From f68a3a321ae65c385124cddc4b58e627927916ac Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Mon, 25 Dec 2023 19:25:43 +0100 Subject: [PATCH] Modifications to dark mode --- lib/SvelteUi/app/dist/index.css | 2 +- lib/SvelteUi/app/dist/index.js | 22 +++++------ lib/SvelteUi/app/src/app.postcss | 33 ++++++++++++----- lib/SvelteUi/app/src/lib/AmpPlot.svelte | 2 +- .../app/src/lib/ConfigurationPanel.svelte | 6 +-- lib/SvelteUi/app/src/lib/DayPlot.svelte | 6 ++- lib/SvelteUi/app/src/lib/Header.svelte | 2 +- lib/SvelteUi/app/src/lib/Helpers.js | 37 +++++++++++++------ lib/SvelteUi/app/src/lib/Mask.svelte | 2 +- lib/SvelteUi/app/src/lib/MonthPlot.svelte | 6 ++- lib/SvelteUi/app/src/lib/PowerGauge.svelte | 2 +- lib/SvelteUi/app/src/lib/PricePlot.svelte | 4 +- lib/SvelteUi/app/src/lib/RealtimePlot.svelte | 6 ++- lib/SvelteUi/app/src/lib/StatusPage.svelte | 2 +- .../app/src/lib/TariffPeakChart.svelte | 4 +- .../app/src/lib/TemperaturePlot.svelte | 4 +- lib/SvelteUi/app/src/lib/VoltPlot.svelte | 2 +- lib/SvelteUi/app/vite.config.js | 33 +++++++++-------- 18 files changed, 108 insertions(+), 67 deletions(-) diff --git a/lib/SvelteUi/app/dist/index.css b/lib/SvelteUi/app/dist/index.css index 38f42072..a3ad3762 100644 --- a/lib/SvelteUi/app/dist/index.css +++ b/lib/SvelteUi/app/dist/index.css @@ -1 +1 @@ -/*! 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-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.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-bold{font-weight:700}.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)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-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;padding:.5rem}:is(.dark .cnt){--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);--tw-shadow-color:#111827;--tw-shadow:var(--tw-shadow-colored);--tw-drop-shadow:drop-shadow(0 4px 3px rgba(0,0,0,.07)) drop-shadow(0 2px 2px rgba(0,0,0,.06));background-color:rgb(31 41 55/var(--tw-bg-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.cnt{min-height:268px}.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{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));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;display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}:is(.dark .in-pre){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity))}.in-post{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-right-radius:.375rem;border-width:1px 1px 1px 0;display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}:is(.dark .in-post){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity));border-color:rgb(31 41 55/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);border-color:rgb(209 213 219/var(--tw-border-opacity));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;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-txt){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-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);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-txt:focus){--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(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-txt:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/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));cursor:not-allowed}:is(.dark .in-f){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-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);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-f:focus){--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(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-f:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-f:default{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.in-f:disabled{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .in-f)::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-f)::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-f:default){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-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;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-m){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-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);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-m:focus){--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(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-m:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/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;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-l){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-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);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-l:focus){--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(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-l:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}:is(.dark .in-l)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-opacity))}:is(.dark .in-l)::placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-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;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-s){--tw-border-opacity:1;--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);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-s:focus){--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(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-s:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-s::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.in-s::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-s){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-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}.bd-on{background-color:rgb(34 197 94/var(--tw-bg-opacity));color:rgb(220 252 231/var(--tw-text-opacity))}.bd-off,.bd-on{--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:.25rem;margin-top:auto;padding:.125rem .25rem}.bd-off{background-color:rgb(107 114 128/var(--tw-bg-opacity));color:rgb(243 244 246/var(--tw-text-opacity))}.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}:is(.dark .pl-unt){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.pl-sub{font-size:1rem;padding-top:10px}.pl-snt{color:gray;font-size:.7rem}:is(.dark .pl-snt){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.pl-lab{font-size:1rem}.chart{height:100%;margin:0 auto;width:100%}svg{position:relative;width:100%}.tick{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity));font-family:Helvetica,Arial;font-size:.85em;font-weight:200}:is(.dark .tick){fill:#fff}.tick line{stroke:#e2e2e2;stroke-dasharray:2}.tick text{fill:#999;text-anchor:start}:is(.dark .tick text){fill:#fff}.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))}:is(.dark .dark\:bg-gray-600){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-900){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/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-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.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-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity:.5}.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}.py-1{padding-bottom:.25rem;padding-top:.25rem}.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-bold{font-weight:700}.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-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)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hdr{--tw-bg-opacity:1;background-color:rgb(124 58 237/var(--tw-bg-opacity));border-radius:.375rem;margin-left:.5rem;margin-right:.5rem;padding:.25rem}:is(.dark .hdr){--tw-bg-opacity:1;background-color:rgb(76 29 149/var(--tw-bg-opacity))}.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;padding:.5rem}:is(.dark .cnt){--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow-color:#111827;--tw-shadow:var(--tw-shadow-colored);--tw-drop-shadow:drop-shadow(0 4px 3px rgba(0,0,0,.07)) drop-shadow(0 2px 2px rgba(0,0,0,.06));background-color:rgb(31 41 55/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.cnt{min-height:268px}.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{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));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;display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}:is(.dark .in-pre){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity))}.in-post{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-right-radius:.375rem;border-width:1px 1px 1px 0;display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}:is(.dark .in-post){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity));border-color:rgb(31 41 55/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);border-color:rgb(209 213 219/var(--tw-border-opacity));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;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-txt){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-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);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-txt:focus){--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(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-txt:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/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));cursor:not-allowed}:is(.dark .in-f){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-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);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-f:focus){--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(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-f:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-f:default{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.in-f:disabled{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .in-f)::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-f)::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-f:default){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-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;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-m){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-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);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-m:focus){--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(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-m:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/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;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-l){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-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);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-l:focus){--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(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-l:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}:is(.dark .in-l)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-opacity))}:is(.dark .in-l)::placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-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;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-s){--tw-border-opacity:1;--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);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-s:focus){--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(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-s:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-s::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.in-s::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-s){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.tr{text-align:right}.bd-green{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(220 252 231/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}:is(.dark .bd-green){--tw-bg-opacity:1;background-color:rgb(22 163 74/var(--tw-bg-opacity))}.bd-yellow{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(234 179 8/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(254 249 195/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}:is(.dark .bd-yellow){--tw-bg-opacity:1;background-color:rgb(202 138 4/var(--tw-bg-opacity))}.bd-red{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(254 226 226/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}:is(.dark .bd-red){--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity))}.bd-blue{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(219 234 254/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}:is(.dark .bd-blue){--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-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}:is(.dark .bd-gray){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity))}.bd-on{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(220 252 231/var(--tw-text-opacity));font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.25rem;margin-top:auto;padding:.125rem .25rem}:is(.dark .bd-on){--tw-bg-opacity:1;background-color:rgb(22 163 74/var(--tw-bg-opacity))}.bd-off{--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:.25rem;margin-top:auto;padding:.125rem .25rem}:is(.dark .bd-off){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity))}.btn-pri{--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;padding:.5rem 1rem}:is(.dark .btn-pri){--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity))}.btn-red{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));margin-left:.5rem;padding:.5rem 1rem}:is(.dark .btn-red){--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity))}.btn-yellow{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(234 179 8/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));margin-left:.5rem;padding:.5rem 1rem}:is(.dark .btn-yellow){--tw-bg-opacity:1;background-color:rgb(202 138 4/var(--tw-bg-opacity))}.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));font-size:.75rem;line-height:1rem;margin-right:.75rem;padding:.25rem .5rem}:is(.dark .btn-pri-sm){--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity))}.btn-yellow-sm{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(234 179 8/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));font-size:.75rem;line-height:1rem;margin-right:.75rem;padding:.25rem .5rem}:is(.dark .btn-yellow-sm){--tw-bg-opacity:1;background-color:rgb(202 138 4/var(--tw-bg-opacity))}.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}:is(.dark .pl-unt){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.pl-sub{font-size:1rem;padding-top:10px}.pl-snt{color:gray;font-size:.7rem}:is(.dark .pl-snt){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.pl-lab{font-size:1rem}.chart{height:100%;margin:0 auto;width:100%}svg{position:relative;width:100%}.tick{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity));font-family:Helvetica,Arial;font-size:.85em;font-weight:200}:is(.dark .tick){fill:#fff}.tick line{stroke:#e2e2e2;stroke-dasharray:2}.tick text{fill:#999;text-anchor:start}:is(.dark .tick text){fill:#fff}.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))}:is(.dark .dark\:bg-gray-600){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-900){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}:is(.dark .dark\:bg-opacity-80){--tw-bg-opacity:.8}:is(.dark .dark\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/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 f8ad0ee7..425e0d55 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 pe(){}function ol(t,e){for(const l in e)t[l]=e[l];return t}function oc(t){return t()}function pa(){return Object.create(null)}function ze(t){t.forEach(oc)}function so(t){return typeof t=="function"}function Ee(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let rs;function Ws(t,e){return rs||(rs=document.createElement("a")),rs.href=e,t===rs.href}function s1(t){return Object.keys(t).length===0}function oo(t,...e){if(t==null)return pe;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function li(t){let e;return oo(t,l=>e=l)(),e}function pl(t,e,l){t.$$.on_destroy.push(oo(e,l))}function ro(t,e,l,n){if(t){const i=rc(t,e,l,n);return t[0](i)}}function rc(t,e,l,n){return t[1]&&n?ol(l.ctx.slice(),t[1](n(e))):l.ctx}function ao(t,e,l,n){if(t[2]&&n){const i=t[2](n(l));if(e.dirty===void 0)return i;if(typeof i=="object"){const o=[],u=Math.max(e.dirty.length,i.length);for(let a=0;a32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function wi(t){return function(e){return e.preventDefault(),t.call(this,e)}}function r(t,e,l){l==null?t.removeAttribute(e):t.getAttribute(e)!==l&&t.setAttribute(e,l)}const r1=["width","height"];function ni(t,e){const l=Object.getOwnPropertyDescriptors(t.__proto__);for(const n in e)e[n]==null?t.removeAttribute(n):n==="style"?t.style.cssText=e[n]:n==="__value"?t.value=t[n]=e[n]:l[n]&&l[n].set&&r1.indexOf(n)===-1?t[n]=e[n]:r(t,n,e[n])}function ge(t){return t===""?null:+t}function a1(t){return Array.from(t.childNodes)}function J(t,e){e=""+e,t.data!==e&&(t.data=e)}function u1(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function f1(t,e,l){~o1.indexOf(l)?u1(t,e):J(t,e)}function oe(t,e){t.value=e==null?"":e}function co(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function $e(t,e,l){for(let n=0;n{u.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=te(n.contentWindow,"resize",e),e()}),s(t,n),()=>{(i||o&&n.contentWindow)&&o(),$(n)}}function m1(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,l,n,e),i}function da(t,e){return new t(e)}let ki;function bi(t){ki=t}function yi(){if(!ki)throw new Error("Function called outside component initialization");return ki}function ac(t){yi().$$.on_mount.push(t)}function _1(t){yi().$$.on_destroy.push(t)}function p1(){const t=yi();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=m1(e,l,{cancelable:n});return i.slice().forEach(u=>{u.call(t,o)}),!o.defaultPrevented}return!0}}function gi(t,e){return yi().$$.context.set(t,e),e}function Ul(t){return yi().$$.context.get(t)}const xn=[],ps=[];let ei=[];const va=[],uc=Promise.resolve();let zs=!1;function fc(){zs||(zs=!0,uc.then(cc))}function d1(){return fc(),uc}function We(t){ei.push(t)}const Fs=new Set;let Zn=0;function cc(){if(Zn!==0)return;const t=ki;do{try{for(;Znt.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),ei=e}const cs=new Set;let sn;function Ae(){sn={r:0,c:[],p:sn}}function Pe(){sn.r||ze(sn.c),sn=sn.p}function O(t,e){t&&t.i&&(cs.delete(t),t.i(e))}function q(t,e,l,n){if(t&&t.o){if(cs.has(t))return;cs.add(t),sn.c.push(()=>{cs.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function mc(t,e){const l={},n={},i={$$scope:1};let o=t.length;for(;o--;){const u=t[o],a=e[o];if(a){for(const 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 ha(t){return typeof t=="object"&&t!==null?t:{}}function re(t){t&&t.c()}function ie(t,e,l,n){const{fragment:i,after_update:o}=t.$$;i&&i.m(e,l),n||We(()=>{const u=t.$$.on_mount.map(oc).filter(so);t.$$.on_destroy?t.$$.on_destroy.push(...u):ze(u),t.$$.on_mount=[]}),o.forEach(We)}function se(t,e){const l=t.$$;l.fragment!==null&&(h1(l.after_update),ze(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function b1(t,e){t.$$.dirty[0]===-1&&(xn.push(t),fc(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const d=v.length?v[0]:b;return f.ctx&&i(f.ctx[p],f.ctx[p]=d)&&(!f.skip_bound&&f.bound[p]&&f.bound[p](d),_&&b1(t,p)),b}):[],f.update(),_=!0,ze(f.before_update),f.fragment=n?n(f.ctx):!1,e.target){if(e.hydrate){const p=a1(e.target);f.fragment&&f.fragment.l(p),p.forEach($)}else f.fragment&&f.fragment.c();e.intro&&O(t.$$.fragment),ie(t,e.target,e.anchor,e.customElement),cc()}bi(c)}class Ie{$destroy(){se(this,1),this.$destroy=pe}$on(e,l){if(!so(l))return pe;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(l),()=>{const i=n.indexOf(l);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!s1(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const ba=t=>typeof t>"u",_c=t=>typeof t=="function",pc=t=>typeof t=="number";function g1(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function dc(){let t=0;return()=>t++}function k1(){return Math.random().toString(36).substring(2)}const jl=typeof window>"u";function vc(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const hc=(t,e)=>t?{}:{style:e},Gs=t=>({"aria-hidden":"true",...hc(t,"display:none;")}),Jn=[];function bc(t,e){return{subscribe:it(t,e).subscribe}}function it(t,e=pe){let l;const n=new Set;function i(a){if(Ee(t,a)&&(t=a,l)){const c=!Jn.length;for(const f of n)f[1](),Jn.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 w1(t,e,l){const n=!Array.isArray(t),i=n?[t]:t,o=e.length<2;return bc(l,u=>{let a=!1;const c=[];let f=0,_=pe;const p=()=>{if(f)return;_();const v=e(n?c[0]:c,u);o?u(v):_=so(v)?v:pe},b=i.map((v,d)=>oo(v,g=>{c[d]=g,f&=~(1<{f|=1<`@@svnav-ctx__${t}`,Vs=Ci("LOCATION"),ii=Ci("ROUTER"),gc=Ci("ROUTE"),y1=Ci("ROUTE_PARAMS"),C1=Ci("FOCUS_ELEM"),kc=/^:(.+)/,di=(t,e,l)=>t.substr(e,l),Ks=(t,e)=>di(t,0,e.length)===e,$1=t=>t==="",S1=t=>kc.test(t),wc=t=>t[0]==="*",M1=t=>t.replace(/\*.*$/,""),yc=t=>t.replace(/(^\/+|\/+$)/g,"");function vl(t,e=!1){const l=yc(t).split("/");return e?l.filter(Boolean):l}const qs=(t,e)=>t+(e?`?${e}`:""),_o=t=>`/${yc(t)}`;function $i(...t){const e=n=>vl(n,!0).join("/"),l=t.map(e).join("/");return _o(l)}const po=1,bs=2,cn=3,T1=4,Cc=5,N1=6,$c=7,E1=8,A1=9,Sc=10,Mc=11,P1={[po]:"Link",[bs]:"Route",[cn]:"Router",[T1]:"useFocus",[Cc]:"useLocation",[N1]:"useMatch",[$c]:"useNavigate",[E1]:"useParams",[A1]:"useResolvable",[Sc]:"useResolve",[Mc]:"navigate"},vo=t=>P1[t];function D1(t,e){let l;return t===bs?l=e.path?`path="${e.path}"`:"default":t===po?l=`to="${e.to}"`:t===cn&&(l=`basepath="${e.basepath||""}"`),`<${vo(t)} ${l||""} />`}function R1(t,e,l,n){const i=l&&D1(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 pe(){}function ol(t,e){for(const l in e)t[l]=e[l];return t}function oc(t){return t()}function pa(){return Object.create(null)}function ze(t){t.forEach(oc)}function so(t){return typeof t=="function"}function Ee(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let rs;function Ws(t,e){return rs||(rs=document.createElement("a")),rs.href=e,t===rs.href}function s1(t){return Object.keys(t).length===0}function oo(t,...e){if(t==null)return pe;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function li(t){let e;return oo(t,l=>e=l)(),e}function pl(t,e,l){t.$$.on_destroy.push(oo(e,l))}function ro(t,e,l,n){if(t){const i=rc(t,e,l,n);return t[0](i)}}function rc(t,e,l,n){return t[1]&&n?ol(l.ctx.slice(),t[1](n(e))):l.ctx}function ao(t,e,l,n){if(t[2]&&n){const i=t[2](n(l));if(e.dirty===void 0)return i;if(typeof i=="object"){const o=[],u=Math.max(e.dirty.length,i.length);for(let a=0;a32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function wi(t){return function(e){return e.preventDefault(),t.call(this,e)}}function r(t,e,l){l==null?t.removeAttribute(e):t.getAttribute(e)!==l&&t.setAttribute(e,l)}const r1=["width","height"];function ni(t,e){const l=Object.getOwnPropertyDescriptors(t.__proto__);for(const n in e)e[n]==null?t.removeAttribute(n):n==="style"?t.style.cssText=e[n]:n==="__value"?t.value=t[n]=e[n]:l[n]&&l[n].set&&r1.indexOf(n)===-1?t[n]=e[n]:r(t,n,e[n])}function ge(t){return t===""?null:+t}function a1(t){return Array.from(t.childNodes)}function J(t,e){e=""+e,t.data!==e&&(t.data=e)}function u1(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function f1(t,e,l){~o1.indexOf(l)?u1(t,e):J(t,e)}function oe(t,e){t.value=e==null?"":e}function co(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function $e(t,e,l){for(let n=0;n{u.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=te(n.contentWindow,"resize",e),e()}),s(t,n),()=>{(i||o&&n.contentWindow)&&o(),$(n)}}function m1(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,l,n,e),i}function da(t,e){return new t(e)}let ki;function bi(t){ki=t}function yi(){if(!ki)throw new Error("Function called outside component initialization");return ki}function ac(t){yi().$$.on_mount.push(t)}function _1(t){yi().$$.on_destroy.push(t)}function p1(){const t=yi();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=m1(e,l,{cancelable:n});return i.slice().forEach(u=>{u.call(t,o)}),!o.defaultPrevented}return!0}}function gi(t,e){return yi().$$.context.set(t,e),e}function Ul(t){return yi().$$.context.get(t)}const xn=[],ps=[];let ei=[];const va=[],uc=Promise.resolve();let zs=!1;function fc(){zs||(zs=!0,uc.then(cc))}function d1(){return fc(),uc}function We(t){ei.push(t)}const Fs=new Set;let Zn=0;function cc(){if(Zn!==0)return;const t=ki;do{try{for(;Znt.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),ei=e}const cs=new Set;let sn;function Ae(){sn={r:0,c:[],p:sn}}function Pe(){sn.r||ze(sn.c),sn=sn.p}function I(t,e){t&&t.i&&(cs.delete(t),t.i(e))}function q(t,e,l,n){if(t&&t.o){if(cs.has(t))return;cs.add(t),sn.c.push(()=>{cs.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function mc(t,e){const l={},n={},i={$$scope:1};let o=t.length;for(;o--;){const u=t[o],a=e[o];if(a){for(const m in u)m in a||(n[m]=1);for(const m in a)i[m]||(l[m]=a[m],i[m]=1);t[o]=a}else for(const m in u)i[m]=1}for(const u in n)u in l||(l[u]=void 0);return l}function ha(t){return typeof t=="object"&&t!==null?t:{}}function re(t){t&&t.c()}function ie(t,e,l,n){const{fragment:i,after_update:o}=t.$$;i&&i.m(e,l),n||We(()=>{const u=t.$$.on_mount.map(oc).filter(so);t.$$.on_destroy?t.$$.on_destroy.push(...u):ze(u),t.$$.on_mount=[]}),o.forEach(We)}function se(t,e){const l=t.$$;l.fragment!==null&&(h1(l.after_update),ze(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function b1(t,e){t.$$.dirty[0]===-1&&(xn.push(t),fc(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const d=v.length?v[0]:h;return f.ctx&&i(f.ctx[_],f.ctx[_]=d)&&(!f.skip_bound&&f.bound[_]&&f.bound[_](d),p&&b1(t,_)),h}):[],f.update(),p=!0,ze(f.before_update),f.fragment=n?n(f.ctx):!1,e.target){if(e.hydrate){const _=a1(e.target);f.fragment&&f.fragment.l(_),_.forEach($)}else f.fragment&&f.fragment.c();e.intro&&I(t.$$.fragment),ie(t,e.target,e.anchor,e.customElement),cc()}bi(m)}class Re{$destroy(){se(this,1),this.$destroy=pe}$on(e,l){if(!so(l))return pe;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(l),()=>{const i=n.indexOf(l);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!s1(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const ba=t=>typeof t>"u",_c=t=>typeof t=="function",pc=t=>typeof t=="number";function g1(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function dc(){let t=0;return()=>t++}function k1(){return Math.random().toString(36).substring(2)}const jl=typeof window>"u";function vc(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const hc=(t,e)=>t?{}:{style:e},Gs=t=>({"aria-hidden":"true",...hc(t,"display:none;")}),Jn=[];function bc(t,e){return{subscribe:it(t,e).subscribe}}function it(t,e=pe){let l;const n=new Set;function i(a){if(Ee(t,a)&&(t=a,l)){const m=!Jn.length;for(const f of n)f[1](),Jn.push(f,t);if(m){for(let f=0;f{n.delete(f),n.size===0&&l&&(l(),l=null)}}return{set:i,update:o,subscribe:u}}function w1(t,e,l){const n=!Array.isArray(t),i=n?[t]:t,o=e.length<2;return bc(l,u=>{let a=!1;const m=[];let f=0,p=pe;const _=()=>{if(f)return;p();const v=e(n?m[0]:m,u);o?u(v):p=so(v)?v:pe},h=i.map((v,d)=>oo(v,g=>{m[d]=g,f&=~(1<{f|=1<`@@svnav-ctx__${t}`,Vs=Ci("LOCATION"),ii=Ci("ROUTER"),gc=Ci("ROUTE"),y1=Ci("ROUTE_PARAMS"),C1=Ci("FOCUS_ELEM"),kc=/^:(.+)/,di=(t,e,l)=>t.substr(e,l),Ks=(t,e)=>di(t,0,e.length)===e,$1=t=>t==="",S1=t=>kc.test(t),wc=t=>t[0]==="*",M1=t=>t.replace(/\*.*$/,""),yc=t=>t.replace(/(^\/+|\/+$)/g,"");function vl(t,e=!1){const l=yc(t).split("/");return e?l.filter(Boolean):l}const qs=(t,e)=>t+(e?`?${e}`:""),_o=t=>`/${yc(t)}`;function $i(...t){const e=n=>vl(n,!0).join("/"),l=t.map(e).join("/");return _o(l)}const po=1,bs=2,cn=3,T1=4,Cc=5,N1=6,$c=7,E1=8,A1=9,Sc=10,Mc=11,P1={[po]:"Link",[bs]:"Route",[cn]:"Router",[T1]:"useFocus",[Cc]:"useLocation",[N1]:"useMatch",[$c]:"useNavigate",[E1]:"useParams",[A1]:"useResolvable",[Sc]:"useResolve",[Mc]:"navigate"},vo=t=>P1[t];function D1(t,e){let l;return t===bs?l=e.path?`path="${e.path}"`:"default":t===po?l=`to="${e.to}"`:t===cn&&(l=`basepath="${e.basepath||""}"`),`<${vo(t)} ${l||""} />`}function L1(t,e,l,n){const i=l&&D1(n||t,l),o=i?` -Occurred in: ${i}`:"",u=vo(t),a=_c(e)?e(u):e;return`<${u}> ${a}${o}`}const Tc=t=>(...e)=>t(R1(...e)),Nc=Tc(t=>{throw new Error(t)}),ds=Tc(console.warn),ga=4,I1=3,L1=2,O1=1,F1=1;function q1(t,e){const l=t.default?0:vl(t.fullPath).reduce((n,i)=>{let o=n;return o+=ga,$1(i)?o+=F1:S1(i)?o+=L1:wc(i)?o-=ga+O1:o+=I1,o},0);return{route:t,score:l,index:e}}function B1(t){return t.map(q1).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function Ec(t,e){let l,n;const[i]=e.split("?"),o=vl(i),u=o[0]==="",a=B1(t);for(let c=0,f=a.length;c({..._,params:b,uri:T});if(_.default){n=v(e);continue}const d=vl(_.fullPath),g=Math.max(o.length,d.length);let w=0;for(;w{f===".."?c.pop():f!=="."&&c.push(f)}),qs(`/${c.join("/")}`,n)}function ka(t,e){const{pathname:l,hash:n="",search:i="",state:o}=t,u=vl(e,!0),a=vl(l,!0);for(;u.length;)u[0]!==a[0]&&Nc(cn,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),u.shift(),a.shift();return{pathname:$i(...a),hash:n,search:i,state:o}}const wa=t=>t.length===1?"":t,ho=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,o=i?wa(di(t,l)):"",u=i?di(t,0,l):t,a=n?wa(di(u,e)):"";return{pathname:(n?di(u,0,e):u)||"/",search:a,hash:o}},j1=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function H1(t,e,l){return $i(l,U1(t,e))}function W1(t,e){const l=_o(M1(t)),n=vl(l,!0),i=vl(e,!0).slice(0,n.length),o=Ac({fullPath:l},$i(...i));return o&&o.uri}const Bs="POP",z1="PUSH",G1="REPLACE";function Us(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function V1(t){let e=[],l=Us(t),n=Bs;const i=(o=e)=>o.forEach(u=>u({location:l,action:n}));return{get location(){return l},listen(o){e.push(o);const u=()=>{l=Us(t),n=Bs,i([o])};i([o]);const a=vc(t,"popstate",u);return()=>{a(),e=e.filter(c=>c!==o)}},navigate(o,u){const{state:a={},replace:c=!1}=u||{};if(n=c?G1:z1,pc(o))u&&ds(Mc,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=Bs,t.history.go(o);else{const f={...a,_key:k1()};try{t.history[c?"replaceState":"pushState"](f,"",o)}catch{t.location[c?"replace":"assign"](o)}}l=Us(t),i()}}}function js(t,e){return{...ho(e),state:t}}function K1(t="/"){let e=0,l=[js(null,t)];return{get entries(){return l},get location(){return l[e]},addEventListener(){},removeEventListener(){},history:{get state(){return l[e].state},pushState(n,i,o){e++,l=l.slice(0,e),l.push(js(n,o))},replaceState(n,i,o){l[e]=js(n,o)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const Y1=!!(!jl&&window.document&&window.document.createElement),Q1=!jl&&window.location.origin==="null",Pc=V1(Y1&&!Q1?window:K1()),{navigate:fn}=Pc;let Sl=null,Dc=!0;function X1(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nSl.level||t.level===Sl.level&&X1(t.routerId,Sl.routerId))&&(Sl=t)}function J1(){Sl=null}function x1(){Dc=!1}function ya(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=vc(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function e0(t,e){return Number(t.dataset.svnavRouteEnd)===e}function t0(t){return/^H[1-6]$/i.test(t.tagName)}function Ca(t,e=document){return e.querySelector(t)}function l0(t){let l=Ca(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!e0(l,t);){if(t0(l))return l;const n=Ca("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function n0(t){Promise.resolve(li(t.focusElement)).then(e=>{const l=e||l0(t.id);l||ds(cn,`Could not find an element to focus. You should always render a header for accessibility reasons, or set a custom focus element via the "useFocus" hook. If you don't want this Route or Router to manage focus, pass "primary={false}" to it.`,t,bs),!ya(l)&&ya(document.documentElement)})}const i0=(t,e,l)=>(n,i)=>d1().then(()=>{if(!Sl||Dc){x1();return}if(n&&n0(Sl.route),t.announcements&&i){const{path:o,fullPath:u,meta:a,params:c,uri:f}=Sl.route,_=t.createAnnouncement({path:o,fullPath:u,meta:a,params:c,uri:f},li(l));Promise.resolve(_).then(p=>{e.set(p)})}J1()}),s0="position:fixed;top:-1px;left:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;";function o0(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},hc(t[6],s0)],i={};for(let o=0;o`Navigated to ${ee.uri}`,announcements:!0,...d},T=_,M=_o(_),P=Ul(Vs),L=Ul(ii),I=!P,F=a0(),C=v&&!(L&&!L.manageFocus),R=it("");pl(t,R,ee=>l(0,a=ee));const ne=L?L.disableInlineStyles:g,H=it([]);pl(t,H,ee=>l(20,u=ee));const z=it(null);pl(t,z,ee=>l(18,i=ee));let U=!1;const K=I?0:L.level+1,G=I?it((()=>ka(jl?ho(p):b.location,M))()):P;pl(t,G,ee=>l(17,n=ee));const X=it(n);pl(t,X,ee=>l(19,o=ee));const Y=i0(w,R,G),j=ee=>V=>V.filter(W=>W.id!==ee);function x(ee){if(jl){if(U)return;const V=Ac(ee,n.pathname);if(V)return U=!0,V}else H.update(V=>{const W=j(ee.id)(V);return W.push(ee),W})}function ae(ee){H.update(j(ee))}return!I&&_!==$a&&ds(cn,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:_}),I&&(ac(()=>b.listen(V=>{const W=ka(V.location,M);X.set(n),G.set(W)})),gi(Vs,G)),gi(ii,{activeRoute:z,registerRoute:x,unregisterRoute:ae,manageFocus:C,level:K,id:F,history:I?b:L.history,basepath:I?M:L.basepath,disableInlineStyles:ne}),t.$$set=ee=>{"basepath"in ee&&l(11,_=ee.basepath),"url"in ee&&l(12,p=ee.url),"history"in ee&&l(13,b=ee.history),"primary"in ee&&l(14,v=ee.primary),"a11y"in ee&&l(15,d=ee.a11y),"disableInlineStyles"in ee&&l(16,g=ee.disableInlineStyles),"$$scope"in ee&&l(21,f=ee.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&_!==T&&ds(cn,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const ee=Ec(u,n.pathname);z.set(ee)}if(t.$$.dirty[0]&655360&&I){const ee=!!n.hash,V=!ee&&C,W=!ee||n.pathname!==o.pathname;Y(V,W)}t.$$.dirty[0]&262144&&C&&i&&i.primary&&Z1({level:K,routerId:F,route:i})},[a,w,I,F,C,R,ne,H,z,G,X,_,p,b,v,d,g,n,i,o,u,f,c]}class f0 extends Ie{constructor(e){super(),Re(this,e,u0,r0,Ee,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const Rc=f0;function Si(t,e,l=ii,n=cn){Ul(l)||Nc(t,o=>`You cannot use ${o} outside of a ${vo(n)}.`,e)}const c0=t=>{const{subscribe:e}=Ul(t);return{subscribe:e}};function Ic(){return Si(Cc),c0(Vs)}function Lc(){const{history:t}=Ul(ii);return t}function Oc(){const t=Ul(gc);return t?w1(t,e=>e.base):it("/")}function Fc(){Si(Sc);const t=Oc(),{basepath:e}=Ul(ii);return n=>H1(n,li(t),e)}function m0(){Si($c);const t=Fc(),{navigate:e}=Lc();return(n,i)=>{const o=pc(n)?n:t(n);return e(o,i)}}const _0=t=>({params:t&16,location:t&8}),Sa=t=>({params:jl?li(t[10]):t[4],location:t[3],navigate:t[11]});function Ma(t){let e,l;return e=new Rc({props:{primary:t[1],$$slots:{default:[v0]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.primary=n[1]),i&528409&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function p0(t){let e;const l=t[18].default,n=ro(l,t,t[19],Sa);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&524312)&&uo(n,l,i,i[19],e?ao(l,i[19],o,_0):fo(i[19]),Sa)},i(i){e||(O(n,i),e=!0)},o(i){q(n,i),e=!1},d(i){n&&n.d(i)}}}function d0(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},jl?li(t[10]):t[4],t[12]];var o=t[0];function u(a){let c={};for(let f=0;f{se(_,1)}),Pe()}o?(e=da(o,u()),re(e.$$.fragment),O(e.$$.fragment,1),ie(e,l.parentNode,l)):e=null}else o&&e.$set(f)},i(a){n||(e&&O(e.$$.fragment,a),n=!0)},o(a){e&&q(e.$$.fragment,a),n=!1},d(a){a&&$(l),e&&se(e,a)}}}function v0(t){let e,l,n,i;const o=[d0,p0],u=[];function a(c,f){return c[0]!==null?0:1}return e=a(t),l=u[e]=o[e](t),{c(){l.c(),n=Ke()},m(c,f){u[e].m(c,f),S(c,n,f),i=!0},p(c,f){let _=e;e=a(c),e===_?u[e].p(c,f):(Ae(),q(u[_],1,1,()=>{u[_]=null}),Pe(),l=u[e],l?l.p(c,f):(l=u[e]=o[e](c),l.c()),O(l,1),l.m(n.parentNode,n))},i(c){i||(O(l),i=!0)},o(c){q(l),i=!1},d(c){u[e].d(c),c&&$(n)}}}function h0(t){let e,l,n,i,o,u=[Gs(t[7]),{"data-svnav-route-start":t[5]}],a={};for(let p=0;p{c=null}),Pe())},i(p){o||(O(c),o=!0)},o(p){q(c),o=!1},d(p){p&&$(e),p&&$(l),c&&c.d(p),p&&$(n),p&&$(i)}}}const b0=dc();function g0(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:g=!0}=e;Si(bs,e);const w=b0(),{registerRoute:T,unregisterRoute:M,activeRoute:P,disableInlineStyles:L}=Ul(ii);pl(t,P,U=>l(16,u=U));const I=Oc();pl(t,I,U=>l(17,c=U));const F=Ic();pl(t,F,U=>l(3,a=U));const C=it(null);let R;const ne=it(),H=it({});pl(t,H,U=>l(4,f=U)),gi(gc,ne),gi(y1,H),gi(C1,C);const z=m0();return jl||_1(()=>M(w)),t.$$set=U=>{l(24,e=ol(ol({},e),ms(U))),l(12,o=_s(e,i)),"path"in U&&l(13,b=U.path),"component"in U&&l(0,v=U.component),"meta"in U&&l(14,d=U.meta),"primary"in U&&l(1,g=U.primary),"$$scope"in U&&l(19,p=U.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const U=b==="",K=$i(c,b),Q={id:w,path:b,meta:d,default:U,fullPath:U?"":K,base:U?c:W1(K,a.pathname),primary:g,focusElement:C};ne.set(Q),l(15,R=T(Q))}if(t.$$.dirty&98304&&l(2,n=!!(R||u&&u.id===w)),t.$$.dirty&98308&&n){const{params:U}=R||u;H.set(U)}},e=ms(e),[v,g,n,a,f,w,P,L,I,F,H,z,o,b,d,R,u,c,_,p]}class k0 extends Ie{constructor(e){super(),Re(this,e,g0,h0,Ee,{path:13,component:0,meta:14,primary:1})}}const ml=k0;function w0(t){let e,l,n,i;const o=t[13].default,u=ro(o,t,t[12],null);let a=[{href:t[0]},t[2],t[1]],c={};for(let f=0;fl(11,p=C));const P=p1(),L=Fc(),{navigate:I}=Lc();function F(C){P("click",C),g1(C)&&(C.preventDefault(),I(n,{state:w,replace:u||g}))}return t.$$set=C=>{l(19,e=ol(ol({},e),ms(C))),l(18,_=_s(e,f)),"to"in C&&l(5,d=C.to),"replace"in C&&l(6,g=C.replace),"state"in C&&l(7,w=C.state),"getProps"in C&&l(8,T=C.getProps),"$$scope"in C&&l(12,v=C.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=L(d,p)),t.$$.dirty&2049&&l(10,i=Ks(p.pathname,n)),t.$$.dirty&2049&&l(9,o=n===p.pathname),t.$$.dirty&2049&&(u=ho(n)===j1(p)),t.$$.dirty&512&&l(2,a=o?{"aria-current":"page"}:{}),l(1,c=(()=>{if(_c(T)){const C=T({location:p,href:n,isPartiallyCurrent:i,isCurrent:o});return{..._,...C}}return _})())},e=ms(e),[n,c,a,M,F,d,g,w,T,o,i,p,v,b]}class C0 extends Ie{constructor(e){super(),Re(this,e,y0,w0,Ee,{to:5,replace:6,state:7,getProps:8})}}const Qt=C0;let Ys=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Bl(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function $0(t){return t>218&&t<242?"#32d900":t>212&&t<248?"#b1d900":t>208&&t<252?"#ffb800":"#d90000"}function qc(t){let e;return t>90?e="#d90000":t>85?e="#e32100":t>80?e="#ffb800":t>75?e="#dcd800":e="#32d900",e}function S0(t){return t>75?"#32d900":t>50?"#77d900":t>25?"#94d900":"#dcd800"}function vs(t){switch(t){case 1:return"Aidon";case 2:return"Kaifa";case 3:return"Kamstrup";case 8:return"Iskra";case 9:return"Landis+Gyr";case 10:return"Sagemcom";default:return"Unknown"}}function Ue(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function he(t,e){switch(e){case 5:switch(t){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(t){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 241:return"LilyGO T-ETH-POE";case 242:return"M5 PoESP32";case 243:return"WT32-ETH01";case 200:return"Generic ESP32";case 2:return"HAN Reader 2.0 by Max Spencer";case 0:return"Custom hardware by Roar Fredriksen";case 1:return"Kamstrup module by Egil Opsahl";case 8:return"\xB5HAN mosquito by dbeinder";case 3:return"Pow-K (UART0)";case 4:return"Pow-U (UART0)";case 101:return"Wemos D1 mini";case 100:return"Generic ESP8266";case 70:return"Generic ESP32-C3";case 71:return"ESP32-C3-DevKitM-1";case 80:return"Generic ESP32-S3"}}function Ta(t){switch(t){case-1:return"Parse error";case-2:return"Incomplete data received";case-3:return"Payload boundry flag missing";case-4:return"Header checksum error";case-5:return"Footer checksum error";case-9:return"Unknown data received, check meter config";case-41:return"Frame length not equal";case-51:return"Authentication failed";case-52:return"Decryption failed";case-53:return"Encryption key invalid";case 90:return"No HAN data received for at least 30s";case 91:return"Serial break";case 92:return"Serial buffer full";case 93:return"Serial FIFO overflow";case 94:return"Serial frame error";case 95:return"Serial parity error";case 96:return"RX error";case 98:return"Exception in code, debugging necessary";case 99:return"Autodetection failed"}return t<0?"Unspecified error "+t:""}function Na(t){switch(t){case-3:return"Connection failed";case-4:return"Network timeout";case-10:return"Connection denied";case-11:return"Failed to subscribe";case-13:return"Connection lost"}return t<0?"Unspecified error "+t:""}function Ea(t){switch(t){case 400:return"Unrecognized data in request";case 401:case 403:return"Unauthorized, check API key";case 404:return"Price unavailable, not found";case 425:return"Server says its too early";case 429:return"Exceeded API rate limit";case 500:return"Internal server error";case-1:return"Connection error";case-2:return"Incomplete data received";case-3:return"Invalid data, tag missing";case-51:return"Authentication failed";case-52:return"Decryption failed";case-53:return"Encryption key invalid"}return t<0?"Unspecified error "+t:""}function Aa(t){switch(t){case 255:return"Unable to start upgrade";case-1:return"Connection refused";case-2:return"Failed to send headers";case-3:return"Failed to send payload";case-4:return"Not connected";case-5:return"Connection lost";case-6:return"No stream";case-7:return"Not a HTTP server";case-8:return"Not enough memory";case-9:return"Encoding error";case-10:return"Stream write";case-11:return"Read timeout"}return"Unknown "+t}function ti(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Xe(t,e){return t==1||t==2&&e}function It(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function ke(t,e){return isNaN(t)?"-":(isNaN(e)&&(e=t<10?1:0),t.toFixed(e))}function dl(t,e){return t.setTime(t.getTime()+e*36e5),t}function Pa(t){if(t.chip=="esp8266")switch(t.boot_reason){case 0:return"Normal";case 1:return"WDT reset";case 2:return"Exception reset";case 3:return"Soft WDT reset";case 4:return"Software restart";case 5:return"Deep sleep";case 6:return"External reset";default:return"Unknown (8266)"}else switch(t.boot_reason){case 1:return"Vbat power on reset";case 3:return"Software reset";case 4:return"WDT reset";case 5:return"Deep sleep";case 6:return"SLC reset";case 7:return"Timer Group0 WDT reset";case 8:return"Timer Group1 WDT reset";case 9:return"RTC WDT reset";case 10:return"Instrusion test reset CPU";case 11:return"Time Group reset CPU";case 12:return"Software reset CPU";case 13:return"RTC WTD reset CPU";case 14:return"PRO CPU";case 15:return"Brownout";case 16:return"RTC reset";default:return"Unknown"}}function Da(t){return t=="EOE"?"ENTSO-E":t=="HKS"?"hvakosterstrommen.no":t=="EDS"?"Energi Data Service":t=="MIX"?"Mixed sources":"Unknown ("+t+")"}function Ra(t){return t=="EOE"?"https://transparency.entsoe.eu/-E":t=="HKS"?"https://www.hvakosterstrommen.no/":t=="EDS"?"https://www.energidataservice.dk/":"#"}async function Ml(t,e={}){const{timeout:l=8e3}=e,n=new AbortController,i=setTimeout(()=>n.abort(),l),o=await fetch(t,{...e,signal:n.signal});return clearTimeout(i),o}let _l={version:"",chip:"",mac:null,apmac:null,vndcfg:null,usrcfg:null,fwconsent:null,booting:!1,upgrading:!1,ui:{},security:0,boot_reason:0,upgrade:{x:-1,e:0,f:null,t:null},trying:null,if:{eth:!1}};const Wt=it(_l);async function bo(){_l=await(await Ml("/sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),Wt.set(_l)}let us=0,Ia=-127,La=null,M0={};const Bc=bc(M0,t=>{let e;async function l(){Ml("/data.json").then(n=>n.json()).then(n=>{t(n),Ia!=n.t&&(Ia=n.t,setTimeout(zc,2e3)),La==null&&n.pe&&n.p!=null&&(La=n.p,jc()),_l.upgrading?window.location.reload():(!_l||!_l.chip||_l.booting||us>1&&!ti(_l.board))&&(bo(),on&&clearTimeout(on),on=setTimeout(ko,2e3),rn&&clearTimeout(rn),rn=setTimeout(wo,3e3));let i=5e3;if(ti(_l.board)&&n.v>2.5){let o=3.3-Math.min(3.3,n.v);o>0&&(i=Math.max(o,.1)*10*5e3)}i>5e3&&console.log("Scheduling next data fetch in "+i+"ms"),e&&clearTimeout(e),e=setTimeout(l,i),us=0}).catch(n=>{us++,us>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(l,15e3)):e=setTimeout(l,ti(_l.board)?1e4:5e3)})}return l(),function(){clearTimeout(e)}});let Qs={},vi;const go=it(Qs);async function Uc(){let t=!1;if(go.update(e=>{for(var l=0;l<36;l++){if(e[Ue(l)]==null){t=l<12;break}e[Ue(l)]=e[Ue(l+1)]}return e}),t)jc();else{let e=new Date;vi=setTimeout(Uc,(60-e.getMinutes())*6e4)}}async function jc(){vi&&(clearTimeout(vi),vi=0),Qs=await(await Ml("/energyprice.json")).json(),go.set(Qs);let e=new Date;vi=setTimeout(Uc,(60-e.getMinutes())*6e4)}let Xs={},on;async function ko(){on&&(clearTimeout(on),on=0),Xs=await(await Ml("/dayplot.json")).json(),Hc.set(Xs);let e=new Date;on=setTimeout(ko,(60-e.getMinutes())*6e4+20)}const Hc=it(Xs,t=>(ko(),function(){}));let Zs={},rn;async function wo(){rn&&(clearTimeout(rn),rn=0),Zs=await(await Ml("/monthplot.json")).json(),Wc.set(Zs);let e=new Date;rn=setTimeout(wo,(24-e.getHours())*36e5+40)}const Wc=it(Zs,t=>(wo(),function(){}));let Js={};async function zc(){Js=await(await Ml("/temperature.json")).json(),Gc.set(Js)}const Gc=it(Js,t=>(zc(),function(){}));let xs={},fs;async function Vc(){fs&&(clearTimeout(fs),fs=0),xs=await(await Ml("/tariff.json")).json(),Kc.set(xs);let e=new Date;fs=setTimeout(Vc,(60-e.getMinutes())*6e4+30)}const Kc=it(xs,t=>function(){});let eo=[];const yo=it(eo);async function T0(){eo=await(await Ml("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),yo.set(eo)}let to={};async function N0(){to=await(await Ml("/realtime.json")).json(),Yc.set(to)}const Yc=it(to,t=>(N0(),function(){}));function hs(t){return"WARNING: "+t+" must be connected to an external power supply during firmware upgrade. Failure to do so may cause power-down during upload resulting in non-functioning unit."}async function Qc(t){await(await fetch("/upgrade?expected_version="+t,{method:"POST"})).json()}function Xc(t,e){if(/^v\d{1,2}\.\d{1,2}\.\d{1,2}$/.test(t)){let l=t.substring(1).split("."),n=parseInt(l[0]),i=parseInt(l[1]),o=parseInt(l[2]),u=[...e];u.reverse();let a,c,f;for(let _=0;_o&&(a=p):g==i+1&&(c=p);else if(d==n+1)if(f){let T=f.tag_name.substring(1).split(".");parseInt(T[0]);let M=parseInt(T[1]);parseInt(T[2]),g==M&&(f=p)}else f=p}return c||f||a||!1}else return e[0]}const E0="/github.svg";function Oa(t){let e,l;function n(u,a){return u[1]>1?O0:u[1]>0?L0:u[2]>1?I0:u[2]>0?R0:u[3]>1?D0:u[3]>0?P0:A0}let i=n(t),o=i(t);return{c(){e=E(`Up - `),o.c(),l=Ke()},m(u,a){S(u,e,a),o.m(u,a),S(u,l,a)},p(u,a){i===(i=n(u))&&o?o.p(u,a):(o.d(1),o=i(u),o&&(o.c(),o.m(l.parentNode,l)))},d(u){u&&$(e),o.d(u),u&&$(l)}}}function A0(t){let e,l;return{c(){e=E(t[0]),l=E(" seconds")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&1&&J(e,n[0])},d(n){n&&$(e),n&&$(l)}}}function P0(t){let e,l;return{c(){e=E(t[3]),l=E(" minute")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&8&&J(e,n[3])},d(n){n&&$(e),n&&$(l)}}}function D0(t){let e,l;return{c(){e=E(t[3]),l=E(" minutes")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&8&&J(e,n[3])},d(n){n&&$(e),n&&$(l)}}}function R0(t){let e,l;return{c(){e=E(t[2]),l=E(" hour")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&4&&J(e,n[2])},d(n){n&&$(e),n&&$(l)}}}function I0(t){let e,l;return{c(){e=E(t[2]),l=E(" hours")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&4&&J(e,n[2])},d(n){n&&$(e),n&&$(l)}}}function L0(t){let e,l;return{c(){e=E(t[1]),l=E(" day")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&2&&J(e,n[1])},d(n){n&&$(e),n&&$(l)}}}function O0(t){let e,l;return{c(){e=E(t[1]),l=E(" days")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&2&&J(e,n[1])},d(n){n&&$(e),n&&$(l)}}}function F0(t){let e,l=t[0]&&Oa(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),S(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Oa(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:pe,o:pe,d(n){l&&l.d(n),n&&$(e)}}}function q0(t,e,l){let{epoch:n}=e,i=0,o=0,u=0;return t.$$set=a=>{"epoch"in a&&l(0,n=a.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(1,i=Math.floor(n/86400)),l(2,o=Math.floor(n/3600)),l(3,u=Math.floor(n/60)))},[n,i,o,u]}class B0 extends Ie{constructor(e){super(),Re(this,e,q0,F0,Ee,{epoch:0})}}function U0(t){let e,l,n;return{c(){e=m("span"),l=E(t[2]),r(e,"title",t[1]),r(e,"class",n="bd-"+t[0])},m(i,o){S(i,e,o),s(e,l)},p(i,[o]){o&4&&J(l,i[2]),o&2&&r(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&r(e,"class",n)},i:pe,o:pe,d(i){i&&$(e)}}}function j0(t,e,l){let{color:n}=e,{title:i}=e,{text:o}=e;return t.$$set=u=>{"color"in u&&l(0,n=u.color),"title"in u&&l(1,i=u.title),"text"in u&&l(2,o=u.text)},[n,i,o]}class an extends Ie{constructor(e){super(),Re(this,e,j0,U0,Ee,{color:0,title:1,text:2})}}function H0(t){let e,l=`${Ue(t[0].getDate())}.${Ue(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Ue(t[0].getHours())}:${Ue(t[0].getMinutes())}`,n;return{c(){e=m("span"),n=E(l),r(e,"class",t[1])},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${Ue(i[0].getDate())}.${Ue(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Ue(i[0].getHours())}:${Ue(i[0].getMinutes())}`)&&J(n,l),o&2&&r(e,"class",i[1])},d(i){i&&$(e)}}}function W0(t){let e=`${Ue(t[0].getDate())}. ${Ys[t[0].getMonth()]} ${Ue(t[0].getHours())}:${Ue(t[0].getMinutes())}`,l;return{c(){l=E(e)},m(n,i){S(n,l,i)},p(n,i){i&1&&e!==(e=`${Ue(n[0].getDate())}. ${Ys[n[0].getMonth()]} ${Ue(n[0].getHours())}:${Ue(n[0].getMinutes())}`)&&J(l,e)},d(n){n&&$(l)}}}function z0(t){let e;function l(o,u){return o[2]?W0:H0}let n=l(t),i=n(t);return{c(){i.c(),e=Ke()},m(o,u){i.m(o,u),S(o,e,u)},p(o,[u]){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:pe,o:pe,d(o){i.d(o),o&&$(e)}}}function G0(t,e,l){let{timestamp:n}=e,{fullTimeColor:i}=e,{offset:o}=e,u;return t.$$set=a=>{"timestamp"in a&&l(0,n=a.timestamp),"fullTimeColor"in a&&l(1,i=a.fullTimeColor),"offset"in a&&l(3,o=a.offset)},t.$$.update=()=>{t.$$.dirty&9&&(l(2,u=Math.abs(new Date().getTime()-n.getTime())<3e5),isNaN(o)||dl(n,o-(24+n.getHours()-n.getUTCHours())%24))},[n,i,u,o]}class Zc extends Ie{constructor(e){super(),Re(this,e,G0,z0,Ee,{timestamp:0,fullTimeColor:1,offset:3})}}function V0(t){let e,l,n;return{c(){e=De("svg"),l=De("path"),n=De("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z"),r(n,"stroke-linecap","round"),r(n,"stroke-linejoin","round"),r(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(i,o){S(i,e,o),s(e,l),s(e,n)},p:pe,i:pe,o:pe,d(i){i&&$(e)}}}class K0 extends Ie{constructor(e){super(),Re(this,e,null,V0,Ee,{})}}function Y0(t){let e,l;return{c(){e=De("svg"),l=De("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){S(n,e,i),s(e,l)},p:pe,i:pe,o:pe,d(n){n&&$(e)}}}class Q0 extends Ie{constructor(e){super(),Re(this,e,null,Y0,Ee,{})}}function X0(t){let e,l;return{c(){e=De("svg"),l=De("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){S(n,e,i),s(e,l)},p:pe,i:pe,o:pe,d(n){n&&$(e)}}}class Rt extends Ie{constructor(e){super(),Re(this,e,null,X0,Ee,{})}}function Z0(t){let e,l;return{c(){e=De("svg"),l=De("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9 8.25H7.5a2.25 2.25 0 00-2.25 2.25v9a2.25 2.25 0 002.25 2.25h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25H15M9 12l3 3m0 0l3-3m-3 3V2.25"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){S(n,e,i),s(e,l)},p:pe,i:pe,o:pe,d(n){n&&$(e)}}}class Jc extends Ie{constructor(e){super(),Re(this,e,null,Z0,Ee,{})}}function J0(t){let e,l,n=t[1].version+"",i;return{c(){e=E("AMS reader "),l=m("span"),i=E(n)},m(o,u){S(o,e,u),S(o,l,u),s(l,i)},p(o,u){u&2&&n!==(n=o[1].version+"")&&J(i,n)},d(o){o&&$(e),o&&$(l)}}}function Fa(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=m("div"),n=E(l),i=E("\xB0C"),r(e,"class","flex-none my-auto")},m(o,u){S(o,e,u),s(e,n),s(e,i)},p(o,u){u&1&&l!==(l=(o[0].t>-50?o[0].t.toFixed(1):"-")+"")&&J(n,l)},d(o){o&&$(e)}}}function qa(t){let e,l="HAN: "+Ta(t[0].he),n;return{c(){e=m("div"),n=E(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="HAN: "+Ta(i[0].he))&&J(n,l)},d(i){i&&$(e)}}}function Ba(t){let e,l="MQTT: "+Na(t[0].me),n;return{c(){e=m("div"),n=E(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="MQTT: "+Na(i[0].me))&&J(n,l)},d(i){i&&$(e)}}}function Ua(t){let e,l="Price service: "+Ea(t[0].ee),n;return{c(){e=m("div"),n=E(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="Price service: "+Ea(i[0].ee))&&J(n,l)},d(i){i&&$(e)}}}function ja(t){let e,l,n,i,o,u;return l=new Qt({props:{to:"/configuration",$$slots:{default:[x0]},$$scope:{ctx:t}}}),o=new Qt({props:{to:"/status",$$slots:{default:[em]},$$scope:{ctx:t}}}),{c(){e=m("div"),re(l.$$.fragment),n=h(),i=m("div"),re(o.$$.fragment),r(e,"class","flex-none px-1 mt-1"),r(e,"title","Configuration"),r(i,"class","flex-none px-1 mt-1"),r(i,"title","Device information")},m(a,c){S(a,e,c),ie(l,e,null),S(a,n,c),S(a,i,c),ie(o,i,null),u=!0},i(a){u||(O(l.$$.fragment,a),O(o.$$.fragment,a),u=!0)},o(a){q(l.$$.fragment,a),q(o.$$.fragment,a),u=!1},d(a){a&&$(e),se(l),a&&$(n),a&&$(i),se(o)}}}function x0(t){let e,l;return e=new K0({}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function em(t){let e,l;return e=new Q0({}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function Ha(t){let e,l,n,i,o;const u=[lm,tm],a=[];function 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,_){S(f,e,_),a[l].m(e,null),o=!0},p(f,_){let p=l;l=c(f),l===p?a[l].p(f,_):(Ae(),q(a[p],1,1,()=>{a[p]=null}),Pe(),n=a[l],n?n.p(f,_):(n=a[l]=u[l](f),n.c()),O(n,1),n.m(e,null)),(!o||_&4&&i!==(i="New version: "+f[2].tag_name))&&r(e,"title",i)},i(f){o||(O(n),o=!0)},o(f){q(n),o=!1},d(f){f&&$(e),a[l].d()}}}function tm(t){let e,l,n=t[2].tag_name+"",i;return{c(){e=m("span"),l=E("New version: "),i=E(n)},m(o,u){S(o,e,u),s(e,l),s(e,i)},p(o,u){u&4&&n!==(n=o[2].tag_name+"")&&J(i,n)},i:pe,o:pe,d(o){o&&$(e)}}}function lm(t){let e,l,n,i=t[2].tag_name+"",o,u,a,c,f,_;return a=new Jc({}),{c(){e=m("button"),l=m("span"),n=E("New version: "),o=E(i),u=h(),re(a.$$.fragment),r(l,"class","mt-1"),r(e,"class","flex")},m(p,b){S(p,e,b),s(e,l),s(l,n),s(l,o),s(e,u),ie(a,e,null),c=!0,f||(_=te(e,"click",t[3]),f=!0)},p(p,b){(!c||b&4)&&i!==(i=p[2].tag_name+"")&&J(o,i)},i(p){c||(O(a.$$.fragment,p),c=!0)},o(p){q(a.$$.fragment,p),c=!1},d(p){p&&$(e),se(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,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Le,Se;i=new Qt({props:{to:"/",$$slots:{default:[J0]},$$scope:{ctx:t}}}),c=new B0({props:{epoch:t[0].u}});let ye=t[0].t>-50&&Fa(t);M=new an({props:{title:"ESP",text:t[1].booting?"Booting":t[0].v>2?t[0].v.toFixed(2)+"V":"ESP",color:Bl(t[1].booting?2:t[0].em)}}),L=new an({props:{title:"HAN",text:"HAN",color:Bl(t[1].booting?9:t[0].hm)}}),F=new an({props:{title:"WiFi",text:t[0].r?t[0].r.toFixed(0)+"dBm":"WiFi",color:Bl(t[1].booting?9:t[0].wm)}}),R=new an({props:{title:"MQTT",text:"MQTT",color:Bl(t[1].booting?9:t[0].mm)}});let ve=(t[0].he<0||t[0].he>0)&&qa(t),Te=t[0].me<0&&Ba(t),be=(t[0].ee>0||t[0].ee<0)&&Ua(t);ae=new Zc({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),offset:t[1].clock_offset,fullTimeColor:"text-red-500"}});let N=t[1].vndcfg&&t[1].usrcfg&&ja(t);He=new Rt({});let y=t[1].fwconsent===1&&t[2]&&Ha(t);return{c(){e=m("nav"),l=m("div"),n=m("div"),re(i.$$.fragment),o=h(),u=m("div"),a=m("div"),re(c.$$.fragment),f=h(),ye&&ye.c(),_=h(),p=m("div"),b=E("Free mem: "),d=E(v),g=E("kb"),w=h(),T=m("div"),re(M.$$.fragment),P=h(),re(L.$$.fragment),I=h(),re(F.$$.fragment),C=h(),re(R.$$.fragment),ne=h(),ve&&ve.c(),H=h(),Te&&Te.c(),z=h(),be&&be.c(),U=h(),K=m("div"),Q=m("div"),G=m("a"),X=m("img"),j=h(),x=m("div"),re(ae.$$.fragment),ee=h(),N&&N.c(),V=h(),W=m("div"),we=m("a"),re(He.$$.fragment),Le=h(),y&&y.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(X,"class","gh-logo"),Ws(X.src,Y=E0)||r(X,"src",Y),r(X,"alt","GitHub repo"),r(G,"class","float-right"),r(G,"href","https://github.com/UtilitechAS/amsreader-firmware"),r(G,"target","_blank"),r(G,"rel","noreferrer"),r(G,"aria-label","GitHub"),r(Q,"class","flex-none"),r(x,"class","flex-none my-auto px-2"),r(we,"href",It("")),r(we,"target","_blank"),r(we,"rel","noreferrer"),r(W,"class","flex-none px-1 mt-1"),r(W,"title","Documentation"),r(K,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),r(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),r(e,"class","bg-violet-600 p-1 rounded-md mx-2")},m(k,A){S(k,e,A),s(e,l),s(l,n),ie(i,n,null),s(l,o),s(l,u),s(u,a),ie(c,a,null),s(u,f),ye&&ye.m(u,null),s(u,_),s(u,p),s(p,b),s(p,d),s(p,g),s(l,w),s(l,T),ie(M,T,null),s(T,P),ie(L,T,null),s(T,I),ie(F,T,null),s(T,C),ie(R,T,null),s(l,ne),ve&&ve.m(l,null),s(l,H),Te&&Te.m(l,null),s(l,z),be&&be.m(l,null),s(l,U),s(l,K),s(K,Q),s(Q,G),s(G,X),s(K,j),s(K,x),ie(ae,x,null),s(K,ee),N&&N.m(K,null),s(K,V),s(K,W),s(W,we),ie(He,we,null),s(K,Le),y&&y.m(K,null),Se=!0},p(k,[A]){const D={};A&18&&(D.$$scope={dirty:A,ctx:k}),i.$set(D);const Z={};A&1&&(Z.epoch=k[0].u),c.$set(Z),k[0].t>-50?ye?ye.p(k,A):(ye=Fa(k),ye.c(),ye.m(u,_)):ye&&(ye.d(1),ye=null),(!Se||A&1)&&v!==(v=(k[0].m?(k[0].m/1e3).toFixed(1):"-")+"")&&J(d,v);const le={};A&3&&(le.text=k[1].booting?"Booting":k[0].v>2?k[0].v.toFixed(2)+"V":"ESP"),A&3&&(le.color=Bl(k[1].booting?2:k[0].em)),M.$set(le);const fe={};A&3&&(fe.color=Bl(k[1].booting?9:k[0].hm)),L.$set(fe);const de={};A&1&&(de.text=k[0].r?k[0].r.toFixed(0)+"dBm":"WiFi"),A&3&&(de.color=Bl(k[1].booting?9:k[0].wm)),F.$set(de);const Ce={};A&3&&(Ce.color=Bl(k[1].booting?9:k[0].mm)),R.$set(Ce),k[0].he<0||k[0].he>0?ve?ve.p(k,A):(ve=qa(k),ve.c(),ve.m(l,H)):ve&&(ve.d(1),ve=null),k[0].me<0?Te?Te.p(k,A):(Te=Ba(k),Te.c(),Te.m(l,z)):Te&&(Te.d(1),Te=null),k[0].ee>0||k[0].ee<0?be?be.p(k,A):(be=Ua(k),be.c(),be.m(l,U)):be&&(be.d(1),be=null);const Oe={};A&1&&(Oe.timestamp=k[0].c?new Date(k[0].c*1e3):new Date(0)),A&2&&(Oe.offset=k[1].clock_offset),ae.$set(Oe),k[1].vndcfg&&k[1].usrcfg?N?A&2&&O(N,1):(N=ja(k),N.c(),O(N,1),N.m(K,V)):N&&(Ae(),q(N,1,1,()=>{N=null}),Pe()),k[1].fwconsent===1&&k[2]?y?(y.p(k,A),A&6&&O(y,1)):(y=Ha(k),y.c(),O(y,1),y.m(K,null)):y&&(Ae(),q(y,1,1,()=>{y=null}),Pe())},i(k){Se||(O(i.$$.fragment,k),O(c.$$.fragment,k),O(M.$$.fragment,k),O(L.$$.fragment,k),O(F.$$.fragment,k),O(R.$$.fragment,k),O(ae.$$.fragment,k),O(N),O(He.$$.fragment,k),O(y),Se=!0)},o(k){q(i.$$.fragment,k),q(c.$$.fragment,k),q(M.$$.fragment,k),q(L.$$.fragment,k),q(F.$$.fragment,k),q(R.$$.fragment,k),q(ae.$$.fragment,k),q(N),q(He.$$.fragment,k),q(y),Se=!1},d(k){k&&$(e),se(i),se(c),ye&&ye.d(),se(M),se(L),se(F),se(R),ve&&ve.d(),Te&&Te.d(),be&&be.d(),se(ae),N&&N.d(),se(He),y&&y.d()}}}function im(t,e,l){let{data:n={}}=e,i={},o={};function u(){confirm("Do you want to upgrade this device to "+o.tag_name+"?")&&(!ti(i.board)||confirm(hs(he(i.chip,i.board))))&&(Wt.update(a=>(a.upgrading=!0,a)),Qc(o.tag_name))}return Wt.subscribe(a=>{l(1,i=a),a.fwconsent===1&&T0()}),yo.subscribe(a=>{l(2,o=Xc(i.version,a))}),t.$$set=a=>{"data"in a&&l(0,n=a.data)},[n,i,o,u]}class sm extends Ie{constructor(e){super(),Re(this,e,im,nm,Ee,{data:0})}}function om(t){let e,l,n,i;return{c(){e=De("svg"),l=De("path"),n=De("path"),r(l,"d",Hs(150,150,115,210,510)),r(l,"stroke","rgba(128, 128, 128, 0.15)"),r(l,"fill","none"),r(l,"stroke-width","55"),r(n,"d",i=Hs(150,150,115,210,210+300*t[0]/100)),r(n,"stroke",t[1]),r(n,"fill","none"),r(n,"stroke-width","55"),r(e,"viewBox","0 0 300 300"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"height","100%")},m(o,u){S(o,e,u),s(e,l),s(e,n)},p(o,[u]){u&1&&i!==(i=Hs(150,150,115,210,210+300*o[0]/100))&&r(n,"d",i),u&2&&r(n,"stroke",o[1])},i:pe,o:pe,d(o){o&&$(e)}}}function Wa(t,e,l,n){var i=(n-90)*Math.PI/180;return{x:t+l*Math.cos(i),y:e+l*Math.sin(i)}}function Hs(t,e,l,n,i){var o=Wa(t,e,l,i),u=Wa(t,e,l,n),a=i-n<=180?"0":"1",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 Ie{constructor(e){super(),Re(this,e,rm,om,Ee,{pct:0,color:1})}}function za(t){let e,l,n,i,o,u,a,c;return{c(){e=m("br"),l=h(),n=m("span"),i=E(t[3]),o=h(),u=m("span"),a=E(t[4]),c=E("/kWh"),r(n,"class","pl-sub"),r(u,"class","pl-snt")},m(f,_){S(f,e,_),S(f,l,_),S(f,n,_),s(n,i),S(f,o,_),S(f,u,_),s(u,a),s(u,c)},p(f,_){_&8&&J(i,f[3]),_&16&&J(a,f[4])},d(f){f&&$(e),f&&$(l),f&&$(n),f&&$(o),f&&$(u)}}}function um(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w;l=new am({props:{pct:t[6],color:t[5](t[6])}});let T=t[3]&&za(t);return{c(){e=m("div"),re(l.$$.fragment),n=h(),i=m("span"),o=m("span"),u=E(t[2]),a=h(),c=m("br"),f=h(),_=m("span"),p=E(t[0]),b=h(),v=m("span"),d=E(t[1]),g=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(M,P){S(M,e,P),ie(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,g),T&&T.m(i,null),w=!0},p(M,[P]){const L={};P&64&&(L.pct=M[6]),P&96&&(L.color=M[5](M[6])),l.$set(L),(!w||P&4)&&J(u,M[2]),(!w||P&1)&&J(p,M[0]),(!w||P&2)&&J(d,M[1]),M[3]?T?T.p(M,P):(T=za(M),T.c(),T.m(i,null)):T&&(T.d(1),T=null)},i(M){w||(O(l.$$.fragment,M),w=!0)},o(M){q(l.$$.fragment,M),w=!1},d(M){M&&$(e),se(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 xc extends Ie{constructor(e){super(),Re(this,e,fm,um,Ee,{val:0,max:7,unit:1,label:2,sub:3,subunit:4,colorFn:5})}}function Ga(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Va(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Ka(t,e,l){const n=t.slice();return n[15]=e[l],n}function Ya(t){let e,l,n,i,o,u,a=t[0].title&&Qa(t),c=t[0].y.ticks,f=[];for(let d=0;dt[9].call(e))},m(o,u){S(o,e,u),s(e,n),i=mo(e,t[9].bind(e))},p(o,u){u&1&&l!==(l=o[0].title+"")&&J(n,l)},d(o){o&&$(e),i()}}}function Xa(t){let e,l,n,i=t[15].label+"",o,u,a,c;return{c(){e=De("g"),l=De("line"),n=De("text"),o=E(i),r(l,"x2","100%"),r(n,"y","-4"),r(n,"x",u=t[15].align=="right"?"85%":""),r(e,"class",a="tick tick-"+t[15].value+" tick-"+t[15].color),r(e,"transform",c="translate(0, "+t[7](t[15].value)+")")},m(f,_){S(f,e,_),s(e,l),s(e,n),s(n,o)},p(f,_){_&1&&i!==(i=f[15].label+"")&&J(o,i),_&1&&u!==(u=f[15].align=="right"?"85%":"")&&r(n,"x",u),_&1&&a!==(a="tick tick-"+f[15].value+" tick-"+f[15].color)&&r(e,"class",a),_&129&&c!==(c="translate(0, "+f[7](f[15].value)+")")&&r(e,"transform",c)},d(f){f&&$(e)}}}function Za(t){let e=!isNaN(t[7](t[15].value)),l,n=e&&Xa(t);return{c(){n&&n.c(),l=Ke()},m(i,o){n&&n.m(i,o),S(i,l,o)},p(i,o){o&129&&(e=!isNaN(i[7](i[15].value))),e?n?n.p(i,o):(n=Xa(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&$(l)}}}function Ja(t){let e,l,n=(t[3]>20||t[13]%2==0)&&xa(t);return{c(){e=De("g"),n&&n.c(),r(e,"class","tick"),r(e,"transform",l="translate("+t[6](t[13])+","+t[4]+")")},m(i,o){S(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[13]%2==0?n?n.p(i,o):(n=xa(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&80&&l!==(l="translate("+i[6](i[13])+","+i[4]+")")&&r(e,"transform",l)},d(i){i&&$(e),n&&n.d()}}}function xa(t){let e,l=t[11].label+"",n,i;return{c(){e=De("text"),n=E(l),r(e,"x",i=t[3]/2),r(e,"y","-4")},m(o,u){S(o,e,u),s(e,n)},p(o,u){u&1&&l!==(l=o[11].label+"")&&J(n,l),u&8&&i!==(i=o[3]/2)&&r(e,"x",i)},d(o){o&&$(e)}}}function eu(t){let e=!isNaN(t[6](t[13])),l,n=e&&Ja(t);return{c(){n&&n.c(),l=Ke()},m(i,o){n&&n.m(i,o),S(i,l,o)},p(i,o){o&64&&(e=!isNaN(i[6](i[13]))),e?n?n.p(i,o):(n=Ja(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&$(l)}}}function tu(t){let e,l,n=t[11].value!==void 0&&lu(t),i=t[11].value2>1e-4&&su(t);return{c(){e=De("g"),n&&n.c(),l=De("g"),i&&i.c()},m(o,u){S(o,e,u),n&&n.m(e,null),S(o,l,u),i&&i.m(l,null)},p(o,u){o[11].value!==void 0?n?n.p(o,u):(n=lu(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[11].value2>1e-4?i?i.p(o,u):(i=su(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&$(e),n&&n.d(),o&&$(l),i&&i.d()}}}function lu(t){let e,l,n,i,o,u,a,c=t[3]>15&&nu(t);return{c(){e=De("rect"),c&&c.c(),a=Ke(),r(e,"x",l=t[6](t[13])+2),r(e,"y",n=t[7](t[11].value)),r(e,"width",i=t[3]-4),r(e,"height",o=t[7](t[0].y.min)-t[7](Math.min(t[0].y.min,0)+t[11].value)),r(e,"fill",u=t[11].color)},m(f,_){S(f,e,_),c&&c.m(f,_),S(f,a,_)},p(f,_){_&64&&l!==(l=f[6](f[13])+2)&&r(e,"x",l),_&129&&n!==(n=f[7](f[11].value))&&r(e,"y",n),_&8&&i!==(i=f[3]-4)&&r(e,"width",i),_&129&&o!==(o=f[7](f[0].y.min)-f[7](Math.min(f[0].y.min,0)+f[11].value))&&r(e,"height",o),_&1&&u!==(u=f[11].color)&&r(e,"fill",u),f[3]>15?c?c.p(f,_):(c=nu(f),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(f){f&&$(e),c&&c.d(f),f&&$(a)}}}function nu(t){let e,l=t[11].label+"",n,i,o,u,a,c,f=t[11].title&&iu(t);return{c(){e=De("text"),n=E(l),f&&f.c(),c=Ke(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor",o=t[3]t[7](0)-t[8]?t[11].color:"white"),r(e,"transform",a="translate("+(t[6](t[13])+t[3]/2)+" "+(t[7](t[11].value)>t[7](0)-t[8]?t[7](t[11].value)-t[8]:t[7](t[11].value)+10)+") rotate("+(t[11].labelAngle?t[11].labelAngle:t[3]_[7](0)-_[8]?_[11].color:"white")&&r(e,"fill",u),p&457&&a!==(a="translate("+(_[6](_[13])+_[3]/2)+" "+(_[7](_[11].value)>_[7](0)-_[8]?_[7](_[11].value)-_[8]:_[7](_[11].value)+10)+") rotate("+(_[11].labelAngle?_[11].labelAngle:_[3]15&&ou(t);return{c(){e=De("rect"),c&&c.c(),a=Ke(),r(e,"x",l=t[6](t[13])+2),r(e,"y",n=t[7](0)),r(e,"width",i=t[3]-4),r(e,"height",o=t[7](t[0].y.min)-t[7](t[0].y.min+t[11].value2)),r(e,"fill",u=t[11].color2?t[11].color2:t[11].color)},m(f,_){S(f,e,_),c&&c.m(f,_),S(f,a,_)},p(f,_){_&64&&l!==(l=f[6](f[13])+2)&&r(e,"x",l),_&128&&n!==(n=f[7](0))&&r(e,"y",n),_&8&&i!==(i=f[3]-4)&&r(e,"width",i),_&129&&o!==(o=f[7](f[0].y.min)-f[7](f[0].y.min+f[11].value2))&&r(e,"height",o),_&1&&u!==(u=f[11].color2?f[11].color2:f[11].color)&&r(e,"fill",u),f[3]>15?c?c.p(f,_):(c=ou(f),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(f){f&&$(e),c&&c.d(f),f&&$(a)}}}function ou(t){let e,l=t[11].label2+"",n,i,o,u,a,c=t[11].title2&&ru(t);return{c(){e=De("text"),n=E(l),c&&c.c(),a=Ke(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor","middle"),r(e,"fill",o=t[7](-t[11].value2)t[10].call(e))},m(i,o){S(i,e,o),n&&n.m(e,null),l=mo(e,t[10].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=Ya(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:pe,o:pe,d(i){i&&$(e),n&&n.d(),l()}}}let un=30;function mm(t,e,l){let{config:n}=e,i,o,u,a,c,f,_,p=0;function b(){p=this.clientHeight,l(5,p)}function v(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return t.$$set=d=>{"config"in d&&l(0,n=d.config)},t.$$.update=()=>{if(t.$$.dirty&63){l(4,f=o-p);let d=i-(n.padding.left+n.padding.right);l(3,u=d/n.points.length),l(8,_=un.y.max?T=n.padding.bottom:wf||T<0?0:T})}},[n,i,o,u,f,p,a,c,_,b,v]}class mn extends Ie{constructor(e){super(),Re(this,e,mm,cm,Ee,{config:0})}}function _m(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function pm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{ds:u}=e,a={};function c(f){return{label:ke(f)+"V",title:f.toFixed(1)+" V",value:isNaN(f)?0:f,color:$0(f||0)}}return t.$$set=f=>{"u1"in f&&l(1,n=f.u1),"u2"in f&&l(2,i=f.u2),"u3"in f&&l(3,o=f.u3),"ds"in f&&l(4,u=f.ds)},t.$$.update=()=>{if(t.$$.dirty&30){let f=[],_=[];n>0&&(f.push({label:u===1?"L1-L2":"L1"}),_.push(c(n))),i>0&&(f.push({label:u===1?"L1-L3":"L2"}),_.push(c(i))),o>0&&(f.push({label:u===1?"L2-L3":"L3"}),_.push(c(o))),l(0,a={title:"Voltage",padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:f},points:_})}},[a,n,i,o,u]}class dm extends Ie{constructor(e){super(),Re(this,e,pm,_m,Ee,{u1:1,u2:2,u3:3,ds:4})}}function vm(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function hm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{i1:u}=e,{i2:a}=e,{i2e:c}=e,{i3:f}=e,{max:_}=e,p={};function b(v){return{label:ke(v)+"A",title:v.toFixed(1)+" A",value:isNaN(v)?0:v,color:qc(v?v/_*100:0)}}return t.$$set=v=>{"u1"in v&&l(1,n=v.u1),"u2"in v&&l(2,i=v.u2),"u3"in v&&l(3,o=v.u3),"i1"in v&&l(4,u=v.i1),"i2"in v&&l(5,a=v.i2),"i2e"in v&&l(6,c=v.i2e),"i3"in v&&l(7,f=v.i3),"max"in v&&l(8,_=v.max)},t.$$.update=()=>{if(t.$$.dirty&510){let v=[],d=[];n>0&&(v.push({label:"L1"}),d.push(b(u))),i>0&&(c?(v.push({label:"L2"}),d.push({label:"Not available",labelAngle:-90,title:"L2 current is not reported by your meter",value:0,color:"#7c3aedcc"})):(v.push({label:"L2"}),d.push(b(a)))),o>0&&(v.push({label:"L3"}),d.push(b(f))),l(0,p={title:"Amperage",padding:{top:20,right:15,bottom:20,left:35},y:{min:0,max:_,ticks:[{value:0,label:"0%"},{value:_/4,label:"25%"},{value:_/2,label:"50%"},{value:_/4*3,label:"75%"},{value:_,label:"100%"}]},x:{ticks:v},points:d})}},[p,n,i,o,u,a,c,f,_]}class bm extends Ie{constructor(e){super(),Re(this,e,hm,vm,Ee,{u1:1,u2:2,u3:3,i1:4,i2:5,i2e:6,i3:7,max:8})}}function gm(t){let e,l,n,i,o,u,a,c=(typeof t[0]<"u"?t[0].toFixed(0):"-")+"",f,_,p,b,v,d,g=(typeof t[1]<"u"?t[1].toFixed(0):"-")+"",w,T,M,P,L,I,F,C=(typeof t[2]<"u"?t[2].toFixed(1):"-")+"",R,ne,H,z,U,K,Q=(typeof t[3]<"u"?t[3].toFixed(1):"-")+"",G,X;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=E(c),_=E(" VAr"),p=h(),b=m("div"),b.textContent="Instant out",v=h(),d=m("div"),w=E(g),T=E(" VAr"),M=h(),P=m("div"),L=m("div"),L.textContent="Total in",I=h(),F=m("div"),R=E(C),ne=E(" kVArh"),H=h(),z=m("div"),z.textContent="Total out",U=h(),K=m("div"),G=E(Q),X=E(" kVArh"),r(a,"class","text-right"),r(d,"class","text-right"),r(i,"class","grid grid-cols-2 mt-4"),r(F,"class","text-right"),r(K,"class","text-right"),r(P,"class","grid grid-cols-2 mt-4"),r(e,"class","mx-2 text-sm")},m(Y,j){S(Y,e,j),s(e,l),s(e,n),s(e,i),s(i,o),s(i,u),s(i,a),s(a,f),s(a,_),s(i,p),s(i,b),s(i,v),s(i,d),s(d,w),s(d,T),s(e,M),s(e,P),s(P,L),s(P,I),s(P,F),s(F,R),s(F,ne),s(P,H),s(P,z),s(P,U),s(P,K),s(K,G),s(K,X)},p(Y,[j]){j&1&&c!==(c=(typeof Y[0]<"u"?Y[0].toFixed(0):"-")+"")&&J(f,c),j&2&&g!==(g=(typeof Y[1]<"u"?Y[1].toFixed(0):"-")+"")&&J(w,g),j&4&&C!==(C=(typeof Y[2]<"u"?Y[2].toFixed(1):"-")+"")&&J(R,C),j&8&&Q!==(Q=(typeof Y[3]<"u"?Y[3].toFixed(1):"-")+"")&&J(G,Q)},i:pe,o:pe,d(Y){Y&&$(e)}}}function km(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:o}=e,{exportTotal:u}=e;return t.$$set=a=>{"importInstant"in a&&l(0,n=a.importInstant),"exportInstant"in a&&l(1,i=a.exportInstant),"importTotal"in a&&l(2,o=a.importTotal),"exportTotal"in a&&l(3,u=a.exportTotal)},[n,i,o,u]}class wm extends Ie{constructor(e){super(),Re(this,e,km,gm,Ee,{importInstant:0,exportInstant:1,importTotal:2,exportTotal:3})}}function uu(t){let e;function l(o,u){return o[3]?Cm:ym}let n=l(t),i=n(t);return{c(){i.c(),e=Ke()},m(o,u){i.m(o,u),S(o,e,u)},p(o,u){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&$(e)}}}function ym(t){let e,l,n,i,o,u,a=ke(t[1].h.u,2)+"",c,f,_,p,b,v,d=ke(t[1].d.u,1)+"",g,w,T,M,P,L,I=ke(t[1].m.u)+"",F,C,R,ne,H,z,U=ke(t[0].last_month.u)+"",K,Q,G,X,Y=t[4]&&fu(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=E(a),f=E(" kWh"),_=h(),p=m("div"),p.textContent="Day",b=h(),v=m("div"),g=E(d),w=E(" kWh"),T=h(),M=m("div"),M.textContent="Month",P=h(),L=m("div"),F=E(I),C=E(" kWh"),R=h(),ne=m("div"),ne.textContent="Last month",H=h(),z=m("div"),K=E(U),Q=E(" kWh"),G=h(),Y&&Y.c(),X=Ke(),r(u,"class","text-right"),r(v,"class","text-right"),r(L,"class","text-right"),r(z,"class","text-right"),r(n,"class","grid grid-cols-2 mb-3")},m(j,x){S(j,e,x),S(j,l,x),S(j,n,x),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(n,_),s(n,p),s(n,b),s(n,v),s(v,g),s(v,w),s(n,T),s(n,M),s(n,P),s(n,L),s(L,F),s(L,C),s(n,R),s(n,ne),s(n,H),s(n,z),s(z,K),s(z,Q),S(j,G,x),Y&&Y.m(j,x),S(j,X,x)},p(j,x){x&2&&a!==(a=ke(j[1].h.u,2)+"")&&J(c,a),x&2&&d!==(d=ke(j[1].d.u,1)+"")&&J(g,d),x&2&&I!==(I=ke(j[1].m.u)+"")&&J(F,I),x&1&&U!==(U=ke(j[0].last_month.u)+"")&&J(K,U),j[4]?Y?Y.p(j,x):(Y=fu(j),Y.c(),Y.m(X.parentNode,X)):Y&&(Y.d(1),Y=null)},d(j){j&&$(e),j&&$(l),j&&$(n),j&&$(G),Y&&Y.d(j),j&&$(X)}}}function Cm(t){let e,l,n,i,o,u,a=ke(t[1].h.u,2)+"",c,f,_,p,b,v,d,g=ke(t[1].d.u,1)+"",w,T,M,P,L,I,F,C=ke(t[1].m.u)+"",R,ne,H,z,U,K,Q,G=ke(t[0].last_month.u)+"",X,Y,j,x,ae,ee,V,W,we,He,Le,Se=ke(t[1].h.p,2)+"",ye,ve,Te,be,N,y,k,A=ke(t[1].d.p,1)+"",D,Z,le,fe,de,Ce,Oe,ue=ke(t[1].m.p)+"",Me,Je,Lt,st,wt,nt,Ot,Qe=ke(t[0].last_month.p)+"",Xt,zt,vt,xe,Ge=t[4]&&cu(t),Ye=t[4]&&mu(t),Ne=t[4]&&_u(t),Ze=t[4]&&pu(t),et=t[4]&&du(t),qe=t[4]&&vu(t),Fe=t[4]&&hu(t),_e=t[4]&&bu(t);return{c(){e=m("strong"),e.textContent="Import",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=E(a),f=E(" kWh"),_=h(),Ge&&Ge.c(),p=h(),b=m("div"),b.textContent="Day",v=h(),d=m("div"),w=E(g),T=E(" kWh"),M=h(),Ye&&Ye.c(),P=h(),L=m("div"),L.textContent="Month",I=h(),F=m("div"),R=E(C),ne=E(" kWh"),H=h(),Ne&&Ne.c(),z=h(),U=m("div"),U.textContent="Last mo.",K=h(),Q=m("div"),X=E(G),Y=E(" kWh"),j=h(),Ze&&Ze.c(),ae=h(),ee=m("strong"),ee.textContent="Export",V=h(),W=m("div"),we=m("div"),we.textContent="Hour",He=h(),Le=m("div"),ye=E(Se),ve=E(" kWh"),Te=h(),et&&et.c(),be=h(),N=m("div"),N.textContent="Day",y=h(),k=m("div"),D=E(A),Z=E(" kWh"),le=h(),qe&&qe.c(),fe=h(),de=m("div"),de.textContent="Month",Ce=h(),Oe=m("div"),Me=E(ue),Je=E(" kWh"),Lt=h(),Fe&&Fe.c(),st=h(),wt=m("div"),wt.textContent="Last mo.",nt=h(),Ot=m("div"),Xt=E(Qe),zt=E(" kWh"),vt=h(),_e&&_e.c(),r(u,"class","text-right"),r(d,"class","text-right"),r(F,"class","text-right"),r(Q,"class","text-right"),r(n,"class",x="grid grid-cols-"+t[5]+" mb-3"),r(Le,"class","text-right"),r(k,"class","text-right"),r(Oe,"class","text-right"),r(Ot,"class","text-right"),r(W,"class",xe="grid grid-cols-"+t[5])},m(ce,Be){S(ce,e,Be),S(ce,l,Be),S(ce,n,Be),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(n,_),Ge&&Ge.m(n,null),s(n,p),s(n,b),s(n,v),s(n,d),s(d,w),s(d,T),s(n,M),Ye&&Ye.m(n,null),s(n,P),s(n,L),s(n,I),s(n,F),s(F,R),s(F,ne),s(n,H),Ne&&Ne.m(n,null),s(n,z),s(n,U),s(n,K),s(n,Q),s(Q,X),s(Q,Y),s(n,j),Ze&&Ze.m(n,null),S(ce,ae,Be),S(ce,ee,Be),S(ce,V,Be),S(ce,W,Be),s(W,we),s(W,He),s(W,Le),s(Le,ye),s(Le,ve),s(W,Te),et&&et.m(W,null),s(W,be),s(W,N),s(W,y),s(W,k),s(k,D),s(k,Z),s(W,le),qe&&qe.m(W,null),s(W,fe),s(W,de),s(W,Ce),s(W,Oe),s(Oe,Me),s(Oe,Je),s(W,Lt),Fe&&Fe.m(W,null),s(W,st),s(W,wt),s(W,nt),s(W,Ot),s(Ot,Xt),s(Ot,zt),s(W,vt),_e&&_e.m(W,null)},p(ce,Be){Be&2&&a!==(a=ke(ce[1].h.u,2)+"")&&J(c,a),ce[4]?Ge?Ge.p(ce,Be):(Ge=cu(ce),Ge.c(),Ge.m(n,p)):Ge&&(Ge.d(1),Ge=null),Be&2&&g!==(g=ke(ce[1].d.u,1)+"")&&J(w,g),ce[4]?Ye?Ye.p(ce,Be):(Ye=mu(ce),Ye.c(),Ye.m(n,P)):Ye&&(Ye.d(1),Ye=null),Be&2&&C!==(C=ke(ce[1].m.u)+"")&&J(R,C),ce[4]?Ne?Ne.p(ce,Be):(Ne=_u(ce),Ne.c(),Ne.m(n,z)):Ne&&(Ne.d(1),Ne=null),Be&1&&G!==(G=ke(ce[0].last_month.u)+"")&&J(X,G),ce[4]?Ze?Ze.p(ce,Be):(Ze=pu(ce),Ze.c(),Ze.m(n,null)):Ze&&(Ze.d(1),Ze=null),Be&32&&x!==(x="grid grid-cols-"+ce[5]+" mb-3")&&r(n,"class",x),Be&2&&Se!==(Se=ke(ce[1].h.p,2)+"")&&J(ye,Se),ce[4]?et?et.p(ce,Be):(et=du(ce),et.c(),et.m(W,be)):et&&(et.d(1),et=null),Be&2&&A!==(A=ke(ce[1].d.p,1)+"")&&J(D,A),ce[4]?qe?qe.p(ce,Be):(qe=vu(ce),qe.c(),qe.m(W,fe)):qe&&(qe.d(1),qe=null),Be&2&&ue!==(ue=ke(ce[1].m.p)+"")&&J(Me,ue),ce[4]?Fe?Fe.p(ce,Be):(Fe=hu(ce),Fe.c(),Fe.m(W,st)):Fe&&(Fe.d(1),Fe=null),Be&1&&Qe!==(Qe=ke(ce[0].last_month.p)+"")&&J(Xt,Qe),ce[4]?_e?_e.p(ce,Be):(_e=bu(ce),_e.c(),_e.m(W,null)):_e&&(_e.d(1),_e=null),Be&32&&xe!==(xe="grid grid-cols-"+ce[5])&&r(W,"class",xe)},d(ce){ce&&$(e),ce&&$(l),ce&&$(n),Ge&&Ge.d(),Ye&&Ye.d(),Ne&&Ne.d(),Ze&&Ze.d(),ce&&$(ae),ce&&$(ee),ce&&$(V),ce&&$(W),et&&et.d(),qe&&qe.d(),Fe&&Fe.d(),_e&&_e.d()}}}function fu(t){let e,l,n,i,o,u,a=ke(t[1].h.c,2)+"",c,f,_,p,b,v,d,g=ke(t[1].d.c,1)+"",w,T,M,P,L,I,F,C=ke(t[1].m.c)+"",R,ne,H,z,U,K,Q,G=ke(t[0].last_month.c)+"",X,Y,j;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=E(a),f=h(),_=E(t[2]),p=h(),b=m("div"),b.textContent="Day",v=h(),d=m("div"),w=E(g),T=h(),M=E(t[2]),P=h(),L=m("div"),L.textContent="Month",I=h(),F=m("div"),R=E(C),ne=h(),H=E(t[2]),z=h(),U=m("div"),U.textContent="Last month",K=h(),Q=m("div"),X=E(G),Y=h(),j=E(t[2]),r(u,"class","text-right"),r(d,"class","text-right"),r(F,"class","text-right"),r(Q,"class","text-right"),r(n,"class","grid grid-cols-2")},m(x,ae){S(x,e,ae),S(x,l,ae),S(x,n,ae),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(u,_),s(n,p),s(n,b),s(n,v),s(n,d),s(d,w),s(d,T),s(d,M),s(n,P),s(n,L),s(n,I),s(n,F),s(F,R),s(F,ne),s(F,H),s(n,z),s(n,U),s(n,K),s(n,Q),s(Q,X),s(Q,Y),s(Q,j)},p(x,ae){ae&2&&a!==(a=ke(x[1].h.c,2)+"")&&J(c,a),ae&4&&J(_,x[2]),ae&2&&g!==(g=ke(x[1].d.c,1)+"")&&J(w,g),ae&4&&J(M,x[2]),ae&2&&C!==(C=ke(x[1].m.c)+"")&&J(R,C),ae&4&&J(H,x[2]),ae&1&&G!==(G=ke(x[0].last_month.c)+"")&&J(X,G),ae&4&&J(j,x[2])},d(x){x&&$(e),x&&$(l),x&&$(n)}}}function cu(t){let e,l=ke(t[1].h.c,2)+"",n,i,o;return{c(){e=m("div"),n=E(l),i=h(),o=E(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].h.c,2)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function mu(t){let e,l=ke(t[1].d.c,1)+"",n,i,o;return{c(){e=m("div"),n=E(l),i=h(),o=E(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].d.c,1)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function _u(t){let e,l=ke(t[1].m.c)+"",n,i,o;return{c(){e=m("div"),n=E(l),i=h(),o=E(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].m.c)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function pu(t){let e,l=ke(t[0].last_month.c)+"",n,i,o;return{c(){e=m("div"),n=E(l),i=h(),o=E(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ke(u[0].last_month.c)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function du(t){let e,l=ke(t[1].h.i,2)+"",n,i,o;return{c(){e=m("div"),n=E(l),i=h(),o=E(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].h.i,2)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function vu(t){let e,l=ke(t[1].d.i,1)+"",n,i,o;return{c(){e=m("div"),n=E(l),i=h(),o=E(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].d.i,1)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function hu(t){let e,l=ke(t[1].m.i)+"",n,i,o;return{c(){e=m("div"),n=E(l),i=h(),o=E(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].m.i)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function bu(t){let e,l=ke(t[0].last_month.i)+"",n,i,o;return{c(){e=m("div"),n=E(l),i=h(),o=E(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ke(u[0].last_month.i)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function $m(t){let e,l,n,i,o,u,a=t[1]&&uu(t);return{c(){e=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){S(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=uu(c),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i:pe,o:pe,d(c){c&&$(e),a&&a.d()}}}function Sm(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 Mm extends Ie{constructor(e){super(),Re(this,e,Sm,$m,Ee,{sysinfo:0,data:1,currency:2,hasExport:3})}}function Tm(t){let e,l,n=Da(t[0].source)+"",i,o,u,a,c;return a=new mn({props:{config:t[1]}}),{c(){e=m("a"),l=E("Provided by: "),i=E(n),u=h(),re(a.$$.fragment),r(e,"href",o=Ra(t[0].source)),r(e,"target","_blank"),r(e,"class","text-xs float-right z-40")},m(f,_){S(f,e,_),s(e,l),s(e,i),S(f,u,_),ie(a,f,_),c=!0},p(f,[_]){(!c||_&1)&&n!==(n=Da(f[0].source)+"")&&J(i,n),(!c||_&1&&o!==(o=Ra(f[0].source)))&&r(e,"href",o);const p={};_&2&&(p.config=f[1]),a.$set(p)},i(f){c||(O(a.$$.fragment,f),c=!0)},o(f){q(a.$$.fragment,f),c=!1},d(f){f&&$(e),f&&$(u),se(a,f)}}}function Nm(t,e,l){let{json:n}=e,{sysinfo:i}=e,o={},u,a;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=[],g=[];l(4,a=l(3,u=0));let w=new Date;for(dl(w,i.clock_offset-(24+w.getHours()-w.getUTCHours())%24),_=f;_<24&&(p=n[Ue(b++)],p!=null);_++)d.push({label:Ue(w.getHours())}),g.push(p*100),l(4,a=Math.min(a,p*100)),l(3,u=Math.max(u,p*100)),dl(w,1);for(_=0;_<24&&(p=n[Ue(b++)],p!=null);_++)d.push({label:Ue(w.getHours())}),g.push(p*100),l(4,a=Math.min(a,p*100)),l(3,u=Math.max(u,p*100)),dl(w,1);if(a>-100&&u<100){switch(c){case"NOK":case"DKK":c="\xF8re";break;case"SEK":c="\xF6re";break;case"EUR":c="cent";break;case"CHF":c="rp.";break;default:c=c+"/100"}for(l(4,a*=100),l(3,u*=100),_=0;_=0?I.toFixed(F):"",title:I>=0?I.toFixed(2)+" "+c:"",value:p>=0?Math.abs(p):0,label2:I<0?I.toFixed(F):"",title2:I<0?I.toFixed(2)+" "+c:"",value2:p<0?Math.abs(p):0,color:"#7c3aed"})}let M=Math.max(u,Math.abs(a));if(a<0){l(4,a=Math.min(M/4*-1,a));let I=Math.ceil(Math.abs(a)/M*4),F=a/I;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=dl(new Date,-24),v=new Date().getUTCHours();for(dl(b,i.clock_offset-(24+b.getHours()-b.getUTCHours())%24),c=v;c<24;c++){let T=n["i"+Ue(c)],M=n["e"+Ue(c)];T===void 0&&(T=0),M===void 0&&(M=0),_.push({label:Ue(b.getHours())}),p.push({label:T.toFixed(1),title:T.toFixed(2)+" kWh",value:T*10,label2:M.toFixed(1),title2:M.toFixed(2)+" kWh",value2:M*10,color:"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,M*10)),l(3,u=Math.max(u,T*10)),dl(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(dl(b,i.clock_offset-(24+b.getHours()-b.getUTCHours())%24),dl(v,i.clock_offset-(24+v.getHours()-v.getUTCHours())%24),v.setDate(0),c=b.getDate();c<=v.getDate();c++){let T=n["i"+Ue(c)],M=n["e"+Ue(c)];T===void 0&&(T=0),M===void 0&&(M=0),_.push({label:Ue(c)}),p.push({label:T.toFixed(T<10?1:0),title:T.toFixed(2)+" kWh",value:T,label2:M.toFixed(M<10?1:0),title2:M.toFixed(2)+" kWh",value2:M,color:"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,M)),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,g)=>{var w=d.n?d.n:d.a;c=d.v,c==-127&&(c=0),_.push({label:w.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 Ie{constructor(e){super(),Re(this,e,Fm,Om,Ee,{json:1})}}function Bm(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}let Um=0;function jm(t,e,l){let n={},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?Ue(_.d)+"."+Ys[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 Ie{constructor(e){super(),Re(this,e,jm,Bm,Ee,{})}}function gu(t,e,l){const n=t.slice();return n[18]=e[l],n[20]=l,n}function ku(t,e,l){const n=t.slice();return n[21]=e[l],n}function wu(t){let e,l,n,i,o,u=t[7],a=[];for(let _=0;_t[14].call(e))},m(f,_){S(f,e,_),s(e,l),s(l,n),s(l,i),s(l,o),s(e,u),c&&c.m(e,null),a=mo(e,t[14].bind(e))},p(f,[_]){_&1024&&J(i,f[10]),f[7]?c?c.p(f,_):(c=wu(f),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i:pe,o:pe,d(f){f&&$(e),c&&c.d(),a()}}}let zm=12;function Gm(t,e,l){let n;Yc.subscribe(I=>{l(11,n=I)});let i,o=0;function u(){n.data.unshift(0),l(11,n.data=n.data.slice(0,n.size),n),o+=10,i=setTimeout(u,1e4)}Bc.subscribe(I=>{o>0?n.data&&I.u-o>=10&&(i&&clearTimeout(i),n.data.unshift(I.i-I.e),l(11,n.data=n.data.slice(0,n.size),n),o+=10,i=setTimeout(u,1e4)):o=I.u});let a,c,f,_,p,b,v,d,g,w,T,M,P;function L(){f=this.clientWidth,_=this.clientHeight,l(0,f),l(1,_)}return t.$$.update=()=>{if(t.$$.dirty&14847&&(l(2,p=parseInt(_)-50),l(3,b=f-35),l(9,M=b/n.size),l(13,c=0),l(12,a=0),n.data)){for(let F in n.data){let C=n.data[F];l(12,a=Math.max(Math.ceil(C/1e3)*1e3,a)),l(13,c=Math.min(Math.ceil(C/1e3)*1e3,c))}l(10,P=a>2500?"kW":"W"),l(7,w=[]);for(let F=c;F2500?(F/1e3).toFixed(1):F});l(8,T=[]);for(let F=c;F0||t[0].e>0}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&2&&(u.sysinfo=i[1]),o&1&&(u.data=i[0].ea),o&1&&(u.currency=i[0].pc),o&1&&(u.hasExport=i[0].om>0||i[0].e>0),l.$set(u)},i(i){n||(O(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Ru(t){let e,l,n;return l=new Hm({}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt h-64")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},i(i){n||(O(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Iu(t){let e,l,n;return l=new Vm({}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},i(i){n||(O(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Lu(t){let e,l,n;return l=new Em({props:{json:t[2],sysinfo:t[1]}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&4&&(u.json=i[2]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(O(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Ou(t){let e,l,n;return l=new Dm({props:{json:t[3],sysinfo:t[1]}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&8&&(u.json=i[3]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(O(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Fu(t){let e,l,n;return l=new Lm({props:{json:t[4],sysinfo:t[1]}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&16&&(u.json=i[4]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(O(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function qu(t){let e,l,n;return l=new qm({props:{json:t[5]}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&32&&(u.json=i[5]),l.$set(u)},i(i){n||(O(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Km(t){let e,l=Xe(t[1].ui.i,t[0].i),n,i=Xe(t[1].ui.e,t[0].om||t[0].e>0),o,u=Xe(t[1].ui.v,t[0].u1>100||t[0].u2>100||t[0].u3>100),a,c=Xe(t[1].ui.a,t[0].i1>.01||t[0].i2>.01||t[0].i3>.01),f,_=Xe(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),p,b=Xe(t[1].ui.c,t[0].ea),v,d=Xe(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),g,w=Xe(t[1].ui.l),T,M=Xe(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),P,L=Xe(t[1].ui.d,t[3]),I,F=Xe(t[1].ui.m,t[4]),C,R=Xe(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),ne,H=l&&Tu(t),z=i&&Nu(t),U=u&&Eu(t),K=c&&Au(t),Q=_&&Pu(t),G=b&&Du(t),X=d&&Ru(),Y=w&&Iu(),j=M&&Lu(t),x=L&&Ou(t),ae=F&&Fu(t),ee=R&&qu(t);return{c(){e=m("div"),H&&H.c(),n=h(),z&&z.c(),o=h(),U&&U.c(),a=h(),K&&K.c(),f=h(),Q&&Q.c(),p=h(),G&&G.c(),v=h(),X&&X.c(),g=h(),Y&&Y.c(),T=h(),j&&j.c(),P=h(),x&&x.c(),I=h(),ae&&ae.c(),C=h(),ee&&ee.c(),r(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(V,W){S(V,e,W),H&&H.m(e,null),s(e,n),z&&z.m(e,null),s(e,o),U&&U.m(e,null),s(e,a),K&&K.m(e,null),s(e,f),Q&&Q.m(e,null),s(e,p),G&&G.m(e,null),s(e,v),X&&X.m(e,null),s(e,g),Y&&Y.m(e,null),s(e,T),j&&j.m(e,null),s(e,P),x&&x.m(e,null),s(e,I),ae&&ae.m(e,null),s(e,C),ee&&ee.m(e,null),ne=!0},p(V,[W]){W&3&&(l=Xe(V[1].ui.i,V[0].i)),l?H?(H.p(V,W),W&3&&O(H,1)):(H=Tu(V),H.c(),O(H,1),H.m(e,n)):H&&(Ae(),q(H,1,1,()=>{H=null}),Pe()),W&3&&(i=Xe(V[1].ui.e,V[0].om||V[0].e>0)),i?z?(z.p(V,W),W&3&&O(z,1)):(z=Nu(V),z.c(),O(z,1),z.m(e,o)):z&&(Ae(),q(z,1,1,()=>{z=null}),Pe()),W&3&&(u=Xe(V[1].ui.v,V[0].u1>100||V[0].u2>100||V[0].u3>100)),u?U?(U.p(V,W),W&3&&O(U,1)):(U=Eu(V),U.c(),O(U,1),U.m(e,a)):U&&(Ae(),q(U,1,1,()=>{U=null}),Pe()),W&3&&(c=Xe(V[1].ui.a,V[0].i1>.01||V[0].i2>.01||V[0].i3>.01)),c?K?(K.p(V,W),W&3&&O(K,1)):(K=Au(V),K.c(),O(K,1),K.m(e,f)):K&&(Ae(),q(K,1,1,()=>{K=null}),Pe()),W&3&&(_=Xe(V[1].ui.r,V[0].ri>0||V[0].re>0||V[0].ric>0||V[0].rec>0)),_?Q?(Q.p(V,W),W&3&&O(Q,1)):(Q=Pu(V),Q.c(),O(Q,1),Q.m(e,p)):Q&&(Ae(),q(Q,1,1,()=>{Q=null}),Pe()),W&3&&(b=Xe(V[1].ui.c,V[0].ea)),b?G?(G.p(V,W),W&3&&O(G,1)):(G=Du(V),G.c(),O(G,1),G.m(e,v)):G&&(Ae(),q(G,1,1,()=>{G=null}),Pe()),W&3&&(d=Xe(V[1].ui.t,V[0].pr&&(V[0].pr.startsWith("10YNO")||V[0].pr.startsWith("10Y1001A1001A4")))),d?X?W&3&&O(X,1):(X=Ru(),X.c(),O(X,1),X.m(e,g)):X&&(Ae(),q(X,1,1,()=>{X=null}),Pe()),W&2&&(w=Xe(V[1].ui.l)),w?Y?W&2&&O(Y,1):(Y=Iu(),Y.c(),O(Y,1),Y.m(e,T)):Y&&(Ae(),q(Y,1,1,()=>{Y=null}),Pe()),W&3&&(M=Xe(V[1].ui.p,V[0].pe&&!Number.isNaN(V[0].p))),M?j?(j.p(V,W),W&3&&O(j,1)):(j=Lu(V),j.c(),O(j,1),j.m(e,P)):j&&(Ae(),q(j,1,1,()=>{j=null}),Pe()),W&10&&(L=Xe(V[1].ui.d,V[3])),L?x?(x.p(V,W),W&10&&O(x,1)):(x=Ou(V),x.c(),O(x,1),x.m(e,I)):x&&(Ae(),q(x,1,1,()=>{x=null}),Pe()),W&18&&(F=Xe(V[1].ui.m,V[4])),F?ae?(ae.p(V,W),W&18&&O(ae,1)):(ae=Fu(V),ae.c(),O(ae,1),ae.m(e,C)):ae&&(Ae(),q(ae,1,1,()=>{ae=null}),Pe()),W&35&&(R=Xe(V[1].ui.s,V[0].t&&V[0].t!=-127&&V[5].c>1)),R?ee?(ee.p(V,W),W&35&&O(ee,1)):(ee=qu(V),ee.c(),O(ee,1),ee.m(e,null)):ee&&(Ae(),q(ee,1,1,()=>{ee=null}),Pe())},i(V){ne||(O(H),O(z),O(U),O(K),O(Q),O(G),O(X),O(Y),O(j),O(x),O(ae),O(ee),ne=!0)},o(V){q(H),q(z),q(U),q(K),q(Q),q(G),q(X),q(Y),q(j),q(x),q(ae),q(ee),ne=!1},d(V){V&&$(e),H&&H.d(),z&&z.d(),U&&U.d(),K&&K.d(),Q&&Q.d(),G&&G.d(),X&&X.d(),Y&&Y.d(),j&&j.d(),x&&x.d(),ae&&ae.d(),ee&&ee.d()}}}function Ym(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},u={},a={},c={};return go.subscribe(f=>{l(2,o=f)}),Hc.subscribe(f=>{l(3,u=f)}),Wc.subscribe(f=>{l(4,a=f)}),Gc.subscribe(f=>{l(5,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 Qm extends Ie{constructor(e){super(),Re(this,e,Ym,Km,Ee,{data:0,sysinfo:1})}}let lo={};const hi=it(lo);async function Xm(){lo=await(await fetch("/configuration.json")).json(),hi.set(lo)}let no={};const e1=it(no);async function Zm(){no=await(await fetch("/priceconfig.json")).json(),e1.set(no)}function Bu(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Jm(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function xm(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Uu(t){let e;return{c(){e=m("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function ju(t){let e,l,n;return{c(){e=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){S(i,e,o),S(i,l,o),S(i,n,o)},d(i){i&&$(e),i&&$(l),i&&$(n)}}}function Hu(t){let e;return{c(){e=m("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Wu(t){let e,l,n;return{c(){e=m("option"),l=E("GPIO"),n=E(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){S(i,e,o),s(e,l),s(e,n)},d(i){i&&$(e)}}}function zu(t){let e,l=t[4]>1&&!(t[0]=="esp32"&&(t[4]==9||t[4]==16))&&!((t[0]=="esp32s2"||t[0]=="esp32s3")&&t[4]==18)&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Wu(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),S(n,e,i)},p(n,i){n[4]>1&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!((n[0]=="esp32s2"||n[0]=="esp32s3")&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Wu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&$(e)}}}function e_(t){let e,l,n,i,o;function u(d,g){return d[0]=="esp32c3"?xm:Jm}let a=u(t),c=a(t),f=t[0]=="esp8266"&&Uu(),_=(t[0]=="esp32"||t[0]=="esp32solo")&&ju(),p=(t[0]=="esp32s2"||t[0]=="esp32s3")&&Hu(),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"esp32s3":l(1,i=46);break;case"esp32c3":l(1,i=19);break}},[n,i]}class io extends Ie{constructor(e){super(),Re(this,e,t_,e_,Ee,{chip:0})}}function Gu(t){let e,l,n=t[1]&&Vu(t);return{c(){e=m("div"),l=m("div"),n&&n.c(),r(l,"class","fixed inset-0 bg-gray-500 dark:bg-gray-900 bg-opacity-50 flex items-center justify-center"),r(e,"class","z-50"),r(e,"aria-modal","true")},m(i,o){S(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=Vu(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&$(e),n&&n.d()}}}function Vu(t){let e,l;return{c(){e=m("div"),l=E(t[1]),r(e,"class","bg-white dark:bg-gray-600 m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 dark:text-white w-96")},m(n,i){S(n,e,i),s(e,l)},p(n,i){i&2&&J(l,n[1])},d(n){n&&$(e)}}}function l_(t){let e,l=t[0]&&Gu(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),S(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Gu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:pe,o:pe,d(n){l&&l.d(n),n&&$(e)}}}function n_(t,e,l){let{active:n}=e,{message:i}=e;return t.$$set=o=>{"active"in o&&l(0,n=o.active),"message"in o&&l(1,i=o.message)},[n,i]}class kt extends Ie{constructor(e){super(),Re(this,e,n_,l_,Ee,{active:0,message:1})}}function Ku(t,e,l){const n=t.slice();return n[1]=e[l],n}function Yu(t){let e,l,n=t[1]+"",i;return{c(){e=m("option"),l=E("Europe/"),i=E(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,u){S(o,e,u),s(e,l),s(e,i)},p:pe,d(o){o&&$(e)}}}function i_(t){let e,l,n,i=t[0],o=[];for(let u=0;u>1&1,A=0;A0;y--)A[y]=A[y]?A[y-1]^I.EXPONENT[R._modN(I.LOG[A[y]]+N)]:A[y-1];A[0]=I.EXPONENT[R._modN(I.LOG[A[0]]+N)]}for(N=0;N<=k;N++)A[N]=I.LOG[A[N]]},_checkBadness:function(){var N,y,k,A,D,Z=0,le=this._badness,fe=this.buffer,de=this.width;for(D=0;Dde*de;)ue-=de*de,Oe++;for(Z+=Oe*R.N4,A=0;A=le-2&&(N=le-2,D>9&&N--);var fe=N;if(D>9){for(Z[fe+2]=0,Z[fe+3]=0;fe--;)y=Z[fe],Z[fe+3]|=255&y<<4,Z[fe+2]=y>>4;Z[2]|=255&N<<4,Z[1]=N>>4,Z[0]=64|N>>12}else{for(Z[fe+1]=0,Z[fe+2]=0;fe--;)y=Z[fe],Z[fe+2]|=255&y<<4,Z[fe+1]=y>>4;Z[1]|=255&N<<4,Z[0]=64|N>>4}for(fe=N+3-(D<10);fe=5&&(k+=R.N1+A[y]-5);for(y=3;yN||A[y-3]*3>=A[y]*4||A[y+3]*3>=A[y]*4)&&(k+=R.N3);return k},_finish:function(){this._stringBuffer=this.buffer.slice();var N,y,k=0,A=3e4;for(y=0;y<8&&(this._applyMask(y),N=this._checkBadness(),N>=1)A&1&&(D[Z-1-y+Z*8]=1,y<6?D[8+Z*y]=1:D[8+Z*(y+1)]=1);for(y=0;y<7;y++,A>>=1)A&1&&(D[8+Z*(Z-7+y)]=1,y?D[6-y+Z*8]=1:D[7+Z*8]=1)},_interleaveBlocks:function(){var N,y,k=this._dataBlock,A=this._ecc,D=this._eccBlock,Z=0,le=this._calculateMaxLength(),fe=this._neccBlock1,de=this._neccBlock2,Ce=this._stringBuffer;for(N=0;N1)for(N=T.BLOCK[A],k=D-7;;){for(y=D-7;y>N-3&&(this._addAlignment(y,k),!(y6)for(N=C.BLOCK[Z-7],y=17,k=0;k<6;k++)for(A=0;A<3;A++,y--)1&(y>11?Z>>y-12:N>>y)?(D[5-k+le*(2-A+le-11)]=1,D[2-A+le-11+le*(5-k)]=1):(this._setMask(5-k,2-A+le-11),this._setMask(2-A+le-11,5-k))},_isMasked:function(N,y){var k=R._getMaskBit(N,y);return this._mask[k]===1},_pack:function(){var N,y,k,A=1,D=1,Z=this.width,le=Z-1,fe=Z-1,de=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(y=0;yy&&(k=N,N=y,y=k),k=y,k+=y*y,k>>=1,k+=N,k},_modN:function(N){for(;N>=255;)N-=255,N=(N>>8)+(N&255);return N},N1:3,N2:3,N3:40,N4:10}),ne=R,H=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var N=this.element;N.width=N.height=this.qrious.size}}),z=H,U=p.extend(function(N,y,k,A){this.name=N,this.modifiable=Boolean(y),this.defaultValue=k,this._valueTransformer=A},{transform:function(N){var y=this._valueTransformer;return typeof y=="function"?y(N,this):N}}),K=U,Q=p.extend(null,{abs:function(N){return N!=null?Math.abs(N):null},hasOwn:function(N,y){return Object.prototype.hasOwnProperty.call(N,y)},noop:function(){},toUpperCase:function(N){return N!=null?N.toUpperCase():null}}),G=Q,X=p.extend(function(N){this.options={},N.forEach(function(y){this.options[y.name]=y},this)},{exists:function(N){return this.options[N]!=null},get:function(N,y){return X._get(this.options[N],y)},getAll:function(N){var y,k=this.options,A={};for(y in k)G.hasOwn(k,y)&&(A[y]=X._get(k[y],N));return A},init:function(N,y,k){typeof k!="function"&&(k=G.noop);var A,D;for(A in this.options)G.hasOwn(this.options,A)&&(D=this.options[A],X._set(D,D.defaultValue,y),X._createAccessor(D,y,k));this._setAll(N,y,!0)},set:function(N,y,k){return this._set(N,y,k)},setAll:function(N,y){return this._setAll(N,y)},_set:function(N,y,k,A){var D=this.options[N];if(!D)throw new Error("Invalid option: "+N);if(!D.modifiable&&!A)throw new Error("Option cannot be modified: "+N);return X._set(D,y,k)},_setAll:function(N,y,k){if(!N)return!1;var A,D=!1;for(A in N)G.hasOwn(N,A)&&this._set(A,N[A],y,k)&&(D=!0);return D}},{_createAccessor:function(N,y,k){var A={get:function(){return X._get(N,y)}};N.modifiable&&(A.set=function(D){X._set(N,D,y)&&k(D,N)}),Object.defineProperty(y,N.name,A)},_get:function(N,y){return y["_"+N.name]},_set:function(N,y,k){var A="_"+N.name,D=k[A],Z=N.transform(y!=null?y:N.defaultValue);return k[A]=Z,Z!==D}}),Y=X,j=p.extend(function(){this._services={}},{getService:function(N){var y=this._services[N];if(!y)throw new Error("Service is not being managed with name: "+N);return y},setService:function(N,y){if(this._services[N])throw new Error("Service is already managed with name: "+N);y&&(this._services[N]=y)}}),x=j,ae=new Y([new K("background",!0,"white"),new K("backgroundAlpha",!0,1,G.abs),new K("element"),new K("foreground",!0,"black"),new K("foregroundAlpha",!0,1,G.abs),new K("level",!0,"L",G.toUpperCase),new K("mime",!0,"image/png"),new K("padding",!0,null,G.abs),new K("size",!0,100,G.abs),new K("value",!0,"")]),ee=new x,V=p.extend(function(N){ae.init(N,this,this.update.bind(this));var y=ae.get("element",this),k=ee.getService("element"),A=y&&k.isCanvas(y)?y:k.createCanvas(),D=y&&k.isImage(y)?y:k.createImage();this._canvasRenderer=new g(this,A,!0),this._imageRenderer=new z(this,D,D===y),this.update()},{get:function(){return ae.getAll(this)},set:function(N){ae.setAll(N,this)&&this.update()},toDataURL:function(N){return this.canvas.toDataURL(N||this.mime)},update:function(){var N=new ne({level:this.level,value:this.value});this._canvasRenderer.render(N),this._imageRenderer.render(N)}},{use:function(N){ee.setService(N.getName(),N)}});Object.defineProperties(V.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var W=V,we=W,He=p.extend({getName:function(){}}),Le=He,Se=Le.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(N){},isImage:function(N){}}),ye=Se,ve=ye.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(N){return N instanceof HTMLCanvasElement},isImage:function(N){return N instanceof HTMLImageElement}}),Te=ve;we.use(new Te);var be=we;return be})})(l1);const f_=l1.exports;function c_(t){let e,l;return{c(){e=m("img"),Ws(e.src,l=t[2])||r(e,"src",l),r(e,"alt",t[0]),r(e,"class",t[1])},m(n,i){S(n,e,i)},p(n,[i]){i&4&&!Ws(e.src,l=n[2])&&r(e,"src",l),i&1&&r(e,"alt",n[0]),i&2&&r(e,"class",n[1])},i:pe,o:pe,d(n){n&&$(e)}}}function m_(t,e,l){const n=new f_;let{errorCorrection:i="L"}=e,{background:o="#fff"}=e,{color:u="#000"}=e,{size:a="200"}=e,{value: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 ac(()=>{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 __ extends Ie{constructor(e){super(),Re(this,e,m_,c_,Ee,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function Qu(t,e,l){const n=t.slice();return n[101]=e[l],n[102]=e,n[103]=l,n}function Xu(t,e,l){const n=t.slice();return n[104]=e[l],n[105]=e,n[106]=l,n}function p_(t,e,l){const n=t.slice();return n[107]=e[l],n}function d_(t,e,l){const n=t.slice();return n[110]=e[l],n}function v_(t){let e,l;return{c(){e=m("option"),l=E(t[110]),e.__value=t[110],e.value=e.__value},m(n,i){S(n,e,i),s(e,l)},p:pe,d(n){n&&$(e)}}}function h_(t){let e;return{c(){e=E("Configure price")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Zu(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){S(o,e,u),S(o,l,u),oe(l,t[3].p.t),n||(i=te(l,"input",t[20]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].p.t&&oe(l,o[3].p.t)},d(o){o&&$(e),o&&$(l),n=!1,i()}}}function Ju(t){let e,l,n,i,o,u,a,c,f,_,p,b,v;return{c(){e=m("div"),l=E("Username"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=E("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,g){S(d,e,g),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].g.u),S(d,u,g),S(d,a,g),s(a,c),s(a,f),s(a,_),s(a,p),oe(p,t[3].g.p),b||(v=[te(o,"input",t[22]),te(p,"input",t[23])],b=!0)},p(d,g){g[0]&8&&o.value!==d[3].g.u&&oe(o,d[3].g.u),g[0]&8&&p.value!==d[3].g.p&&oe(p,d[3].g.p)},d(d){d&&$(e),d&&$(u),d&&$(a),b=!1,ze(v)}}}function b_(t){let e,l=t[107]*100+"",n;return{c(){e=m("option"),n=E(l),e.__value=t[107]*100,e.value=e.__value},m(i,o){S(i,e,o),s(e,n)},p:pe,d(i){i&&$(e)}}}function xu(t){let e,l,n,i;return{c(){e=m("br"),l=m("input"),r(l,"name","mek"),r(l,"type","text"),r(l,"class","in-s")},m(o,u){S(o,e,u),S(o,l,u),oe(l,t[3].m.e.k),n||(i=te(l,"input",t[33]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].m.e.k&&oe(l,o[3].m.e.k)},d(o){o&&$(e),o&&$(l),n=!1,i()}}}function ef(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=E("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){S(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].m.e.a),u||(a=te(o,"input",t[34]),u=!0)},p(c,f){f[0]&8&&o.value!==c[3].m.e.a&&oe(o,c[3].m.e.a)},d(c){c&&$(e),u=!1,a()}}}function tf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H;return{c(){e=m("div"),l=m("div"),n=E("Watt"),i=m("br"),o=h(),u=m("input"),a=h(),c=m("div"),f=E("Volt"),_=m("br"),p=h(),b=m("input"),v=h(),d=m("div"),g=E("Amp"),w=m("br"),T=h(),M=m("input"),P=h(),L=m("div"),I=E("kWh"),F=m("br"),C=h(),R=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(M,"name","mma"),r(M,"type","number"),r(M,"min","0.00"),r(M,"max","1000"),r(M,"step","0.001"),r(M,"class","in-m tr w-full"),r(d,"class","w-1/4"),r(R,"name","mmc"),r(R,"type","number"),r(R,"min","0.00"),r(R,"max","1000"),r(R,"step","0.001"),r(R,"class","in-l tr w-full"),r(L,"class","w-1/4"),r(e,"class","flex my-1")},m(z,U){S(z,e,U),s(e,l),s(l,n),s(l,i),s(l,o),s(l,u),oe(u,t[3].m.m.w),s(e,a),s(e,c),s(c,f),s(c,_),s(c,p),s(c,b),oe(b,t[3].m.m.v),s(e,v),s(e,d),s(d,g),s(d,w),s(d,T),s(d,M),oe(M,t[3].m.m.a),s(e,P),s(e,L),s(L,I),s(L,F),s(L,C),s(L,R),oe(R,t[3].m.m.c),ne||(H=[te(u,"input",t[36]),te(b,"input",t[37]),te(M,"input",t[38]),te(R,"input",t[39])],ne=!0)},p(z,U){U[0]&8&&ge(u.value)!==z[3].m.m.w&&oe(u,z[3].m.m.w),U[0]&8&&ge(b.value)!==z[3].m.m.v&&oe(b,z[3].m.m.v),U[0]&8&&ge(M.value)!==z[3].m.m.a&&oe(M,z[3].m.m.a),U[0]&8&&ge(R.value)!==z[3].m.m.c&&oe(R,z[3].m.m.c)},d(z){z&&$(e),ne=!1,ze(H)}}}function lf(t){let e;return{c(){e=m("option"),e.textContent="Ethernet",e.__value=3,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function nf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V;return{c(){e=m("div"),l=E("SSID"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=E("Password"),f=m("br"),_=h(),p=m("input"),b=h(),v=m("div"),d=m("div"),g=E("Power saving"),w=m("br"),T=h(),M=m("select"),P=m("option"),P.textContent="Default",L=m("option"),L.textContent="Off",I=m("option"),I.textContent="Minimum",F=m("option"),F.textContent="Maximum",C=h(),R=m("div"),ne=E("Power"),H=m("br"),z=h(),U=m("div"),K=m("input"),Q=h(),G=m("span"),G.textContent="dBm",X=h(),Y=m("div"),j=m("label"),x=m("input"),ae=E(" Allow 802.11b legacy rates"),r(o,"name","ws"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(p,"name","wp"),r(p,"type","password"),r(p,"class","in-s"),r(a,"class","my-1"),P.__value=255,P.value=P.__value,L.__value=0,L.value=L.__value,I.__value=1,I.value=I.__value,F.__value=2,F.value=F.__value,r(M,"name","wz"),r(M,"class","in-s"),t[3].w.z===void 0&&We(()=>t[43].call(M)),r(d,"class","w-1/2"),r(K,"name","ww"),r(K,"type","number"),r(K,"min","0"),r(K,"max","20.5"),r(K,"step","0.5"),r(K,"class","in-f tr w-full"),r(G,"class","in-post"),r(U,"class","flex"),r(R,"class","ml-2 w-1/2"),r(v,"class","my-1 flex"),r(x,"type","checkbox"),r(x,"name","wb"),x.__value="true",x.value=x.__value,r(x,"class","rounded mb-1"),r(Y,"class","my-3")},m(W,we){S(W,e,we),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].w.s),S(W,u,we),S(W,a,we),s(a,c),s(a,f),s(a,_),s(a,p),oe(p,t[3].w.p),S(W,b,we),S(W,v,we),s(v,d),s(d,g),s(d,w),s(d,T),s(d,M),s(M,P),s(M,L),s(M,I),s(M,F),$e(M,t[3].w.z,!0),s(v,C),s(v,R),s(R,ne),s(R,H),s(R,z),s(R,U),s(U,K),oe(K,t[3].w.w),s(U,Q),s(U,G),S(W,X,we),S(W,Y,we),s(Y,j),s(j,x),x.checked=t[3].w.b,s(j,ae),ee||(V=[te(o,"input",t[41]),te(p,"input",t[42]),te(M,"change",t[43]),te(K,"input",t[44]),te(x,"change",t[45])],ee=!0)},p(W,we){we[0]&8&&o.value!==W[3].w.s&&oe(o,W[3].w.s),we[0]&8&&p.value!==W[3].w.p&&oe(p,W[3].w.p),we[0]&8&&$e(M,W[3].w.z),we[0]&8&&ge(K.value)!==W[3].w.w&&oe(K,W[3].w.w),we[0]&8&&(x.checked=W[3].w.b)},d(W){W&&$(e),W&&$(u),W&&$(a),W&&$(b),W&&$(v),W&&$(X),W&&$(Y),ee=!1,ze(V)}}}function sf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w;return{c(){e=m("div"),l=E("Gateway"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=E("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,M){S(T,e,M),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].n.g),S(T,u,M),S(T,a,M),s(a,c),s(a,f),s(a,_),s(a,p),s(p,b),oe(b,t[3].n.d1),s(p,v),s(p,d),oe(d,t[3].n.d2),g||(w=[te(o,"input",t[49]),te(b,"input",t[50]),te(d,"input",t[51])],g=!0)},p(T,M){M[0]&8&&o.value!==T[3].n.g&&oe(o,T[3].n.g),M[0]&8&&b.value!==T[3].n.d1&&oe(b,T[3].n.d1),M[0]&8&&d.value!==T[3].n.d2&&oe(d,T[3].n.d2)},d(T){T&&$(e),T&&$(u),T&&$(a),g=!1,ze(w)}}}function of(t){let e,l,n,i,o;return{c(){e=m("label"),l=m("input"),n=E(" SSL"),r(l,"type","checkbox"),r(l,"name","qs"),l.__value="true",l.value=l.__value,r(l,"class","rounded mb-1"),r(e,"class","float-right mr-3")},m(u,a){S(u,e,a),s(e,l),l.checked=t[3].q.s.e,s(e,n),i||(o=[te(l,"change",t[55]),te(l,"change",t[14])],i=!0)},p(u,a){a[0]&8&&(l.checked=u[3].q.s.e)},d(u){u&&$(e),i=!1,ze(o)}}}function rf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v;const d=[k_,g_],g=[];function w(C,R){return C[3].q.s.c?0:1}n=w(t),i=g[n]=d[n](t);const T=[$_,C_],M=[];function P(C,R){return C[3].q.s.r?0:1}a=P(t),c=M[a]=T[a](t);const L=[N_,T_],I=[];function F(C,R){return C[3].q.s.k?0:1}return p=F(t),b=I[p]=L[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(C,R){S(C,e,R),s(e,l),g[n].m(l,null),s(e,o),s(e,u),M[a].m(u,null),s(e,f),s(e,_),I[p].m(_,null),v=!0},p(C,R){let ne=n;n=w(C),n===ne?g[n].p(C,R):(Ae(),q(g[ne],1,1,()=>{g[ne]=null}),Pe(),i=g[n],i?i.p(C,R):(i=g[n]=d[n](C),i.c()),O(i,1),i.m(l,null));let H=a;a=P(C),a===H?M[a].p(C,R):(Ae(),q(M[H],1,1,()=>{M[H]=null}),Pe(),c=M[a],c?c.p(C,R):(c=M[a]=T[a](C),c.c()),O(c,1),c.m(u,null));let z=p;p=F(C),p===z?I[p].p(C,R):(Ae(),q(I[z],1,1,()=>{I[z]=null}),Pe(),b=I[p],b?b.p(C,R):(b=I[p]=L[p](C),b.c()),O(b,1),b.m(_,null))},i(C){v||(O(i),O(c),O(b),v=!0)},o(C){q(i),q(c),q(b),v=!1},d(C){C&&$(e),g[n].d(),M[a].d(),I[p].d()}}}function g_(t){let e,l;return e=new Qt({props:{to:"/mqtt-ca",$$slots:{default:[w_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i[3]&1048576&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function k_(t){let e,l,n,i,o,u,a,c;return l=new Qt({props:{to:"/mqtt-ca",$$slots:{default:[y_]},$$scope:{ctx:t}}}),o=new gs({}),{c(){e=m("span"),re(l.$$.fragment),n=h(),i=m("span"),re(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){S(f,e,_),ie(l,e,null),S(f,n,_),S(f,i,_),ie(o,i,null),u=!0,a||(c=[te(i,"click",t[11]),te(i,"keypress",t[11])],a=!0)},p(f,_){const p={};_[3]&1048576&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(O(l.$$.fragment,f),O(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&$(e),se(l),f&&$(n),f&&$(i),se(o),a=!1,ze(c)}}}function w_(t){let e,l;return e=new an({props:{color:"blue",text:"Upload CA",title:"Click here to upload CA"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function y_(t){let e;return{c(){e=E("CA OK")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function C_(t){let e,l;return e=new Qt({props:{to:"/mqtt-cert",$$slots:{default:[S_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i[3]&1048576&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function $_(t){let e,l,n,i,o,u,a,c;return l=new Qt({props:{to:"/mqtt-cert",$$slots:{default:[M_]},$$scope:{ctx:t}}}),o=new gs({}),{c(){e=m("span"),re(l.$$.fragment),n=h(),i=m("span"),re(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){S(f,e,_),ie(l,e,null),S(f,n,_),S(f,i,_),ie(o,i,null),u=!0,a||(c=[te(i,"click",t[12]),te(i,"keypress",t[12])],a=!0)},p(f,_){const p={};_[3]&1048576&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(O(l.$$.fragment,f),O(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&$(e),se(l),f&&$(n),f&&$(i),se(o),a=!1,ze(c)}}}function S_(t){let e,l;return e=new an({props:{color:"blue",text:"Upload cert",title:"Click here to upload certificate"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function M_(t){let e;return{c(){e=E("Cert OK")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function T_(t){let e,l;return e=new Qt({props:{to:"/mqtt-key",$$slots:{default:[E_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i[3]&1048576&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function N_(t){let e,l,n,i,o,u,a,c;return l=new Qt({props:{to:"/mqtt-key",$$slots:{default:[A_]},$$scope:{ctx:t}}}),o=new gs({}),{c(){e=m("span"),re(l.$$.fragment),n=h(),i=m("span"),re(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){S(f,e,_),ie(l,e,null),S(f,n,_),S(f,i,_),ie(o,i,null),u=!0,a||(c=[te(i,"click",t[13]),te(i,"keypress",t[13])],a=!0)},p(f,_){const p={};_[3]&1048576&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(O(l.$$.fragment,f),O(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&$(e),se(l),f&&$(n),f&&$(i),se(o),a=!1,ze(c)}}}function E_(t){let e,l;return e=new an({props:{color:"blue",text:"Upload key",title:"Click here to upload key"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function A_(t){let e;return{c(){e=E("Key OK")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function af(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G,X;return o=new Rt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Domoticz",n=h(),i=m("a"),re(o.$$.fragment),u=h(),a=m("input"),c=h(),f=m("div"),_=m("div"),p=E("Electricity IDX"),b=m("br"),v=h(),d=m("input"),g=h(),w=m("div"),T=E("Current IDX"),M=m("br"),P=h(),L=m("input"),I=h(),F=m("div"),C=E(`Voltage IDX: L1, L2 & L3 - `),R=m("div"),ne=m("input"),H=h(),z=m("input"),U=h(),K=m("input"),r(l,"class","text-sm"),r(i,"href",It("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(L,"name","oc"),r(L,"type","text"),r(L,"class","in-l tr w-full"),r(w,"class","w-1/2"),r(f,"class","my-1 flex"),r(ne,"name","ou1"),r(ne,"type","text"),r(ne,"class","in-f tr w-1/3"),r(z,"name","ou2"),r(z,"type","text"),r(z,"class","in-m tr w-1/3"),r(K,"name","ou3"),r(K,"type","text"),r(K,"class","in-l tr w-1/3"),r(R,"class","flex"),r(F,"class","my-1"),r(e,"class","cnt")},m(Y,j){S(Y,e,j),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,_),s(_,p),s(_,b),s(_,v),s(_,d),oe(d,t[3].o.e),s(f,g),s(f,w),s(w,T),s(w,M),s(w,P),s(w,L),oe(L,t[3].o.c),s(e,I),s(e,F),s(F,C),s(F,R),s(R,ne),oe(ne,t[3].o.u1),s(R,H),s(R,z),oe(z,t[3].o.u2),s(R,U),s(R,K),oe(K,t[3].o.u3),Q=!0,G||(X=[te(d,"input",t[63]),te(L,"input",t[64]),te(ne,"input",t[65]),te(z,"input",t[66]),te(K,"input",t[67])],G=!0)},p(Y,j){j[0]&8&&d.value!==Y[3].o.e&&oe(d,Y[3].o.e),j[0]&8&&L.value!==Y[3].o.c&&oe(L,Y[3].o.c),j[0]&8&&ne.value!==Y[3].o.u1&&oe(ne,Y[3].o.u1),j[0]&8&&z.value!==Y[3].o.u2&&oe(z,Y[3].o.u2),j[0]&8&&K.value!==Y[3].o.u3&&oe(K,Y[3].o.u3)},i(Y){Q||(O(o.$$.fragment,Y),Q=!0)},o(Y){q(o.$$.fragment,Y),Q=!1},d(Y){Y&&$(e),se(o),G=!1,ze(X)}}}function uf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K;return o=new Rt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Home-Assistant",n=h(),i=m("a"),re(o.$$.fragment),u=h(),a=m("input"),c=h(),f=m("div"),_=E("Discovery topic prefix"),p=m("br"),b=h(),v=m("input"),d=h(),g=m("div"),w=E("Hostname for URL"),T=m("br"),M=h(),P=m("input"),I=h(),F=m("div"),C=E("Name tag"),R=m("br"),ne=h(),H=m("input"),r(l,"class","text-sm"),r(i,"href",It("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(P,"name","hh"),r(P,"type","text"),r(P,"class","in-s"),r(P,"placeholder",L=t[3].g.h+".local"),r(g,"class","my-1"),r(H,"name","hn"),r(H,"type","text"),r(H,"class","in-s"),r(F,"class","my-1"),r(e,"class","cnt")},m(Q,G){S(Q,e,G),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,_),s(f,p),s(f,b),s(f,v),oe(v,t[3].h.t),s(e,d),s(e,g),s(g,w),s(g,T),s(g,M),s(g,P),oe(P,t[3].h.h),s(e,I),s(e,F),s(F,C),s(F,R),s(F,ne),s(F,H),oe(H,t[3].h.n),z=!0,U||(K=[te(v,"input",t[68]),te(P,"input",t[69]),te(H,"input",t[70])],U=!0)},p(Q,G){G[0]&8&&v.value!==Q[3].h.t&&oe(v,Q[3].h.t),(!z||G[0]&8&&L!==(L=Q[3].g.h+".local"))&&r(P,"placeholder",L),G[0]&8&&P.value!==Q[3].h.h&&oe(P,Q[3].h.h),G[0]&8&&H.value!==Q[3].h.n&&oe(H,Q[3].h.n)},i(Q){z||(O(o.$$.fragment,Q),z=!0)},o(Q){q(o.$$.fragment,Q),z=!1},d(Q){Q&&$(e),se(o),U=!1,ze(K)}}}function ff(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G,X,Y,j,x,ae;o=new Rt({});let ee=t[3].c.es&&cf(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Cloud connections",n=h(),i=m("a"),re(o.$$.fragment),u=h(),a=m("input"),c=h(),f=m("div"),_=m("label"),p=m("input"),b=E(" Enable cloud upload"),v=h(),d=m("div"),g=E("Client ID"),w=m("br"),T=h(),M=m("input"),I=h(),F=m("div"),C=E("Client secret"),R=m("br"),ne=h(),H=m("input"),U=h(),K=m("div"),Q=m("label"),G=m("input"),X=E(" Energy Speedometer"),Y=h(),ee&&ee.c(),r(l,"class","text-sm"),r(i,"href",It("Cloud")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","c"),a.value="true",r(p,"type","checkbox"),r(p,"name","ce"),p.__value="true",p.value=p.__value,r(p,"class","rounded mb-1"),r(f,"class","my-1"),r(M,"name","ci"),r(M,"type","text"),r(M,"class","in-s"),r(M,"pattern",P=t[3].c.e?"[A-Z0-9]{16}":".*"),M.required=L=t[3].c.e,r(d,"class","my-1"),r(H,"name","cs"),r(H,"type","text"),r(H,"class","in-s"),r(H,"pattern",z=t[3].c.e&&t[3].c.s!="***"?"[A-Z0-9]{16}":".*"),r(F,"class","my-1"),r(G,"type","checkbox"),r(G,"class","rounded mb-1"),r(G,"name","ces"),G.__value="true",G.value=G.__value,r(K,"class","my-1"),r(e,"class","cnt")},m(V,W){S(V,e,W),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,_),s(_,p),p.checked=t[3].c.e,s(_,b),s(e,v),s(e,d),s(d,g),s(d,w),s(d,T),s(d,M),oe(M,t[3].c.i),s(e,I),s(e,F),s(F,C),s(F,R),s(F,ne),s(F,H),oe(H,t[3].c.s),s(e,U),s(e,K),s(K,Q),s(Q,G),G.checked=t[3].c.es,s(Q,X),s(K,Y),ee&&ee.m(K,null),j=!0,x||(ae=[te(p,"change",t[71]),te(M,"input",t[72]),te(H,"input",t[73]),te(G,"change",t[74])],x=!0)},p(V,W){W[0]&8&&(p.checked=V[3].c.e),(!j||W[0]&8&&P!==(P=V[3].c.e?"[A-Z0-9]{16}":".*"))&&r(M,"pattern",P),(!j||W[0]&8&&L!==(L=V[3].c.e))&&(M.required=L),W[0]&8&&M.value!==V[3].c.i&&oe(M,V[3].c.i),(!j||W[0]&8&&z!==(z=V[3].c.e&&V[3].c.s!="***"?"[A-Z0-9]{16}":".*"))&&r(H,"pattern",z),W[0]&8&&H.value!==V[3].c.s&&oe(H,V[3].c.s),W[0]&8&&(G.checked=V[3].c.es),V[3].c.es?ee?(ee.p(V,W),W[0]&8&&O(ee,1)):(ee=cf(V),ee.c(),O(ee,1),ee.m(K,null)):ee&&(Ae(),q(ee,1,1,()=>{ee=null}),Pe())},i(V){j||(O(o.$$.fragment,V),O(ee),j=!0)},o(V){q(o.$$.fragment,V),q(ee),j=!1},d(V){V&&$(e),se(o),ee&&ee.d(),x=!1,ze(ae)}}}function cf(t){let e,l,n=t[0].mac+"",i,o,u,a,c=(t[0].meter.id?t[0].meter.id:"missing, required")+"",f,_,p,b,v=t[0].mac&&t[0].meter.id&&mf(t);return{c(){e=m("div"),l=E("MAC: "),i=E(n),o=h(),u=m("div"),a=E("Meter ID: "),f=E(c),_=h(),v&&v.c(),p=Ke(),r(e,"class","pl-5"),r(u,"class","pl-5")},m(d,g){S(d,e,g),s(e,l),s(e,i),S(d,o,g),S(d,u,g),s(u,a),s(u,f),S(d,_,g),v&&v.m(d,g),S(d,p,g),b=!0},p(d,g){(!b||g[0]&1)&&n!==(n=d[0].mac+"")&&J(i,n),(!b||g[0]&1)&&c!==(c=(d[0].meter.id?d[0].meter.id:"missing, required")+"")&&J(f,c),d[0].mac&&d[0].meter.id?v?(v.p(d,g),g[0]&1&&O(v,1)):(v=mf(d),v.c(),O(v,1),v.m(p.parentNode,p)):v&&(Ae(),q(v,1,1,()=>{v=null}),Pe())},i(d){b||(O(v),b=!0)},o(d){q(v),b=!1},d(d){d&&$(e),d&&$(o),d&&$(u),d&&$(_),v&&v.d(d),d&&$(p)}}}function mf(t){let e,l,n;return l=new __({props:{value:'{"mac":"'+t[0].mac+'","meter":"'+t[0].meter.id+'"}'}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","pl-2")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o[0]&1&&(u.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(u)},i(i){n||(O(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function _f(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P;o=new Rt({});let L={length:9},I=[];for(let F=0;F20&&hf(t),p=t[3].i.d.d>0&&kf(t),b=t[0].chip=="esp8266"&&wf(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Hardware",n=h(),i=m("a"),re(o.$$.fragment),u=h(),_&&_.c(),a=h(),p&&p.c(),c=h(),b&&b.c(),r(l,"class","text-sm"),r(i,"href",It("GPIO-configuration")),r(i,"target","_blank"),r(i,"class","float-right"),r(e,"class","cnt")},m(v,d){S(v,e,d),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),_&&_.m(e,null),s(e,a),p&&p.m(e,null),s(e,c),b&&b.m(e,null),f=!0},p(v,d){v[0].board>20?_?(_.p(v,d),d[0]&1&&O(_,1)):(_=hf(v),_.c(),O(_,1),_.m(e,a)):_&&(Ae(),q(_,1,1,()=>{_=null}),Pe()),v[3].i.d.d>0?p?p.p(v,d):(p=kf(v),p.c(),p.m(e,c)):p&&(p.d(1),p=null),v[0].chip=="esp8266"?b?b.p(v,d):(b=wf(v),b.c(),b.m(e,null)):b&&(b.d(1),b=null)},i(v){f||(O(o.$$.fragment,v),O(_),f=!0)},o(v){q(o.$$.fragment,v),q(_),f=!1},d(v){v&&$(e),se(o),_&&_.d(),p&&p.d(),b&&b.d()}}}function hf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Le,Se,ye,ve,Te,be,N,y,k,A,D,Z,le,fe,de,Ce,Oe,ue,Me,Je,Lt,st,wt,nt,Ot,Qe,Xt,zt,vt,xe,Ge,Ye,Ne,Ze,et;f=new io({props:{chip:t[0].chip}}),w=new io({props:{chip:t[0].chip}});let qe=t[0].chip!="esp8266"&&bf(t),Fe=t[3].i.v.p>0&&gf(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=E("HAN RX"),u=m("br"),a=h(),c=m("select"),re(f.$$.fragment),_=h(),p=m("div"),b=E("HAN TX"),v=m("br"),d=h(),g=m("select"),re(w.$$.fragment),T=h(),M=m("div"),P=m("label"),L=m("input"),I=E(" pullup"),F=h(),C=m("div"),R=m("div"),ne=E("AP button"),H=m("br"),z=h(),U=m("input"),K=h(),Q=m("div"),G=E("LED"),X=m("br"),Y=h(),j=m("div"),x=m("input"),ae=h(),ee=m("div"),V=m("label"),W=m("input"),we=E(" inverted"),He=h(),Le=m("div"),Se=E("RGB"),ye=m("label"),ve=m("input"),Te=E(" inverted"),be=m("br"),N=h(),y=m("div"),k=m("input"),A=h(),D=m("input"),Z=h(),le=m("input"),fe=h(),de=m("div"),Ce=m("div"),Oe=E(`LED dis. GPIO - `),ue=m("input"),Me=h(),Je=m("div"),Lt=E("Temperature"),st=m("br"),wt=h(),nt=m("input"),Ot=h(),Qe=m("div"),Xt=E("Analog temp"),zt=m("br"),vt=h(),xe=m("input"),Ge=h(),qe&&qe.c(),Ye=h(),Fe&&Fe.c(),r(e,"type","hidden"),r(e,"name","i"),e.value="true",r(c,"name","ihp"),r(c,"class","in-f w-full"),t[3].i.h.p===void 0&&We(()=>t[78].call(c)),r(i,"class","w-1/3"),r(g,"name","iht"),r(g,"class","in-l w-full"),t[3].i.h.t===void 0&&We(()=>t[79].call(g)),r(p,"class","w-1/3"),r(L,"name","ihu"),L.__value="true",L.value=L.__value,r(L,"type","checkbox"),r(L,"class","rounded mb-1"),r(P,"class","ml-2"),r(M,"class","w-1/3"),r(n,"class","flex flex-wrap"),r(U,"name","ia"),r(U,"type","number"),r(U,"min","0"),r(U,"max",t[6]),r(U,"class","in-f tr w-full"),r(R,"class","w-1/3"),r(x,"name","ilp"),r(x,"type","number"),r(x,"min","0"),r(x,"max",t[6]),r(x,"class","in-l tr w-full"),r(j,"class","flex"),r(Q,"class","w-1/3"),r(W,"name","ili"),W.__value="true",W.value=W.__value,r(W,"type","checkbox"),r(W,"class","rounded mb-1"),r(V,"class","ml-4"),r(ee,"class","w-1/3"),r(ve,"name","iri"),ve.__value="true",ve.value=ve.__value,r(ve,"type","checkbox"),r(ve,"class","rounded mb-1"),r(ye,"class","ml-4"),r(k,"name","irr"),r(k,"type","number"),r(k,"min","0"),r(k,"max",t[6]),r(k,"class","in-f tr w-1/3"),r(D,"name","irg"),r(D,"type","number"),r(D,"min","0"),r(D,"max",t[6]),r(D,"class","in-m tr w-1/3"),r(le,"name","irb"),r(le,"type","number"),r(le,"min","0"),r(le,"max",t[6]),r(le,"class","in-l tr w-1/3"),r(y,"class","flex"),r(Le,"class","w-full"),r(ue,"name","idd"),r(ue,"type","number"),r(ue,"min","0"),r(ue,"max",t[6]),r(ue,"class","in-s tr"),r(Ce,"class","my-1 pr-1 w-1/3"),r(de,"class","w-full"),r(nt,"name","itd"),r(nt,"type","number"),r(nt,"min","0"),r(nt,"max",t[6]),r(nt,"class","in-f tr w-full"),r(Je,"class","my-1 w-1/3"),r(xe,"name","ita"),r(xe,"type","number"),r(xe,"min","0"),r(xe,"max",t[6]),r(xe,"class","in-l tr w-full"),r(Qe,"class","my-1 pr-1 w-1/3"),r(C,"class","flex flex-wrap")},m(_e,ce){S(_e,e,ce),S(_e,l,ce),S(_e,n,ce),s(n,i),s(i,o),s(i,u),s(i,a),s(i,c),ie(f,c,null),$e(c,t[3].i.h.p,!0),s(n,_),s(n,p),s(p,b),s(p,v),s(p,d),s(p,g),ie(w,g,null),$e(g,t[3].i.h.t,!0),s(n,T),s(n,M),s(M,P),s(P,L),L.checked=t[3].i.h.u,s(P,I),S(_e,F,ce),S(_e,C,ce),s(C,R),s(R,ne),s(R,H),s(R,z),s(R,U),oe(U,t[3].i.a),s(C,K),s(C,Q),s(Q,G),s(Q,X),s(Q,Y),s(Q,j),s(j,x),oe(x,t[3].i.l.p),s(C,ae),s(C,ee),s(ee,V),s(V,W),W.checked=t[3].i.l.i,s(V,we),s(C,He),s(C,Le),s(Le,Se),s(Le,ye),s(ye,ve),ve.checked=t[3].i.r.i,s(ye,Te),s(Le,be),s(Le,N),s(Le,y),s(y,k),oe(k,t[3].i.r.r),s(y,A),s(y,D),oe(D,t[3].i.r.g),s(y,Z),s(y,le),oe(le,t[3].i.r.b),s(C,fe),s(C,de),s(de,Ce),s(Ce,Oe),s(Ce,ue),oe(ue,t[3].i.d.d),s(C,Me),s(C,Je),s(Je,Lt),s(Je,st),s(Je,wt),s(Je,nt),oe(nt,t[3].i.t.d),s(C,Ot),s(C,Qe),s(Qe,Xt),s(Qe,zt),s(Qe,vt),s(Qe,xe),oe(xe,t[3].i.t.a),s(C,Ge),qe&&qe.m(C,null),s(C,Ye),Fe&&Fe.m(C,null),Ne=!0,Ze||(et=[te(c,"change",t[78]),te(g,"change",t[79]),te(L,"change",t[80]),te(U,"input",t[81]),te(x,"input",t[82]),te(W,"change",t[83]),te(ve,"change",t[84]),te(k,"input",t[85]),te(D,"input",t[86]),te(le,"input",t[87]),te(ue,"input",t[88]),te(nt,"input",t[89]),te(xe,"input",t[90])],Ze=!0)},p(_e,ce){const Be={};ce[0]&1&&(Be.chip=_e[0].chip),f.$set(Be),ce[0]&8&&$e(c,_e[3].i.h.p);const pt={};ce[0]&1&&(pt.chip=_e[0].chip),w.$set(pt),ce[0]&8&&$e(g,_e[3].i.h.t),ce[0]&8&&(L.checked=_e[3].i.h.u),(!Ne||ce[0]&64)&&r(U,"max",_e[6]),ce[0]&8&&ge(U.value)!==_e[3].i.a&&oe(U,_e[3].i.a),(!Ne||ce[0]&64)&&r(x,"max",_e[6]),ce[0]&8&&ge(x.value)!==_e[3].i.l.p&&oe(x,_e[3].i.l.p),ce[0]&8&&(W.checked=_e[3].i.l.i),ce[0]&8&&(ve.checked=_e[3].i.r.i),(!Ne||ce[0]&64)&&r(k,"max",_e[6]),ce[0]&8&&ge(k.value)!==_e[3].i.r.r&&oe(k,_e[3].i.r.r),(!Ne||ce[0]&64)&&r(D,"max",_e[6]),ce[0]&8&&ge(D.value)!==_e[3].i.r.g&&oe(D,_e[3].i.r.g),(!Ne||ce[0]&64)&&r(le,"max",_e[6]),ce[0]&8&&ge(le.value)!==_e[3].i.r.b&&oe(le,_e[3].i.r.b),(!Ne||ce[0]&64)&&r(ue,"max",_e[6]),ce[0]&8&&ge(ue.value)!==_e[3].i.d.d&&oe(ue,_e[3].i.d.d),(!Ne||ce[0]&64)&&r(nt,"max",_e[6]),ce[0]&8&&ge(nt.value)!==_e[3].i.t.d&&oe(nt,_e[3].i.t.d),(!Ne||ce[0]&64)&&r(xe,"max",_e[6]),ce[0]&8&&ge(xe.value)!==_e[3].i.t.a&&oe(xe,_e[3].i.t.a),_e[0].chip!="esp8266"?qe?qe.p(_e,ce):(qe=bf(_e),qe.c(),qe.m(C,Ye)):qe&&(qe.d(1),qe=null),_e[3].i.v.p>0?Fe?Fe.p(_e,ce):(Fe=gf(_e),Fe.c(),Fe.m(C,null)):Fe&&(Fe.d(1),Fe=null)},i(_e){Ne||(O(f.$$.fragment,_e),O(w.$$.fragment,_e),Ne=!0)},o(_e){q(f.$$.fragment,_e),q(w.$$.fragment,_e),Ne=!1},d(_e){_e&&$(e),_e&&$(l),_e&&$(n),se(f),se(w),_e&&$(F),_e&&$(C),qe&&qe.d(),Fe&&Fe.d(),Ze=!1,ze(et)}}}function bf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=E("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){S(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].i.v.p),u||(a=te(o,"input",t[91]),u=!0)},p(c,f){f[0]&64&&r(o,"max",c[6]),f[0]&8&&ge(o.value)!==c[3].i.v.p&&oe(o,c[3].i.v.p)},d(c){c&&$(e),u=!1,a()}}}function gf(t){let e,l,n,i,o,u,a,c,f,_;return{c(){e=m("div"),l=E("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){S(p,e,b),s(e,l),s(e,n),s(e,i),s(e,o),s(o,u),oe(u,t[3].i.v.d.v),s(o,a),s(o,c),oe(c,t[3].i.v.d.g),f||(_=[te(u,"input",t[92]),te(c,"input",t[93])],f=!0)},p(p,b){b[0]&8&&ge(u.value)!==p[3].i.v.d.v&&oe(u,p[3].i.v.d.v),b[0]&8&&ge(c.value)!==p[3].i.v.d.g&&oe(c,p[3].i.v.d.g)},d(p){p&&$(e),f=!1,ze(_)}}}function kf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=E(`LED behaviour - `),n=m("select"),i=m("option"),i.textContent="Enabled",o=m("option"),o.textContent="Disabled",i.__value=0,i.value=i.__value,o.__value=1,o.value=o.__value,r(n,"name","idb"),r(n,"class","in-s"),t[3].i.d.b===void 0&&We(()=>t[94].call(n)),r(e,"class","my-1 w-full")},m(c,f){S(c,e,f),s(e,l),s(e,n),s(n,i),s(n,o),$e(n,t[3].i.d.b,!0),u||(a=te(n,"change",t[94]),u=!0)},p(c,f){f[0]&8&&$e(n,c[3].i.d.b)},d(c){c&&$(e),u=!1,a()}}}function wf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M=(t[0].board==2||t[0].board==100)&&yf(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=E("Vcc offset"),u=m("br"),a=h(),c=m("input"),f=h(),_=m("div"),p=E("Multiplier"),b=m("br"),v=h(),d=m("input"),g=h(),M&&M.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(P,L){S(P,e,L),S(P,l,L),S(P,n,L),s(n,i),s(i,o),s(i,u),s(i,a),s(i,c),oe(c,t[3].i.v.o),s(n,f),s(n,_),s(_,p),s(_,b),s(_,v),s(_,d),oe(d,t[3].i.v.m),s(n,g),M&&M.m(n,null),w||(T=[te(c,"input",t[95]),te(d,"input",t[96])],w=!0)},p(P,L){L[0]&8&&ge(c.value)!==P[3].i.v.o&&oe(c,P[3].i.v.o),L[0]&8&&ge(d.value)!==P[3].i.v.m&&oe(d,P[3].i.v.m),P[0].board==2||P[0].board==100?M?M.p(P,L):(M=yf(P),M.c(),M.m(n,null)):M&&(M.d(1),M=null)},d(P){P&&$(e),P&&$(l),P&&$(n),M&&M.d(),w=!1,ze(T)}}}function yf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=E("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){S(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].i.v.b),u||(a=te(o,"input",t[97]),u=!0)},p(c,f){f[0]&8&&ge(o.value)!==c[3].i.v.b&&oe(o,c[3].i.v.b)},d(c){c&&$(e),u=!1,a()}}}function Cf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T=t[3].d.t&&$f();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=E(" 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&&We(()=>t[100].call(_)),r(f,"class","my-1")},m(M,P){S(M,e,P),S(M,l,P),S(M,n,P),s(n,i),s(i,o),o.checked=t[3].d.t,s(i,u),S(M,a,P),T&&T.m(M,P),S(M,c,P),S(M,f,P),s(f,_),s(_,p),s(_,b),s(_,v),s(_,d),$e(_,t[3].d.l,!0),g||(w=[te(o,"change",t[99]),te(_,"change",t[100])],g=!0)},p(M,P){P[0]&8&&(o.checked=M[3].d.t),M[3].d.t?T||(T=$f(),T.c(),T.m(c.parentNode,c)):T&&(T.d(1),T=null),P[0]&8&&$e(_,M[3].d.l)},d(M){M&&$(e),M&&$(l),M&&$(n),M&&$(a),T&&T.d(M),M&&$(c),M&&$(f),g=!1,ze(w)}}}function $f(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){S(l,e,n)},d(l){l&&$(e)}}}function P_(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Le,Se,ye,ve,Te,be,N,y,k,A,D,Z,le,fe,de,Ce,Oe,ue,Me,Je,Lt,st,wt,nt,Ot,Qe,Xt,zt,vt,xe,Ge,Ye,Ne,Ze,et,qe,Fe,_e,ce,Be,pt,Tl,Nl,El,Mi,Ti,je,_n,Ni,Al,Pl,Ei,Hl,Ai,Wl,Pi,hl,Di,Ri,Ii,Gt,Dl,Ve,yt,ht,si,Li,bl,Oi,zl,Zt,$o,So,Rl,rl,Il,Mo,Fi,To,bt,Ll,No,qi,pn,dn,vn,hn,Bi,Eo,Ft,Ui,Ao,Gl,Po,Do,Ro,al,bn,gn,Io,kn,Vl,Lo,Oo,Fo,wn,Jt,qo,ji,Bo,Kl,Uo,jo,Ho,yn,xt,Wo,Hi,zo,ks,Go,Yl,Wi,el,Vo,Ko,Yo,ws,zi,tl,Qo,Xo,Zo,qt,Gi,Jo,Cn,$n,xo,oi,er,Ql,tr,lr,nr,Vt,Sn,Mn,ir,sr,mt,Vi,or,Tn,Nn,rr,Xl,ar,ur,fr,Ol,ul,En,An,cr,Bt,Ki,Yi,mr,Ut,Pn,Qi,Xi,_r,ys,Zi,Ji,ll,pr,dr,ri,vr,Fl,hr,ai,nl,br,gr,kr,xi,gl,wr,lt,es,yr,Dn,Rn,Cr,ui,$r,fl,Sr,Cs,Mr,Tr,In,kl,Nr,il,Er,$s,Zl,Ar,Pr,Dr,wl,Rr,Jl,Ir,Lr,Or,yl,Fr,Ln,On,qr,Br,Ur,Cl,jr,Fn,Hr,Wr,zr,Ct,qn,Bn,Un,jn,Hn,Wn,Gr,xl,Vr,Kr,Yr,$l,Qr,Ss,Ms,Ts,Ns=t[3].p.r.startsWith("10YNO")||t[3].p.r.startsWith("10Y1001A1001A4"),Es,cl,ts,Xr,zn,Gn,Zr,fi,Jr,ci,xr,As,jt,ls,ea,Vn,Kn,ta,mi,la,ns,is,sl,na,ia,sa,ql,Ps,Yn,oa,ss,Qn,ra,os,Ds,en,Rs,tn,Is,ln,Ls,nn,Kt,Os,aa;a=new Rt({}),R=new o_({});let n1=["NOK","SEK","DKK","EUR","CHF"],_i=[];for(let B=0;B<5;B+=1)_i[B]=v_(d_(t,n1,B));vt=new Qt({props:{to:"/priceconfig",class:"text-blue-600 hover:text-blue-800",$$slots:{default:[h_]},$$scope:{ctx:t}}});let $t=t[3].p.e&&t[0].chip!="esp8266"&&Zu(t),St=t[3].g.s>0&&Ju(t);Pl=new Rt({});let i1=[24,48,96,192,384,576,1152],pi=[];for(let B=0;B<7;B+=1)pi[B]=b_(p_(t,i1,B));let Mt=t[3].m.e.e&&xu(t),Tt=t[3].m.e.e&&ef(t),Nt=t[3].m.m.e&&tf(t);$n=new Rt({});let Ht=t[0].if&&t[0].if.eth&&lf(),Et=(t[3].n.c==1||t[3].n.c==2)&&nf(t);Nn=new Rt({}),Pn=new t1({});let At=t[3].n.m=="static"&&sf(t);Rn=new Rt({});let Pt=t[0].chip!="esp8266"&&of(t),ot=t[3].q.s.e&&rf(t),rt=t[3].q.m==3&&af(t),at=t[3].q.m==4&&uf(t),ut=t[3].c.es!=null&&ff(t),ft=Ns&&_f(t);Gn=new Rt({});let Xn=t[7],gt=[];for(let B=0;B20||t[0].chip=="esp8266"||t[3].i.d.d>0)&&vf(t);Kn=new Rt({});let Dt=t[3].d.s&&Cf(t);return en=new kt({props:{active:t[1],message:"Loading configuration"}}),tn=new kt({props:{active:t[2],message:"Saving configuration"}}),ln=new kt({props:{active:t[4],message:"Performing factory reset"}}),nn=new kt({props:{active:t[5],message:"Device have been factory reset and switched to AP mode"}}),{c(){e=m("form"),l=m("div"),n=m("div"),i=m("strong"),i.textContent="General",o=h(),u=m("a"),re(a.$$.fragment),c=h(),f=m("input"),_=h(),p=m("div"),b=m("div"),v=m("div"),d=E("Hostname"),g=m("br"),w=h(),T=m("input"),M=h(),P=m("div"),L=E("Time zone"),I=m("br"),F=h(),C=m("select"),re(R.$$.fragment),ne=h(),H=m("input"),z=h(),U=m("div"),K=m("div"),Q=m("div"),G=E("Price region"),X=m("br"),Y=h(),j=m("select"),x=m("optgroup"),ae=m("option"),ae.textContent="NO1",ee=m("option"),ee.textContent="NO2",V=m("option"),V.textContent="NO3",W=m("option"),W.textContent="NO4",we=m("option"),we.textContent="NO5",He=m("optgroup"),Le=m("option"),Le.textContent="SE1",Se=m("option"),Se.textContent="SE2",ye=m("option"),ye.textContent="SE3",ve=m("option"),ve.textContent="SE4",Te=m("optgroup"),be=m("option"),be.textContent="DK1",N=m("option"),N.textContent="DK2",y=m("option"),y.textContent="Austria",k=m("option"),k.textContent="Belgium",A=m("option"),A.textContent="Czech Republic",D=m("option"),D.textContent="Estonia",Z=m("option"),Z.textContent="Finland",le=m("option"),le.textContent="France",fe=m("option"),fe.textContent="Germany",de=m("option"),de.textContent="Great Britain",Ce=m("option"),Ce.textContent="Latvia",Oe=m("option"),Oe.textContent="Lithuania",ue=m("option"),ue.textContent="Netherland",Me=m("option"),Me.textContent="Poland",Je=m("option"),Je.textContent="Switzerland",Lt=h(),st=m("div"),wt=E("Currency"),nt=m("br"),Ot=h(),Qe=m("select");for(let B=0;B<5;B+=1)_i[B].c();Xt=h(),zt=m("div"),re(vt.$$.fragment),xe=h(),Ge=m("div"),Ye=m("label"),Ne=m("input"),Ze=E(" Enable price fetch from remote server"),et=h(),$t&&$t.c(),qe=h(),Fe=m("div"),_e=E("Security"),ce=m("br"),Be=h(),pt=m("select"),Tl=m("option"),Tl.textContent="None",Nl=m("option"),Nl.textContent="Only configuration",El=m("option"),El.textContent="Everything",Mi=h(),St&&St.c(),Ti=h(),je=m("div"),_n=m("strong"),_n.textContent="Meter",Ni=h(),Al=m("a"),re(Pl.$$.fragment),Ei=h(),Hl=m("input"),Ai=h(),Wl=m("input"),Pi=h(),hl=m("div"),Di=E("Communication"),Ri=m("br"),Ii=h(),Gt=m("select"),Dl=m("option"),Dl.textContent="Passive (Push)",Ve=m("option"),Ve.textContent="Kamstrup (Pull)",yt=h(),ht=m("div"),si=m("span"),si.textContent="Buffer size",Li=h(),bl=m("span"),bl.textContent="Serial conf.",Oi=h(),zl=m("label"),Zt=m("input"),$o=E(" inverted"),So=h(),Rl=m("div"),rl=m("select"),Il=m("option"),Mo=E("Autodetect");for(let B=0;B<7;B+=1)pi[B].c();To=h(),bt=m("select"),Ll=m("option"),No=E("-"),pn=m("option"),pn.textContent="7N1",dn=m("option"),dn.textContent="8N1",vn=m("option"),vn.textContent="7E1",hn=m("option"),hn.textContent="8E1",Eo=h(),Ft=m("input"),Ao=h(),Gl=m("div"),Po=E("Voltage"),Do=m("br"),Ro=h(),al=m("select"),bn=m("option"),bn.textContent="400V (TN)",gn=m("option"),gn.textContent="230V (IT/TT)",Io=h(),kn=m("div"),Vl=m("div"),Lo=E("Main fuse"),Oo=m("br"),Fo=h(),wn=m("label"),Jt=m("input"),qo=h(),ji=m("span"),ji.textContent="A",Bo=h(),Kl=m("div"),Uo=E("Production"),jo=m("br"),Ho=h(),yn=m("label"),xt=m("input"),Wo=h(),Hi=m("span"),Hi.textContent="kWp",zo=h(),ks=m("div"),Go=h(),Yl=m("div"),Wi=m("label"),el=m("input"),Vo=E(" Meter is encrypted"),Ko=h(),Mt&&Mt.c(),Yo=h(),Tt&&Tt.c(),ws=h(),zi=m("label"),tl=m("input"),Qo=E(" Multipliers"),Xo=h(),Nt&&Nt.c(),Zo=h(),qt=m("div"),Gi=m("strong"),Gi.textContent="Connection",Jo=h(),Cn=m("a"),re($n.$$.fragment),xo=h(),oi=m("input"),er=h(),Ql=m("div"),tr=E("Connection"),lr=m("br"),nr=h(),Vt=m("select"),Sn=m("option"),Sn.textContent="WiFi",Mn=m("option"),Mn.textContent="Access point",Ht&&Ht.c(),ir=h(),Et&&Et.c(),sr=h(),mt=m("div"),Vi=m("strong"),Vi.textContent="Network",or=h(),Tn=m("a"),re(Nn.$$.fragment),rr=h(),Xl=m("div"),ar=E("IP"),ur=m("br"),fr=h(),Ol=m("div"),ul=m("select"),En=m("option"),En.textContent="DHCP",An=m("option"),An.textContent="Static",cr=h(),Bt=m("input"),mr=h(),Ut=m("select"),re(Pn.$$.fragment),_r=h(),At&&At.c(),ys=h(),Zi=m("div"),Ji=m("label"),ll=m("input"),pr=E(" enable mDNS"),dr=h(),ri=m("input"),vr=h(),Fl=m("div"),hr=E("NTP "),ai=m("label"),nl=m("input"),br=E(" obtain from DHCP"),gr=m("br"),kr=h(),xi=m("div"),gl=m("input"),wr=h(),lt=m("div"),es=m("strong"),es.textContent="MQTT",yr=h(),Dn=m("a"),re(Rn.$$.fragment),Cr=h(),ui=m("input"),$r=h(),fl=m("div"),Sr=E(`Server - `),Pt&&Pt.c(),Cs=h(),Mr=m("br"),Tr=h(),In=m("div"),kl=m("input"),Nr=h(),il=m("input"),Er=h(),ot&&ot.c(),$s=h(),Zl=m("div"),Ar=E("Username"),Pr=m("br"),Dr=h(),wl=m("input"),Rr=h(),Jl=m("div"),Ir=E("Password"),Lr=m("br"),Or=h(),yl=m("input"),Fr=h(),Ln=m("div"),On=m("div"),qr=E("Client ID"),Br=m("br"),Ur=h(),Cl=m("input"),jr=h(),Fn=m("div"),Hr=E("Payload"),Wr=m("br"),zr=h(),Ct=m("select"),qn=m("option"),qn.textContent="JSON",Bn=m("option"),Bn.textContent="Raw (minimal)",Un=m("option"),Un.textContent="Raw (full)",jn=m("option"),jn.textContent="Domoticz",Hn=m("option"),Hn.textContent="HomeAssistant",Wn=m("option"),Wn.textContent="HEX dump",Gr=h(),xl=m("div"),Vr=E("Publish topic"),Kr=m("br"),Yr=h(),$l=m("input"),Qr=h(),rt&&rt.c(),Ss=h(),at&&at.c(),Ms=h(),ut&&ut.c(),Ts=h(),ft&&ft.c(),Es=h(),cl=m("div"),ts=m("strong"),ts.textContent="User interface",Xr=h(),zn=m("a"),re(Gn.$$.fragment),Zr=h(),fi=m("input"),Jr=h(),ci=m("div");for(let B=0;BSave',Ds=h(),re(en.$$.fragment),Rs=h(),re(tn.$$.fragment),Is=h(),re(ln.$$.fragment),Ls=h(),re(nn.$$.fragment),r(i,"class","text-sm"),r(u,"href",It("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(C,"name","gt"),r(C,"class","in-l w-full"),t[3].g.t===void 0&&We(()=>t[16].call(C)),r(b,"class","flex"),r(p,"class","my-1"),r(H,"type","hidden"),r(H,"name","p"),H.value="true",ae.__value="10YNO-1--------2",ae.value=ae.__value,ee.__value="10YNO-2--------T",ee.value=ee.__value,V.__value="10YNO-3--------J",V.value=V.__value,W.__value="10YNO-4--------9",W.value=W.__value,we.__value="10Y1001A1001A48H",we.value=we.__value,r(x,"label","Norway"),Le.__value="10Y1001A1001A44P",Le.value=Le.__value,Se.__value="10Y1001A1001A45N",Se.value=Se.__value,ye.__value="10Y1001A1001A46L",ye.value=ye.__value,ve.__value="10Y1001A1001A47J",ve.value=ve.__value,r(He,"label","Sweden"),be.__value="10YDK-1--------W",be.value=be.__value,N.__value="10YDK-2--------M",N.value=N.__value,r(Te,"label","Denmark"),y.__value="10YAT-APG------L",y.value=y.__value,k.__value="10YBE----------2",k.value=k.__value,A.__value="10YCZ-CEPS-----N",A.value=A.__value,D.__value="10Y1001A1001A39I",D.value=D.__value,Z.__value="10YFI-1--------U",Z.value=Z.__value,le.__value="10YFR-RTE------C",le.value=le.__value,fe.__value="10Y1001A1001A83F",fe.value=fe.__value,de.__value="10YGB----------A",de.value=de.__value,Ce.__value="10YLV-1001A00074",Ce.value=Ce.__value,Oe.__value="10YLT-1001A0008Q",Oe.value=Oe.__value,ue.__value="10YNL----------L",ue.value=ue.__value,Me.__value="10YPL-AREA-----S",Me.value=Me.__value,Je.__value="10YCH-SWISSGRIDZ",Je.value=Je.__value,r(j,"name","pr"),r(j,"class","in-f w-full"),t[3].p.r===void 0&&We(()=>t[17].call(j)),r(Q,"class","w-full"),r(Qe,"name","pc"),r(Qe,"class","in-l"),t[3].p.c===void 0&&We(()=>t[18].call(Qe)),r(K,"class","flex"),r(U,"class","my-1"),r(zt,"class","my-1"),r(Ne,"type","checkbox"),r(Ne,"name","pe"),Ne.__value="true",Ne.value=Ne.__value,r(Ne,"class","rounded mb-1"),r(Ge,"class","my-1"),Tl.__value=0,Tl.value=Tl.__value,Nl.__value=1,Nl.value=Nl.__value,El.__value=2,El.value=El.__value,r(pt,"name","gs"),r(pt,"class","in-s"),t[3].g.s===void 0&&We(()=>t[21].call(pt)),r(Fe,"class","my-1"),r(n,"class","cnt"),r(_n,"class","text-sm"),r(Al,"href",It("Meter-configuration")),r(Al,"target","_blank"),r(Al,"class","float-right"),r(Hl,"type","hidden"),r(Hl,"name","m"),Hl.value="true",r(Wl,"type","hidden"),r(Wl,"name","mo"),Wl.value="1",Dl.__value=0,Dl.value=Dl.__value,Ve.__value=9,Ve.value=Ve.__value,r(Gt,"name","ma"),r(Gt,"class","in-s"),t[3].m.a===void 0&&We(()=>t[24].call(Gt)),r(hl,"class","my-1"),r(si,"class","float-right"),r(Zt,"name","mi"),Zt.__value="true",Zt.value=Zt.__value,r(Zt,"type","checkbox"),r(Zt,"class","rounded mb-1"),r(zl,"class","mt-2 ml-3 whitespace-nowrap"),Il.__value=0,Il.value=Il.__value,Il.disabled=Fi=t[3].m.b!=0,r(rl,"name","mb"),r(rl,"class","in-f tr w-1/2"),t[3].m.b===void 0&&We(()=>t[26].call(rl)),Ll.__value=0,Ll.value=Ll.__value,Ll.disabled=qi=t[3].m.b!=0,pn.__value=2,pn.value=pn.__value,dn.__value=3,dn.value=dn.__value,vn.__value=10,vn.value=vn.__value,hn.__value=11,hn.value=hn.__value,r(bt,"name","mp"),r(bt,"class","in-m"),bt.disabled=Bi=t[3].m.b==0,t[3].m.p===void 0&&We(()=>t[27].call(bt)),r(Ft,"name","ms"),r(Ft,"type","number"),r(Ft,"min",64),r(Ft,"max",Ui=t[0].chip=="esp8266"?t[3].i.h.p==3||t[3].i.h.p==113?512:128:4096),r(Ft,"step",64),r(Ft,"class","in-l tr w-1/2"),r(Rl,"class","flex w-full"),r(ht,"class","my-1"),bn.__value=2,bn.value=bn.__value,gn.__value=1,gn.value=gn.__value,r(al,"name","md"),r(al,"class","in-s"),t[3].m.d===void 0&&We(()=>t[29].call(al)),r(Gl,"class","my-1"),r(Jt,"name","mf"),r(Jt,"type","number"),r(Jt,"min","5"),r(Jt,"max","65535"),r(Jt,"class","in-f tr w-full"),r(ji,"class","in-post"),r(wn,"class","flex"),r(Vl,"class","mx-1"),r(xt,"name","mr"),r(xt,"type","number"),r(xt,"min","0"),r(xt,"max","65535"),r(xt,"class","in-f tr w-full"),r(Hi,"class","in-post"),r(yn,"class","flex"),r(Kl,"class","mx-1"),r(kn,"class","my-1 flex"),r(ks,"class","my-1"),r(el,"type","checkbox"),r(el,"name","me"),el.__value="true",el.value=el.__value,r(el,"class","rounded mb-1"),r(Yl,"class","my-1"),r(tl,"type","checkbox"),r(tl,"name","mm"),tl.__value="true",tl.value=tl.__value,r(tl,"class","rounded mb-1"),r(je,"class","cnt"),r(Gi,"class","text-sm"),r(Cn,"href",It("WiFi-configuration")),r(Cn,"target","_blank"),r(Cn,"class","float-right"),r(oi,"type","hidden"),r(oi,"name","w"),oi.value="true",Sn.__value=1,Sn.value=Sn.__value,Mn.__value=2,Mn.value=Mn.__value,r(Vt,"name","nc"),r(Vt,"class","in-s"),t[3].n.c===void 0&&We(()=>t[40].call(Vt)),r(Ql,"class","my-1"),r(qt,"class","cnt"),r(Vi,"class","text-sm"),r(Tn,"href",It("Network-configuration")),r(Tn,"target","_blank"),r(Tn,"class","float-right"),En.__value="dhcp",En.value=En.__value,An.__value="static",An.value=An.__value,r(ul,"name","nm"),r(ul,"class","in-f"),t[3].n.m===void 0&&We(()=>t[46].call(ul)),r(Bt,"name","ni"),r(Bt,"type","text"),r(Bt,"class","in-m w-full"),Bt.disabled=Ki=t[3].n.m=="dhcp",Bt.required=Yi=t[3].n.m=="static",r(Ut,"name","ns"),r(Ut,"class","in-l"),Ut.disabled=Qi=t[3].n.m=="dhcp",Ut.required=Xi=t[3].n.m=="static",t[3].n.s===void 0&&We(()=>t[48].call(Ut)),r(Ol,"class","flex"),r(Xl,"class","my-1"),r(ll,"name","nd"),ll.__value="true",ll.value=ll.__value,r(ll,"type","checkbox"),r(ll,"class","rounded mb-1"),r(Zi,"class","my-1"),r(ri,"type","hidden"),r(ri,"name","ntp"),ri.value="true",r(nl,"name","ntpd"),nl.__value="true",nl.value=nl.__value,r(nl,"type","checkbox"),r(nl,"class","rounded mb-1"),r(ai,"class","ml-4"),r(gl,"name","ntph"),r(gl,"type","text"),r(gl,"class","in-s"),r(xi,"class","flex"),r(Fl,"class","my-1"),r(mt,"class","cnt"),r(es,"class","text-sm"),r(Dn,"href",It("MQTT-configuration")),r(Dn,"target","_blank"),r(Dn,"class","float-right"),r(ui,"type","hidden"),r(ui,"name","q"),ui.value="true",r(kl,"name","qh"),r(kl,"type","text"),r(kl,"class","in-f w-3/4"),r(il,"name","qp"),r(il,"type","number"),r(il,"min","1024"),r(il,"max","65535"),r(il,"class","in-l tr w-1/4"),r(In,"class","flex"),r(fl,"class","my-1"),r(wl,"name","qu"),r(wl,"type","text"),r(wl,"class","in-s"),r(Zl,"class","my-1"),r(yl,"name","qa"),r(yl,"type","password"),r(yl,"class","in-s"),r(Jl,"class","my-1"),r(Cl,"name","qc"),r(Cl,"type","text"),r(Cl,"class","in-f w-full"),qn.__value=0,qn.value=qn.__value,Bn.__value=1,Bn.value=Bn.__value,Un.__value=2,Un.value=Un.__value,jn.__value=3,jn.value=jn.__value,Hn.__value=4,Hn.value=Hn.__value,Wn.__value=255,Wn.value=Wn.__value,r(Ct,"name","qm"),r(Ct,"class","in-l"),t[3].q.m===void 0&&We(()=>t[61].call(Ct)),r(Ln,"class","my-1 flex"),r($l,"name","qb"),r($l,"type","text"),r($l,"class","in-s"),r(xl,"class","my-1"),r(lt,"class","cnt"),r(ts,"class","text-sm"),r(zn,"href",It("User-interface")),r(zn,"target","_blank"),r(zn,"class","float-right"),r(fi,"type","hidden"),r(fi,"name","u"),fi.value="true",r(ci,"class","flex flex-wrap"),r(cl,"class","cnt"),r(ls,"class","text-sm"),r(Vn,"href","https://amsleser.no/blog/post/24-telnet-debug"),r(Vn,"target","_blank"),r(Vn,"class","float-right"),r(mi,"type","hidden"),r(mi,"name","d"),mi.value="true",r(sl,"type","checkbox"),r(sl,"name","ds"),sl.__value="true",sl.value=sl.__value,r(sl,"class","rounded mb-1"),r(ns,"class","mt-3"),r(jt,"class","cnt"),r(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),r(Yn,"type","button"),r(Yn,"class","py-2 px-4 rounded bg-red-500 text-white ml-2"),r(Qn,"type","button"),r(Qn,"class","py-2 px-4 rounded bg-yellow-500 text-white"),r(ss,"class","text-center"),r(os,"class","text-right"),r(ql,"class","grid grid-cols-3"),r(e,"autocomplete","off")},m(B,me){S(B,e,me),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),ie(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,g),s(v,w),s(v,T),oe(T,t[3].g.h),s(b,M),s(b,P),s(P,L),s(P,I),s(P,F),s(P,C),ie(R,C,null),$e(C,t[3].g.t,!0),s(n,ne),s(n,H),s(n,z),s(n,U),s(U,K),s(K,Q),s(Q,G),s(Q,X),s(Q,Y),s(Q,j),s(j,x),s(x,ae),s(x,ee),s(x,V),s(x,W),s(x,we),s(j,He),s(He,Le),s(He,Se),s(He,ye),s(He,ve),s(j,Te),s(Te,be),s(Te,N),s(j,y),s(j,k),s(j,A),s(j,D),s(j,Z),s(j,le),s(j,fe),s(j,de),s(j,Ce),s(j,Oe),s(j,ue),s(j,Me),s(j,Je),$e(j,t[3].p.r,!0),s(K,Lt),s(K,st),s(st,wt),s(st,nt),s(st,Ot),s(st,Qe);for(let _t=0;_t<5;_t+=1)_i[_t]&&_i[_t].m(Qe,null);$e(Qe,t[3].p.c,!0),s(n,Xt),s(n,zt),ie(vt,zt,null),s(n,xe),s(n,Ge),s(Ge,Ye),s(Ye,Ne),Ne.checked=t[3].p.e,s(Ye,Ze),s(Ge,et),$t&&$t.m(Ge,null),s(n,qe),s(n,Fe),s(Fe,_e),s(Fe,ce),s(Fe,Be),s(Fe,pt),s(pt,Tl),s(pt,Nl),s(pt,El),$e(pt,t[3].g.s,!0),s(n,Mi),St&&St.m(n,null),s(l,Ti),s(l,je),s(je,_n),s(je,Ni),s(je,Al),ie(Pl,Al,null),s(je,Ei),s(je,Hl),s(je,Ai),s(je,Wl),s(je,Pi),s(je,hl),s(hl,Di),s(hl,Ri),s(hl,Ii),s(hl,Gt),s(Gt,Dl),s(Gt,Ve),$e(Gt,t[3].m.a,!0),s(je,yt),s(je,ht),s(ht,si),s(ht,Li),s(ht,bl),s(ht,Oi),s(ht,zl),s(zl,Zt),Zt.checked=t[3].m.i,s(zl,$o),s(ht,So),s(ht,Rl),s(Rl,rl),s(rl,Il),s(Il,Mo);for(let _t=0;_t<7;_t+=1)pi[_t]&&pi[_t].m(rl,null);$e(rl,t[3].m.b,!0),s(Rl,To),s(Rl,bt),s(bt,Ll),s(Ll,No),s(bt,pn),s(bt,dn),s(bt,vn),s(bt,hn),$e(bt,t[3].m.p,!0),s(Rl,Eo),s(Rl,Ft),oe(Ft,t[3].m.s),s(je,Ao),s(je,Gl),s(Gl,Po),s(Gl,Do),s(Gl,Ro),s(Gl,al),s(al,bn),s(al,gn),$e(al,t[3].m.d,!0),s(je,Io),s(je,kn),s(kn,Vl),s(Vl,Lo),s(Vl,Oo),s(Vl,Fo),s(Vl,wn),s(wn,Jt),oe(Jt,t[3].m.f),s(wn,qo),s(wn,ji),s(kn,Bo),s(kn,Kl),s(Kl,Uo),s(Kl,jo),s(Kl,Ho),s(Kl,yn),s(yn,xt),oe(xt,t[3].m.r),s(yn,Wo),s(yn,Hi),s(je,zo),s(je,ks),s(je,Go),s(je,Yl),s(Yl,Wi),s(Wi,el),el.checked=t[3].m.e.e,s(Wi,Vo),s(Yl,Ko),Mt&&Mt.m(Yl,null),s(je,Yo),Tt&&Tt.m(je,null),s(je,ws),s(je,zi),s(zi,tl),tl.checked=t[3].m.m.e,s(zi,Qo),s(je,Xo),Nt&&Nt.m(je,null),s(l,Zo),s(l,qt),s(qt,Gi),s(qt,Jo),s(qt,Cn),ie($n,Cn,null),s(qt,xo),s(qt,oi),s(qt,er),s(qt,Ql),s(Ql,tr),s(Ql,lr),s(Ql,nr),s(Ql,Vt),s(Vt,Sn),s(Vt,Mn),Ht&&Ht.m(Vt,null),$e(Vt,t[3].n.c,!0),s(qt,ir),Et&&Et.m(qt,null),s(l,sr),s(l,mt),s(mt,Vi),s(mt,or),s(mt,Tn),ie(Nn,Tn,null),s(mt,rr),s(mt,Xl),s(Xl,ar),s(Xl,ur),s(Xl,fr),s(Xl,Ol),s(Ol,ul),s(ul,En),s(ul,An),$e(ul,t[3].n.m,!0),s(Ol,cr),s(Ol,Bt),oe(Bt,t[3].n.i),s(Ol,mr),s(Ol,Ut),ie(Pn,Ut,null),$e(Ut,t[3].n.s,!0),s(mt,_r),At&&At.m(mt,null),s(mt,ys),s(mt,Zi),s(Zi,Ji),s(Ji,ll),ll.checked=t[3].n.d,s(Ji,pr),s(mt,dr),s(mt,ri),s(mt,vr),s(mt,Fl),s(Fl,hr),s(Fl,ai),s(ai,nl),nl.checked=t[3].n.h,s(ai,br),s(Fl,gr),s(Fl,kr),s(Fl,xi),s(xi,gl),oe(gl,t[3].n.n1),s(l,wr),s(l,lt),s(lt,es),s(lt,yr),s(lt,Dn),ie(Rn,Dn,null),s(lt,Cr),s(lt,ui),s(lt,$r),s(lt,fl),s(fl,Sr),Pt&&Pt.m(fl,null),s(fl,Cs),s(fl,Mr),s(fl,Tr),s(fl,In),s(In,kl),oe(kl,t[3].q.h),s(In,Nr),s(In,il),oe(il,t[3].q.p),s(lt,Er),ot&&ot.m(lt,null),s(lt,$s),s(lt,Zl),s(Zl,Ar),s(Zl,Pr),s(Zl,Dr),s(Zl,wl),oe(wl,t[3].q.u),s(lt,Rr),s(lt,Jl),s(Jl,Ir),s(Jl,Lr),s(Jl,Or),s(Jl,yl),oe(yl,t[3].q.a),s(lt,Fr),s(lt,Ln),s(Ln,On),s(On,qr),s(On,Br),s(On,Ur),s(On,Cl),oe(Cl,t[3].q.c),s(Ln,jr),s(Ln,Fn),s(Fn,Hr),s(Fn,Wr),s(Fn,zr),s(Fn,Ct),s(Ct,qn),s(Ct,Bn),s(Ct,Un),s(Ct,jn),s(Ct,Hn),s(Ct,Wn),$e(Ct,t[3].q.m,!0),s(lt,Gr),s(lt,xl),s(xl,Vr),s(xl,Kr),s(xl,Yr),s(xl,$l),oe($l,t[3].q.b),s(l,Qr),rt&&rt.m(l,null),s(l,Ss),at&&at.m(l,null),s(l,Ms),ut&&ut.m(l,null),s(l,Ts),ft&&ft.m(l,null),s(l,Es),s(l,cl),s(cl,ts),s(cl,Xr),s(cl,zn),ie(Gn,zn,null),s(cl,Zr),s(cl,fi),s(cl,Jr),s(cl,ci);for(let _t=0;_t0?St?St.p(B,me):(St=Ju(B),St.c(),St.m(n,null)):St&&(St.d(1),St=null),me[0]&8&&$e(Gt,B[3].m.a),me[0]&8&&(Zt.checked=B[3].m.i),(!Kt||me[0]&8&&Fi!==(Fi=B[3].m.b!=0))&&(Il.disabled=Fi),me[0]&8&&$e(rl,B[3].m.b),(!Kt||me[0]&8&&qi!==(qi=B[3].m.b!=0))&&(Ll.disabled=qi),(!Kt||me[0]&8&&Bi!==(Bi=B[3].m.b==0))&&(bt.disabled=Bi),me[0]&8&&$e(bt,B[3].m.p),(!Kt||me[0]&9&&Ui!==(Ui=B[0].chip=="esp8266"?B[3].i.h.p==3||B[3].i.h.p==113?512:128:4096))&&r(Ft,"max",Ui),me[0]&8&&ge(Ft.value)!==B[3].m.s&&oe(Ft,B[3].m.s),me[0]&8&&$e(al,B[3].m.d),me[0]&8&&ge(Jt.value)!==B[3].m.f&&oe(Jt,B[3].m.f),me[0]&8&&ge(xt.value)!==B[3].m.r&&oe(xt,B[3].m.r),me[0]&8&&(el.checked=B[3].m.e.e),B[3].m.e.e?Mt?Mt.p(B,me):(Mt=xu(B),Mt.c(),Mt.m(Yl,null)):Mt&&(Mt.d(1),Mt=null),B[3].m.e.e?Tt?Tt.p(B,me):(Tt=ef(B),Tt.c(),Tt.m(je,ws)):Tt&&(Tt.d(1),Tt=null),me[0]&8&&(tl.checked=B[3].m.m.e),B[3].m.m.e?Nt?Nt.p(B,me):(Nt=tf(B),Nt.c(),Nt.m(je,null)):Nt&&(Nt.d(1),Nt=null),B[0].if&&B[0].if.eth?Ht||(Ht=lf(),Ht.c(),Ht.m(Vt,null)):Ht&&(Ht.d(1),Ht=null),me[0]&8&&$e(Vt,B[3].n.c),B[3].n.c==1||B[3].n.c==2?Et?Et.p(B,me):(Et=nf(B),Et.c(),Et.m(qt,null)):Et&&(Et.d(1),Et=null),me[0]&8&&$e(ul,B[3].n.m),(!Kt||me[0]&8&&Ki!==(Ki=B[3].n.m=="dhcp"))&&(Bt.disabled=Ki),(!Kt||me[0]&8&&Yi!==(Yi=B[3].n.m=="static"))&&(Bt.required=Yi),me[0]&8&&Bt.value!==B[3].n.i&&oe(Bt,B[3].n.i),(!Kt||me[0]&8&&Qi!==(Qi=B[3].n.m=="dhcp"))&&(Ut.disabled=Qi),(!Kt||me[0]&8&&Xi!==(Xi=B[3].n.m=="static"))&&(Ut.required=Xi),me[0]&8&&$e(Ut,B[3].n.s),B[3].n.m=="static"?At?At.p(B,me):(At=sf(B),At.c(),At.m(mt,ys)):At&&(At.d(1),At=null),me[0]&8&&(ll.checked=B[3].n.d),me[0]&8&&(nl.checked=B[3].n.h),me[0]&8&&gl.value!==B[3].n.n1&&oe(gl,B[3].n.n1),B[0].chip!="esp8266"?Pt?Pt.p(B,me):(Pt=of(B),Pt.c(),Pt.m(fl,Cs)):Pt&&(Pt.d(1),Pt=null),me[0]&8&&kl.value!==B[3].q.h&&oe(kl,B[3].q.h),me[0]&8&&ge(il.value)!==B[3].q.p&&oe(il,B[3].q.p),B[3].q.s.e?ot?(ot.p(B,me),me[0]&8&&O(ot,1)):(ot=rf(B),ot.c(),O(ot,1),ot.m(lt,$s)):ot&&(Ae(),q(ot,1,1,()=>{ot=null}),Pe()),me[0]&8&&wl.value!==B[3].q.u&&oe(wl,B[3].q.u),me[0]&8&&yl.value!==B[3].q.a&&oe(yl,B[3].q.a),me[0]&8&&Cl.value!==B[3].q.c&&oe(Cl,B[3].q.c),me[0]&8&&$e(Ct,B[3].q.m),me[0]&8&&$l.value!==B[3].q.b&&oe($l,B[3].q.b),B[3].q.m==3?rt?(rt.p(B,me),me[0]&8&&O(rt,1)):(rt=af(B),rt.c(),O(rt,1),rt.m(l,Ss)):rt&&(Ae(),q(rt,1,1,()=>{rt=null}),Pe()),B[3].q.m==4?at?(at.p(B,me),me[0]&8&&O(at,1)):(at=uf(B),at.c(),O(at,1),at.m(l,Ms)):at&&(Ae(),q(at,1,1,()=>{at=null}),Pe()),B[3].c.es!=null?ut?(ut.p(B,me),me[0]&8&&O(ut,1)):(ut=ff(B),ut.c(),O(ut,1),ut.m(l,Ts)):ut&&(Ae(),q(ut,1,1,()=>{ut=null}),Pe()),me[0]&8&&(Ns=B[3].p.r.startsWith("10YNO")||B[3].p.r.startsWith("10Y1001A1001A4")),Ns?ft?(ft.p(B,me),me[0]&8&&O(ft,1)):(ft=_f(B),ft.c(),O(ft,1),ft.m(l,Es)):ft&&(Ae(),q(ft,1,1,()=>{ft=null}),Pe()),me[0]&136){Xn=B[7];let Yt;for(Yt=0;Yt20||B[0].chip=="esp8266"||B[3].i.d.d>0?ct?(ct.p(B,me),me[0]&9&&O(ct,1)):(ct=vf(B),ct.c(),O(ct,1),ct.m(l,As)):ct&&(Ae(),q(ct,1,1,()=>{ct=null}),Pe()),me[0]&8&&(sl.checked=B[3].d.s),B[3].d.s?Dt?Dt.p(B,me):(Dt=Cf(B),Dt.c(),Dt.m(jt,null)):Dt&&(Dt.d(1),Dt=null);const ua={};me[0]&2&&(ua.active=B[1]),en.$set(ua);const fa={};me[0]&4&&(fa.active=B[2]),tn.$set(fa);const ca={};me[0]&16&&(ca.active=B[4]),ln.$set(ca);const ma={};me[0]&32&&(ma.active=B[5]),nn.$set(ma)},i(B){Kt||(O(a.$$.fragment,B),O(R.$$.fragment,B),O(vt.$$.fragment,B),O(Pl.$$.fragment,B),O($n.$$.fragment,B),O(Nn.$$.fragment,B),O(Pn.$$.fragment,B),O(Rn.$$.fragment,B),O(ot),O(rt),O(at),O(ut),O(ft),O(Gn.$$.fragment,B),O(ct),O(Kn.$$.fragment,B),O(en.$$.fragment,B),O(tn.$$.fragment,B),O(ln.$$.fragment,B),O(nn.$$.fragment,B),Kt=!0)},o(B){q(a.$$.fragment,B),q(R.$$.fragment,B),q(vt.$$.fragment,B),q(Pl.$$.fragment,B),q($n.$$.fragment,B),q(Nn.$$.fragment,B),q(Pn.$$.fragment,B),q(Rn.$$.fragment,B),q(ot),q(rt),q(at),q(ut),q(ft),q(Gn.$$.fragment,B),q(ct),q(Kn.$$.fragment,B),q(en.$$.fragment,B),q(tn.$$.fragment,B),q(ln.$$.fragment,B),q(nn.$$.fragment,B),Kt=!1},d(B){B&&$(e),se(a),se(R),dt(_i,B),se(vt),$t&&$t.d(),St&&St.d(),se(Pl),dt(pi,B),Mt&&Mt.d(),Tt&&Tt.d(),Nt&&Nt.d(),se($n),Ht&&Ht.d(),Et&&Et.d(),se(Nn),se(Pn),At&&At.d(),se(Rn),Pt&&Pt.d(),ot&&ot.d(),rt&&rt.d(),at&&at.d(),ut&&ut.d(),ft&&ft.d(),se(Gn),dt(gt,B),ct&&ct.d(),se(Kn),Dt&&Dt.d(),B&&$(Ds),se(en,B),B&&$(Rs),se(tn,B),B&&$(Is),se(ln,B),B&&$(Ls),se(nn,B),Os=!1,ze(aa)}}}async function D_(){await(await fetch("/reboot",{method:"POST"})).json()}function R_(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:"Realtime plot",key:"l"},{name:"Price",key:"p"},{name:"Day plot",key:"d"},{name:"Month plot",key:"m"},{name:"Temperature plot",key:"s"},{name:"Dark mode",key:"k"}],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},d:{d:null,b:0},t:{d:null,a:null},v:{p:null,d:{v:null,g:null},o:null,m:null,b:null}},h:{t:"",h:"",n:""},c:{e:!1,i:null,s:null,es:null}};hi.subscribe(Ve=>{Ve.version&&(l(3,a=Ve),l(1,o=!1))}),Xm();let c=!1,f=!1;async function _(){if(confirm("Are you sure you want to factory reset the device?")){l(4,c=!0);const Ve=new URLSearchParams;Ve.append("perform","true");let ht=await(await fetch("/reset",{method:"POST",body:Ve})).json();l(4,c=!1),l(5,f=ht.success)}}async function p(Ve){l(2,u=!0);const yt=new FormData(Ve.target),ht=new URLSearchParams;for(let bl of yt){const[Oi,zl]=bl;ht.append(Oi,zl)}let Li=await(await fetch("/save",{method:"POST",body:ht})).json();Wt.update(bl=>(bl.booting=Li.reboot,bl.ui=a.u,bl)),l(2,u=!1),fn("/")}const b=function(){confirm("Are you sure you want to reboot the device?")&&(Wt.update(Ve=>(Ve.booting=!0,Ve)),D_())};async function v(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("/mqtt-ca",{method:"POST"})).text(),hi.update(yt=>(yt.q.s.c=!1,yt)))}async function d(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("/mqtt-cert",{method:"POST"})).text(),hi.update(yt=>(yt.q.s.r=!1,yt)))}async function g(){confirm("Are you sure you want to delete key?")&&(await(await fetch("/mqtt-key",{method:"POST"})).text(),hi.update(yt=>(yt.q.s.k=!1,yt)))}const w=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 M(){a.g.h=this.value,l(3,a)}function P(){a.g.t=tt(this),l(3,a)}function L(){a.p.r=tt(this),l(3,a)}function I(){a.p.c=tt(this),l(3,a)}function F(){a.p.e=this.checked,l(3,a)}function C(){a.p.t=this.value,l(3,a)}function R(){a.g.s=tt(this),l(3,a)}function ne(){a.g.u=this.value,l(3,a)}function H(){a.g.p=this.value,l(3,a)}function z(){a.m.a=tt(this),l(3,a)}function U(){a.m.i=this.checked,l(3,a)}function K(){a.m.b=tt(this),l(3,a)}function Q(){a.m.p=tt(this),l(3,a)}function G(){a.m.s=ge(this.value),l(3,a)}function X(){a.m.d=tt(this),l(3,a)}function Y(){a.m.f=ge(this.value),l(3,a)}function j(){a.m.r=ge(this.value),l(3,a)}function x(){a.m.e.e=this.checked,l(3,a)}function ae(){a.m.e.k=this.value,l(3,a)}function ee(){a.m.e.a=this.value,l(3,a)}function V(){a.m.m.e=this.checked,l(3,a)}function W(){a.m.m.w=ge(this.value),l(3,a)}function we(){a.m.m.v=ge(this.value),l(3,a)}function He(){a.m.m.a=ge(this.value),l(3,a)}function Le(){a.m.m.c=ge(this.value),l(3,a)}function Se(){a.n.c=tt(this),l(3,a)}function ye(){a.w.s=this.value,l(3,a)}function ve(){a.w.p=this.value,l(3,a)}function Te(){a.w.z=tt(this),l(3,a)}function be(){a.w.w=ge(this.value),l(3,a)}function N(){a.w.b=this.checked,l(3,a)}function y(){a.n.m=tt(this),l(3,a)}function k(){a.n.i=this.value,l(3,a)}function A(){a.n.s=tt(this),l(3,a)}function D(){a.n.g=this.value,l(3,a)}function Z(){a.n.d1=this.value,l(3,a)}function le(){a.n.d2=this.value,l(3,a)}function fe(){a.n.d=this.checked,l(3,a)}function de(){a.n.h=this.checked,l(3,a)}function Ce(){a.n.n1=this.value,l(3,a)}function Oe(){a.q.s.e=this.checked,l(3,a)}function ue(){a.q.h=this.value,l(3,a)}function Me(){a.q.p=ge(this.value),l(3,a)}function Je(){a.q.u=this.value,l(3,a)}function Lt(){a.q.a=this.value,l(3,a)}function st(){a.q.c=this.value,l(3,a)}function wt(){a.q.m=tt(this),l(3,a)}function nt(){a.q.b=this.value,l(3,a)}function Ot(){a.o.e=this.value,l(3,a)}function Qe(){a.o.c=this.value,l(3,a)}function Xt(){a.o.u1=this.value,l(3,a)}function zt(){a.o.u2=this.value,l(3,a)}function vt(){a.o.u3=this.value,l(3,a)}function xe(){a.h.t=this.value,l(3,a)}function Ge(){a.h.h=this.value,l(3,a)}function Ye(){a.h.n=this.value,l(3,a)}function Ne(){a.c.e=this.checked,l(3,a)}function Ze(){a.c.i=this.value,l(3,a)}function et(){a.c.s=this.value,l(3,a)}function qe(){a.c.es=this.checked,l(3,a)}function Fe(Ve){a.t.t[Ve]=ge(this.value),l(3,a)}function _e(){a.t.h=ge(this.value),l(3,a)}function ce(Ve){a.u[Ve.key]=tt(this),l(3,a)}function Be(){a.i.h.p=tt(this),l(3,a)}function pt(){a.i.h.t=tt(this),l(3,a)}function Tl(){a.i.h.u=this.checked,l(3,a)}function Nl(){a.i.a=ge(this.value),l(3,a)}function El(){a.i.l.p=ge(this.value),l(3,a)}function Mi(){a.i.l.i=this.checked,l(3,a)}function Ti(){a.i.r.i=this.checked,l(3,a)}function je(){a.i.r.r=ge(this.value),l(3,a)}function _n(){a.i.r.g=ge(this.value),l(3,a)}function Ni(){a.i.r.b=ge(this.value),l(3,a)}function Al(){a.i.d.d=ge(this.value),l(3,a)}function Pl(){a.i.t.d=ge(this.value),l(3,a)}function Ei(){a.i.t.a=ge(this.value),l(3,a)}function Hl(){a.i.v.p=ge(this.value),l(3,a)}function Ai(){a.i.v.d.v=ge(this.value),l(3,a)}function Wl(){a.i.v.d.g=ge(this.value),l(3,a)}function Pi(){a.i.d.b=tt(this),l(3,a)}function hl(){a.i.v.o=ge(this.value),l(3,a)}function Di(){a.i.v.m=ge(this.value),l(3,a)}function Ri(){a.i.v.b=ge(this.value),l(3,a)}function Ii(){a.d.s=this.checked,l(3,a)}function Gt(){a.d.t=this.checked,l(3,a)}function Dl(){a.d.l=tt(this),l(3,a)}return t.$$set=Ve=>{"sysinfo"in Ve&&l(0,n=Ve.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,g,w,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Le,Se,ye,ve,Te,be,N,y,k,A,D,Z,le,fe,de,Ce,Oe,ue,Me,Je,Lt,st,wt,nt,Ot,Qe,Xt,zt,vt,xe,Ge,Ye,Ne,Ze,et,qe,Fe,_e,ce,Be,pt,Tl,Nl,El,Mi,Ti,je,_n,Ni,Al,Pl,Ei,Hl,Ai,Wl,Pi,hl,Di,Ri,Ii,Gt,Dl]}class I_ extends Ie{constructor(e){super(),Re(this,e,R_,P_,Ee,{sysinfo:0},null,[-1,-1,-1,-1])}}function Sf(t,e,l){const n=t.slice();return n[20]=e[l],n}function L_(t){let e=he(t[1].chip,t[1].board)+"",l;return{c(){l=E(e)},m(n,i){S(n,l,i)},p(n,i){i&2&&e!==(e=he(n[1].chip,n[1].board)+"")&&J(l,e)},d(n){n&&$(l)}}}function Mf(t){let e,l,n=t[1].apmac+"",i,o,u,a,c,f,_,p,b,v=Pa(t[1])+"",d,g,w=t[1].boot_reason+"",T,M,P=t[1].ex_cause+"",L,I,F;const C=[F_,O_],R=[];function ne(H,z){return H[0].u>0?0:1}return c=ne(t),f=R[c]=C[c](t),{c(){e=m("div"),l=E("AP MAC: "),i=E(n),o=h(),u=m("div"),a=E(`Last boot: - `),f.c(),_=h(),p=m("div"),b=E("Reason: "),d=E(v),g=E(" ("),T=E(w),M=E("/"),L=E(P),I=E(")"),r(e,"class","my-2"),r(u,"class","my-2"),r(p,"class","my-2")},m(H,z){S(H,e,z),s(e,l),s(e,i),S(H,o,z),S(H,u,z),s(u,a),R[c].m(u,null),S(H,_,z),S(H,p,z),s(p,b),s(p,d),s(p,g),s(p,T),s(p,M),s(p,L),s(p,I),F=!0},p(H,z){(!F||z&2)&&n!==(n=H[1].apmac+"")&&J(i,n);let U=c;c=ne(H),c===U?R[c].p(H,z):(Ae(),q(R[U],1,1,()=>{R[U]=null}),Pe(),f=R[c],f?f.p(H,z):(f=R[c]=C[c](H),f.c()),O(f,1),f.m(u,null)),(!F||z&2)&&v!==(v=Pa(H[1])+"")&&J(d,v),(!F||z&2)&&w!==(w=H[1].boot_reason+"")&&J(T,w),(!F||z&2)&&P!==(P=H[1].ex_cause+"")&&J(L,P)},i(H){F||(O(f),F=!0)},o(H){q(f),F=!1},d(H){H&&$(e),H&&$(o),H&&$(u),R[c].d(),H&&$(_),H&&$(p)}}}function O_(t){let e;return{c(){e=E("-")},m(l,n){S(l,e,n)},p:pe,i:pe,o:pe,d(l){l&&$(e)}}}function F_(t){let e,l;return e=new Zc({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:""}}),{c(){re(e.$$.fragment)},m(n,i){ie(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||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function q_(t){let e;return{c(){e=m("span"),e.textContent="Update consents",r(e,"class","btn-pri-sm")},m(l,n){S(l,e,n)},p:pe,d(l){l&&$(e)}}}function Tf(t){let e,l,n,i,o,u=vs(t[1].meter.mfg)+"",a,c,f,_,p=(t[1].meter.model?t[1].meter.model:"unknown")+"",b,v,d,g,w=(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=E("Manufacturer: "),a=E(u),c=h(),f=m("div"),_=E("Model: "),b=E(p),v=h(),d=m("div"),g=E("ID: "),T=E(w),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(M,P){S(M,e,P),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,g),s(d,T)},p(M,P){P&2&&u!==(u=vs(M[1].meter.mfg)+"")&&J(a,u),P&2&&p!==(p=(M[1].meter.model?M[1].meter.model:"unknown")+"")&&J(b,p),P&2&&w!==(w=(M[1].meter.id?M[1].meter.id:"unknown")+"")&&J(T,w)},d(M){M&&$(e)}}}function Nf(t){let e,l,n,i,o,u=t[1].net.ip+"",a,c,f,_,p=t[1].net.mask+"",b,v,d,g,w=t[1].net.gw+"",T,M,P,L,I=t[1].net.dns1+"",F,C,R=t[1].net.dns2&&Ef(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Network",n=h(),i=m("div"),o=E("IP: "),a=E(u),c=h(),f=m("div"),_=E("Mask: "),b=E(p),v=h(),d=m("div"),g=E("Gateway: "),T=E(w),M=h(),P=m("div"),L=E("DNS: "),F=E(I),C=h(),R&&R.c(),r(l,"class","text-sm"),r(i,"class","my-2"),r(f,"class","my-2"),r(d,"class","my-2"),r(P,"class","my-2"),r(e,"class","cnt")},m(ne,H){S(ne,e,H),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,g),s(d,T),s(e,M),s(e,P),s(P,L),s(P,F),s(P,C),R&&R.m(P,null)},p(ne,H){H&2&&u!==(u=ne[1].net.ip+"")&&J(a,u),H&2&&p!==(p=ne[1].net.mask+"")&&J(b,p),H&2&&w!==(w=ne[1].net.gw+"")&&J(T,w),H&2&&I!==(I=ne[1].net.dns1+"")&&J(F,I),ne[1].net.dns2?R?R.p(ne,H):(R=Ef(ne),R.c(),R.m(P,null)):R&&(R.d(1),R=null)},d(ne){ne&&$(e),R&&R.d()}}}function Ef(t){let e,l=t[1].net.dns2+"",n;return{c(){e=E("/ "),n=E(l)},m(i,o){S(i,e,o),S(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns2+"")&&J(n,l)},d(i){i&&$(e),i&&$(n)}}}function Af(t){let e,l,n,i=t[1].upgrade.f+"",o,u,a=t[1].upgrade.t+"",c,f,_=Aa(t[1].upgrade.e)+"",p;return{c(){e=m("div"),l=m("div"),n=E("Previous upgrade attempt from "),o=E(i),u=E(" to "),c=E(a),f=E(" failed. "),p=E(_),r(l,"class","bd-yellow"),r(e,"class","my-2")},m(b,v){S(b,e,v),s(e,l),s(l,n),s(l,o),s(l,u),s(l,c),s(l,f),s(l,p)},p(b,v){v&2&&i!==(i=b[1].upgrade.f+"")&&J(o,i),v&2&&a!==(a=b[1].upgrade.t+"")&&J(c,a),v&2&&_!==(_=Aa(b[1].upgrade.e)+"")&&J(p,_)},d(b){b&&$(e)}}}function Pf(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&&Df(t),b=t[1].fwconsent===2&&Rf();return{c(){e=m("div"),l=E(`Latest version: - `),n=m("a"),o=E(i),a=h(),p&&p.c(),c=h(),b&&b.c(),f=Ke(),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){S(v,e,d),s(e,l),s(e,n),s(n,o),s(e,a),p&&p.m(e,null),S(v,c,d),b&&b.m(v,d),S(v,f,d),_=!0},p(v,d){(!_||d&4)&&i!==(i=v[2].tag_name+"")&&J(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&&O(p,1)):(p=Df(v),p.c(),O(p,1),p.m(e,null)):p&&(Ae(),q(p,1,1,()=>{p=null}),Pe()),v[1].fwconsent===2?b||(b=Rf(),b.c(),b.m(f.parentNode,f)):b&&(b.d(1),b=null)},i(v){_||(O(p),_=!0)},o(v){q(p),_=!1},d(v){v&&$(e),p&&p.d(),v&&$(c),b&&b.d(v),v&&$(f)}}}function Df(t){let e,l,n,i,o,u;return n=new Jc({}),{c(){e=m("div"),l=m("button"),re(n.$$.fragment),r(e,"class","flex-none ml-2 text-green-500"),r(e,"title","Install this version")},m(a,c){S(a,e,c),s(e,l),ie(n,l,null),i=!0,o||(u=te(l,"click",t[10]),o=!0)},p:pe,i(a){i||(O(n.$$.fragment,a),i=!0)},o(a){q(n.$$.fragment,a),i=!1},d(a){a&&$(e),se(n),o=!1,u()}}}function Rf(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){S(l,e,n)},d(l){l&&$(e)}}}function If(t){let e,l=hs(he(t[1].chip,t[1].board))+"",n;return{c(){e=m("div"),n=E(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&2&&l!==(l=hs(he(i[1].chip,i[1].board))+"")&&J(n,l)},d(i){i&&$(e)}}}function Lf(t){let e,l,n,i,o,u;function a(_,p){return _[4].length==0?U_:B_}let c=a(t),f=c(t);return{c(){e=m("div"),l=m("form"),n=m("input"),i=h(),f.c(),co(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){S(_,e,p),s(e,l),s(l,n),t[12](n),s(l,i),f.m(l,null),o||(u=[te(n,"change",t[13]),te(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(_){_&&$(e),t[12](null),f.d(),o=!1,ze(u)}}}function B_(t){let e=t[4][0].name+"",l,n,i;return{c(){l=E(e),n=h(),i=m("button"),i.textContent="Upload",r(i,"type","submit"),r(i,"class","btn-pri-sm float-right")},m(o,u){S(o,l,u),S(o,n,u),S(o,i,u)},p(o,u){u&16&&e!==(e=o[4][0].name+"")&&J(l,e)},d(o){o&&$(l),o&&$(n),o&&$(i)}}}function U_(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){S(i,e,o),l||(n=te(e,"click",t[14]),l=!0)},p:pe,d(i){i&&$(e),l=!1,n()}}}function Of(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g=t[9],w=[];for(let I=0;I Include Secrets
(SSID, PSK, passwords and tokens)',c=h(),T&&T.c(),f=h(),_=m("form"),p=m("input"),b=h(),L.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"),co(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(I,F){S(I,e,F),s(e,l),s(e,n),s(e,i),s(i,o);for(let C=0;C{A=null}),Pe());const Lt={};Me&8388608&&(Lt.$$scope={dirty:Me,ctx:ue}),ne.$set(Lt),ue[1].meter?D?D.p(ue,Me):(D=Tf(ue),D.c(),D.m(e,K)):D&&(D.d(1),D=null),ue[1].net?Z?Z.p(ue,Me):(Z=Nf(ue),Z.c(),Z.m(e,Q)):Z&&(Z.d(1),Z=null),(!N||Me&2)&&ae!==(ae=ue[1].version+"")&&J(ee,ae),ue[1].upgrade.t&&ue[1].upgrade.t!=ue[1].version?le?le.p(ue,Me):(le=Af(ue),le.c(),le.m(G,W)):le&&(le.d(1),le=null),ue[2]?fe?(fe.p(ue,Me),Me&4&&O(fe,1)):(fe=Pf(ue),fe.c(),O(fe,1),fe.m(G,we)):fe&&(Ae(),q(fe,1,1,()=>{fe=null}),Pe()),Me&3&&(He=(ue[1].security==0||ue[0].a)&&ti(ue[1].board)),He?de?de.p(ue,Me):(de=If(ue),de.c(),de.m(G,Le)):de&&(de.d(1),de=null),ue[1].security==0||ue[0].a?Ce?Ce.p(ue,Me):(Ce=Lf(ue),Ce.c(),Ce.m(G,null)):Ce&&(Ce.d(1),Ce=null),ue[1].security==0||ue[0].a?Oe?Oe.p(ue,Me):(Oe=Of(ue),Oe.c(),Oe.m(e,null)):Oe&&(Oe.d(1),Oe=null);const st={};Me&32&&(st.active=ue[5]),ve.$set(st);const wt={};Me&256&&(wt.active=ue[8]),be.$set(wt)},i(ue){N||(O(w.$$.fragment,ue),O(A),O(ne.$$.fragment,ue),O(fe),O(ve.$$.fragment,ue),O(be.$$.fragment,ue),N=!0)},o(ue){q(w.$$.fragment,ue),q(A),q(ne.$$.fragment,ue),q(fe),q(ve.$$.fragment,ue),q(be.$$.fragment,ue),N=!1},d(ue){ue&&$(e),se(w),A&&A.d(),se(ne),D&&D.d(),Z&&Z.d(),le&&le.d(),fe&&fe.d(),de&&de.d(),Ce&&Ce.d(),Oe&&Oe.d(),ue&&$(ye),se(ve,ue),ue&&$(Te),se(be,ue),y=!1,k()}}}async function z_(){await(await fetch("/reboot",{method:"POST"})).json()}function G_(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={};yo.subscribe(C=>{l(2,u=Xc(i.version,C)),u||l(2,u=C[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(hs(he(i.chip,i.board))))&&(Wt.update(C=>(C.upgrading=!0,C)),Qc(u.tag_name))}const c=function(){confirm("Are you sure you want to reboot the device?")&&(Wt.update(C=>(C.booting=!0,C)),z_())};let f,_=[],p=!1,b,v=[],d=!1;bo();function g(C){ps[C?"unshift":"push"](()=>{f=C,l(3,f)})}function w(){_=this.files,l(4,_)}const T=()=>{f.click()},M=()=>l(5,p=!0);function P(C){ps[C?"unshift":"push"](()=>{b=C,l(6,b)})}function L(){v=this.files,l(7,v)}const I=()=>{b.click()},F=()=>l(8,d=!0);return t.$$set=C=>{"data"in C&&l(0,n=C.data),"sysinfo"in C&&l(1,i=C.sysinfo)},[n,i,u,f,_,p,b,v,d,o,a,c,g,w,T,M,P,L,I,F]}class V_ extends Ie{constructor(e){super(),Re(this,e,G_,W_,Ee,{data:0,sysinfo:1})}}function Bf(t){let e,l,n=he(t[0],7)+"",i,o,u=he(t[0],5)+"",a,c,f=he(t[0],4)+"",_,p,b=he(t[0],3)+"",v,d,g,w,T=he(t[0],2)+"",M,P,L=he(t[0],1)+"",I,F,C=he(t[0],0)+"",R,ne,H,z,U=he(t[0],101)+"",K,Q,G=he(t[0],100)+"",X;return{c(){e=m("optgroup"),l=m("option"),i=E(n),o=m("option"),a=E(u),c=m("option"),_=E(f),p=m("option"),v=E(b),d=h(),g=m("optgroup"),w=m("option"),M=E(T),P=m("option"),I=E(L),F=m("option"),R=E(C),ne=h(),H=m("optgroup"),z=m("option"),K=E(U),Q=m("option"),X=E(G),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"),w.__value=2,w.value=w.__value,P.__value=1,P.value=P.__value,F.__value=0,F.value=F.__value,r(g,"label","Custom hardware"),z.__value=101,z.value=z.__value,Q.__value=100,Q.value=Q.__value,r(H,"label","Generic hardware")},m(Y,j){S(Y,e,j),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,_),s(e,p),s(p,v),S(Y,d,j),S(Y,g,j),s(g,w),s(w,M),s(g,P),s(P,I),s(g,F),s(F,R),S(Y,ne,j),S(Y,H,j),s(H,z),s(z,K),s(H,Q),s(Q,X)},p(Y,j){j&1&&n!==(n=he(Y[0],7)+"")&&J(i,n),j&1&&u!==(u=he(Y[0],5)+"")&&J(a,u),j&1&&f!==(f=he(Y[0],4)+"")&&J(_,f),j&1&&b!==(b=he(Y[0],3)+"")&&J(v,b),j&1&&T!==(T=he(Y[0],2)+"")&&J(M,T),j&1&&L!==(L=he(Y[0],1)+"")&&J(I,L),j&1&&C!==(C=he(Y[0],0)+"")&&J(R,C),j&1&&U!==(U=he(Y[0],101)+"")&&J(K,U),j&1&&G!==(G=he(Y[0],100)+"")&&J(X,G)},d(Y){Y&&$(e),Y&&$(d),Y&&$(g),Y&&$(ne),Y&&$(H)}}}function Uf(t){let e,l,n=he(t[0],201)+"",i,o,u=he(t[0],202)+"",a,c,f=he(t[0],203)+"",_,p,b=he(t[0],241)+"",v,d,g=he(t[0],242)+"",w,T,M=he(t[0],243)+"",P,L,I=he(t[0],200)+"",F;return{c(){e=m("optgroup"),l=m("option"),i=E(n),o=m("option"),a=E(u),c=m("option"),_=E(f),p=m("option"),v=E(b),d=m("option"),w=E(g),T=m("option"),P=E(M),L=m("option"),F=E(I),l.__value=201,l.value=l.__value,o.__value=202,o.value=o.__value,c.__value=203,c.value=c.__value,p.__value=241,p.value=p.__value,d.__value=242,d.value=d.__value,T.__value=243,T.value=T.__value,L.__value=200,L.value=L.__value,r(e,"label","Generic hardware")},m(C,R){S(C,e,R),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,_),s(e,p),s(p,v),s(e,d),s(d,w),s(e,T),s(T,P),s(e,L),s(L,F)},p(C,R){R&1&&n!==(n=he(C[0],201)+"")&&J(i,n),R&1&&u!==(u=he(C[0],202)+"")&&J(a,u),R&1&&f!==(f=he(C[0],203)+"")&&J(_,f),R&1&&b!==(b=he(C[0],241)+"")&&J(v,b),R&1&&g!==(g=he(C[0],242)+"")&&J(w,g),R&1&&M!==(M=he(C[0],243)+"")&&J(P,M),R&1&&I!==(I=he(C[0],200)+"")&&J(F,I)},d(C){C&&$(e)}}}function jf(t){let e,l,n=he(t[0],7)+"",i,o,u=he(t[0],6)+"",a,c,f=he(t[0],5)+"",_,p,b,v,d=he(t[0],51)+"",g,w,T=he(t[0],50)+"",M;return{c(){e=m("optgroup"),l=m("option"),i=E(n),o=m("option"),a=E(u),c=m("option"),_=E(f),p=h(),b=m("optgroup"),v=m("option"),g=E(d),w=m("option"),M=E(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,w.__value=50,w.value=w.__value,r(b,"label","Generic hardware")},m(P,L){S(P,e,L),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,_),S(P,p,L),S(P,b,L),s(b,v),s(v,g),s(b,w),s(w,M)},p(P,L){L&1&&n!==(n=he(P[0],7)+"")&&J(i,n),L&1&&u!==(u=he(P[0],6)+"")&&J(a,u),L&1&&f!==(f=he(P[0],5)+"")&&J(_,f),L&1&&d!==(d=he(P[0],51)+"")&&J(g,d),L&1&&T!==(T=he(P[0],50)+"")&&J(M,T)},d(P){P&&$(e),P&&$(p),P&&$(b)}}}function Hf(t){let e,l,n=he(t[0],8)+"",i,o,u,a,c=he(t[0],71)+"",f,_,p=he(t[0],70)+"",b;return{c(){e=m("optgroup"),l=m("option"),i=E(n),o=h(),u=m("optgroup"),a=m("option"),f=E(c),_=m("option"),b=E(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){S(v,e,d),s(e,l),s(l,i),S(v,o,d),S(v,u,d),s(u,a),s(a,f),s(u,_),s(_,b)},p(v,d){d&1&&n!==(n=he(v[0],8)+"")&&J(i,n),d&1&&c!==(c=he(v[0],71)+"")&&J(f,c),d&1&&p!==(p=he(v[0],70)+"")&&J(b,p)},d(v){v&&$(e),v&&$(o),v&&$(u)}}}function Wf(t){let e,l,n=he(t[0],200)+"",i;return{c(){e=m("optgroup"),l=m("option"),i=E(n),l.__value=200,l.value=l.__value,r(e,"label","Generic hardware")},m(o,u){S(o,e,u),s(e,l),s(l,i)},p(o,u){u&1&&n!==(n=he(o[0],200)+"")&&J(i,n)},d(o){o&&$(e)}}}function zf(t){let e,l,n=he(t[0],80)+"",i;return{c(){e=m("optgroup"),l=m("option"),i=E(n),l.__value=80,l.value=l.__value,r(e,"label","Generic hardware")},m(o,u){S(o,e,u),s(e,l),s(l,i)},p(o,u){u&1&&n!==(n=he(o[0],80)+"")&&J(i,n)},d(o){o&&$(e)}}}function K_(t){let e,l,n,i,o,u,a,c,f=t[0]=="esp8266"&&Bf(t),_=t[0]=="esp32"&&Uf(t),p=t[0]=="esp32s2"&&jf(t),b=t[0]=="esp32c3"&&Hf(t),v=t[0]=="esp32solo"&&Wf(t),d=t[0]=="esp32s3"&&zf(t);return{c(){e=m("option"),l=h(),f&&f.c(),n=h(),_&&_.c(),i=h(),p&&p.c(),o=h(),b&&b.c(),u=h(),v&&v.c(),a=h(),d&&d.c(),c=Ke(),e.__value=-1,e.value=e.__value},m(g,w){S(g,e,w),S(g,l,w),f&&f.m(g,w),S(g,n,w),_&&_.m(g,w),S(g,i,w),p&&p.m(g,w),S(g,o,w),b&&b.m(g,w),S(g,u,w),v&&v.m(g,w),S(g,a,w),d&&d.m(g,w),S(g,c,w)},p(g,[w]){g[0]=="esp8266"?f?f.p(g,w):(f=Bf(g),f.c(),f.m(n.parentNode,n)):f&&(f.d(1),f=null),g[0]=="esp32"?_?_.p(g,w):(_=Uf(g),_.c(),_.m(i.parentNode,i)):_&&(_.d(1),_=null),g[0]=="esp32s2"?p?p.p(g,w):(p=jf(g),p.c(),p.m(o.parentNode,o)):p&&(p.d(1),p=null),g[0]=="esp32c3"?b?b.p(g,w):(b=Hf(g),b.c(),b.m(u.parentNode,u)):b&&(b.d(1),b=null),g[0]=="esp32solo"?v?v.p(g,w):(v=Wf(g),v.c(),v.m(a.parentNode,a)):v&&(v.d(1),v=null),g[0]=="esp32s3"?d?d.p(g,w):(d=zf(g),d.c(),d.m(c.parentNode,c)):d&&(d.d(1),d=null)},i:pe,o:pe,d(g){g&&$(e),g&&$(l),f&&f.d(g),g&&$(n),_&&_.d(g),g&&$(i),p&&p.d(g),g&&$(o),b&&b.d(g),g&&$(u),v&&v.d(g),g&&$(a),d&&d.d(g),g&&$(c)}}}function Y_(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class Q_ extends Ie{constructor(e){super(),Re(this,e,Y_,K_,Ee,{chip:0})}}function Gf(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){S(l,e,n)},d(l){l&&$(e)}}}function Vf(t){let e,l,n,i,o,u,a;return u=new io({props:{chip:t[0].chip}}),{c(){e=m("div"),l=E("HAN GPIO"),n=m("br"),i=h(),o=m("select"),re(u.$$.fragment),r(o,"name","vh"),r(o,"class","in-s"),r(e,"class","my-3")},m(c,f){S(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),ie(u,o,null),a=!0},p(c,f){const _={};f&1&&(_.chip=c[0].chip),u.$set(_)},i(c){a||(O(u.$$.fragment,c),a=!0)},o(c){q(u.$$.fragment,c),a=!1},d(c){c&&$(e),se(u)}}}function X_(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q=t[0].usrcfg&&Gf();d=new Q_({props:{chip:t[0].chip}});let G=t[0].board&&t[0].board>20&&Vf(t);return H=new kt({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(),Q&&Q.c(),c=h(),f=m("div"),_=E("Board type"),p=m("br"),b=h(),v=m("select"),re(d.$$.fragment),g=h(),G&&G.c(),w=h(),T=m("div"),M=m("label"),P=m("input"),L=E(" Clear all other configuration"),I=h(),F=m("div"),F.innerHTML='',C=h(),R=m("span"),R.textContent="\xA0",ne=h(),re(H.$$.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&&We(()=>t[4].call(v)),r(f,"class","my-3"),r(P,"type","checkbox"),r(P,"name","vr"),P.__value="true",P.value=P.__value,r(P,"class","rounded mb-1"),r(T,"class","my-3"),r(F,"class","my-3"),r(R,"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(X,Y){S(X,e,Y),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),Q&&Q.m(n,null),s(n,c),s(n,f),s(f,_),s(f,p),s(f,b),s(f,v),ie(d,v,null),$e(v,t[0].board,!0),s(n,g),G&&G.m(n,null),s(n,w),s(n,T),s(T,M),s(M,P),P.checked=t[2],s(M,L),s(n,I),s(n,F),s(n,C),s(n,R),S(X,ne,Y),ie(H,X,Y),z=!0,U||(K=[te(v,"change",t[4]),te(P,"change",t[5]),te(n,"submit",wi(t[3]))],U=!0)},p(X,[Y]){X[0].usrcfg?Q||(Q=Gf(),Q.c(),Q.m(n,c)):Q&&(Q.d(1),Q=null);const j={};Y&1&&(j.chip=X[0].chip),d.$set(j),Y&1&&$e(v,X[0].board),X[0].board&&X[0].board>20?G?(G.p(X,Y),Y&1&&O(G,1)):(G=Vf(X),G.c(),O(G,1),G.m(n,w)):G&&(Ae(),q(G,1,1,()=>{G=null}),Pe()),Y&4&&(P.checked=X[2]);const x={};Y&2&&(x.active=X[1]),H.$set(x)},i(X){z||(O(d.$$.fragment,X),O(G),O(H.$$.fragment,X),z=!0)},o(X){q(d.$$.fragment,X),q(G),q(H.$$.fragment,X),z=!1},d(X){X&&$(e),Q&&Q.d(),se(d),G&&G.d(),X&&$(ne),se(H,X),U=!1,ze(K)}}}function Z_(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[g,w]=d;p.append(g,w)}let v=await(await fetch("/save",{method:"POST",body:p})).json();l(1,i=!1),Wt.update(d=>(d.vndcfg=v.success,d.booting=v.reboot,d.if.eth=d.boardType>240&&d.boardType<250,d)),fn(n.usrcfg?"/":"/setup")}let u=!1;Wt.subscribe(f=>{l(0,n=f),f.fwconsent===1&&l(2,u=!n.usrcfg)});function a(){n.board=tt(this),l(0,n)}function c(){u=this.checked,l(2,u)}return t.$$set=f=>{"sysinfo"in f&&l(0,n=f.sysinfo)},[n,i,u,o,a,c]}class J_ extends Ie{constructor(e){super(),Re(this,e,Z_,X_,Ee,{sysinfo:0})}}function Kf(t){let e;return{c(){e=m("option"),e.textContent="Ethernet",e.__value=3,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Yf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v;return{c(){e=m("div"),l=E("SSID"),n=m("br"),i=h(),o=m("input"),a=h(),c=m("div"),f=E("PSK"),_=m("br"),p=h(),b=m("input"),r(o,"name","ss"),r(o,"type","text"),r(o,"class","in-s"),o.required=u=t[2]==1||t[2]==2,r(e,"class","my-3"),r(b,"name","sp"),r(b,"type","password"),r(b,"class","in-s"),r(b,"autocomplete","off"),b.required=v=t[2]==2,r(c,"class","my-3")},m(d,g){S(d,e,g),s(e,l),s(e,n),s(e,i),s(e,o),S(d,a,g),S(d,c,g),s(c,f),s(c,_),s(c,p),s(c,b)},p(d,g){g&4&&u!==(u=d[2]==1||d[2]==2)&&(o.required=u),g&4&&v!==(v=d[2]==2)&&(b.required=v)},d(d){d&&$(e),d&&$(a),d&&$(c)}}}function Qf(t){let e,l,n,i,o,u,a,c;return a=new t1({}),{c(){e=m("br"),l=h(),n=m("div"),i=m("input"),o=h(),u=m("select"),re(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,_){S(f,e,_),S(f,l,_),S(f,n,_),s(n,i),s(n,o),s(n,u),ie(a,u,null),c=!0},p(f,_){(!c||_&2)&&(i.required=f[1]),(!c||_&2)&&(u.required=f[1])},i(f){c||(O(a.$$.fragment,f),c=!0)},o(f){q(a.$$.fragment,f),c=!1},d(f){f&&$(e),f&&$(l),f&&$(n),se(a)}}}function Xf(t){let e;return{c(){e=m("div"),e.innerHTML=`
Gateway
+Occurred in: ${i}`:"",u=vo(t),a=_c(e)?e(u):e;return`<${u}> ${a}${o}`}const Tc=t=>(...e)=>t(L1(...e)),Nc=Tc(t=>{throw new Error(t)}),ds=Tc(console.warn),ga=4,R1=3,I1=2,O1=1,F1=1;function q1(t,e){const l=t.default?0:vl(t.fullPath).reduce((n,i)=>{let o=n;return o+=ga,$1(i)?o+=F1:S1(i)?o+=I1:wc(i)?o-=ga+O1:o+=R1,o},0);return{route:t,score:l,index:e}}function B1(t){return t.map(q1).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function Ec(t,e){let l,n;const[i]=e.split("?"),o=vl(i),u=o[0]==="",a=B1(t);for(let m=0,f=a.length;m({...p,params:h,uri:P});if(p.default){n=v(e);continue}const d=vl(p.fullPath),g=Math.max(o.length,d.length);let y=0;for(;y{f===".."?m.pop():f!=="."&&m.push(f)}),qs(`/${m.join("/")}`,n)}function ka(t,e){const{pathname:l,hash:n="",search:i="",state:o}=t,u=vl(e,!0),a=vl(l,!0);for(;u.length;)u[0]!==a[0]&&Nc(cn,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),u.shift(),a.shift();return{pathname:$i(...a),hash:n,search:i,state:o}}const wa=t=>t.length===1?"":t,ho=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,o=i?wa(di(t,l)):"",u=i?di(t,0,l):t,a=n?wa(di(u,e)):"";return{pathname:(n?di(u,0,e):u)||"/",search:a,hash:o}},j1=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function H1(t,e,l){return $i(l,U1(t,e))}function W1(t,e){const l=_o(M1(t)),n=vl(l,!0),i=vl(e,!0).slice(0,n.length),o=Ac({fullPath:l},$i(...i));return o&&o.uri}const Bs="POP",z1="PUSH",G1="REPLACE";function Us(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function V1(t){let e=[],l=Us(t),n=Bs;const i=(o=e)=>o.forEach(u=>u({location:l,action:n}));return{get location(){return l},listen(o){e.push(o);const u=()=>{l=Us(t),n=Bs,i([o])};i([o]);const a=vc(t,"popstate",u);return()=>{a(),e=e.filter(m=>m!==o)}},navigate(o,u){const{state:a={},replace:m=!1}=u||{};if(n=m?G1:z1,pc(o))u&&ds(Mc,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=Bs,t.history.go(o);else{const f={...a,_key:k1()};try{t.history[m?"replaceState":"pushState"](f,"",o)}catch{t.location[m?"replace":"assign"](o)}}l=Us(t),i()}}}function js(t,e){return{...ho(e),state:t}}function K1(t="/"){let e=0,l=[js(null,t)];return{get entries(){return l},get location(){return l[e]},addEventListener(){},removeEventListener(){},history:{get state(){return l[e].state},pushState(n,i,o){e++,l=l.slice(0,e),l.push(js(n,o))},replaceState(n,i,o){l[e]=js(n,o)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const Y1=!!(!jl&&window.document&&window.document.createElement),Q1=!jl&&window.location.origin==="null",Pc=V1(Y1&&!Q1?window:K1()),{navigate:fn}=Pc;let Sl=null,Dc=!0;function X1(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nSl.level||t.level===Sl.level&&X1(t.routerId,Sl.routerId))&&(Sl=t)}function J1(){Sl=null}function x1(){Dc=!1}function ya(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=vc(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function e0(t,e){return Number(t.dataset.svnavRouteEnd)===e}function t0(t){return/^H[1-6]$/i.test(t.tagName)}function Ca(t,e=document){return e.querySelector(t)}function l0(t){let l=Ca(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!e0(l,t);){if(t0(l))return l;const n=Ca("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function n0(t){Promise.resolve(li(t.focusElement)).then(e=>{const l=e||l0(t.id);l||ds(cn,`Could not find an element to focus. You should always render a header for accessibility reasons, or set a custom focus element via the "useFocus" hook. If you don't want this Route or Router to manage focus, pass "primary={false}" to it.`,t,bs),!ya(l)&&ya(document.documentElement)})}const i0=(t,e,l)=>(n,i)=>d1().then(()=>{if(!Sl||Dc){x1();return}if(n&&n0(Sl.route),t.announcements&&i){const{path:o,fullPath:u,meta:a,params:m,uri:f}=Sl.route,p=t.createAnnouncement({path:o,fullPath:u,meta:a,params:m,uri:f},li(l));Promise.resolve(p).then(_=>{e.set(_)})}J1()}),s0="position:fixed;top:-1px;left:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;";function o0(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},hc(t[6],s0)],i={};for(let o=0;o`Navigated to ${ee.uri}`,announcements:!0,...d},P=p,M=_o(p),E=Ul(Vs),R=Ul(ii),O=!E,F=a0(),w=v&&!(R&&!R.manageFocus),D=it("");pl(t,D,ee=>l(0,a=ee));const ne=R?R.disableInlineStyles:g,H=it([]);pl(t,H,ee=>l(20,u=ee));const z=it(null);pl(t,z,ee=>l(18,i=ee));let U=!1;const K=O?0:R.level+1,G=O?it((()=>ka(jl?ho(_):h.location,M))()):E;pl(t,G,ee=>l(17,n=ee));const X=it(n);pl(t,X,ee=>l(19,o=ee));const Y=i0(y,D,G),j=ee=>V=>V.filter(W=>W.id!==ee);function x(ee){if(jl){if(U)return;const V=Ac(ee,n.pathname);if(V)return U=!0,V}else H.update(V=>{const W=j(ee.id)(V);return W.push(ee),W})}function ae(ee){H.update(j(ee))}return!O&&p!==$a&&ds(cn,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:p}),O&&(ac(()=>h.listen(V=>{const W=ka(V.location,M);X.set(n),G.set(W)})),gi(Vs,G)),gi(ii,{activeRoute:z,registerRoute:x,unregisterRoute:ae,manageFocus:w,level:K,id:F,history:O?h:R.history,basepath:O?M:R.basepath,disableInlineStyles:ne}),t.$$set=ee=>{"basepath"in ee&&l(11,p=ee.basepath),"url"in ee&&l(12,_=ee.url),"history"in ee&&l(13,h=ee.history),"primary"in ee&&l(14,v=ee.primary),"a11y"in ee&&l(15,d=ee.a11y),"disableInlineStyles"in ee&&l(16,g=ee.disableInlineStyles),"$$scope"in ee&&l(21,f=ee.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&p!==P&&ds(cn,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const ee=Ec(u,n.pathname);z.set(ee)}if(t.$$.dirty[0]&655360&&O){const ee=!!n.hash,V=!ee&&w,W=!ee||n.pathname!==o.pathname;Y(V,W)}t.$$.dirty[0]&262144&&w&&i&&i.primary&&Z1({level:K,routerId:F,route:i})},[a,y,O,F,w,D,ne,H,z,G,X,p,_,h,v,d,g,n,i,o,u,f,m]}class f0 extends Re{constructor(e){super(),Le(this,e,u0,r0,Ee,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const Lc=f0;function Si(t,e,l=ii,n=cn){Ul(l)||Nc(t,o=>`You cannot use ${o} outside of a ${vo(n)}.`,e)}const c0=t=>{const{subscribe:e}=Ul(t);return{subscribe:e}};function Rc(){return Si(Cc),c0(Vs)}function Ic(){const{history:t}=Ul(ii);return t}function Oc(){const t=Ul(gc);return t?w1(t,e=>e.base):it("/")}function Fc(){Si(Sc);const t=Oc(),{basepath:e}=Ul(ii);return n=>H1(n,li(t),e)}function m0(){Si($c);const t=Fc(),{navigate:e}=Ic();return(n,i)=>{const o=pc(n)?n:t(n);return e(o,i)}}const _0=t=>({params:t&16,location:t&8}),Sa=t=>({params:jl?li(t[10]):t[4],location:t[3],navigate:t[11]});function Ma(t){let e,l;return e=new Lc({props:{primary:t[1],$$slots:{default:[v0]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.primary=n[1]),i&528409&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function p0(t){let e;const l=t[18].default,n=ro(l,t,t[19],Sa);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&524312)&&uo(n,l,i,i[19],e?ao(l,i[19],o,_0):fo(i[19]),Sa)},i(i){e||(I(n,i),e=!0)},o(i){q(n,i),e=!1},d(i){n&&n.d(i)}}}function d0(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},jl?li(t[10]):t[4],t[12]];var o=t[0];function u(a){let m={};for(let f=0;f{se(p,1)}),Pe()}o?(e=da(o,u()),re(e.$$.fragment),I(e.$$.fragment,1),ie(e,l.parentNode,l)):e=null}else o&&e.$set(f)},i(a){n||(e&&I(e.$$.fragment,a),n=!0)},o(a){e&&q(e.$$.fragment,a),n=!1},d(a){a&&$(l),e&&se(e,a)}}}function v0(t){let e,l,n,i;const o=[d0,p0],u=[];function a(m,f){return m[0]!==null?0:1}return e=a(t),l=u[e]=o[e](t),{c(){l.c(),n=Ke()},m(m,f){u[e].m(m,f),S(m,n,f),i=!0},p(m,f){let p=e;e=a(m),e===p?u[e].p(m,f):(Ae(),q(u[p],1,1,()=>{u[p]=null}),Pe(),l=u[e],l?l.p(m,f):(l=u[e]=o[e](m),l.c()),I(l,1),l.m(n.parentNode,n))},i(m){i||(I(l),i=!0)},o(m){q(l),i=!1},d(m){u[e].d(m),m&&$(n)}}}function h0(t){let e,l,n,i,o,u=[Gs(t[7]),{"data-svnav-route-start":t[5]}],a={};for(let _=0;_{m=null}),Pe())},i(_){o||(I(m),o=!0)},o(_){q(m),o=!1},d(_){_&&$(e),_&&$(l),m&&m.d(_),_&&$(n),_&&$(i)}}}const b0=dc();function g0(t,e,l){let n;const i=["path","component","meta","primary"];let o=_s(e,i),u,a,m,f,{$$slots:p={},$$scope:_}=e,{path:h=""}=e,{component:v=null}=e,{meta:d={}}=e,{primary:g=!0}=e;Si(bs,e);const y=b0(),{registerRoute:P,unregisterRoute:M,activeRoute:E,disableInlineStyles:R}=Ul(ii);pl(t,E,U=>l(16,u=U));const O=Oc();pl(t,O,U=>l(17,m=U));const F=Rc();pl(t,F,U=>l(3,a=U));const w=it(null);let D;const ne=it(),H=it({});pl(t,H,U=>l(4,f=U)),gi(gc,ne),gi(y1,H),gi(C1,w);const z=m0();return jl||_1(()=>M(y)),t.$$set=U=>{l(24,e=ol(ol({},e),ms(U))),l(12,o=_s(e,i)),"path"in U&&l(13,h=U.path),"component"in U&&l(0,v=U.component),"meta"in U&&l(14,d=U.meta),"primary"in U&&l(1,g=U.primary),"$$scope"in U&&l(19,_=U.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const U=h==="",K=$i(m,h),Q={id:y,path:h,meta:d,default:U,fullPath:U?"":K,base:U?m:W1(K,a.pathname),primary:g,focusElement:w};ne.set(Q),l(15,D=P(Q))}if(t.$$.dirty&98304&&l(2,n=!!(D||u&&u.id===y)),t.$$.dirty&98308&&n){const{params:U}=D||u;H.set(U)}},e=ms(e),[v,g,n,a,f,y,E,R,O,F,H,z,o,h,d,D,u,m,p,_]}class k0 extends Re{constructor(e){super(),Le(this,e,g0,h0,Ee,{path:13,component:0,meta:14,primary:1})}}const ml=k0;function w0(t){let e,l,n,i;const o=t[13].default,u=ro(o,t,t[12],null);let a=[{href:t[0]},t[2],t[1]],m={};for(let f=0;fl(11,_=w));const E=p1(),R=Fc(),{navigate:O}=Ic();function F(w){E("click",w),g1(w)&&(w.preventDefault(),O(n,{state:y,replace:u||g}))}return t.$$set=w=>{l(19,e=ol(ol({},e),ms(w))),l(18,p=_s(e,f)),"to"in w&&l(5,d=w.to),"replace"in w&&l(6,g=w.replace),"state"in w&&l(7,y=w.state),"getProps"in w&&l(8,P=w.getProps),"$$scope"in w&&l(12,v=w.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=R(d,_)),t.$$.dirty&2049&&l(10,i=Ks(_.pathname,n)),t.$$.dirty&2049&&l(9,o=n===_.pathname),t.$$.dirty&2049&&(u=ho(n)===j1(_)),t.$$.dirty&512&&l(2,a=o?{"aria-current":"page"}:{}),l(1,m=(()=>{if(_c(P)){const w=P({location:_,href:n,isPartiallyCurrent:i,isCurrent:o});return{...p,...w}}return p})())},e=ms(e),[n,m,a,M,F,d,g,y,P,o,i,_,v,h]}class C0 extends Re{constructor(e){super(),Le(this,e,y0,w0,Ee,{to:5,replace:6,state:7,getProps:8})}}const Qt=C0;let Ys=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Bl(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function $0(t,e){return e?t>218&&t<242?"#32c000":t>212&&t<248?"#b1c000":t>208&&t<252?"#ffa000":"#d90000":t>218&&t<242?"#32d900":t>212&&t<248?"#b1d900":t>208&&t<252?"#ffb800":"#d90000"}function qc(t,e){let l;return e?t>90?l="#d90000":t>85?l="#e31000":t>80?l="#ffa900":t>75?l="#dcc300":l="#32c500":t>90?l="#d90000":t>85?l="#e32100":t>80?l="#ffb800":t>75?l="#dcd800":l="#32d900",l}function S0(t){return t>75?"#32d900":t>50?"#77d900":t>25?"#94d900":"#dcd800"}function vs(t){switch(t){case 1:return"Aidon";case 2:return"Kaifa";case 3:return"Kamstrup";case 8:return"Iskra";case 9:return"Landis+Gyr";case 10:return"Sagemcom";default:return"Unknown"}}function Ue(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function he(t,e){switch(e){case 5:switch(t){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(t){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 241:return"LilyGO T-ETH-POE";case 242:return"M5 PoESP32";case 243:return"WT32-ETH01";case 200:return"Generic ESP32";case 2:return"HAN Reader 2.0 by Max Spencer";case 0:return"Custom hardware by Roar Fredriksen";case 1:return"Kamstrup module by Egil Opsahl";case 8:return"\xB5HAN mosquito by dbeinder";case 3:return"Pow-K (UART0)";case 4:return"Pow-U (UART0)";case 101:return"Wemos D1 mini";case 100:return"Generic ESP8266";case 70:return"Generic ESP32-C3";case 71:return"ESP32-C3-DevKitM-1";case 80:return"Generic ESP32-S3"}}function Ta(t){switch(t){case-1:return"Parse error";case-2:return"Incomplete data received";case-3:return"Payload boundry flag missing";case-4:return"Header checksum error";case-5:return"Footer checksum error";case-9:return"Unknown data received, check meter config";case-41:return"Frame length not equal";case-51:return"Authentication failed";case-52:return"Decryption failed";case-53:return"Encryption key invalid";case 90:return"No HAN data received for at least 30s";case 91:return"Serial break";case 92:return"Serial buffer full";case 93:return"Serial FIFO overflow";case 94:return"Serial frame error";case 95:return"Serial parity error";case 96:return"RX error";case 98:return"Exception in code, debugging necessary";case 99:return"Autodetection failed"}return t<0?"Unspecified error "+t:""}function Na(t){switch(t){case-3:return"Connection failed";case-4:return"Network timeout";case-10:return"Connection denied";case-11:return"Failed to subscribe";case-13:return"Connection lost"}return t<0?"Unspecified error "+t:""}function Ea(t){switch(t){case 400:return"Unrecognized data in request";case 401:case 403:return"Unauthorized, check API key";case 404:return"Price unavailable, not found";case 425:return"Server says its too early";case 429:return"Exceeded API rate limit";case 500:return"Internal server error";case-1:return"Connection error";case-2:return"Incomplete data received";case-3:return"Invalid data, tag missing";case-51:return"Authentication failed";case-52:return"Decryption failed";case-53:return"Encryption key invalid"}return t<0?"Unspecified error "+t:""}function Aa(t){switch(t){case 255:return"Unable to start upgrade";case-1:return"Connection refused";case-2:return"Failed to send headers";case-3:return"Failed to send payload";case-4:return"Not connected";case-5:return"Connection lost";case-6:return"No stream";case-7:return"Not a HTTP server";case-8:return"Not enough memory";case-9:return"Encoding error";case-10:return"Stream write";case-11:return"Read timeout"}return"Unknown "+t}function ti(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Xe(t,e){return t==1||t==2&&e}function Rt(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function ke(t,e){return isNaN(t)?"-":(isNaN(e)&&(e=t<10?1:0),t.toFixed(e))}function dl(t,e){return t.setTime(t.getTime()+e*36e5),t}function Pa(t){if(t.chip=="esp8266")switch(t.boot_reason){case 0:return"Normal";case 1:return"WDT reset";case 2:return"Exception reset";case 3:return"Soft WDT reset";case 4:return"Software restart";case 5:return"Deep sleep";case 6:return"External reset";default:return"Unknown (8266)"}else switch(t.boot_reason){case 1:return"Vbat power on reset";case 3:return"Software reset";case 4:return"WDT reset";case 5:return"Deep sleep";case 6:return"SLC reset";case 7:return"Timer Group0 WDT reset";case 8:return"Timer Group1 WDT reset";case 9:return"RTC WDT reset";case 10:return"Instrusion test reset CPU";case 11:return"Time Group reset CPU";case 12:return"Software reset CPU";case 13:return"RTC WTD reset CPU";case 14:return"PRO CPU";case 15:return"Brownout";case 16:return"RTC reset";default:return"Unknown"}}function Da(t){return t=="EOE"?"ENTSO-E":t=="HKS"?"hvakosterstrommen.no":t=="EDS"?"Energi Data Service":t=="MIX"?"Mixed sources":"Unknown ("+t+")"}function La(t){return t=="EOE"?"https://transparency.entsoe.eu/-E":t=="HKS"?"https://www.hvakosterstrommen.no/":t=="EDS"?"https://www.energidataservice.dk/":"#"}async function Ml(t,e={}){const{timeout:l=8e3}=e,n=new AbortController,i=setTimeout(()=>n.abort(),l),o=await fetch(t,{...e,signal:n.signal});return clearTimeout(i),o}let _l={version:"",chip:"",mac:null,apmac:null,vndcfg:null,usrcfg:null,fwconsent:null,booting:!1,upgrading:!1,ui:{},security:0,boot_reason:0,upgrade:{x:-1,e:0,f:null,t:null},trying:null,if:{eth:!1}};const Wt=it(_l);async function bo(){_l=await(await Ml("/sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),Wt.set(_l)}let us=0,Ra=-127,Ia=null,M0={};const Bc=bc(M0,t=>{let e;async function l(){Ml("/data.json").then(n=>n.json()).then(n=>{t(n),Ra!=n.t&&(Ra=n.t,setTimeout(zc,2e3)),Ia==null&&n.pe&&n.p!=null&&(Ia=n.p,jc()),_l.upgrading?window.location.reload():(!_l||!_l.chip||_l.booting||us>1&&!ti(_l.board))&&(bo(),on&&clearTimeout(on),on=setTimeout(ko,2e3),rn&&clearTimeout(rn),rn=setTimeout(wo,3e3));let i=5e3;if(ti(_l.board)&&n.v>2.5){let o=3.3-Math.min(3.3,n.v);o>0&&(i=Math.max(o,.1)*10*5e3)}i>5e3&&console.log("Scheduling next data fetch in "+i+"ms"),e&&clearTimeout(e),e=setTimeout(l,i),us=0}).catch(n=>{us++,us>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(l,15e3)):e=setTimeout(l,ti(_l.board)?1e4:5e3)})}return l(),function(){clearTimeout(e)}});let Qs={},vi;const go=it(Qs);async function Uc(){let t=!1;if(go.update(e=>{for(var l=0;l<36;l++){if(e[Ue(l)]==null){t=l<12;break}e[Ue(l)]=e[Ue(l+1)]}return e}),t)jc();else{let e=new Date;vi=setTimeout(Uc,(60-e.getMinutes())*6e4)}}async function jc(){vi&&(clearTimeout(vi),vi=0),Qs=await(await Ml("/energyprice.json")).json(),go.set(Qs);let e=new Date;vi=setTimeout(Uc,(60-e.getMinutes())*6e4)}let Xs={},on;async function ko(){on&&(clearTimeout(on),on=0),Xs=await(await Ml("/dayplot.json")).json(),Hc.set(Xs);let e=new Date;on=setTimeout(ko,(60-e.getMinutes())*6e4+20)}const Hc=it(Xs,t=>(ko(),function(){}));let Zs={},rn;async function wo(){rn&&(clearTimeout(rn),rn=0),Zs=await(await Ml("/monthplot.json")).json(),Wc.set(Zs);let e=new Date;rn=setTimeout(wo,(24-e.getHours())*36e5+40)}const Wc=it(Zs,t=>(wo(),function(){}));let Js={};async function zc(){Js=await(await Ml("/temperature.json")).json(),Gc.set(Js)}const Gc=it(Js,t=>(zc(),function(){}));let xs={},fs;async function Vc(){fs&&(clearTimeout(fs),fs=0),xs=await(await Ml("/tariff.json")).json(),Kc.set(xs);let e=new Date;fs=setTimeout(Vc,(60-e.getMinutes())*6e4+30)}const Kc=it(xs,t=>function(){});let eo=[];const yo=it(eo);async function T0(){eo=await(await Ml("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),yo.set(eo)}let to={};async function N0(){to=await(await Ml("/realtime.json")).json(),Yc.set(to)}const Yc=it(to,t=>(N0(),function(){}));function hs(t){return"WARNING: "+t+" must be connected to an external power supply during firmware upgrade. Failure to do so may cause power-down during upload resulting in non-functioning unit."}async function Qc(t){await(await fetch("/upgrade?expected_version="+t,{method:"POST"})).json()}function Xc(t,e){if(/^v\d{1,2}\.\d{1,2}\.\d{1,2}$/.test(t)){let l=t.substring(1).split("."),n=parseInt(l[0]),i=parseInt(l[1]),o=parseInt(l[2]),u=[...e];u.reverse();let a,m,f;for(let p=0;po&&(a=_):g==i+1&&(m=_);else if(d==n+1)if(f){let P=f.tag_name.substring(1).split(".");parseInt(P[0]);let M=parseInt(P[1]);parseInt(P[2]),g==M&&(f=_)}else f=_}return m||f||a||!1}else return e[0]}const E0="/github.svg";function Oa(t){let e,l;function n(u,a){return u[1]>1?O0:u[1]>0?I0:u[2]>1?R0:u[2]>0?L0:u[3]>1?D0:u[3]>0?P0:A0}let i=n(t),o=i(t);return{c(){e=N(`Up + `),o.c(),l=Ke()},m(u,a){S(u,e,a),o.m(u,a),S(u,l,a)},p(u,a){i===(i=n(u))&&o?o.p(u,a):(o.d(1),o=i(u),o&&(o.c(),o.m(l.parentNode,l)))},d(u){u&&$(e),o.d(u),u&&$(l)}}}function A0(t){let e,l;return{c(){e=N(t[0]),l=N(" seconds")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&1&&J(e,n[0])},d(n){n&&$(e),n&&$(l)}}}function P0(t){let e,l;return{c(){e=N(t[3]),l=N(" minute")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&8&&J(e,n[3])},d(n){n&&$(e),n&&$(l)}}}function D0(t){let e,l;return{c(){e=N(t[3]),l=N(" minutes")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&8&&J(e,n[3])},d(n){n&&$(e),n&&$(l)}}}function L0(t){let e,l;return{c(){e=N(t[2]),l=N(" hour")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&4&&J(e,n[2])},d(n){n&&$(e),n&&$(l)}}}function R0(t){let e,l;return{c(){e=N(t[2]),l=N(" hours")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&4&&J(e,n[2])},d(n){n&&$(e),n&&$(l)}}}function I0(t){let e,l;return{c(){e=N(t[1]),l=N(" day")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&2&&J(e,n[1])},d(n){n&&$(e),n&&$(l)}}}function O0(t){let e,l;return{c(){e=N(t[1]),l=N(" days")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&2&&J(e,n[1])},d(n){n&&$(e),n&&$(l)}}}function F0(t){let e,l=t[0]&&Oa(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),S(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Oa(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:pe,o:pe,d(n){l&&l.d(n),n&&$(e)}}}function q0(t,e,l){let{epoch:n}=e,i=0,o=0,u=0;return t.$$set=a=>{"epoch"in a&&l(0,n=a.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(1,i=Math.floor(n/86400)),l(2,o=Math.floor(n/3600)),l(3,u=Math.floor(n/60)))},[n,i,o,u]}class B0 extends Re{constructor(e){super(),Le(this,e,q0,F0,Ee,{epoch:0})}}function U0(t){let e,l,n;return{c(){e=c("span"),l=N(t[2]),r(e,"title",t[1]),r(e,"class",n="bd-"+t[0])},m(i,o){S(i,e,o),s(e,l)},p(i,[o]){o&4&&J(l,i[2]),o&2&&r(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&r(e,"class",n)},i:pe,o:pe,d(i){i&&$(e)}}}function j0(t,e,l){let{color:n}=e,{title:i}=e,{text:o}=e;return t.$$set=u=>{"color"in u&&l(0,n=u.color),"title"in u&&l(1,i=u.title),"text"in u&&l(2,o=u.text)},[n,i,o]}class an extends Re{constructor(e){super(),Le(this,e,j0,U0,Ee,{color:0,title:1,text:2})}}function H0(t){let e,l=`${Ue(t[0].getDate())}.${Ue(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Ue(t[0].getHours())}:${Ue(t[0].getMinutes())}`,n;return{c(){e=c("span"),n=N(l),r(e,"class",t[1])},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${Ue(i[0].getDate())}.${Ue(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Ue(i[0].getHours())}:${Ue(i[0].getMinutes())}`)&&J(n,l),o&2&&r(e,"class",i[1])},d(i){i&&$(e)}}}function W0(t){let e=`${Ue(t[0].getDate())}. ${Ys[t[0].getMonth()]} ${Ue(t[0].getHours())}:${Ue(t[0].getMinutes())}`,l;return{c(){l=N(e)},m(n,i){S(n,l,i)},p(n,i){i&1&&e!==(e=`${Ue(n[0].getDate())}. ${Ys[n[0].getMonth()]} ${Ue(n[0].getHours())}:${Ue(n[0].getMinutes())}`)&&J(l,e)},d(n){n&&$(l)}}}function z0(t){let e;function l(o,u){return o[2]?W0:H0}let n=l(t),i=n(t);return{c(){i.c(),e=Ke()},m(o,u){i.m(o,u),S(o,e,u)},p(o,[u]){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:pe,o:pe,d(o){i.d(o),o&&$(e)}}}function G0(t,e,l){let{timestamp:n}=e,{fullTimeColor:i}=e,{offset:o}=e,u;return t.$$set=a=>{"timestamp"in a&&l(0,n=a.timestamp),"fullTimeColor"in a&&l(1,i=a.fullTimeColor),"offset"in a&&l(3,o=a.offset)},t.$$.update=()=>{t.$$.dirty&9&&(l(2,u=Math.abs(new Date().getTime()-n.getTime())<3e5),isNaN(o)||dl(n,o-(24+n.getHours()-n.getUTCHours())%24))},[n,i,u,o]}class Zc extends Re{constructor(e){super(),Le(this,e,G0,z0,Ee,{timestamp:0,fullTimeColor:1,offset:3})}}function V0(t){let e,l,n;return{c(){e=De("svg"),l=De("path"),n=De("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z"),r(n,"stroke-linecap","round"),r(n,"stroke-linejoin","round"),r(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(i,o){S(i,e,o),s(e,l),s(e,n)},p:pe,i:pe,o:pe,d(i){i&&$(e)}}}class K0 extends Re{constructor(e){super(),Le(this,e,null,V0,Ee,{})}}function Y0(t){let e,l;return{c(){e=De("svg"),l=De("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){S(n,e,i),s(e,l)},p:pe,i:pe,o:pe,d(n){n&&$(e)}}}class Q0 extends Re{constructor(e){super(),Le(this,e,null,Y0,Ee,{})}}function X0(t){let e,l;return{c(){e=De("svg"),l=De("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){S(n,e,i),s(e,l)},p:pe,i:pe,o:pe,d(n){n&&$(e)}}}class Lt extends Re{constructor(e){super(),Le(this,e,null,X0,Ee,{})}}function Z0(t){let e,l;return{c(){e=De("svg"),l=De("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9 8.25H7.5a2.25 2.25 0 00-2.25 2.25v9a2.25 2.25 0 002.25 2.25h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25H15M9 12l3 3m0 0l3-3m-3 3V2.25"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){S(n,e,i),s(e,l)},p:pe,i:pe,o:pe,d(n){n&&$(e)}}}class Jc extends Re{constructor(e){super(),Le(this,e,null,Z0,Ee,{})}}function J0(t){let e,l,n=t[1].version+"",i;return{c(){e=N("AMS reader "),l=c("span"),i=N(n)},m(o,u){S(o,e,u),S(o,l,u),s(l,i)},p(o,u){u&2&&n!==(n=o[1].version+"")&&J(i,n)},d(o){o&&$(e),o&&$(l)}}}function Fa(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=c("div"),n=N(l),i=N("\xB0C"),r(e,"class","flex-none my-auto")},m(o,u){S(o,e,u),s(e,n),s(e,i)},p(o,u){u&1&&l!==(l=(o[0].t>-50?o[0].t.toFixed(1):"-")+"")&&J(n,l)},d(o){o&&$(e)}}}function qa(t){let e,l="HAN: "+Ta(t[0].he),n;return{c(){e=c("div"),n=N(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="HAN: "+Ta(i[0].he))&&J(n,l)},d(i){i&&$(e)}}}function Ba(t){let e,l="MQTT: "+Na(t[0].me),n;return{c(){e=c("div"),n=N(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="MQTT: "+Na(i[0].me))&&J(n,l)},d(i){i&&$(e)}}}function Ua(t){let e,l="Price service: "+Ea(t[0].ee),n;return{c(){e=c("div"),n=N(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="Price service: "+Ea(i[0].ee))&&J(n,l)},d(i){i&&$(e)}}}function ja(t){let e,l,n,i,o,u;return l=new Qt({props:{to:"/configuration",$$slots:{default:[x0]},$$scope:{ctx:t}}}),o=new Qt({props:{to:"/status",$$slots:{default:[em]},$$scope:{ctx:t}}}),{c(){e=c("div"),re(l.$$.fragment),n=b(),i=c("div"),re(o.$$.fragment),r(e,"class","flex-none px-1 mt-1"),r(e,"title","Configuration"),r(i,"class","flex-none px-1 mt-1"),r(i,"title","Device information")},m(a,m){S(a,e,m),ie(l,e,null),S(a,n,m),S(a,i,m),ie(o,i,null),u=!0},i(a){u||(I(l.$$.fragment,a),I(o.$$.fragment,a),u=!0)},o(a){q(l.$$.fragment,a),q(o.$$.fragment,a),u=!1},d(a){a&&$(e),se(l),a&&$(n),a&&$(i),se(o)}}}function x0(t){let e,l;return e=new K0({}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function em(t){let e,l;return e=new Q0({}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function Ha(t){let e,l,n,i,o;const u=[lm,tm],a=[];function m(f,p){return f[1].security==0||f[0].a?0:1}return l=m(t),n=a[l]=u[l](t),{c(){e=c("div"),n.c(),r(e,"class","flex-none mr-3 text-yellow-500"),r(e,"title",i="New version: "+t[2].tag_name)},m(f,p){S(f,e,p),a[l].m(e,null),o=!0},p(f,p){let _=l;l=m(f),l===_?a[l].p(f,p):(Ae(),q(a[_],1,1,()=>{a[_]=null}),Pe(),n=a[l],n?n.p(f,p):(n=a[l]=u[l](f),n.c()),I(n,1),n.m(e,null)),(!o||p&4&&i!==(i="New version: "+f[2].tag_name))&&r(e,"title",i)},i(f){o||(I(n),o=!0)},o(f){q(n),o=!1},d(f){f&&$(e),a[l].d()}}}function tm(t){let e,l,n=t[2].tag_name+"",i;return{c(){e=c("span"),l=N("New version: "),i=N(n)},m(o,u){S(o,e,u),s(e,l),s(e,i)},p(o,u){u&4&&n!==(n=o[2].tag_name+"")&&J(i,n)},i:pe,o:pe,d(o){o&&$(e)}}}function lm(t){let e,l,n,i=t[2].tag_name+"",o,u,a,m,f,p;return a=new Jc({}),{c(){e=c("button"),l=c("span"),n=N("New version: "),o=N(i),u=b(),re(a.$$.fragment),r(l,"class","mt-1"),r(e,"class","flex")},m(_,h){S(_,e,h),s(e,l),s(l,n),s(l,o),s(e,u),ie(a,e,null),m=!0,f||(p=te(e,"click",t[3]),f=!0)},p(_,h){(!m||h&4)&&i!==(i=_[2].tag_name+"")&&J(o,i)},i(_){m||(I(a.$$.fragment,_),m=!0)},o(_){q(a.$$.fragment,_),m=!1},d(_){_&&$(e),se(a),f=!1,p()}}}function nm(t){let e,l,n,i,o,u,a,m,f,p,_,h,v=(t[0].m?(t[0].m/1e3).toFixed(1):"-")+"",d,g,y,P,M,E,R,O,F,w,D,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Ie,Se;i=new Qt({props:{to:"/",$$slots:{default:[J0]},$$scope:{ctx:t}}}),m=new B0({props:{epoch:t[0].u}});let ye=t[0].t>-50&&Fa(t);M=new an({props:{title:"ESP",text:t[1].booting?"Booting":t[0].v>2?t[0].v.toFixed(2)+"V":"ESP",color:Bl(t[1].booting?2:t[0].em)}}),R=new an({props:{title:"HAN",text:"HAN",color:Bl(t[1].booting?9:t[0].hm)}}),F=new an({props:{title:"WiFi",text:t[0].r?t[0].r.toFixed(0)+"dBm":"WiFi",color:Bl(t[1].booting?9:t[0].wm)}}),D=new an({props:{title:"MQTT",text:"MQTT",color:Bl(t[1].booting?9:t[0].mm)}});let ve=(t[0].he<0||t[0].he>0)&&qa(t),Te=t[0].me<0&&Ba(t),be=(t[0].ee>0||t[0].ee<0)&&Ua(t);ae=new Zc({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),offset:t[1].clock_offset,fullTimeColor:"text-red-500"}});let T=t[1].vndcfg&&t[1].usrcfg&&ja(t);He=new Lt({});let C=t[1].fwconsent===1&&t[2]&&Ha(t);return{c(){e=c("nav"),l=c("div"),n=c("div"),re(i.$$.fragment),o=b(),u=c("div"),a=c("div"),re(m.$$.fragment),f=b(),ye&&ye.c(),p=b(),_=c("div"),h=N("Free mem: "),d=N(v),g=N("kb"),y=b(),P=c("div"),re(M.$$.fragment),E=b(),re(R.$$.fragment),O=b(),re(F.$$.fragment),w=b(),re(D.$$.fragment),ne=b(),ve&&ve.c(),H=b(),Te&&Te.c(),z=b(),be&&be.c(),U=b(),K=c("div"),Q=c("div"),G=c("a"),X=c("img"),j=b(),x=c("div"),re(ae.$$.fragment),ee=b(),T&&T.c(),V=b(),W=c("div"),we=c("a"),re(He.$$.fragment),Ie=b(),C&&C.c(),r(n,"class","flex text-lg text-gray-100 p-2"),r(a,"class","flex-none my-auto"),r(_,"class","flex-none my-auto"),r(u,"class","flex-none my-auto p-2 flex space-x-4"),r(P,"class","flex-auto flex-wrap my-auto justify-center p-2"),r(X,"class","gh-logo"),Ws(X.src,Y=E0)||r(X,"src",Y),r(X,"alt","GitHub repo"),r(G,"class","float-right"),r(G,"href","https://github.com/UtilitechAS/amsreader-firmware"),r(G,"target","_blank"),r(G,"rel","noreferrer"),r(G,"aria-label","GitHub"),r(Q,"class","flex-none"),r(x,"class","flex-none my-auto px-2"),r(we,"href",Rt("")),r(we,"target","_blank"),r(we,"rel","noreferrer"),r(W,"class","flex-none px-1 mt-1"),r(W,"title","Documentation"),r(K,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),r(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),r(e,"class","hdr")},m(k,A){S(k,e,A),s(e,l),s(l,n),ie(i,n,null),s(l,o),s(l,u),s(u,a),ie(m,a,null),s(u,f),ye&&ye.m(u,null),s(u,p),s(u,_),s(_,h),s(_,d),s(_,g),s(l,y),s(l,P),ie(M,P,null),s(P,E),ie(R,P,null),s(P,O),ie(F,P,null),s(P,w),ie(D,P,null),s(l,ne),ve&&ve.m(l,null),s(l,H),Te&&Te.m(l,null),s(l,z),be&&be.m(l,null),s(l,U),s(l,K),s(K,Q),s(Q,G),s(G,X),s(K,j),s(K,x),ie(ae,x,null),s(K,ee),T&&T.m(K,null),s(K,V),s(K,W),s(W,we),ie(He,we,null),s(K,Ie),C&&C.m(K,null),Se=!0},p(k,[A]){const L={};A&18&&(L.$$scope={dirty:A,ctx:k}),i.$set(L);const Z={};A&1&&(Z.epoch=k[0].u),m.$set(Z),k[0].t>-50?ye?ye.p(k,A):(ye=Fa(k),ye.c(),ye.m(u,p)):ye&&(ye.d(1),ye=null),(!Se||A&1)&&v!==(v=(k[0].m?(k[0].m/1e3).toFixed(1):"-")+"")&&J(d,v);const le={};A&3&&(le.text=k[1].booting?"Booting":k[0].v>2?k[0].v.toFixed(2)+"V":"ESP"),A&3&&(le.color=Bl(k[1].booting?2:k[0].em)),M.$set(le);const fe={};A&3&&(fe.color=Bl(k[1].booting?9:k[0].hm)),R.$set(fe);const de={};A&1&&(de.text=k[0].r?k[0].r.toFixed(0)+"dBm":"WiFi"),A&3&&(de.color=Bl(k[1].booting?9:k[0].wm)),F.$set(de);const Ce={};A&3&&(Ce.color=Bl(k[1].booting?9:k[0].mm)),D.$set(Ce),k[0].he<0||k[0].he>0?ve?ve.p(k,A):(ve=qa(k),ve.c(),ve.m(l,H)):ve&&(ve.d(1),ve=null),k[0].me<0?Te?Te.p(k,A):(Te=Ba(k),Te.c(),Te.m(l,z)):Te&&(Te.d(1),Te=null),k[0].ee>0||k[0].ee<0?be?be.p(k,A):(be=Ua(k),be.c(),be.m(l,U)):be&&(be.d(1),be=null);const Oe={};A&1&&(Oe.timestamp=k[0].c?new Date(k[0].c*1e3):new Date(0)),A&2&&(Oe.offset=k[1].clock_offset),ae.$set(Oe),k[1].vndcfg&&k[1].usrcfg?T?A&2&&I(T,1):(T=ja(k),T.c(),I(T,1),T.m(K,V)):T&&(Ae(),q(T,1,1,()=>{T=null}),Pe()),k[1].fwconsent===1&&k[2]?C?(C.p(k,A),A&6&&I(C,1)):(C=Ha(k),C.c(),I(C,1),C.m(K,null)):C&&(Ae(),q(C,1,1,()=>{C=null}),Pe())},i(k){Se||(I(i.$$.fragment,k),I(m.$$.fragment,k),I(M.$$.fragment,k),I(R.$$.fragment,k),I(F.$$.fragment,k),I(D.$$.fragment,k),I(ae.$$.fragment,k),I(T),I(He.$$.fragment,k),I(C),Se=!0)},o(k){q(i.$$.fragment,k),q(m.$$.fragment,k),q(M.$$.fragment,k),q(R.$$.fragment,k),q(F.$$.fragment,k),q(D.$$.fragment,k),q(ae.$$.fragment,k),q(T),q(He.$$.fragment,k),q(C),Se=!1},d(k){k&&$(e),se(i),se(m),ye&&ye.d(),se(M),se(R),se(F),se(D),ve&&ve.d(),Te&&Te.d(),be&&be.d(),se(ae),T&&T.d(),se(He),C&&C.d()}}}function im(t,e,l){let{data:n={}}=e,i={},o={};function u(){confirm("Do you want to upgrade this device to "+o.tag_name+"?")&&(!ti(i.board)||confirm(hs(he(i.chip,i.board))))&&(Wt.update(a=>(a.upgrading=!0,a)),Qc(o.tag_name))}return Wt.subscribe(a=>{l(1,i=a),a.fwconsent===1&&T0()}),yo.subscribe(a=>{l(2,o=Xc(i.version,a))}),t.$$set=a=>{"data"in a&&l(0,n=a.data)},[n,i,o,u]}class sm extends Re{constructor(e){super(),Le(this,e,im,nm,Ee,{data:0})}}function om(t){let e,l,n,i;return{c(){e=De("svg"),l=De("path"),n=De("path"),r(l,"d",Hs(150,150,115,210,510)),r(l,"stroke","rgba(128, 128, 128, 0.15)"),r(l,"fill","none"),r(l,"stroke-width","55"),r(n,"d",i=Hs(150,150,115,210,210+300*t[0]/100)),r(n,"stroke",t[1]),r(n,"fill","none"),r(n,"stroke-width","55"),r(e,"viewBox","0 0 300 300"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"height","100%")},m(o,u){S(o,e,u),s(e,l),s(e,n)},p(o,[u]){u&1&&i!==(i=Hs(150,150,115,210,210+300*o[0]/100))&&r(n,"d",i),u&2&&r(n,"stroke",o[1])},i:pe,o:pe,d(o){o&&$(e)}}}function Wa(t,e,l,n){var i=(n-90)*Math.PI/180;return{x:t+l*Math.cos(i),y:e+l*Math.sin(i)}}function Hs(t,e,l,n,i){var o=Wa(t,e,l,i),u=Wa(t,e,l,n),a=i-n<=180?"0":"1",m=["M",o.x,o.y,"A",l,l,0,a,0,u.x,u.y].join(" ");return m}function rm(t,e,l){let{pct:n=0}=e,{color:i="red"}=e;return t.$$set=o=>{"pct"in o&&l(0,n=o.pct),"color"in o&&l(1,i=o.color)},[n,i]}class am extends Re{constructor(e){super(),Le(this,e,rm,om,Ee,{pct:0,color:1})}}function za(t){let e,l,n,i,o,u,a,m;return{c(){e=c("br"),l=b(),n=c("span"),i=N(t[3]),o=b(),u=c("span"),a=N(t[4]),m=N("/kWh"),r(n,"class","pl-sub"),r(u,"class","pl-snt")},m(f,p){S(f,e,p),S(f,l,p),S(f,n,p),s(n,i),S(f,o,p),S(f,u,p),s(u,a),s(u,m)},p(f,p){p&8&&J(i,f[3]),p&16&&J(a,f[4])},d(f){f&&$(e),f&&$(l),f&&$(n),f&&$(o),f&&$(u)}}}function um(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y;l=new am({props:{pct:t[6],color:t[5](t[6],document.documentElement.classList.contains("dark"))}});let P=t[3]&&za(t);return{c(){e=c("div"),re(l.$$.fragment),n=b(),i=c("span"),o=c("span"),u=N(t[2]),a=b(),m=c("br"),f=b(),p=c("span"),_=N(t[0]),h=b(),v=c("span"),d=N(t[1]),g=b(),P&&P.c(),r(o,"class","pl-lab"),r(p,"class","pl-val"),r(v,"class","pl-unt"),r(i,"class","pl-ov"),r(e,"class","pl-root")},m(M,E){S(M,e,E),ie(l,e,null),s(e,n),s(e,i),s(i,o),s(o,u),s(i,a),s(i,m),s(i,f),s(i,p),s(p,_),s(i,h),s(i,v),s(v,d),s(i,g),P&&P.m(i,null),y=!0},p(M,[E]){const R={};E&64&&(R.pct=M[6]),E&96&&(R.color=M[5](M[6],document.documentElement.classList.contains("dark"))),l.$set(R),(!y||E&4)&&J(u,M[2]),(!y||E&1)&&J(_,M[0]),(!y||E&2)&&J(d,M[1]),M[3]?P?P.p(M,E):(P=za(M),P.c(),P.m(i,null)):P&&(P.d(1),P=null)},i(M){y||(I(l.$$.fragment,M),y=!0)},o(M){q(l.$$.fragment,M),y=!1},d(M){M&&$(e),se(l),P&&P.d()}}}function fm(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:u}=e,{sub:a=""}=e,{subunit:m=""}=e,{colorFn:f}=e,p=0;return t.$$set=_=>{"val"in _&&l(0,n=_.val),"max"in _&&l(7,i=_.max),"unit"in _&&l(1,o=_.unit),"label"in _&&l(2,u=_.label),"sub"in _&&l(3,a=_.sub),"subunit"in _&&l(4,m=_.subunit),"colorFn"in _&&l(5,f=_.colorFn)},t.$$.update=()=>{t.$$.dirty&129&&l(6,p=Math.min(n,i)/i*100)},[n,o,u,a,m,f,p,i]}class xc extends Re{constructor(e){super(),Le(this,e,fm,um,Ee,{val:0,max:7,unit:1,label:2,sub:3,subunit:4,colorFn:5})}}function Ga(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Va(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Ka(t,e,l){const n=t.slice();return n[15]=e[l],n}function Ya(t){let e,l,n,i,o,u,a=t[0].title&&Qa(t),m=t[0].y.ticks,f=[];for(let d=0;dt[9].call(e))},m(o,u){S(o,e,u),s(e,n),i=mo(e,t[9].bind(e))},p(o,u){u&1&&l!==(l=o[0].title+"")&&J(n,l)},d(o){o&&$(e),i()}}}function Xa(t){let e,l,n,i=t[15].label+"",o,u,a,m;return{c(){e=De("g"),l=De("line"),n=De("text"),o=N(i),r(l,"x2","100%"),r(n,"y","-4"),r(n,"x",u=t[15].align=="right"?"85%":""),r(e,"class",a="tick tick-"+t[15].value+" tick-"+t[15].color),r(e,"transform",m="translate(0, "+t[7](t[15].value)+")")},m(f,p){S(f,e,p),s(e,l),s(e,n),s(n,o)},p(f,p){p&1&&i!==(i=f[15].label+"")&&J(o,i),p&1&&u!==(u=f[15].align=="right"?"85%":"")&&r(n,"x",u),p&1&&a!==(a="tick tick-"+f[15].value+" tick-"+f[15].color)&&r(e,"class",a),p&129&&m!==(m="translate(0, "+f[7](f[15].value)+")")&&r(e,"transform",m)},d(f){f&&$(e)}}}function Za(t){let e=!isNaN(t[7](t[15].value)),l,n=e&&Xa(t);return{c(){n&&n.c(),l=Ke()},m(i,o){n&&n.m(i,o),S(i,l,o)},p(i,o){o&129&&(e=!isNaN(i[7](i[15].value))),e?n?n.p(i,o):(n=Xa(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&$(l)}}}function Ja(t){let e,l,n=(t[3]>20||t[13]%2==0)&&xa(t);return{c(){e=De("g"),n&&n.c(),r(e,"class","tick"),r(e,"transform",l="translate("+t[6](t[13])+","+t[4]+")")},m(i,o){S(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[13]%2==0?n?n.p(i,o):(n=xa(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&80&&l!==(l="translate("+i[6](i[13])+","+i[4]+")")&&r(e,"transform",l)},d(i){i&&$(e),n&&n.d()}}}function xa(t){let e,l=t[11].label+"",n,i;return{c(){e=De("text"),n=N(l),r(e,"x",i=t[3]/2),r(e,"y","-4")},m(o,u){S(o,e,u),s(e,n)},p(o,u){u&1&&l!==(l=o[11].label+"")&&J(n,l),u&8&&i!==(i=o[3]/2)&&r(e,"x",i)},d(o){o&&$(e)}}}function eu(t){let e=!isNaN(t[6](t[13])),l,n=e&&Ja(t);return{c(){n&&n.c(),l=Ke()},m(i,o){n&&n.m(i,o),S(i,l,o)},p(i,o){o&64&&(e=!isNaN(i[6](i[13]))),e?n?n.p(i,o):(n=Ja(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&$(l)}}}function tu(t){let e,l,n=t[11].value!==void 0&&lu(t),i=t[11].value2>1e-4&&su(t);return{c(){e=De("g"),n&&n.c(),l=De("g"),i&&i.c()},m(o,u){S(o,e,u),n&&n.m(e,null),S(o,l,u),i&&i.m(l,null)},p(o,u){o[11].value!==void 0?n?n.p(o,u):(n=lu(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[11].value2>1e-4?i?i.p(o,u):(i=su(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&$(e),n&&n.d(),o&&$(l),i&&i.d()}}}function lu(t){let e,l,n,i,o,u,a,m=t[3]>15&&nu(t);return{c(){e=De("rect"),m&&m.c(),a=Ke(),r(e,"x",l=t[6](t[13])+2),r(e,"y",n=t[7](t[11].value)),r(e,"width",i=t[3]-4),r(e,"height",o=t[7](t[0].y.min)-t[7](Math.min(t[0].y.min,0)+t[11].value)),r(e,"fill",u=t[11].color)},m(f,p){S(f,e,p),m&&m.m(f,p),S(f,a,p)},p(f,p){p&64&&l!==(l=f[6](f[13])+2)&&r(e,"x",l),p&129&&n!==(n=f[7](f[11].value))&&r(e,"y",n),p&8&&i!==(i=f[3]-4)&&r(e,"width",i),p&129&&o!==(o=f[7](f[0].y.min)-f[7](Math.min(f[0].y.min,0)+f[11].value))&&r(e,"height",o),p&1&&u!==(u=f[11].color)&&r(e,"fill",u),f[3]>15?m?m.p(f,p):(m=nu(f),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},d(f){f&&$(e),m&&m.d(f),f&&$(a)}}}function nu(t){let e,l=t[11].label+"",n,i,o,u,a,m,f=t[11].title&&iu(t);return{c(){e=De("text"),n=N(l),f&&f.c(),m=Ke(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor",o=t[3]t[7](0)-t[8]?t[11].color:"white"),r(e,"transform",a="translate("+(t[6](t[13])+t[3]/2)+" "+(t[7](t[11].value)>t[7](0)-t[8]?t[7](t[11].value)-t[8]:t[7](t[11].value)+10)+") rotate("+(t[11].labelAngle?t[11].labelAngle:t[3]p[7](0)-p[8]?p[11].color:"white")&&r(e,"fill",u),_&457&&a!==(a="translate("+(p[6](p[13])+p[3]/2)+" "+(p[7](p[11].value)>p[7](0)-p[8]?p[7](p[11].value)-p[8]:p[7](p[11].value)+10)+") rotate("+(p[11].labelAngle?p[11].labelAngle:p[3]15&&ou(t);return{c(){e=De("rect"),m&&m.c(),a=Ke(),r(e,"x",l=t[6](t[13])+2),r(e,"y",n=t[7](0)),r(e,"width",i=t[3]-4),r(e,"height",o=t[7](t[0].y.min)-t[7](t[0].y.min+t[11].value2)),r(e,"fill",u=t[11].color2?t[11].color2:t[11].color)},m(f,p){S(f,e,p),m&&m.m(f,p),S(f,a,p)},p(f,p){p&64&&l!==(l=f[6](f[13])+2)&&r(e,"x",l),p&128&&n!==(n=f[7](0))&&r(e,"y",n),p&8&&i!==(i=f[3]-4)&&r(e,"width",i),p&129&&o!==(o=f[7](f[0].y.min)-f[7](f[0].y.min+f[11].value2))&&r(e,"height",o),p&1&&u!==(u=f[11].color2?f[11].color2:f[11].color)&&r(e,"fill",u),f[3]>15?m?m.p(f,p):(m=ou(f),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},d(f){f&&$(e),m&&m.d(f),f&&$(a)}}}function ou(t){let e,l=t[11].label2+"",n,i,o,u,a,m=t[11].title2&&ru(t);return{c(){e=De("text"),n=N(l),m&&m.c(),a=Ke(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor","middle"),r(e,"fill",o=t[7](-t[11].value2)t[10].call(e))},m(i,o){S(i,e,o),n&&n.m(e,null),l=mo(e,t[10].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=Ya(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:pe,o:pe,d(i){i&&$(e),n&&n.d(),l()}}}let un=30;function mm(t,e,l){let{config:n}=e,i,o,u,a,m,f,p,_=0;function h(){_=this.clientHeight,l(5,_)}function v(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return t.$$set=d=>{"config"in d&&l(0,n=d.config)},t.$$.update=()=>{if(t.$$.dirty&63){l(4,f=o-_);let d=i-(n.padding.left+n.padding.right);l(3,u=d/n.points.length),l(8,p=un.y.max?P=n.padding.bottom:yf||P<0?0:P})}},[n,i,o,u,f,_,a,m,p,h,v]}class mn extends Re{constructor(e){super(),Le(this,e,mm,cm,Ee,{config:0})}}function _m(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function pm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{ds:u}=e,a={};function m(f){return{label:ke(f)+"V",title:f.toFixed(1)+" V",value:isNaN(f)?0:f,color:$0(f||0,document.documentElement.classList.contains("dark"))}}return t.$$set=f=>{"u1"in f&&l(1,n=f.u1),"u2"in f&&l(2,i=f.u2),"u3"in f&&l(3,o=f.u3),"ds"in f&&l(4,u=f.ds)},t.$$.update=()=>{if(t.$$.dirty&30){let f=[],p=[];n>0&&(f.push({label:u===1?"L1-L2":"L1"}),p.push(m(n))),i>0&&(f.push({label:u===1?"L1-L3":"L2"}),p.push(m(i))),o>0&&(f.push({label:u===1?"L2-L3":"L3"}),p.push(m(o))),l(0,a={title:"Voltage",padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:f},points:p})}},[a,n,i,o,u]}class dm extends Re{constructor(e){super(),Le(this,e,pm,_m,Ee,{u1:1,u2:2,u3:3,ds:4})}}function vm(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function hm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{i1:u}=e,{i2:a}=e,{i2e:m}=e,{i3:f}=e,{max:p}=e,_={};function h(v){return{label:ke(v)+"A",title:v.toFixed(1)+" A",value:isNaN(v)?0:v,color:qc(v?v/p*100:0,document.documentElement.classList.contains("dark"))}}return t.$$set=v=>{"u1"in v&&l(1,n=v.u1),"u2"in v&&l(2,i=v.u2),"u3"in v&&l(3,o=v.u3),"i1"in v&&l(4,u=v.i1),"i2"in v&&l(5,a=v.i2),"i2e"in v&&l(6,m=v.i2e),"i3"in v&&l(7,f=v.i3),"max"in v&&l(8,p=v.max)},t.$$.update=()=>{if(t.$$.dirty&510){let v=[],d=[];n>0&&(v.push({label:"L1"}),d.push(h(u))),i>0&&(m?(v.push({label:"L2"}),d.push({label:"Not available",labelAngle:-90,title:"L2 current is not reported by your meter",value:0,color:"#7c3aedcc"})):(v.push({label:"L2"}),d.push(h(a)))),o>0&&(v.push({label:"L3"}),d.push(h(f))),l(0,_={title:"Amperage",padding:{top:20,right:15,bottom:20,left:35},y:{min:0,max:p,ticks:[{value:0,label:"0%"},{value:p/4,label:"25%"},{value:p/2,label:"50%"},{value:p/4*3,label:"75%"},{value:p,label:"100%"}]},x:{ticks:v},points:d})}},[_,n,i,o,u,a,m,f,p]}class bm extends Re{constructor(e){super(),Le(this,e,hm,vm,Ee,{u1:1,u2:2,u3:3,i1:4,i2:5,i2e:6,i3:7,max:8})}}function gm(t){let e,l,n,i,o,u,a,m=(typeof t[0]<"u"?t[0].toFixed(0):"-")+"",f,p,_,h,v,d,g=(typeof t[1]<"u"?t[1].toFixed(0):"-")+"",y,P,M,E,R,O,F,w=(typeof t[2]<"u"?t[2].toFixed(1):"-")+"",D,ne,H,z,U,K,Q=(typeof t[3]<"u"?t[3].toFixed(1):"-")+"",G,X;return{c(){e=c("div"),l=c("strong"),l.textContent="Reactive",n=b(),i=c("div"),o=c("div"),o.textContent="Instant in",u=b(),a=c("div"),f=N(m),p=N(" VAr"),_=b(),h=c("div"),h.textContent="Instant out",v=b(),d=c("div"),y=N(g),P=N(" VAr"),M=b(),E=c("div"),R=c("div"),R.textContent="Total in",O=b(),F=c("div"),D=N(w),ne=N(" kVArh"),H=b(),z=c("div"),z.textContent="Total out",U=b(),K=c("div"),G=N(Q),X=N(" kVArh"),r(a,"class","text-right"),r(d,"class","text-right"),r(i,"class","grid grid-cols-2 mt-4"),r(F,"class","text-right"),r(K,"class","text-right"),r(E,"class","grid grid-cols-2 mt-4"),r(e,"class","mx-2 text-sm")},m(Y,j){S(Y,e,j),s(e,l),s(e,n),s(e,i),s(i,o),s(i,u),s(i,a),s(a,f),s(a,p),s(i,_),s(i,h),s(i,v),s(i,d),s(d,y),s(d,P),s(e,M),s(e,E),s(E,R),s(E,O),s(E,F),s(F,D),s(F,ne),s(E,H),s(E,z),s(E,U),s(E,K),s(K,G),s(K,X)},p(Y,[j]){j&1&&m!==(m=(typeof Y[0]<"u"?Y[0].toFixed(0):"-")+"")&&J(f,m),j&2&&g!==(g=(typeof Y[1]<"u"?Y[1].toFixed(0):"-")+"")&&J(y,g),j&4&&w!==(w=(typeof Y[2]<"u"?Y[2].toFixed(1):"-")+"")&&J(D,w),j&8&&Q!==(Q=(typeof Y[3]<"u"?Y[3].toFixed(1):"-")+"")&&J(G,Q)},i:pe,o:pe,d(Y){Y&&$(e)}}}function km(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:o}=e,{exportTotal:u}=e;return t.$$set=a=>{"importInstant"in a&&l(0,n=a.importInstant),"exportInstant"in a&&l(1,i=a.exportInstant),"importTotal"in a&&l(2,o=a.importTotal),"exportTotal"in a&&l(3,u=a.exportTotal)},[n,i,o,u]}class wm extends Re{constructor(e){super(),Le(this,e,km,gm,Ee,{importInstant:0,exportInstant:1,importTotal:2,exportTotal:3})}}function uu(t){let e;function l(o,u){return o[3]?Cm:ym}let n=l(t),i=n(t);return{c(){i.c(),e=Ke()},m(o,u){i.m(o,u),S(o,e,u)},p(o,u){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&$(e)}}}function ym(t){let e,l,n,i,o,u,a=ke(t[1].h.u,2)+"",m,f,p,_,h,v,d=ke(t[1].d.u,1)+"",g,y,P,M,E,R,O=ke(t[1].m.u)+"",F,w,D,ne,H,z,U=ke(t[0].last_month.u)+"",K,Q,G,X,Y=t[4]&&fu(t);return{c(){e=c("strong"),e.textContent="Consumption",l=b(),n=c("div"),i=c("div"),i.textContent="Hour",o=b(),u=c("div"),m=N(a),f=N(" kWh"),p=b(),_=c("div"),_.textContent="Day",h=b(),v=c("div"),g=N(d),y=N(" kWh"),P=b(),M=c("div"),M.textContent="Month",E=b(),R=c("div"),F=N(O),w=N(" kWh"),D=b(),ne=c("div"),ne.textContent="Last month",H=b(),z=c("div"),K=N(U),Q=N(" kWh"),G=b(),Y&&Y.c(),X=Ke(),r(u,"class","text-right"),r(v,"class","text-right"),r(R,"class","text-right"),r(z,"class","text-right"),r(n,"class","grid grid-cols-2 mb-3")},m(j,x){S(j,e,x),S(j,l,x),S(j,n,x),s(n,i),s(n,o),s(n,u),s(u,m),s(u,f),s(n,p),s(n,_),s(n,h),s(n,v),s(v,g),s(v,y),s(n,P),s(n,M),s(n,E),s(n,R),s(R,F),s(R,w),s(n,D),s(n,ne),s(n,H),s(n,z),s(z,K),s(z,Q),S(j,G,x),Y&&Y.m(j,x),S(j,X,x)},p(j,x){x&2&&a!==(a=ke(j[1].h.u,2)+"")&&J(m,a),x&2&&d!==(d=ke(j[1].d.u,1)+"")&&J(g,d),x&2&&O!==(O=ke(j[1].m.u)+"")&&J(F,O),x&1&&U!==(U=ke(j[0].last_month.u)+"")&&J(K,U),j[4]?Y?Y.p(j,x):(Y=fu(j),Y.c(),Y.m(X.parentNode,X)):Y&&(Y.d(1),Y=null)},d(j){j&&$(e),j&&$(l),j&&$(n),j&&$(G),Y&&Y.d(j),j&&$(X)}}}function Cm(t){let e,l,n,i,o,u,a=ke(t[1].h.u,2)+"",m,f,p,_,h,v,d,g=ke(t[1].d.u,1)+"",y,P,M,E,R,O,F,w=ke(t[1].m.u)+"",D,ne,H,z,U,K,Q,G=ke(t[0].last_month.u)+"",X,Y,j,x,ae,ee,V,W,we,He,Ie,Se=ke(t[1].h.p,2)+"",ye,ve,Te,be,T,C,k,A=ke(t[1].d.p,1)+"",L,Z,le,fe,de,Ce,Oe,ue=ke(t[1].m.p)+"",Me,Je,It,st,wt,nt,Ot,Qe=ke(t[0].last_month.p)+"",Xt,zt,vt,xe,Ge=t[4]&&cu(t),Ye=t[4]&&mu(t),Ne=t[4]&&_u(t),Ze=t[4]&&pu(t),et=t[4]&&du(t),qe=t[4]&&vu(t),Fe=t[4]&&hu(t),_e=t[4]&&bu(t);return{c(){e=c("strong"),e.textContent="Import",l=b(),n=c("div"),i=c("div"),i.textContent="Hour",o=b(),u=c("div"),m=N(a),f=N(" kWh"),p=b(),Ge&&Ge.c(),_=b(),h=c("div"),h.textContent="Day",v=b(),d=c("div"),y=N(g),P=N(" kWh"),M=b(),Ye&&Ye.c(),E=b(),R=c("div"),R.textContent="Month",O=b(),F=c("div"),D=N(w),ne=N(" kWh"),H=b(),Ne&&Ne.c(),z=b(),U=c("div"),U.textContent="Last mo.",K=b(),Q=c("div"),X=N(G),Y=N(" kWh"),j=b(),Ze&&Ze.c(),ae=b(),ee=c("strong"),ee.textContent="Export",V=b(),W=c("div"),we=c("div"),we.textContent="Hour",He=b(),Ie=c("div"),ye=N(Se),ve=N(" kWh"),Te=b(),et&&et.c(),be=b(),T=c("div"),T.textContent="Day",C=b(),k=c("div"),L=N(A),Z=N(" kWh"),le=b(),qe&&qe.c(),fe=b(),de=c("div"),de.textContent="Month",Ce=b(),Oe=c("div"),Me=N(ue),Je=N(" kWh"),It=b(),Fe&&Fe.c(),st=b(),wt=c("div"),wt.textContent="Last mo.",nt=b(),Ot=c("div"),Xt=N(Qe),zt=N(" kWh"),vt=b(),_e&&_e.c(),r(u,"class","text-right"),r(d,"class","text-right"),r(F,"class","text-right"),r(Q,"class","text-right"),r(n,"class",x="grid grid-cols-"+t[5]+" mb-3"),r(Ie,"class","text-right"),r(k,"class","text-right"),r(Oe,"class","text-right"),r(Ot,"class","text-right"),r(W,"class",xe="grid grid-cols-"+t[5])},m(ce,Be){S(ce,e,Be),S(ce,l,Be),S(ce,n,Be),s(n,i),s(n,o),s(n,u),s(u,m),s(u,f),s(n,p),Ge&&Ge.m(n,null),s(n,_),s(n,h),s(n,v),s(n,d),s(d,y),s(d,P),s(n,M),Ye&&Ye.m(n,null),s(n,E),s(n,R),s(n,O),s(n,F),s(F,D),s(F,ne),s(n,H),Ne&&Ne.m(n,null),s(n,z),s(n,U),s(n,K),s(n,Q),s(Q,X),s(Q,Y),s(n,j),Ze&&Ze.m(n,null),S(ce,ae,Be),S(ce,ee,Be),S(ce,V,Be),S(ce,W,Be),s(W,we),s(W,He),s(W,Ie),s(Ie,ye),s(Ie,ve),s(W,Te),et&&et.m(W,null),s(W,be),s(W,T),s(W,C),s(W,k),s(k,L),s(k,Z),s(W,le),qe&&qe.m(W,null),s(W,fe),s(W,de),s(W,Ce),s(W,Oe),s(Oe,Me),s(Oe,Je),s(W,It),Fe&&Fe.m(W,null),s(W,st),s(W,wt),s(W,nt),s(W,Ot),s(Ot,Xt),s(Ot,zt),s(W,vt),_e&&_e.m(W,null)},p(ce,Be){Be&2&&a!==(a=ke(ce[1].h.u,2)+"")&&J(m,a),ce[4]?Ge?Ge.p(ce,Be):(Ge=cu(ce),Ge.c(),Ge.m(n,_)):Ge&&(Ge.d(1),Ge=null),Be&2&&g!==(g=ke(ce[1].d.u,1)+"")&&J(y,g),ce[4]?Ye?Ye.p(ce,Be):(Ye=mu(ce),Ye.c(),Ye.m(n,E)):Ye&&(Ye.d(1),Ye=null),Be&2&&w!==(w=ke(ce[1].m.u)+"")&&J(D,w),ce[4]?Ne?Ne.p(ce,Be):(Ne=_u(ce),Ne.c(),Ne.m(n,z)):Ne&&(Ne.d(1),Ne=null),Be&1&&G!==(G=ke(ce[0].last_month.u)+"")&&J(X,G),ce[4]?Ze?Ze.p(ce,Be):(Ze=pu(ce),Ze.c(),Ze.m(n,null)):Ze&&(Ze.d(1),Ze=null),Be&32&&x!==(x="grid grid-cols-"+ce[5]+" mb-3")&&r(n,"class",x),Be&2&&Se!==(Se=ke(ce[1].h.p,2)+"")&&J(ye,Se),ce[4]?et?et.p(ce,Be):(et=du(ce),et.c(),et.m(W,be)):et&&(et.d(1),et=null),Be&2&&A!==(A=ke(ce[1].d.p,1)+"")&&J(L,A),ce[4]?qe?qe.p(ce,Be):(qe=vu(ce),qe.c(),qe.m(W,fe)):qe&&(qe.d(1),qe=null),Be&2&&ue!==(ue=ke(ce[1].m.p)+"")&&J(Me,ue),ce[4]?Fe?Fe.p(ce,Be):(Fe=hu(ce),Fe.c(),Fe.m(W,st)):Fe&&(Fe.d(1),Fe=null),Be&1&&Qe!==(Qe=ke(ce[0].last_month.p)+"")&&J(Xt,Qe),ce[4]?_e?_e.p(ce,Be):(_e=bu(ce),_e.c(),_e.m(W,null)):_e&&(_e.d(1),_e=null),Be&32&&xe!==(xe="grid grid-cols-"+ce[5])&&r(W,"class",xe)},d(ce){ce&&$(e),ce&&$(l),ce&&$(n),Ge&&Ge.d(),Ye&&Ye.d(),Ne&&Ne.d(),Ze&&Ze.d(),ce&&$(ae),ce&&$(ee),ce&&$(V),ce&&$(W),et&&et.d(),qe&&qe.d(),Fe&&Fe.d(),_e&&_e.d()}}}function fu(t){let e,l,n,i,o,u,a=ke(t[1].h.c,2)+"",m,f,p,_,h,v,d,g=ke(t[1].d.c,1)+"",y,P,M,E,R,O,F,w=ke(t[1].m.c)+"",D,ne,H,z,U,K,Q,G=ke(t[0].last_month.c)+"",X,Y,j;return{c(){e=c("strong"),e.textContent="Cost",l=b(),n=c("div"),i=c("div"),i.textContent="Hour",o=b(),u=c("div"),m=N(a),f=b(),p=N(t[2]),_=b(),h=c("div"),h.textContent="Day",v=b(),d=c("div"),y=N(g),P=b(),M=N(t[2]),E=b(),R=c("div"),R.textContent="Month",O=b(),F=c("div"),D=N(w),ne=b(),H=N(t[2]),z=b(),U=c("div"),U.textContent="Last month",K=b(),Q=c("div"),X=N(G),Y=b(),j=N(t[2]),r(u,"class","text-right"),r(d,"class","text-right"),r(F,"class","text-right"),r(Q,"class","text-right"),r(n,"class","grid grid-cols-2")},m(x,ae){S(x,e,ae),S(x,l,ae),S(x,n,ae),s(n,i),s(n,o),s(n,u),s(u,m),s(u,f),s(u,p),s(n,_),s(n,h),s(n,v),s(n,d),s(d,y),s(d,P),s(d,M),s(n,E),s(n,R),s(n,O),s(n,F),s(F,D),s(F,ne),s(F,H),s(n,z),s(n,U),s(n,K),s(n,Q),s(Q,X),s(Q,Y),s(Q,j)},p(x,ae){ae&2&&a!==(a=ke(x[1].h.c,2)+"")&&J(m,a),ae&4&&J(p,x[2]),ae&2&&g!==(g=ke(x[1].d.c,1)+"")&&J(y,g),ae&4&&J(M,x[2]),ae&2&&w!==(w=ke(x[1].m.c)+"")&&J(D,w),ae&4&&J(H,x[2]),ae&1&&G!==(G=ke(x[0].last_month.c)+"")&&J(X,G),ae&4&&J(j,x[2])},d(x){x&&$(e),x&&$(l),x&&$(n)}}}function cu(t){let e,l=ke(t[1].h.c,2)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].h.c,2)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function mu(t){let e,l=ke(t[1].d.c,1)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].d.c,1)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function _u(t){let e,l=ke(t[1].m.c)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].m.c)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function pu(t){let e,l=ke(t[0].last_month.c)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ke(u[0].last_month.c)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function du(t){let e,l=ke(t[1].h.i,2)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].h.i,2)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function vu(t){let e,l=ke(t[1].d.i,1)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].d.i,1)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function hu(t){let e,l=ke(t[1].m.i)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].m.i)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function bu(t){let e,l=ke(t[0].last_month.i)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ke(u[0].last_month.i)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function $m(t){let e,l,n,i,o,u,a=t[1]&&uu(t);return{c(){e=c("div"),l=c("strong"),l.textContent="Real time calculation",n=b(),i=c("br"),o=c("br"),u=b(),a&&a.c(),r(e,"class","mx-2 text-sm")},m(m,f){S(m,e,f),s(e,l),s(e,n),s(e,i),s(e,o),s(e,u),a&&a.m(e,null)},p(m,[f]){m[1]?a?a.p(m,f):(a=uu(m),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i:pe,o:pe,d(m){m&&$(e),a&&a.d()}}}function Sm(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:u}=e,a=!1,m=3;return t.$$set=f=>{"sysinfo"in f&&l(0,n=f.sysinfo),"data"in f&&l(1,i=f.data),"currency"in f&&l(2,o=f.currency),"hasExport"in f&&l(3,u=f.hasExport)},t.$$.update=()=>{t.$$.dirty&18&&(l(4,a=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(5,m=a?3:2))},[n,i,o,u,a,m]}class Mm extends Re{constructor(e){super(),Le(this,e,Sm,$m,Ee,{sysinfo:0,data:1,currency:2,hasExport:3})}}function Tm(t){let e,l,n=Da(t[0].source)+"",i,o,u,a,m;return a=new mn({props:{config:t[1]}}),{c(){e=c("a"),l=N("Provided by: "),i=N(n),u=b(),re(a.$$.fragment),r(e,"href",o=La(t[0].source)),r(e,"target","_blank"),r(e,"class","text-xs float-right z-40")},m(f,p){S(f,e,p),s(e,l),s(e,i),S(f,u,p),ie(a,f,p),m=!0},p(f,[p]){(!m||p&1)&&n!==(n=Da(f[0].source)+"")&&J(i,n),(!m||p&1&&o!==(o=La(f[0].source)))&&r(e,"href",o);const _={};p&2&&(_.config=f[1]),a.$set(_)},i(f){m||(I(a.$$.fragment,f),m=!0)},o(f){q(a.$$.fragment,f),m=!1},d(f){f&&$(e),f&&$(u),se(a,f)}}}function Nm(t,e,l){let{json:n}=e,{sysinfo:i}=e,o={},u,a,m=document.documentElement.classList.contains("dark");return t.$$set=f=>{"json"in f&&l(0,n=f.json),"sysinfo"in f&&l(2,i=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&29){let f=n.currency,p=new Date().getUTCHours(),_=0,h=0,v=0,d=[],g=[],y=[];l(4,a=l(3,u=0));let P=new Date;for(dl(P,i.clock_offset-(24+P.getHours()-P.getUTCHours())%24),_=p;_<24&&(h=n[Ue(v++)],h!=null);_++)g.push({label:Ue(P.getHours())}),y.push(h*100),l(4,a=Math.min(a,h*100)),l(3,u=Math.max(u,h*100)),dl(P,1);for(_=0;_<24&&(h=n[Ue(v++)],h!=null);_++)g.push({label:Ue(P.getHours())}),y.push(h*100),l(4,a=Math.min(a,h*100)),l(3,u=Math.max(u,h*100)),dl(P,1);if(a>-100&&u<100){switch(f){case"NOK":case"DKK":f="\xF8re";break;case"SEK":f="\xF6re";break;case"EUR":f="cent";break;case"CHF":f="rp.";break;default:f=f+"/100"}for(l(4,a*=100),l(3,u*=100),_=0;_=0?F.toFixed(w):"",title:F>=0?F.toFixed(2)+" "+f:"",value:h>=0?Math.abs(h):0,label2:F<0?F.toFixed(w):"",title2:F<0?F.toFixed(2)+" "+f:"",value2:h<0?Math.abs(h):0,color:m?"#5c2da5":"#7c3aed"})}let E=Math.max(u,Math.abs(a));if(a<0){l(4,a=Math.min(E/4*-1,a));let F=Math.ceil(Math.abs(a)/E*4),w=a/F;for(_=1;_{"json"in f&&l(1,n=f.json),"sysinfo"in f&&l(2,i=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let f=0,p=[],_=[],h=[];l(4,a=l(3,u=0));let v=dl(new Date,-24),d=new Date().getUTCHours();for(dl(v,i.clock_offset-(24+v.getHours()-v.getUTCHours())%24),f=d;f<24;f++){let M=n["i"+Ue(f)],E=n["e"+Ue(f)];M===void 0&&(M=0),E===void 0&&(E=0),_.push({label:Ue(v.getHours())}),h.push({label:M.toFixed(1),title:M.toFixed(2)+" kWh",value:M*10,label2:E.toFixed(1),title2:E.toFixed(2)+" kWh",value2:E*10,color:m?"#5c2da5":"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,E*10)),l(3,u=Math.max(u,M*10)),dl(v,1)}for(f=0;f{"json"in f&&l(1,n=f.json),"sysinfo"in f&&l(2,i=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let f=0,p=[],_=[],h=[];l(4,a=l(3,u=0));let v=new Date,d=new Date;for(dl(v,i.clock_offset-(24+v.getHours()-v.getUTCHours())%24),dl(d,i.clock_offset-(24+d.getHours()-d.getUTCHours())%24),d.setDate(0),f=v.getDate();f<=d.getDate();f++){let M=n["i"+Ue(f)],E=n["e"+Ue(f)];M===void 0&&(M=0),E===void 0&&(E=0),_.push({label:Ue(f)}),h.push({label:M.toFixed(M<10?1:0),title:M.toFixed(2)+" kWh",value:M,label2:E.toFixed(E<10?1:0),title2:E.toFixed(2)+" kWh",value2:E,color:m?"#5c2da5":"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,E)),l(3,u=Math.max(u,M))}for(f=1;f{"json"in m&&l(1,n=m.json)},t.$$.update=()=>{if(t.$$.dirty&14){let m=0,f=0,p=[],_=[],h=[];n.s&&n.s.forEach((g,y)=>{var P=g.n?g.n:g.a;f=g.v,f==-127&&(f=0),_.push({label:P.slice(-4)}),h.push({label:f.toFixed(1),value:f,color:i?"#5c2da5":"#7c3aed"}),l(3,a=Math.min(a,f)),l(2,u=Math.max(u,f))}),l(2,u=Math.ceil(u)),l(3,a=Math.floor(a));let v=u;a<0&&(v+=Math.abs(a));let d=v/4;for(m=0;m<5;m++)f=a+d*m,p.push({value:f,label:f.toFixed(1)});l(0,o={title:"Temperature sensors (\xB0C)",height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:a,max:u,ticks:p},x:{ticks:_},points:h})}},[o,n,u,a]}class qm extends Re{constructor(e){super(),Le(this,e,Fm,Om,Ee,{json:1})}}function Bm(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}let Um=0;function jm(t,e,l){let n=document.documentElement.classList.contains("dark"),i={},o=0,u;return Kc.subscribe(a=>{l(2,u=a)}),Vc(),t.$$.update=()=>{if(t.$$.dirty&6){let a=0,m=[],f=[],p=[];if(m.push({value:0,label:0}),u&&u.p)for(a=0;a0?Ue(_.d)+"."+Ys[new Date().getMonth()]:"-"}),l(1,o=Math.max(o,_.v))}if(u&&u.t){for(a=0;a=o)break;m.push({value:_,label:_})}m.push({label:u.m.toFixed(1),align:"right",color:"green",value:u.m})}u&&u.c&&(m.push({label:u.c.toFixed(0),color:"orange",value:u.c}),l(1,o=Math.max(o,u.c))),l(1,o=Math.ceil(o)),l(0,i={title:"Tariff peaks",padding:{top:20,right:35,bottom:20,left:35},y:{min:Um,max:o,ticks:m},x:{ticks:f},points:p})}},[i,o,u]}class Hm extends Re{constructor(e){super(),Le(this,e,jm,Bm,Ee,{})}}function gu(t,e,l){const n=t.slice();return n[19]=e[l],n[21]=l,n}function ku(t,e,l){const n=t.slice();return n[22]=e[l],n}function wu(t){let e,l,n,i,o,u=t[7],a=[];for(let p=0;pt[15].call(e))},m(f,p){S(f,e,p),s(e,l),s(l,n),s(l,i),s(l,o),s(e,u),m&&m.m(e,null),a=mo(e,t[15].bind(e))},p(f,[p]){p&1024&&J(i,f[10]),f[7]?m?m.p(f,p):(m=wu(f),m.c(),m.m(e,null)):m&&(m.d(1),m=null)},i:pe,o:pe,d(f){f&&$(e),m&&m.d(),a()}}}let zm=12;function Gm(t,e,l){let n=document.documentElement.classList.contains("dark"),i;Yc.subscribe(F=>{l(12,i=F)});let o,u=0;function a(){i.data.unshift(0),l(12,i.data=i.data.slice(0,i.size),i),u+=10,o=setTimeout(a,1e4)}Bc.subscribe(F=>{u>0?i.data&&F.u-u>=10&&(o&&clearTimeout(o),i.data.unshift(F.i-F.e),l(12,i.data=i.data.slice(0,i.size),i),u+=10,o=setTimeout(a,1e4)):u=F.u});let m,f,p,_,h,v,d,g,y,P,M,E,R;function O(){p=this.clientWidth,_=this.clientHeight,l(0,p),l(1,_)}return t.$$.update=()=>{if(t.$$.dirty&29183&&(l(2,h=parseInt(_)-50),l(3,v=p-35),l(9,E=v/i.size),l(14,f=0),l(13,m=0),i.data)){for(let w in i.data){let D=i.data[w];l(13,m=Math.max(Math.ceil(D/1e3)*1e3,m)),l(14,f=Math.min(Math.ceil(D/1e3)*1e3,f))}l(10,R=m>2500?"kW":"W"),l(7,P=[]);for(let w=f;w2500?(w/1e3).toFixed(1):w});l(8,M=[]);for(let w=f;w0||t[0].e>0}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&2&&(u.sysinfo=i[1]),o&1&&(u.data=i[0].ea),o&1&&(u.currency=i[0].pc),o&1&&(u.hasExport=i[0].om>0||i[0].e>0),l.$set(u)},i(i){n||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Lu(t){let e,l,n;return l=new Hm({}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt h-64")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},i(i){n||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Ru(t){let e,l,n;return l=new Vm({}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},i(i){n||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Iu(t){let e,l,n;return l=new Em({props:{json:t[2],sysinfo:t[1]}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&4&&(u.json=i[2]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Ou(t){let e,l,n;return l=new Dm({props:{json:t[3],sysinfo:t[1]}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&8&&(u.json=i[3]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Fu(t){let e,l,n;return l=new Im({props:{json:t[4],sysinfo:t[1]}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&16&&(u.json=i[4]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function qu(t){let e,l,n;return l=new qm({props:{json:t[5]}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&32&&(u.json=i[5]),l.$set(u)},i(i){n||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Km(t){let e,l=Xe(t[1].ui.i,t[0].i),n,i=Xe(t[1].ui.e,t[0].om||t[0].e>0),o,u=Xe(t[1].ui.v,t[0].u1>100||t[0].u2>100||t[0].u3>100),a,m=Xe(t[1].ui.a,t[0].i1>.01||t[0].i2>.01||t[0].i3>.01),f,p=Xe(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),_,h=Xe(t[1].ui.c,t[0].ea),v,d=Xe(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),g,y=Xe(t[1].ui.l),P,M=Xe(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),E,R=Xe(t[1].ui.d,t[3]),O,F=Xe(t[1].ui.m,t[4]),w,D=Xe(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),ne,H=l&&Tu(t),z=i&&Nu(t),U=u&&Eu(t),K=m&&Au(t),Q=p&&Pu(t),G=h&&Du(t),X=d&&Lu(),Y=y&&Ru(),j=M&&Iu(t),x=R&&Ou(t),ae=F&&Fu(t),ee=D&&qu(t);return{c(){e=c("div"),H&&H.c(),n=b(),z&&z.c(),o=b(),U&&U.c(),a=b(),K&&K.c(),f=b(),Q&&Q.c(),_=b(),G&&G.c(),v=b(),X&&X.c(),g=b(),Y&&Y.c(),P=b(),j&&j.c(),E=b(),x&&x.c(),O=b(),ae&&ae.c(),w=b(),ee&&ee.c(),r(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(V,W){S(V,e,W),H&&H.m(e,null),s(e,n),z&&z.m(e,null),s(e,o),U&&U.m(e,null),s(e,a),K&&K.m(e,null),s(e,f),Q&&Q.m(e,null),s(e,_),G&&G.m(e,null),s(e,v),X&&X.m(e,null),s(e,g),Y&&Y.m(e,null),s(e,P),j&&j.m(e,null),s(e,E),x&&x.m(e,null),s(e,O),ae&&ae.m(e,null),s(e,w),ee&&ee.m(e,null),ne=!0},p(V,[W]){W&3&&(l=Xe(V[1].ui.i,V[0].i)),l?H?(H.p(V,W),W&3&&I(H,1)):(H=Tu(V),H.c(),I(H,1),H.m(e,n)):H&&(Ae(),q(H,1,1,()=>{H=null}),Pe()),W&3&&(i=Xe(V[1].ui.e,V[0].om||V[0].e>0)),i?z?(z.p(V,W),W&3&&I(z,1)):(z=Nu(V),z.c(),I(z,1),z.m(e,o)):z&&(Ae(),q(z,1,1,()=>{z=null}),Pe()),W&3&&(u=Xe(V[1].ui.v,V[0].u1>100||V[0].u2>100||V[0].u3>100)),u?U?(U.p(V,W),W&3&&I(U,1)):(U=Eu(V),U.c(),I(U,1),U.m(e,a)):U&&(Ae(),q(U,1,1,()=>{U=null}),Pe()),W&3&&(m=Xe(V[1].ui.a,V[0].i1>.01||V[0].i2>.01||V[0].i3>.01)),m?K?(K.p(V,W),W&3&&I(K,1)):(K=Au(V),K.c(),I(K,1),K.m(e,f)):K&&(Ae(),q(K,1,1,()=>{K=null}),Pe()),W&3&&(p=Xe(V[1].ui.r,V[0].ri>0||V[0].re>0||V[0].ric>0||V[0].rec>0)),p?Q?(Q.p(V,W),W&3&&I(Q,1)):(Q=Pu(V),Q.c(),I(Q,1),Q.m(e,_)):Q&&(Ae(),q(Q,1,1,()=>{Q=null}),Pe()),W&3&&(h=Xe(V[1].ui.c,V[0].ea)),h?G?(G.p(V,W),W&3&&I(G,1)):(G=Du(V),G.c(),I(G,1),G.m(e,v)):G&&(Ae(),q(G,1,1,()=>{G=null}),Pe()),W&3&&(d=Xe(V[1].ui.t,V[0].pr&&(V[0].pr.startsWith("10YNO")||V[0].pr.startsWith("10Y1001A1001A4")))),d?X?W&3&&I(X,1):(X=Lu(),X.c(),I(X,1),X.m(e,g)):X&&(Ae(),q(X,1,1,()=>{X=null}),Pe()),W&2&&(y=Xe(V[1].ui.l)),y?Y?W&2&&I(Y,1):(Y=Ru(),Y.c(),I(Y,1),Y.m(e,P)):Y&&(Ae(),q(Y,1,1,()=>{Y=null}),Pe()),W&3&&(M=Xe(V[1].ui.p,V[0].pe&&!Number.isNaN(V[0].p))),M?j?(j.p(V,W),W&3&&I(j,1)):(j=Iu(V),j.c(),I(j,1),j.m(e,E)):j&&(Ae(),q(j,1,1,()=>{j=null}),Pe()),W&10&&(R=Xe(V[1].ui.d,V[3])),R?x?(x.p(V,W),W&10&&I(x,1)):(x=Ou(V),x.c(),I(x,1),x.m(e,O)):x&&(Ae(),q(x,1,1,()=>{x=null}),Pe()),W&18&&(F=Xe(V[1].ui.m,V[4])),F?ae?(ae.p(V,W),W&18&&I(ae,1)):(ae=Fu(V),ae.c(),I(ae,1),ae.m(e,w)):ae&&(Ae(),q(ae,1,1,()=>{ae=null}),Pe()),W&35&&(D=Xe(V[1].ui.s,V[0].t&&V[0].t!=-127&&V[5].c>1)),D?ee?(ee.p(V,W),W&35&&I(ee,1)):(ee=qu(V),ee.c(),I(ee,1),ee.m(e,null)):ee&&(Ae(),q(ee,1,1,()=>{ee=null}),Pe())},i(V){ne||(I(H),I(z),I(U),I(K),I(Q),I(G),I(X),I(Y),I(j),I(x),I(ae),I(ee),ne=!0)},o(V){q(H),q(z),q(U),q(K),q(Q),q(G),q(X),q(Y),q(j),q(x),q(ae),q(ee),ne=!1},d(V){V&&$(e),H&&H.d(),z&&z.d(),U&&U.d(),K&&K.d(),Q&&Q.d(),G&&G.d(),X&&X.d(),Y&&Y.d(),j&&j.d(),x&&x.d(),ae&&ae.d(),ee&&ee.d()}}}function Ym(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},u={},a={},m={};return go.subscribe(f=>{l(2,o=f)}),Hc.subscribe(f=>{l(3,u=f)}),Wc.subscribe(f=>{l(4,a=f)}),Gc.subscribe(f=>{l(5,m=f)}),t.$$set=f=>{"data"in f&&l(0,n=f.data),"sysinfo"in f&&l(1,i=f.sysinfo)},[n,i,o,u,a,m]}class Qm extends Re{constructor(e){super(),Le(this,e,Ym,Km,Ee,{data:0,sysinfo:1})}}let lo={};const hi=it(lo);async function Xm(){lo=await(await fetch("/configuration.json")).json(),hi.set(lo)}let no={};const e1=it(no);async function Zm(){no=await(await fetch("/priceconfig.json")).json(),e1.set(no)}function Bu(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Jm(t){let e;return{c(){e=c("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function xm(t){let e;return{c(){e=c("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Uu(t){let e;return{c(){e=c("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function ju(t){let e,l,n;return{c(){e=c("option"),e.textContent="UART1",l=b(),n=c("option"),n.textContent="UART2",e.__value=9,e.value=e.__value,n.__value=16,n.value=n.__value},m(i,o){S(i,e,o),S(i,l,o),S(i,n,o)},d(i){i&&$(e),i&&$(l),i&&$(n)}}}function Hu(t){let e;return{c(){e=c("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Wu(t){let e,l,n;return{c(){e=c("option"),l=N("GPIO"),n=N(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){S(i,e,o),s(e,l),s(e,n)},d(i){i&&$(e)}}}function zu(t){let e,l=t[4]>1&&!(t[0]=="esp32"&&(t[4]==9||t[4]==16))&&!((t[0]=="esp32s2"||t[0]=="esp32s3")&&t[4]==18)&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Wu(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),S(n,e,i)},p(n,i){n[4]>1&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!((n[0]=="esp32s2"||n[0]=="esp32s3")&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Wu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&$(e)}}}function e_(t){let e,l,n,i,o;function u(d,g){return d[0]=="esp32c3"?xm:Jm}let a=u(t),m=a(t),f=t[0]=="esp8266"&&Uu(),p=(t[0]=="esp32"||t[0]=="esp32solo")&&ju(),_=(t[0]=="esp32s2"||t[0]=="esp32s3")&&Hu(),h={length:t[1]+1},v=[];for(let d=0;d{"chip"in o&&l(0,n=o.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32s3":l(1,i=46);break;case"esp32c3":l(1,i=19);break}},[n,i]}class io extends Re{constructor(e){super(),Le(this,e,t_,e_,Ee,{chip:0})}}function Gu(t){let e,l,n=t[1]&&Vu(t);return{c(){e=c("div"),l=c("div"),n&&n.c(),r(l,"class","fixed inset-0 bg-gray-500 dark:bg-gray-900 bg-opacity-50 dark:bg-opacity-80 flex items-center justify-center"),r(e,"class","z-50"),r(e,"aria-modal","true")},m(i,o){S(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=Vu(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&$(e),n&&n.d()}}}function Vu(t){let e,l;return{c(){e=c("div"),l=N(t[1]),r(e,"class","bg-white dark:bg-gray-600 m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 dark:text-white w-96")},m(n,i){S(n,e,i),s(e,l)},p(n,i){i&2&&J(l,n[1])},d(n){n&&$(e)}}}function l_(t){let e,l=t[0]&&Gu(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),S(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Gu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:pe,o:pe,d(n){l&&l.d(n),n&&$(e)}}}function n_(t,e,l){let{active:n}=e,{message:i}=e;return t.$$set=o=>{"active"in o&&l(0,n=o.active),"message"in o&&l(1,i=o.message)},[n,i]}class kt extends Re{constructor(e){super(),Le(this,e,n_,l_,Ee,{active:0,message:1})}}function Ku(t,e,l){const n=t.slice();return n[1]=e[l],n}function Yu(t){let e,l,n=t[1]+"",i;return{c(){e=c("option"),l=N("Europe/"),i=N(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,u){S(o,e,u),s(e,l),s(e,i)},p:pe,d(o){o&&$(e)}}}function i_(t){let e,l,n,i=t[0],o=[];for(let u=0;u>1&1,A=0;A0;C--)A[C]=A[C]?A[C-1]^O.EXPONENT[D._modN(O.LOG[A[C]]+T)]:A[C-1];A[0]=O.EXPONENT[D._modN(O.LOG[A[0]]+T)]}for(T=0;T<=k;T++)A[T]=O.LOG[A[T]]},_checkBadness:function(){var T,C,k,A,L,Z=0,le=this._badness,fe=this.buffer,de=this.width;for(L=0;Lde*de;)ue-=de*de,Oe++;for(Z+=Oe*D.N4,A=0;A=le-2&&(T=le-2,L>9&&T--);var fe=T;if(L>9){for(Z[fe+2]=0,Z[fe+3]=0;fe--;)C=Z[fe],Z[fe+3]|=255&C<<4,Z[fe+2]=C>>4;Z[2]|=255&T<<4,Z[1]=T>>4,Z[0]=64|T>>12}else{for(Z[fe+1]=0,Z[fe+2]=0;fe--;)C=Z[fe],Z[fe+2]|=255&C<<4,Z[fe+1]=C>>4;Z[1]|=255&T<<4,Z[0]=64|T>>4}for(fe=T+3-(L<10);fe=5&&(k+=D.N1+A[C]-5);for(C=3;CT||A[C-3]*3>=A[C]*4||A[C+3]*3>=A[C]*4)&&(k+=D.N3);return k},_finish:function(){this._stringBuffer=this.buffer.slice();var T,C,k=0,A=3e4;for(C=0;C<8&&(this._applyMask(C),T=this._checkBadness(),T>=1)A&1&&(L[Z-1-C+Z*8]=1,C<6?L[8+Z*C]=1:L[8+Z*(C+1)]=1);for(C=0;C<7;C++,A>>=1)A&1&&(L[8+Z*(Z-7+C)]=1,C?L[6-C+Z*8]=1:L[7+Z*8]=1)},_interleaveBlocks:function(){var T,C,k=this._dataBlock,A=this._ecc,L=this._eccBlock,Z=0,le=this._calculateMaxLength(),fe=this._neccBlock1,de=this._neccBlock2,Ce=this._stringBuffer;for(T=0;T1)for(T=P.BLOCK[A],k=L-7;;){for(C=L-7;C>T-3&&(this._addAlignment(C,k),!(C6)for(T=w.BLOCK[Z-7],C=17,k=0;k<6;k++)for(A=0;A<3;A++,C--)1&(C>11?Z>>C-12:T>>C)?(L[5-k+le*(2-A+le-11)]=1,L[2-A+le-11+le*(5-k)]=1):(this._setMask(5-k,2-A+le-11),this._setMask(2-A+le-11,5-k))},_isMasked:function(T,C){var k=D._getMaskBit(T,C);return this._mask[k]===1},_pack:function(){var T,C,k,A=1,L=1,Z=this.width,le=Z-1,fe=Z-1,de=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(C=0;CC&&(k=T,T=C,C=k),k=C,k+=C*C,k>>=1,k+=T,k},_modN:function(T){for(;T>=255;)T-=255,T=(T>>8)+(T&255);return T},N1:3,N2:3,N3:40,N4:10}),ne=D,H=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var T=this.element;T.width=T.height=this.qrious.size}}),z=H,U=_.extend(function(T,C,k,A){this.name=T,this.modifiable=Boolean(C),this.defaultValue=k,this._valueTransformer=A},{transform:function(T){var C=this._valueTransformer;return typeof C=="function"?C(T,this):T}}),K=U,Q=_.extend(null,{abs:function(T){return T!=null?Math.abs(T):null},hasOwn:function(T,C){return Object.prototype.hasOwnProperty.call(T,C)},noop:function(){},toUpperCase:function(T){return T!=null?T.toUpperCase():null}}),G=Q,X=_.extend(function(T){this.options={},T.forEach(function(C){this.options[C.name]=C},this)},{exists:function(T){return this.options[T]!=null},get:function(T,C){return X._get(this.options[T],C)},getAll:function(T){var C,k=this.options,A={};for(C in k)G.hasOwn(k,C)&&(A[C]=X._get(k[C],T));return A},init:function(T,C,k){typeof k!="function"&&(k=G.noop);var A,L;for(A in this.options)G.hasOwn(this.options,A)&&(L=this.options[A],X._set(L,L.defaultValue,C),X._createAccessor(L,C,k));this._setAll(T,C,!0)},set:function(T,C,k){return this._set(T,C,k)},setAll:function(T,C){return this._setAll(T,C)},_set:function(T,C,k,A){var L=this.options[T];if(!L)throw new Error("Invalid option: "+T);if(!L.modifiable&&!A)throw new Error("Option cannot be modified: "+T);return X._set(L,C,k)},_setAll:function(T,C,k){if(!T)return!1;var A,L=!1;for(A in T)G.hasOwn(T,A)&&this._set(A,T[A],C,k)&&(L=!0);return L}},{_createAccessor:function(T,C,k){var A={get:function(){return X._get(T,C)}};T.modifiable&&(A.set=function(L){X._set(T,L,C)&&k(L,T)}),Object.defineProperty(C,T.name,A)},_get:function(T,C){return C["_"+T.name]},_set:function(T,C,k){var A="_"+T.name,L=k[A],Z=T.transform(C!=null?C:T.defaultValue);return k[A]=Z,Z!==L}}),Y=X,j=_.extend(function(){this._services={}},{getService:function(T){var C=this._services[T];if(!C)throw new Error("Service is not being managed with name: "+T);return C},setService:function(T,C){if(this._services[T])throw new Error("Service is already managed with name: "+T);C&&(this._services[T]=C)}}),x=j,ae=new Y([new K("background",!0,"white"),new K("backgroundAlpha",!0,1,G.abs),new K("element"),new K("foreground",!0,"black"),new K("foregroundAlpha",!0,1,G.abs),new K("level",!0,"L",G.toUpperCase),new K("mime",!0,"image/png"),new K("padding",!0,null,G.abs),new K("size",!0,100,G.abs),new K("value",!0,"")]),ee=new x,V=_.extend(function(T){ae.init(T,this,this.update.bind(this));var C=ae.get("element",this),k=ee.getService("element"),A=C&&k.isCanvas(C)?C:k.createCanvas(),L=C&&k.isImage(C)?C:k.createImage();this._canvasRenderer=new g(this,A,!0),this._imageRenderer=new z(this,L,L===C),this.update()},{get:function(){return ae.getAll(this)},set:function(T){ae.setAll(T,this)&&this.update()},toDataURL:function(T){return this.canvas.toDataURL(T||this.mime)},update:function(){var T=new ne({level:this.level,value:this.value});this._canvasRenderer.render(T),this._imageRenderer.render(T)}},{use:function(T){ee.setService(T.getName(),T)}});Object.defineProperties(V.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var W=V,we=W,He=_.extend({getName:function(){}}),Ie=He,Se=Ie.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(T){},isImage:function(T){}}),ye=Se,ve=ye.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(T){return T instanceof HTMLCanvasElement},isImage:function(T){return T instanceof HTMLImageElement}}),Te=ve;we.use(new Te);var be=we;return be})})(l1);const f_=l1.exports;function c_(t){let e,l;return{c(){e=c("img"),Ws(e.src,l=t[2])||r(e,"src",l),r(e,"alt",t[0]),r(e,"class",t[1])},m(n,i){S(n,e,i)},p(n,[i]){i&4&&!Ws(e.src,l=n[2])&&r(e,"src",l),i&1&&r(e,"alt",n[0]),i&2&&r(e,"class",n[1])},i:pe,o:pe,d(n){n&&$(e)}}}function m_(t,e,l){const n=new f_;let{errorCorrection:i="L"}=e,{background:o="#fff"}=e,{color:u="#000"}=e,{size:a="200"}=e,{value:m=""}=e,{padding:f=0}=e,{className:p="qrcode"}=e,_="";function h(){n.set({background:o,foreground:u,level:i,padding:f,size:a,value:m}),l(2,_=n.toDataURL("image/jpeg"))}return ac(()=>{h()}),t.$$set=v=>{"errorCorrection"in v&&l(3,i=v.errorCorrection),"background"in v&&l(4,o=v.background),"color"in v&&l(5,u=v.color),"size"in v&&l(6,a=v.size),"value"in v&&l(0,m=v.value),"padding"in v&&l(7,f=v.padding),"className"in v&&l(1,p=v.className)},t.$$.update=()=>{t.$$.dirty&1&&m&&h()},[m,p,_,i,o,u,a,f]}class __ extends Re{constructor(e){super(),Le(this,e,m_,c_,Ee,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function Qu(t,e,l){const n=t.slice();return n[101]=e[l],n[102]=e,n[103]=l,n}function Xu(t,e,l){const n=t.slice();return n[104]=e[l],n[105]=e,n[106]=l,n}function p_(t,e,l){const n=t.slice();return n[107]=e[l],n}function d_(t,e,l){const n=t.slice();return n[110]=e[l],n}function v_(t){let e,l;return{c(){e=c("option"),l=N(t[110]),e.__value=t[110],e.value=e.__value},m(n,i){S(n,e,i),s(e,l)},p:pe,d(n){n&&$(e)}}}function h_(t){let e;return{c(){e=N("Configure price")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Zu(t){let e,l,n,i;return{c(){e=c("br"),l=c("input"),r(l,"name","pt"),r(l,"type","text"),r(l,"class","in-s"),r(l,"placeholder","ENTSO-E API key, optional, read docs")},m(o,u){S(o,e,u),S(o,l,u),oe(l,t[3].p.t),n||(i=te(l,"input",t[20]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].p.t&&oe(l,o[3].p.t)},d(o){o&&$(e),o&&$(l),n=!1,i()}}}function Ju(t){let e,l,n,i,o,u,a,m,f,p,_,h,v;return{c(){e=c("div"),l=N("Username"),n=c("br"),i=b(),o=c("input"),u=b(),a=c("div"),m=N("Password"),f=c("br"),p=b(),_=c("input"),r(o,"name","gu"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(_,"name","gp"),r(_,"type","password"),r(_,"class","in-s"),r(a,"class","my-1")},m(d,g){S(d,e,g),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].g.u),S(d,u,g),S(d,a,g),s(a,m),s(a,f),s(a,p),s(a,_),oe(_,t[3].g.p),h||(v=[te(o,"input",t[22]),te(_,"input",t[23])],h=!0)},p(d,g){g[0]&8&&o.value!==d[3].g.u&&oe(o,d[3].g.u),g[0]&8&&_.value!==d[3].g.p&&oe(_,d[3].g.p)},d(d){d&&$(e),d&&$(u),d&&$(a),h=!1,ze(v)}}}function b_(t){let e,l=t[107]*100+"",n;return{c(){e=c("option"),n=N(l),e.__value=t[107]*100,e.value=e.__value},m(i,o){S(i,e,o),s(e,n)},p:pe,d(i){i&&$(e)}}}function xu(t){let e,l,n,i;return{c(){e=c("br"),l=c("input"),r(l,"name","mek"),r(l,"type","text"),r(l,"class","in-s")},m(o,u){S(o,e,u),S(o,l,u),oe(l,t[3].m.e.k),n||(i=te(l,"input",t[33]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].m.e.k&&oe(l,o[3].m.e.k)},d(o){o&&$(e),o&&$(l),n=!1,i()}}}function ef(t){let e,l,n,i,o,u,a;return{c(){e=c("div"),l=N("Authentication key"),n=c("br"),i=b(),o=c("input"),r(o,"name","mea"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1")},m(m,f){S(m,e,f),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].m.e.a),u||(a=te(o,"input",t[34]),u=!0)},p(m,f){f[0]&8&&o.value!==m[3].m.e.a&&oe(o,m[3].m.e.a)},d(m){m&&$(e),u=!1,a()}}}function tf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y,P,M,E,R,O,F,w,D,ne,H;return{c(){e=c("div"),l=c("div"),n=N("Watt"),i=c("br"),o=b(),u=c("input"),a=b(),m=c("div"),f=N("Volt"),p=c("br"),_=b(),h=c("input"),v=b(),d=c("div"),g=N("Amp"),y=c("br"),P=b(),M=c("input"),E=b(),R=c("div"),O=N("kWh"),F=c("br"),w=b(),D=c("input"),r(u,"name","mmw"),r(u,"type","number"),r(u,"min","0.00"),r(u,"max","1000"),r(u,"step","0.001"),r(u,"class","in-f tr w-full"),r(l,"class","w-1/4"),r(h,"name","mmv"),r(h,"type","number"),r(h,"min","0.00"),r(h,"max","1000"),r(h,"step","0.001"),r(h,"class","in-m tr w-full"),r(m,"class","w-1/4"),r(M,"name","mma"),r(M,"type","number"),r(M,"min","0.00"),r(M,"max","1000"),r(M,"step","0.001"),r(M,"class","in-m tr w-full"),r(d,"class","w-1/4"),r(D,"name","mmc"),r(D,"type","number"),r(D,"min","0.00"),r(D,"max","1000"),r(D,"step","0.001"),r(D,"class","in-l tr w-full"),r(R,"class","w-1/4"),r(e,"class","flex my-1")},m(z,U){S(z,e,U),s(e,l),s(l,n),s(l,i),s(l,o),s(l,u),oe(u,t[3].m.m.w),s(e,a),s(e,m),s(m,f),s(m,p),s(m,_),s(m,h),oe(h,t[3].m.m.v),s(e,v),s(e,d),s(d,g),s(d,y),s(d,P),s(d,M),oe(M,t[3].m.m.a),s(e,E),s(e,R),s(R,O),s(R,F),s(R,w),s(R,D),oe(D,t[3].m.m.c),ne||(H=[te(u,"input",t[36]),te(h,"input",t[37]),te(M,"input",t[38]),te(D,"input",t[39])],ne=!0)},p(z,U){U[0]&8&&ge(u.value)!==z[3].m.m.w&&oe(u,z[3].m.m.w),U[0]&8&&ge(h.value)!==z[3].m.m.v&&oe(h,z[3].m.m.v),U[0]&8&&ge(M.value)!==z[3].m.m.a&&oe(M,z[3].m.m.a),U[0]&8&&ge(D.value)!==z[3].m.m.c&&oe(D,z[3].m.m.c)},d(z){z&&$(e),ne=!1,ze(H)}}}function lf(t){let e;return{c(){e=c("option"),e.textContent="Ethernet",e.__value=3,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function nf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y,P,M,E,R,O,F,w,D,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V;return{c(){e=c("div"),l=N("SSID"),n=c("br"),i=b(),o=c("input"),u=b(),a=c("div"),m=N("Password"),f=c("br"),p=b(),_=c("input"),h=b(),v=c("div"),d=c("div"),g=N("Power saving"),y=c("br"),P=b(),M=c("select"),E=c("option"),E.textContent="Default",R=c("option"),R.textContent="Off",O=c("option"),O.textContent="Minimum",F=c("option"),F.textContent="Maximum",w=b(),D=c("div"),ne=N("Power"),H=c("br"),z=b(),U=c("div"),K=c("input"),Q=b(),G=c("span"),G.textContent="dBm",X=b(),Y=c("div"),j=c("label"),x=c("input"),ae=N(" Allow 802.11b legacy rates"),r(o,"name","ws"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(_,"name","wp"),r(_,"type","password"),r(_,"class","in-s"),r(a,"class","my-1"),E.__value=255,E.value=E.__value,R.__value=0,R.value=R.__value,O.__value=1,O.value=O.__value,F.__value=2,F.value=F.__value,r(M,"name","wz"),r(M,"class","in-s"),t[3].w.z===void 0&&We(()=>t[43].call(M)),r(d,"class","w-1/2"),r(K,"name","ww"),r(K,"type","number"),r(K,"min","0"),r(K,"max","20.5"),r(K,"step","0.5"),r(K,"class","in-f tr w-full"),r(G,"class","in-post"),r(U,"class","flex"),r(D,"class","ml-2 w-1/2"),r(v,"class","my-1 flex"),r(x,"type","checkbox"),r(x,"name","wb"),x.__value="true",x.value=x.__value,r(x,"class","rounded mb-1"),r(Y,"class","my-3")},m(W,we){S(W,e,we),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].w.s),S(W,u,we),S(W,a,we),s(a,m),s(a,f),s(a,p),s(a,_),oe(_,t[3].w.p),S(W,h,we),S(W,v,we),s(v,d),s(d,g),s(d,y),s(d,P),s(d,M),s(M,E),s(M,R),s(M,O),s(M,F),$e(M,t[3].w.z,!0),s(v,w),s(v,D),s(D,ne),s(D,H),s(D,z),s(D,U),s(U,K),oe(K,t[3].w.w),s(U,Q),s(U,G),S(W,X,we),S(W,Y,we),s(Y,j),s(j,x),x.checked=t[3].w.b,s(j,ae),ee||(V=[te(o,"input",t[41]),te(_,"input",t[42]),te(M,"change",t[43]),te(K,"input",t[44]),te(x,"change",t[45])],ee=!0)},p(W,we){we[0]&8&&o.value!==W[3].w.s&&oe(o,W[3].w.s),we[0]&8&&_.value!==W[3].w.p&&oe(_,W[3].w.p),we[0]&8&&$e(M,W[3].w.z),we[0]&8&&ge(K.value)!==W[3].w.w&&oe(K,W[3].w.w),we[0]&8&&(x.checked=W[3].w.b)},d(W){W&&$(e),W&&$(u),W&&$(a),W&&$(h),W&&$(v),W&&$(X),W&&$(Y),ee=!1,ze(V)}}}function sf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y;return{c(){e=c("div"),l=N("Gateway"),n=c("br"),i=b(),o=c("input"),u=b(),a=c("div"),m=N("DNS"),f=c("br"),p=b(),_=c("div"),h=c("input"),v=b(),d=c("input"),r(o,"name","ng"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(h,"name","nd1"),r(h,"type","text"),r(h,"class","in-f w-full"),r(d,"name","nd2"),r(d,"type","text"),r(d,"class","in-l w-full"),r(_,"class","flex"),r(a,"class","my-1")},m(P,M){S(P,e,M),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].n.g),S(P,u,M),S(P,a,M),s(a,m),s(a,f),s(a,p),s(a,_),s(_,h),oe(h,t[3].n.d1),s(_,v),s(_,d),oe(d,t[3].n.d2),g||(y=[te(o,"input",t[49]),te(h,"input",t[50]),te(d,"input",t[51])],g=!0)},p(P,M){M[0]&8&&o.value!==P[3].n.g&&oe(o,P[3].n.g),M[0]&8&&h.value!==P[3].n.d1&&oe(h,P[3].n.d1),M[0]&8&&d.value!==P[3].n.d2&&oe(d,P[3].n.d2)},d(P){P&&$(e),P&&$(u),P&&$(a),g=!1,ze(y)}}}function of(t){let e,l,n,i,o;return{c(){e=c("label"),l=c("input"),n=N(" SSL"),r(l,"type","checkbox"),r(l,"name","qs"),l.__value="true",l.value=l.__value,r(l,"class","rounded mb-1"),r(e,"class","float-right mr-3")},m(u,a){S(u,e,a),s(e,l),l.checked=t[3].q.s.e,s(e,n),i||(o=[te(l,"change",t[55]),te(l,"change",t[14])],i=!0)},p(u,a){a[0]&8&&(l.checked=u[3].q.s.e)},d(u){u&&$(e),i=!1,ze(o)}}}function rf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v;const d=[k_,g_],g=[];function y(w,D){return w[3].q.s.c?0:1}n=y(t),i=g[n]=d[n](t);const P=[$_,C_],M=[];function E(w,D){return w[3].q.s.r?0:1}a=E(t),m=M[a]=P[a](t);const R=[N_,T_],O=[];function F(w,D){return w[3].q.s.k?0:1}return _=F(t),h=O[_]=R[_](t),{c(){e=c("div"),l=c("span"),i.c(),o=b(),u=c("span"),m.c(),f=b(),p=c("span"),h.c(),r(l,"class","flex pr-2"),r(u,"class","flex pr-2"),r(p,"class","flex pr-2"),r(e,"class","my-1 flex")},m(w,D){S(w,e,D),s(e,l),g[n].m(l,null),s(e,o),s(e,u),M[a].m(u,null),s(e,f),s(e,p),O[_].m(p,null),v=!0},p(w,D){let ne=n;n=y(w),n===ne?g[n].p(w,D):(Ae(),q(g[ne],1,1,()=>{g[ne]=null}),Pe(),i=g[n],i?i.p(w,D):(i=g[n]=d[n](w),i.c()),I(i,1),i.m(l,null));let H=a;a=E(w),a===H?M[a].p(w,D):(Ae(),q(M[H],1,1,()=>{M[H]=null}),Pe(),m=M[a],m?m.p(w,D):(m=M[a]=P[a](w),m.c()),I(m,1),m.m(u,null));let z=_;_=F(w),_===z?O[_].p(w,D):(Ae(),q(O[z],1,1,()=>{O[z]=null}),Pe(),h=O[_],h?h.p(w,D):(h=O[_]=R[_](w),h.c()),I(h,1),h.m(p,null))},i(w){v||(I(i),I(m),I(h),v=!0)},o(w){q(i),q(m),q(h),v=!1},d(w){w&&$(e),g[n].d(),M[a].d(),O[_].d()}}}function g_(t){let e,l;return e=new Qt({props:{to:"/mqtt-ca",$$slots:{default:[w_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i[3]&1048576&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function k_(t){let e,l,n,i,o,u,a,m;return l=new Qt({props:{to:"/mqtt-ca",$$slots:{default:[y_]},$$scope:{ctx:t}}}),o=new gs({}),{c(){e=c("span"),re(l.$$.fragment),n=b(),i=c("span"),re(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,p){S(f,e,p),ie(l,e,null),S(f,n,p),S(f,i,p),ie(o,i,null),u=!0,a||(m=[te(i,"click",t[11]),te(i,"keypress",t[11])],a=!0)},p(f,p){const _={};p[3]&1048576&&(_.$$scope={dirty:p,ctx:f}),l.$set(_)},i(f){u||(I(l.$$.fragment,f),I(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&$(e),se(l),f&&$(n),f&&$(i),se(o),a=!1,ze(m)}}}function w_(t){let e,l;return e=new an({props:{color:"blue",text:"Upload CA",title:"Click here to upload CA"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function y_(t){let e;return{c(){e=N("CA OK")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function C_(t){let e,l;return e=new Qt({props:{to:"/mqtt-cert",$$slots:{default:[S_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i[3]&1048576&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function $_(t){let e,l,n,i,o,u,a,m;return l=new Qt({props:{to:"/mqtt-cert",$$slots:{default:[M_]},$$scope:{ctx:t}}}),o=new gs({}),{c(){e=c("span"),re(l.$$.fragment),n=b(),i=c("span"),re(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,p){S(f,e,p),ie(l,e,null),S(f,n,p),S(f,i,p),ie(o,i,null),u=!0,a||(m=[te(i,"click",t[12]),te(i,"keypress",t[12])],a=!0)},p(f,p){const _={};p[3]&1048576&&(_.$$scope={dirty:p,ctx:f}),l.$set(_)},i(f){u||(I(l.$$.fragment,f),I(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&$(e),se(l),f&&$(n),f&&$(i),se(o),a=!1,ze(m)}}}function S_(t){let e,l;return e=new an({props:{color:"blue",text:"Upload cert",title:"Click here to upload certificate"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function M_(t){let e;return{c(){e=N("Cert OK")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function T_(t){let e,l;return e=new Qt({props:{to:"/mqtt-key",$$slots:{default:[E_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i[3]&1048576&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function N_(t){let e,l,n,i,o,u,a,m;return l=new Qt({props:{to:"/mqtt-key",$$slots:{default:[A_]},$$scope:{ctx:t}}}),o=new gs({}),{c(){e=c("span"),re(l.$$.fragment),n=b(),i=c("span"),re(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,p){S(f,e,p),ie(l,e,null),S(f,n,p),S(f,i,p),ie(o,i,null),u=!0,a||(m=[te(i,"click",t[13]),te(i,"keypress",t[13])],a=!0)},p(f,p){const _={};p[3]&1048576&&(_.$$scope={dirty:p,ctx:f}),l.$set(_)},i(f){u||(I(l.$$.fragment,f),I(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&$(e),se(l),f&&$(n),f&&$(i),se(o),a=!1,ze(m)}}}function E_(t){let e,l;return e=new an({props:{color:"blue",text:"Upload key",title:"Click here to upload key"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function A_(t){let e;return{c(){e=N("Key OK")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function af(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y,P,M,E,R,O,F,w,D,ne,H,z,U,K,Q,G,X;return o=new Lt({}),{c(){e=c("div"),l=c("strong"),l.textContent="Domoticz",n=b(),i=c("a"),re(o.$$.fragment),u=b(),a=c("input"),m=b(),f=c("div"),p=c("div"),_=N("Electricity IDX"),h=c("br"),v=b(),d=c("input"),g=b(),y=c("div"),P=N("Current IDX"),M=c("br"),E=b(),R=c("input"),O=b(),F=c("div"),w=N(`Voltage IDX: L1, L2 & L3 + `),D=c("div"),ne=c("input"),H=b(),z=c("input"),U=b(),K=c("input"),r(l,"class","text-sm"),r(i,"href",Rt("MQTT-configuration#domoticz")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","o"),a.value="true",r(d,"name","oe"),r(d,"type","text"),r(d,"class","in-f tr w-full"),r(p,"class","w-1/2"),r(R,"name","oc"),r(R,"type","text"),r(R,"class","in-l tr w-full"),r(y,"class","w-1/2"),r(f,"class","my-1 flex"),r(ne,"name","ou1"),r(ne,"type","text"),r(ne,"class","in-f tr w-1/3"),r(z,"name","ou2"),r(z,"type","text"),r(z,"class","in-m tr w-1/3"),r(K,"name","ou3"),r(K,"type","text"),r(K,"class","in-l tr w-1/3"),r(D,"class","flex"),r(F,"class","my-1"),r(e,"class","cnt")},m(Y,j){S(Y,e,j),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),s(e,a),s(e,m),s(e,f),s(f,p),s(p,_),s(p,h),s(p,v),s(p,d),oe(d,t[3].o.e),s(f,g),s(f,y),s(y,P),s(y,M),s(y,E),s(y,R),oe(R,t[3].o.c),s(e,O),s(e,F),s(F,w),s(F,D),s(D,ne),oe(ne,t[3].o.u1),s(D,H),s(D,z),oe(z,t[3].o.u2),s(D,U),s(D,K),oe(K,t[3].o.u3),Q=!0,G||(X=[te(d,"input",t[63]),te(R,"input",t[64]),te(ne,"input",t[65]),te(z,"input",t[66]),te(K,"input",t[67])],G=!0)},p(Y,j){j[0]&8&&d.value!==Y[3].o.e&&oe(d,Y[3].o.e),j[0]&8&&R.value!==Y[3].o.c&&oe(R,Y[3].o.c),j[0]&8&&ne.value!==Y[3].o.u1&&oe(ne,Y[3].o.u1),j[0]&8&&z.value!==Y[3].o.u2&&oe(z,Y[3].o.u2),j[0]&8&&K.value!==Y[3].o.u3&&oe(K,Y[3].o.u3)},i(Y){Q||(I(o.$$.fragment,Y),Q=!0)},o(Y){q(o.$$.fragment,Y),Q=!1},d(Y){Y&&$(e),se(o),G=!1,ze(X)}}}function uf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y,P,M,E,R,O,F,w,D,ne,H,z,U,K;return o=new Lt({}),{c(){e=c("div"),l=c("strong"),l.textContent="Home-Assistant",n=b(),i=c("a"),re(o.$$.fragment),u=b(),a=c("input"),m=b(),f=c("div"),p=N("Discovery topic prefix"),_=c("br"),h=b(),v=c("input"),d=b(),g=c("div"),y=N("Hostname for URL"),P=c("br"),M=b(),E=c("input"),O=b(),F=c("div"),w=N("Name tag"),D=c("br"),ne=b(),H=c("input"),r(l,"class","text-sm"),r(i,"href",Rt("MQTT-configuration#home-assistant")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","h"),a.value="true",r(v,"name","ht"),r(v,"type","text"),r(v,"class","in-s"),r(v,"placeholder","homeassistant"),r(f,"class","my-1"),r(E,"name","hh"),r(E,"type","text"),r(E,"class","in-s"),r(E,"placeholder",R=t[3].g.h+".local"),r(g,"class","my-1"),r(H,"name","hn"),r(H,"type","text"),r(H,"class","in-s"),r(F,"class","my-1"),r(e,"class","cnt")},m(Q,G){S(Q,e,G),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),s(e,a),s(e,m),s(e,f),s(f,p),s(f,_),s(f,h),s(f,v),oe(v,t[3].h.t),s(e,d),s(e,g),s(g,y),s(g,P),s(g,M),s(g,E),oe(E,t[3].h.h),s(e,O),s(e,F),s(F,w),s(F,D),s(F,ne),s(F,H),oe(H,t[3].h.n),z=!0,U||(K=[te(v,"input",t[68]),te(E,"input",t[69]),te(H,"input",t[70])],U=!0)},p(Q,G){G[0]&8&&v.value!==Q[3].h.t&&oe(v,Q[3].h.t),(!z||G[0]&8&&R!==(R=Q[3].g.h+".local"))&&r(E,"placeholder",R),G[0]&8&&E.value!==Q[3].h.h&&oe(E,Q[3].h.h),G[0]&8&&H.value!==Q[3].h.n&&oe(H,Q[3].h.n)},i(Q){z||(I(o.$$.fragment,Q),z=!0)},o(Q){q(o.$$.fragment,Q),z=!1},d(Q){Q&&$(e),se(o),U=!1,ze(K)}}}function ff(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y,P,M,E,R,O,F,w,D,ne,H,z,U,K,Q,G,X,Y,j,x,ae;o=new Lt({});let ee=t[3].c.es&&cf(t);return{c(){e=c("div"),l=c("strong"),l.textContent="Cloud connections",n=b(),i=c("a"),re(o.$$.fragment),u=b(),a=c("input"),m=b(),f=c("div"),p=c("label"),_=c("input"),h=N(" Enable cloud upload"),v=b(),d=c("div"),g=N("Client ID"),y=c("br"),P=b(),M=c("input"),O=b(),F=c("div"),w=N("Client secret"),D=c("br"),ne=b(),H=c("input"),U=b(),K=c("div"),Q=c("label"),G=c("input"),X=N(" Energy Speedometer"),Y=b(),ee&&ee.c(),r(l,"class","text-sm"),r(i,"href",Rt("Cloud")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","c"),a.value="true",r(_,"type","checkbox"),r(_,"name","ce"),_.__value="true",_.value=_.__value,r(_,"class","rounded mb-1"),r(f,"class","my-1"),r(M,"name","ci"),r(M,"type","text"),r(M,"class","in-s"),r(M,"pattern",E=t[3].c.e?"[A-Z0-9]{16}":".*"),M.required=R=t[3].c.e,r(d,"class","my-1"),r(H,"name","cs"),r(H,"type","text"),r(H,"class","in-s"),r(H,"pattern",z=t[3].c.e&&t[3].c.s!="***"?"[A-Z0-9]{16}":".*"),r(F,"class","my-1"),r(G,"type","checkbox"),r(G,"class","rounded mb-1"),r(G,"name","ces"),G.__value="true",G.value=G.__value,r(K,"class","my-1"),r(e,"class","cnt")},m(V,W){S(V,e,W),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),s(e,a),s(e,m),s(e,f),s(f,p),s(p,_),_.checked=t[3].c.e,s(p,h),s(e,v),s(e,d),s(d,g),s(d,y),s(d,P),s(d,M),oe(M,t[3].c.i),s(e,O),s(e,F),s(F,w),s(F,D),s(F,ne),s(F,H),oe(H,t[3].c.s),s(e,U),s(e,K),s(K,Q),s(Q,G),G.checked=t[3].c.es,s(Q,X),s(K,Y),ee&&ee.m(K,null),j=!0,x||(ae=[te(_,"change",t[71]),te(M,"input",t[72]),te(H,"input",t[73]),te(G,"change",t[74])],x=!0)},p(V,W){W[0]&8&&(_.checked=V[3].c.e),(!j||W[0]&8&&E!==(E=V[3].c.e?"[A-Z0-9]{16}":".*"))&&r(M,"pattern",E),(!j||W[0]&8&&R!==(R=V[3].c.e))&&(M.required=R),W[0]&8&&M.value!==V[3].c.i&&oe(M,V[3].c.i),(!j||W[0]&8&&z!==(z=V[3].c.e&&V[3].c.s!="***"?"[A-Z0-9]{16}":".*"))&&r(H,"pattern",z),W[0]&8&&H.value!==V[3].c.s&&oe(H,V[3].c.s),W[0]&8&&(G.checked=V[3].c.es),V[3].c.es?ee?(ee.p(V,W),W[0]&8&&I(ee,1)):(ee=cf(V),ee.c(),I(ee,1),ee.m(K,null)):ee&&(Ae(),q(ee,1,1,()=>{ee=null}),Pe())},i(V){j||(I(o.$$.fragment,V),I(ee),j=!0)},o(V){q(o.$$.fragment,V),q(ee),j=!1},d(V){V&&$(e),se(o),ee&&ee.d(),x=!1,ze(ae)}}}function cf(t){let e,l,n=t[0].mac+"",i,o,u,a,m=(t[0].meter.id?t[0].meter.id:"missing, required")+"",f,p,_,h,v=t[0].mac&&t[0].meter.id&&mf(t);return{c(){e=c("div"),l=N("MAC: "),i=N(n),o=b(),u=c("div"),a=N("Meter ID: "),f=N(m),p=b(),v&&v.c(),_=Ke(),r(e,"class","pl-5"),r(u,"class","pl-5")},m(d,g){S(d,e,g),s(e,l),s(e,i),S(d,o,g),S(d,u,g),s(u,a),s(u,f),S(d,p,g),v&&v.m(d,g),S(d,_,g),h=!0},p(d,g){(!h||g[0]&1)&&n!==(n=d[0].mac+"")&&J(i,n),(!h||g[0]&1)&&m!==(m=(d[0].meter.id?d[0].meter.id:"missing, required")+"")&&J(f,m),d[0].mac&&d[0].meter.id?v?(v.p(d,g),g[0]&1&&I(v,1)):(v=mf(d),v.c(),I(v,1),v.m(_.parentNode,_)):v&&(Ae(),q(v,1,1,()=>{v=null}),Pe())},i(d){h||(I(v),h=!0)},o(d){q(v),h=!1},d(d){d&&$(e),d&&$(o),d&&$(u),d&&$(p),v&&v.d(d),d&&$(_)}}}function mf(t){let e,l,n;return l=new __({props:{value:'{"mac":"'+t[0].mac+'","meter":"'+t[0].meter.id+'"}'}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","pl-2")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o[0]&1&&(u.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(u)},i(i){n||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function _f(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y,P,M,E;o=new Lt({});let R={length:9},O=[];for(let F=0;F20&&hf(t),_=t[3].i.d.d>0&&kf(t),h=t[0].chip=="esp8266"&&wf(t);return{c(){e=c("div"),l=c("strong"),l.textContent="Hardware",n=b(),i=c("a"),re(o.$$.fragment),u=b(),p&&p.c(),a=b(),_&&_.c(),m=b(),h&&h.c(),r(l,"class","text-sm"),r(i,"href",Rt("GPIO-configuration")),r(i,"target","_blank"),r(i,"class","float-right"),r(e,"class","cnt")},m(v,d){S(v,e,d),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),p&&p.m(e,null),s(e,a),_&&_.m(e,null),s(e,m),h&&h.m(e,null),f=!0},p(v,d){v[0].board>20?p?(p.p(v,d),d[0]&1&&I(p,1)):(p=hf(v),p.c(),I(p,1),p.m(e,a)):p&&(Ae(),q(p,1,1,()=>{p=null}),Pe()),v[3].i.d.d>0?_?_.p(v,d):(_=kf(v),_.c(),_.m(e,m)):_&&(_.d(1),_=null),v[0].chip=="esp8266"?h?h.p(v,d):(h=wf(v),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i(v){f||(I(o.$$.fragment,v),I(p),f=!0)},o(v){q(o.$$.fragment,v),q(p),f=!1},d(v){v&&$(e),se(o),p&&p.d(),_&&_.d(),h&&h.d()}}}function hf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y,P,M,E,R,O,F,w,D,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Ie,Se,ye,ve,Te,be,T,C,k,A,L,Z,le,fe,de,Ce,Oe,ue,Me,Je,It,st,wt,nt,Ot,Qe,Xt,zt,vt,xe,Ge,Ye,Ne,Ze,et;f=new io({props:{chip:t[0].chip}}),y=new io({props:{chip:t[0].chip}});let qe=t[0].chip!="esp8266"&&bf(t),Fe=t[3].i.v.p>0&&gf(t);return{c(){e=c("input"),l=b(),n=c("div"),i=c("div"),o=N("HAN RX"),u=c("br"),a=b(),m=c("select"),re(f.$$.fragment),p=b(),_=c("div"),h=N("HAN TX"),v=c("br"),d=b(),g=c("select"),re(y.$$.fragment),P=b(),M=c("div"),E=c("label"),R=c("input"),O=N(" pullup"),F=b(),w=c("div"),D=c("div"),ne=N("AP button"),H=c("br"),z=b(),U=c("input"),K=b(),Q=c("div"),G=N("LED"),X=c("br"),Y=b(),j=c("div"),x=c("input"),ae=b(),ee=c("div"),V=c("label"),W=c("input"),we=N(" inverted"),He=b(),Ie=c("div"),Se=N("RGB"),ye=c("label"),ve=c("input"),Te=N(" inverted"),be=c("br"),T=b(),C=c("div"),k=c("input"),A=b(),L=c("input"),Z=b(),le=c("input"),fe=b(),de=c("div"),Ce=c("div"),Oe=N(`LED dis. GPIO + `),ue=c("input"),Me=b(),Je=c("div"),It=N("Temperature"),st=c("br"),wt=b(),nt=c("input"),Ot=b(),Qe=c("div"),Xt=N("Analog temp"),zt=c("br"),vt=b(),xe=c("input"),Ge=b(),qe&&qe.c(),Ye=b(),Fe&&Fe.c(),r(e,"type","hidden"),r(e,"name","i"),e.value="true",r(m,"name","ihp"),r(m,"class","in-f w-full"),t[3].i.h.p===void 0&&We(()=>t[78].call(m)),r(i,"class","w-1/3"),r(g,"name","iht"),r(g,"class","in-l w-full"),t[3].i.h.t===void 0&&We(()=>t[79].call(g)),r(_,"class","w-1/3"),r(R,"name","ihu"),R.__value="true",R.value=R.__value,r(R,"type","checkbox"),r(R,"class","rounded mb-1"),r(E,"class","ml-2"),r(M,"class","w-1/3"),r(n,"class","flex flex-wrap"),r(U,"name","ia"),r(U,"type","number"),r(U,"min","0"),r(U,"max",t[6]),r(U,"class","in-f tr w-full"),r(D,"class","w-1/3"),r(x,"name","ilp"),r(x,"type","number"),r(x,"min","0"),r(x,"max",t[6]),r(x,"class","in-l tr w-full"),r(j,"class","flex"),r(Q,"class","w-1/3"),r(W,"name","ili"),W.__value="true",W.value=W.__value,r(W,"type","checkbox"),r(W,"class","rounded mb-1"),r(V,"class","ml-4"),r(ee,"class","w-1/3"),r(ve,"name","iri"),ve.__value="true",ve.value=ve.__value,r(ve,"type","checkbox"),r(ve,"class","rounded mb-1"),r(ye,"class","ml-4"),r(k,"name","irr"),r(k,"type","number"),r(k,"min","0"),r(k,"max",t[6]),r(k,"class","in-f tr w-1/3"),r(L,"name","irg"),r(L,"type","number"),r(L,"min","0"),r(L,"max",t[6]),r(L,"class","in-m tr w-1/3"),r(le,"name","irb"),r(le,"type","number"),r(le,"min","0"),r(le,"max",t[6]),r(le,"class","in-l tr w-1/3"),r(C,"class","flex"),r(Ie,"class","w-full"),r(ue,"name","idd"),r(ue,"type","number"),r(ue,"min","0"),r(ue,"max",t[6]),r(ue,"class","in-s tr"),r(Ce,"class","my-1 pr-1 w-1/3"),r(de,"class","w-full"),r(nt,"name","itd"),r(nt,"type","number"),r(nt,"min","0"),r(nt,"max",t[6]),r(nt,"class","in-f tr w-full"),r(Je,"class","my-1 w-1/3"),r(xe,"name","ita"),r(xe,"type","number"),r(xe,"min","0"),r(xe,"max",t[6]),r(xe,"class","in-l tr w-full"),r(Qe,"class","my-1 pr-1 w-1/3"),r(w,"class","flex flex-wrap")},m(_e,ce){S(_e,e,ce),S(_e,l,ce),S(_e,n,ce),s(n,i),s(i,o),s(i,u),s(i,a),s(i,m),ie(f,m,null),$e(m,t[3].i.h.p,!0),s(n,p),s(n,_),s(_,h),s(_,v),s(_,d),s(_,g),ie(y,g,null),$e(g,t[3].i.h.t,!0),s(n,P),s(n,M),s(M,E),s(E,R),R.checked=t[3].i.h.u,s(E,O),S(_e,F,ce),S(_e,w,ce),s(w,D),s(D,ne),s(D,H),s(D,z),s(D,U),oe(U,t[3].i.a),s(w,K),s(w,Q),s(Q,G),s(Q,X),s(Q,Y),s(Q,j),s(j,x),oe(x,t[3].i.l.p),s(w,ae),s(w,ee),s(ee,V),s(V,W),W.checked=t[3].i.l.i,s(V,we),s(w,He),s(w,Ie),s(Ie,Se),s(Ie,ye),s(ye,ve),ve.checked=t[3].i.r.i,s(ye,Te),s(Ie,be),s(Ie,T),s(Ie,C),s(C,k),oe(k,t[3].i.r.r),s(C,A),s(C,L),oe(L,t[3].i.r.g),s(C,Z),s(C,le),oe(le,t[3].i.r.b),s(w,fe),s(w,de),s(de,Ce),s(Ce,Oe),s(Ce,ue),oe(ue,t[3].i.d.d),s(w,Me),s(w,Je),s(Je,It),s(Je,st),s(Je,wt),s(Je,nt),oe(nt,t[3].i.t.d),s(w,Ot),s(w,Qe),s(Qe,Xt),s(Qe,zt),s(Qe,vt),s(Qe,xe),oe(xe,t[3].i.t.a),s(w,Ge),qe&&qe.m(w,null),s(w,Ye),Fe&&Fe.m(w,null),Ne=!0,Ze||(et=[te(m,"change",t[78]),te(g,"change",t[79]),te(R,"change",t[80]),te(U,"input",t[81]),te(x,"input",t[82]),te(W,"change",t[83]),te(ve,"change",t[84]),te(k,"input",t[85]),te(L,"input",t[86]),te(le,"input",t[87]),te(ue,"input",t[88]),te(nt,"input",t[89]),te(xe,"input",t[90])],Ze=!0)},p(_e,ce){const Be={};ce[0]&1&&(Be.chip=_e[0].chip),f.$set(Be),ce[0]&8&&$e(m,_e[3].i.h.p);const pt={};ce[0]&1&&(pt.chip=_e[0].chip),y.$set(pt),ce[0]&8&&$e(g,_e[3].i.h.t),ce[0]&8&&(R.checked=_e[3].i.h.u),(!Ne||ce[0]&64)&&r(U,"max",_e[6]),ce[0]&8&&ge(U.value)!==_e[3].i.a&&oe(U,_e[3].i.a),(!Ne||ce[0]&64)&&r(x,"max",_e[6]),ce[0]&8&&ge(x.value)!==_e[3].i.l.p&&oe(x,_e[3].i.l.p),ce[0]&8&&(W.checked=_e[3].i.l.i),ce[0]&8&&(ve.checked=_e[3].i.r.i),(!Ne||ce[0]&64)&&r(k,"max",_e[6]),ce[0]&8&&ge(k.value)!==_e[3].i.r.r&&oe(k,_e[3].i.r.r),(!Ne||ce[0]&64)&&r(L,"max",_e[6]),ce[0]&8&&ge(L.value)!==_e[3].i.r.g&&oe(L,_e[3].i.r.g),(!Ne||ce[0]&64)&&r(le,"max",_e[6]),ce[0]&8&&ge(le.value)!==_e[3].i.r.b&&oe(le,_e[3].i.r.b),(!Ne||ce[0]&64)&&r(ue,"max",_e[6]),ce[0]&8&&ge(ue.value)!==_e[3].i.d.d&&oe(ue,_e[3].i.d.d),(!Ne||ce[0]&64)&&r(nt,"max",_e[6]),ce[0]&8&&ge(nt.value)!==_e[3].i.t.d&&oe(nt,_e[3].i.t.d),(!Ne||ce[0]&64)&&r(xe,"max",_e[6]),ce[0]&8&&ge(xe.value)!==_e[3].i.t.a&&oe(xe,_e[3].i.t.a),_e[0].chip!="esp8266"?qe?qe.p(_e,ce):(qe=bf(_e),qe.c(),qe.m(w,Ye)):qe&&(qe.d(1),qe=null),_e[3].i.v.p>0?Fe?Fe.p(_e,ce):(Fe=gf(_e),Fe.c(),Fe.m(w,null)):Fe&&(Fe.d(1),Fe=null)},i(_e){Ne||(I(f.$$.fragment,_e),I(y.$$.fragment,_e),Ne=!0)},o(_e){q(f.$$.fragment,_e),q(y.$$.fragment,_e),Ne=!1},d(_e){_e&&$(e),_e&&$(l),_e&&$(n),se(f),se(y),_e&&$(F),_e&&$(w),qe&&qe.d(),Fe&&Fe.d(),Ze=!1,ze(et)}}}function bf(t){let e,l,n,i,o,u,a;return{c(){e=c("div"),l=N("Vcc"),n=c("br"),i=b(),o=c("input"),r(o,"name","ivp"),r(o,"type","number"),r(o,"min","0"),r(o,"max",t[6]),r(o,"class","in-s tr w-full"),r(e,"class","my-1 pl-1 w-1/3")},m(m,f){S(m,e,f),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].i.v.p),u||(a=te(o,"input",t[91]),u=!0)},p(m,f){f[0]&64&&r(o,"max",m[6]),f[0]&8&&ge(o.value)!==m[3].i.v.p&&oe(o,m[3].i.v.p)},d(m){m&&$(e),u=!1,a()}}}function gf(t){let e,l,n,i,o,u,a,m,f,p;return{c(){e=c("div"),l=N("Voltage divider"),n=c("br"),i=b(),o=c("div"),u=c("input"),a=b(),m=c("input"),r(u,"name","ivdv"),r(u,"type","number"),r(u,"min","0"),r(u,"max","65535"),r(u,"class","in-f tr w-full"),r(u,"placeholder","VCC"),r(m,"name","ivdg"),r(m,"type","number"),r(m,"min","0"),r(m,"max","65535"),r(m,"class","in-l tr w-full"),r(m,"placeholder","GND"),r(o,"class","flex"),r(e,"class","my-1")},m(_,h){S(_,e,h),s(e,l),s(e,n),s(e,i),s(e,o),s(o,u),oe(u,t[3].i.v.d.v),s(o,a),s(o,m),oe(m,t[3].i.v.d.g),f||(p=[te(u,"input",t[92]),te(m,"input",t[93])],f=!0)},p(_,h){h[0]&8&&ge(u.value)!==_[3].i.v.d.v&&oe(u,_[3].i.v.d.v),h[0]&8&&ge(m.value)!==_[3].i.v.d.g&&oe(m,_[3].i.v.d.g)},d(_){_&&$(e),f=!1,ze(p)}}}function kf(t){let e,l,n,i,o,u,a;return{c(){e=c("div"),l=N(`LED behaviour + `),n=c("select"),i=c("option"),i.textContent="Enabled",o=c("option"),o.textContent="Disabled",i.__value=0,i.value=i.__value,o.__value=1,o.value=o.__value,r(n,"name","idb"),r(n,"class","in-s"),t[3].i.d.b===void 0&&We(()=>t[94].call(n)),r(e,"class","my-1 w-full")},m(m,f){S(m,e,f),s(e,l),s(e,n),s(n,i),s(n,o),$e(n,t[3].i.d.b,!0),u||(a=te(n,"change",t[94]),u=!0)},p(m,f){f[0]&8&&$e(n,m[3].i.d.b)},d(m){m&&$(e),u=!1,a()}}}function wf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y,P,M=(t[0].board==2||t[0].board==100)&&yf(t);return{c(){e=c("input"),l=b(),n=c("div"),i=c("div"),o=N("Vcc offset"),u=c("br"),a=b(),m=c("input"),f=b(),p=c("div"),_=N("Multiplier"),h=c("br"),v=b(),d=c("input"),g=b(),M&&M.c(),r(e,"type","hidden"),r(e,"name","iv"),e.value="true",r(m,"name","ivo"),r(m,"type","number"),r(m,"min","0.0"),r(m,"max","3.5"),r(m,"step","0.01"),r(m,"class","in-f tr w-full"),r(i,"class","w-1/3"),r(d,"name","ivm"),r(d,"type","number"),r(d,"min","0.1"),r(d,"max","10"),r(d,"step","0.01"),r(d,"class","in-l tr w-full"),r(p,"class","w-1/3 pr-1"),r(n,"class","my-1 flex flex-wrap")},m(E,R){S(E,e,R),S(E,l,R),S(E,n,R),s(n,i),s(i,o),s(i,u),s(i,a),s(i,m),oe(m,t[3].i.v.o),s(n,f),s(n,p),s(p,_),s(p,h),s(p,v),s(p,d),oe(d,t[3].i.v.m),s(n,g),M&&M.m(n,null),y||(P=[te(m,"input",t[95]),te(d,"input",t[96])],y=!0)},p(E,R){R[0]&8&&ge(m.value)!==E[3].i.v.o&&oe(m,E[3].i.v.o),R[0]&8&&ge(d.value)!==E[3].i.v.m&&oe(d,E[3].i.v.m),E[0].board==2||E[0].board==100?M?M.p(E,R):(M=yf(E),M.c(),M.m(n,null)):M&&(M.d(1),M=null)},d(E){E&&$(e),E&&$(l),E&&$(n),M&&M.d(),y=!1,ze(P)}}}function yf(t){let e,l,n,i,o,u,a;return{c(){e=c("div"),l=N("Boot limit"),n=c("br"),i=b(),o=c("input"),r(o,"name","ivb"),r(o,"type","number"),r(o,"min","2.5"),r(o,"max","3.5"),r(o,"step","0.1"),r(o,"class","in-s tr w-full"),r(e,"class","w-1/3 pl-1")},m(m,f){S(m,e,f),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].i.v.b),u||(a=te(o,"input",t[97]),u=!0)},p(m,f){f[0]&8&&ge(o.value)!==m[3].i.v.b&&oe(o,m[3].i.v.b)},d(m){m&&$(e),u=!1,a()}}}function Cf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y,P=t[3].d.t&&$f();return{c(){e=c("div"),e.textContent="Debug can cause sudden reboots. Do not leave on!",l=b(),n=c("div"),i=c("label"),o=c("input"),u=N(" Enable telnet"),a=b(),P&&P.c(),m=b(),f=c("div"),p=c("select"),_=c("option"),_.textContent="Verbose",h=c("option"),h.textContent="Debug",v=c("option"),v.textContent="Info",d=c("option"),d.textContent="Warning",r(e,"class","bd-red"),r(o,"type","checkbox"),r(o,"name","dt"),o.__value="true",o.value=o.__value,r(o,"class","rounded mb-1"),r(n,"class","my-1"),_.__value=1,_.value=_.__value,h.__value=2,h.value=h.__value,v.__value=3,v.value=v.__value,d.__value=4,d.value=d.__value,r(p,"name","dl"),r(p,"class","in-s"),t[3].d.l===void 0&&We(()=>t[100].call(p)),r(f,"class","my-1")},m(M,E){S(M,e,E),S(M,l,E),S(M,n,E),s(n,i),s(i,o),o.checked=t[3].d.t,s(i,u),S(M,a,E),P&&P.m(M,E),S(M,m,E),S(M,f,E),s(f,p),s(p,_),s(p,h),s(p,v),s(p,d),$e(p,t[3].d.l,!0),g||(y=[te(o,"change",t[99]),te(p,"change",t[100])],g=!0)},p(M,E){E[0]&8&&(o.checked=M[3].d.t),M[3].d.t?P||(P=$f(),P.c(),P.m(m.parentNode,m)):P&&(P.d(1),P=null),E[0]&8&&$e(p,M[3].d.l)},d(M){M&&$(e),M&&$(l),M&&$(n),M&&$(a),P&&P.d(M),M&&$(m),M&&$(f),g=!1,ze(y)}}}function $f(t){let e;return{c(){e=c("div"),e.textContent="Telnet is unsafe and should be off when not in use",r(e,"class","bd-red")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function P_(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y,P,M,E,R,O,F,w,D,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Ie,Se,ye,ve,Te,be,T,C,k,A,L,Z,le,fe,de,Ce,Oe,ue,Me,Je,It,st,wt,nt,Ot,Qe,Xt,zt,vt,xe,Ge,Ye,Ne,Ze,et,qe,Fe,_e,ce,Be,pt,Tl,Nl,El,Mi,Ti,je,_n,Ni,Al,Pl,Ei,Hl,Ai,Wl,Pi,hl,Di,Li,Ri,Gt,Dl,Ve,yt,ht,si,Ii,bl,Oi,zl,Zt,$o,So,Ll,rl,Rl,Mo,Fi,To,bt,Il,No,qi,pn,dn,vn,hn,Bi,Eo,Ft,Ui,Ao,Gl,Po,Do,Lo,al,bn,gn,Ro,kn,Vl,Io,Oo,Fo,wn,Jt,qo,ji,Bo,Kl,Uo,jo,Ho,yn,xt,Wo,Hi,zo,ks,Go,Yl,Wi,el,Vo,Ko,Yo,ws,zi,tl,Qo,Xo,Zo,qt,Gi,Jo,Cn,$n,xo,oi,er,Ql,tr,lr,nr,Vt,Sn,Mn,ir,sr,mt,Vi,or,Tn,Nn,rr,Xl,ar,ur,fr,Ol,ul,En,An,cr,Bt,Ki,Yi,mr,Ut,Pn,Qi,Xi,_r,ys,Zi,Ji,ll,pr,dr,ri,vr,Fl,hr,ai,nl,br,gr,kr,xi,gl,wr,lt,es,yr,Dn,Ln,Cr,ui,$r,fl,Sr,Cs,Mr,Tr,Rn,kl,Nr,il,Er,$s,Zl,Ar,Pr,Dr,wl,Lr,Jl,Rr,Ir,Or,yl,Fr,In,On,qr,Br,Ur,Cl,jr,Fn,Hr,Wr,zr,Ct,qn,Bn,Un,jn,Hn,Wn,Gr,xl,Vr,Kr,Yr,$l,Qr,Ss,Ms,Ts,Ns=t[3].p.r.startsWith("10YNO")||t[3].p.r.startsWith("10Y1001A1001A4"),Es,cl,ts,Xr,zn,Gn,Zr,fi,Jr,ci,xr,As,jt,ls,ea,Vn,Kn,ta,mi,la,ns,is,sl,na,ia,sa,ql,Ps,Yn,oa,ss,Qn,ra,os,Ds,en,Ls,tn,Rs,ln,Is,nn,Kt,Os,aa;a=new Lt({}),D=new o_({});let n1=["NOK","SEK","DKK","EUR","CHF"],_i=[];for(let B=0;B<5;B+=1)_i[B]=v_(d_(t,n1,B));vt=new Qt({props:{to:"/priceconfig",class:"text-blue-600 hover:text-blue-800",$$slots:{default:[h_]},$$scope:{ctx:t}}});let $t=t[3].p.e&&t[0].chip!="esp8266"&&Zu(t),St=t[3].g.s>0&&Ju(t);Pl=new Lt({});let i1=[24,48,96,192,384,576,1152],pi=[];for(let B=0;B<7;B+=1)pi[B]=b_(p_(t,i1,B));let Mt=t[3].m.e.e&&xu(t),Tt=t[3].m.e.e&&ef(t),Nt=t[3].m.m.e&&tf(t);$n=new Lt({});let Ht=t[0].if&&t[0].if.eth&&lf(),Et=(t[3].n.c==1||t[3].n.c==2)&&nf(t);Nn=new Lt({}),Pn=new t1({});let At=t[3].n.m=="static"&&sf(t);Ln=new Lt({});let Pt=t[0].chip!="esp8266"&&of(t),ot=t[3].q.s.e&&rf(t),rt=t[3].q.m==3&&af(t),at=t[3].q.m==4&&uf(t),ut=t[3].c.es!=null&&ff(t),ft=Ns&&_f(t);Gn=new Lt({});let Xn=t[7],gt=[];for(let B=0;B20||t[0].chip=="esp8266"||t[3].i.d.d>0)&&vf(t);Kn=new Lt({});let Dt=t[3].d.s&&Cf(t);return en=new kt({props:{active:t[1],message:"Loading configuration"}}),tn=new kt({props:{active:t[2],message:"Saving configuration"}}),ln=new kt({props:{active:t[4],message:"Performing factory reset"}}),nn=new kt({props:{active:t[5],message:"Device have been factory reset and switched to AP mode"}}),{c(){e=c("form"),l=c("div"),n=c("div"),i=c("strong"),i.textContent="General",o=b(),u=c("a"),re(a.$$.fragment),m=b(),f=c("input"),p=b(),_=c("div"),h=c("div"),v=c("div"),d=N("Hostname"),g=c("br"),y=b(),P=c("input"),M=b(),E=c("div"),R=N("Time zone"),O=c("br"),F=b(),w=c("select"),re(D.$$.fragment),ne=b(),H=c("input"),z=b(),U=c("div"),K=c("div"),Q=c("div"),G=N("Price region"),X=c("br"),Y=b(),j=c("select"),x=c("optgroup"),ae=c("option"),ae.textContent="NO1",ee=c("option"),ee.textContent="NO2",V=c("option"),V.textContent="NO3",W=c("option"),W.textContent="NO4",we=c("option"),we.textContent="NO5",He=c("optgroup"),Ie=c("option"),Ie.textContent="SE1",Se=c("option"),Se.textContent="SE2",ye=c("option"),ye.textContent="SE3",ve=c("option"),ve.textContent="SE4",Te=c("optgroup"),be=c("option"),be.textContent="DK1",T=c("option"),T.textContent="DK2",C=c("option"),C.textContent="Austria",k=c("option"),k.textContent="Belgium",A=c("option"),A.textContent="Czech Republic",L=c("option"),L.textContent="Estonia",Z=c("option"),Z.textContent="Finland",le=c("option"),le.textContent="France",fe=c("option"),fe.textContent="Germany",de=c("option"),de.textContent="Great Britain",Ce=c("option"),Ce.textContent="Latvia",Oe=c("option"),Oe.textContent="Lithuania",ue=c("option"),ue.textContent="Netherland",Me=c("option"),Me.textContent="Poland",Je=c("option"),Je.textContent="Switzerland",It=b(),st=c("div"),wt=N("Currency"),nt=c("br"),Ot=b(),Qe=c("select");for(let B=0;B<5;B+=1)_i[B].c();Xt=b(),zt=c("div"),re(vt.$$.fragment),xe=b(),Ge=c("div"),Ye=c("label"),Ne=c("input"),Ze=N(" Enable price fetch from remote server"),et=b(),$t&&$t.c(),qe=b(),Fe=c("div"),_e=N("Security"),ce=c("br"),Be=b(),pt=c("select"),Tl=c("option"),Tl.textContent="None",Nl=c("option"),Nl.textContent="Only configuration",El=c("option"),El.textContent="Everything",Mi=b(),St&&St.c(),Ti=b(),je=c("div"),_n=c("strong"),_n.textContent="Meter",Ni=b(),Al=c("a"),re(Pl.$$.fragment),Ei=b(),Hl=c("input"),Ai=b(),Wl=c("input"),Pi=b(),hl=c("div"),Di=N("Communication"),Li=c("br"),Ri=b(),Gt=c("select"),Dl=c("option"),Dl.textContent="Passive (Push)",Ve=c("option"),Ve.textContent="Kamstrup (Pull)",yt=b(),ht=c("div"),si=c("span"),si.textContent="Buffer size",Ii=b(),bl=c("span"),bl.textContent="Serial conf.",Oi=b(),zl=c("label"),Zt=c("input"),$o=N(" inverted"),So=b(),Ll=c("div"),rl=c("select"),Rl=c("option"),Mo=N("Autodetect");for(let B=0;B<7;B+=1)pi[B].c();To=b(),bt=c("select"),Il=c("option"),No=N("-"),pn=c("option"),pn.textContent="7N1",dn=c("option"),dn.textContent="8N1",vn=c("option"),vn.textContent="7E1",hn=c("option"),hn.textContent="8E1",Eo=b(),Ft=c("input"),Ao=b(),Gl=c("div"),Po=N("Voltage"),Do=c("br"),Lo=b(),al=c("select"),bn=c("option"),bn.textContent="400V (TN)",gn=c("option"),gn.textContent="230V (IT/TT)",Ro=b(),kn=c("div"),Vl=c("div"),Io=N("Main fuse"),Oo=c("br"),Fo=b(),wn=c("label"),Jt=c("input"),qo=b(),ji=c("span"),ji.textContent="A",Bo=b(),Kl=c("div"),Uo=N("Production"),jo=c("br"),Ho=b(),yn=c("label"),xt=c("input"),Wo=b(),Hi=c("span"),Hi.textContent="kWp",zo=b(),ks=c("div"),Go=b(),Yl=c("div"),Wi=c("label"),el=c("input"),Vo=N(" Meter is encrypted"),Ko=b(),Mt&&Mt.c(),Yo=b(),Tt&&Tt.c(),ws=b(),zi=c("label"),tl=c("input"),Qo=N(" Multipliers"),Xo=b(),Nt&&Nt.c(),Zo=b(),qt=c("div"),Gi=c("strong"),Gi.textContent="Connection",Jo=b(),Cn=c("a"),re($n.$$.fragment),xo=b(),oi=c("input"),er=b(),Ql=c("div"),tr=N("Connection"),lr=c("br"),nr=b(),Vt=c("select"),Sn=c("option"),Sn.textContent="WiFi",Mn=c("option"),Mn.textContent="Access point",Ht&&Ht.c(),ir=b(),Et&&Et.c(),sr=b(),mt=c("div"),Vi=c("strong"),Vi.textContent="Network",or=b(),Tn=c("a"),re(Nn.$$.fragment),rr=b(),Xl=c("div"),ar=N("IP"),ur=c("br"),fr=b(),Ol=c("div"),ul=c("select"),En=c("option"),En.textContent="DHCP",An=c("option"),An.textContent="Static",cr=b(),Bt=c("input"),mr=b(),Ut=c("select"),re(Pn.$$.fragment),_r=b(),At&&At.c(),ys=b(),Zi=c("div"),Ji=c("label"),ll=c("input"),pr=N(" enable mDNS"),dr=b(),ri=c("input"),vr=b(),Fl=c("div"),hr=N("NTP "),ai=c("label"),nl=c("input"),br=N(" obtain from DHCP"),gr=c("br"),kr=b(),xi=c("div"),gl=c("input"),wr=b(),lt=c("div"),es=c("strong"),es.textContent="MQTT",yr=b(),Dn=c("a"),re(Ln.$$.fragment),Cr=b(),ui=c("input"),$r=b(),fl=c("div"),Sr=N(`Server + `),Pt&&Pt.c(),Cs=b(),Mr=c("br"),Tr=b(),Rn=c("div"),kl=c("input"),Nr=b(),il=c("input"),Er=b(),ot&&ot.c(),$s=b(),Zl=c("div"),Ar=N("Username"),Pr=c("br"),Dr=b(),wl=c("input"),Lr=b(),Jl=c("div"),Rr=N("Password"),Ir=c("br"),Or=b(),yl=c("input"),Fr=b(),In=c("div"),On=c("div"),qr=N("Client ID"),Br=c("br"),Ur=b(),Cl=c("input"),jr=b(),Fn=c("div"),Hr=N("Payload"),Wr=c("br"),zr=b(),Ct=c("select"),qn=c("option"),qn.textContent="JSON",Bn=c("option"),Bn.textContent="Raw (minimal)",Un=c("option"),Un.textContent="Raw (full)",jn=c("option"),jn.textContent="Domoticz",Hn=c("option"),Hn.textContent="HomeAssistant",Wn=c("option"),Wn.textContent="HEX dump",Gr=b(),xl=c("div"),Vr=N("Publish topic"),Kr=c("br"),Yr=b(),$l=c("input"),Qr=b(),rt&&rt.c(),Ss=b(),at&&at.c(),Ms=b(),ut&&ut.c(),Ts=b(),ft&&ft.c(),Es=b(),cl=c("div"),ts=c("strong"),ts.textContent="User interface",Xr=b(),zn=c("a"),re(Gn.$$.fragment),Zr=b(),fi=c("input"),Jr=b(),ci=c("div");for(let B=0;BSave',Ds=b(),re(en.$$.fragment),Ls=b(),re(tn.$$.fragment),Rs=b(),re(ln.$$.fragment),Is=b(),re(nn.$$.fragment),r(i,"class","text-sm"),r(u,"href",Rt("General-configuration")),r(u,"target","_blank"),r(u,"class","float-right"),r(f,"type","hidden"),r(f,"name","g"),f.value="true",r(P,"name","gh"),r(P,"type","text"),r(P,"class","in-f w-full"),r(P,"pattern","[A-Za-z0-9-]+"),r(w,"name","gt"),r(w,"class","in-l w-full"),t[3].g.t===void 0&&We(()=>t[16].call(w)),r(h,"class","flex"),r(_,"class","my-1"),r(H,"type","hidden"),r(H,"name","p"),H.value="true",ae.__value="10YNO-1--------2",ae.value=ae.__value,ee.__value="10YNO-2--------T",ee.value=ee.__value,V.__value="10YNO-3--------J",V.value=V.__value,W.__value="10YNO-4--------9",W.value=W.__value,we.__value="10Y1001A1001A48H",we.value=we.__value,r(x,"label","Norway"),Ie.__value="10Y1001A1001A44P",Ie.value=Ie.__value,Se.__value="10Y1001A1001A45N",Se.value=Se.__value,ye.__value="10Y1001A1001A46L",ye.value=ye.__value,ve.__value="10Y1001A1001A47J",ve.value=ve.__value,r(He,"label","Sweden"),be.__value="10YDK-1--------W",be.value=be.__value,T.__value="10YDK-2--------M",T.value=T.__value,r(Te,"label","Denmark"),C.__value="10YAT-APG------L",C.value=C.__value,k.__value="10YBE----------2",k.value=k.__value,A.__value="10YCZ-CEPS-----N",A.value=A.__value,L.__value="10Y1001A1001A39I",L.value=L.__value,Z.__value="10YFI-1--------U",Z.value=Z.__value,le.__value="10YFR-RTE------C",le.value=le.__value,fe.__value="10Y1001A1001A83F",fe.value=fe.__value,de.__value="10YGB----------A",de.value=de.__value,Ce.__value="10YLV-1001A00074",Ce.value=Ce.__value,Oe.__value="10YLT-1001A0008Q",Oe.value=Oe.__value,ue.__value="10YNL----------L",ue.value=ue.__value,Me.__value="10YPL-AREA-----S",Me.value=Me.__value,Je.__value="10YCH-SWISSGRIDZ",Je.value=Je.__value,r(j,"name","pr"),r(j,"class","in-f w-full"),t[3].p.r===void 0&&We(()=>t[17].call(j)),r(Q,"class","w-full"),r(Qe,"name","pc"),r(Qe,"class","in-l"),t[3].p.c===void 0&&We(()=>t[18].call(Qe)),r(K,"class","flex"),r(U,"class","my-1"),r(zt,"class","my-1"),r(Ne,"type","checkbox"),r(Ne,"name","pe"),Ne.__value="true",Ne.value=Ne.__value,r(Ne,"class","rounded mb-1"),r(Ge,"class","my-1"),Tl.__value=0,Tl.value=Tl.__value,Nl.__value=1,Nl.value=Nl.__value,El.__value=2,El.value=El.__value,r(pt,"name","gs"),r(pt,"class","in-s"),t[3].g.s===void 0&&We(()=>t[21].call(pt)),r(Fe,"class","my-1"),r(n,"class","cnt"),r(_n,"class","text-sm"),r(Al,"href",Rt("Meter-configuration")),r(Al,"target","_blank"),r(Al,"class","float-right"),r(Hl,"type","hidden"),r(Hl,"name","m"),Hl.value="true",r(Wl,"type","hidden"),r(Wl,"name","mo"),Wl.value="1",Dl.__value=0,Dl.value=Dl.__value,Ve.__value=9,Ve.value=Ve.__value,r(Gt,"name","ma"),r(Gt,"class","in-s"),t[3].m.a===void 0&&We(()=>t[24].call(Gt)),r(hl,"class","my-1"),r(si,"class","float-right"),r(Zt,"name","mi"),Zt.__value="true",Zt.value=Zt.__value,r(Zt,"type","checkbox"),r(Zt,"class","rounded mb-1"),r(zl,"class","mt-2 ml-3 whitespace-nowrap"),Rl.__value=0,Rl.value=Rl.__value,Rl.disabled=Fi=t[3].m.b!=0,r(rl,"name","mb"),r(rl,"class","in-f tr w-1/2"),t[3].m.b===void 0&&We(()=>t[26].call(rl)),Il.__value=0,Il.value=Il.__value,Il.disabled=qi=t[3].m.b!=0,pn.__value=2,pn.value=pn.__value,dn.__value=3,dn.value=dn.__value,vn.__value=10,vn.value=vn.__value,hn.__value=11,hn.value=hn.__value,r(bt,"name","mp"),r(bt,"class","in-m"),bt.disabled=Bi=t[3].m.b==0,t[3].m.p===void 0&&We(()=>t[27].call(bt)),r(Ft,"name","ms"),r(Ft,"type","number"),r(Ft,"min",64),r(Ft,"max",Ui=t[0].chip=="esp8266"?t[3].i.h.p==3||t[3].i.h.p==113?512:128:4096),r(Ft,"step",64),r(Ft,"class","in-l tr w-1/2"),r(Ll,"class","flex w-full"),r(ht,"class","my-1"),bn.__value=2,bn.value=bn.__value,gn.__value=1,gn.value=gn.__value,r(al,"name","md"),r(al,"class","in-s"),t[3].m.d===void 0&&We(()=>t[29].call(al)),r(Gl,"class","my-1"),r(Jt,"name","mf"),r(Jt,"type","number"),r(Jt,"min","5"),r(Jt,"max","65535"),r(Jt,"class","in-f tr w-full"),r(ji,"class","in-post"),r(wn,"class","flex"),r(Vl,"class","mx-1"),r(xt,"name","mr"),r(xt,"type","number"),r(xt,"min","0"),r(xt,"max","65535"),r(xt,"class","in-f tr w-full"),r(Hi,"class","in-post"),r(yn,"class","flex"),r(Kl,"class","mx-1"),r(kn,"class","my-1 flex"),r(ks,"class","my-1"),r(el,"type","checkbox"),r(el,"name","me"),el.__value="true",el.value=el.__value,r(el,"class","rounded mb-1"),r(Yl,"class","my-1"),r(tl,"type","checkbox"),r(tl,"name","mm"),tl.__value="true",tl.value=tl.__value,r(tl,"class","rounded mb-1"),r(je,"class","cnt"),r(Gi,"class","text-sm"),r(Cn,"href",Rt("WiFi-configuration")),r(Cn,"target","_blank"),r(Cn,"class","float-right"),r(oi,"type","hidden"),r(oi,"name","w"),oi.value="true",Sn.__value=1,Sn.value=Sn.__value,Mn.__value=2,Mn.value=Mn.__value,r(Vt,"name","nc"),r(Vt,"class","in-s"),t[3].n.c===void 0&&We(()=>t[40].call(Vt)),r(Ql,"class","my-1"),r(qt,"class","cnt"),r(Vi,"class","text-sm"),r(Tn,"href",Rt("Network-configuration")),r(Tn,"target","_blank"),r(Tn,"class","float-right"),En.__value="dhcp",En.value=En.__value,An.__value="static",An.value=An.__value,r(ul,"name","nm"),r(ul,"class","in-f"),t[3].n.m===void 0&&We(()=>t[46].call(ul)),r(Bt,"name","ni"),r(Bt,"type","text"),r(Bt,"class","in-m w-full"),Bt.disabled=Ki=t[3].n.m=="dhcp",Bt.required=Yi=t[3].n.m=="static",r(Ut,"name","ns"),r(Ut,"class","in-l"),Ut.disabled=Qi=t[3].n.m=="dhcp",Ut.required=Xi=t[3].n.m=="static",t[3].n.s===void 0&&We(()=>t[48].call(Ut)),r(Ol,"class","flex"),r(Xl,"class","my-1"),r(ll,"name","nd"),ll.__value="true",ll.value=ll.__value,r(ll,"type","checkbox"),r(ll,"class","rounded mb-1"),r(Zi,"class","my-1"),r(ri,"type","hidden"),r(ri,"name","ntp"),ri.value="true",r(nl,"name","ntpd"),nl.__value="true",nl.value=nl.__value,r(nl,"type","checkbox"),r(nl,"class","rounded mb-1"),r(ai,"class","ml-4"),r(gl,"name","ntph"),r(gl,"type","text"),r(gl,"class","in-s"),r(xi,"class","flex"),r(Fl,"class","my-1"),r(mt,"class","cnt"),r(es,"class","text-sm"),r(Dn,"href",Rt("MQTT-configuration")),r(Dn,"target","_blank"),r(Dn,"class","float-right"),r(ui,"type","hidden"),r(ui,"name","q"),ui.value="true",r(kl,"name","qh"),r(kl,"type","text"),r(kl,"class","in-f w-3/4"),r(il,"name","qp"),r(il,"type","number"),r(il,"min","1024"),r(il,"max","65535"),r(il,"class","in-l tr w-1/4"),r(Rn,"class","flex"),r(fl,"class","my-1"),r(wl,"name","qu"),r(wl,"type","text"),r(wl,"class","in-s"),r(Zl,"class","my-1"),r(yl,"name","qa"),r(yl,"type","password"),r(yl,"class","in-s"),r(Jl,"class","my-1"),r(Cl,"name","qc"),r(Cl,"type","text"),r(Cl,"class","in-f w-full"),qn.__value=0,qn.value=qn.__value,Bn.__value=1,Bn.value=Bn.__value,Un.__value=2,Un.value=Un.__value,jn.__value=3,jn.value=jn.__value,Hn.__value=4,Hn.value=Hn.__value,Wn.__value=255,Wn.value=Wn.__value,r(Ct,"name","qm"),r(Ct,"class","in-l"),t[3].q.m===void 0&&We(()=>t[61].call(Ct)),r(In,"class","my-1 flex"),r($l,"name","qb"),r($l,"type","text"),r($l,"class","in-s"),r(xl,"class","my-1"),r(lt,"class","cnt"),r(ts,"class","text-sm"),r(zn,"href",Rt("User-interface")),r(zn,"target","_blank"),r(zn,"class","float-right"),r(fi,"type","hidden"),r(fi,"name","u"),fi.value="true",r(ci,"class","flex flex-wrap"),r(cl,"class","cnt"),r(ls,"class","text-sm"),r(Vn,"href","https://amsleser.no/blog/post/24-telnet-debug"),r(Vn,"target","_blank"),r(Vn,"class","float-right"),r(mi,"type","hidden"),r(mi,"name","d"),mi.value="true",r(sl,"type","checkbox"),r(sl,"name","ds"),sl.__value="true",sl.value=sl.__value,r(sl,"class","rounded mb-1"),r(ns,"class","mt-3"),r(jt,"class","cnt"),r(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),r(Yn,"type","button"),r(Yn,"class","btn-red"),r(Qn,"type","button"),r(Qn,"class","btn-yellow"),r(ss,"class","text-center"),r(os,"class","text-right"),r(ql,"class","grid grid-cols-3 mt-3"),r(e,"autocomplete","off")},m(B,me){S(B,e,me),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),ie(a,u,null),s(n,m),s(n,f),s(n,p),s(n,_),s(_,h),s(h,v),s(v,d),s(v,g),s(v,y),s(v,P),oe(P,t[3].g.h),s(h,M),s(h,E),s(E,R),s(E,O),s(E,F),s(E,w),ie(D,w,null),$e(w,t[3].g.t,!0),s(n,ne),s(n,H),s(n,z),s(n,U),s(U,K),s(K,Q),s(Q,G),s(Q,X),s(Q,Y),s(Q,j),s(j,x),s(x,ae),s(x,ee),s(x,V),s(x,W),s(x,we),s(j,He),s(He,Ie),s(He,Se),s(He,ye),s(He,ve),s(j,Te),s(Te,be),s(Te,T),s(j,C),s(j,k),s(j,A),s(j,L),s(j,Z),s(j,le),s(j,fe),s(j,de),s(j,Ce),s(j,Oe),s(j,ue),s(j,Me),s(j,Je),$e(j,t[3].p.r,!0),s(K,It),s(K,st),s(st,wt),s(st,nt),s(st,Ot),s(st,Qe);for(let _t=0;_t<5;_t+=1)_i[_t]&&_i[_t].m(Qe,null);$e(Qe,t[3].p.c,!0),s(n,Xt),s(n,zt),ie(vt,zt,null),s(n,xe),s(n,Ge),s(Ge,Ye),s(Ye,Ne),Ne.checked=t[3].p.e,s(Ye,Ze),s(Ge,et),$t&&$t.m(Ge,null),s(n,qe),s(n,Fe),s(Fe,_e),s(Fe,ce),s(Fe,Be),s(Fe,pt),s(pt,Tl),s(pt,Nl),s(pt,El),$e(pt,t[3].g.s,!0),s(n,Mi),St&&St.m(n,null),s(l,Ti),s(l,je),s(je,_n),s(je,Ni),s(je,Al),ie(Pl,Al,null),s(je,Ei),s(je,Hl),s(je,Ai),s(je,Wl),s(je,Pi),s(je,hl),s(hl,Di),s(hl,Li),s(hl,Ri),s(hl,Gt),s(Gt,Dl),s(Gt,Ve),$e(Gt,t[3].m.a,!0),s(je,yt),s(je,ht),s(ht,si),s(ht,Ii),s(ht,bl),s(ht,Oi),s(ht,zl),s(zl,Zt),Zt.checked=t[3].m.i,s(zl,$o),s(ht,So),s(ht,Ll),s(Ll,rl),s(rl,Rl),s(Rl,Mo);for(let _t=0;_t<7;_t+=1)pi[_t]&&pi[_t].m(rl,null);$e(rl,t[3].m.b,!0),s(Ll,To),s(Ll,bt),s(bt,Il),s(Il,No),s(bt,pn),s(bt,dn),s(bt,vn),s(bt,hn),$e(bt,t[3].m.p,!0),s(Ll,Eo),s(Ll,Ft),oe(Ft,t[3].m.s),s(je,Ao),s(je,Gl),s(Gl,Po),s(Gl,Do),s(Gl,Lo),s(Gl,al),s(al,bn),s(al,gn),$e(al,t[3].m.d,!0),s(je,Ro),s(je,kn),s(kn,Vl),s(Vl,Io),s(Vl,Oo),s(Vl,Fo),s(Vl,wn),s(wn,Jt),oe(Jt,t[3].m.f),s(wn,qo),s(wn,ji),s(kn,Bo),s(kn,Kl),s(Kl,Uo),s(Kl,jo),s(Kl,Ho),s(Kl,yn),s(yn,xt),oe(xt,t[3].m.r),s(yn,Wo),s(yn,Hi),s(je,zo),s(je,ks),s(je,Go),s(je,Yl),s(Yl,Wi),s(Wi,el),el.checked=t[3].m.e.e,s(Wi,Vo),s(Yl,Ko),Mt&&Mt.m(Yl,null),s(je,Yo),Tt&&Tt.m(je,null),s(je,ws),s(je,zi),s(zi,tl),tl.checked=t[3].m.m.e,s(zi,Qo),s(je,Xo),Nt&&Nt.m(je,null),s(l,Zo),s(l,qt),s(qt,Gi),s(qt,Jo),s(qt,Cn),ie($n,Cn,null),s(qt,xo),s(qt,oi),s(qt,er),s(qt,Ql),s(Ql,tr),s(Ql,lr),s(Ql,nr),s(Ql,Vt),s(Vt,Sn),s(Vt,Mn),Ht&&Ht.m(Vt,null),$e(Vt,t[3].n.c,!0),s(qt,ir),Et&&Et.m(qt,null),s(l,sr),s(l,mt),s(mt,Vi),s(mt,or),s(mt,Tn),ie(Nn,Tn,null),s(mt,rr),s(mt,Xl),s(Xl,ar),s(Xl,ur),s(Xl,fr),s(Xl,Ol),s(Ol,ul),s(ul,En),s(ul,An),$e(ul,t[3].n.m,!0),s(Ol,cr),s(Ol,Bt),oe(Bt,t[3].n.i),s(Ol,mr),s(Ol,Ut),ie(Pn,Ut,null),$e(Ut,t[3].n.s,!0),s(mt,_r),At&&At.m(mt,null),s(mt,ys),s(mt,Zi),s(Zi,Ji),s(Ji,ll),ll.checked=t[3].n.d,s(Ji,pr),s(mt,dr),s(mt,ri),s(mt,vr),s(mt,Fl),s(Fl,hr),s(Fl,ai),s(ai,nl),nl.checked=t[3].n.h,s(ai,br),s(Fl,gr),s(Fl,kr),s(Fl,xi),s(xi,gl),oe(gl,t[3].n.n1),s(l,wr),s(l,lt),s(lt,es),s(lt,yr),s(lt,Dn),ie(Ln,Dn,null),s(lt,Cr),s(lt,ui),s(lt,$r),s(lt,fl),s(fl,Sr),Pt&&Pt.m(fl,null),s(fl,Cs),s(fl,Mr),s(fl,Tr),s(fl,Rn),s(Rn,kl),oe(kl,t[3].q.h),s(Rn,Nr),s(Rn,il),oe(il,t[3].q.p),s(lt,Er),ot&&ot.m(lt,null),s(lt,$s),s(lt,Zl),s(Zl,Ar),s(Zl,Pr),s(Zl,Dr),s(Zl,wl),oe(wl,t[3].q.u),s(lt,Lr),s(lt,Jl),s(Jl,Rr),s(Jl,Ir),s(Jl,Or),s(Jl,yl),oe(yl,t[3].q.a),s(lt,Fr),s(lt,In),s(In,On),s(On,qr),s(On,Br),s(On,Ur),s(On,Cl),oe(Cl,t[3].q.c),s(In,jr),s(In,Fn),s(Fn,Hr),s(Fn,Wr),s(Fn,zr),s(Fn,Ct),s(Ct,qn),s(Ct,Bn),s(Ct,Un),s(Ct,jn),s(Ct,Hn),s(Ct,Wn),$e(Ct,t[3].q.m,!0),s(lt,Gr),s(lt,xl),s(xl,Vr),s(xl,Kr),s(xl,Yr),s(xl,$l),oe($l,t[3].q.b),s(l,Qr),rt&&rt.m(l,null),s(l,Ss),at&&at.m(l,null),s(l,Ms),ut&&ut.m(l,null),s(l,Ts),ft&&ft.m(l,null),s(l,Es),s(l,cl),s(cl,ts),s(cl,Xr),s(cl,zn),ie(Gn,zn,null),s(cl,Zr),s(cl,fi),s(cl,Jr),s(cl,ci);for(let _t=0;_t0?St?St.p(B,me):(St=Ju(B),St.c(),St.m(n,null)):St&&(St.d(1),St=null),me[0]&8&&$e(Gt,B[3].m.a),me[0]&8&&(Zt.checked=B[3].m.i),(!Kt||me[0]&8&&Fi!==(Fi=B[3].m.b!=0))&&(Rl.disabled=Fi),me[0]&8&&$e(rl,B[3].m.b),(!Kt||me[0]&8&&qi!==(qi=B[3].m.b!=0))&&(Il.disabled=qi),(!Kt||me[0]&8&&Bi!==(Bi=B[3].m.b==0))&&(bt.disabled=Bi),me[0]&8&&$e(bt,B[3].m.p),(!Kt||me[0]&9&&Ui!==(Ui=B[0].chip=="esp8266"?B[3].i.h.p==3||B[3].i.h.p==113?512:128:4096))&&r(Ft,"max",Ui),me[0]&8&&ge(Ft.value)!==B[3].m.s&&oe(Ft,B[3].m.s),me[0]&8&&$e(al,B[3].m.d),me[0]&8&&ge(Jt.value)!==B[3].m.f&&oe(Jt,B[3].m.f),me[0]&8&&ge(xt.value)!==B[3].m.r&&oe(xt,B[3].m.r),me[0]&8&&(el.checked=B[3].m.e.e),B[3].m.e.e?Mt?Mt.p(B,me):(Mt=xu(B),Mt.c(),Mt.m(Yl,null)):Mt&&(Mt.d(1),Mt=null),B[3].m.e.e?Tt?Tt.p(B,me):(Tt=ef(B),Tt.c(),Tt.m(je,ws)):Tt&&(Tt.d(1),Tt=null),me[0]&8&&(tl.checked=B[3].m.m.e),B[3].m.m.e?Nt?Nt.p(B,me):(Nt=tf(B),Nt.c(),Nt.m(je,null)):Nt&&(Nt.d(1),Nt=null),B[0].if&&B[0].if.eth?Ht||(Ht=lf(),Ht.c(),Ht.m(Vt,null)):Ht&&(Ht.d(1),Ht=null),me[0]&8&&$e(Vt,B[3].n.c),B[3].n.c==1||B[3].n.c==2?Et?Et.p(B,me):(Et=nf(B),Et.c(),Et.m(qt,null)):Et&&(Et.d(1),Et=null),me[0]&8&&$e(ul,B[3].n.m),(!Kt||me[0]&8&&Ki!==(Ki=B[3].n.m=="dhcp"))&&(Bt.disabled=Ki),(!Kt||me[0]&8&&Yi!==(Yi=B[3].n.m=="static"))&&(Bt.required=Yi),me[0]&8&&Bt.value!==B[3].n.i&&oe(Bt,B[3].n.i),(!Kt||me[0]&8&&Qi!==(Qi=B[3].n.m=="dhcp"))&&(Ut.disabled=Qi),(!Kt||me[0]&8&&Xi!==(Xi=B[3].n.m=="static"))&&(Ut.required=Xi),me[0]&8&&$e(Ut,B[3].n.s),B[3].n.m=="static"?At?At.p(B,me):(At=sf(B),At.c(),At.m(mt,ys)):At&&(At.d(1),At=null),me[0]&8&&(ll.checked=B[3].n.d),me[0]&8&&(nl.checked=B[3].n.h),me[0]&8&&gl.value!==B[3].n.n1&&oe(gl,B[3].n.n1),B[0].chip!="esp8266"?Pt?Pt.p(B,me):(Pt=of(B),Pt.c(),Pt.m(fl,Cs)):Pt&&(Pt.d(1),Pt=null),me[0]&8&&kl.value!==B[3].q.h&&oe(kl,B[3].q.h),me[0]&8&&ge(il.value)!==B[3].q.p&&oe(il,B[3].q.p),B[3].q.s.e?ot?(ot.p(B,me),me[0]&8&&I(ot,1)):(ot=rf(B),ot.c(),I(ot,1),ot.m(lt,$s)):ot&&(Ae(),q(ot,1,1,()=>{ot=null}),Pe()),me[0]&8&&wl.value!==B[3].q.u&&oe(wl,B[3].q.u),me[0]&8&&yl.value!==B[3].q.a&&oe(yl,B[3].q.a),me[0]&8&&Cl.value!==B[3].q.c&&oe(Cl,B[3].q.c),me[0]&8&&$e(Ct,B[3].q.m),me[0]&8&&$l.value!==B[3].q.b&&oe($l,B[3].q.b),B[3].q.m==3?rt?(rt.p(B,me),me[0]&8&&I(rt,1)):(rt=af(B),rt.c(),I(rt,1),rt.m(l,Ss)):rt&&(Ae(),q(rt,1,1,()=>{rt=null}),Pe()),B[3].q.m==4?at?(at.p(B,me),me[0]&8&&I(at,1)):(at=uf(B),at.c(),I(at,1),at.m(l,Ms)):at&&(Ae(),q(at,1,1,()=>{at=null}),Pe()),B[3].c.es!=null?ut?(ut.p(B,me),me[0]&8&&I(ut,1)):(ut=ff(B),ut.c(),I(ut,1),ut.m(l,Ts)):ut&&(Ae(),q(ut,1,1,()=>{ut=null}),Pe()),me[0]&8&&(Ns=B[3].p.r.startsWith("10YNO")||B[3].p.r.startsWith("10Y1001A1001A4")),Ns?ft?(ft.p(B,me),me[0]&8&&I(ft,1)):(ft=_f(B),ft.c(),I(ft,1),ft.m(l,Es)):ft&&(Ae(),q(ft,1,1,()=>{ft=null}),Pe()),me[0]&136){Xn=B[7];let Yt;for(Yt=0;Yt20||B[0].chip=="esp8266"||B[3].i.d.d>0?ct?(ct.p(B,me),me[0]&9&&I(ct,1)):(ct=vf(B),ct.c(),I(ct,1),ct.m(l,As)):ct&&(Ae(),q(ct,1,1,()=>{ct=null}),Pe()),me[0]&8&&(sl.checked=B[3].d.s),B[3].d.s?Dt?Dt.p(B,me):(Dt=Cf(B),Dt.c(),Dt.m(jt,null)):Dt&&(Dt.d(1),Dt=null);const ua={};me[0]&2&&(ua.active=B[1]),en.$set(ua);const fa={};me[0]&4&&(fa.active=B[2]),tn.$set(fa);const ca={};me[0]&16&&(ca.active=B[4]),ln.$set(ca);const ma={};me[0]&32&&(ma.active=B[5]),nn.$set(ma)},i(B){Kt||(I(a.$$.fragment,B),I(D.$$.fragment,B),I(vt.$$.fragment,B),I(Pl.$$.fragment,B),I($n.$$.fragment,B),I(Nn.$$.fragment,B),I(Pn.$$.fragment,B),I(Ln.$$.fragment,B),I(ot),I(rt),I(at),I(ut),I(ft),I(Gn.$$.fragment,B),I(ct),I(Kn.$$.fragment,B),I(en.$$.fragment,B),I(tn.$$.fragment,B),I(ln.$$.fragment,B),I(nn.$$.fragment,B),Kt=!0)},o(B){q(a.$$.fragment,B),q(D.$$.fragment,B),q(vt.$$.fragment,B),q(Pl.$$.fragment,B),q($n.$$.fragment,B),q(Nn.$$.fragment,B),q(Pn.$$.fragment,B),q(Ln.$$.fragment,B),q(ot),q(rt),q(at),q(ut),q(ft),q(Gn.$$.fragment,B),q(ct),q(Kn.$$.fragment,B),q(en.$$.fragment,B),q(tn.$$.fragment,B),q(ln.$$.fragment,B),q(nn.$$.fragment,B),Kt=!1},d(B){B&&$(e),se(a),se(D),dt(_i,B),se(vt),$t&&$t.d(),St&&St.d(),se(Pl),dt(pi,B),Mt&&Mt.d(),Tt&&Tt.d(),Nt&&Nt.d(),se($n),Ht&&Ht.d(),Et&&Et.d(),se(Nn),se(Pn),At&&At.d(),se(Ln),Pt&&Pt.d(),ot&&ot.d(),rt&&rt.d(),at&&at.d(),ut&&ut.d(),ft&&ft.d(),se(Gn),dt(gt,B),ct&&ct.d(),se(Kn),Dt&&Dt.d(),B&&$(Ds),se(en,B),B&&$(Ls),se(tn,B),B&&$(Rs),se(ln,B),B&&$(Is),se(nn,B),Os=!1,ze(aa)}}}async function D_(){await(await fetch("/reboot",{method:"POST"})).json()}function L_(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:"Realtime plot",key:"l"},{name:"Price",key:"p"},{name:"Day plot",key:"d"},{name:"Month plot",key:"m"},{name:"Temperature plot",key:"s"},{name:"Dark mode",key:"k"}],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},d:{d:null,b:0},t:{d:null,a:null},v:{p:null,d:{v:null,g:null},o:null,m:null,b:null}},h:{t:"",h:"",n:""},c:{e:!1,i:null,s:null,es:null}};hi.subscribe(Ve=>{Ve.version&&(l(3,a=Ve),l(1,o=!1))}),Xm();let m=!1,f=!1;async function p(){if(confirm("Are you sure you want to factory reset the device?")){l(4,m=!0);const Ve=new URLSearchParams;Ve.append("perform","true");let ht=await(await fetch("/reset",{method:"POST",body:Ve})).json();l(4,m=!1),l(5,f=ht.success)}}async function _(Ve){l(2,u=!0);const yt=new FormData(Ve.target),ht=new URLSearchParams;for(let bl of yt){const[Oi,zl]=bl;ht.append(Oi,zl)}let Ii=await(await fetch("/save",{method:"POST",body:ht})).json();Wt.update(bl=>(bl.booting=Ii.reboot,bl.ui=a.u,bl)),l(2,u=!1),fn("/")}const h=function(){confirm("Are you sure you want to reboot the device?")&&(Wt.update(Ve=>(Ve.booting=!0,Ve)),D_())};async function v(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("/mqtt-ca",{method:"POST"})).text(),hi.update(yt=>(yt.q.s.c=!1,yt)))}async function d(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("/mqtt-cert",{method:"POST"})).text(),hi.update(yt=>(yt.q.s.r=!1,yt)))}async function g(){confirm("Are you sure you want to delete key?")&&(await(await fetch("/mqtt-key",{method:"POST"})).text(),hi.update(yt=>(yt.q.s.k=!1,yt)))}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 P=44;function M(){a.g.h=this.value,l(3,a)}function E(){a.g.t=tt(this),l(3,a)}function R(){a.p.r=tt(this),l(3,a)}function O(){a.p.c=tt(this),l(3,a)}function F(){a.p.e=this.checked,l(3,a)}function w(){a.p.t=this.value,l(3,a)}function D(){a.g.s=tt(this),l(3,a)}function ne(){a.g.u=this.value,l(3,a)}function H(){a.g.p=this.value,l(3,a)}function z(){a.m.a=tt(this),l(3,a)}function U(){a.m.i=this.checked,l(3,a)}function K(){a.m.b=tt(this),l(3,a)}function Q(){a.m.p=tt(this),l(3,a)}function G(){a.m.s=ge(this.value),l(3,a)}function X(){a.m.d=tt(this),l(3,a)}function Y(){a.m.f=ge(this.value),l(3,a)}function j(){a.m.r=ge(this.value),l(3,a)}function x(){a.m.e.e=this.checked,l(3,a)}function ae(){a.m.e.k=this.value,l(3,a)}function ee(){a.m.e.a=this.value,l(3,a)}function V(){a.m.m.e=this.checked,l(3,a)}function W(){a.m.m.w=ge(this.value),l(3,a)}function we(){a.m.m.v=ge(this.value),l(3,a)}function He(){a.m.m.a=ge(this.value),l(3,a)}function Ie(){a.m.m.c=ge(this.value),l(3,a)}function Se(){a.n.c=tt(this),l(3,a)}function ye(){a.w.s=this.value,l(3,a)}function ve(){a.w.p=this.value,l(3,a)}function Te(){a.w.z=tt(this),l(3,a)}function be(){a.w.w=ge(this.value),l(3,a)}function T(){a.w.b=this.checked,l(3,a)}function C(){a.n.m=tt(this),l(3,a)}function k(){a.n.i=this.value,l(3,a)}function A(){a.n.s=tt(this),l(3,a)}function L(){a.n.g=this.value,l(3,a)}function Z(){a.n.d1=this.value,l(3,a)}function le(){a.n.d2=this.value,l(3,a)}function fe(){a.n.d=this.checked,l(3,a)}function de(){a.n.h=this.checked,l(3,a)}function Ce(){a.n.n1=this.value,l(3,a)}function Oe(){a.q.s.e=this.checked,l(3,a)}function ue(){a.q.h=this.value,l(3,a)}function Me(){a.q.p=ge(this.value),l(3,a)}function Je(){a.q.u=this.value,l(3,a)}function It(){a.q.a=this.value,l(3,a)}function st(){a.q.c=this.value,l(3,a)}function wt(){a.q.m=tt(this),l(3,a)}function nt(){a.q.b=this.value,l(3,a)}function Ot(){a.o.e=this.value,l(3,a)}function Qe(){a.o.c=this.value,l(3,a)}function Xt(){a.o.u1=this.value,l(3,a)}function zt(){a.o.u2=this.value,l(3,a)}function vt(){a.o.u3=this.value,l(3,a)}function xe(){a.h.t=this.value,l(3,a)}function Ge(){a.h.h=this.value,l(3,a)}function Ye(){a.h.n=this.value,l(3,a)}function Ne(){a.c.e=this.checked,l(3,a)}function Ze(){a.c.i=this.value,l(3,a)}function et(){a.c.s=this.value,l(3,a)}function qe(){a.c.es=this.checked,l(3,a)}function Fe(Ve){a.t.t[Ve]=ge(this.value),l(3,a)}function _e(){a.t.h=ge(this.value),l(3,a)}function ce(Ve){a.u[Ve.key]=tt(this),l(3,a)}function Be(){a.i.h.p=tt(this),l(3,a)}function pt(){a.i.h.t=tt(this),l(3,a)}function Tl(){a.i.h.u=this.checked,l(3,a)}function Nl(){a.i.a=ge(this.value),l(3,a)}function El(){a.i.l.p=ge(this.value),l(3,a)}function Mi(){a.i.l.i=this.checked,l(3,a)}function Ti(){a.i.r.i=this.checked,l(3,a)}function je(){a.i.r.r=ge(this.value),l(3,a)}function _n(){a.i.r.g=ge(this.value),l(3,a)}function Ni(){a.i.r.b=ge(this.value),l(3,a)}function Al(){a.i.d.d=ge(this.value),l(3,a)}function Pl(){a.i.t.d=ge(this.value),l(3,a)}function Ei(){a.i.t.a=ge(this.value),l(3,a)}function Hl(){a.i.v.p=ge(this.value),l(3,a)}function Ai(){a.i.v.d.v=ge(this.value),l(3,a)}function Wl(){a.i.v.d.g=ge(this.value),l(3,a)}function Pi(){a.i.d.b=tt(this),l(3,a)}function hl(){a.i.v.o=ge(this.value),l(3,a)}function Di(){a.i.v.m=ge(this.value),l(3,a)}function Li(){a.i.v.b=ge(this.value),l(3,a)}function Ri(){a.d.s=this.checked,l(3,a)}function Gt(){a.d.t=this.checked,l(3,a)}function Dl(){a.d.l=tt(this),l(3,a)}return t.$$set=Ve=>{"sysinfo"in Ve&&l(0,n=Ve.sysinfo)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(6,P=n.chip=="esp8266"?16:n.chip=="esp32s2"?44:39)},[n,o,u,a,m,f,P,i,p,_,h,v,d,g,y,M,E,R,O,F,w,D,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Ie,Se,ye,ve,Te,be,T,C,k,A,L,Z,le,fe,de,Ce,Oe,ue,Me,Je,It,st,wt,nt,Ot,Qe,Xt,zt,vt,xe,Ge,Ye,Ne,Ze,et,qe,Fe,_e,ce,Be,pt,Tl,Nl,El,Mi,Ti,je,_n,Ni,Al,Pl,Ei,Hl,Ai,Wl,Pi,hl,Di,Li,Ri,Gt,Dl]}class R_ extends Re{constructor(e){super(),Le(this,e,L_,P_,Ee,{sysinfo:0},null,[-1,-1,-1,-1])}}function Sf(t,e,l){const n=t.slice();return n[20]=e[l],n}function I_(t){let e=he(t[1].chip,t[1].board)+"",l;return{c(){l=N(e)},m(n,i){S(n,l,i)},p(n,i){i&2&&e!==(e=he(n[1].chip,n[1].board)+"")&&J(l,e)},d(n){n&&$(l)}}}function Mf(t){let e,l,n=t[1].apmac+"",i,o,u,a,m,f,p,_,h,v=Pa(t[1])+"",d,g,y=t[1].boot_reason+"",P,M,E=t[1].ex_cause+"",R,O,F;const w=[F_,O_],D=[];function ne(H,z){return H[0].u>0?0:1}return m=ne(t),f=D[m]=w[m](t),{c(){e=c("div"),l=N("AP MAC: "),i=N(n),o=b(),u=c("div"),a=N(`Last boot: + `),f.c(),p=b(),_=c("div"),h=N("Reason: "),d=N(v),g=N(" ("),P=N(y),M=N("/"),R=N(E),O=N(")"),r(e,"class","my-2"),r(u,"class","my-2"),r(_,"class","my-2")},m(H,z){S(H,e,z),s(e,l),s(e,i),S(H,o,z),S(H,u,z),s(u,a),D[m].m(u,null),S(H,p,z),S(H,_,z),s(_,h),s(_,d),s(_,g),s(_,P),s(_,M),s(_,R),s(_,O),F=!0},p(H,z){(!F||z&2)&&n!==(n=H[1].apmac+"")&&J(i,n);let U=m;m=ne(H),m===U?D[m].p(H,z):(Ae(),q(D[U],1,1,()=>{D[U]=null}),Pe(),f=D[m],f?f.p(H,z):(f=D[m]=w[m](H),f.c()),I(f,1),f.m(u,null)),(!F||z&2)&&v!==(v=Pa(H[1])+"")&&J(d,v),(!F||z&2)&&y!==(y=H[1].boot_reason+"")&&J(P,y),(!F||z&2)&&E!==(E=H[1].ex_cause+"")&&J(R,E)},i(H){F||(I(f),F=!0)},o(H){q(f),F=!1},d(H){H&&$(e),H&&$(o),H&&$(u),D[m].d(),H&&$(p),H&&$(_)}}}function O_(t){let e;return{c(){e=N("-")},m(l,n){S(l,e,n)},p:pe,i:pe,o:pe,d(l){l&&$(e)}}}function F_(t){let e,l;return e=new Zc({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:""}}),{c(){re(e.$$.fragment)},m(n,i){ie(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||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function q_(t){let e;return{c(){e=c("span"),e.textContent="Update consents",r(e,"class","btn-pri-sm")},m(l,n){S(l,e,n)},p:pe,d(l){l&&$(e)}}}function Tf(t){let e,l,n,i,o,u=vs(t[1].meter.mfg)+"",a,m,f,p,_=(t[1].meter.model?t[1].meter.model:"unknown")+"",h,v,d,g,y=(t[1].meter.id?t[1].meter.id:"unknown")+"",P;return{c(){e=c("div"),l=c("strong"),l.textContent="Meter",n=b(),i=c("div"),o=N("Manufacturer: "),a=N(u),m=b(),f=c("div"),p=N("Model: "),h=N(_),v=b(),d=c("div"),g=N("ID: "),P=N(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(M,E){S(M,e,E),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,m),s(e,f),s(f,p),s(f,h),s(e,v),s(e,d),s(d,g),s(d,P)},p(M,E){E&2&&u!==(u=vs(M[1].meter.mfg)+"")&&J(a,u),E&2&&_!==(_=(M[1].meter.model?M[1].meter.model:"unknown")+"")&&J(h,_),E&2&&y!==(y=(M[1].meter.id?M[1].meter.id:"unknown")+"")&&J(P,y)},d(M){M&&$(e)}}}function Nf(t){let e,l,n,i,o,u=t[1].net.ip+"",a,m,f,p,_=t[1].net.mask+"",h,v,d,g,y=t[1].net.gw+"",P,M,E,R,O=t[1].net.dns1+"",F,w,D=t[1].net.dns2&&Ef(t);return{c(){e=c("div"),l=c("strong"),l.textContent="Network",n=b(),i=c("div"),o=N("IP: "),a=N(u),m=b(),f=c("div"),p=N("Mask: "),h=N(_),v=b(),d=c("div"),g=N("Gateway: "),P=N(y),M=b(),E=c("div"),R=N("DNS: "),F=N(O),w=b(),D&&D.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(ne,H){S(ne,e,H),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,m),s(e,f),s(f,p),s(f,h),s(e,v),s(e,d),s(d,g),s(d,P),s(e,M),s(e,E),s(E,R),s(E,F),s(E,w),D&&D.m(E,null)},p(ne,H){H&2&&u!==(u=ne[1].net.ip+"")&&J(a,u),H&2&&_!==(_=ne[1].net.mask+"")&&J(h,_),H&2&&y!==(y=ne[1].net.gw+"")&&J(P,y),H&2&&O!==(O=ne[1].net.dns1+"")&&J(F,O),ne[1].net.dns2?D?D.p(ne,H):(D=Ef(ne),D.c(),D.m(E,null)):D&&(D.d(1),D=null)},d(ne){ne&&$(e),D&&D.d()}}}function Ef(t){let e,l=t[1].net.dns2+"",n;return{c(){e=N("/ "),n=N(l)},m(i,o){S(i,e,o),S(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns2+"")&&J(n,l)},d(i){i&&$(e),i&&$(n)}}}function Af(t){let e,l,n,i=t[1].upgrade.f+"",o,u,a=t[1].upgrade.t+"",m,f,p=Aa(t[1].upgrade.e)+"",_;return{c(){e=c("div"),l=c("div"),n=N("Previous upgrade attempt from "),o=N(i),u=N(" to "),m=N(a),f=N(" failed. "),_=N(p),r(l,"class","bd-yellow"),r(e,"class","my-2")},m(h,v){S(h,e,v),s(e,l),s(l,n),s(l,o),s(l,u),s(l,m),s(l,f),s(l,_)},p(h,v){v&2&&i!==(i=h[1].upgrade.f+"")&&J(o,i),v&2&&a!==(a=h[1].upgrade.t+"")&&J(m,a),v&2&&p!==(p=Aa(h[1].upgrade.e)+"")&&J(_,p)},d(h){h&&$(e)}}}function Pf(t){let e,l,n,i=t[2].tag_name+"",o,u,a,m,f,p,_=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[2]&&t[2].tag_name!=t[1].version&&Df(t),h=t[1].fwconsent===2&&Lf();return{c(){e=c("div"),l=N(`Latest version: + `),n=c("a"),o=N(i),a=b(),_&&_.c(),m=b(),h&&h.c(),f=Ke(),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){S(v,e,d),s(e,l),s(e,n),s(n,o),s(e,a),_&&_.m(e,null),S(v,m,d),h&&h.m(v,d),S(v,f,d),p=!0},p(v,d){(!p||d&4)&&i!==(i=v[2].tag_name+"")&&J(o,i),(!p||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(v,d),d&7&&I(_,1)):(_=Df(v),_.c(),I(_,1),_.m(e,null)):_&&(Ae(),q(_,1,1,()=>{_=null}),Pe()),v[1].fwconsent===2?h||(h=Lf(),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},i(v){p||(I(_),p=!0)},o(v){q(_),p=!1},d(v){v&&$(e),_&&_.d(),v&&$(m),h&&h.d(v),v&&$(f)}}}function Df(t){let e,l,n,i,o,u;return n=new Jc({}),{c(){e=c("div"),l=c("button"),re(n.$$.fragment),r(e,"class","flex-none ml-2 text-green-500"),r(e,"title","Install this version")},m(a,m){S(a,e,m),s(e,l),ie(n,l,null),i=!0,o||(u=te(l,"click",t[10]),o=!0)},p:pe,i(a){i||(I(n.$$.fragment,a),i=!0)},o(a){q(n.$$.fragment,a),i=!1},d(a){a&&$(e),se(n),o=!1,u()}}}function Lf(t){let e;return{c(){e=c("div"),e.innerHTML='
You have disabled one-click firmware upgrade, link to self-upgrade is disabled
',r(e,"class","my-2")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Rf(t){let e,l=hs(he(t[1].chip,t[1].board))+"",n;return{c(){e=c("div"),n=N(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&2&&l!==(l=hs(he(i[1].chip,i[1].board))+"")&&J(n,l)},d(i){i&&$(e)}}}function If(t){let e,l,n,i,o,u;function a(p,_){return p[4].length==0?U_:B_}let m=a(t),f=m(t);return{c(){e=c("div"),l=c("form"),n=c("input"),i=b(),f.c(),co(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,_){S(p,e,_),s(e,l),s(l,n),t[12](n),s(l,i),f.m(l,null),o||(u=[te(n,"change",t[13]),te(l,"submit",t[15])],o=!0)},p(p,_){m===(m=a(p))&&f?f.p(p,_):(f.d(1),f=m(p),f&&(f.c(),f.m(l,null)))},d(p){p&&$(e),t[12](null),f.d(),o=!1,ze(u)}}}function B_(t){let e=t[4][0].name+"",l,n,i;return{c(){l=N(e),n=b(),i=c("button"),i.textContent="Upload",r(i,"type","submit"),r(i,"class","btn-pri-sm float-right")},m(o,u){S(o,l,u),S(o,n,u),S(o,i,u)},p(o,u){u&16&&e!==(e=o[4][0].name+"")&&J(l,e)},d(o){o&&$(l),o&&$(n),o&&$(i)}}}function U_(t){let e,l,n;return{c(){e=c("button"),e.textContent="Select firmware file for upgrade",r(e,"type","button"),r(e,"class","btn-pri-sm float-right")},m(i,o){S(i,e,o),l||(n=te(e,"click",t[14]),l=!0)},p:pe,d(i){i&&$(e),l=!1,n()}}}function Of(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g=t[9],y=[];for(let O=0;O Include Secrets
(SSID, PSK, passwords and tokens)',m=b(),P&&P.c(),f=b(),p=c("form"),_=c("input"),h=b(),R.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"),co(_,"display","none"),r(_,"name","file"),r(_,"type","file"),r(_,"accept",".cfg"),r(p,"action","/configfile"),r(p,"enctype","multipart/form-data"),r(p,"method","post"),r(p,"autocomplete","off"),r(e,"class","cnt")},m(O,F){S(O,e,F),s(e,l),s(e,n),s(e,i),s(i,o);for(let w=0;w{A=null}),Pe());const It={};Me&8388608&&(It.$$scope={dirty:Me,ctx:ue}),ne.$set(It),ue[1].meter?L?L.p(ue,Me):(L=Tf(ue),L.c(),L.m(e,K)):L&&(L.d(1),L=null),ue[1].net?Z?Z.p(ue,Me):(Z=Nf(ue),Z.c(),Z.m(e,Q)):Z&&(Z.d(1),Z=null),(!T||Me&2)&&ae!==(ae=ue[1].version+"")&&J(ee,ae),ue[1].upgrade.t&&ue[1].upgrade.t!=ue[1].version?le?le.p(ue,Me):(le=Af(ue),le.c(),le.m(G,W)):le&&(le.d(1),le=null),ue[2]?fe?(fe.p(ue,Me),Me&4&&I(fe,1)):(fe=Pf(ue),fe.c(),I(fe,1),fe.m(G,we)):fe&&(Ae(),q(fe,1,1,()=>{fe=null}),Pe()),Me&3&&(He=(ue[1].security==0||ue[0].a)&&ti(ue[1].board)),He?de?de.p(ue,Me):(de=Rf(ue),de.c(),de.m(G,Ie)):de&&(de.d(1),de=null),ue[1].security==0||ue[0].a?Ce?Ce.p(ue,Me):(Ce=If(ue),Ce.c(),Ce.m(G,null)):Ce&&(Ce.d(1),Ce=null),ue[1].security==0||ue[0].a?Oe?Oe.p(ue,Me):(Oe=Of(ue),Oe.c(),Oe.m(e,null)):Oe&&(Oe.d(1),Oe=null);const st={};Me&32&&(st.active=ue[5]),ve.$set(st);const wt={};Me&256&&(wt.active=ue[8]),be.$set(wt)},i(ue){T||(I(y.$$.fragment,ue),I(A),I(ne.$$.fragment,ue),I(fe),I(ve.$$.fragment,ue),I(be.$$.fragment,ue),T=!0)},o(ue){q(y.$$.fragment,ue),q(A),q(ne.$$.fragment,ue),q(fe),q(ve.$$.fragment,ue),q(be.$$.fragment,ue),T=!1},d(ue){ue&&$(e),se(y),A&&A.d(),se(ne),L&&L.d(),Z&&Z.d(),le&&le.d(),fe&&fe.d(),de&&de.d(),Ce&&Ce.d(),Oe&&Oe.d(),ue&&$(ye),se(ve,ue),ue&&$(Te),se(be,ue),C=!1,k()}}}async function z_(){await(await fetch("/reboot",{method:"POST"})).json()}function G_(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={};yo.subscribe(w=>{l(2,u=Xc(i.version,w)),u||l(2,u=w[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(hs(he(i.chip,i.board))))&&(Wt.update(w=>(w.upgrading=!0,w)),Qc(u.tag_name))}const m=function(){confirm("Are you sure you want to reboot the device?")&&(Wt.update(w=>(w.booting=!0,w)),z_())};let f,p=[],_=!1,h,v=[],d=!1;bo();function g(w){ps[w?"unshift":"push"](()=>{f=w,l(3,f)})}function y(){p=this.files,l(4,p)}const P=()=>{f.click()},M=()=>l(5,_=!0);function E(w){ps[w?"unshift":"push"](()=>{h=w,l(6,h)})}function R(){v=this.files,l(7,v)}const O=()=>{h.click()},F=()=>l(8,d=!0);return t.$$set=w=>{"data"in w&&l(0,n=w.data),"sysinfo"in w&&l(1,i=w.sysinfo)},[n,i,u,f,p,_,h,v,d,o,a,m,g,y,P,M,E,R,O,F]}class V_ extends Re{constructor(e){super(),Le(this,e,G_,W_,Ee,{data:0,sysinfo:1})}}function Bf(t){let e,l,n=he(t[0],7)+"",i,o,u=he(t[0],5)+"",a,m,f=he(t[0],4)+"",p,_,h=he(t[0],3)+"",v,d,g,y,P=he(t[0],2)+"",M,E,R=he(t[0],1)+"",O,F,w=he(t[0],0)+"",D,ne,H,z,U=he(t[0],101)+"",K,Q,G=he(t[0],100)+"",X;return{c(){e=c("optgroup"),l=c("option"),i=N(n),o=c("option"),a=N(u),m=c("option"),p=N(f),_=c("option"),v=N(h),d=b(),g=c("optgroup"),y=c("option"),M=N(P),E=c("option"),O=N(R),F=c("option"),D=N(w),ne=b(),H=c("optgroup"),z=c("option"),K=N(U),Q=c("option"),X=N(G),l.__value=7,l.value=l.__value,o.__value=5,o.value=o.__value,m.__value=4,m.value=m.__value,_.__value=3,_.value=_.__value,r(e,"label","amsleser.no"),y.__value=2,y.value=y.__value,E.__value=1,E.value=E.__value,F.__value=0,F.value=F.__value,r(g,"label","Custom hardware"),z.__value=101,z.value=z.__value,Q.__value=100,Q.value=Q.__value,r(H,"label","Generic hardware")},m(Y,j){S(Y,e,j),s(e,l),s(l,i),s(e,o),s(o,a),s(e,m),s(m,p),s(e,_),s(_,v),S(Y,d,j),S(Y,g,j),s(g,y),s(y,M),s(g,E),s(E,O),s(g,F),s(F,D),S(Y,ne,j),S(Y,H,j),s(H,z),s(z,K),s(H,Q),s(Q,X)},p(Y,j){j&1&&n!==(n=he(Y[0],7)+"")&&J(i,n),j&1&&u!==(u=he(Y[0],5)+"")&&J(a,u),j&1&&f!==(f=he(Y[0],4)+"")&&J(p,f),j&1&&h!==(h=he(Y[0],3)+"")&&J(v,h),j&1&&P!==(P=he(Y[0],2)+"")&&J(M,P),j&1&&R!==(R=he(Y[0],1)+"")&&J(O,R),j&1&&w!==(w=he(Y[0],0)+"")&&J(D,w),j&1&&U!==(U=he(Y[0],101)+"")&&J(K,U),j&1&&G!==(G=he(Y[0],100)+"")&&J(X,G)},d(Y){Y&&$(e),Y&&$(d),Y&&$(g),Y&&$(ne),Y&&$(H)}}}function Uf(t){let e,l,n=he(t[0],201)+"",i,o,u=he(t[0],202)+"",a,m,f=he(t[0],203)+"",p,_,h=he(t[0],241)+"",v,d,g=he(t[0],242)+"",y,P,M=he(t[0],243)+"",E,R,O=he(t[0],200)+"",F;return{c(){e=c("optgroup"),l=c("option"),i=N(n),o=c("option"),a=N(u),m=c("option"),p=N(f),_=c("option"),v=N(h),d=c("option"),y=N(g),P=c("option"),E=N(M),R=c("option"),F=N(O),l.__value=201,l.value=l.__value,o.__value=202,o.value=o.__value,m.__value=203,m.value=m.__value,_.__value=241,_.value=_.__value,d.__value=242,d.value=d.__value,P.__value=243,P.value=P.__value,R.__value=200,R.value=R.__value,r(e,"label","Generic hardware")},m(w,D){S(w,e,D),s(e,l),s(l,i),s(e,o),s(o,a),s(e,m),s(m,p),s(e,_),s(_,v),s(e,d),s(d,y),s(e,P),s(P,E),s(e,R),s(R,F)},p(w,D){D&1&&n!==(n=he(w[0],201)+"")&&J(i,n),D&1&&u!==(u=he(w[0],202)+"")&&J(a,u),D&1&&f!==(f=he(w[0],203)+"")&&J(p,f),D&1&&h!==(h=he(w[0],241)+"")&&J(v,h),D&1&&g!==(g=he(w[0],242)+"")&&J(y,g),D&1&&M!==(M=he(w[0],243)+"")&&J(E,M),D&1&&O!==(O=he(w[0],200)+"")&&J(F,O)},d(w){w&&$(e)}}}function jf(t){let e,l,n=he(t[0],7)+"",i,o,u=he(t[0],6)+"",a,m,f=he(t[0],5)+"",p,_,h,v,d=he(t[0],51)+"",g,y,P=he(t[0],50)+"",M;return{c(){e=c("optgroup"),l=c("option"),i=N(n),o=c("option"),a=N(u),m=c("option"),p=N(f),_=b(),h=c("optgroup"),v=c("option"),g=N(d),y=c("option"),M=N(P),l.__value=7,l.value=l.__value,o.__value=6,o.value=o.__value,m.__value=5,m.value=m.__value,r(e,"label","amsleser.no"),v.__value=51,v.value=v.__value,y.__value=50,y.value=y.__value,r(h,"label","Generic hardware")},m(E,R){S(E,e,R),s(e,l),s(l,i),s(e,o),s(o,a),s(e,m),s(m,p),S(E,_,R),S(E,h,R),s(h,v),s(v,g),s(h,y),s(y,M)},p(E,R){R&1&&n!==(n=he(E[0],7)+"")&&J(i,n),R&1&&u!==(u=he(E[0],6)+"")&&J(a,u),R&1&&f!==(f=he(E[0],5)+"")&&J(p,f),R&1&&d!==(d=he(E[0],51)+"")&&J(g,d),R&1&&P!==(P=he(E[0],50)+"")&&J(M,P)},d(E){E&&$(e),E&&$(_),E&&$(h)}}}function Hf(t){let e,l,n=he(t[0],8)+"",i,o,u,a,m=he(t[0],71)+"",f,p,_=he(t[0],70)+"",h;return{c(){e=c("optgroup"),l=c("option"),i=N(n),o=b(),u=c("optgroup"),a=c("option"),f=N(m),p=c("option"),h=N(_),l.__value=8,l.value=l.__value,r(e,"label","Custom hardware"),a.__value=71,a.value=a.__value,p.__value=70,p.value=p.__value,r(u,"label","Generic hardware")},m(v,d){S(v,e,d),s(e,l),s(l,i),S(v,o,d),S(v,u,d),s(u,a),s(a,f),s(u,p),s(p,h)},p(v,d){d&1&&n!==(n=he(v[0],8)+"")&&J(i,n),d&1&&m!==(m=he(v[0],71)+"")&&J(f,m),d&1&&_!==(_=he(v[0],70)+"")&&J(h,_)},d(v){v&&$(e),v&&$(o),v&&$(u)}}}function Wf(t){let e,l,n=he(t[0],200)+"",i;return{c(){e=c("optgroup"),l=c("option"),i=N(n),l.__value=200,l.value=l.__value,r(e,"label","Generic hardware")},m(o,u){S(o,e,u),s(e,l),s(l,i)},p(o,u){u&1&&n!==(n=he(o[0],200)+"")&&J(i,n)},d(o){o&&$(e)}}}function zf(t){let e,l,n=he(t[0],80)+"",i;return{c(){e=c("optgroup"),l=c("option"),i=N(n),l.__value=80,l.value=l.__value,r(e,"label","Generic hardware")},m(o,u){S(o,e,u),s(e,l),s(l,i)},p(o,u){u&1&&n!==(n=he(o[0],80)+"")&&J(i,n)},d(o){o&&$(e)}}}function K_(t){let e,l,n,i,o,u,a,m,f=t[0]=="esp8266"&&Bf(t),p=t[0]=="esp32"&&Uf(t),_=t[0]=="esp32s2"&&jf(t),h=t[0]=="esp32c3"&&Hf(t),v=t[0]=="esp32solo"&&Wf(t),d=t[0]=="esp32s3"&&zf(t);return{c(){e=c("option"),l=b(),f&&f.c(),n=b(),p&&p.c(),i=b(),_&&_.c(),o=b(),h&&h.c(),u=b(),v&&v.c(),a=b(),d&&d.c(),m=Ke(),e.__value=-1,e.value=e.__value},m(g,y){S(g,e,y),S(g,l,y),f&&f.m(g,y),S(g,n,y),p&&p.m(g,y),S(g,i,y),_&&_.m(g,y),S(g,o,y),h&&h.m(g,y),S(g,u,y),v&&v.m(g,y),S(g,a,y),d&&d.m(g,y),S(g,m,y)},p(g,[y]){g[0]=="esp8266"?f?f.p(g,y):(f=Bf(g),f.c(),f.m(n.parentNode,n)):f&&(f.d(1),f=null),g[0]=="esp32"?p?p.p(g,y):(p=Uf(g),p.c(),p.m(i.parentNode,i)):p&&(p.d(1),p=null),g[0]=="esp32s2"?_?_.p(g,y):(_=jf(g),_.c(),_.m(o.parentNode,o)):_&&(_.d(1),_=null),g[0]=="esp32c3"?h?h.p(g,y):(h=Hf(g),h.c(),h.m(u.parentNode,u)):h&&(h.d(1),h=null),g[0]=="esp32solo"?v?v.p(g,y):(v=Wf(g),v.c(),v.m(a.parentNode,a)):v&&(v.d(1),v=null),g[0]=="esp32s3"?d?d.p(g,y):(d=zf(g),d.c(),d.m(m.parentNode,m)):d&&(d.d(1),d=null)},i:pe,o:pe,d(g){g&&$(e),g&&$(l),f&&f.d(g),g&&$(n),p&&p.d(g),g&&$(i),_&&_.d(g),g&&$(o),h&&h.d(g),g&&$(u),v&&v.d(g),g&&$(a),d&&d.d(g),g&&$(m)}}}function Y_(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class Q_ extends Re{constructor(e){super(),Le(this,e,Y_,K_,Ee,{chip:0})}}function Gf(t){let e;return{c(){e=c("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){S(l,e,n)},d(l){l&&$(e)}}}function Vf(t){let e,l,n,i,o,u,a;return u=new io({props:{chip:t[0].chip}}),{c(){e=c("div"),l=N("HAN GPIO"),n=c("br"),i=b(),o=c("select"),re(u.$$.fragment),r(o,"name","vh"),r(o,"class","in-s"),r(e,"class","my-3")},m(m,f){S(m,e,f),s(e,l),s(e,n),s(e,i),s(e,o),ie(u,o,null),a=!0},p(m,f){const p={};f&1&&(p.chip=m[0].chip),u.$set(p)},i(m){a||(I(u.$$.fragment,m),a=!0)},o(m){q(u.$$.fragment,m),a=!1},d(m){m&&$(e),se(u)}}}function X_(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y,P,M,E,R,O,F,w,D,ne,H,z,U,K,Q=t[0].usrcfg&&Gf();d=new Q_({props:{chip:t[0].chip}});let G=t[0].board&&t[0].board>20&&Vf(t);return H=new kt({props:{active:t[1],message:"Saving device configuration"}}),{c(){e=c("div"),l=c("div"),n=c("form"),i=c("input"),o=b(),u=c("strong"),u.textContent="Initial configuration",a=b(),Q&&Q.c(),m=b(),f=c("div"),p=N("Board type"),_=c("br"),h=b(),v=c("select"),re(d.$$.fragment),g=b(),G&&G.c(),y=b(),P=c("div"),M=c("label"),E=c("input"),R=N(" Clear all other configuration"),O=b(),F=c("div"),F.innerHTML='',w=b(),D=c("span"),D.textContent="\xA0",ne=b(),re(H.$$.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&&We(()=>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(P,"class","my-3"),r(F,"class","my-3"),r(D,"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(X,Y){S(X,e,Y),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),Q&&Q.m(n,null),s(n,m),s(n,f),s(f,p),s(f,_),s(f,h),s(f,v),ie(d,v,null),$e(v,t[0].board,!0),s(n,g),G&&G.m(n,null),s(n,y),s(n,P),s(P,M),s(M,E),E.checked=t[2],s(M,R),s(n,O),s(n,F),s(n,w),s(n,D),S(X,ne,Y),ie(H,X,Y),z=!0,U||(K=[te(v,"change",t[4]),te(E,"change",t[5]),te(n,"submit",wi(t[3]))],U=!0)},p(X,[Y]){X[0].usrcfg?Q||(Q=Gf(),Q.c(),Q.m(n,m)):Q&&(Q.d(1),Q=null);const j={};Y&1&&(j.chip=X[0].chip),d.$set(j),Y&1&&$e(v,X[0].board),X[0].board&&X[0].board>20?G?(G.p(X,Y),Y&1&&I(G,1)):(G=Vf(X),G.c(),I(G,1),G.m(n,y)):G&&(Ae(),q(G,1,1,()=>{G=null}),Pe()),Y&4&&(E.checked=X[2]);const x={};Y&2&&(x.active=X[1]),H.$set(x)},i(X){z||(I(d.$$.fragment,X),I(G),I(H.$$.fragment,X),z=!0)},o(X){q(d.$$.fragment,X),q(G),q(H.$$.fragment,X),z=!1},d(X){X&&$(e),Q&&Q.d(),se(d),G&&G.d(),X&&$(ne),se(H,X),U=!1,ze(K)}}}function Z_(t,e,l){let{sysinfo:n={}}=e,i=!1;async function o(f){l(1,i=!0);const p=new FormData(f.target),_=new URLSearchParams;for(let d of p){const[g,y]=d;_.append(g,y)}let v=await(await fetch("/save",{method:"POST",body:_})).json();l(1,i=!1),Wt.update(d=>(d.vndcfg=v.success,d.booting=v.reboot,d.if.eth=d.boardType>240&&d.boardType<250,d)),fn(n.usrcfg?"/":"/setup")}let u=!1;Wt.subscribe(f=>{l(0,n=f),f.fwconsent===1&&l(2,u=!n.usrcfg)});function a(){n.board=tt(this),l(0,n)}function m(){u=this.checked,l(2,u)}return t.$$set=f=>{"sysinfo"in f&&l(0,n=f.sysinfo)},[n,i,u,o,a,m]}class J_ extends Re{constructor(e){super(),Le(this,e,Z_,X_,Ee,{sysinfo:0})}}function Kf(t){let e;return{c(){e=c("option"),e.textContent="Ethernet",e.__value=3,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Yf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v;return{c(){e=c("div"),l=N("SSID"),n=c("br"),i=b(),o=c("input"),a=b(),m=c("div"),f=N("PSK"),p=c("br"),_=b(),h=c("input"),r(o,"name","ss"),r(o,"type","text"),r(o,"class","in-s"),o.required=u=t[2]==1||t[2]==2,r(e,"class","my-3"),r(h,"name","sp"),r(h,"type","password"),r(h,"class","in-s"),r(h,"autocomplete","off"),h.required=v=t[2]==2,r(m,"class","my-3")},m(d,g){S(d,e,g),s(e,l),s(e,n),s(e,i),s(e,o),S(d,a,g),S(d,m,g),s(m,f),s(m,p),s(m,_),s(m,h)},p(d,g){g&4&&u!==(u=d[2]==1||d[2]==2)&&(o.required=u),g&4&&v!==(v=d[2]==2)&&(h.required=v)},d(d){d&&$(e),d&&$(a),d&&$(m)}}}function Qf(t){let e,l,n,i,o,u,a,m;return a=new t1({}),{c(){e=c("br"),l=b(),n=c("div"),i=c("input"),o=b(),u=c("select"),re(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,p){S(f,e,p),S(f,l,p),S(f,n,p),s(n,i),s(n,o),s(n,u),ie(a,u,null),m=!0},p(f,p){(!m||p&2)&&(i.required=f[1]),(!m||p&2)&&(u.required=f[1])},i(f){m||(I(a.$$.fragment,f),m=!0)},o(f){q(a.$$.fragment,f),m=!1},d(f){f&&$(e),f&&$(l),f&&$(n),se(a)}}}function Xf(t){let e;return{c(){e=c("div"),e.innerHTML=`
Gateway
DNS
-
`,r(e,"class","my-3 flex")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function x_(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G,X,Y,j=t[0].if&&t[0].if.eth&&Kf(),x=(t[2]==1||t[2]==2)&&Yf(t),ae=t[1]&&Qf(t),ee=t[1]&&Xf();return Q=new kt({props:{active:t[3],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"),f=E("Connection"),_=m("br"),p=h(),b=m("select"),v=m("option"),v.textContent="Connect to WiFi",d=m("option"),d.textContent="Standalone access point",j&&j.c(),g=h(),x&&x.c(),w=h(),T=m("div"),M=E(`Hostname - `),P=m("input"),L=h(),I=m("div"),F=m("label"),C=m("input"),R=E(" Static IP"),ne=h(),ae&&ae.c(),H=h(),ee&&ee.c(),z=h(),U=m("div"),U.innerHTML='',K=h(),re(Q.$$.fragment),r(i,"type","hidden"),r(i,"name","s"),i.value="true",r(u,"class","text-sm"),v.__value=1,v.value=v.__value,d.__value=2,d.value=d.__value,r(b,"name","sc"),r(b,"class","in-s"),t[2]===void 0&&We(()=>t[5].call(b)),r(c,"class","my-3"),r(P,"name","sh"),r(P,"type","text"),r(P,"class","in-s"),r(P,"maxlength","32"),r(P,"pattern","[a-z0-9_-]+"),r(P,"placeholder","Optional, ex.: ams-reader"),r(P,"autocomplete","off"),r(C,"type","checkbox"),r(C,"name","sm"),C.__value="static",C.value=C.__value,r(C,"class","rounded mb-1"),r(I,"class","my-3"),r(U,"class","my-3"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(V,W){S(V,e,W),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(b,d),j&&j.m(b,null),$e(b,t[2],!0),s(n,g),x&&x.m(n,null),s(n,w),s(n,T),s(T,M),s(T,P),oe(P,t[0].hostname),s(n,L),s(n,I),s(I,F),s(F,C),C.checked=t[1],s(F,R),s(I,ne),ae&&ae.m(I,null),s(n,H),ee&&ee.m(n,null),s(n,z),s(n,U),S(V,K,W),ie(Q,V,W),G=!0,X||(Y=[te(b,"change",t[5]),te(P,"input",t[6]),te(C,"change",t[7]),te(n,"submit",wi(t[4]))],X=!0)},p(V,[W]){V[0].if&&V[0].if.eth?j||(j=Kf(),j.c(),j.m(b,null)):j&&(j.d(1),j=null),W&4&&$e(b,V[2]),V[2]==1||V[2]==2?x?x.p(V,W):(x=Yf(V),x.c(),x.m(n,w)):x&&(x.d(1),x=null),W&1&&P.value!==V[0].hostname&&oe(P,V[0].hostname),W&2&&(C.checked=V[1]),V[1]?ae?(ae.p(V,W),W&2&&O(ae,1)):(ae=Qf(V),ae.c(),O(ae,1),ae.m(I,null)):ae&&(Ae(),q(ae,1,1,()=>{ae=null}),Pe()),V[1]?ee||(ee=Xf(),ee.c(),ee.m(n,z)):ee&&(ee.d(1),ee=null);const we={};W&8&&(we.active=V[3]),Q.$set(we)},i(V){G||(O(ae),O(Q.$$.fragment,V),G=!0)},o(V){q(ae),q(Q.$$.fragment,V),G=!1},d(V){V&&$(e),j&&j.d(),x&&x.d(),ae&&ae.d(),ee&&ee.d(),V&&$(K),se(Q,V),X=!1,ze(Y)}}}function ep(t,e,l){let{sysinfo:n={}}=e,i=!1,o=1,u=!1,a=0;function c(){var v="";a++;var d=function(){setTimeout(c,1e3)};if(n.net.ip&&a%3==0){if(!n.net.ip){d();return}v="http://"+n.net.ip}else n.hostname&&a%3==1?v="http://"+n.hostname:n.hostname&&a%3==2?v="http://"+n.hostname+".local":v="";console&&console.log("Trying url "+v),Wt.update(w=>(w.trying=v,w));var g=new XMLHttpRequest;g.timeout=5e3,g.addEventListener("abort",d),g.addEventListener("error",d),g.addEventListener("timeout",d),g.addEventListener("load",function(w){window.location.href=v||"/"}),g.open("GET",v+"/is-alive",!0),g.send()}async function f(v){l(3,u=!0);const d=new FormData(v.target),g=new URLSearchParams;for(let M of d){const[P,L]=M;g.append(P,L)}let T=await(await fetch("/save",{method:"POST",body:g})).json();l(3,u=!1),Wt.update(M=>(M.hostname=d.get("sh"),M.usrcfg=T.success,M.booting=T.reboot,i&&(M.net.ip=d.get("si"),M.net.mask=d.get("su"),M.net.gw=d.get("sg"),M.net.dns1=d.get("sd")),setTimeout(c,5e3),M))}function _(){o=tt(this),l(2,o)}function p(){n.hostname=this.value,l(0,n)}function b(){i=this.checked,l(1,i)}return t.$$set=v=>{"sysinfo"in v&&l(0,n=v.sysinfo)},[n,i,o,u,f,_,p,b]}class tp extends Ie{constructor(e){super(),Re(this,e,ep,x_,Ee,{sysinfo:0})}}function lp(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T;return d=new kt({props:{active:t[2],message:"Uploading file, please wait"}}),{c(){e=m("div"),l=m("div"),n=m("strong"),i=E("Upload "),o=E(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(),re(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(M,P){S(M,e,P),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),S(M,v,P),ie(d,M,P),g=!0,w||(T=te(f,"submit",t[3]),w=!0)},p(M,[P]){(!g||P&2)&&J(o,M[1]),(!g||P&1)&&r(f,"action",M[0]);const L={};P&4&&(L.active=M[2]),d.$set(L)},i(M){g||(O(d.$$.fragment,M),g=!0)},o(M){q(d.$$.fragment,M),g=!1},d(M){M&&$(e),M&&$(v),se(d,M),w=!1,T()}}}function np(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 Co extends Ie{constructor(e){super(),Re(this,e,np,lp,Ee,{action:0,title:1})}}function ip(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G;return U=new kt({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=E("Enable one-click upgrade? (implies data collection)"),_=m("br"),p=h(),b=m("a"),v=E("Read more"),d=m("br"),g=h(),w=m("label"),T=m("input"),P=E(" Yes"),L=m("label"),I=m("input"),C=E(" No"),R=m("br"),ne=h(),H=m("div"),H.innerHTML='',z=h(),re(U.$$.fragment),r(b,"href",It("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=M=t[0].fwconsent===1,r(T,"class","rounded m-2"),T.required=!0,r(I,"type","radio"),r(I,"name","sf"),I.value=2,I.checked=F=t[0].fwconsent===2,r(I,"class","rounded m-2"),I.required=!0,r(c,"class","my-3"),r(H,"class","my-3"),r(n,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-3 lg:grid-cols-2")},m(X,Y){S(X,e,Y),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,g),s(c,w),s(w,T),s(w,P),s(c,L),s(L,I),s(L,C),s(c,R),s(n,ne),s(n,H),S(X,z,Y),ie(U,X,Y),K=!0,Q||(G=te(n,"submit",wi(t[2])),Q=!0)},p(X,[Y]){(!K||Y&1&&M!==(M=X[0].fwconsent===1))&&(T.checked=M),(!K||Y&1&&F!==(F=X[0].fwconsent===2))&&(I.checked=F);const j={};Y&2&&(j.active=X[1]),U.$set(j)},i(X){K||(O(U.$$.fragment,X),K=!0)},o(X){q(U.$$.fragment,X),K=!1},d(X){X&&$(e),X&&$(z),se(U,X),Q=!1,G()}}}function sp(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),Wt.update(p=>(p.fwconsent=a.sf===!0?1:a.sf===!1?2:0,p.booting=_.reboot,p)),fn("/")}return t.$$set=u=>{"sysinfo"in u&&l(0,n=u.sysinfo)},[n,i,o]}class op extends Ie{constructor(e){super(),Re(this,e,sp,ip,Ee,{sysinfo:0})}}function Zf(t,e,l){const n=t.slice();return n[17]=e[l],n[18]=e,n[19]=l,n}function Jf(t,e,l){const n=t.slice();return n[20]=e[l],n[22]=l,n}function xf(t,e,l){const n=t.slice();return n[20]=e[l],n[22]=l,n}function ec(t,e,l){const n=t.slice();return n[20]=e[l],n[22]=l,n}function tc(t){let e,l,n=t[0].o,i=[];for(let u=0;uq(i[u],1,1,()=>{i[u]=null});return{c(){for(let u=0;uSave',L=h(),re(I.$$.fragment),F=h(),re(C.$$.fragment),r(l,"class","text-sm"),r(i,"href",It("Price-configuration")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"class","m-3"),r(_,"type","hidden"),r(_,"name","r"),_.value="true",r(g,"type","button"),r(g,"class","btn-pri"),r(T,"class","text-center"),r(P,"class","text-right"),r(v,"class","grid grid-cols-3"),r(f,"autocomplete","off"),r(e,"class","cnt")},m(U,K){S(U,e,K),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,_),s(f,p),z&&z.m(f,null),s(f,b),s(f,v),s(v,d),s(d,g),s(v,w),s(v,T),s(v,M),s(v,P),S(U,L,K),ie(I,U,K),S(U,F,K),ie(C,U,K),R=!0,ne||(H=[te(g,"click",t[6]),te(f,"submit",wi(t[4]))],ne=!0)},p(U,[K]){U[0].o?z?(z.p(U,K),K&1&&O(z,1)):(z=tc(U),z.c(),O(z,1),z.m(f,b)):z&&(Ae(),q(z,1,1,()=>{z=null}),Pe());const Q={};K&2&&(Q.active=U[1]),I.$set(Q);const G={};K&4&&(G.active=U[2]),C.$set(G)},i(U){R||(O(o.$$.fragment,U),O(z),O(I.$$.fragment,U),O(C.$$.fragment,U),R=!0)},o(U){q(o.$$.fragment,U),q(z),q(I.$$.fragment,U),q(C.$$.fragment,U),R=!1},d(U){U&&$(e),se(o),z&&z.d(),U&&$(L),se(I,U),U&&$(F),se(C,U),ne=!1,ze(H)}}}function ap(t,e,l){let n=["mo","tu","we","th","fr","sa","su"],i={},o=!0,u=!1;e1.subscribe(L=>{L.o&&(l(0,i=L),l(1,o=!1))}),Zm();async function a(L){l(2,u=!0);const I=new URLSearchParams;I.append("r","true"),I.append("rc",i.o.length),i.o.forEach(function(C,R){I.append("rt"+R,C.t),I.append("rn"+R,C.n),I.append("rd"+R,C.d),I.append("ra"+R,C.a),I.append("rh"+R,C.h),I.append("rv"+R,C.v)}),await(await fetch("/save",{method:"POST",body:I})).json(),l(2,u=!1),fn("/configuration")}let c=function(L,I){return L.includes(I)?L=L.filter(function(F){return F!==I}):L.push(I),L},f=function(){let L=i.o;L.push({t:1,n:"",d:3,a:[0,1,2,3,4,5,6,7],h:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],v:.01}),l(0,i.o=L,i)},_=function(L){let I=i.o;I.splice(L,1),l(0,i.o=I,i)};function p(L,I){L[I].n=this.value,l(0,i)}function b(L,I){L[I].d=tt(this),l(0,i)}function v(L,I){L[I].t=tt(this),l(0,i)}function d(L,I){L[I].v=ge(this.value),l(0,i)}return[i,o,u,n,a,c,f,_,p,b,v,d,(L,I,F,C)=>l(0,F[C].a=c(L.a,I),i),(L,I,F,C)=>l(0,F[C].h=c(L.h,I),i),(L,I,F,C)=>l(0,F[C].h=c(L.h,I+12),i),L=>_(L),L=>_(L)]}class up extends Ie{constructor(e){super(),Re(this,e,ap,rp,Ee,{})}}function fp(t){let e,l;return e=new Qm({props:{data:t[1],sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(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||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function cp(t){let e,l;return e=new I_({props:{sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function mp(t){let e,l;return e=new up({}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function _p(t){let e,l;return e=new V_({props:{sysinfo:t[0],data:t[1]}}),{c(){re(e.$$.fragment)},m(n,i){ie(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||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function pp(t){let e,l;return e=new Co({props:{title:"CA",action:"/mqtt-ca"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function dp(t){let e,l;return e=new Co({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function vp(t){let e,l;return e=new Co({props:{title:"private key",action:"/mqtt-key"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function hp(t){let e,l;return e=new op({props:{sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function bp(t){let e,l;return e=new tp({props:{sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function gp(t){let e,l;return e=new J_({props:{sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function kp(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F;return e=new sm({props:{data:t[1]}}),n=new ml({props:{path:"/",$$slots:{default:[fp]},$$scope:{ctx:t}}}),o=new ml({props:{path:"/configuration",$$slots:{default:[cp]},$$scope:{ctx:t}}}),a=new ml({props:{path:"/priceconfig",$$slots:{default:[mp]},$$scope:{ctx:t}}}),f=new ml({props:{path:"/status",$$slots:{default:[_p]},$$scope:{ctx:t}}}),p=new ml({props:{path:"/mqtt-ca",$$slots:{default:[pp]},$$scope:{ctx:t}}}),v=new ml({props:{path:"/mqtt-cert",$$slots:{default:[dp]},$$scope:{ctx:t}}}),g=new ml({props:{path:"/mqtt-key",$$slots:{default:[vp]},$$scope:{ctx:t}}}),T=new ml({props:{path:"/consent",$$slots:{default:[hp]},$$scope:{ctx:t}}}),P=new ml({props:{path:"/setup",$$slots:{default:[bp]},$$scope:{ctx:t}}}),I=new ml({props:{path:"/vendor",$$slots:{default:[gp]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment),l=h(),re(n.$$.fragment),i=h(),re(o.$$.fragment),u=h(),re(a.$$.fragment),c=h(),re(f.$$.fragment),_=h(),re(p.$$.fragment),b=h(),re(v.$$.fragment),d=h(),re(g.$$.fragment),w=h(),re(T.$$.fragment),M=h(),re(P.$$.fragment),L=h(),re(I.$$.fragment)},m(C,R){ie(e,C,R),S(C,l,R),ie(n,C,R),S(C,i,R),ie(o,C,R),S(C,u,R),ie(a,C,R),S(C,c,R),ie(f,C,R),S(C,_,R),ie(p,C,R),S(C,b,R),ie(v,C,R),S(C,d,R),ie(g,C,R),S(C,w,R),ie(T,C,R),S(C,M,R),ie(P,C,R),S(C,L,R),ie(I,C,R),F=!0},p(C,R){const ne={};R&2&&(ne.data=C[1]),e.$set(ne);const H={};R&7&&(H.$$scope={dirty:R,ctx:C}),n.$set(H);const z={};R&5&&(z.$$scope={dirty:R,ctx:C}),o.$set(z);const U={};R&4&&(U.$$scope={dirty:R,ctx:C}),a.$set(U);const K={};R&7&&(K.$$scope={dirty:R,ctx:C}),f.$set(K);const Q={};R&4&&(Q.$$scope={dirty:R,ctx:C}),p.$set(Q);const G={};R&4&&(G.$$scope={dirty:R,ctx:C}),v.$set(G);const X={};R&4&&(X.$$scope={dirty:R,ctx:C}),g.$set(X);const Y={};R&5&&(Y.$$scope={dirty:R,ctx:C}),T.$set(Y);const j={};R&5&&(j.$$scope={dirty:R,ctx:C}),P.$set(j);const x={};R&5&&(x.$$scope={dirty:R,ctx:C}),I.$set(x)},i(C){F||(O(e.$$.fragment,C),O(n.$$.fragment,C),O(o.$$.fragment,C),O(a.$$.fragment,C),O(f.$$.fragment,C),O(p.$$.fragment,C),O(v.$$.fragment,C),O(g.$$.fragment,C),O(T.$$.fragment,C),O(P.$$.fragment,C),O(I.$$.fragment,C),F=!0)},o(C){q(e.$$.fragment,C),q(n.$$.fragment,C),q(o.$$.fragment,C),q(a.$$.fragment,C),q(f.$$.fragment,C),q(p.$$.fragment,C),q(v.$$.fragment,C),q(g.$$.fragment,C),q(T.$$.fragment,C),q(P.$$.fragment,C),q(I.$$.fragment,C),F=!1},d(C){se(e,C),C&&$(l),se(n,C),C&&$(i),se(o,C),C&&$(u),se(a,C),C&&$(c),se(f,C),C&&$(_),se(p,C),C&&$(b),se(v,C),C&&$(d),se(g,C),C&&$(w),se(T,C),C&&$(M),se(P,C),C&&$(L),se(I,C)}}}function wp(t){let e,l,n,i;const o=[$p,Cp],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=Ke()},m(c,f){u[e].m(c,f),S(c,n,f),i=!0},p(c,f){let _=e;e=a(c),e===_?u[e].p(c,f):(Ae(),q(u[_],1,1,()=>{u[_]=null}),Pe(),l=u[e],l?l.p(c,f):(l=u[e]=o[e](c),l.c()),O(l,1),l.m(n.parentNode,n))},i(c){i||(O(l),i=!0)},o(c){q(l),i=!1},d(c){u[e].d(c),c&&$(n)}}}function yp(t){let e,l;return e=new kt({props:{active:"true",message:"Device is upgrading, please wait"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function Cp(t){let e,l;return e=new kt({props:{active:"true",message:"Device is booting, please wait"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function $p(t){let e,l;return e=new kt({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[0].trying}}),{c(){re(e.$$.fragment)},m(n,i){ie(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||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function Sp(t){let e,l,n,i,o,u;l=new Rc({props:{$$slots:{default:[kp]},$$scope:{ctx:t}}});const a=[yp,wp],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"),re(l.$$.fragment),n=h(),o&&o.c(),r(e,"class","container mx-auto m-3")},m(_,p){S(_,e,p),ie(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&&(Ae(),q(c[v],1,1,()=>{c[v]=null}),Pe()),~i?(o=c[i],o?o.p(_,p):(o=c[i]=a[i](_),o.c()),O(o,1),o.m(e,null)):o=null)},i(_){u||(O(l.$$.fragment,_),O(o),u=!0)},o(_){q(l.$$.fragment,_),q(o),u=!1},d(_){_&&$(e),se(l),~i&&c[i].d()}}}function Mp(t,e,l){let n={};Wt.subscribe(o=>{l(0,n=o),n.vndcfg===!1?fn("/vendor"):n.usrcfg===!1?fn("/setup"):n.fwconsent===0&&fn("/consent"),n.ui.k===1?(console.log("dark"),document.documentElement.classList.add("dark")):n.ui.k===0?(console.log("light"),document.documentElement.classList.remove("dark")):window.matchMedia("(prefers-color-scheme: dark)").matches?(console.log("dark auto"),document.documentElement.classList.add("dark")):(console.log("light auto"),document.documentElement.classList.remove("dark"))}),bo();let i={};return Bc.subscribe(o=>{l(1,i=o)}),[n,i]}class Tp extends Ie{constructor(e){super(),Re(this,e,Mp,Sp,Ee,{})}}new Tp({target:document.getElementById("app")}); +
`,r(e,"class","my-3 flex")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function x_(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y,P,M,E,R,O,F,w,D,ne,H,z,U,K,Q,G,X,Y,j=t[0].if&&t[0].if.eth&&Kf(),x=(t[2]==1||t[2]==2)&&Yf(t),ae=t[1]&&Qf(t),ee=t[1]&&Xf();return Q=new kt({props:{active:t[3],message:"Saving your configuration to the device"}}),{c(){e=c("div"),l=c("div"),n=c("form"),i=c("input"),o=b(),u=c("strong"),u.textContent="Setup",a=b(),m=c("div"),f=N("Connection"),p=c("br"),_=b(),h=c("select"),v=c("option"),v.textContent="Connect to WiFi",d=c("option"),d.textContent="Standalone access point",j&&j.c(),g=b(),x&&x.c(),y=b(),P=c("div"),M=N(`Hostname + `),E=c("input"),R=b(),O=c("div"),F=c("label"),w=c("input"),D=N(" Static IP"),ne=b(),ae&&ae.c(),H=b(),ee&&ee.c(),z=b(),U=c("div"),U.innerHTML='',K=b(),re(Q.$$.fragment),r(i,"type","hidden"),r(i,"name","s"),i.value="true",r(u,"class","text-sm"),v.__value=1,v.value=v.__value,d.__value=2,d.value=d.__value,r(h,"name","sc"),r(h,"class","in-s"),t[2]===void 0&&We(()=>t[5].call(h)),r(m,"class","my-3"),r(E,"name","sh"),r(E,"type","text"),r(E,"class","in-s"),r(E,"maxlength","32"),r(E,"pattern","[a-z0-9_-]+"),r(E,"placeholder","Optional, ex.: ams-reader"),r(E,"autocomplete","off"),r(w,"type","checkbox"),r(w,"name","sm"),w.__value="static",w.value=w.__value,r(w,"class","rounded mb-1"),r(O,"class","my-3"),r(U,"class","my-3"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(V,W){S(V,e,W),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),s(n,m),s(m,f),s(m,p),s(m,_),s(m,h),s(h,v),s(h,d),j&&j.m(h,null),$e(h,t[2],!0),s(n,g),x&&x.m(n,null),s(n,y),s(n,P),s(P,M),s(P,E),oe(E,t[0].hostname),s(n,R),s(n,O),s(O,F),s(F,w),w.checked=t[1],s(F,D),s(O,ne),ae&&ae.m(O,null),s(n,H),ee&&ee.m(n,null),s(n,z),s(n,U),S(V,K,W),ie(Q,V,W),G=!0,X||(Y=[te(h,"change",t[5]),te(E,"input",t[6]),te(w,"change",t[7]),te(n,"submit",wi(t[4]))],X=!0)},p(V,[W]){V[0].if&&V[0].if.eth?j||(j=Kf(),j.c(),j.m(h,null)):j&&(j.d(1),j=null),W&4&&$e(h,V[2]),V[2]==1||V[2]==2?x?x.p(V,W):(x=Yf(V),x.c(),x.m(n,y)):x&&(x.d(1),x=null),W&1&&E.value!==V[0].hostname&&oe(E,V[0].hostname),W&2&&(w.checked=V[1]),V[1]?ae?(ae.p(V,W),W&2&&I(ae,1)):(ae=Qf(V),ae.c(),I(ae,1),ae.m(O,null)):ae&&(Ae(),q(ae,1,1,()=>{ae=null}),Pe()),V[1]?ee||(ee=Xf(),ee.c(),ee.m(n,z)):ee&&(ee.d(1),ee=null);const we={};W&8&&(we.active=V[3]),Q.$set(we)},i(V){G||(I(ae),I(Q.$$.fragment,V),G=!0)},o(V){q(ae),q(Q.$$.fragment,V),G=!1},d(V){V&&$(e),j&&j.d(),x&&x.d(),ae&&ae.d(),ee&&ee.d(),V&&$(K),se(Q,V),X=!1,ze(Y)}}}function ep(t,e,l){let{sysinfo:n={}}=e,i=!1,o=1,u=!1,a=0;function m(){var v="";a++;var d=function(){setTimeout(m,1e3)};if(n.net.ip&&a%3==0){if(!n.net.ip){d();return}v="http://"+n.net.ip}else n.hostname&&a%3==1?v="http://"+n.hostname:n.hostname&&a%3==2?v="http://"+n.hostname+".local":v="";console&&console.log("Trying url "+v),Wt.update(y=>(y.trying=v,y));var g=new XMLHttpRequest;g.timeout=5e3,g.addEventListener("abort",d),g.addEventListener("error",d),g.addEventListener("timeout",d),g.addEventListener("load",function(y){window.location.href=v||"/"}),g.open("GET",v+"/is-alive",!0),g.send()}async function f(v){l(3,u=!0);const d=new FormData(v.target),g=new URLSearchParams;for(let M of d){const[E,R]=M;g.append(E,R)}let P=await(await fetch("/save",{method:"POST",body:g})).json();l(3,u=!1),Wt.update(M=>(M.hostname=d.get("sh"),M.usrcfg=P.success,M.booting=P.reboot,i&&(M.net.ip=d.get("si"),M.net.mask=d.get("su"),M.net.gw=d.get("sg"),M.net.dns1=d.get("sd")),setTimeout(m,5e3),M))}function p(){o=tt(this),l(2,o)}function _(){n.hostname=this.value,l(0,n)}function h(){i=this.checked,l(1,i)}return t.$$set=v=>{"sysinfo"in v&&l(0,n=v.sysinfo)},[n,i,o,u,f,p,_,h]}class tp extends Re{constructor(e){super(),Le(this,e,ep,x_,Ee,{sysinfo:0})}}function lp(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y,P;return d=new kt({props:{active:t[2],message:"Uploading file, please wait"}}),{c(){e=c("div"),l=c("div"),n=c("strong"),i=N("Upload "),o=N(t[1]),u=b(),a=c("p"),a.textContent="Select a suitable file and click upload",m=b(),f=c("form"),p=c("input"),_=b(),h=c("div"),h.innerHTML='',v=b(),re(d.$$.fragment),r(a,"class","mb-4"),r(p,"name","file"),r(p,"type","file"),r(h,"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(M,E){S(M,e,E),s(e,l),s(l,n),s(n,i),s(n,o),s(l,u),s(l,a),s(l,m),s(l,f),s(f,p),s(f,_),s(f,h),S(M,v,E),ie(d,M,E),g=!0,y||(P=te(f,"submit",t[3]),y=!0)},p(M,[E]){(!g||E&2)&&J(o,M[1]),(!g||E&1)&&r(f,"action",M[0]);const R={};E&4&&(R.active=M[2]),d.$set(R)},i(M){g||(I(d.$$.fragment,M),g=!0)},o(M){q(d.$$.fragment,M),g=!1},d(M){M&&$(e),M&&$(v),se(d,M),y=!1,P()}}}function np(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 Co extends Re{constructor(e){super(),Le(this,e,np,lp,Ee,{action:0,title:1})}}function ip(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y,P,M,E,R,O,F,w,D,ne,H,z,U,K,Q,G;return U=new kt({props:{active:t[1],message:"Saving preferences"}}),{c(){e=c("div"),l=c("div"),n=c("form"),i=c("div"),i.textContent="Various permissions we need to do stuff:",o=b(),u=c("hr"),a=b(),m=c("div"),f=N("Enable one-click upgrade? (implies data collection)"),p=c("br"),_=b(),h=c("a"),v=N("Read more"),d=c("br"),g=b(),y=c("label"),P=c("input"),E=N(" Yes"),R=c("label"),O=c("input"),w=N(" No"),D=c("br"),ne=b(),H=c("div"),H.innerHTML='',z=b(),re(U.$$.fragment),r(h,"href",Rt("Data-collection-on-one-click-firmware-upgrade")),r(h,"target","_blank"),r(h,"class","text-blue-600 hover:text-blue-800"),r(P,"type","radio"),r(P,"name","sf"),P.value=1,P.checked=M=t[0].fwconsent===1,r(P,"class","rounded m-2"),P.required=!0,r(O,"type","radio"),r(O,"name","sf"),O.value=2,O.checked=F=t[0].fwconsent===2,r(O,"class","rounded m-2"),O.required=!0,r(m,"class","my-3"),r(H,"class","my-3"),r(n,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-3 lg:grid-cols-2")},m(X,Y){S(X,e,Y),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),s(n,m),s(m,f),s(m,p),s(m,_),s(m,h),s(h,v),s(m,d),s(m,g),s(m,y),s(y,P),s(y,E),s(m,R),s(R,O),s(R,w),s(m,D),s(n,ne),s(n,H),S(X,z,Y),ie(U,X,Y),K=!0,Q||(G=te(n,"submit",wi(t[2])),Q=!0)},p(X,[Y]){(!K||Y&1&&M!==(M=X[0].fwconsent===1))&&(P.checked=M),(!K||Y&1&&F!==(F=X[0].fwconsent===2))&&(O.checked=F);const j={};Y&2&&(j.active=X[1]),U.$set(j)},i(X){K||(I(U.$$.fragment,X),K=!0)},o(X){q(U.$$.fragment,X),K=!1},d(X){X&&$(e),X&&$(z),se(U,X),Q=!1,G()}}}function sp(t,e,l){let{sysinfo:n={}}=e,i=!1;async function o(u){l(1,i=!0);const a=new FormData(u.target),m=new URLSearchParams;for(let _ of a){const[h,v]=_;m.append(h,v)}let p=await(await fetch("/save",{method:"POST",body:m})).json();l(1,i=!1),Wt.update(_=>(_.fwconsent=a.sf===!0?1:a.sf===!1?2:0,_.booting=p.reboot,_)),fn("/")}return t.$$set=u=>{"sysinfo"in u&&l(0,n=u.sysinfo)},[n,i,o]}class op extends Re{constructor(e){super(),Le(this,e,sp,ip,Ee,{sysinfo:0})}}function Zf(t,e,l){const n=t.slice();return n[17]=e[l],n[18]=e,n[19]=l,n}function Jf(t,e,l){const n=t.slice();return n[20]=e[l],n[22]=l,n}function xf(t,e,l){const n=t.slice();return n[20]=e[l],n[22]=l,n}function ec(t,e,l){const n=t.slice();return n[20]=e[l],n[22]=l,n}function tc(t){let e,l,n=t[0].o,i=[];for(let u=0;uq(i[u],1,1,()=>{i[u]=null});return{c(){for(let u=0;uSave',R=b(),re(O.$$.fragment),F=b(),re(w.$$.fragment),r(l,"class","text-sm"),r(i,"href",Rt("Price-configuration")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"class","m-3"),r(p,"type","hidden"),r(p,"name","r"),p.value="true",r(g,"type","button"),r(g,"class","btn-pri"),r(P,"class","text-center"),r(E,"class","text-right"),r(v,"class","grid grid-cols-3"),r(f,"autocomplete","off"),r(e,"class","cnt")},m(U,K){S(U,e,K),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),s(e,a),s(e,m),s(e,f),s(f,p),s(f,_),z&&z.m(f,null),s(f,h),s(f,v),s(v,d),s(d,g),s(v,y),s(v,P),s(v,M),s(v,E),S(U,R,K),ie(O,U,K),S(U,F,K),ie(w,U,K),D=!0,ne||(H=[te(g,"click",t[6]),te(f,"submit",wi(t[4]))],ne=!0)},p(U,[K]){U[0].o?z?(z.p(U,K),K&1&&I(z,1)):(z=tc(U),z.c(),I(z,1),z.m(f,h)):z&&(Ae(),q(z,1,1,()=>{z=null}),Pe());const Q={};K&2&&(Q.active=U[1]),O.$set(Q);const G={};K&4&&(G.active=U[2]),w.$set(G)},i(U){D||(I(o.$$.fragment,U),I(z),I(O.$$.fragment,U),I(w.$$.fragment,U),D=!0)},o(U){q(o.$$.fragment,U),q(z),q(O.$$.fragment,U),q(w.$$.fragment,U),D=!1},d(U){U&&$(e),se(o),z&&z.d(),U&&$(R),se(O,U),U&&$(F),se(w,U),ne=!1,ze(H)}}}function ap(t,e,l){let n=["mo","tu","we","th","fr","sa","su"],i={},o=!0,u=!1;e1.subscribe(R=>{R.o&&(l(0,i=R),l(1,o=!1))}),Zm();async function a(R){l(2,u=!0);const O=new URLSearchParams;O.append("r","true"),O.append("rc",i.o.length),i.o.forEach(function(w,D){O.append("rt"+D,w.t),O.append("rn"+D,w.n),O.append("rd"+D,w.d),O.append("ra"+D,w.a),O.append("rh"+D,w.h),O.append("rv"+D,w.v)}),await(await fetch("/save",{method:"POST",body:O})).json(),l(2,u=!1),fn("/configuration")}let m=function(R,O){return R.includes(O)?R=R.filter(function(F){return F!==O}):R.push(O),R},f=function(){let R=i.o;R.push({t:1,n:"",d:3,a:[0,1,2,3,4,5,6,7],h:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],v:.01}),l(0,i.o=R,i)},p=function(R){let O=i.o;O.splice(R,1),l(0,i.o=O,i)};function _(R,O){R[O].n=this.value,l(0,i)}function h(R,O){R[O].d=tt(this),l(0,i)}function v(R,O){R[O].t=tt(this),l(0,i)}function d(R,O){R[O].v=ge(this.value),l(0,i)}return[i,o,u,n,a,m,f,p,_,h,v,d,(R,O,F,w)=>l(0,F[w].a=m(R.a,O),i),(R,O,F,w)=>l(0,F[w].h=m(R.h,O),i),(R,O,F,w)=>l(0,F[w].h=m(R.h,O+12),i),R=>p(R),R=>p(R)]}class up extends Re{constructor(e){super(),Le(this,e,ap,rp,Ee,{})}}function fp(t){let e,l;return e=new Qm({props:{data:t[1],sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(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||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function cp(t){let e,l;return e=new R_({props:{sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function mp(t){let e,l;return e=new up({}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function _p(t){let e,l;return e=new V_({props:{sysinfo:t[0],data:t[1]}}),{c(){re(e.$$.fragment)},m(n,i){ie(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||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function pp(t){let e,l;return e=new Co({props:{title:"CA",action:"/mqtt-ca"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function dp(t){let e,l;return e=new Co({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function vp(t){let e,l;return e=new Co({props:{title:"private key",action:"/mqtt-key"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function hp(t){let e,l;return e=new op({props:{sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function bp(t){let e,l;return e=new tp({props:{sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function gp(t){let e,l;return e=new J_({props:{sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function kp(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,y,P,M,E,R,O,F;return e=new sm({props:{data:t[1]}}),n=new ml({props:{path:"/",$$slots:{default:[fp]},$$scope:{ctx:t}}}),o=new ml({props:{path:"/configuration",$$slots:{default:[cp]},$$scope:{ctx:t}}}),a=new ml({props:{path:"/priceconfig",$$slots:{default:[mp]},$$scope:{ctx:t}}}),f=new ml({props:{path:"/status",$$slots:{default:[_p]},$$scope:{ctx:t}}}),_=new ml({props:{path:"/mqtt-ca",$$slots:{default:[pp]},$$scope:{ctx:t}}}),v=new ml({props:{path:"/mqtt-cert",$$slots:{default:[dp]},$$scope:{ctx:t}}}),g=new ml({props:{path:"/mqtt-key",$$slots:{default:[vp]},$$scope:{ctx:t}}}),P=new ml({props:{path:"/consent",$$slots:{default:[hp]},$$scope:{ctx:t}}}),E=new ml({props:{path:"/setup",$$slots:{default:[bp]},$$scope:{ctx:t}}}),O=new ml({props:{path:"/vendor",$$slots:{default:[gp]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment),l=b(),re(n.$$.fragment),i=b(),re(o.$$.fragment),u=b(),re(a.$$.fragment),m=b(),re(f.$$.fragment),p=b(),re(_.$$.fragment),h=b(),re(v.$$.fragment),d=b(),re(g.$$.fragment),y=b(),re(P.$$.fragment),M=b(),re(E.$$.fragment),R=b(),re(O.$$.fragment)},m(w,D){ie(e,w,D),S(w,l,D),ie(n,w,D),S(w,i,D),ie(o,w,D),S(w,u,D),ie(a,w,D),S(w,m,D),ie(f,w,D),S(w,p,D),ie(_,w,D),S(w,h,D),ie(v,w,D),S(w,d,D),ie(g,w,D),S(w,y,D),ie(P,w,D),S(w,M,D),ie(E,w,D),S(w,R,D),ie(O,w,D),F=!0},p(w,D){const ne={};D&2&&(ne.data=w[1]),e.$set(ne);const H={};D&7&&(H.$$scope={dirty:D,ctx:w}),n.$set(H);const z={};D&5&&(z.$$scope={dirty:D,ctx:w}),o.$set(z);const U={};D&4&&(U.$$scope={dirty:D,ctx:w}),a.$set(U);const K={};D&7&&(K.$$scope={dirty:D,ctx:w}),f.$set(K);const Q={};D&4&&(Q.$$scope={dirty:D,ctx:w}),_.$set(Q);const G={};D&4&&(G.$$scope={dirty:D,ctx:w}),v.$set(G);const X={};D&4&&(X.$$scope={dirty:D,ctx:w}),g.$set(X);const Y={};D&5&&(Y.$$scope={dirty:D,ctx:w}),P.$set(Y);const j={};D&5&&(j.$$scope={dirty:D,ctx:w}),E.$set(j);const x={};D&5&&(x.$$scope={dirty:D,ctx:w}),O.$set(x)},i(w){F||(I(e.$$.fragment,w),I(n.$$.fragment,w),I(o.$$.fragment,w),I(a.$$.fragment,w),I(f.$$.fragment,w),I(_.$$.fragment,w),I(v.$$.fragment,w),I(g.$$.fragment,w),I(P.$$.fragment,w),I(E.$$.fragment,w),I(O.$$.fragment,w),F=!0)},o(w){q(e.$$.fragment,w),q(n.$$.fragment,w),q(o.$$.fragment,w),q(a.$$.fragment,w),q(f.$$.fragment,w),q(_.$$.fragment,w),q(v.$$.fragment,w),q(g.$$.fragment,w),q(P.$$.fragment,w),q(E.$$.fragment,w),q(O.$$.fragment,w),F=!1},d(w){se(e,w),w&&$(l),se(n,w),w&&$(i),se(o,w),w&&$(u),se(a,w),w&&$(m),se(f,w),w&&$(p),se(_,w),w&&$(h),se(v,w),w&&$(d),se(g,w),w&&$(y),se(P,w),w&&$(M),se(E,w),w&&$(R),se(O,w)}}}function wp(t){let e,l,n,i;const o=[$p,Cp],u=[];function a(m,f){return m[0].trying?0:1}return e=a(t),l=u[e]=o[e](t),{c(){l.c(),n=Ke()},m(m,f){u[e].m(m,f),S(m,n,f),i=!0},p(m,f){let p=e;e=a(m),e===p?u[e].p(m,f):(Ae(),q(u[p],1,1,()=>{u[p]=null}),Pe(),l=u[e],l?l.p(m,f):(l=u[e]=o[e](m),l.c()),I(l,1),l.m(n.parentNode,n))},i(m){i||(I(l),i=!0)},o(m){q(l),i=!1},d(m){u[e].d(m),m&&$(n)}}}function yp(t){let e,l;return e=new kt({props:{active:"true",message:"Device is upgrading, please wait"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function Cp(t){let e,l;return e=new kt({props:{active:"true",message:"Device is booting, please wait"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function $p(t){let e,l;return e=new kt({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[0].trying}}),{c(){re(e.$$.fragment)},m(n,i){ie(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||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function Sp(t){let e,l,n,i,o,u;l=new Lc({props:{$$slots:{default:[kp]},$$scope:{ctx:t}}});const a=[yp,wp],m=[];function f(p,_){return p[0].upgrading?0:p[0].booting?1:-1}return~(i=f(t))&&(o=m[i]=a[i](t)),{c(){e=c("div"),re(l.$$.fragment),n=b(),o&&o.c(),r(e,"class","container mx-auto m-3")},m(p,_){S(p,e,_),ie(l,e,null),s(e,n),~i&&m[i].m(e,null),u=!0},p(p,[_]){const h={};_&7&&(h.$$scope={dirty:_,ctx:p}),l.$set(h);let v=i;i=f(p),i===v?~i&&m[i].p(p,_):(o&&(Ae(),q(m[v],1,1,()=>{m[v]=null}),Pe()),~i?(o=m[i],o?o.p(p,_):(o=m[i]=a[i](p),o.c()),I(o,1),o.m(e,null)):o=null)},i(p){u||(I(l.$$.fragment,p),I(o),u=!0)},o(p){q(l.$$.fragment,p),q(o),u=!1},d(p){p&&$(e),se(l),~i&&m[i].d()}}}function Mp(t,e,l){let n={};Wt.subscribe(o=>{l(0,n=o),n.vndcfg===!1?fn("/vendor"):n.usrcfg===!1?fn("/setup"):n.fwconsent===0&&fn("/consent"),n.ui.k===1?(console.log("dark"),document.documentElement.classList.add("dark")):n.ui.k===0?(console.log("light"),document.documentElement.classList.remove("dark")):window.matchMedia("(prefers-color-scheme: dark)").matches?(console.log("dark auto"),document.documentElement.classList.add("dark")):(console.log("light auto"),document.documentElement.classList.remove("dark"))}),bo();let i={};return Bc.subscribe(o=>{l(1,i=o)}),[n,i]}class Tp extends Re{constructor(e){super(),Le(this,e,Mp,Sp,Ee,{})}}new Tp({target:document.getElementById("app")}); diff --git a/lib/SvelteUi/app/src/app.postcss b/lib/SvelteUi/app/src/app.postcss index 9eeb4b75..e060fd0c 100644 --- a/lib/SvelteUi/app/src/app.postcss +++ b/lib/SvelteUi/app/src/app.postcss @@ -2,13 +2,17 @@ @tailwind components; @tailwind utilities; +.hdr { + @apply bg-violet-600 p-1 rounded-md mx-2 dark:bg-violet-900 +} + .gh-logo { width: 2rem; height: 2rem; } .cnt { - @apply m-2 p-2 rounded dark:bg-gray-800 bg-white dark:text-white shadow-lg dark:shadow-xl dark:shadow-gray-900 dark:drop-shadow-md; + @apply m-2 p-2 rounded dark:bg-gray-800 bg-white dark:text-white shadow-lg dark:shadow-gray-900 dark:drop-shadow-md; min-height: 268px; } @@ -45,33 +49,42 @@ } .bd-green { - @apply my-auto bg-green-500 text-green-100 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded + @apply my-auto dark:bg-green-600 bg-green-500 text-green-100 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded } .bd-yellow { - @apply my-auto bg-yellow-500 text-yellow-100 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded + @apply my-auto dark:bg-yellow-600 bg-yellow-500 text-yellow-100 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded } .bd-red { - @apply my-auto bg-red-500 text-red-100 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded + @apply my-auto dark:bg-red-600 bg-red-500 text-red-100 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded } .bd-blue { - @apply my-auto bg-blue-500 text-blue-100 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded + @apply my-auto dark:bg-blue-600 bg-blue-500 text-blue-100 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded } .bd-gray { - @apply my-auto bg-gray-500 text-gray-100 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded + @apply my-auto dark:bg-gray-600 bg-gray-500 text-gray-100 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded } .bd-on { - @apply my-auto bg-green-500 text-green-100 text-xs font-semibold mr-1 px-1 py-0.5 rounded + @apply my-auto dark:bg-green-600 bg-green-500 text-green-100 text-xs font-semibold mr-1 px-1 py-0.5 rounded } .bd-off { - @apply my-auto bg-gray-500 text-gray-100 text-xs font-semibold mr-1 px-1 py-0.5 rounded + @apply my-auto dark:bg-gray-600 bg-gray-500 text-gray-100 text-xs font-semibold mr-1 px-1 py-0.5 rounded } .btn-pri { - @apply py-2 px-4 rounded bg-blue-500 text-white mr-3 + @apply py-2 px-4 rounded dark:bg-blue-600 bg-blue-500 text-white mr-3 +} +.btn-red { + @apply py-2 px-4 rounded dark:bg-red-600 bg-red-500 text-white ml-2 +} +.btn-yellow { + @apply py-2 px-4 rounded dark:bg-yellow-600 bg-yellow-500 text-white ml-2 } .btn-pri-sm { - @apply text-xs py-1 px-2 rounded bg-blue-500 text-white mr-3 + @apply text-xs py-1 px-2 rounded dark:bg-blue-600 bg-blue-500 text-white mr-3 +} +.btn-yellow-sm { + @apply text-xs py-1 px-2 rounded dark:bg-yellow-600 bg-yellow-500 text-white mr-3 } .pl-root { diff --git a/lib/SvelteUi/app/src/lib/AmpPlot.svelte b/lib/SvelteUi/app/src/lib/AmpPlot.svelte index 1aea5b19..8c0c72ca 100644 --- a/lib/SvelteUi/app/src/lib/AmpPlot.svelte +++ b/lib/SvelteUi/app/src/lib/AmpPlot.svelte @@ -18,7 +18,7 @@ label: fmtnum(v) + 'A', title: v.toFixed(1) + ' A', value: isNaN(v) ? 0 : v, - color: ampcol(v ? (v)/(max)*100 : 0) + color: ampcol(v ? (v)/(max)*100 : 0, document.documentElement.classList.contains('dark')) }; }; diff --git a/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte b/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte index ce1b2960..680bab69 100644 --- a/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte +++ b/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte @@ -825,12 +825,12 @@ {/if} -
+
- +
- +
diff --git a/lib/SvelteUi/app/src/lib/DayPlot.svelte b/lib/SvelteUi/app/src/lib/DayPlot.svelte index 95a1ef09..d8f253a3 100644 --- a/lib/SvelteUi/app/src/lib/DayPlot.svelte +++ b/lib/SvelteUi/app/src/lib/DayPlot.svelte @@ -9,6 +9,8 @@ let max; let min; + let dark = document.documentElement.classList.contains('dark'); + $: { let i = 0; let yTicks = []; @@ -34,7 +36,7 @@ label2: exp.toFixed(1), title2: exp.toFixed(2) + ' kWh', value2: exp*10, - color: '#7c3aed', + color: dark ? '#5c2da5' : '#7c3aed', color2: '#37829E' }); min = Math.max(min, exp*10); @@ -57,7 +59,7 @@ label2: exp.toFixed(1), title2: exp.toFixed(2) + ' kWh', value2: exp*10, - color: '#7c3aed', + color: dark ? '#5c2da5' : '#7c3aed', color2: '#37829E' }); min = Math.max(min, exp*10); diff --git a/lib/SvelteUi/app/src/lib/Header.svelte b/lib/SvelteUi/app/src/lib/Header.svelte index 11b87f3a..e9359454 100644 --- a/lib/SvelteUi/app/src/lib/Header.svelte +++ b/lib/SvelteUi/app/src/lib/Header.svelte @@ -41,7 +41,7 @@ }); -