From 48eb640838f2502f8891036ef0e780dcd60667d7 Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Fri, 5 May 2023 18:12:26 +0200 Subject: [PATCH] Changes after testing --- lib/EnergyAccounting/src/EnergyAccounting.cpp | 6 +++-- lib/SvelteUi/app/dist/index.css | 2 +- lib/SvelteUi/app/dist/index.js | 2 +- lib/SvelteUi/app/src/app.postcss | 3 ++- .../app/src/lib/AccountingData.svelte | 4 ++-- lib/SvelteUi/src/AmsWebServer.cpp | 18 ++++++++------- src/AmsToMqttBridge.cpp | 22 +++++++++++++++++-- 7 files changed, 40 insertions(+), 17 deletions(-) diff --git a/lib/EnergyAccounting/src/EnergyAccounting.cpp b/lib/EnergyAccounting/src/EnergyAccounting.cpp index 66657f0e..ec7bf752 100644 --- a/lib/EnergyAccounting/src/EnergyAccounting.cpp +++ b/lib/EnergyAccounting/src/EnergyAccounting.cpp @@ -125,13 +125,15 @@ bool EnergyAccounting::update(AmsData* amsData) { totalImport += ds->getDayImport(i); totalExport += ds->getDayExport(i); } - uint8_t accuracy; + uint8_t accuracy = 0; uint64_t importUpdate = totalImport, exportUpdate = totalExport; - while(totalImport > UINT32_MAX || totalExport > UINT32_MAX) { + while(importUpdate > UINT32_MAX || exportUpdate > UINT32_MAX) { accuracy++; importUpdate = totalImport / pow(10, accuracy); exportUpdate = totalExport / pow(10, accuracy); } + data.lastMonthImport = importUpdate; + data.lastMonthExport = exportUpdate; data.lastMonthAccuracy = accuracy; data.month = local.Month; diff --git a/lib/SvelteUi/app/dist/index.css b/lib/SvelteUi/app/dist/index.css index 3e6869b3..d3b8ffcc 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-3{margin-right:.75rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-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-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}.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-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-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}.pr-1{padding-right:.25rem}.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}.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-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity))}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.gh-logo{height:2rem;width:2rem}.cnt{--tw-bg-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-radius:.25rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);margin:.5rem;padding:.5rem}.gwf{height:16rem}@media (min-width:640px){.gwf{grid-column:span 2/span 2}}@media (min-width:768px){.gwf{grid-column:span 3/span 3}}@media (min-width:1024px){.gwf{grid-column:span 4/span 4}}@media (min-width:1280px){.gwf{grid-column:span 5/span 5}}@media (min-width:1536px){.gwf{grid-column:span 6/span 6}}.in-pre{border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;border-width:1px 0 1px 1px}.in-post,.in-pre{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}.in-post{border-bottom-right-radius:.375rem;border-top-right-radius:.375rem;border-width:1px 1px 1px 0}.in-post,.in-txt{border-color:rgb(209 213 219/var(--tw-border-opacity))}.in-txt{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-txt:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-f{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-f:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-m{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-m:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-l{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;border-top-right-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-l:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-s{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem;width:100%}.in-s:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.tr{text-align:right}.bd-green{background-color:rgb(34 197 94/var(--tw-bg-opacity));color:rgb(220 252 231/var(--tw-text-opacity))}.bd-green,.bd-yellow{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-yellow{background-color:rgb(234 179 8/var(--tw-bg-opacity));color:rgb(254 249 195/var(--tw-text-opacity))}.bd-red{background-color:rgb(239 68 68/var(--tw-bg-opacity));color:rgb(254 226 226/var(--tw-text-opacity))}.bd-blue,.bd-red{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-blue{background-color:rgb(59 130 246/var(--tw-bg-opacity));color:rgb(219 234 254/var(--tw-text-opacity))}.bd-gray{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(243 244 246/var(--tw-text-opacity));font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.btn-pri{padding:.5rem 1rem}.btn-pri,.btn-pri-sm{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));margin-right:.75rem}.btn-pri-sm{font-size:.75rem;line-height:1rem;padding:.25rem .5rem}.pl-root{position:relative}.pl-ov{left:25%;position:absolute;text-align:center;top:27%;width:50%}.pl-val{font-size:1.7rem}.pl-unt{color:gray;font-size:1rem}.pl-sub{font-size:1rem;padding-top:10px}.pl-snt{color:gray;font-size:.7rem}.pl-lab{font-size:1rem}.chart{height:100%;margin:0 auto;width:100%}svg{position:relative;width:100%}.tick{font-family:Helvetica,Arial;font-size:.85em;font-weight:200}.tick line{stroke:#e2e2e2;stroke-dasharray:2}.tick text{fill:#999;text-anchor:start}.tick.tick-0 line{stroke-dasharray:0}.tick.tick-green line{stroke:#32d900!important}.tick.tick-green text{fill:#32d900!important}.tick.tick-orange line{stroke:#d95600!important}.tick.tick-orange text{fill:#d95600!important}.x-axis .tick text{text-anchor:middle}.bars rect{stroke:#000;stroke-opacity:.25;opacity:.9}.bars text{display:block;font-family:Helvetica,Arial;font-size:.85em;text-align:center}.hover\:text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity))}@media (min-width:640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width:1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width:1536px){.\32xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}} +/*! tailwindcss v3.3.2 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}[multiple],[type=date],[type=datetime-local],[type=email],[type=month],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=time],[type=url],[type=week],select,textarea{--tw-shadow:0 0 #0000;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-radius:0;border-width:1px;font-size:1rem;line-height:1.5rem;padding:.5rem .75rem}[multiple]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=email]:focus,[type=month]:focus,[type=number]:focus,[type=password]:focus,[type=search]:focus,[type=tel]:focus,[type=text]:focus,[type=time]:focus,[type=url]:focus,[type=week]:focus,select:focus,textarea:focus{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);border-color:#2563eb;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-bottom:0;padding-top:0}select{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple]{background-image:none;background-position:0 0;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{--tw-shadow:0 0 #0000;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-origin:border-box;border-color:#6b7280;border-width:1px;color:#2563eb;display:inline-block;flex-shrink:0;height:1rem;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1rem}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}[type=checkbox]:checked,[type=radio]:checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}[type=checkbox]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E")}[type=radio]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")}[type=checkbox]:checked:focus,[type=checkbox]:checked:hover,[type=radio]:checked:focus,[type=radio]:checked:hover{background-color:currentColor;border-color:transparent}[type=checkbox]:indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}[type=checkbox]:indeterminate:focus,[type=checkbox]:indeterminate:hover{background-color:currentColor;border-color:transparent}[type=file]{background:unset;border-color:inherit;border-radius:0;border-width:0;font-size:unset;line-height:inherit;padding:0}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.static{position:static}.fixed{position:fixed}.inset-0{inset:0}.z-40{z-index:40}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.float-right{float:right}.clear-both{clear:both}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-3{margin:.75rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-bottom:.25rem;margin-top:.25rem}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.my-auto{margin-bottom:auto;margin-top:auto}.mb-1{margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mr-3{margin-right:.75rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-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-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}.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-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-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}.pr-1{padding-right:.25rem}.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}.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-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity))}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.gh-logo{height:2rem;width:2rem}.cnt{--tw-bg-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-radius:.25rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);margin:.5rem;min-height:268px;padding:.5rem}.gwf{height:16rem}@media (min-width:640px){.gwf{grid-column:span 2/span 2}}@media (min-width:768px){.gwf{grid-column:span 3/span 3}}@media (min-width:1024px){.gwf{grid-column:span 4/span 4}}@media (min-width:1280px){.gwf{grid-column:span 5/span 5}}@media (min-width:1536px){.gwf{grid-column:span 6/span 6}}.in-pre{border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;border-width:1px 0 1px 1px}.in-post,.in-pre{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}.in-post{border-bottom-right-radius:.375rem;border-top-right-radius:.375rem;border-width:1px 1px 1px 0}.in-post,.in-txt{border-color:rgb(209 213 219/var(--tw-border-opacity))}.in-txt{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-txt:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-f{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-f:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-m{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-m:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-l{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;border-top-right-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-l:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-s{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem;width:100%}.in-s:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.tr{text-align:right}.bd-green{background-color:rgb(34 197 94/var(--tw-bg-opacity));color:rgb(220 252 231/var(--tw-text-opacity))}.bd-green,.bd-yellow{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-yellow{background-color:rgb(234 179 8/var(--tw-bg-opacity));color:rgb(254 249 195/var(--tw-text-opacity))}.bd-red{background-color:rgb(239 68 68/var(--tw-bg-opacity));color:rgb(254 226 226/var(--tw-text-opacity))}.bd-blue,.bd-red{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-blue{background-color:rgb(59 130 246/var(--tw-bg-opacity));color:rgb(219 234 254/var(--tw-text-opacity))}.bd-gray{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(243 244 246/var(--tw-text-opacity));font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.btn-pri{padding:.5rem 1rem}.btn-pri,.btn-pri-sm{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));margin-right:.75rem}.btn-pri-sm{font-size:.75rem;line-height:1rem;padding:.25rem .5rem}.pl-root{position:relative}.pl-ov{left:25%;position:absolute;text-align:center;top:27%;width:50%}.pl-val{font-size:1.7rem}.pl-unt{color:gray;font-size:1rem}.pl-sub{font-size:1rem;padding-top:10px}.pl-snt{color:gray;font-size:.7rem}.pl-lab{font-size:1rem}.chart{height:100%;margin:0 auto;width:100%}svg{position:relative;width:100%}.tick{font-family:Helvetica,Arial;font-size:.85em;font-weight:200}.tick line{stroke:#e2e2e2;stroke-dasharray:2}.tick text{fill:#999;text-anchor:start}.tick.tick-0 line{stroke-dasharray:0}.tick.tick-green line{stroke:#32d900!important}.tick.tick-green text{fill:#32d900!important}.tick.tick-orange line{stroke:#d95600!important}.tick.tick-orange text{fill:#d95600!important}.x-axis .tick text{text-anchor:middle}.bars rect{stroke:#000;stroke-opacity:.25;opacity:.9}.bars text{display:block;font-family:Helvetica,Arial;font-size:.85em;text-align:center}.hover\:text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity))}@media (min-width:640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width:1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width:1536px){.\32xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}} diff --git a/lib/SvelteUi/app/dist/index.js b/lib/SvelteUi/app/dist/index.js index a38dbd02..eb684549 100644 --- a/lib/SvelteUi/app/dist/index.js +++ b/lib/SvelteUi/app/dist/index.js @@ -1,7 +1,7 @@ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).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 ne(){}function Xt(t,e){for(const l in e)t[l]=e[l];return t}function qf(t){return t()}function yr(){return Object.create(null)}function Ve(t){t.forEach(qf)}function eo(t){return typeof t=="function"}function ke(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let os;function Fc(t,e){return os||(os=document.createElement("a")),os.href=e,t===os.href}function Rc(t){return Object.keys(t).length===0}function to(t,...e){if(t==null)return ne;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function ni(t){let e;return to(t,l=>e=l)(),e}function il(t,e,l){t.$$.on_destroy.push(to(e,l))}function lo(t,e,l,n){if(t){const i=Uf(t,e,l,n);return t[0](i)}}function Uf(t,e,l,n){return t[1]&&n?Xt(l.ctx.slice(),t[1](n(e))):l.ctx}function no(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=[],r=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 hs(t){return function(e){return e.preventDefault(),t.call(this,e)}}function u(t,e,l){l==null?t.removeAttribute(e):t.getAttribute(e)!==l&&t.setAttribute(e,l)}function ii(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?t[n]=e[n]:u(t,n,e[n])}function ae(t){return t===""?null:+t}function Oc(t){return Array.from(t.childNodes)}function B(t,e){e=""+e,t.data!==e&&(t.data=e)}function qc(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Uc(t,e,l){~Lc.indexOf(l)?qc(t,e):B(t,e)}function V(t,e){t.value=e??""}function Hf(t,e,l,n){l===null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function Re(t,e,l){for(let n=0;n{r.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=K(n.contentWindow,"resize",e),e()}),s(t,n),()=>{(i||o&&n.contentWindow)&&o(),k(n)}}function Wc(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,l,n,e),i}function $r(t,e){return new t(e)}let wi;function bi(t){wi=t}function yi(){if(!wi)throw new Error("Function called outside component initialization");return wi}function Gc(t){yi().$$.on_mount.push(t)}function Bc(t){yi().$$.on_destroy.push(t)}function Yc(){const t=yi();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=Wc(e,l,{cancelable:n});return i.slice().forEach(r=>{r.call(t,o)}),!o.defaultPrevented}return!0}}function gi(t,e){return yi().$$.context.set(t,e),e}function Il(t){return yi().$$.context.get(t)}const xn=[],ms=[];let ei=[];const Cr=[],jf=Promise.resolve();let Ws=!1;function Wf(){Ws||(Ws=!0,jf.then(Gf))}function zc(){return Wf(),jf}function tt(t){ei.push(t)}const Ls=new Set;let Zn=0;function Gf(){if(Zn!==0)return;const t=wi;do{try{for(;Znt.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),ei=e}const fs=new Set;let xl;function Te(){xl={r:0,c:[],p:xl}}function Se(){xl.r||Ve(xl.c),xl=xl.p}function N(t,e){t&&t.i&&(fs.delete(t),t.i(e))}function D(t,e,l,n){if(t&&t.o){if(fs.has(t))return;fs.add(t),xl.c.push(()=>{fs.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function Bf(t,e){const l={},n={},i={$$scope:1};let o=t.length;for(;o--;){const r=t[o],a=e[o];if(a){for(const p in r)p in a||(n[p]=1);for(const p in a)i[p]||(l[p]=a[p],i[p]=1);t[o]=a}else for(const p in r)i[p]=1}for(const r in n)r in l||(l[r]=void 0);return l}function Tr(t){return typeof t=="object"&&t!==null?t:{}}function J(t){t&&t.c()}function X(t,e,l,n){const{fragment:i,after_update:o}=t.$$;i&&i.m(e,l),n||tt(()=>{const r=t.$$.on_mount.map(qf).filter(eo);t.$$.on_destroy?t.$$.on_destroy.push(...r):Ve(r),t.$$.on_mount=[]}),o.forEach(tt)}function Z(t,e){const l=t.$$;l.fragment!==null&&(Kc(l.after_update),Ve(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function Qc(t,e){t.$$.dirty[0]===-1&&(xn.push(t),Wf(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const h=v.length?v[0]:d;return f.ctx&&i(f.ctx[m],f.ctx[m]=h)&&(!f.skip_bound&&f.bound[m]&&f.bound[m](h),_&&Qc(t,m)),d}):[],f.update(),_=!0,Ve(f.before_update),f.fragment=n?n(f.ctx):!1,e.target){if(e.hydrate){const m=Oc(e.target);f.fragment&&f.fragment.l(m),m.forEach(k)}else f.fragment&&f.fragment.c();e.intro&&N(t.$$.fragment),X(t,e.target,e.anchor,e.customElement),Gf()}bi(p)}class $e{$destroy(){Z(this,1),this.$destroy=ne}$on(e,l){if(!eo(l))return ne;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&&!Rc(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Sr=t=>typeof t>"u",Yf=t=>typeof t=="function",zf=t=>typeof t=="number";function Xc(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Vf(){let t=0;return()=>t++}function Zc(){return Math.random().toString(36).substring(2)}const El=typeof window>"u";function Kf(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const Qf=(t,e)=>t?{}:{style:e},Gs=t=>({"aria-hidden":"true",...Qf(t,"display:none;")}),Jn=[];function Xf(t,e){return{subscribe:ut(t,e).subscribe}}function ut(t,e=ne){let l;const n=new Set;function i(a){if(ke(t,a)&&(t=a,l)){const p=!Jn.length;for(const f of n)f[1](),Jn.push(f,t);if(p){for(let f=0;f{n.delete(f),n.size===0&&l&&(l(),l=null)}}return{set:i,update:o,subscribe:r}}function Jc(t,e,l){const n=!Array.isArray(t),i=n?[t]:t,o=e.length<2;return Xf(l,r=>{let a=!1;const p=[];let f=0,_=ne;const m=()=>{if(f)return;_();const v=e(n?p[0]:p,r);o?r(v):_=eo(v)?v:ne},d=i.map((v,h)=>to(v,g=>{p[h]=g,f&=~(1<{f|=1<`@@svnav-ctx__${t}`,Bs=$i("LOCATION"),si=$i("ROUTER"),Zf=$i("ROUTE"),xc=$i("ROUTE_PARAMS"),e1=$i("FOCUS_ELEM"),Jf=/^:(.+)/,hi=(t,e,l)=>t.substr(e,l),Ys=(t,e)=>hi(t,0,e.length)===e,t1=t=>t==="",l1=t=>Jf.test(t),xf=t=>t[0]==="*",n1=t=>t.replace(/\*.*$/,""),ec=t=>t.replace(/(^\/+|\/+$)/g,"");function ul(t,e=!1){const l=ec(t).split("/");return e?l.filter(Boolean):l}const Os=(t,e)=>t+(e?`?${e}`:""),oo=t=>`/${ec(t)}`;function Ci(...t){const e=n=>ul(n,!0).join("/"),l=t.map(e).join("/");return oo(l)}const uo=1,bs=2,ln=3,i1=4,tc=5,s1=6,lc=7,o1=8,u1=9,nc=10,ic=11,r1={[uo]:"Link",[bs]:"Route",[ln]:"Router",[i1]:"useFocus",[tc]:"useLocation",[s1]:"useMatch",[lc]:"useNavigate",[o1]:"useParams",[u1]:"useResolvable",[nc]:"useResolve",[ic]:"navigate"},ro=t=>r1[t];function a1(t,e){let l;return t===bs?l=e.path?`path="${e.path}"`:"default":t===uo?l=`to="${e.to}"`:t===ln&&(l=`basepath="${e.basepath||""}"`),`<${ro(t)} ${l||""} />`}function f1(t,e,l,n){const i=l&&a1(n||t,l),o=i?` Occurred in: ${i}`:"",r=ro(t),a=Yf(e)?e(r):e;return`<${r}> ${a}${o}`}const sc=t=>(...e)=>t(f1(...e)),oc=sc(t=>{throw new Error(t)}),_s=sc(console.warn),Pr=4,c1=3,p1=2,m1=1,_1=1;function d1(t,e){const l=t.default?0:ul(t.fullPath).reduce((n,i)=>{let o=n;return o+=Pr,t1(i)?o+=_1:l1(i)?o+=p1:xf(i)?o-=Pr+m1:o+=c1,o},0);return{route:t,score:l,index:e}}function v1(t){return t.map(d1).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function uc(t,e){let l,n;const[i]=e.split("?"),o=ul(i),r=o[0]==="",a=v1(t);for(let p=0,f=a.length;p({..._,params:d,uri:C});if(_.default){n=v(e);continue}const h=ul(_.fullPath),g=Math.max(o.length,h.length);let y=0;for(;y{f===".."?p.pop():f!=="."&&p.push(f)}),Os(`/${p.join("/")}`,n)}function Nr(t,e){const{pathname:l,hash:n="",search:i="",state:o}=t,r=ul(e,!0),a=ul(l,!0);for(;r.length;)r[0]!==a[0]&&oc(ln,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),r.shift(),a.shift();return{pathname:Ci(...a),hash:n,search:i,state:o}}const Mr=t=>t.length===1?"":t,ao=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,o=i?Mr(hi(t,l)):"",r=i?hi(t,0,l):t,a=n?Mr(hi(r,e)):"";return{pathname:(n?hi(r,0,e):r)||"/",search:a,hash:o}},b1=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function g1(t,e,l){return Ci(l,h1(t,e))}function k1(t,e){const l=oo(n1(t)),n=ul(l,!0),i=ul(e,!0).slice(0,n.length),o=rc({fullPath:l},Ci(...i));return o&&o.uri}const qs="POP",w1="PUSH",y1="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 $1(t){let e=[],l=Us(t),n=qs;const i=(o=e)=>o.forEach(r=>r({location:l,action:n}));return{get location(){return l},listen(o){e.push(o);const r=()=>{l=Us(t),n=qs,i([o])};i([o]);const a=Kf(t,"popstate",r);return()=>{a(),e=e.filter(p=>p!==o)}},navigate(o,r){const{state:a={},replace:p=!1}=r||{};if(n=p?y1:w1,zf(o))r&&_s(ic,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=qs,t.history.go(o);else{const f={...a,_key:Zc()};try{t.history[p?"replaceState":"pushState"](f,"",o)}catch{t.location[p?"replace":"assign"](o)}}l=Us(t),i()}}}function Hs(t,e){return{...ao(e),state:t}}function C1(t="/"){let e=0,l=[Hs(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(Hs(n,o))},replaceState(n,i,o){l[e]=Hs(n,o)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const T1=!!(!El&&window.document&&window.document.createElement),S1=!El&&window.location.origin==="null",ac=$1(T1&&!S1?window:C1()),{navigate:ti}=ac;let wl=null,fc=!0;function P1(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nwl.level||t.level===wl.level&&P1(t.routerId,wl.routerId))&&(wl=t)}function M1(){wl=null}function A1(){fc=!1}function Ar(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=Kf(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function D1(t,e){return Number(t.dataset.svnavRouteEnd)===e}function I1(t){return/^H[1-6]$/i.test(t.tagName)}function Dr(t,e=document){return e.querySelector(t)}function E1(t){let l=Dr(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!D1(l,t);){if(I1(l))return l;const n=Dr("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function F1(t){Promise.resolve(ni(t.focusElement)).then(e=>{const l=e||E1(t.id);l||_s(ln,`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),!Ar(l)&&Ar(document.documentElement)})}const R1=(t,e,l)=>(n,i)=>zc().then(()=>{if(!wl||fc){A1();return}if(n&&F1(wl.route),t.announcements&&i){const{path:o,fullPath:r,meta:a,params:p,uri:f}=wl.route,_=t.createAnnouncement({path:o,fullPath:r,meta:a,params:p,uri:f},ni(l));Promise.resolve(_).then(m=>{e.set(m)})}M1()}),L1="position:fixed;top:-1px;left:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;";function O1(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},Qf(t[6],L1)],i={};for(let o=0;o`Navigated to ${le.uri}`,announcements:!0,...h},C=_,T=oo(_),P=Il(Bs),I=Il(si),S=!P,A=U1(),E=v&&!(I&&!I.manageFocus),F=ut("");il(t,F,le=>l(0,a=le));const z=I?I.disableInlineStyles:g,O=ut([]);il(t,O,le=>l(20,r=le));const R=ut(null);il(t,R,le=>l(18,i=le));let U=!1;const Y=S?0:I.level+1,H=S?ut((()=>Nr(El?ao(m):d.location,T))()):P;il(t,H,le=>l(17,n=le));const G=ut(n);il(t,G,le=>l(19,o=le));const L=R1(y,F,H),W=le=>de=>de.filter(ie=>ie.id!==le);function j(le){if(El){if(U)return;const de=rc(le,n.pathname);if(de)return U=!0,de}else O.update(de=>{const ie=W(le.id)(de);return ie.push(le),ie})}function ee(le){O.update(W(le))}return!S&&_!==Ir&&_s(ln,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:_}),S&&(Gc(()=>d.listen(de=>{const ie=Nr(de.location,T);G.set(n),H.set(ie)})),gi(Bs,H)),gi(si,{activeRoute:R,registerRoute:j,unregisterRoute:ee,manageFocus:E,level:Y,id:A,history:S?d:I.history,basepath:S?T:I.basepath,disableInlineStyles:z}),t.$$set=le=>{"basepath"in le&&l(11,_=le.basepath),"url"in le&&l(12,m=le.url),"history"in le&&l(13,d=le.history),"primary"in le&&l(14,v=le.primary),"a11y"in le&&l(15,h=le.a11y),"disableInlineStyles"in le&&l(16,g=le.disableInlineStyles),"$$scope"in le&&l(21,f=le.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&_!==C&&_s(ln,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const le=uc(r,n.pathname);R.set(le)}if(t.$$.dirty[0]&655360&&S){const le=!!n.hash,de=!le&&E,ie=!le||n.pathname!==o.pathname;L(de,ie)}t.$$.dirty[0]&262144&&E&&i&&i.primary&&N1({level:Y,routerId:A,route:i})},[a,y,S,A,E,F,z,O,R,H,G,_,m,d,v,h,g,n,i,o,r,f,p]}class j1 extends $e{constructor(e){super(),ye(this,e,H1,q1,ke,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const cc=j1;function Ti(t,e,l=si,n=ln){Il(l)||oc(t,o=>`You cannot use ${o} outside of a ${ro(n)}.`,e)}const W1=t=>{const{subscribe:e}=Il(t);return{subscribe:e}};function pc(){return Ti(tc),W1(Bs)}function mc(){const{history:t}=Il(si);return t}function _c(){const t=Il(Zf);return t?Jc(t,e=>e.base):ut("/")}function dc(){Ti(nc);const t=_c(),{basepath:e}=Il(si);return n=>g1(n,ni(t),e)}function G1(){Ti(lc);const t=dc(),{navigate:e}=mc();return(n,i)=>{const o=zf(n)?n:t(n);return e(o,i)}}const B1=t=>({params:t&16,location:t&8}),Er=t=>({params:El?ni(t[10]):t[4],location:t[3],navigate:t[11]});function Fr(t){let e,l;return e=new cc({props:{primary:t[1],$$slots:{default:[V1]},$$scope:{ctx:t}}}),{c(){J(e.$$.fragment)},m(n,i){X(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||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Y1(t){let e;const l=t[18].default,n=lo(l,t,t[19],Er);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&524312)&&io(n,l,i,i[19],e?no(l,i[19],o,B1):so(i[19]),Er)},i(i){e||(N(n,i),e=!0)},o(i){D(n,i),e=!1},d(i){n&&n.d(i)}}}function z1(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},El?ni(t[10]):t[4],t[12]];var o=t[0];function r(a){let p={};for(let f=0;f{Z(_,1)}),Se()}o?(e=$r(o,r()),J(e.$$.fragment),N(e.$$.fragment,1),X(e,l.parentNode,l)):e=null}else o&&e.$set(f)},i(a){n||(e&&N(e.$$.fragment,a),n=!0)},o(a){e&&D(e.$$.fragment,a),n=!1},d(a){a&&k(l),e&&Z(e,a)}}}function V1(t){let e,l,n,i;const o=[z1,Y1],r=[];function a(p,f){return p[0]!==null?0:1}return e=a(t),l=r[e]=o[e](t),{c(){l.c(),n=We()},m(p,f){r[e].m(p,f),w(p,n,f),i=!0},p(p,f){let _=e;e=a(p),e===_?r[e].p(p,f):(Te(),D(r[_],1,1,()=>{r[_]=null}),Se(),l=r[e],l?l.p(p,f):(l=r[e]=o[e](p),l.c()),N(l,1),l.m(n.parentNode,n))},i(p){i||(N(l),i=!0)},o(p){D(l),i=!1},d(p){r[e].d(p),p&&k(n)}}}function K1(t){let e,l,n,i,o,r=[Gs(t[7]),{"data-svnav-route-start":t[5]}],a={};for(let m=0;m{p=null}),Se())},i(m){o||(N(p),o=!0)},o(m){D(p),o=!1},d(m){m&&k(e),m&&k(l),p&&p.d(m),m&&k(n),m&&k(i)}}}const Q1=Vf();function X1(t,e,l){let n;const i=["path","component","meta","primary"];let o=ps(e,i),r,a,p,f,{$$slots:_={},$$scope:m}=e,{path:d=""}=e,{component:v=null}=e,{meta:h={}}=e,{primary:g=!0}=e;Ti(bs,e);const y=Q1(),{registerRoute:C,unregisterRoute:T,activeRoute:P,disableInlineStyles:I}=Il(si);il(t,P,U=>l(16,r=U));const S=_c();il(t,S,U=>l(17,p=U));const A=pc();il(t,A,U=>l(3,a=U));const E=ut(null);let F;const z=ut(),O=ut({});il(t,O,U=>l(4,f=U)),gi(Zf,z),gi(xc,O),gi(e1,E);const R=G1();return El||Bc(()=>T(y)),t.$$set=U=>{l(24,e=Xt(Xt({},e),cs(U))),l(12,o=ps(e,i)),"path"in U&&l(13,d=U.path),"component"in U&&l(0,v=U.component),"meta"in U&&l(14,h=U.meta),"primary"in U&&l(1,g=U.primary),"$$scope"in U&&l(19,m=U.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const U=d==="",Y=Ci(p,d),q={id:y,path:d,meta:h,default:U,fullPath:U?"":Y,base:U?p:k1(Y,a.pathname),primary:g,focusElement:E};z.set(q),l(15,F=C(q))}if(t.$$.dirty&98304&&l(2,n=!!(F||r&&r.id===y)),t.$$.dirty&98308&&n){const{params:U}=F||r;O.set(U)}},e=cs(e),[v,g,n,a,f,y,P,I,S,A,O,R,o,d,h,F,r,p,_,m]}class Z1 extends $e{constructor(e){super(),ye(this,e,X1,K1,ke,{path:13,component:0,meta:14,primary:1})}}const kl=Z1;function J1(t){let e,l,n,i;const o=t[13].default,r=lo(o,t,t[12],null);let a=[{href:t[0]},t[2],t[1]],p={};for(let f=0;fl(11,m=E));const P=Yc(),I=dc(),{navigate:S}=mc();function A(E){P("click",E),Xc(E)&&(E.preventDefault(),S(n,{state:y,replace:r||g}))}return t.$$set=E=>{l(19,e=Xt(Xt({},e),cs(E))),l(18,_=ps(e,f)),"to"in E&&l(5,h=E.to),"replace"in E&&l(6,g=E.replace),"state"in E&&l(7,y=E.state),"getProps"in E&&l(8,C=E.getProps),"$$scope"in E&&l(12,v=E.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=I(h,m)),t.$$.dirty&2049&&l(10,i=Ys(m.pathname,n)),t.$$.dirty&2049&&l(9,o=n===m.pathname),t.$$.dirty&2049&&(r=ao(n)===b1(m)),t.$$.dirty&512&&l(2,a=o?{"aria-current":"page"}:{}),l(1,p=(()=>{if(Yf(C)){const E=C({location:m,href:n,isPartiallyCurrent:i,isCurrent:o});return{..._,...E}}return _})())},e=cs(e),[n,p,a,T,A,h,g,y,C,o,i,m,v,d]}class ep extends $e{constructor(e){super(),ye(this,e,x1,J1,ke,{to:5,replace:6,state:7,getProps:8})}}const Dl=ep;let zs=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Al(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function tp(t){return t>218&&t<242?"#32d900":t>212&&t<248?"#b1d900":t>208&&t<252?"#ffb800":"#d90000"}function vc(t){return t>90?"#d90000":t>85?"#e32100":t>80?"#ffb800":t>75?"#dcd800":"#32d900"}function lp(t){return t>75?"#32d900":t>50?"#77d900":t>25?"#94d900":"#dcd800"}function ds(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""}}function De(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function fe(t,e){switch(e){case 5:switch(t){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(t){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 200:return"Generic ESP32";case 2:return"HAN Reader 2.0 by Max Spencer";case 0:return"Custom hardware by Roar Fredriksen";case 1:return"Kamstrup module by Egil Opsahl";case 8:return"µHAN mosquito by dbeinder";case 3:return"Pow-K (UART0)";case 4:return"Pow-U (UART0)";case 101:return"Wemos D1 mini";case 100:return"Generic ESP8266";case 70:return"Generic ESP32-C3";case 71:return"ESP32-C3-DevKitM-1"}}function Rr(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 Lr(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 Or(t){switch(t){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-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 li(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Ye(t,e){return t==1||t==2&&e}function Ft(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function ce(t,e){return isNaN(t)?"-":(isNaN(e)&&(e=t<10?1:0),t.toFixed(e))}function ki(t,e){return t.setTime(t.getTime()+e*36e5),t}function qr(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"}}async function Fl(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 nl={version:"",chip:"",mac:null,apmac:null,vndcfg:null,usrcfg:null,fwconsent:null,booting:!1,upgrading:!1,ui:{},security:0,boot_reason:0,upgrade:{x:-1,e:0,f:null,t:null},trying:null};const Rt=ut(nl);async function fo(){nl=await(await Fl("/sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),Rt.set(nl)}let rs=0,Ur=-127,Hr=null,np={};const ip=Xf(np,t=>{let e;async function l(){Fl("/data.json").then(n=>n.json()).then(n=>{t(n),Ur!=n.t&&(Ur=n.t,setTimeout(kc,2e3)),Hr!=n.p&&n.pe&&(Hr=n.p,setTimeout(sp,4e3)),nl.upgrading?window.location.reload():(!nl||!nl.chip||nl.booting||rs>1&&!li(nl.board))&&(fo(),en&&clearTimeout(en),en=setTimeout(co,2e3),tn&&clearTimeout(tn),tn=setTimeout(po,3e3));let i=5e3;if(li(nl.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),rs=0}).catch(n=>{rs++,rs>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(l,15e3)):e=setTimeout(l,li(nl.board)?1e4:5e3)})}return l(),function(){clearTimeout(e)}});let Vs={};const hc=ut(Vs);async function sp(){Vs=await(await Fl("/energyprice.json")).json(),hc.set(Vs)}let Ks={},en;async function co(){en&&(clearTimeout(en),en=0),Ks=await(await Fl("/dayplot.json")).json(),bc.set(Ks),en=setTimeout(co,(60-new Date().getMinutes())*6e4+20)}const bc=ut(Ks,t=>(co(),function(){}));let Qs={},tn;async function po(){tn&&(clearTimeout(tn),tn=0),Qs=await(await Fl("/monthplot.json")).json(),gc.set(Qs),tn=setTimeout(po,(24-new Date().getHours())*36e5+40)}const gc=ut(Qs,t=>(po(),function(){}));let Xs={};async function kc(){Xs=await(await Fl("/temperature.json")).json(),wc.set(Xs)}const wc=ut(Xs,t=>(kc(),function(){}));let Zs={},as;async function yc(){as&&(clearTimeout(as),as=0),Zs=await(await Fl("/tariff.json")).json(),$c.set(Zs),as=setTimeout(yc,(60-new Date().getMinutes())*6e4+30)}const $c=ut(Zs,t=>function(){});let Js=[];const mo=ut(Js);async function op(){Js=await(await Fl("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),mo.set(Js)}function vs(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 Cc(t){await(await fetch("/upgrade?expected_version="+t,{method:"POST"})).json()}function Tc(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]),r=[...e];r.reverse();let a,p,f;for(let _=0;_o&&(a=m):g==i+1&&(p=m);else if(h==n+1)if(f){let C=f.tag_name.substring(1).split(".");parseInt(C[0]);let T=parseInt(C[1]);parseInt(C[2]),g==T&&(f=m)}else f=m}return p||f||a||!1}else return e[0]}const up="/github.svg";function jr(t){let e,l;function n(r,a){return r[1]>1?_p:r[1]>0?mp:r[2]>1?pp:r[2]>0?cp:r[3]>1?fp:r[3]>0?ap:rp}let i=n(t),o=i(t);return{c(){e=$(`Up - `),o.c(),l=We()},m(r,a){w(r,e,a),o.m(r,a),w(r,l,a)},p(r,a){i===(i=n(r))&&o?o.p(r,a):(o.d(1),o=i(r),o&&(o.c(),o.m(l.parentNode,l)))},d(r){r&&k(e),o.d(r),r&&k(l)}}}function rp(t){let e,l;return{c(){e=$(t[0]),l=$(" seconds")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&1&&B(e,n[0])},d(n){n&&k(e),n&&k(l)}}}function ap(t){let e,l;return{c(){e=$(t[3]),l=$(" minute")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&8&&B(e,n[3])},d(n){n&&k(e),n&&k(l)}}}function fp(t){let e,l;return{c(){e=$(t[3]),l=$(" minutes")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&8&&B(e,n[3])},d(n){n&&k(e),n&&k(l)}}}function cp(t){let e,l;return{c(){e=$(t[2]),l=$(" hour")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&4&&B(e,n[2])},d(n){n&&k(e),n&&k(l)}}}function pp(t){let e,l;return{c(){e=$(t[2]),l=$(" hours")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&4&&B(e,n[2])},d(n){n&&k(e),n&&k(l)}}}function mp(t){let e,l;return{c(){e=$(t[1]),l=$(" day")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&2&&B(e,n[1])},d(n){n&&k(e),n&&k(l)}}}function _p(t){let e,l;return{c(){e=$(t[1]),l=$(" days")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&2&&B(e,n[1])},d(n){n&&k(e),n&&k(l)}}}function dp(t){let e,l=t[0]&&jr(t);return{c(){l&&l.c(),e=We()},m(n,i){l&&l.m(n,i),w(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=jr(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:ne,o:ne,d(n){l&&l.d(n),n&&k(e)}}}function vp(t,e,l){let{epoch:n}=e,i=0,o=0,r=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,r=Math.floor(n/60)))},[n,i,o,r]}class hp extends $e{constructor(e){super(),ye(this,e,vp,dp,ke,{epoch:0})}}function bp(t){let e,l,n;return{c(){e=c("span"),l=$(t[2]),u(e,"title",t[1]),u(e,"class",n="bd-"+t[0])},m(i,o){w(i,e,o),s(e,l)},p(i,[o]){o&4&&B(l,i[2]),o&2&&u(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&u(e,"class",n)},i:ne,o:ne,d(i){i&&k(e)}}}function gp(t,e,l){let{color:n}=e,{title:i}=e,{text:o}=e;return t.$$set=r=>{"color"in r&&l(0,n=r.color),"title"in r&&l(1,i=r.title),"text"in r&&l(2,o=r.text)},[n,i,o]}class sl extends $e{constructor(e){super(),ye(this,e,gp,bp,ke,{color:0,title:1,text:2})}}function kp(t){let e,l=`${De(t[0].getDate())}.${De(t[0].getMonth()+1)}.${t[0].getFullYear()} ${De(t[0].getHours())}:${De(t[0].getMinutes())}`,n;return{c(){e=c("span"),n=$(l),u(e,"class",t[1])},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${De(i[0].getDate())}.${De(i[0].getMonth()+1)}.${i[0].getFullYear()} ${De(i[0].getHours())}:${De(i[0].getMinutes())}`)&&B(n,l),o&2&&u(e,"class",i[1])},d(i){i&&k(e)}}}function wp(t){let e=`${De(t[0].getDate())}. ${zs[t[0].getMonth()]} ${De(t[0].getHours())}:${De(t[0].getMinutes())}`,l;return{c(){l=$(e)},m(n,i){w(n,l,i)},p(n,i){i&1&&e!==(e=`${De(n[0].getDate())}. ${zs[n[0].getMonth()]} ${De(n[0].getHours())}:${De(n[0].getMinutes())}`)&&B(l,e)},d(n){n&&k(l)}}}function yp(t){let e,l;function n(r,a){return a&1&&(e=null),e==null&&(e=Math.abs(new Date().getTime()-r[0].getTime())<3e5),e?wp:kp}let i=n(t,-1),o=i(t);return{c(){o.c(),l=We()},m(r,a){o.m(r,a),w(r,l,a)},p(r,[a]){i===(i=n(r,a))&&o?o.p(r,a):(o.d(1),o=i(r),o&&(o.c(),o.m(l.parentNode,l)))},i:ne,o:ne,d(r){o.d(r),r&&k(l)}}}function $p(t,e,l){let{timestamp:n}=e,{fullTimeColor:i}=e;return t.$$set=o=>{"timestamp"in o&&l(0,n=o.timestamp),"fullTimeColor"in o&&l(1,i=o.fullTimeColor)},[n,i]}class Sc extends $e{constructor(e){super(),ye(this,e,$p,yp,ke,{timestamp:0,fullTimeColor:1})}}function Cp(t){let e,l,n;return{c(){e=Ue("svg"),l=Ue("path"),n=Ue("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(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"),u(n,"stroke-linecap","round"),u(n,"stroke-linejoin","round"),u(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(i,o){w(i,e,o),s(e,l),s(e,n)},p:ne,i:ne,o:ne,d(i){i&&k(e)}}}class Tp extends $e{constructor(e){super(),ye(this,e,null,Cp,ke,{})}}function Sp(t){let e,l;return{c(){e=Ue("svg"),l=Ue("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(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"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(n,i){w(n,e,i),s(e,l)},p:ne,i:ne,o:ne,d(n){n&&k(e)}}}class Pp extends $e{constructor(e){super(),ye(this,e,null,Sp,ke,{})}}function Np(t){let e,l;return{c(){e=Ue("svg"),l=Ue("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(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"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(n,i){w(n,e,i),s(e,l)},p:ne,i:ne,o:ne,d(n){n&&k(e)}}}class Et extends $e{constructor(e){super(),ye(this,e,null,Np,ke,{})}}function Mp(t){let e,l;return{c(){e=Ue("svg"),l=Ue("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(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"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(n,i){w(n,e,i),s(e,l)},p:ne,i:ne,o:ne,d(n){n&&k(e)}}}class Pc extends $e{constructor(e){super(),ye(this,e,null,Mp,ke,{})}}function Ap(t){let e,l,n=t[1].version+"",i;return{c(){e=$("AMS reader "),l=c("span"),i=$(n)},m(o,r){w(o,e,r),w(o,l,r),s(l,i)},p(o,r){r&2&&n!==(n=o[1].version+"")&&B(i,n)},d(o){o&&k(e),o&&k(l)}}}function Wr(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=c("div"),n=$(l),i=$("°C"),u(e,"class","flex-none my-auto")},m(o,r){w(o,e,r),s(e,n),s(e,i)},p(o,r){r&1&&l!==(l=(o[0].t>-50?o[0].t.toFixed(1):"-")+"")&&B(n,l)},d(o){o&&k(e)}}}function Gr(t){let e,l="HAN: "+Rr(t[0].he),n;return{c(){e=c("div"),n=$(l),u(e,"class","bd-red")},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="HAN: "+Rr(i[0].he))&&B(n,l)},d(i){i&&k(e)}}}function Br(t){let e,l="MQTT: "+Lr(t[0].me),n;return{c(){e=c("div"),n=$(l),u(e,"class","bd-red")},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="MQTT: "+Lr(i[0].me))&&B(n,l)},d(i){i&&k(e)}}}function Yr(t){let e,l="PriceAPI: "+Or(t[0].ee),n;return{c(){e=c("div"),n=$(l),u(e,"class","bd-red")},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="PriceAPI: "+Or(i[0].ee))&&B(n,l)},d(i){i&&k(e)}}}function zr(t){let e,l,n,i,o,r;return l=new Dl({props:{to:"/configuration",$$slots:{default:[Dp]},$$scope:{ctx:t}}}),o=new Dl({props:{to:"/status",$$slots:{default:[Ip]},$$scope:{ctx:t}}}),{c(){e=c("div"),J(l.$$.fragment),n=b(),i=c("div"),J(o.$$.fragment),u(e,"class","flex-none px-1 mt-1"),u(e,"title","Configuration"),u(i,"class","flex-none px-1 mt-1"),u(i,"title","Device information")},m(a,p){w(a,e,p),X(l,e,null),w(a,n,p),w(a,i,p),X(o,i,null),r=!0},i(a){r||(N(l.$$.fragment,a),N(o.$$.fragment,a),r=!0)},o(a){D(l.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&k(e),Z(l),a&&k(n),a&&k(i),Z(o)}}}function Dp(t){let e,l;return e=new Tp({}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Ip(t){let e,l;return e=new Pp({}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Vr(t){let e,l,n,i,o;const r=[Fp,Ep],a=[];function p(f,_){return f[1].security==0||f[0].a?0:1}return l=p(t),n=a[l]=r[l](t),{c(){e=c("div"),n.c(),u(e,"class","flex-none mr-3 text-yellow-500"),u(e,"title",i="New version: "+t[2].tag_name)},m(f,_){w(f,e,_),a[l].m(e,null),o=!0},p(f,_){let m=l;l=p(f),l===m?a[l].p(f,_):(Te(),D(a[m],1,1,()=>{a[m]=null}),Se(),n=a[l],n?n.p(f,_):(n=a[l]=r[l](f),n.c()),N(n,1),n.m(e,null)),(!o||_&4&&i!==(i="New version: "+f[2].tag_name))&&u(e,"title",i)},i(f){o||(N(n),o=!0)},o(f){D(n),o=!1},d(f){f&&k(e),a[l].d()}}}function Ep(t){let e,l,n=t[2].tag_name+"",i;return{c(){e=c("span"),l=$("New version: "),i=$(n)},m(o,r){w(o,e,r),s(e,l),s(e,i)},p(o,r){r&4&&n!==(n=o[2].tag_name+"")&&B(i,n)},i:ne,o:ne,d(o){o&&k(e)}}}function Fp(t){let e,l,n,i=t[2].tag_name+"",o,r,a,p,f,_;return a=new Pc({}),{c(){e=c("button"),l=c("span"),n=$("New version: "),o=$(i),r=b(),J(a.$$.fragment),u(l,"class","mt-1"),u(e,"class","flex")},m(m,d){w(m,e,d),s(e,l),s(l,n),s(l,o),s(e,r),X(a,e,null),p=!0,f||(_=K(e,"click",t[3]),f=!0)},p(m,d){(!p||d&4)&&i!==(i=m[2].tag_name+"")&&B(o,i)},i(m){p||(N(a.$$.fragment,m),p=!0)},o(m){D(a.$$.fragment,m),p=!1},d(m){m&&k(e),Z(a),f=!1,_()}}}function Rp(t){let e,l,n,i,o,r,a,p,f,_,m,d,v=(t[0].m?(t[0].m/1e3).toFixed(1):"-")+"",h,g,y,C,T,P,I,S,A,E,F,z,O,R,U,Y,q,H,G,L,W,j,ee,le,de,ie,we,Ie,Ce,Ee;i=new Dl({props:{to:"/",$$slots:{default:[Ap]},$$scope:{ctx:t}}}),p=new hp({props:{epoch:t[0].u}});let ve=t[0].t>-50&&Wr(t);T=new sl({props:{title:"ESP",text:t[1].booting?"Booting":t[0].v>2?t[0].v.toFixed(2)+"V":"ESP",color:Al(t[1].booting?2:t[0].em)}}),I=new sl({props:{title:"HAN",text:"HAN",color:Al(t[1].booting?9:t[0].hm)}}),A=new sl({props:{title:"WiFi",text:t[0].r?t[0].r.toFixed(0)+"dBm":"WiFi",color:Al(t[1].booting?9:t[0].wm)}}),F=new sl({props:{title:"MQTT",text:"MQTT",color:Al(t[1].booting?9:t[0].mm)}});let Pe=(t[0].he<0||t[0].he>0)&&Gr(t),Ae=t[0].me<0&&Br(t),pe=(t[0].ee>0||t[0].ee<0)&&Yr(t);ee=new Sc({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),fullTimeColor:"text-red-500"}});let se=t[1].vndcfg&&t[1].usrcfg&&zr(t);Ie=new Et({});let me=t[1].fwconsent===1&&t[2]&&Vr(t);return{c(){e=c("nav"),l=c("div"),n=c("div"),J(i.$$.fragment),o=b(),r=c("div"),a=c("div"),J(p.$$.fragment),f=b(),ve&&ve.c(),_=b(),m=c("div"),d=$("Free mem: "),h=$(v),g=$("kb"),y=b(),C=c("div"),J(T.$$.fragment),P=b(),J(I.$$.fragment),S=b(),J(A.$$.fragment),E=b(),J(F.$$.fragment),z=b(),Pe&&Pe.c(),O=b(),Ae&&Ae.c(),R=b(),pe&&pe.c(),U=b(),Y=c("div"),q=c("div"),H=c("a"),G=c("img"),W=b(),j=c("div"),J(ee.$$.fragment),le=b(),se&&se.c(),de=b(),ie=c("div"),we=c("a"),J(Ie.$$.fragment),Ce=b(),me&&me.c(),u(n,"class","flex text-lg text-gray-100 p-2"),u(a,"class","flex-none my-auto"),u(m,"class","flex-none my-auto"),u(r,"class","flex-none my-auto p-2 flex space-x-4"),u(C,"class","flex-auto flex-wrap my-auto justify-center p-2"),u(G,"class","gh-logo"),Fc(G.src,L=up)||u(G,"src",L),u(G,"alt","GitHub repo"),u(H,"class","float-right"),u(H,"href","https://github.com/UtilitechAS/amsreader-firmware"),u(H,"target","_blank"),u(H,"rel","noreferrer"),u(H,"aria-label","GitHub"),u(q,"class","flex-none"),u(j,"class","flex-none my-auto px-2"),u(we,"href",Ft("")),u(we,"target","_blank"),u(we,"rel","noreferrer"),u(ie,"class","flex-none px-1 mt-1"),u(ie,"title","Documentation"),u(Y,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),u(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),u(e,"class","bg-violet-600 p-1 rounded-md mx-2")},m(Q,oe){w(Q,e,oe),s(e,l),s(l,n),X(i,n,null),s(l,o),s(l,r),s(r,a),X(p,a,null),s(r,f),ve&&ve.m(r,null),s(r,_),s(r,m),s(m,d),s(m,h),s(m,g),s(l,y),s(l,C),X(T,C,null),s(C,P),X(I,C,null),s(C,S),X(A,C,null),s(C,E),X(F,C,null),s(l,z),Pe&&Pe.m(l,null),s(l,O),Ae&&Ae.m(l,null),s(l,R),pe&&pe.m(l,null),s(l,U),s(l,Y),s(Y,q),s(q,H),s(H,G),s(Y,W),s(Y,j),X(ee,j,null),s(Y,le),se&&se.m(Y,null),s(Y,de),s(Y,ie),s(ie,we),X(Ie,we,null),s(Y,Ce),me&&me.m(Y,null),Ee=!0},p(Q,[oe]){const Ne={};oe&18&&(Ne.$$scope={dirty:oe,ctx:Q}),i.$set(Ne);const Me={};oe&1&&(Me.epoch=Q[0].u),p.$set(Me),Q[0].t>-50?ve?ve.p(Q,oe):(ve=Wr(Q),ve.c(),ve.m(r,_)):ve&&(ve.d(1),ve=null),(!Ee||oe&1)&&v!==(v=(Q[0].m?(Q[0].m/1e3).toFixed(1):"-")+"")&&B(h,v);const he={};oe&3&&(he.text=Q[1].booting?"Booting":Q[0].v>2?Q[0].v.toFixed(2)+"V":"ESP"),oe&3&&(he.color=Al(Q[1].booting?2:Q[0].em)),T.$set(he);const x={};oe&3&&(x.color=Al(Q[1].booting?9:Q[0].hm)),I.$set(x);const _e={};oe&1&&(_e.text=Q[0].r?Q[0].r.toFixed(0)+"dBm":"WiFi"),oe&3&&(_e.color=Al(Q[1].booting?9:Q[0].wm)),A.$set(_e);const Le={};oe&3&&(Le.color=Al(Q[1].booting?9:Q[0].mm)),F.$set(Le),Q[0].he<0||Q[0].he>0?Pe?Pe.p(Q,oe):(Pe=Gr(Q),Pe.c(),Pe.m(l,O)):Pe&&(Pe.d(1),Pe=null),Q[0].me<0?Ae?Ae.p(Q,oe):(Ae=Br(Q),Ae.c(),Ae.m(l,R)):Ae&&(Ae.d(1),Ae=null),Q[0].ee>0||Q[0].ee<0?pe?pe.p(Q,oe):(pe=Yr(Q),pe.c(),pe.m(l,U)):pe&&(pe.d(1),pe=null);const Ge={};oe&1&&(Ge.timestamp=Q[0].c?new Date(Q[0].c*1e3):new Date(0)),ee.$set(Ge),Q[1].vndcfg&&Q[1].usrcfg?se?oe&2&&N(se,1):(se=zr(Q),se.c(),N(se,1),se.m(Y,de)):se&&(Te(),D(se,1,1,()=>{se=null}),Se()),Q[1].fwconsent===1&&Q[2]?me?(me.p(Q,oe),oe&6&&N(me,1)):(me=Vr(Q),me.c(),N(me,1),me.m(Y,null)):me&&(Te(),D(me,1,1,()=>{me=null}),Se())},i(Q){Ee||(N(i.$$.fragment,Q),N(p.$$.fragment,Q),N(T.$$.fragment,Q),N(I.$$.fragment,Q),N(A.$$.fragment,Q),N(F.$$.fragment,Q),N(ee.$$.fragment,Q),N(se),N(Ie.$$.fragment,Q),N(me),Ee=!0)},o(Q){D(i.$$.fragment,Q),D(p.$$.fragment,Q),D(T.$$.fragment,Q),D(I.$$.fragment,Q),D(A.$$.fragment,Q),D(F.$$.fragment,Q),D(ee.$$.fragment,Q),D(se),D(Ie.$$.fragment,Q),D(me),Ee=!1},d(Q){Q&&k(e),Z(i),Z(p),ve&&ve.d(),Z(T),Z(I),Z(A),Z(F),Pe&&Pe.d(),Ae&&Ae.d(),pe&&pe.d(),Z(ee),se&&se.d(),Z(Ie),me&&me.d()}}}function Lp(t,e,l){let{data:n={}}=e,i={},o={};function r(){confirm("Do you want to upgrade this device to "+o.tag_name+"?")&&(!li(i.board)||confirm(vs(fe(i.chip,i.board))))&&(Rt.update(a=>(a.upgrading=!0,a)),Cc(o.tag_name))}return Rt.subscribe(a=>{l(1,i=a),a.fwconsent===1&&op()}),mo.subscribe(a=>{l(2,o=Tc(i.version,a))}),t.$$set=a=>{"data"in a&&l(0,n=a.data)},[n,i,o,r]}class Op extends $e{constructor(e){super(),ye(this,e,Lp,Rp,ke,{data:0})}}function qp(t){let e,l,n,i;return{c(){e=Ue("svg"),l=Ue("path"),n=Ue("path"),u(l,"d",js(150,150,115,210,510)),u(l,"stroke","#eee"),u(l,"fill","none"),u(l,"stroke-width","55"),u(n,"d",i=js(150,150,115,210,210+300*t[0]/100)),u(n,"stroke",t[1]),u(n,"fill","none"),u(n,"stroke-width","55"),u(e,"viewBox","0 0 300 300"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"height","100%")},m(o,r){w(o,e,r),s(e,l),s(e,n)},p(o,[r]){r&1&&i!==(i=js(150,150,115,210,210+300*o[0]/100))&&u(n,"d",i),r&2&&u(n,"stroke",o[1])},i:ne,o:ne,d(o){o&&k(e)}}}function Kr(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 js(t,e,l,n,i){var o=Kr(t,e,l,i),r=Kr(t,e,l,n),a=i-n<=180?"0":"1",p=["M",o.x,o.y,"A",l,l,0,a,0,r.x,r.y].join(" ");return p}function Up(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 Hp extends $e{constructor(e){super(),ye(this,e,Up,qp,ke,{pct:0,color:1})}}function Qr(t){let e,l,n,i,o,r,a,p;return{c(){e=c("br"),l=b(),n=c("span"),i=$(t[3]),o=b(),r=c("span"),a=$(t[4]),p=$("/kWh"),u(n,"class","pl-sub"),u(r,"class","pl-snt")},m(f,_){w(f,e,_),w(f,l,_),w(f,n,_),s(n,i),w(f,o,_),w(f,r,_),s(r,a),s(r,p)},p(f,_){_&8&&B(i,f[3]),_&16&&B(a,f[4])},d(f){f&&k(e),f&&k(l),f&&k(n),f&&k(o),f&&k(r)}}}function jp(t){let e,l,n,i,o,r,a,p,f,_,m,d,v,h,g,y;l=new Hp({props:{pct:t[6],color:t[5](t[6])}});let C=t[3]&&Qr(t);return{c(){e=c("div"),J(l.$$.fragment),n=b(),i=c("span"),o=c("span"),r=$(t[2]),a=b(),p=c("br"),f=b(),_=c("span"),m=$(t[0]),d=b(),v=c("span"),h=$(t[1]),g=b(),C&&C.c(),u(o,"class","pl-lab"),u(_,"class","pl-val"),u(v,"class","pl-unt"),u(i,"class","pl-ov"),u(e,"class","pl-root")},m(T,P){w(T,e,P),X(l,e,null),s(e,n),s(e,i),s(i,o),s(o,r),s(i,a),s(i,p),s(i,f),s(i,_),s(_,m),s(i,d),s(i,v),s(v,h),s(i,g),C&&C.m(i,null),y=!0},p(T,[P]){const I={};P&64&&(I.pct=T[6]),P&96&&(I.color=T[5](T[6])),l.$set(I),(!y||P&4)&&B(r,T[2]),(!y||P&1)&&B(m,T[0]),(!y||P&2)&&B(h,T[1]),T[3]?C?C.p(T,P):(C=Qr(T),C.c(),C.m(i,null)):C&&(C.d(1),C=null)},i(T){y||(N(l.$$.fragment,T),y=!0)},o(T){D(l.$$.fragment,T),y=!1},d(T){T&&k(e),Z(l),C&&C.d()}}}function Wp(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:r}=e,{sub:a=""}=e,{subunit:p=""}=e,{colorFn:f}=e,_=0;return t.$$set=m=>{"val"in m&&l(0,n=m.val),"max"in m&&l(7,i=m.max),"unit"in m&&l(1,o=m.unit),"label"in m&&l(2,r=m.label),"sub"in m&&l(3,a=m.sub),"subunit"in m&&l(4,p=m.subunit),"colorFn"in m&&l(5,f=m.colorFn)},t.$$.update=()=>{t.$$.dirty&129&&l(6,_=Math.min(n,i)/i*100)},[n,o,r,a,p,f,_,i]}class Nc extends $e{constructor(e){super(),ye(this,e,Wp,jp,ke,{val:0,max:7,unit:1,label:2,sub:3,subunit:4,colorFn:5})}}function Xr(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function Zr(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function Jr(t,e,l){const n=t.slice();return n[13]=e[l],n}function xr(t){let e,l,n,i,o,r=t[0].title&&ea(t),a=t[0].y.ticks,p=[];for(let v=0;v20||t[11]%2==0)&&ia(t);return{c(){e=Ue("g"),n&&n.c(),u(e,"class","tick"),u(e,"transform",l="translate("+t[5](t[11])+","+t[4]+")")},m(i,o){w(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[11]%2==0?n?n.p(i,o):(n=ia(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&48&&l!==(l="translate("+i[5](i[11])+","+i[4]+")")&&u(e,"transform",l)},d(i){i&&k(e),n&&n.d()}}}function ia(t){let e,l=t[9].label+"",n,i;return{c(){e=Ue("text"),n=$(l),u(e,"x",i=t[3]/2),u(e,"y","-4")},m(o,r){w(o,e,r),s(e,n)},p(o,r){r&1&&l!==(l=o[9].label+"")&&B(n,l),r&8&&i!==(i=o[3]/2)&&u(e,"x",i)},d(o){o&&k(e)}}}function sa(t){let e=!isNaN(t[5](t[11])),l,n=e&&na(t);return{c(){n&&n.c(),l=We()},m(i,o){n&&n.m(i,o),w(i,l,o)},p(i,o){o&32&&(e=!isNaN(i[5](i[11]))),e?n?n.p(i,o):(n=na(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&k(l)}}}function oa(t){let e,l,n=t[9].value!==void 0&&ua(t),i=t[9].value2>1e-4&&fa(t);return{c(){e=Ue("g"),n&&n.c(),l=Ue("g"),i&&i.c()},m(o,r){w(o,e,r),n&&n.m(e,null),w(o,l,r),i&&i.m(l,null)},p(o,r){o[9].value!==void 0?n?n.p(o,r):(n=ua(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[9].value2>1e-4?i?i.p(o,r):(i=fa(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&k(e),n&&n.d(),o&&k(l),i&&i.d()}}}function ua(t){let e,l,n,i,o,r,a,p=t[3]>15&&ra(t);return{c(){e=Ue("rect"),p&&p.c(),a=We(),u(e,"x",l=t[5](t[11])+2),u(e,"y",n=t[6](t[9].value)),u(e,"width",i=t[3]-4),u(e,"height",o=t[6](t[0].y.min)-t[6](Math.min(t[0].y.min,0)+t[9].value)),u(e,"fill",r=t[9].color)},m(f,_){w(f,e,_),p&&p.m(f,_),w(f,a,_)},p(f,_){_&32&&l!==(l=f[5](f[11])+2)&&u(e,"x",l),_&65&&n!==(n=f[6](f[9].value))&&u(e,"y",n),_&8&&i!==(i=f[3]-4)&&u(e,"width",i),_&65&&o!==(o=f[6](f[0].y.min)-f[6](Math.min(f[0].y.min,0)+f[9].value))&&u(e,"height",o),_&1&&r!==(r=f[9].color)&&u(e,"fill",r),f[3]>15?p?p.p(f,_):(p=ra(f),p.c(),p.m(a.parentNode,a)):p&&(p.d(1),p=null)},d(f){f&&k(e),p&&p.d(f),f&&k(a)}}}function ra(t){let e,l=t[9].label+"",n,i,o,r,a,p,f,_,m=t[9].title&&aa(t);return{c(){e=Ue("text"),n=$(l),m&&m.c(),_=We(),u(e,"y",i=t[6](t[9].value)>t[6](0)-t[7]?t[6](t[9].value)-t[7]:t[6](t[9].value)+10),u(e,"x",o=t[5](t[11])+t[3]/2),u(e,"width",r=t[3]-4),u(e,"dominant-baseline","middle"),u(e,"text-anchor",a=t[3]<25?"left":"middle"),u(e,"fill",p=t[6](t[9].value)>t[6](0)-t[7]?t[9].color:"white"),u(e,"transform",f="rotate("+(t[3]<25?90:0)+", "+(t[5](t[11])+t[3]/2)+", "+(t[6](t[9].value)>t[6](0)-t[7]?t[6](t[9].value)-t[7]:t[6](t[9].value)+9)+")")},m(d,v){w(d,e,v),s(e,n),m&&m.m(d,v),w(d,_,v)},p(d,v){v&1&&l!==(l=d[9].label+"")&&B(n,l),v&193&&i!==(i=d[6](d[9].value)>d[6](0)-d[7]?d[6](d[9].value)-d[7]:d[6](d[9].value)+10)&&u(e,"y",i),v&40&&o!==(o=d[5](d[11])+d[3]/2)&&u(e,"x",o),v&8&&r!==(r=d[3]-4)&&u(e,"width",r),v&8&&a!==(a=d[3]<25?"left":"middle")&&u(e,"text-anchor",a),v&193&&p!==(p=d[6](d[9].value)>d[6](0)-d[7]?d[9].color:"white")&&u(e,"fill",p),v&233&&f!==(f="rotate("+(d[3]<25?90:0)+", "+(d[5](d[11])+d[3]/2)+", "+(d[6](d[9].value)>d[6](0)-d[7]?d[6](d[9].value)-d[7]:d[6](d[9].value)+9)+")")&&u(e,"transform",f),d[9].title?m?m.p(d,v):(m=aa(d),m.c(),m.m(_.parentNode,_)):m&&(m.d(1),m=null)},d(d){d&&k(e),m&&m.d(d),d&&k(_)}}}function aa(t){let e,l=t[9].title+"",n;return{c(){e=Ue("title"),n=$(l)},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=i[9].title+"")&&B(n,l)},d(i){i&&k(e)}}}function fa(t){let e,l,n,i,o,r,a,p=t[3]>15&&ca(t);return{c(){e=Ue("rect"),p&&p.c(),a=We(),u(e,"x",l=t[5](t[11])+2),u(e,"y",n=t[6](0)),u(e,"width",i=t[3]-4),u(e,"height",o=t[6](t[0].y.min)-t[6](t[0].y.min+t[9].value2)),u(e,"fill",r=t[9].color)},m(f,_){w(f,e,_),p&&p.m(f,_),w(f,a,_)},p(f,_){_&32&&l!==(l=f[5](f[11])+2)&&u(e,"x",l),_&64&&n!==(n=f[6](0))&&u(e,"y",n),_&8&&i!==(i=f[3]-4)&&u(e,"width",i),_&65&&o!==(o=f[6](f[0].y.min)-f[6](f[0].y.min+f[9].value2))&&u(e,"height",o),_&1&&r!==(r=f[9].color)&&u(e,"fill",r),f[3]>15?p?p.p(f,_):(p=ca(f),p.c(),p.m(a.parentNode,a)):p&&(p.d(1),p=null)},d(f){f&&k(e),p&&p.d(f),f&&k(a)}}}function ca(t){let e,l=t[9].label2+"",n,i,o,r,a,p,f,_,m=t[9].title2&&pa(t);return{c(){e=Ue("text"),n=$(l),m&&m.c(),_=We(),u(e,"y",i=t[6](-t[9].value2)t[6](0)-12?t[6](t[9].value2-t[0].y.min)-12:t[6](t[9].value2-t[0].y.min)+9)+")")},m(d,v){w(d,e,v),s(e,n),m&&m.m(d,v),w(d,_,v)},p(d,v){v&1&&l!==(l=d[9].label2+"")&&B(n,l),v&65&&i!==(i=d[6](-d[9].value2)d[6](0)-12?d[6](d[9].value2-d[0].y.min)-12:d[6](d[9].value2-d[0].y.min)+9)+")")&&u(e,"transform",f),d[9].title2?m?m.p(d,v):(m=pa(d),m.c(),m.m(_.parentNode,_)):m&&(m.d(1),m=null)},d(d){d&&k(e),m&&m.d(d),d&&k(_)}}}function pa(t){let e,l=t[9].title2+"",n;return{c(){e=Ue("title"),n=$(l)},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=i[9].title2+"")&&B(n,l)},d(i){i&&k(e)}}}function ma(t){let e=!isNaN(t[5](t[11]))&&!isNaN(t[6](t[9].value)),l,n=e&&oa(t);return{c(){n&&n.c(),l=We()},m(i,o){n&&n.m(i,o),w(i,l,o)},p(i,o){o&97&&(e=!isNaN(i[5](i[11]))&&!isNaN(i[6](i[9].value))),e?n?n.p(i,o):(n=oa(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&k(l)}}}function Gp(t){let e,l,n=t[0].x.ticks&&t[0].points&&t[4]&&xr(t);return{c(){e=c("div"),n&&n.c(),u(e,"class","chart"),tt(()=>t[8].call(e))},m(i,o){w(i,e,o),n&&n.m(e,null),l=jc(e,t[8].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=xr(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:ne,o:ne,d(i){i&&k(e),n&&n.d(),l()}}}function Bp(t,e,l){let{config:n}=e,i,o,r,a,p,f,_;function m(){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&31){l(4,f=o-(n.title?20:0));let d=i-(n.padding.left+n.padding.right);l(3,r=d/n.points.length),l(7,_=r<25?28:17);let v=(f-n.padding.top-n.padding.bottom)/(n.y.max-n.y.min);l(5,a=function(h){return h*r+n.padding.left}),l(6,p=function(h){let g=0;return h>n.y.max?g=n.padding.bottom:hf||g<0?0:g})}},[n,i,o,r,f,a,p,_,m]}class nn extends $e{constructor(e){super(),ye(this,e,Bp,Gp,ke,{config:0})}}function Yp(t){let e,l;return e=new nn({props:{config:t[0]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function zp(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{ds:r}=e,a={};function p(f){return{label:ce(f)+"V",title:f.toFixed(1)+" V",value:isNaN(f)?0:f,color:tp(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,r=f.ds)},t.$$.update=()=>{if(t.$$.dirty&30){let f=[],_=[];n>0&&(f.push({label:r===1?"L1-L2":"L1"}),_.push(p(n))),i>0&&(f.push({label:r===1?"L1-L3":"L2"}),_.push(p(i))),o>0&&(f.push({label:r===1?"L2-L3":"L3"}),_.push(p(o))),l(0,a={padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:f},points:_})}},[a,n,i,o,r]}class Vp extends $e{constructor(e){super(),ye(this,e,zp,Yp,ke,{u1:1,u2:2,u3:3,ds:4})}}function Kp(t){let e,l;return e=new nn({props:{config:t[0]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Qp(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{i1:r}=e,{i2:a}=e,{i3:p}=e,{max:f}=e,_={};function m(d){return{label:ce(d)+"A",title:d.toFixed(1)+" A",value:isNaN(d)?0:d,color:vc(d?d/f*100:0)}}return t.$$set=d=>{"u1"in d&&l(1,n=d.u1),"u2"in d&&l(2,i=d.u2),"u3"in d&&l(3,o=d.u3),"i1"in d&&l(4,r=d.i1),"i2"in d&&l(5,a=d.i2),"i3"in d&&l(6,p=d.i3),"max"in d&&l(7,f=d.max)},t.$$.update=()=>{if(t.$$.dirty&254){let d=[],v=[];n>0&&(d.push({label:"L1"}),v.push(m(r))),i>0&&(d.push({label:"L2"}),v.push(m(a))),o>0&&(d.push({label:"L3"}),v.push(m(p))),l(0,_={padding:{top:20,right:15,bottom:20,left:35},y:{min:0,max:f,ticks:[{value:0,label:"0%"},{value:f/4,label:"25%"},{value:f/2,label:"50%"},{value:f/4*3,label:"75%"},{value:f,label:"100%"}]},x:{ticks:d},points:v})}},[_,n,i,o,r,a,p,f]}class Xp extends $e{constructor(e){super(),ye(this,e,Qp,Kp,ke,{u1:1,u2:2,u3:3,i1:4,i2:5,i3:6,max:7})}}function Zp(t){let e,l,n,i,o,r,a,p=(typeof t[0]<"u"?t[0].toFixed(0):"-")+"",f,_,m,d,v,h,g=(typeof t[1]<"u"?t[1].toFixed(0):"-")+"",y,C,T,P,I,S,A,E=(typeof t[2]<"u"?t[2].toFixed(1):"-")+"",F,z,O,R,U,Y,q=(typeof t[3]<"u"?t[3].toFixed(1):"-")+"",H,G;return{c(){e=c("div"),l=c("strong"),l.textContent="Reactive",n=b(),i=c("div"),o=c("div"),o.textContent="Instant in",r=b(),a=c("div"),f=$(p),_=$(" VAr"),m=b(),d=c("div"),d.textContent="Instant out",v=b(),h=c("div"),y=$(g),C=$(" VAr"),T=b(),P=c("div"),I=c("div"),I.textContent="Total in",S=b(),A=c("div"),F=$(E),z=$(" kVArh"),O=b(),R=c("div"),R.textContent="Total out",U=b(),Y=c("div"),H=$(q),G=$(" kVArh"),u(a,"class","text-right"),u(h,"class","text-right"),u(i,"class","grid grid-cols-2 mt-4"),u(A,"class","text-right"),u(Y,"class","text-right"),u(P,"class","grid grid-cols-2 mt-4"),u(e,"class","mx-2 text-sm")},m(L,W){w(L,e,W),s(e,l),s(e,n),s(e,i),s(i,o),s(i,r),s(i,a),s(a,f),s(a,_),s(i,m),s(i,d),s(i,v),s(i,h),s(h,y),s(h,C),s(e,T),s(e,P),s(P,I),s(P,S),s(P,A),s(A,F),s(A,z),s(P,O),s(P,R),s(P,U),s(P,Y),s(Y,H),s(Y,G)},p(L,[W]){W&1&&p!==(p=(typeof L[0]<"u"?L[0].toFixed(0):"-")+"")&&B(f,p),W&2&&g!==(g=(typeof L[1]<"u"?L[1].toFixed(0):"-")+"")&&B(y,g),W&4&&E!==(E=(typeof L[2]<"u"?L[2].toFixed(1):"-")+"")&&B(F,E),W&8&&q!==(q=(typeof L[3]<"u"?L[3].toFixed(1):"-")+"")&&B(H,q)},i:ne,o:ne,d(L){L&&k(e)}}}function Jp(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:o}=e,{exportTotal:r}=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,r=a.exportTotal)},[n,i,o,r]}class xp extends $e{constructor(e){super(),ye(this,e,Jp,Zp,ke,{importInstant:0,exportInstant:1,importTotal:2,exportTotal:3})}}function _a(t){let e;function l(o,r){return o[3]?tm:em}let n=l(t),i=n(t);return{c(){i.c(),e=We()},m(o,r){i.m(o,r),w(o,e,r)},p(o,r){n===(n=l(o))&&i?i.p(o,r):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&k(e)}}}function em(t){let e,l,n,i,o,r,a=ce(t[1].h.u,2)+"",p,f,_,m,d,v,h=ce(t[1].d.u,1)+"",g,y,C,T,P,I,S=ce(t[1].m.u)+"",A,E,F,z,O,R,U=ce(t[0].last_month.u)+"",Y,q,H,G,L=t[4]&&da(t);return{c(){e=c("strong"),e.textContent="Consumption",l=b(),n=c("div"),i=c("div"),i.textContent="Hour",o=b(),r=c("div"),p=$(a),f=$(" kWh"),_=b(),m=c("div"),m.textContent="Day",d=b(),v=c("div"),g=$(h),y=$(" kWh"),C=b(),T=c("div"),T.textContent="Month",P=b(),I=c("div"),A=$(S),E=$(" kWh"),F=b(),z=c("div"),z.textContent="Last month",O=b(),R=c("div"),Y=$(U),q=$(" kWh"),H=b(),L&&L.c(),G=We(),u(r,"class","text-right"),u(v,"class","text-right"),u(I,"class","text-right"),u(R,"class","text-right"),u(n,"class","grid grid-cols-2 mb-3")},m(W,j){w(W,e,j),w(W,l,j),w(W,n,j),s(n,i),s(n,o),s(n,r),s(r,p),s(r,f),s(n,_),s(n,m),s(n,d),s(n,v),s(v,g),s(v,y),s(n,C),s(n,T),s(n,P),s(n,I),s(I,A),s(I,E),s(n,F),s(n,z),s(n,O),s(n,R),s(R,Y),s(R,q),w(W,H,j),L&&L.m(W,j),w(W,G,j)},p(W,j){j&2&&a!==(a=ce(W[1].h.u,2)+"")&&B(p,a),j&2&&h!==(h=ce(W[1].d.u,1)+"")&&B(g,h),j&2&&S!==(S=ce(W[1].m.u)+"")&&B(A,S),j&1&&U!==(U=ce(W[0].last_month.u)+"")&&B(Y,U),W[4]?L?L.p(W,j):(L=da(W),L.c(),L.m(G.parentNode,G)):L&&(L.d(1),L=null)},d(W){W&&k(e),W&&k(l),W&&k(n),W&&k(H),L&&L.d(W),W&&k(G)}}}function tm(t){let e,l,n,i,o,r,a=ce(t[1].h.u,2)+"",p,f,_,m,d,v,h,g=ce(t[1].d.u,1)+"",y,C,T,P,I,S,A,E=ce(t[1].m.u)+"",F,z,O,R,U,Y,q,H=ce(t[0].last_month.u)+"",G,L,W,j,ee,le,de,ie,we,Ie,Ce,Ee=ce(t[1].h.p,2)+"",ve,Pe,Ae,pe,se,me,Q,oe=ce(t[1].d.p,1)+"",Ne,Me,he,x,_e,Le,Ge,Ke=ce(t[1].m.p)+"",Fe,je,re,ge,Lt,Rl,Zt,ft=ce(t[0].last_month.p)+"",yl,rl,Ot,dt,Qe=t[4]&&va(t),Xe=t[4]&&ha(t),Ze=t[4]&&ba(t),Oe=t[4]&&ga(t),Je=t[4]&&ka(t),Be=t[4]&&wa(t),xe=t[4]&&ya(t),et=t[4]&&$a(t);return{c(){e=c("strong"),e.textContent="Import",l=b(),n=c("div"),i=c("div"),i.textContent="Hour",o=b(),r=c("div"),p=$(a),f=$(" kWh"),_=b(),Qe&&Qe.c(),m=b(),d=c("div"),d.textContent="Day",v=b(),h=c("div"),y=$(g),C=$(" kWh"),T=b(),Xe&&Xe.c(),P=b(),I=c("div"),I.textContent="Month",S=b(),A=c("div"),F=$(E),z=$(" kWh"),O=b(),Ze&&Ze.c(),R=b(),U=c("div"),U.textContent="Last month",Y=b(),q=c("div"),G=$(H),L=$(" kWh"),W=b(),Oe&&Oe.c(),ee=b(),le=c("strong"),le.textContent="Export",de=b(),ie=c("div"),we=c("div"),we.textContent="Hour",Ie=b(),Ce=c("div"),ve=$(Ee),Pe=$(" kWh"),Ae=b(),Je&&Je.c(),pe=b(),se=c("div"),se.textContent="Day",me=b(),Q=c("div"),Ne=$(oe),Me=$(" kWh"),he=b(),Be&&Be.c(),x=b(),_e=c("div"),_e.textContent="Month",Le=b(),Ge=c("div"),Fe=$(Ke),je=$(" kWh"),re=b(),xe&&xe.c(),ge=b(),Lt=c("div"),Lt.textContent="Last month",Rl=b(),Zt=c("div"),yl=$(ft),rl=$(" kWh"),Ot=b(),et&&et.c(),u(r,"class","text-right"),u(h,"class","text-right"),u(A,"class","text-right"),u(q,"class","text-right"),u(n,"class",j="grid grid-cols-"+t[5]+" mb-3"),u(Ce,"class","text-right"),u(Q,"class","text-right"),u(Ge,"class","text-right"),u(Zt,"class","text-right"),u(ie,"class",dt="grid grid-cols-"+t[5])},m(ue,be){w(ue,e,be),w(ue,l,be),w(ue,n,be),s(n,i),s(n,o),s(n,r),s(r,p),s(r,f),s(n,_),Qe&&Qe.m(n,null),s(n,m),s(n,d),s(n,v),s(n,h),s(h,y),s(h,C),s(n,T),Xe&&Xe.m(n,null),s(n,P),s(n,I),s(n,S),s(n,A),s(A,F),s(A,z),s(n,O),Ze&&Ze.m(n,null),s(n,R),s(n,U),s(n,Y),s(n,q),s(q,G),s(q,L),s(n,W),Oe&&Oe.m(n,null),w(ue,ee,be),w(ue,le,be),w(ue,de,be),w(ue,ie,be),s(ie,we),s(ie,Ie),s(ie,Ce),s(Ce,ve),s(Ce,Pe),s(ie,Ae),Je&&Je.m(ie,null),s(ie,pe),s(ie,se),s(ie,me),s(ie,Q),s(Q,Ne),s(Q,Me),s(ie,he),Be&&Be.m(ie,null),s(ie,x),s(ie,_e),s(ie,Le),s(ie,Ge),s(Ge,Fe),s(Ge,je),s(ie,re),xe&&xe.m(ie,null),s(ie,ge),s(ie,Lt),s(ie,Rl),s(ie,Zt),s(Zt,yl),s(Zt,rl),s(ie,Ot),et&&et.m(ie,null)},p(ue,be){be&2&&a!==(a=ce(ue[1].h.u,2)+"")&&B(p,a),ue[4]?Qe?Qe.p(ue,be):(Qe=va(ue),Qe.c(),Qe.m(n,m)):Qe&&(Qe.d(1),Qe=null),be&2&&g!==(g=ce(ue[1].d.u,1)+"")&&B(y,g),ue[4]?Xe?Xe.p(ue,be):(Xe=ha(ue),Xe.c(),Xe.m(n,P)):Xe&&(Xe.d(1),Xe=null),be&2&&E!==(E=ce(ue[1].m.u)+"")&&B(F,E),ue[4]?Ze?Ze.p(ue,be):(Ze=ba(ue),Ze.c(),Ze.m(n,R)):Ze&&(Ze.d(1),Ze=null),be&1&&H!==(H=ce(ue[0].last_month.u)+"")&&B(G,H),ue[4]?Oe?Oe.p(ue,be):(Oe=ga(ue),Oe.c(),Oe.m(n,null)):Oe&&(Oe.d(1),Oe=null),be&32&&j!==(j="grid grid-cols-"+ue[5]+" mb-3")&&u(n,"class",j),be&2&&Ee!==(Ee=ce(ue[1].h.p,2)+"")&&B(ve,Ee),ue[4]?Je?Je.p(ue,be):(Je=ka(ue),Je.c(),Je.m(ie,pe)):Je&&(Je.d(1),Je=null),be&2&&oe!==(oe=ce(ue[1].d.p,1)+"")&&B(Ne,oe),ue[4]?Be?Be.p(ue,be):(Be=wa(ue),Be.c(),Be.m(ie,x)):Be&&(Be.d(1),Be=null),be&2&&Ke!==(Ke=ce(ue[1].m.p)+"")&&B(Fe,Ke),ue[4]?xe?xe.p(ue,be):(xe=ya(ue),xe.c(),xe.m(ie,ge)):xe&&(xe.d(1),xe=null),be&1&&ft!==(ft=ce(ue[0].last_month.p)+"")&&B(yl,ft),ue[4]?et?et.p(ue,be):(et=$a(ue),et.c(),et.m(ie,null)):et&&(et.d(1),et=null),be&32&&dt!==(dt="grid grid-cols-"+ue[5])&&u(ie,"class",dt)},d(ue){ue&&k(e),ue&&k(l),ue&&k(n),Qe&&Qe.d(),Xe&&Xe.d(),Ze&&Ze.d(),Oe&&Oe.d(),ue&&k(ee),ue&&k(le),ue&&k(de),ue&&k(ie),Je&&Je.d(),Be&&Be.d(),xe&&xe.d(),et&&et.d()}}}function da(t){let e,l,n,i,o,r,a=ce(t[1].h.c,2)+"",p,f,_,m,d,v,h,g=ce(t[1].d.c,1)+"",y,C,T,P,I,S,A,E=ce(t[1].m.c)+"",F,z,O,R,U,Y,q,H=ce(t[0].last_month.c)+"",G,L,W;return{c(){e=c("strong"),e.textContent="Cost",l=b(),n=c("div"),i=c("div"),i.textContent="Hour",o=b(),r=c("div"),p=$(a),f=b(),_=$(t[2]),m=b(),d=c("div"),d.textContent="Day",v=b(),h=c("div"),y=$(g),C=b(),T=$(t[2]),P=b(),I=c("div"),I.textContent="Month",S=b(),A=c("div"),F=$(E),z=b(),O=$(t[2]),R=b(),U=c("div"),U.textContent="Last month",Y=b(),q=c("div"),G=$(H),L=b(),W=$(t[2]),u(r,"class","text-right"),u(h,"class","text-right"),u(A,"class","text-right"),u(q,"class","text-right"),u(n,"class","grid grid-cols-2")},m(j,ee){w(j,e,ee),w(j,l,ee),w(j,n,ee),s(n,i),s(n,o),s(n,r),s(r,p),s(r,f),s(r,_),s(n,m),s(n,d),s(n,v),s(n,h),s(h,y),s(h,C),s(h,T),s(n,P),s(n,I),s(n,S),s(n,A),s(A,F),s(A,z),s(A,O),s(n,R),s(n,U),s(n,Y),s(n,q),s(q,G),s(q,L),s(q,W)},p(j,ee){ee&2&&a!==(a=ce(j[1].h.c,2)+"")&&B(p,a),ee&4&&B(_,j[2]),ee&2&&g!==(g=ce(j[1].d.c,1)+"")&&B(y,g),ee&4&&B(T,j[2]),ee&2&&E!==(E=ce(j[1].m.c)+"")&&B(F,E),ee&4&&B(O,j[2]),ee&1&&H!==(H=ce(j[0].last_month.c)+"")&&B(G,H),ee&4&&B(W,j[2])},d(j){j&&k(e),j&&k(l),j&&k(n)}}}function va(t){let e,l=ce(t[1].h.c,2)+"",n,i,o;return{c(){e=c("div"),n=$(l),i=b(),o=$(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].h.c,2)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&k(e)}}}function ha(t){let e,l=ce(t[1].d.c,1)+"",n,i,o;return{c(){e=c("div"),n=$(l),i=b(),o=$(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].d.c,1)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&k(e)}}}function ba(t){let e,l=ce(t[1].m.c)+"",n,i,o;return{c(){e=c("div"),n=$(l),i=b(),o=$(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].m.c)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&k(e)}}}function ga(t){let e,l=ce(t[0].last_month.c)+"",n,i,o;return{c(){e=c("div"),n=$(l),i=b(),o=$(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&1&&l!==(l=ce(r[0].last_month.c)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&k(e)}}}function ka(t){let e,l=ce(t[1].h.i,2)+"",n,i,o;return{c(){e=c("div"),n=$(l),i=b(),o=$(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].h.i,2)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&k(e)}}}function wa(t){let e,l=ce(t[1].d.i,1)+"",n,i,o;return{c(){e=c("div"),n=$(l),i=b(),o=$(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].d.i,1)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&k(e)}}}function ya(t){let e,l=ce(t[1].m.i)+"",n,i,o;return{c(){e=c("div"),n=$(l),i=b(),o=$(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].m.i)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&k(e)}}}function $a(t){let e,l=ce(t[0].last_month.i)+"",n,i,o;return{c(){e=c("div"),n=$(l),i=b(),o=$(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&1&&l!==(l=ce(r[0].last_month.i)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&k(e)}}}function lm(t){let e,l,n,i,o,r,a=t[1]&&_a(t);return{c(){e=c("div"),l=c("strong"),l.textContent="Real time calculation",n=b(),i=c("br"),o=c("br"),r=b(),a&&a.c(),u(e,"class","mx-2 text-sm")},m(p,f){w(p,e,f),s(e,l),s(e,n),s(e,i),s(e,o),s(e,r),a&&a.m(e,null)},p(p,[f]){p[1]?a?a.p(p,f):(a=_a(p),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i:ne,o:ne,d(p){p&&k(e),a&&a.d()}}}function nm(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:r}=e,a=!1,p=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,r=f.hasExport)},t.$$.update=()=>{t.$$.dirty&18&&(l(4,a=i&&i.h&&(i.h.c>.01||i.d.c>.01||i.m.c>.01||i.h.i>.01||i.d.i>.01||i.m.i>.01)),l(5,p=a?3:2))},[n,i,o,r,a,p]}class im extends $e{constructor(e){super(),ye(this,e,nm,lm,ke,{sysinfo:0,data:1,currency:2,hasExport:3})}}function sm(t){let e,l,n,i;return n=new nn({props:{config:t[0]}}),{c(){e=c("a"),e.textContent="Provided by ENTSO-E",l=b(),J(n.$$.fragment),u(e,"href","https://transparency.entsoe.eu/"),u(e,"target","_blank"),u(e,"class","text-xs float-right z-40")},m(o,r){w(o,e,r),w(o,l,r),X(n,o,r),i=!0},p(o,[r]){const a={};r&1&&(a.config=o[0]),n.$set(a)},i(o){i||(N(n.$$.fragment,o),i=!0)},o(o){D(n.$$.fragment,o),i=!1},d(o){o&&k(e),o&&k(l),Z(n,o)}}}function om(t,e,l){let{json:n}=e,i={},o=0,r=0;return t.$$set=a=>{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=new Date().getUTCHours(),p=0,f=0,_=0,m=n[20]==null?2:1,d=[],v=[],h=[],g=new Date;for(p=a;p<24&&(f=n[De(_++)],f!=null);p++)v.push({label:De(g.getHours())}),h.push({label:f>0?f.toFixed(m):"",title:f>0?f.toFixed(2)+" "+n.currency:"",value:f>0?Math.abs(f*100):0,label2:f<0?f.toFixed(m):"",title2:f<0?f.toFixed(2)+" "+n.currency:"",value2:f<0?Math.abs(f*100):0,color:"#7c3aed"}),l(3,r=Math.min(r,f*100)),l(2,o=Math.max(o,f*100)),ki(g,1);for(p=0;p<24&&(f=n[De(_++)],f!=null);p++)v.push({label:De(g.getHours())}),h.push({label:f>0?f.toFixed(m):"",value:f>0?Math.abs(f*100):0,label2:f<0?f.toFixed(m):"",value2:f<0?Math.abs(f*100):0,color:"#7c3aed"}),l(3,r=Math.min(r,f*100)),l(2,o=Math.max(o,f*100)),ki(g,1);if(l(2,o=Math.ceil(o)),l(3,r=Math.floor(r)),r<0){let C=r/4;for(p=1;p<5;p++){let T=C*p;d.push({value:T,label:(T/100).toFixed(2)})}}let y=o/4;for(p=0;p<5;p++){let C=y*p;d.push({value:C,label:(C/100).toFixed(2)})}l(0,i={title:"Future energy price ("+n.currency+")",padding:{top:20,right:15,bottom:20,left:35},y:{min:r,max:o,ticks:d},x:{ticks:v},points:h})}},[i,n,o,r]}class um extends $e{constructor(e){super(),ye(this,e,om,sm,ke,{json:1})}}function rm(t){let e,l;return e=new nn({props:{config:t[0]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function am(t,e,l){let{json:n}=e,i={},o=0,r=0;return t.$$set=a=>{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=0,p=[],f=[],_=[],m=ki(new Date,-24),d=new Date().getUTCHours();for(a=d;a<24;a++){let g=n["i"+De(a)],y=n["e"+De(a)];g===void 0&&(g=0),y===void 0&&(y=0),f.push({label:De(m.getHours())}),_.push({label:g.toFixed(1),title:g.toFixed(2)+" kWh",value:g*10,label2:y.toFixed(1),title2:y.toFixed(2)+" kWh",value2:y*10,color:"#7c3aed"}),l(3,r=Math.max(r,y*10)),l(2,o=Math.max(o,g*10)),ki(m,1)}for(a=0;a{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=0,p=[],f=[],_=[],m=new Date,d=new Date;for(d.setDate(0),a=m.getDate();a<=d.getDate();a++){let g=n["i"+De(a)],y=n["e"+De(a)];g===void 0&&(g=0),y===void 0&&(y=0),f.push({label:De(a)}),_.push({label:g.toFixed(g<10?1:0),title:g.toFixed(2)+" kWh",value:g,label2:y.toFixed(y<10?1:0),title2:y.toFixed(2)+" kWh",value2:y,color:"#7c3aed"}),l(3,r=Math.max(r,y)),l(2,o=Math.max(o,g))}for(a=1;a{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=0,p=0,f=[],_=[],m=[];n.s&&n.s.forEach((h,g)=>{var y=h.n?h.n:h.a;p=h.v,p==-127&&(p=0),_.push({label:y.slice(-4)}),m.push({label:p.toFixed(1),value:p,color:"#7c3aed"}),l(3,r=Math.min(r,p)),l(2,o=Math.max(o,p))}),l(2,o=Math.ceil(o)),l(3,r=Math.floor(r));let d=o;r<0&&(d+=Math.abs(r));let v=d/4;for(a=0;a<5;a++)p=r+v*a,f.push({value:p,label:p.toFixed(1)});l(0,i={title:"Temperature sensors (°C)",height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:r,max:o,ticks:f},x:{ticks:_},points:m})}},[i,n,o,r]}class vm extends $e{constructor(e){super(),ye(this,e,dm,_m,ke,{json:1})}}function hm(t){let e,l;return e=new nn({props:{config:t[0]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}let bm=0;function gm(t,e,l){let n={},i=0,o;return $c.subscribe(r=>{l(2,o=r)}),yc(),t.$$.update=()=>{if(t.$$.dirty&6){let r=0,a=[],p=[],f=[];if(a.push({value:0,label:0}),o&&o.p)for(r=0;r0?De(_.d)+"."+zs[new Date().getMonth()]:"-"}),l(1,i=Math.max(i,_.v))}if(o&&o.t){for(r=0;r=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:bm,max:i,ticks:a},x:{ticks:p},points:f})}},[n,i,o]}class km extends $e{constructor(e){super(),ye(this,e,gm,hm,ke,{})}}function Ca(t){let e,l,n,i,o,r,a=(t[0].mt?ds(t[0].mt):"-")+"",p,f,_,m=(t[0].ic?t[0].ic.toFixed(1):"-")+"",d,v,h;return i=new Nc({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:"Import",sub:t[0].p,subunit:t[0].pc,colorFn:vc}}),{c(){e=c("div"),l=c("div"),n=c("div"),J(i.$$.fragment),o=b(),r=c("div"),p=$(a),f=b(),_=c("div"),d=$(m),v=$(" kWh"),u(n,"class","col-span-2"),u(_,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(g,y){w(g,e,y),s(e,l),s(l,n),X(i,n,null),s(l,o),s(l,r),s(r,p),s(l,f),s(l,_),s(_,d),s(_,v),h=!0},p(g,y){const C={};y&1&&(C.val=g[0].i?g[0].i:0),y&1&&(C.max=g[0].im?g[0].im:15e3),y&1&&(C.sub=g[0].p),y&1&&(C.subunit=g[0].pc),i.$set(C),(!h||y&1)&&a!==(a=(g[0].mt?ds(g[0].mt):"-")+"")&&B(p,a),(!h||y&1)&&m!==(m=(g[0].ic?g[0].ic.toFixed(1):"-")+"")&&B(d,m)},i(g){h||(N(i.$$.fragment,g),h=!0)},o(g){D(i.$$.fragment,g),h=!1},d(g){g&&k(e),Z(i)}}}function Ta(t){let e,l,n,i,o,r,a,p,f=(t[0].ec?t[0].ec.toFixed(1):"-")+"",_,m,d;return i=new Nc({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:"Export",colorFn:lp}}),{c(){e=c("div"),l=c("div"),n=c("div"),J(i.$$.fragment),o=b(),r=c("div"),a=b(),p=c("div"),_=$(f),m=$(" kWh"),u(n,"class","col-span-2"),u(p,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(v,h){w(v,e,h),s(e,l),s(l,n),X(i,n,null),s(l,o),s(l,r),s(l,a),s(l,p),s(p,_),s(p,m),d=!0},p(v,h){const g={};h&1&&(g.val=v[0].e?v[0].e:0),h&1&&(g.max=v[0].om?v[0].om*1e3:1e4),i.$set(g),(!d||h&1)&&f!==(f=(v[0].ec?v[0].ec.toFixed(1):"-")+"")&&B(_,f)},i(v){d||(N(i.$$.fragment,v),d=!0)},o(v){D(i.$$.fragment,v),d=!1},d(v){v&&k(e),Z(i)}}}function Sa(t){let e,l,n;return l=new Vp({props:{u1:t[0].u1,u2:t[0].u2,u3:t[0].u3,ds:t[0].ds}}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt")},m(i,o){w(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&1&&(r.u1=i[0].u1),o&1&&(r.u2=i[0].u2),o&1&&(r.u3=i[0].u3),o&1&&(r.ds=i[0].ds),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function Pa(t){let e,l,n;return l=new Xp({props:{u1:t[0].u1,u2:t[0].u2,u3:t[0].u3,i1:t[0].i1,i2:t[0].i2,i3:t[0].i3,max:t[0].mf?t[0].mf:32}}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt")},m(i,o){w(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&1&&(r.u1=i[0].u1),o&1&&(r.u2=i[0].u2),o&1&&(r.u3=i[0].u3),o&1&&(r.i1=i[0].i1),o&1&&(r.i2=i[0].i2),o&1&&(r.i3=i[0].i3),o&1&&(r.max=i[0].mf?i[0].mf:32),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function Na(t){let e,l,n;return l=new xp({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec}}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt")},m(i,o){w(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&1&&(r.importInstant=i[0].ri),o&1&&(r.exportInstant=i[0].re),o&1&&(r.importTotal=i[0].ric),o&1&&(r.exportTotal=i[0].rec),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function Ma(t){let e,l,n;return l=new im({props:{sysinfo:t[1],data:t[0].ea,currency:t[0].pc,hasExport:t[0].om>0||t[0].e>0}}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt")},m(i,o){w(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&2&&(r.sysinfo=i[1]),o&1&&(r.data=i[0].ea),o&1&&(r.currency=i[0].pc),o&1&&(r.hasExport=i[0].om>0||i[0].e>0),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function Aa(t){let e,l,n;return l=new km({}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt h-64")},m(i,o){w(i,e,o),X(l,e,null),n=!0},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function Da(t){let e,l,n;return l=new um({props:{json:t[2]}}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt gwf")},m(i,o){w(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&4&&(r.json=i[2]),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function Ia(t){let e,l,n;return l=new fm({props:{json:t[3]}}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt gwf")},m(i,o){w(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&8&&(r.json=i[3]),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function Ea(t){let e,l,n;return l=new mm({props:{json:t[4]}}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt gwf")},m(i,o){w(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&16&&(r.json=i[4]),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function Fa(t){let e,l,n;return l=new vm({props:{json:t[5]}}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt gwf")},m(i,o){w(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&32&&(r.json=i[5]),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function wm(t){let e,l=Ye(t[1].ui.i,t[0].i),n,i=Ye(t[1].ui.e,t[0].om||t[0].e>0),o,r=Ye(t[1].ui.v,t[0].u1>100||t[0].u2>100||t[0].u3>100),a,p=Ye(t[1].ui.a,t[0].i1>.01||t[0].i2>.01||t[0].i3>.01),f,_=Ye(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),m,d=Ye(t[1].ui.c,t[0].ea),v,h=Ye(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("10YNO")||t[0].pr=="10Y1001A1001A48H")),g,y=Ye(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),C,T=Ye(t[1].ui.d,t[3]),P,I=Ye(t[1].ui.m,t[4]),S,A=Ye(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),E,F=l&&Ca(t),z=i&&Ta(t),O=r&&Sa(t),R=p&&Pa(t),U=_&&Na(t),Y=d&&Ma(t),q=h&&Aa(),H=y&&Da(t),G=T&&Ia(t),L=I&&Ea(t),W=A&&Fa(t);return{c(){e=c("div"),F&&F.c(),n=b(),z&&z.c(),o=b(),O&&O.c(),a=b(),R&&R.c(),f=b(),U&&U.c(),m=b(),Y&&Y.c(),v=b(),q&&q.c(),g=b(),H&&H.c(),C=b(),G&&G.c(),P=b(),L&&L.c(),S=b(),W&&W.c(),u(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(j,ee){w(j,e,ee),F&&F.m(e,null),s(e,n),z&&z.m(e,null),s(e,o),O&&O.m(e,null),s(e,a),R&&R.m(e,null),s(e,f),U&&U.m(e,null),s(e,m),Y&&Y.m(e,null),s(e,v),q&&q.m(e,null),s(e,g),H&&H.m(e,null),s(e,C),G&&G.m(e,null),s(e,P),L&&L.m(e,null),s(e,S),W&&W.m(e,null),E=!0},p(j,[ee]){ee&3&&(l=Ye(j[1].ui.i,j[0].i)),l?F?(F.p(j,ee),ee&3&&N(F,1)):(F=Ca(j),F.c(),N(F,1),F.m(e,n)):F&&(Te(),D(F,1,1,()=>{F=null}),Se()),ee&3&&(i=Ye(j[1].ui.e,j[0].om||j[0].e>0)),i?z?(z.p(j,ee),ee&3&&N(z,1)):(z=Ta(j),z.c(),N(z,1),z.m(e,o)):z&&(Te(),D(z,1,1,()=>{z=null}),Se()),ee&3&&(r=Ye(j[1].ui.v,j[0].u1>100||j[0].u2>100||j[0].u3>100)),r?O?(O.p(j,ee),ee&3&&N(O,1)):(O=Sa(j),O.c(),N(O,1),O.m(e,a)):O&&(Te(),D(O,1,1,()=>{O=null}),Se()),ee&3&&(p=Ye(j[1].ui.a,j[0].i1>.01||j[0].i2>.01||j[0].i3>.01)),p?R?(R.p(j,ee),ee&3&&N(R,1)):(R=Pa(j),R.c(),N(R,1),R.m(e,f)):R&&(Te(),D(R,1,1,()=>{R=null}),Se()),ee&3&&(_=Ye(j[1].ui.r,j[0].ri>0||j[0].re>0||j[0].ric>0||j[0].rec>0)),_?U?(U.p(j,ee),ee&3&&N(U,1)):(U=Na(j),U.c(),N(U,1),U.m(e,m)):U&&(Te(),D(U,1,1,()=>{U=null}),Se()),ee&3&&(d=Ye(j[1].ui.c,j[0].ea)),d?Y?(Y.p(j,ee),ee&3&&N(Y,1)):(Y=Ma(j),Y.c(),N(Y,1),Y.m(e,v)):Y&&(Te(),D(Y,1,1,()=>{Y=null}),Se()),ee&3&&(h=Ye(j[1].ui.t,j[0].pr&&(j[0].pr.startsWith("10YNO")||j[0].pr=="10Y1001A1001A48H"))),h?q?ee&3&&N(q,1):(q=Aa(),q.c(),N(q,1),q.m(e,g)):q&&(Te(),D(q,1,1,()=>{q=null}),Se()),ee&3&&(y=Ye(j[1].ui.p,j[0].pe&&!Number.isNaN(j[0].p))),y?H?(H.p(j,ee),ee&3&&N(H,1)):(H=Da(j),H.c(),N(H,1),H.m(e,C)):H&&(Te(),D(H,1,1,()=>{H=null}),Se()),ee&10&&(T=Ye(j[1].ui.d,j[3])),T?G?(G.p(j,ee),ee&10&&N(G,1)):(G=Ia(j),G.c(),N(G,1),G.m(e,P)):G&&(Te(),D(G,1,1,()=>{G=null}),Se()),ee&18&&(I=Ye(j[1].ui.m,j[4])),I?L?(L.p(j,ee),ee&18&&N(L,1)):(L=Ea(j),L.c(),N(L,1),L.m(e,S)):L&&(Te(),D(L,1,1,()=>{L=null}),Se()),ee&35&&(A=Ye(j[1].ui.s,j[0].t&&j[0].t!=-127&&j[5].c>1)),A?W?(W.p(j,ee),ee&35&&N(W,1)):(W=Fa(j),W.c(),N(W,1),W.m(e,null)):W&&(Te(),D(W,1,1,()=>{W=null}),Se())},i(j){E||(N(F),N(z),N(O),N(R),N(U),N(Y),N(q),N(H),N(G),N(L),N(W),E=!0)},o(j){D(F),D(z),D(O),D(R),D(U),D(Y),D(q),D(H),D(G),D(L),D(W),E=!1},d(j){j&&k(e),F&&F.d(),z&&z.d(),O&&O.d(),R&&R.d(),U&&U.d(),Y&&Y.d(),q&&q.d(),H&&H.d(),G&&G.d(),L&&L.d(),W&&W.d()}}}function ym(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},r={},a={},p={};return hc.subscribe(f=>{l(2,o=f)}),bc.subscribe(f=>{l(3,r=f)}),gc.subscribe(f=>{l(4,a=f)}),wc.subscribe(f=>{l(5,p=f)}),t.$$set=f=>{"data"in f&&l(0,n=f.data),"sysinfo"in f&&l(1,i=f.sysinfo)},[n,i,o,r,a,p]}class $m extends $e{constructor(e){super(),ye(this,e,ym,wm,ke,{data:0,sysinfo:1})}}let xs={};const Mc=ut(xs);async function Cm(){xs=await(await fetch("/configuration.json")).json(),Mc.set(xs)}function Ra(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Tm(t){let e;return{c(){e=c("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function Sm(t){let e;return{c(){e=c("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function La(t){let e;return{c(){e=c("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function Oa(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){w(i,e,o),w(i,l,o),w(i,n,o)},d(i){i&&k(e),i&&k(l),i&&k(n)}}}function qa(t){let e;return{c(){e=c("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function Ua(t){let e,l,n;return{c(){e=c("option"),l=$("GPIO"),n=$(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){w(i,e,o),s(e,l),s(e,n)},d(i){i&&k(e)}}}function Ha(t){let e,l=t[4]>3&&!(t[0]=="esp32"&&(t[4]==9||t[4]==16))&&!(t[0]=="esp32s2"&&t[4]==18)&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Ua(t);return{c(){l&&l.c(),e=We()},m(n,i){l&&l.m(n,i),w(n,e,i)},p(n,i){n[4]>3&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!(n[0]=="esp32s2"&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Ua(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&k(e)}}}function Pm(t){let e,l,n,i,o;function r(h,g){return h[0]=="esp32c3"?Sm:Tm}let a=r(t),p=a(t),f=t[0]=="esp8266"&&La(),_=(t[0]=="esp32"||t[0]=="esp32solo")&&Oa(),m=t[0]=="esp32s2"&&qa(),d={length:t[1]+1},v=[];for(let h=0;h{"chip"in o&&l(0,n=o.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32c3":l(1,i=19);break}},[n,i]}class Ac extends $e{constructor(e){super(),ye(this,e,Nm,Pm,ke,{chip:0})}}function ja(t){let e,l,n=t[1]&&Wa(t);return{c(){e=c("div"),l=c("div"),n&&n.c(),u(l,"class","fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center"),u(e,"class","z-50"),u(e,"aria-modal","true")},m(i,o){w(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=Wa(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&k(e),n&&n.d()}}}function Wa(t){let e,l;return{c(){e=c("div"),l=$(t[1]),u(e,"class","bg-white m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 w-96")},m(n,i){w(n,e,i),s(e,l)},p(n,i){i&2&&B(l,n[1])},d(n){n&&k(e)}}}function Mm(t){let e,l=t[0]&&ja(t);return{c(){l&&l.c(),e=We()},m(n,i){l&&l.m(n,i),w(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=ja(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:ne,o:ne,d(n){l&&l.d(n),n&&k(e)}}}function Am(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 Mt extends $e{constructor(e){super(),ye(this,e,Am,Mm,ke,{active:0,message:1})}}function Ga(t,e,l){const n=t.slice();return n[1]=e[l],n}function Ba(t){let e,l,n=t[1]+"",i;return{c(){e=c("option"),l=$("Europe/"),i=$(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,r){w(o,e,r),s(e,l),s(e,i)},p:ne,d(o){o&&k(e)}}}function Dm(t){let e,l,n,i=t[0],o=[];for(let r=0;r{r[_]=null}),Se(),l=r[e],l||(l=r[e]=o[e](p),l.c()),N(l,1),l.m(n.parentNode,n))},i(p){i||(N(l),i=!0)},o(p){D(l),i=!1},d(p){r[e].d(p),p&&k(n)}}}function Wm(t){let e,l;return e=new sl({props:{color:"blue",text:"Upload cert",title:"Click here to upload certificate"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Gm(t){let e,l;return e=new sl({props:{color:"green",text:"Cert OK",title:"Click here to replace certificate"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Bm(t){let e,l,n,i;const o=[Gm,Wm],r=[];function a(p,f){return p[3].q.s.r?0:1}return e=a(t),l=r[e]=o[e](t),{c(){l.c(),n=We()},m(p,f){r[e].m(p,f),w(p,n,f),i=!0},p(p,f){let _=e;e=a(p),e!==_&&(Te(),D(r[_],1,1,()=>{r[_]=null}),Se(),l=r[e],l||(l=r[e]=o[e](p),l.c()),N(l,1),l.m(n.parentNode,n))},i(p){i||(N(l),i=!0)},o(p){D(l),i=!1},d(p){r[e].d(p),p&&k(n)}}}function Ym(t){let e,l;return e=new sl({props:{color:"blue",text:"Upload key",title:"Click here to upload key"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function zm(t){let e,l;return e=new sl({props:{color:"green",text:"Key OK",title:"Click here to replace key"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Vm(t){let e,l,n,i;const o=[zm,Ym],r=[];function a(p,f){return p[3].q.s.k?0:1}return e=a(t),l=r[e]=o[e](t),{c(){l.c(),n=We()},m(p,f){r[e].m(p,f),w(p,n,f),i=!0},p(p,f){let _=e;e=a(p),e!==_&&(Te(),D(r[_],1,1,()=>{r[_]=null}),Se(),l=r[e],l||(l=r[e]=o[e](p),l.c()),N(l,1),l.m(n.parentNode,n))},i(p){i||(N(l),i=!0)},o(p){D(l),i=!1},d(p){r[e].d(p),p&&k(n)}}}function tf(t){let e,l,n,i,o,r,a,p,f,_,m,d,v,h,g,y,C,T,P,I,S,A,E,F,z,O,R,U,Y,q,H,G;return o=new Et({}),{c(){e=c("div"),l=c("strong"),l.textContent="Domoticz",n=b(),i=c("a"),J(o.$$.fragment),r=b(),a=c("input"),p=b(),f=c("div"),_=c("div"),m=$("Electricity IDX"),d=c("br"),v=b(),h=c("input"),g=b(),y=c("div"),C=$("Current IDX"),T=c("br"),P=b(),I=c("input"),S=b(),A=c("div"),E=$(`Voltage IDX: L1, L2 & L3 + `),o.c(),l=We()},m(r,a){w(r,e,a),o.m(r,a),w(r,l,a)},p(r,a){i===(i=n(r))&&o?o.p(r,a):(o.d(1),o=i(r),o&&(o.c(),o.m(l.parentNode,l)))},d(r){r&&k(e),o.d(r),r&&k(l)}}}function rp(t){let e,l;return{c(){e=$(t[0]),l=$(" seconds")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&1&&B(e,n[0])},d(n){n&&k(e),n&&k(l)}}}function ap(t){let e,l;return{c(){e=$(t[3]),l=$(" minute")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&8&&B(e,n[3])},d(n){n&&k(e),n&&k(l)}}}function fp(t){let e,l;return{c(){e=$(t[3]),l=$(" minutes")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&8&&B(e,n[3])},d(n){n&&k(e),n&&k(l)}}}function cp(t){let e,l;return{c(){e=$(t[2]),l=$(" hour")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&4&&B(e,n[2])},d(n){n&&k(e),n&&k(l)}}}function pp(t){let e,l;return{c(){e=$(t[2]),l=$(" hours")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&4&&B(e,n[2])},d(n){n&&k(e),n&&k(l)}}}function mp(t){let e,l;return{c(){e=$(t[1]),l=$(" day")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&2&&B(e,n[1])},d(n){n&&k(e),n&&k(l)}}}function _p(t){let e,l;return{c(){e=$(t[1]),l=$(" days")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&2&&B(e,n[1])},d(n){n&&k(e),n&&k(l)}}}function dp(t){let e,l=t[0]&&jr(t);return{c(){l&&l.c(),e=We()},m(n,i){l&&l.m(n,i),w(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=jr(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:ne,o:ne,d(n){l&&l.d(n),n&&k(e)}}}function vp(t,e,l){let{epoch:n}=e,i=0,o=0,r=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,r=Math.floor(n/60)))},[n,i,o,r]}class hp extends $e{constructor(e){super(),ye(this,e,vp,dp,ke,{epoch:0})}}function bp(t){let e,l,n;return{c(){e=c("span"),l=$(t[2]),u(e,"title",t[1]),u(e,"class",n="bd-"+t[0])},m(i,o){w(i,e,o),s(e,l)},p(i,[o]){o&4&&B(l,i[2]),o&2&&u(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&u(e,"class",n)},i:ne,o:ne,d(i){i&&k(e)}}}function gp(t,e,l){let{color:n}=e,{title:i}=e,{text:o}=e;return t.$$set=r=>{"color"in r&&l(0,n=r.color),"title"in r&&l(1,i=r.title),"text"in r&&l(2,o=r.text)},[n,i,o]}class sl extends $e{constructor(e){super(),ye(this,e,gp,bp,ke,{color:0,title:1,text:2})}}function kp(t){let e,l=`${De(t[0].getDate())}.${De(t[0].getMonth()+1)}.${t[0].getFullYear()} ${De(t[0].getHours())}:${De(t[0].getMinutes())}`,n;return{c(){e=c("span"),n=$(l),u(e,"class",t[1])},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${De(i[0].getDate())}.${De(i[0].getMonth()+1)}.${i[0].getFullYear()} ${De(i[0].getHours())}:${De(i[0].getMinutes())}`)&&B(n,l),o&2&&u(e,"class",i[1])},d(i){i&&k(e)}}}function wp(t){let e=`${De(t[0].getDate())}. ${zs[t[0].getMonth()]} ${De(t[0].getHours())}:${De(t[0].getMinutes())}`,l;return{c(){l=$(e)},m(n,i){w(n,l,i)},p(n,i){i&1&&e!==(e=`${De(n[0].getDate())}. ${zs[n[0].getMonth()]} ${De(n[0].getHours())}:${De(n[0].getMinutes())}`)&&B(l,e)},d(n){n&&k(l)}}}function yp(t){let e,l;function n(r,a){return a&1&&(e=null),e==null&&(e=Math.abs(new Date().getTime()-r[0].getTime())<3e5),e?wp:kp}let i=n(t,-1),o=i(t);return{c(){o.c(),l=We()},m(r,a){o.m(r,a),w(r,l,a)},p(r,[a]){i===(i=n(r,a))&&o?o.p(r,a):(o.d(1),o=i(r),o&&(o.c(),o.m(l.parentNode,l)))},i:ne,o:ne,d(r){o.d(r),r&&k(l)}}}function $p(t,e,l){let{timestamp:n}=e,{fullTimeColor:i}=e;return t.$$set=o=>{"timestamp"in o&&l(0,n=o.timestamp),"fullTimeColor"in o&&l(1,i=o.fullTimeColor)},[n,i]}class Sc extends $e{constructor(e){super(),ye(this,e,$p,yp,ke,{timestamp:0,fullTimeColor:1})}}function Cp(t){let e,l,n;return{c(){e=Ue("svg"),l=Ue("path"),n=Ue("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(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"),u(n,"stroke-linecap","round"),u(n,"stroke-linejoin","round"),u(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(i,o){w(i,e,o),s(e,l),s(e,n)},p:ne,i:ne,o:ne,d(i){i&&k(e)}}}class Tp extends $e{constructor(e){super(),ye(this,e,null,Cp,ke,{})}}function Sp(t){let e,l;return{c(){e=Ue("svg"),l=Ue("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(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"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(n,i){w(n,e,i),s(e,l)},p:ne,i:ne,o:ne,d(n){n&&k(e)}}}class Pp extends $e{constructor(e){super(),ye(this,e,null,Sp,ke,{})}}function Np(t){let e,l;return{c(){e=Ue("svg"),l=Ue("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(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"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(n,i){w(n,e,i),s(e,l)},p:ne,i:ne,o:ne,d(n){n&&k(e)}}}class Et extends $e{constructor(e){super(),ye(this,e,null,Np,ke,{})}}function Mp(t){let e,l;return{c(){e=Ue("svg"),l=Ue("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(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"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(n,i){w(n,e,i),s(e,l)},p:ne,i:ne,o:ne,d(n){n&&k(e)}}}class Pc extends $e{constructor(e){super(),ye(this,e,null,Mp,ke,{})}}function Ap(t){let e,l,n=t[1].version+"",i;return{c(){e=$("AMS reader "),l=c("span"),i=$(n)},m(o,r){w(o,e,r),w(o,l,r),s(l,i)},p(o,r){r&2&&n!==(n=o[1].version+"")&&B(i,n)},d(o){o&&k(e),o&&k(l)}}}function Wr(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=c("div"),n=$(l),i=$("°C"),u(e,"class","flex-none my-auto")},m(o,r){w(o,e,r),s(e,n),s(e,i)},p(o,r){r&1&&l!==(l=(o[0].t>-50?o[0].t.toFixed(1):"-")+"")&&B(n,l)},d(o){o&&k(e)}}}function Gr(t){let e,l="HAN: "+Rr(t[0].he),n;return{c(){e=c("div"),n=$(l),u(e,"class","bd-red")},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="HAN: "+Rr(i[0].he))&&B(n,l)},d(i){i&&k(e)}}}function Br(t){let e,l="MQTT: "+Lr(t[0].me),n;return{c(){e=c("div"),n=$(l),u(e,"class","bd-red")},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="MQTT: "+Lr(i[0].me))&&B(n,l)},d(i){i&&k(e)}}}function Yr(t){let e,l="PriceAPI: "+Or(t[0].ee),n;return{c(){e=c("div"),n=$(l),u(e,"class","bd-red")},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="PriceAPI: "+Or(i[0].ee))&&B(n,l)},d(i){i&&k(e)}}}function zr(t){let e,l,n,i,o,r;return l=new Dl({props:{to:"/configuration",$$slots:{default:[Dp]},$$scope:{ctx:t}}}),o=new Dl({props:{to:"/status",$$slots:{default:[Ip]},$$scope:{ctx:t}}}),{c(){e=c("div"),J(l.$$.fragment),n=b(),i=c("div"),J(o.$$.fragment),u(e,"class","flex-none px-1 mt-1"),u(e,"title","Configuration"),u(i,"class","flex-none px-1 mt-1"),u(i,"title","Device information")},m(a,p){w(a,e,p),X(l,e,null),w(a,n,p),w(a,i,p),X(o,i,null),r=!0},i(a){r||(N(l.$$.fragment,a),N(o.$$.fragment,a),r=!0)},o(a){D(l.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&k(e),Z(l),a&&k(n),a&&k(i),Z(o)}}}function Dp(t){let e,l;return e=new Tp({}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Ip(t){let e,l;return e=new Pp({}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Vr(t){let e,l,n,i,o;const r=[Fp,Ep],a=[];function p(f,_){return f[1].security==0||f[0].a?0:1}return l=p(t),n=a[l]=r[l](t),{c(){e=c("div"),n.c(),u(e,"class","flex-none mr-3 text-yellow-500"),u(e,"title",i="New version: "+t[2].tag_name)},m(f,_){w(f,e,_),a[l].m(e,null),o=!0},p(f,_){let m=l;l=p(f),l===m?a[l].p(f,_):(Te(),D(a[m],1,1,()=>{a[m]=null}),Se(),n=a[l],n?n.p(f,_):(n=a[l]=r[l](f),n.c()),N(n,1),n.m(e,null)),(!o||_&4&&i!==(i="New version: "+f[2].tag_name))&&u(e,"title",i)},i(f){o||(N(n),o=!0)},o(f){D(n),o=!1},d(f){f&&k(e),a[l].d()}}}function Ep(t){let e,l,n=t[2].tag_name+"",i;return{c(){e=c("span"),l=$("New version: "),i=$(n)},m(o,r){w(o,e,r),s(e,l),s(e,i)},p(o,r){r&4&&n!==(n=o[2].tag_name+"")&&B(i,n)},i:ne,o:ne,d(o){o&&k(e)}}}function Fp(t){let e,l,n,i=t[2].tag_name+"",o,r,a,p,f,_;return a=new Pc({}),{c(){e=c("button"),l=c("span"),n=$("New version: "),o=$(i),r=b(),J(a.$$.fragment),u(l,"class","mt-1"),u(e,"class","flex")},m(m,d){w(m,e,d),s(e,l),s(l,n),s(l,o),s(e,r),X(a,e,null),p=!0,f||(_=K(e,"click",t[3]),f=!0)},p(m,d){(!p||d&4)&&i!==(i=m[2].tag_name+"")&&B(o,i)},i(m){p||(N(a.$$.fragment,m),p=!0)},o(m){D(a.$$.fragment,m),p=!1},d(m){m&&k(e),Z(a),f=!1,_()}}}function Rp(t){let e,l,n,i,o,r,a,p,f,_,m,d,v=(t[0].m?(t[0].m/1e3).toFixed(1):"-")+"",h,g,y,C,T,P,I,S,A,E,F,z,O,R,U,Y,q,H,G,L,W,j,ee,le,de,ie,we,Ie,Ce,Ee;i=new Dl({props:{to:"/",$$slots:{default:[Ap]},$$scope:{ctx:t}}}),p=new hp({props:{epoch:t[0].u}});let ve=t[0].t>-50&&Wr(t);T=new sl({props:{title:"ESP",text:t[1].booting?"Booting":t[0].v>2?t[0].v.toFixed(2)+"V":"ESP",color:Al(t[1].booting?2:t[0].em)}}),I=new sl({props:{title:"HAN",text:"HAN",color:Al(t[1].booting?9:t[0].hm)}}),A=new sl({props:{title:"WiFi",text:t[0].r?t[0].r.toFixed(0)+"dBm":"WiFi",color:Al(t[1].booting?9:t[0].wm)}}),F=new sl({props:{title:"MQTT",text:"MQTT",color:Al(t[1].booting?9:t[0].mm)}});let Pe=(t[0].he<0||t[0].he>0)&&Gr(t),Ae=t[0].me<0&&Br(t),pe=(t[0].ee>0||t[0].ee<0)&&Yr(t);ee=new Sc({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),fullTimeColor:"text-red-500"}});let se=t[1].vndcfg&&t[1].usrcfg&&zr(t);Ie=new Et({});let me=t[1].fwconsent===1&&t[2]&&Vr(t);return{c(){e=c("nav"),l=c("div"),n=c("div"),J(i.$$.fragment),o=b(),r=c("div"),a=c("div"),J(p.$$.fragment),f=b(),ve&&ve.c(),_=b(),m=c("div"),d=$("Free mem: "),h=$(v),g=$("kb"),y=b(),C=c("div"),J(T.$$.fragment),P=b(),J(I.$$.fragment),S=b(),J(A.$$.fragment),E=b(),J(F.$$.fragment),z=b(),Pe&&Pe.c(),O=b(),Ae&&Ae.c(),R=b(),pe&&pe.c(),U=b(),Y=c("div"),q=c("div"),H=c("a"),G=c("img"),W=b(),j=c("div"),J(ee.$$.fragment),le=b(),se&&se.c(),de=b(),ie=c("div"),we=c("a"),J(Ie.$$.fragment),Ce=b(),me&&me.c(),u(n,"class","flex text-lg text-gray-100 p-2"),u(a,"class","flex-none my-auto"),u(m,"class","flex-none my-auto"),u(r,"class","flex-none my-auto p-2 flex space-x-4"),u(C,"class","flex-auto flex-wrap my-auto justify-center p-2"),u(G,"class","gh-logo"),Fc(G.src,L=up)||u(G,"src",L),u(G,"alt","GitHub repo"),u(H,"class","float-right"),u(H,"href","https://github.com/UtilitechAS/amsreader-firmware"),u(H,"target","_blank"),u(H,"rel","noreferrer"),u(H,"aria-label","GitHub"),u(q,"class","flex-none"),u(j,"class","flex-none my-auto px-2"),u(we,"href",Ft("")),u(we,"target","_blank"),u(we,"rel","noreferrer"),u(ie,"class","flex-none px-1 mt-1"),u(ie,"title","Documentation"),u(Y,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),u(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),u(e,"class","bg-violet-600 p-1 rounded-md mx-2")},m(Q,oe){w(Q,e,oe),s(e,l),s(l,n),X(i,n,null),s(l,o),s(l,r),s(r,a),X(p,a,null),s(r,f),ve&&ve.m(r,null),s(r,_),s(r,m),s(m,d),s(m,h),s(m,g),s(l,y),s(l,C),X(T,C,null),s(C,P),X(I,C,null),s(C,S),X(A,C,null),s(C,E),X(F,C,null),s(l,z),Pe&&Pe.m(l,null),s(l,O),Ae&&Ae.m(l,null),s(l,R),pe&&pe.m(l,null),s(l,U),s(l,Y),s(Y,q),s(q,H),s(H,G),s(Y,W),s(Y,j),X(ee,j,null),s(Y,le),se&&se.m(Y,null),s(Y,de),s(Y,ie),s(ie,we),X(Ie,we,null),s(Y,Ce),me&&me.m(Y,null),Ee=!0},p(Q,[oe]){const Ne={};oe&18&&(Ne.$$scope={dirty:oe,ctx:Q}),i.$set(Ne);const Me={};oe&1&&(Me.epoch=Q[0].u),p.$set(Me),Q[0].t>-50?ve?ve.p(Q,oe):(ve=Wr(Q),ve.c(),ve.m(r,_)):ve&&(ve.d(1),ve=null),(!Ee||oe&1)&&v!==(v=(Q[0].m?(Q[0].m/1e3).toFixed(1):"-")+"")&&B(h,v);const he={};oe&3&&(he.text=Q[1].booting?"Booting":Q[0].v>2?Q[0].v.toFixed(2)+"V":"ESP"),oe&3&&(he.color=Al(Q[1].booting?2:Q[0].em)),T.$set(he);const x={};oe&3&&(x.color=Al(Q[1].booting?9:Q[0].hm)),I.$set(x);const _e={};oe&1&&(_e.text=Q[0].r?Q[0].r.toFixed(0)+"dBm":"WiFi"),oe&3&&(_e.color=Al(Q[1].booting?9:Q[0].wm)),A.$set(_e);const Le={};oe&3&&(Le.color=Al(Q[1].booting?9:Q[0].mm)),F.$set(Le),Q[0].he<0||Q[0].he>0?Pe?Pe.p(Q,oe):(Pe=Gr(Q),Pe.c(),Pe.m(l,O)):Pe&&(Pe.d(1),Pe=null),Q[0].me<0?Ae?Ae.p(Q,oe):(Ae=Br(Q),Ae.c(),Ae.m(l,R)):Ae&&(Ae.d(1),Ae=null),Q[0].ee>0||Q[0].ee<0?pe?pe.p(Q,oe):(pe=Yr(Q),pe.c(),pe.m(l,U)):pe&&(pe.d(1),pe=null);const Ge={};oe&1&&(Ge.timestamp=Q[0].c?new Date(Q[0].c*1e3):new Date(0)),ee.$set(Ge),Q[1].vndcfg&&Q[1].usrcfg?se?oe&2&&N(se,1):(se=zr(Q),se.c(),N(se,1),se.m(Y,de)):se&&(Te(),D(se,1,1,()=>{se=null}),Se()),Q[1].fwconsent===1&&Q[2]?me?(me.p(Q,oe),oe&6&&N(me,1)):(me=Vr(Q),me.c(),N(me,1),me.m(Y,null)):me&&(Te(),D(me,1,1,()=>{me=null}),Se())},i(Q){Ee||(N(i.$$.fragment,Q),N(p.$$.fragment,Q),N(T.$$.fragment,Q),N(I.$$.fragment,Q),N(A.$$.fragment,Q),N(F.$$.fragment,Q),N(ee.$$.fragment,Q),N(se),N(Ie.$$.fragment,Q),N(me),Ee=!0)},o(Q){D(i.$$.fragment,Q),D(p.$$.fragment,Q),D(T.$$.fragment,Q),D(I.$$.fragment,Q),D(A.$$.fragment,Q),D(F.$$.fragment,Q),D(ee.$$.fragment,Q),D(se),D(Ie.$$.fragment,Q),D(me),Ee=!1},d(Q){Q&&k(e),Z(i),Z(p),ve&&ve.d(),Z(T),Z(I),Z(A),Z(F),Pe&&Pe.d(),Ae&&Ae.d(),pe&&pe.d(),Z(ee),se&&se.d(),Z(Ie),me&&me.d()}}}function Lp(t,e,l){let{data:n={}}=e,i={},o={};function r(){confirm("Do you want to upgrade this device to "+o.tag_name+"?")&&(!li(i.board)||confirm(vs(fe(i.chip,i.board))))&&(Rt.update(a=>(a.upgrading=!0,a)),Cc(o.tag_name))}return Rt.subscribe(a=>{l(1,i=a),a.fwconsent===1&&op()}),mo.subscribe(a=>{l(2,o=Tc(i.version,a))}),t.$$set=a=>{"data"in a&&l(0,n=a.data)},[n,i,o,r]}class Op extends $e{constructor(e){super(),ye(this,e,Lp,Rp,ke,{data:0})}}function qp(t){let e,l,n,i;return{c(){e=Ue("svg"),l=Ue("path"),n=Ue("path"),u(l,"d",js(150,150,115,210,510)),u(l,"stroke","#eee"),u(l,"fill","none"),u(l,"stroke-width","55"),u(n,"d",i=js(150,150,115,210,210+300*t[0]/100)),u(n,"stroke",t[1]),u(n,"fill","none"),u(n,"stroke-width","55"),u(e,"viewBox","0 0 300 300"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"height","100%")},m(o,r){w(o,e,r),s(e,l),s(e,n)},p(o,[r]){r&1&&i!==(i=js(150,150,115,210,210+300*o[0]/100))&&u(n,"d",i),r&2&&u(n,"stroke",o[1])},i:ne,o:ne,d(o){o&&k(e)}}}function Kr(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 js(t,e,l,n,i){var o=Kr(t,e,l,i),r=Kr(t,e,l,n),a=i-n<=180?"0":"1",p=["M",o.x,o.y,"A",l,l,0,a,0,r.x,r.y].join(" ");return p}function Up(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 Hp extends $e{constructor(e){super(),ye(this,e,Up,qp,ke,{pct:0,color:1})}}function Qr(t){let e,l,n,i,o,r,a,p;return{c(){e=c("br"),l=b(),n=c("span"),i=$(t[3]),o=b(),r=c("span"),a=$(t[4]),p=$("/kWh"),u(n,"class","pl-sub"),u(r,"class","pl-snt")},m(f,_){w(f,e,_),w(f,l,_),w(f,n,_),s(n,i),w(f,o,_),w(f,r,_),s(r,a),s(r,p)},p(f,_){_&8&&B(i,f[3]),_&16&&B(a,f[4])},d(f){f&&k(e),f&&k(l),f&&k(n),f&&k(o),f&&k(r)}}}function jp(t){let e,l,n,i,o,r,a,p,f,_,m,d,v,h,g,y;l=new Hp({props:{pct:t[6],color:t[5](t[6])}});let C=t[3]&&Qr(t);return{c(){e=c("div"),J(l.$$.fragment),n=b(),i=c("span"),o=c("span"),r=$(t[2]),a=b(),p=c("br"),f=b(),_=c("span"),m=$(t[0]),d=b(),v=c("span"),h=$(t[1]),g=b(),C&&C.c(),u(o,"class","pl-lab"),u(_,"class","pl-val"),u(v,"class","pl-unt"),u(i,"class","pl-ov"),u(e,"class","pl-root")},m(T,P){w(T,e,P),X(l,e,null),s(e,n),s(e,i),s(i,o),s(o,r),s(i,a),s(i,p),s(i,f),s(i,_),s(_,m),s(i,d),s(i,v),s(v,h),s(i,g),C&&C.m(i,null),y=!0},p(T,[P]){const I={};P&64&&(I.pct=T[6]),P&96&&(I.color=T[5](T[6])),l.$set(I),(!y||P&4)&&B(r,T[2]),(!y||P&1)&&B(m,T[0]),(!y||P&2)&&B(h,T[1]),T[3]?C?C.p(T,P):(C=Qr(T),C.c(),C.m(i,null)):C&&(C.d(1),C=null)},i(T){y||(N(l.$$.fragment,T),y=!0)},o(T){D(l.$$.fragment,T),y=!1},d(T){T&&k(e),Z(l),C&&C.d()}}}function Wp(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:r}=e,{sub:a=""}=e,{subunit:p=""}=e,{colorFn:f}=e,_=0;return t.$$set=m=>{"val"in m&&l(0,n=m.val),"max"in m&&l(7,i=m.max),"unit"in m&&l(1,o=m.unit),"label"in m&&l(2,r=m.label),"sub"in m&&l(3,a=m.sub),"subunit"in m&&l(4,p=m.subunit),"colorFn"in m&&l(5,f=m.colorFn)},t.$$.update=()=>{t.$$.dirty&129&&l(6,_=Math.min(n,i)/i*100)},[n,o,r,a,p,f,_,i]}class Nc extends $e{constructor(e){super(),ye(this,e,Wp,jp,ke,{val:0,max:7,unit:1,label:2,sub:3,subunit:4,colorFn:5})}}function Xr(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function Zr(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function Jr(t,e,l){const n=t.slice();return n[13]=e[l],n}function xr(t){let e,l,n,i,o,r=t[0].title&&ea(t),a=t[0].y.ticks,p=[];for(let v=0;v20||t[11]%2==0)&&ia(t);return{c(){e=Ue("g"),n&&n.c(),u(e,"class","tick"),u(e,"transform",l="translate("+t[5](t[11])+","+t[4]+")")},m(i,o){w(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[11]%2==0?n?n.p(i,o):(n=ia(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&48&&l!==(l="translate("+i[5](i[11])+","+i[4]+")")&&u(e,"transform",l)},d(i){i&&k(e),n&&n.d()}}}function ia(t){let e,l=t[9].label+"",n,i;return{c(){e=Ue("text"),n=$(l),u(e,"x",i=t[3]/2),u(e,"y","-4")},m(o,r){w(o,e,r),s(e,n)},p(o,r){r&1&&l!==(l=o[9].label+"")&&B(n,l),r&8&&i!==(i=o[3]/2)&&u(e,"x",i)},d(o){o&&k(e)}}}function sa(t){let e=!isNaN(t[5](t[11])),l,n=e&&na(t);return{c(){n&&n.c(),l=We()},m(i,o){n&&n.m(i,o),w(i,l,o)},p(i,o){o&32&&(e=!isNaN(i[5](i[11]))),e?n?n.p(i,o):(n=na(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&k(l)}}}function oa(t){let e,l,n=t[9].value!==void 0&&ua(t),i=t[9].value2>1e-4&&fa(t);return{c(){e=Ue("g"),n&&n.c(),l=Ue("g"),i&&i.c()},m(o,r){w(o,e,r),n&&n.m(e,null),w(o,l,r),i&&i.m(l,null)},p(o,r){o[9].value!==void 0?n?n.p(o,r):(n=ua(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[9].value2>1e-4?i?i.p(o,r):(i=fa(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&k(e),n&&n.d(),o&&k(l),i&&i.d()}}}function ua(t){let e,l,n,i,o,r,a,p=t[3]>15&&ra(t);return{c(){e=Ue("rect"),p&&p.c(),a=We(),u(e,"x",l=t[5](t[11])+2),u(e,"y",n=t[6](t[9].value)),u(e,"width",i=t[3]-4),u(e,"height",o=t[6](t[0].y.min)-t[6](Math.min(t[0].y.min,0)+t[9].value)),u(e,"fill",r=t[9].color)},m(f,_){w(f,e,_),p&&p.m(f,_),w(f,a,_)},p(f,_){_&32&&l!==(l=f[5](f[11])+2)&&u(e,"x",l),_&65&&n!==(n=f[6](f[9].value))&&u(e,"y",n),_&8&&i!==(i=f[3]-4)&&u(e,"width",i),_&65&&o!==(o=f[6](f[0].y.min)-f[6](Math.min(f[0].y.min,0)+f[9].value))&&u(e,"height",o),_&1&&r!==(r=f[9].color)&&u(e,"fill",r),f[3]>15?p?p.p(f,_):(p=ra(f),p.c(),p.m(a.parentNode,a)):p&&(p.d(1),p=null)},d(f){f&&k(e),p&&p.d(f),f&&k(a)}}}function ra(t){let e,l=t[9].label+"",n,i,o,r,a,p,f,_,m=t[9].title&&aa(t);return{c(){e=Ue("text"),n=$(l),m&&m.c(),_=We(),u(e,"y",i=t[6](t[9].value)>t[6](0)-t[7]?t[6](t[9].value)-t[7]:t[6](t[9].value)+10),u(e,"x",o=t[5](t[11])+t[3]/2),u(e,"width",r=t[3]-4),u(e,"dominant-baseline","middle"),u(e,"text-anchor",a=t[3]<25?"left":"middle"),u(e,"fill",p=t[6](t[9].value)>t[6](0)-t[7]?t[9].color:"white"),u(e,"transform",f="rotate("+(t[3]<25?90:0)+", "+(t[5](t[11])+t[3]/2)+", "+(t[6](t[9].value)>t[6](0)-t[7]?t[6](t[9].value)-t[7]:t[6](t[9].value)+9)+")")},m(d,v){w(d,e,v),s(e,n),m&&m.m(d,v),w(d,_,v)},p(d,v){v&1&&l!==(l=d[9].label+"")&&B(n,l),v&193&&i!==(i=d[6](d[9].value)>d[6](0)-d[7]?d[6](d[9].value)-d[7]:d[6](d[9].value)+10)&&u(e,"y",i),v&40&&o!==(o=d[5](d[11])+d[3]/2)&&u(e,"x",o),v&8&&r!==(r=d[3]-4)&&u(e,"width",r),v&8&&a!==(a=d[3]<25?"left":"middle")&&u(e,"text-anchor",a),v&193&&p!==(p=d[6](d[9].value)>d[6](0)-d[7]?d[9].color:"white")&&u(e,"fill",p),v&233&&f!==(f="rotate("+(d[3]<25?90:0)+", "+(d[5](d[11])+d[3]/2)+", "+(d[6](d[9].value)>d[6](0)-d[7]?d[6](d[9].value)-d[7]:d[6](d[9].value)+9)+")")&&u(e,"transform",f),d[9].title?m?m.p(d,v):(m=aa(d),m.c(),m.m(_.parentNode,_)):m&&(m.d(1),m=null)},d(d){d&&k(e),m&&m.d(d),d&&k(_)}}}function aa(t){let e,l=t[9].title+"",n;return{c(){e=Ue("title"),n=$(l)},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=i[9].title+"")&&B(n,l)},d(i){i&&k(e)}}}function fa(t){let e,l,n,i,o,r,a,p=t[3]>15&&ca(t);return{c(){e=Ue("rect"),p&&p.c(),a=We(),u(e,"x",l=t[5](t[11])+2),u(e,"y",n=t[6](0)),u(e,"width",i=t[3]-4),u(e,"height",o=t[6](t[0].y.min)-t[6](t[0].y.min+t[9].value2)),u(e,"fill",r=t[9].color)},m(f,_){w(f,e,_),p&&p.m(f,_),w(f,a,_)},p(f,_){_&32&&l!==(l=f[5](f[11])+2)&&u(e,"x",l),_&64&&n!==(n=f[6](0))&&u(e,"y",n),_&8&&i!==(i=f[3]-4)&&u(e,"width",i),_&65&&o!==(o=f[6](f[0].y.min)-f[6](f[0].y.min+f[9].value2))&&u(e,"height",o),_&1&&r!==(r=f[9].color)&&u(e,"fill",r),f[3]>15?p?p.p(f,_):(p=ca(f),p.c(),p.m(a.parentNode,a)):p&&(p.d(1),p=null)},d(f){f&&k(e),p&&p.d(f),f&&k(a)}}}function ca(t){let e,l=t[9].label2+"",n,i,o,r,a,p,f,_,m=t[9].title2&&pa(t);return{c(){e=Ue("text"),n=$(l),m&&m.c(),_=We(),u(e,"y",i=t[6](-t[9].value2)t[6](0)-12?t[6](t[9].value2-t[0].y.min)-12:t[6](t[9].value2-t[0].y.min)+9)+")")},m(d,v){w(d,e,v),s(e,n),m&&m.m(d,v),w(d,_,v)},p(d,v){v&1&&l!==(l=d[9].label2+"")&&B(n,l),v&65&&i!==(i=d[6](-d[9].value2)d[6](0)-12?d[6](d[9].value2-d[0].y.min)-12:d[6](d[9].value2-d[0].y.min)+9)+")")&&u(e,"transform",f),d[9].title2?m?m.p(d,v):(m=pa(d),m.c(),m.m(_.parentNode,_)):m&&(m.d(1),m=null)},d(d){d&&k(e),m&&m.d(d),d&&k(_)}}}function pa(t){let e,l=t[9].title2+"",n;return{c(){e=Ue("title"),n=$(l)},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=i[9].title2+"")&&B(n,l)},d(i){i&&k(e)}}}function ma(t){let e=!isNaN(t[5](t[11]))&&!isNaN(t[6](t[9].value)),l,n=e&&oa(t);return{c(){n&&n.c(),l=We()},m(i,o){n&&n.m(i,o),w(i,l,o)},p(i,o){o&97&&(e=!isNaN(i[5](i[11]))&&!isNaN(i[6](i[9].value))),e?n?n.p(i,o):(n=oa(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&k(l)}}}function Gp(t){let e,l,n=t[0].x.ticks&&t[0].points&&t[4]&&xr(t);return{c(){e=c("div"),n&&n.c(),u(e,"class","chart"),tt(()=>t[8].call(e))},m(i,o){w(i,e,o),n&&n.m(e,null),l=jc(e,t[8].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=xr(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:ne,o:ne,d(i){i&&k(e),n&&n.d(),l()}}}function Bp(t,e,l){let{config:n}=e,i,o,r,a,p,f,_;function m(){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&31){l(4,f=o-(n.title?20:0));let d=i-(n.padding.left+n.padding.right);l(3,r=d/n.points.length),l(7,_=r<25?28:17);let v=(f-n.padding.top-n.padding.bottom)/(n.y.max-n.y.min);l(5,a=function(h){return h*r+n.padding.left}),l(6,p=function(h){let g=0;return h>n.y.max?g=n.padding.bottom:hf||g<0?0:g})}},[n,i,o,r,f,a,p,_,m]}class nn extends $e{constructor(e){super(),ye(this,e,Bp,Gp,ke,{config:0})}}function Yp(t){let e,l;return e=new nn({props:{config:t[0]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function zp(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{ds:r}=e,a={};function p(f){return{label:ce(f)+"V",title:f.toFixed(1)+" V",value:isNaN(f)?0:f,color:tp(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,r=f.ds)},t.$$.update=()=>{if(t.$$.dirty&30){let f=[],_=[];n>0&&(f.push({label:r===1?"L1-L2":"L1"}),_.push(p(n))),i>0&&(f.push({label:r===1?"L1-L3":"L2"}),_.push(p(i))),o>0&&(f.push({label:r===1?"L2-L3":"L3"}),_.push(p(o))),l(0,a={padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:f},points:_})}},[a,n,i,o,r]}class Vp extends $e{constructor(e){super(),ye(this,e,zp,Yp,ke,{u1:1,u2:2,u3:3,ds:4})}}function Kp(t){let e,l;return e=new nn({props:{config:t[0]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Qp(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{i1:r}=e,{i2:a}=e,{i3:p}=e,{max:f}=e,_={};function m(d){return{label:ce(d)+"A",title:d.toFixed(1)+" A",value:isNaN(d)?0:d,color:vc(d?d/f*100:0)}}return t.$$set=d=>{"u1"in d&&l(1,n=d.u1),"u2"in d&&l(2,i=d.u2),"u3"in d&&l(3,o=d.u3),"i1"in d&&l(4,r=d.i1),"i2"in d&&l(5,a=d.i2),"i3"in d&&l(6,p=d.i3),"max"in d&&l(7,f=d.max)},t.$$.update=()=>{if(t.$$.dirty&254){let d=[],v=[];n>0&&(d.push({label:"L1"}),v.push(m(r))),i>0&&(d.push({label:"L2"}),v.push(m(a))),o>0&&(d.push({label:"L3"}),v.push(m(p))),l(0,_={padding:{top:20,right:15,bottom:20,left:35},y:{min:0,max:f,ticks:[{value:0,label:"0%"},{value:f/4,label:"25%"},{value:f/2,label:"50%"},{value:f/4*3,label:"75%"},{value:f,label:"100%"}]},x:{ticks:d},points:v})}},[_,n,i,o,r,a,p,f]}class Xp extends $e{constructor(e){super(),ye(this,e,Qp,Kp,ke,{u1:1,u2:2,u3:3,i1:4,i2:5,i3:6,max:7})}}function Zp(t){let e,l,n,i,o,r,a,p=(typeof t[0]<"u"?t[0].toFixed(0):"-")+"",f,_,m,d,v,h,g=(typeof t[1]<"u"?t[1].toFixed(0):"-")+"",y,C,T,P,I,S,A,E=(typeof t[2]<"u"?t[2].toFixed(1):"-")+"",F,z,O,R,U,Y,q=(typeof t[3]<"u"?t[3].toFixed(1):"-")+"",H,G;return{c(){e=c("div"),l=c("strong"),l.textContent="Reactive",n=b(),i=c("div"),o=c("div"),o.textContent="Instant in",r=b(),a=c("div"),f=$(p),_=$(" VAr"),m=b(),d=c("div"),d.textContent="Instant out",v=b(),h=c("div"),y=$(g),C=$(" VAr"),T=b(),P=c("div"),I=c("div"),I.textContent="Total in",S=b(),A=c("div"),F=$(E),z=$(" kVArh"),O=b(),R=c("div"),R.textContent="Total out",U=b(),Y=c("div"),H=$(q),G=$(" kVArh"),u(a,"class","text-right"),u(h,"class","text-right"),u(i,"class","grid grid-cols-2 mt-4"),u(A,"class","text-right"),u(Y,"class","text-right"),u(P,"class","grid grid-cols-2 mt-4"),u(e,"class","mx-2 text-sm")},m(L,W){w(L,e,W),s(e,l),s(e,n),s(e,i),s(i,o),s(i,r),s(i,a),s(a,f),s(a,_),s(i,m),s(i,d),s(i,v),s(i,h),s(h,y),s(h,C),s(e,T),s(e,P),s(P,I),s(P,S),s(P,A),s(A,F),s(A,z),s(P,O),s(P,R),s(P,U),s(P,Y),s(Y,H),s(Y,G)},p(L,[W]){W&1&&p!==(p=(typeof L[0]<"u"?L[0].toFixed(0):"-")+"")&&B(f,p),W&2&&g!==(g=(typeof L[1]<"u"?L[1].toFixed(0):"-")+"")&&B(y,g),W&4&&E!==(E=(typeof L[2]<"u"?L[2].toFixed(1):"-")+"")&&B(F,E),W&8&&q!==(q=(typeof L[3]<"u"?L[3].toFixed(1):"-")+"")&&B(H,q)},i:ne,o:ne,d(L){L&&k(e)}}}function Jp(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:o}=e,{exportTotal:r}=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,r=a.exportTotal)},[n,i,o,r]}class xp extends $e{constructor(e){super(),ye(this,e,Jp,Zp,ke,{importInstant:0,exportInstant:1,importTotal:2,exportTotal:3})}}function _a(t){let e;function l(o,r){return o[3]?tm:em}let n=l(t),i=n(t);return{c(){i.c(),e=We()},m(o,r){i.m(o,r),w(o,e,r)},p(o,r){n===(n=l(o))&&i?i.p(o,r):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&k(e)}}}function em(t){let e,l,n,i,o,r,a=ce(t[1].h.u,2)+"",p,f,_,m,d,v,h=ce(t[1].d.u,1)+"",g,y,C,T,P,I,S=ce(t[1].m.u)+"",A,E,F,z,O,R,U=ce(t[0].last_month.u)+"",Y,q,H,G,L=t[4]&&da(t);return{c(){e=c("strong"),e.textContent="Consumption",l=b(),n=c("div"),i=c("div"),i.textContent="Hour",o=b(),r=c("div"),p=$(a),f=$(" kWh"),_=b(),m=c("div"),m.textContent="Day",d=b(),v=c("div"),g=$(h),y=$(" kWh"),C=b(),T=c("div"),T.textContent="Month",P=b(),I=c("div"),A=$(S),E=$(" kWh"),F=b(),z=c("div"),z.textContent="Last month",O=b(),R=c("div"),Y=$(U),q=$(" kWh"),H=b(),L&&L.c(),G=We(),u(r,"class","text-right"),u(v,"class","text-right"),u(I,"class","text-right"),u(R,"class","text-right"),u(n,"class","grid grid-cols-2 mb-3")},m(W,j){w(W,e,j),w(W,l,j),w(W,n,j),s(n,i),s(n,o),s(n,r),s(r,p),s(r,f),s(n,_),s(n,m),s(n,d),s(n,v),s(v,g),s(v,y),s(n,C),s(n,T),s(n,P),s(n,I),s(I,A),s(I,E),s(n,F),s(n,z),s(n,O),s(n,R),s(R,Y),s(R,q),w(W,H,j),L&&L.m(W,j),w(W,G,j)},p(W,j){j&2&&a!==(a=ce(W[1].h.u,2)+"")&&B(p,a),j&2&&h!==(h=ce(W[1].d.u,1)+"")&&B(g,h),j&2&&S!==(S=ce(W[1].m.u)+"")&&B(A,S),j&1&&U!==(U=ce(W[0].last_month.u)+"")&&B(Y,U),W[4]?L?L.p(W,j):(L=da(W),L.c(),L.m(G.parentNode,G)):L&&(L.d(1),L=null)},d(W){W&&k(e),W&&k(l),W&&k(n),W&&k(H),L&&L.d(W),W&&k(G)}}}function tm(t){let e,l,n,i,o,r,a=ce(t[1].h.u,2)+"",p,f,_,m,d,v,h,g=ce(t[1].d.u,1)+"",y,C,T,P,I,S,A,E=ce(t[1].m.u)+"",F,z,O,R,U,Y,q,H=ce(t[0].last_month.u)+"",G,L,W,j,ee,le,de,ie,we,Ie,Ce,Ee=ce(t[1].h.p,2)+"",ve,Pe,Ae,pe,se,me,Q,oe=ce(t[1].d.p,1)+"",Ne,Me,he,x,_e,Le,Ge,Ke=ce(t[1].m.p)+"",Fe,je,re,ge,Lt,Rl,Zt,ft=ce(t[0].last_month.p)+"",yl,rl,Ot,dt,Qe=t[4]&&va(t),Xe=t[4]&&ha(t),Ze=t[4]&&ba(t),Oe=t[4]&&ga(t),Je=t[4]&&ka(t),Be=t[4]&&wa(t),xe=t[4]&&ya(t),et=t[4]&&$a(t);return{c(){e=c("strong"),e.textContent="Import",l=b(),n=c("div"),i=c("div"),i.textContent="Hour",o=b(),r=c("div"),p=$(a),f=$(" kWh"),_=b(),Qe&&Qe.c(),m=b(),d=c("div"),d.textContent="Day",v=b(),h=c("div"),y=$(g),C=$(" kWh"),T=b(),Xe&&Xe.c(),P=b(),I=c("div"),I.textContent="Month",S=b(),A=c("div"),F=$(E),z=$(" kWh"),O=b(),Ze&&Ze.c(),R=b(),U=c("div"),U.textContent="Last mo.",Y=b(),q=c("div"),G=$(H),L=$(" kWh"),W=b(),Oe&&Oe.c(),ee=b(),le=c("strong"),le.textContent="Export",de=b(),ie=c("div"),we=c("div"),we.textContent="Hour",Ie=b(),Ce=c("div"),ve=$(Ee),Pe=$(" kWh"),Ae=b(),Je&&Je.c(),pe=b(),se=c("div"),se.textContent="Day",me=b(),Q=c("div"),Ne=$(oe),Me=$(" kWh"),he=b(),Be&&Be.c(),x=b(),_e=c("div"),_e.textContent="Month",Le=b(),Ge=c("div"),Fe=$(Ke),je=$(" kWh"),re=b(),xe&&xe.c(),ge=b(),Lt=c("div"),Lt.textContent="Last mo.",Rl=b(),Zt=c("div"),yl=$(ft),rl=$(" kWh"),Ot=b(),et&&et.c(),u(r,"class","text-right"),u(h,"class","text-right"),u(A,"class","text-right"),u(q,"class","text-right"),u(n,"class",j="grid grid-cols-"+t[5]+" mb-3"),u(Ce,"class","text-right"),u(Q,"class","text-right"),u(Ge,"class","text-right"),u(Zt,"class","text-right"),u(ie,"class",dt="grid grid-cols-"+t[5])},m(ue,be){w(ue,e,be),w(ue,l,be),w(ue,n,be),s(n,i),s(n,o),s(n,r),s(r,p),s(r,f),s(n,_),Qe&&Qe.m(n,null),s(n,m),s(n,d),s(n,v),s(n,h),s(h,y),s(h,C),s(n,T),Xe&&Xe.m(n,null),s(n,P),s(n,I),s(n,S),s(n,A),s(A,F),s(A,z),s(n,O),Ze&&Ze.m(n,null),s(n,R),s(n,U),s(n,Y),s(n,q),s(q,G),s(q,L),s(n,W),Oe&&Oe.m(n,null),w(ue,ee,be),w(ue,le,be),w(ue,de,be),w(ue,ie,be),s(ie,we),s(ie,Ie),s(ie,Ce),s(Ce,ve),s(Ce,Pe),s(ie,Ae),Je&&Je.m(ie,null),s(ie,pe),s(ie,se),s(ie,me),s(ie,Q),s(Q,Ne),s(Q,Me),s(ie,he),Be&&Be.m(ie,null),s(ie,x),s(ie,_e),s(ie,Le),s(ie,Ge),s(Ge,Fe),s(Ge,je),s(ie,re),xe&&xe.m(ie,null),s(ie,ge),s(ie,Lt),s(ie,Rl),s(ie,Zt),s(Zt,yl),s(Zt,rl),s(ie,Ot),et&&et.m(ie,null)},p(ue,be){be&2&&a!==(a=ce(ue[1].h.u,2)+"")&&B(p,a),ue[4]?Qe?Qe.p(ue,be):(Qe=va(ue),Qe.c(),Qe.m(n,m)):Qe&&(Qe.d(1),Qe=null),be&2&&g!==(g=ce(ue[1].d.u,1)+"")&&B(y,g),ue[4]?Xe?Xe.p(ue,be):(Xe=ha(ue),Xe.c(),Xe.m(n,P)):Xe&&(Xe.d(1),Xe=null),be&2&&E!==(E=ce(ue[1].m.u)+"")&&B(F,E),ue[4]?Ze?Ze.p(ue,be):(Ze=ba(ue),Ze.c(),Ze.m(n,R)):Ze&&(Ze.d(1),Ze=null),be&1&&H!==(H=ce(ue[0].last_month.u)+"")&&B(G,H),ue[4]?Oe?Oe.p(ue,be):(Oe=ga(ue),Oe.c(),Oe.m(n,null)):Oe&&(Oe.d(1),Oe=null),be&32&&j!==(j="grid grid-cols-"+ue[5]+" mb-3")&&u(n,"class",j),be&2&&Ee!==(Ee=ce(ue[1].h.p,2)+"")&&B(ve,Ee),ue[4]?Je?Je.p(ue,be):(Je=ka(ue),Je.c(),Je.m(ie,pe)):Je&&(Je.d(1),Je=null),be&2&&oe!==(oe=ce(ue[1].d.p,1)+"")&&B(Ne,oe),ue[4]?Be?Be.p(ue,be):(Be=wa(ue),Be.c(),Be.m(ie,x)):Be&&(Be.d(1),Be=null),be&2&&Ke!==(Ke=ce(ue[1].m.p)+"")&&B(Fe,Ke),ue[4]?xe?xe.p(ue,be):(xe=ya(ue),xe.c(),xe.m(ie,ge)):xe&&(xe.d(1),xe=null),be&1&&ft!==(ft=ce(ue[0].last_month.p)+"")&&B(yl,ft),ue[4]?et?et.p(ue,be):(et=$a(ue),et.c(),et.m(ie,null)):et&&(et.d(1),et=null),be&32&&dt!==(dt="grid grid-cols-"+ue[5])&&u(ie,"class",dt)},d(ue){ue&&k(e),ue&&k(l),ue&&k(n),Qe&&Qe.d(),Xe&&Xe.d(),Ze&&Ze.d(),Oe&&Oe.d(),ue&&k(ee),ue&&k(le),ue&&k(de),ue&&k(ie),Je&&Je.d(),Be&&Be.d(),xe&&xe.d(),et&&et.d()}}}function da(t){let e,l,n,i,o,r,a=ce(t[1].h.c,2)+"",p,f,_,m,d,v,h,g=ce(t[1].d.c,1)+"",y,C,T,P,I,S,A,E=ce(t[1].m.c)+"",F,z,O,R,U,Y,q,H=ce(t[0].last_month.c)+"",G,L,W;return{c(){e=c("strong"),e.textContent="Cost",l=b(),n=c("div"),i=c("div"),i.textContent="Hour",o=b(),r=c("div"),p=$(a),f=b(),_=$(t[2]),m=b(),d=c("div"),d.textContent="Day",v=b(),h=c("div"),y=$(g),C=b(),T=$(t[2]),P=b(),I=c("div"),I.textContent="Month",S=b(),A=c("div"),F=$(E),z=b(),O=$(t[2]),R=b(),U=c("div"),U.textContent="Last month",Y=b(),q=c("div"),G=$(H),L=b(),W=$(t[2]),u(r,"class","text-right"),u(h,"class","text-right"),u(A,"class","text-right"),u(q,"class","text-right"),u(n,"class","grid grid-cols-2")},m(j,ee){w(j,e,ee),w(j,l,ee),w(j,n,ee),s(n,i),s(n,o),s(n,r),s(r,p),s(r,f),s(r,_),s(n,m),s(n,d),s(n,v),s(n,h),s(h,y),s(h,C),s(h,T),s(n,P),s(n,I),s(n,S),s(n,A),s(A,F),s(A,z),s(A,O),s(n,R),s(n,U),s(n,Y),s(n,q),s(q,G),s(q,L),s(q,W)},p(j,ee){ee&2&&a!==(a=ce(j[1].h.c,2)+"")&&B(p,a),ee&4&&B(_,j[2]),ee&2&&g!==(g=ce(j[1].d.c,1)+"")&&B(y,g),ee&4&&B(T,j[2]),ee&2&&E!==(E=ce(j[1].m.c)+"")&&B(F,E),ee&4&&B(O,j[2]),ee&1&&H!==(H=ce(j[0].last_month.c)+"")&&B(G,H),ee&4&&B(W,j[2])},d(j){j&&k(e),j&&k(l),j&&k(n)}}}function va(t){let e,l=ce(t[1].h.c,2)+"",n,i,o;return{c(){e=c("div"),n=$(l),i=b(),o=$(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].h.c,2)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&k(e)}}}function ha(t){let e,l=ce(t[1].d.c,1)+"",n,i,o;return{c(){e=c("div"),n=$(l),i=b(),o=$(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].d.c,1)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&k(e)}}}function ba(t){let e,l=ce(t[1].m.c)+"",n,i,o;return{c(){e=c("div"),n=$(l),i=b(),o=$(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].m.c)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&k(e)}}}function ga(t){let e,l=ce(t[0].last_month.c)+"",n,i,o;return{c(){e=c("div"),n=$(l),i=b(),o=$(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&1&&l!==(l=ce(r[0].last_month.c)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&k(e)}}}function ka(t){let e,l=ce(t[1].h.i,2)+"",n,i,o;return{c(){e=c("div"),n=$(l),i=b(),o=$(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].h.i,2)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&k(e)}}}function wa(t){let e,l=ce(t[1].d.i,1)+"",n,i,o;return{c(){e=c("div"),n=$(l),i=b(),o=$(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].d.i,1)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&k(e)}}}function ya(t){let e,l=ce(t[1].m.i)+"",n,i,o;return{c(){e=c("div"),n=$(l),i=b(),o=$(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].m.i)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&k(e)}}}function $a(t){let e,l=ce(t[0].last_month.i)+"",n,i,o;return{c(){e=c("div"),n=$(l),i=b(),o=$(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&1&&l!==(l=ce(r[0].last_month.i)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&k(e)}}}function lm(t){let e,l,n,i,o,r,a=t[1]&&_a(t);return{c(){e=c("div"),l=c("strong"),l.textContent="Real time calculation",n=b(),i=c("br"),o=c("br"),r=b(),a&&a.c(),u(e,"class","mx-2 text-sm")},m(p,f){w(p,e,f),s(e,l),s(e,n),s(e,i),s(e,o),s(e,r),a&&a.m(e,null)},p(p,[f]){p[1]?a?a.p(p,f):(a=_a(p),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i:ne,o:ne,d(p){p&&k(e),a&&a.d()}}}function nm(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:r}=e,a=!1,p=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,r=f.hasExport)},t.$$.update=()=>{t.$$.dirty&18&&(l(4,a=i&&i.h&&(i.h.c>.01||i.d.c>.01||i.m.c>.01||i.h.i>.01||i.d.i>.01||i.m.i>.01)),l(5,p=a?3:2))},[n,i,o,r,a,p]}class im extends $e{constructor(e){super(),ye(this,e,nm,lm,ke,{sysinfo:0,data:1,currency:2,hasExport:3})}}function sm(t){let e,l,n,i;return n=new nn({props:{config:t[0]}}),{c(){e=c("a"),e.textContent="Provided by ENTSO-E",l=b(),J(n.$$.fragment),u(e,"href","https://transparency.entsoe.eu/"),u(e,"target","_blank"),u(e,"class","text-xs float-right z-40")},m(o,r){w(o,e,r),w(o,l,r),X(n,o,r),i=!0},p(o,[r]){const a={};r&1&&(a.config=o[0]),n.$set(a)},i(o){i||(N(n.$$.fragment,o),i=!0)},o(o){D(n.$$.fragment,o),i=!1},d(o){o&&k(e),o&&k(l),Z(n,o)}}}function om(t,e,l){let{json:n}=e,i={},o=0,r=0;return t.$$set=a=>{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=new Date().getUTCHours(),p=0,f=0,_=0,m=n[20]==null?2:1,d=[],v=[],h=[],g=new Date;for(p=a;p<24&&(f=n[De(_++)],f!=null);p++)v.push({label:De(g.getHours())}),h.push({label:f>0?f.toFixed(m):"",title:f>0?f.toFixed(2)+" "+n.currency:"",value:f>0?Math.abs(f*100):0,label2:f<0?f.toFixed(m):"",title2:f<0?f.toFixed(2)+" "+n.currency:"",value2:f<0?Math.abs(f*100):0,color:"#7c3aed"}),l(3,r=Math.min(r,f*100)),l(2,o=Math.max(o,f*100)),ki(g,1);for(p=0;p<24&&(f=n[De(_++)],f!=null);p++)v.push({label:De(g.getHours())}),h.push({label:f>0?f.toFixed(m):"",value:f>0?Math.abs(f*100):0,label2:f<0?f.toFixed(m):"",value2:f<0?Math.abs(f*100):0,color:"#7c3aed"}),l(3,r=Math.min(r,f*100)),l(2,o=Math.max(o,f*100)),ki(g,1);if(l(2,o=Math.ceil(o)),l(3,r=Math.floor(r)),r<0){let C=r/4;for(p=1;p<5;p++){let T=C*p;d.push({value:T,label:(T/100).toFixed(2)})}}let y=o/4;for(p=0;p<5;p++){let C=y*p;d.push({value:C,label:(C/100).toFixed(2)})}l(0,i={title:"Future energy price ("+n.currency+")",padding:{top:20,right:15,bottom:20,left:35},y:{min:r,max:o,ticks:d},x:{ticks:v},points:h})}},[i,n,o,r]}class um extends $e{constructor(e){super(),ye(this,e,om,sm,ke,{json:1})}}function rm(t){let e,l;return e=new nn({props:{config:t[0]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function am(t,e,l){let{json:n}=e,i={},o=0,r=0;return t.$$set=a=>{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=0,p=[],f=[],_=[],m=ki(new Date,-24),d=new Date().getUTCHours();for(a=d;a<24;a++){let g=n["i"+De(a)],y=n["e"+De(a)];g===void 0&&(g=0),y===void 0&&(y=0),f.push({label:De(m.getHours())}),_.push({label:g.toFixed(1),title:g.toFixed(2)+" kWh",value:g*10,label2:y.toFixed(1),title2:y.toFixed(2)+" kWh",value2:y*10,color:"#7c3aed"}),l(3,r=Math.max(r,y*10)),l(2,o=Math.max(o,g*10)),ki(m,1)}for(a=0;a{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=0,p=[],f=[],_=[],m=new Date,d=new Date;for(d.setDate(0),a=m.getDate();a<=d.getDate();a++){let g=n["i"+De(a)],y=n["e"+De(a)];g===void 0&&(g=0),y===void 0&&(y=0),f.push({label:De(a)}),_.push({label:g.toFixed(g<10?1:0),title:g.toFixed(2)+" kWh",value:g,label2:y.toFixed(y<10?1:0),title2:y.toFixed(2)+" kWh",value2:y,color:"#7c3aed"}),l(3,r=Math.max(r,y)),l(2,o=Math.max(o,g))}for(a=1;a{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=0,p=0,f=[],_=[],m=[];n.s&&n.s.forEach((h,g)=>{var y=h.n?h.n:h.a;p=h.v,p==-127&&(p=0),_.push({label:y.slice(-4)}),m.push({label:p.toFixed(1),value:p,color:"#7c3aed"}),l(3,r=Math.min(r,p)),l(2,o=Math.max(o,p))}),l(2,o=Math.ceil(o)),l(3,r=Math.floor(r));let d=o;r<0&&(d+=Math.abs(r));let v=d/4;for(a=0;a<5;a++)p=r+v*a,f.push({value:p,label:p.toFixed(1)});l(0,i={title:"Temperature sensors (°C)",height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:r,max:o,ticks:f},x:{ticks:_},points:m})}},[i,n,o,r]}class vm extends $e{constructor(e){super(),ye(this,e,dm,_m,ke,{json:1})}}function hm(t){let e,l;return e=new nn({props:{config:t[0]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}let bm=0;function gm(t,e,l){let n={},i=0,o;return $c.subscribe(r=>{l(2,o=r)}),yc(),t.$$.update=()=>{if(t.$$.dirty&6){let r=0,a=[],p=[],f=[];if(a.push({value:0,label:0}),o&&o.p)for(r=0;r0?De(_.d)+"."+zs[new Date().getMonth()]:"-"}),l(1,i=Math.max(i,_.v))}if(o&&o.t){for(r=0;r=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:bm,max:i,ticks:a},x:{ticks:p},points:f})}},[n,i,o]}class km extends $e{constructor(e){super(),ye(this,e,gm,hm,ke,{})}}function Ca(t){let e,l,n,i,o,r,a=(t[0].mt?ds(t[0].mt):"-")+"",p,f,_,m=(t[0].ic?t[0].ic.toFixed(1):"-")+"",d,v,h;return i=new Nc({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:"Import",sub:t[0].p,subunit:t[0].pc,colorFn:vc}}),{c(){e=c("div"),l=c("div"),n=c("div"),J(i.$$.fragment),o=b(),r=c("div"),p=$(a),f=b(),_=c("div"),d=$(m),v=$(" kWh"),u(n,"class","col-span-2"),u(_,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(g,y){w(g,e,y),s(e,l),s(l,n),X(i,n,null),s(l,o),s(l,r),s(r,p),s(l,f),s(l,_),s(_,d),s(_,v),h=!0},p(g,y){const C={};y&1&&(C.val=g[0].i?g[0].i:0),y&1&&(C.max=g[0].im?g[0].im:15e3),y&1&&(C.sub=g[0].p),y&1&&(C.subunit=g[0].pc),i.$set(C),(!h||y&1)&&a!==(a=(g[0].mt?ds(g[0].mt):"-")+"")&&B(p,a),(!h||y&1)&&m!==(m=(g[0].ic?g[0].ic.toFixed(1):"-")+"")&&B(d,m)},i(g){h||(N(i.$$.fragment,g),h=!0)},o(g){D(i.$$.fragment,g),h=!1},d(g){g&&k(e),Z(i)}}}function Ta(t){let e,l,n,i,o,r,a,p,f=(t[0].ec?t[0].ec.toFixed(1):"-")+"",_,m,d;return i=new Nc({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:"Export",colorFn:lp}}),{c(){e=c("div"),l=c("div"),n=c("div"),J(i.$$.fragment),o=b(),r=c("div"),a=b(),p=c("div"),_=$(f),m=$(" kWh"),u(n,"class","col-span-2"),u(p,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(v,h){w(v,e,h),s(e,l),s(l,n),X(i,n,null),s(l,o),s(l,r),s(l,a),s(l,p),s(p,_),s(p,m),d=!0},p(v,h){const g={};h&1&&(g.val=v[0].e?v[0].e:0),h&1&&(g.max=v[0].om?v[0].om*1e3:1e4),i.$set(g),(!d||h&1)&&f!==(f=(v[0].ec?v[0].ec.toFixed(1):"-")+"")&&B(_,f)},i(v){d||(N(i.$$.fragment,v),d=!0)},o(v){D(i.$$.fragment,v),d=!1},d(v){v&&k(e),Z(i)}}}function Sa(t){let e,l,n;return l=new Vp({props:{u1:t[0].u1,u2:t[0].u2,u3:t[0].u3,ds:t[0].ds}}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt")},m(i,o){w(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&1&&(r.u1=i[0].u1),o&1&&(r.u2=i[0].u2),o&1&&(r.u3=i[0].u3),o&1&&(r.ds=i[0].ds),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function Pa(t){let e,l,n;return l=new Xp({props:{u1:t[0].u1,u2:t[0].u2,u3:t[0].u3,i1:t[0].i1,i2:t[0].i2,i3:t[0].i3,max:t[0].mf?t[0].mf:32}}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt")},m(i,o){w(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&1&&(r.u1=i[0].u1),o&1&&(r.u2=i[0].u2),o&1&&(r.u3=i[0].u3),o&1&&(r.i1=i[0].i1),o&1&&(r.i2=i[0].i2),o&1&&(r.i3=i[0].i3),o&1&&(r.max=i[0].mf?i[0].mf:32),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function Na(t){let e,l,n;return l=new xp({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec}}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt")},m(i,o){w(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&1&&(r.importInstant=i[0].ri),o&1&&(r.exportInstant=i[0].re),o&1&&(r.importTotal=i[0].ric),o&1&&(r.exportTotal=i[0].rec),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function Ma(t){let e,l,n;return l=new im({props:{sysinfo:t[1],data:t[0].ea,currency:t[0].pc,hasExport:t[0].om>0||t[0].e>0}}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt")},m(i,o){w(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&2&&(r.sysinfo=i[1]),o&1&&(r.data=i[0].ea),o&1&&(r.currency=i[0].pc),o&1&&(r.hasExport=i[0].om>0||i[0].e>0),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function Aa(t){let e,l,n;return l=new km({}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt h-64")},m(i,o){w(i,e,o),X(l,e,null),n=!0},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function Da(t){let e,l,n;return l=new um({props:{json:t[2]}}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt gwf")},m(i,o){w(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&4&&(r.json=i[2]),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function Ia(t){let e,l,n;return l=new fm({props:{json:t[3]}}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt gwf")},m(i,o){w(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&8&&(r.json=i[3]),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function Ea(t){let e,l,n;return l=new mm({props:{json:t[4]}}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt gwf")},m(i,o){w(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&16&&(r.json=i[4]),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function Fa(t){let e,l,n;return l=new vm({props:{json:t[5]}}),{c(){e=c("div"),J(l.$$.fragment),u(e,"class","cnt gwf")},m(i,o){w(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&32&&(r.json=i[5]),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),Z(l)}}}function wm(t){let e,l=Ye(t[1].ui.i,t[0].i),n,i=Ye(t[1].ui.e,t[0].om||t[0].e>0),o,r=Ye(t[1].ui.v,t[0].u1>100||t[0].u2>100||t[0].u3>100),a,p=Ye(t[1].ui.a,t[0].i1>.01||t[0].i2>.01||t[0].i3>.01),f,_=Ye(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),m,d=Ye(t[1].ui.c,t[0].ea),v,h=Ye(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("10YNO")||t[0].pr=="10Y1001A1001A48H")),g,y=Ye(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),C,T=Ye(t[1].ui.d,t[3]),P,I=Ye(t[1].ui.m,t[4]),S,A=Ye(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),E,F=l&&Ca(t),z=i&&Ta(t),O=r&&Sa(t),R=p&&Pa(t),U=_&&Na(t),Y=d&&Ma(t),q=h&&Aa(),H=y&&Da(t),G=T&&Ia(t),L=I&&Ea(t),W=A&&Fa(t);return{c(){e=c("div"),F&&F.c(),n=b(),z&&z.c(),o=b(),O&&O.c(),a=b(),R&&R.c(),f=b(),U&&U.c(),m=b(),Y&&Y.c(),v=b(),q&&q.c(),g=b(),H&&H.c(),C=b(),G&&G.c(),P=b(),L&&L.c(),S=b(),W&&W.c(),u(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(j,ee){w(j,e,ee),F&&F.m(e,null),s(e,n),z&&z.m(e,null),s(e,o),O&&O.m(e,null),s(e,a),R&&R.m(e,null),s(e,f),U&&U.m(e,null),s(e,m),Y&&Y.m(e,null),s(e,v),q&&q.m(e,null),s(e,g),H&&H.m(e,null),s(e,C),G&&G.m(e,null),s(e,P),L&&L.m(e,null),s(e,S),W&&W.m(e,null),E=!0},p(j,[ee]){ee&3&&(l=Ye(j[1].ui.i,j[0].i)),l?F?(F.p(j,ee),ee&3&&N(F,1)):(F=Ca(j),F.c(),N(F,1),F.m(e,n)):F&&(Te(),D(F,1,1,()=>{F=null}),Se()),ee&3&&(i=Ye(j[1].ui.e,j[0].om||j[0].e>0)),i?z?(z.p(j,ee),ee&3&&N(z,1)):(z=Ta(j),z.c(),N(z,1),z.m(e,o)):z&&(Te(),D(z,1,1,()=>{z=null}),Se()),ee&3&&(r=Ye(j[1].ui.v,j[0].u1>100||j[0].u2>100||j[0].u3>100)),r?O?(O.p(j,ee),ee&3&&N(O,1)):(O=Sa(j),O.c(),N(O,1),O.m(e,a)):O&&(Te(),D(O,1,1,()=>{O=null}),Se()),ee&3&&(p=Ye(j[1].ui.a,j[0].i1>.01||j[0].i2>.01||j[0].i3>.01)),p?R?(R.p(j,ee),ee&3&&N(R,1)):(R=Pa(j),R.c(),N(R,1),R.m(e,f)):R&&(Te(),D(R,1,1,()=>{R=null}),Se()),ee&3&&(_=Ye(j[1].ui.r,j[0].ri>0||j[0].re>0||j[0].ric>0||j[0].rec>0)),_?U?(U.p(j,ee),ee&3&&N(U,1)):(U=Na(j),U.c(),N(U,1),U.m(e,m)):U&&(Te(),D(U,1,1,()=>{U=null}),Se()),ee&3&&(d=Ye(j[1].ui.c,j[0].ea)),d?Y?(Y.p(j,ee),ee&3&&N(Y,1)):(Y=Ma(j),Y.c(),N(Y,1),Y.m(e,v)):Y&&(Te(),D(Y,1,1,()=>{Y=null}),Se()),ee&3&&(h=Ye(j[1].ui.t,j[0].pr&&(j[0].pr.startsWith("10YNO")||j[0].pr=="10Y1001A1001A48H"))),h?q?ee&3&&N(q,1):(q=Aa(),q.c(),N(q,1),q.m(e,g)):q&&(Te(),D(q,1,1,()=>{q=null}),Se()),ee&3&&(y=Ye(j[1].ui.p,j[0].pe&&!Number.isNaN(j[0].p))),y?H?(H.p(j,ee),ee&3&&N(H,1)):(H=Da(j),H.c(),N(H,1),H.m(e,C)):H&&(Te(),D(H,1,1,()=>{H=null}),Se()),ee&10&&(T=Ye(j[1].ui.d,j[3])),T?G?(G.p(j,ee),ee&10&&N(G,1)):(G=Ia(j),G.c(),N(G,1),G.m(e,P)):G&&(Te(),D(G,1,1,()=>{G=null}),Se()),ee&18&&(I=Ye(j[1].ui.m,j[4])),I?L?(L.p(j,ee),ee&18&&N(L,1)):(L=Ea(j),L.c(),N(L,1),L.m(e,S)):L&&(Te(),D(L,1,1,()=>{L=null}),Se()),ee&35&&(A=Ye(j[1].ui.s,j[0].t&&j[0].t!=-127&&j[5].c>1)),A?W?(W.p(j,ee),ee&35&&N(W,1)):(W=Fa(j),W.c(),N(W,1),W.m(e,null)):W&&(Te(),D(W,1,1,()=>{W=null}),Se())},i(j){E||(N(F),N(z),N(O),N(R),N(U),N(Y),N(q),N(H),N(G),N(L),N(W),E=!0)},o(j){D(F),D(z),D(O),D(R),D(U),D(Y),D(q),D(H),D(G),D(L),D(W),E=!1},d(j){j&&k(e),F&&F.d(),z&&z.d(),O&&O.d(),R&&R.d(),U&&U.d(),Y&&Y.d(),q&&q.d(),H&&H.d(),G&&G.d(),L&&L.d(),W&&W.d()}}}function ym(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},r={},a={},p={};return hc.subscribe(f=>{l(2,o=f)}),bc.subscribe(f=>{l(3,r=f)}),gc.subscribe(f=>{l(4,a=f)}),wc.subscribe(f=>{l(5,p=f)}),t.$$set=f=>{"data"in f&&l(0,n=f.data),"sysinfo"in f&&l(1,i=f.sysinfo)},[n,i,o,r,a,p]}class $m extends $e{constructor(e){super(),ye(this,e,ym,wm,ke,{data:0,sysinfo:1})}}let xs={};const Mc=ut(xs);async function Cm(){xs=await(await fetch("/configuration.json")).json(),Mc.set(xs)}function Ra(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Tm(t){let e;return{c(){e=c("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function Sm(t){let e;return{c(){e=c("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function La(t){let e;return{c(){e=c("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function Oa(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){w(i,e,o),w(i,l,o),w(i,n,o)},d(i){i&&k(e),i&&k(l),i&&k(n)}}}function qa(t){let e;return{c(){e=c("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function Ua(t){let e,l,n;return{c(){e=c("option"),l=$("GPIO"),n=$(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){w(i,e,o),s(e,l),s(e,n)},d(i){i&&k(e)}}}function Ha(t){let e,l=t[4]>3&&!(t[0]=="esp32"&&(t[4]==9||t[4]==16))&&!(t[0]=="esp32s2"&&t[4]==18)&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Ua(t);return{c(){l&&l.c(),e=We()},m(n,i){l&&l.m(n,i),w(n,e,i)},p(n,i){n[4]>3&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!(n[0]=="esp32s2"&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Ua(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&k(e)}}}function Pm(t){let e,l,n,i,o;function r(h,g){return h[0]=="esp32c3"?Sm:Tm}let a=r(t),p=a(t),f=t[0]=="esp8266"&&La(),_=(t[0]=="esp32"||t[0]=="esp32solo")&&Oa(),m=t[0]=="esp32s2"&&qa(),d={length:t[1]+1},v=[];for(let h=0;h{"chip"in o&&l(0,n=o.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32c3":l(1,i=19);break}},[n,i]}class Ac extends $e{constructor(e){super(),ye(this,e,Nm,Pm,ke,{chip:0})}}function ja(t){let e,l,n=t[1]&&Wa(t);return{c(){e=c("div"),l=c("div"),n&&n.c(),u(l,"class","fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center"),u(e,"class","z-50"),u(e,"aria-modal","true")},m(i,o){w(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=Wa(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&k(e),n&&n.d()}}}function Wa(t){let e,l;return{c(){e=c("div"),l=$(t[1]),u(e,"class","bg-white m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 w-96")},m(n,i){w(n,e,i),s(e,l)},p(n,i){i&2&&B(l,n[1])},d(n){n&&k(e)}}}function Mm(t){let e,l=t[0]&&ja(t);return{c(){l&&l.c(),e=We()},m(n,i){l&&l.m(n,i),w(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=ja(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:ne,o:ne,d(n){l&&l.d(n),n&&k(e)}}}function Am(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 Mt extends $e{constructor(e){super(),ye(this,e,Am,Mm,ke,{active:0,message:1})}}function Ga(t,e,l){const n=t.slice();return n[1]=e[l],n}function Ba(t){let e,l,n=t[1]+"",i;return{c(){e=c("option"),l=$("Europe/"),i=$(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,r){w(o,e,r),s(e,l),s(e,i)},p:ne,d(o){o&&k(e)}}}function Dm(t){let e,l,n,i=t[0],o=[];for(let r=0;r{r[_]=null}),Se(),l=r[e],l||(l=r[e]=o[e](p),l.c()),N(l,1),l.m(n.parentNode,n))},i(p){i||(N(l),i=!0)},o(p){D(l),i=!1},d(p){r[e].d(p),p&&k(n)}}}function Wm(t){let e,l;return e=new sl({props:{color:"blue",text:"Upload cert",title:"Click here to upload certificate"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Gm(t){let e,l;return e=new sl({props:{color:"green",text:"Cert OK",title:"Click here to replace certificate"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Bm(t){let e,l,n,i;const o=[Gm,Wm],r=[];function a(p,f){return p[3].q.s.r?0:1}return e=a(t),l=r[e]=o[e](t),{c(){l.c(),n=We()},m(p,f){r[e].m(p,f),w(p,n,f),i=!0},p(p,f){let _=e;e=a(p),e!==_&&(Te(),D(r[_],1,1,()=>{r[_]=null}),Se(),l=r[e],l||(l=r[e]=o[e](p),l.c()),N(l,1),l.m(n.parentNode,n))},i(p){i||(N(l),i=!0)},o(p){D(l),i=!1},d(p){r[e].d(p),p&&k(n)}}}function Ym(t){let e,l;return e=new sl({props:{color:"blue",text:"Upload key",title:"Click here to upload key"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function zm(t){let e,l;return e=new sl({props:{color:"green",text:"Key OK",title:"Click here to replace key"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Vm(t){let e,l,n,i;const o=[zm,Ym],r=[];function a(p,f){return p[3].q.s.k?0:1}return e=a(t),l=r[e]=o[e](t),{c(){l.c(),n=We()},m(p,f){r[e].m(p,f),w(p,n,f),i=!0},p(p,f){let _=e;e=a(p),e!==_&&(Te(),D(r[_],1,1,()=>{r[_]=null}),Se(),l=r[e],l||(l=r[e]=o[e](p),l.c()),N(l,1),l.m(n.parentNode,n))},i(p){i||(N(l),i=!0)},o(p){D(l),i=!1},d(p){r[e].d(p),p&&k(n)}}}function tf(t){let e,l,n,i,o,r,a,p,f,_,m,d,v,h,g,y,C,T,P,I,S,A,E,F,z,O,R,U,Y,q,H,G;return o=new Et({}),{c(){e=c("div"),l=c("strong"),l.textContent="Domoticz",n=b(),i=c("a"),J(o.$$.fragment),r=b(),a=c("input"),p=b(),f=c("div"),_=c("div"),m=$("Electricity IDX"),d=c("br"),v=b(),h=c("input"),g=b(),y=c("div"),C=$("Current IDX"),T=c("br"),P=b(),I=c("input"),S=b(),A=c("div"),E=$(`Voltage IDX: L1, L2 & L3 `),F=c("div"),z=c("input"),O=b(),R=c("input"),U=b(),Y=c("input"),u(l,"class","text-sm"),u(i,"href",Ft("MQTT-configuration#domoticz")),u(i,"target","_blank"),u(i,"class","float-right"),u(a,"type","hidden"),u(a,"name","o"),a.value="true",u(h,"name","oe"),u(h,"type","text"),u(h,"class","in-f tr w-full"),u(_,"class","w-1/2"),u(I,"name","oc"),u(I,"type","text"),u(I,"class","in-l tr w-full"),u(y,"class","w-1/2"),u(f,"class","my-1 flex"),u(z,"name","ou1"),u(z,"type","text"),u(z,"class","in-f tr w-1/3"),u(R,"name","ou2"),u(R,"type","text"),u(R,"class","in-m tr w-1/3"),u(Y,"name","ou3"),u(Y,"type","text"),u(Y,"class","in-l tr w-1/3"),u(F,"class","flex"),u(A,"class","my-1"),u(e,"class","cnt")},m(L,W){w(L,e,W),s(e,l),s(e,n),s(e,i),X(o,i,null),s(e,r),s(e,a),s(e,p),s(e,f),s(f,_),s(_,m),s(_,d),s(_,v),s(_,h),V(h,t[3].o.e),s(f,g),s(f,y),s(y,C),s(y,T),s(y,P),s(y,I),V(I,t[3].o.c),s(e,S),s(e,A),s(A,E),s(A,F),s(F,z),V(z,t[3].o.u1),s(F,O),s(F,R),V(R,t[3].o.u2),s(F,U),s(F,Y),V(Y,t[3].o.u3),q=!0,H||(G=[K(h,"input",t[59]),K(I,"input",t[60]),K(z,"input",t[61]),K(R,"input",t[62]),K(Y,"input",t[63])],H=!0)},p(L,W){W[0]&8&&h.value!==L[3].o.e&&V(h,L[3].o.e),W[0]&8&&I.value!==L[3].o.c&&V(I,L[3].o.c),W[0]&8&&z.value!==L[3].o.u1&&V(z,L[3].o.u1),W[0]&8&&R.value!==L[3].o.u2&&V(R,L[3].o.u2),W[0]&8&&Y.value!==L[3].o.u3&&V(Y,L[3].o.u3)},i(L){q||(N(o.$$.fragment,L),q=!0)},o(L){D(o.$$.fragment,L),q=!1},d(L){L&&k(e),Z(o),H=!1,Ve(G)}}}function lf(t){let e,l,n,i,o,r,a,p,f,_,m,d,v,h,g,y,C,T,P,I,S,A,E,F,z,O,R,U,Y;return o=new Et({}),{c(){e=c("div"),l=c("strong"),l.textContent="Home-Assistant",n=b(),i=c("a"),J(o.$$.fragment),r=b(),a=c("input"),p=b(),f=c("div"),_=$("Discovery topic prefix"),m=c("br"),d=b(),v=c("input"),h=b(),g=c("div"),y=$("Hostname for URL"),C=c("br"),T=b(),P=c("input"),S=b(),A=c("div"),E=$("Name tag"),F=c("br"),z=b(),O=c("input"),u(l,"class","text-sm"),u(i,"href",Ft("MQTT-configuration#home-assistant")),u(i,"target","_blank"),u(i,"class","float-right"),u(a,"type","hidden"),u(a,"name","h"),a.value="true",u(v,"name","ht"),u(v,"type","text"),u(v,"class","in-s"),u(v,"placeholder","homeassistant"),u(f,"class","my-1"),u(P,"name","hh"),u(P,"type","text"),u(P,"class","in-s"),u(P,"placeholder",I=t[3].g.h+".local"),u(g,"class","my-1"),u(O,"name","hn"),u(O,"type","text"),u(O,"class","in-s"),u(A,"class","my-1"),u(e,"class","cnt")},m(q,H){w(q,e,H),s(e,l),s(e,n),s(e,i),X(o,i,null),s(e,r),s(e,a),s(e,p),s(e,f),s(f,_),s(f,m),s(f,d),s(f,v),V(v,t[3].h.t),s(e,h),s(e,g),s(g,y),s(g,C),s(g,T),s(g,P),V(P,t[3].h.h),s(e,S),s(e,A),s(A,E),s(A,F),s(A,z),s(A,O),V(O,t[3].h.n),R=!0,U||(Y=[K(v,"input",t[64]),K(P,"input",t[65]),K(O,"input",t[66])],U=!0)},p(q,H){H[0]&8&&v.value!==q[3].h.t&&V(v,q[3].h.t),(!R||H[0]&8&&I!==(I=q[3].g.h+".local"))&&u(P,"placeholder",I),H[0]&8&&P.value!==q[3].h.h&&V(P,q[3].h.h),H[0]&8&&O.value!==q[3].h.n&&V(O,q[3].h.n)},i(q){R||(N(o.$$.fragment,q),R=!0)},o(q){D(o.$$.fragment,q),R=!1},d(q){q&&k(e),Z(o),U=!1,Ve(Y)}}}function nf(t){let e,l,n,i,o,r,a,p,f,_,m,d,v,h,g,y,C,T,P;o=new Et({});let I={length:9},S=[];for(let A=0;A20&&rf(t),_=t[0].chip=="esp8266"&&cf(t);return{c(){e=c("div"),l=c("strong"),l.textContent="Hardware",n=b(),i=c("a"),J(o.$$.fragment),r=b(),f&&f.c(),a=b(),_&&_.c(),u(l,"class","text-sm"),u(i,"href",Ft("GPIO-configuration")),u(i,"target","_blank"),u(i,"class","float-right"),u(e,"class","cnt")},m(m,d){w(m,e,d),s(e,l),s(e,n),s(e,i),X(o,i,null),s(e,r),f&&f.m(e,null),s(e,a),_&&_.m(e,null),p=!0},p(m,d){m[0].board>20?f?(f.p(m,d),d[0]&1&&N(f,1)):(f=rf(m),f.c(),N(f,1),f.m(e,a)):f&&(Te(),D(f,1,1,()=>{f=null}),Se()),m[0].chip=="esp8266"?_?_.p(m,d):(_=cf(m),_.c(),_.m(e,null)):_&&(_.d(1),_=null)},i(m){p||(N(o.$$.fragment,m),N(f),p=!0)},o(m){D(o.$$.fragment,m),D(f),p=!1},d(m){m&&k(e),Z(o),f&&f.d(),_&&_.d()}}}function rf(t){let e,l,n,i,o,r,a,p,f,_,m,d,v,h,g,y,C,T,P,I,S,A,E,F,z,O,R,U,Y,q,H,G,L,W,j,ee,le,de,ie,we,Ie,Ce,Ee,ve,Pe,Ae,pe,se,me,Q,oe,Ne,Me,he,x,_e,Le,Ge,Ke;d=new Ac({props:{chip:t[0].chip}});let Fe=t[0].chip!="esp8266"&&af(t),je=t[3].i.v.p>0&&ff(t);return{c(){e=c("input"),l=b(),n=c("div"),i=c("div"),o=$("HAN"),r=c("label"),a=c("input"),p=$(" pullup"),f=c("br"),_=b(),m=c("select"),J(d.$$.fragment),v=b(),h=c("div"),g=$("AP button"),y=c("br"),C=b(),T=c("input"),P=b(),I=c("div"),S=$("LED"),A=c("label"),E=c("input"),F=$(" inv"),z=c("br"),O=b(),R=c("div"),U=c("input"),Y=b(),q=c("div"),H=$("RGB"),G=c("label"),L=c("input"),W=$(" inverted"),j=c("br"),ee=b(),le=c("div"),de=c("input"),ie=b(),we=c("input"),Ie=b(),Ce=c("input"),Ee=b(),ve=c("div"),Pe=$("Temperature"),Ae=c("br"),pe=b(),se=c("input"),me=b(),Q=c("div"),oe=$("Analog temp"),Ne=c("br"),Me=b(),he=c("input"),x=b(),Fe&&Fe.c(),_e=b(),je&&je.c(),u(e,"type","hidden"),u(e,"name","i"),e.value="true",u(a,"name","ihu"),a.__value="true",a.value=a.__value,u(a,"type","checkbox"),u(a,"class","rounded mb-1"),u(r,"class","ml-2"),u(m,"name","ihp"),u(m,"class","in-f w-full"),t[3].i.h.p===void 0&&tt(()=>t[71].call(m)),u(i,"class","w-1/3"),u(T,"name","ia"),u(T,"type","number"),u(T,"min","0"),u(T,"max",t[6]),u(T,"class","in-m tr w-full"),u(h,"class","w-1/3"),u(E,"name","ili"),E.__value="true",E.value=E.__value,u(E,"type","checkbox"),u(E,"class","rounded mb-1"),u(A,"class","ml-4"),u(U,"name","ilp"),u(U,"type","number"),u(U,"min","0"),u(U,"max",t[6]),u(U,"class","in-l tr w-full"),u(R,"class","flex"),u(I,"class","w-1/3"),u(L,"name","iri"),L.__value="true",L.value=L.__value,u(L,"type","checkbox"),u(L,"class","rounded mb-1"),u(G,"class","ml-4"),u(de,"name","irr"),u(de,"type","number"),u(de,"min","0"),u(de,"max",t[6]),u(de,"class","in-f tr w-1/3"),u(we,"name","irg"),u(we,"type","number"),u(we,"min","0"),u(we,"max",t[6]),u(we,"class","in-m tr w-1/3"),u(Ce,"name","irb"),u(Ce,"type","number"),u(Ce,"min","0"),u(Ce,"max",t[6]),u(Ce,"class","in-l tr w-1/3"),u(le,"class","flex"),u(q,"class","w-full"),u(se,"name","itd"),u(se,"type","number"),u(se,"min","0"),u(se,"max",t[6]),u(se,"class","in-f tr w-full"),u(ve,"class","my-1 w-1/3"),u(he,"name","ita"),u(he,"type","number"),u(he,"min","0"),u(he,"max",t[6]),u(he,"class","in-l tr w-full"),u(Q,"class","my-1 pr-1 w-1/3"),u(n,"class","flex flex-wrap")},m(re,ge){w(re,e,ge),w(re,l,ge),w(re,n,ge),s(n,i),s(i,o),s(i,r),s(r,a),a.checked=t[3].i.h.u,s(r,p),s(i,f),s(i,_),s(i,m),X(d,m,null),Re(m,t[3].i.h.p,!0),s(n,v),s(n,h),s(h,g),s(h,y),s(h,C),s(h,T),V(T,t[3].i.a),s(n,P),s(n,I),s(I,S),s(I,A),s(A,E),E.checked=t[3].i.l.i,s(A,F),s(I,z),s(I,O),s(I,R),s(R,U),V(U,t[3].i.l.p),s(n,Y),s(n,q),s(q,H),s(q,G),s(G,L),L.checked=t[3].i.r.i,s(G,W),s(q,j),s(q,ee),s(q,le),s(le,de),V(de,t[3].i.r.r),s(le,ie),s(le,we),V(we,t[3].i.r.g),s(le,Ie),s(le,Ce),V(Ce,t[3].i.r.b),s(n,Ee),s(n,ve),s(ve,Pe),s(ve,Ae),s(ve,pe),s(ve,se),V(se,t[3].i.t.d),s(n,me),s(n,Q),s(Q,oe),s(Q,Ne),s(Q,Me),s(Q,he),V(he,t[3].i.t.a),s(n,x),Fe&&Fe.m(n,null),s(n,_e),je&&je.m(n,null),Le=!0,Ge||(Ke=[K(a,"change",t[70]),K(m,"change",t[71]),K(T,"input",t[72]),K(E,"change",t[73]),K(U,"input",t[74]),K(L,"change",t[75]),K(de,"input",t[76]),K(we,"input",t[77]),K(Ce,"input",t[78]),K(se,"input",t[79]),K(he,"input",t[80])],Ge=!0)},p(re,ge){ge[0]&8&&(a.checked=re[3].i.h.u);const Lt={};ge[0]&1&&(Lt.chip=re[0].chip),d.$set(Lt),ge[0]&8&&Re(m,re[3].i.h.p),(!Le||ge[0]&64)&&u(T,"max",re[6]),ge[0]&8&&ae(T.value)!==re[3].i.a&&V(T,re[3].i.a),ge[0]&8&&(E.checked=re[3].i.l.i),(!Le||ge[0]&64)&&u(U,"max",re[6]),ge[0]&8&&ae(U.value)!==re[3].i.l.p&&V(U,re[3].i.l.p),ge[0]&8&&(L.checked=re[3].i.r.i),(!Le||ge[0]&64)&&u(de,"max",re[6]),ge[0]&8&&ae(de.value)!==re[3].i.r.r&&V(de,re[3].i.r.r),(!Le||ge[0]&64)&&u(we,"max",re[6]),ge[0]&8&&ae(we.value)!==re[3].i.r.g&&V(we,re[3].i.r.g),(!Le||ge[0]&64)&&u(Ce,"max",re[6]),ge[0]&8&&ae(Ce.value)!==re[3].i.r.b&&V(Ce,re[3].i.r.b),(!Le||ge[0]&64)&&u(se,"max",re[6]),ge[0]&8&&ae(se.value)!==re[3].i.t.d&&V(se,re[3].i.t.d),(!Le||ge[0]&64)&&u(he,"max",re[6]),ge[0]&8&&ae(he.value)!==re[3].i.t.a&&V(he,re[3].i.t.a),re[0].chip!="esp8266"?Fe?Fe.p(re,ge):(Fe=af(re),Fe.c(),Fe.m(n,_e)):Fe&&(Fe.d(1),Fe=null),re[3].i.v.p>0?je?je.p(re,ge):(je=ff(re),je.c(),je.m(n,null)):je&&(je.d(1),je=null)},i(re){Le||(N(d.$$.fragment,re),Le=!0)},o(re){D(d.$$.fragment,re),Le=!1},d(re){re&&k(e),re&&k(l),re&&k(n),Z(d),Fe&&Fe.d(),je&&je.d(),Ge=!1,Ve(Ke)}}}function af(t){let e,l,n,i,o,r,a;return{c(){e=c("div"),l=$("Vcc"),n=c("br"),i=b(),o=c("input"),u(o,"name","ivp"),u(o,"type","number"),u(o,"min","0"),u(o,"max",t[6]),u(o,"class","in-s tr w-full"),u(e,"class","my-1 pl-1 w-1/3")},m(p,f){w(p,e,f),s(e,l),s(e,n),s(e,i),s(e,o),V(o,t[3].i.v.p),r||(a=K(o,"input",t[81]),r=!0)},p(p,f){f[0]&64&&u(o,"max",p[6]),f[0]&8&&ae(o.value)!==p[3].i.v.p&&V(o,p[3].i.v.p)},d(p){p&&k(e),r=!1,a()}}}function ff(t){let e,l,n,i,o,r,a,p,f,_;return{c(){e=c("div"),l=$("Voltage divider"),n=c("br"),i=b(),o=c("div"),r=c("input"),a=b(),p=c("input"),u(r,"name","ivdv"),u(r,"type","number"),u(r,"min","0"),u(r,"max","65535"),u(r,"class","in-f tr w-full"),u(r,"placeholder","VCC"),u(p,"name","ivdg"),u(p,"type","number"),u(p,"min","0"),u(p,"max","65535"),u(p,"class","in-l tr w-full"),u(p,"placeholder","GND"),u(o,"class","flex"),u(e,"class","my-1")},m(m,d){w(m,e,d),s(e,l),s(e,n),s(e,i),s(e,o),s(o,r),V(r,t[3].i.v.d.v),s(o,a),s(o,p),V(p,t[3].i.v.d.g),f||(_=[K(r,"input",t[82]),K(p,"input",t[83])],f=!0)},p(m,d){d[0]&8&&ae(r.value)!==m[3].i.v.d.v&&V(r,m[3].i.v.d.v),d[0]&8&&ae(p.value)!==m[3].i.v.d.g&&V(p,m[3].i.v.d.g)},d(m){m&&k(e),f=!1,Ve(_)}}}function cf(t){let e,l,n,i,o,r,a,p,f,_,m,d,v,h,g,y,C,T=(t[0].board==2||t[0].board==100)&&pf(t);return{c(){e=c("input"),l=b(),n=c("div"),i=c("div"),o=$("Vcc offset"),r=c("br"),a=b(),p=c("input"),f=b(),_=c("div"),m=$("Multiplier"),d=c("br"),v=b(),h=c("input"),g=b(),T&&T.c(),u(e,"type","hidden"),u(e,"name","iv"),e.value="true",u(p,"name","ivo"),u(p,"type","number"),u(p,"min","0.0"),u(p,"max","3.5"),u(p,"step","0.01"),u(p,"class","in-f tr w-full"),u(i,"class","w-1/3"),u(h,"name","ivm"),u(h,"type","number"),u(h,"min","0.1"),u(h,"max","10"),u(h,"step","0.01"),u(h,"class","in-l tr w-full"),u(_,"class","w-1/3 pr-1"),u(n,"class","my-1 flex flex-wrap")},m(P,I){w(P,e,I),w(P,l,I),w(P,n,I),s(n,i),s(i,o),s(i,r),s(i,a),s(i,p),V(p,t[3].i.v.o),s(n,f),s(n,_),s(_,m),s(_,d),s(_,v),s(_,h),V(h,t[3].i.v.m),s(n,g),T&&T.m(n,null),y||(C=[K(p,"input",t[84]),K(h,"input",t[85])],y=!0)},p(P,I){I[0]&8&&ae(p.value)!==P[3].i.v.o&&V(p,P[3].i.v.o),I[0]&8&&ae(h.value)!==P[3].i.v.m&&V(h,P[3].i.v.m),P[0].board==2||P[0].board==100?T?T.p(P,I):(T=pf(P),T.c(),T.m(n,null)):T&&(T.d(1),T=null)},d(P){P&&k(e),P&&k(l),P&&k(n),T&&T.d(),y=!1,Ve(C)}}}function pf(t){let e,l,n,i,o,r,a;return{c(){e=c("div"),l=$("Boot limit"),n=c("br"),i=b(),o=c("input"),u(o,"name","ivb"),u(o,"type","number"),u(o,"min","2.5"),u(o,"max","3.5"),u(o,"step","0.1"),u(o,"class","in-s tr w-full"),u(e,"class","w-1/3 pl-1")},m(p,f){w(p,e,f),s(e,l),s(e,n),s(e,i),s(e,o),V(o,t[3].i.v.b),r||(a=K(o,"input",t[86]),r=!0)},p(p,f){f[0]&8&&ae(o.value)!==p[3].i.v.b&&V(o,p[3].i.v.b)},d(p){p&&k(e),r=!1,a()}}}function mf(t){let e,l,n,i,o,r,a,p,f,_,m,d,v,h,g,y,C=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"),r=$(" Enable telnet"),a=b(),C&&C.c(),p=b(),f=c("div"),_=c("select"),m=c("option"),m.textContent="Verbose",d=c("option"),d.textContent="Debug",v=c("option"),v.textContent="Info",h=c("option"),h.textContent="Warning",u(e,"class","bd-red"),u(o,"type","checkbox"),u(o,"name","dt"),o.__value="true",o.value=o.__value,u(o,"class","rounded mb-1"),u(n,"class","my-1"),m.__value=1,m.value=m.__value,d.__value=2,d.value=d.__value,v.__value=3,v.value=v.__value,h.__value=4,h.value=h.__value,u(_,"name","dl"),u(_,"class","in-s"),t[3].d.l===void 0&&tt(()=>t[89].call(_)),u(f,"class","my-1")},m(T,P){w(T,e,P),w(T,l,P),w(T,n,P),s(n,i),s(i,o),o.checked=t[3].d.t,s(i,r),w(T,a,P),C&&C.m(T,P),w(T,p,P),w(T,f,P),s(f,_),s(_,m),s(_,d),s(_,v),s(_,h),Re(_,t[3].d.l,!0),g||(y=[K(o,"change",t[88]),K(_,"change",t[89])],g=!0)},p(T,P){P[0]&8&&(o.checked=T[3].d.t),T[3].d.t?C||(C=_f(),C.c(),C.m(p.parentNode,p)):C&&(C.d(1),C=null),P[0]&8&&Re(_,T[3].d.l)},d(T){T&&k(e),T&&k(l),T&&k(n),T&&k(a),C&&C.d(T),T&&k(p),T&&k(f),g=!1,Ve(y)}}}function _f(t){let e;return{c(){e=c("div"),e.textContent="Telnet is unsafe and should be off when not in use",u(e,"class","bd-red")},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function Km(t){let e,l,n,i,o,r,a,p,f,_,m,d,v,h,g,y,C,T,P,I,S,A,E,F,z,O,R,U,Y,q,H,G,L,W,j,ee,le,de,ie,we,Ie,Ce,Ee,ve,Pe,Ae,pe,se,me,Q,oe,Ne,Me,he,x,_e,Le,Ge,Ke,Fe,je,re,ge,Lt,Rl,Zt,ft,yl,rl,Ot,dt,Qe,Xe,Ze,Oe,Je,Be,xe,et,ue,be,Si,al,sn,Tt,Pi,Ni,Mi,fl,Ai,Di,Ii,qe,cl,qt,Ll,Ei,$l,He,on,vo,un,rn,ho,oi,bo,an,gs,go,Cl,Jt,Tl,ko,Fi,wo,pt,Sl,yo,Ri,fn,cn,pn,mn,Li,$o,ui,Ut,Co,To,Ol,So,Po,No,xt,_n,dn,Mo,vn,ql,Ao,Do,Io,hn,Ht,Eo,Oi,Fo,Ul,Ro,Lo,Oo,bn,jt,qo,qi,Uo,ks,Ho,Hl,Ui,Wt,jo,Wo,Go,ws,Hi,Gt,Bo,Yo,zo,ct,ji,Vo,gn,kn,Ko,ri,Qo,jl,Xo,Zo,Jo,pl,xo,Wl,eu,tu,lu,ml,nu,wn,Gl,iu,su,ou,At,yn,$n,Cn,Tn,uu,Bl,ru,au,fu,Sn,Dt,cu,Wi,pu,Gi,Bi,Bt,mu,_u,rt,Yi,du,Pn,Nn,vu,Yl,hu,bu,gu,Pl,el,Mn,An,ku,St,zi,Vi,wu,Pt,Dn,Ki,Qi,yu,ys,Xi,Zi,Yt,$u,Cu,ai,Tu,Nl,Su,fi,zt,Pu,Nu,Mu,Ji,_l,Au,ze,xi,Du,In,En,Iu,ci,Eu,tl,Fu,$s,Ru,Lu,Fn,dl,Ou,Vt,qu,Cs,zl,Uu,Hu,ju,vl,Wu,Vl,Gu,Bu,Yu,hl,zu,Rn,Ln,Vu,Ku,Qu,bl,Xu,On,Zu,Ju,xu,vt,qn,Un,Hn,jn,Wn,Gn,er,Kl,tr,lr,nr,gl,ir,Ts,Ss,Ps=t[3].p.r.startsWith("10YNO")||t[3].p.r=="10Y1001A1001A48H",Ns,ll,es,sr,Bn,Yn,or,pi,ur,mi,rr,Ms,Nt,ts,ar,zn,Vn,fr,_i,cr,ls,ns,Kt,pr,mr,_r,Ml,As,Kn,dr,is,Qn,vr,ss,Ds,Ql,Is,Xl,Es,Zl,Fs,Jl,Qt,Rs,hr;a=new Et({}),F=new Em({});let Ic=["NOK","SEK","DKK","EUR"],di=[];for(let M=0;M<4;M+=1)di[M]=Om(Lm(t,Ic,M));let ht=t[3].p.e&&t[0].chip!="esp8266"&&Va(t),bt=t[3].g.s>0&&Ka(t);rn=new Et({});let Ec=[24,48,96,192,384,576,1152],vi=[];for(let M=0;M<7;M+=1)vi[M]=qm(Rm(t,Ec,M));let gt=t[3].m.e.e&&Qa(t),kt=t[3].m.e.e&&Xa(t),wt=t[3].m.m.e&&Za(t);kn=new Et({}),Nn=new Et({}),Dn=new Dc({});let yt=t[3].n.m=="static"&&Ja(t);En=new Et({});let $t=t[0].chip!="esp8266"&&xa(t),lt=t[3].q.s.e&&ef(t),nt=t[3].q.m==3&&tf(t),it=t[3].q.m==4&&lf(t),st=Ps&&nf(t);Yn=new Et({});let Xn=t[7],mt=[];for(let M=0;M20||t[0].chip=="esp8266")&&uf(t);Vn=new Et({});let Ct=t[3].d.s&&mf(t);return Ql=new Mt({props:{active:t[1],message:"Loading configuration"}}),Xl=new Mt({props:{active:t[2],message:"Saving configuration"}}),Zl=new Mt({props:{active:t[4],message:"Performing factory reset"}}),Jl=new Mt({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(),r=c("a"),J(a.$$.fragment),p=b(),f=c("input"),_=b(),m=c("div"),d=c("div"),v=c("div"),h=$("Hostname"),g=c("br"),y=b(),C=c("input"),T=b(),P=c("div"),I=$("Time zone"),S=c("br"),A=b(),E=c("select"),J(F.$$.fragment),z=b(),O=c("input"),R=b(),U=c("div"),Y=c("div"),q=c("div"),H=$("Price region"),G=c("br"),L=b(),W=c("select"),j=c("optgroup"),ee=c("option"),ee.textContent="NO1",le=c("option"),le.textContent="NO2",de=c("option"),de.textContent="NO3",ie=c("option"),ie.textContent="NO4",we=c("option"),we.textContent="NO5",Ie=c("optgroup"),Ce=c("option"),Ce.textContent="SE1",Ee=c("option"),Ee.textContent="SE2",ve=c("option"),ve.textContent="SE3",Pe=c("option"),Pe.textContent="SE4",Ae=c("optgroup"),pe=c("option"),pe.textContent="DK1",se=c("option"),se.textContent="DK2",me=c("option"),me.textContent="Austria",Q=c("option"),Q.textContent="Belgium",oe=c("option"),oe.textContent="Czech Republic",Ne=c("option"),Ne.textContent="Estonia",Me=c("option"),Me.textContent="Finland",he=c("option"),he.textContent="France",x=c("option"),x.textContent="Germany",_e=c("option"),_e.textContent="Great Britain",Le=c("option"),Le.textContent="Latvia",Ge=c("option"),Ge.textContent="Lithuania",Ke=c("option"),Ke.textContent="Netherland",Fe=c("option"),Fe.textContent="Poland",je=c("option"),je.textContent="Switzerland",re=b(),ge=c("div"),Lt=$("Currency"),Rl=c("br"),Zt=b(),ft=c("select");for(let M=0;M<4;M+=1)di[M].c();yl=b(),rl=c("div"),Ot=c("div"),dt=c("div"),Qe=$("Fixed price"),Xe=c("br"),Ze=b(),Oe=c("input"),Je=b(),Be=c("div"),xe=$("Multiplier"),et=c("br"),ue=b(),be=c("input"),Si=b(),al=c("div"),sn=c("label"),Tt=c("input"),Pi=$(" Enable price fetch from remote server"),Ni=b(),ht&&ht.c(),Mi=b(),fl=c("div"),Ai=$("Security"),Di=c("br"),Ii=b(),qe=c("select"),cl=c("option"),cl.textContent="None",qt=c("option"),qt.textContent="Only configuration",Ll=c("option"),Ll.textContent="Everything",Ei=b(),bt&&bt.c(),$l=b(),He=c("div"),on=c("strong"),on.textContent="Meter",vo=b(),un=c("a"),J(rn.$$.fragment),ho=b(),oi=c("input"),bo=b(),an=c("div"),gs=c("span"),gs.textContent="Serial configuration",go=b(),Cl=c("div"),Jt=c("select"),Tl=c("option"),ko=$("Autodetect");for(let M=0;M<7;M+=1)vi[M].c();wo=b(),pt=c("select"),Sl=c("option"),yo=$("-"),fn=c("option"),fn.textContent="7N1",cn=c("option"),cn.textContent="8N1",pn=c("option"),pn.textContent="7E1",mn=c("option"),mn.textContent="8E1",$o=b(),ui=c("label"),Ut=c("input"),Co=$(" inverted"),To=b(),Ol=c("div"),So=$("Voltage"),Po=c("br"),No=b(),xt=c("select"),_n=c("option"),_n.textContent="400V (TN)",dn=c("option"),dn.textContent="230V (IT/TT)",Mo=b(),vn=c("div"),ql=c("div"),Ao=$("Main fuse"),Do=c("br"),Io=b(),hn=c("label"),Ht=c("input"),Eo=b(),Oi=c("span"),Oi.textContent="A",Fo=b(),Ul=c("div"),Ro=$("Production"),Lo=c("br"),Oo=b(),bn=c("label"),jt=c("input"),qo=b(),qi=c("span"),qi.textContent="kWp",Uo=b(),ks=c("div"),Ho=b(),Hl=c("div"),Ui=c("label"),Wt=c("input"),jo=$(" Meter is encrypted"),Wo=b(),gt&>.c(),Go=b(),kt&&kt.c(),ws=b(),Hi=c("label"),Gt=c("input"),Bo=$(" Multipliers"),Yo=b(),wt&&wt.c(),zo=b(),ct=c("div"),ji=c("strong"),ji.textContent="WiFi",Vo=b(),gn=c("a"),J(kn.$$.fragment),Ko=b(),ri=c("input"),Qo=b(),jl=c("div"),Xo=$("SSID"),Zo=c("br"),Jo=b(),pl=c("input"),xo=b(),Wl=c("div"),eu=$("Password"),tu=c("br"),lu=b(),ml=c("input"),nu=b(),wn=c("div"),Gl=c("div"),iu=$("Power saving"),su=c("br"),ou=b(),At=c("select"),yn=c("option"),yn.textContent="Default",$n=c("option"),$n.textContent="Off",Cn=c("option"),Cn.textContent="Minimum",Tn=c("option"),Tn.textContent="Maximum",uu=b(),Bl=c("div"),ru=$("Power"),au=c("br"),fu=b(),Sn=c("div"),Dt=c("input"),cu=b(),Wi=c("span"),Wi.textContent="dBm",pu=b(),Gi=c("div"),Bi=c("label"),Bt=c("input"),mu=$(" Auto reboot on connection problem"),_u=b(),rt=c("div"),Yi=c("strong"),Yi.textContent="Network",du=b(),Pn=c("a"),J(Nn.$$.fragment),vu=b(),Yl=c("div"),hu=$("IP"),bu=c("br"),gu=b(),Pl=c("div"),el=c("select"),Mn=c("option"),Mn.textContent="DHCP",An=c("option"),An.textContent="Static",ku=b(),St=c("input"),wu=b(),Pt=c("select"),J(Dn.$$.fragment),yu=b(),yt&&yt.c(),ys=b(),Xi=c("div"),Zi=c("label"),Yt=c("input"),$u=$(" enable mDNS"),Cu=b(),ai=c("input"),Tu=b(),Nl=c("div"),Su=$("NTP "),fi=c("label"),zt=c("input"),Pu=$(" obtain from DHCP"),Nu=c("br"),Mu=b(),Ji=c("div"),_l=c("input"),Au=b(),ze=c("div"),xi=c("strong"),xi.textContent="MQTT",Du=b(),In=c("a"),J(En.$$.fragment),Iu=b(),ci=c("input"),Eu=b(),tl=c("div"),Fu=$(`Server `),$t&&$t.c(),$s=b(),Ru=c("br"),Lu=b(),Fn=c("div"),dl=c("input"),Ou=b(),Vt=c("input"),qu=b(),lt&<.c(),Cs=b(),zl=c("div"),Uu=$("Username"),Hu=c("br"),ju=b(),vl=c("input"),Wu=b(),Vl=c("div"),Gu=$("Password"),Bu=c("br"),Yu=b(),hl=c("input"),zu=b(),Rn=c("div"),Ln=c("div"),Vu=$("Client ID"),Ku=c("br"),Qu=b(),bl=c("input"),Xu=b(),On=c("div"),Zu=$("Payload"),Ju=c("br"),xu=b(),vt=c("select"),qn=c("option"),qn.textContent="JSON",Un=c("option"),Un.textContent="Raw (minimal)",Hn=c("option"),Hn.textContent="Raw (full)",jn=c("option"),jn.textContent="Domoticz",Wn=c("option"),Wn.textContent="HomeAssistant",Gn=c("option"),Gn.textContent="HEX dump",er=b(),Kl=c("div"),tr=$("Publish topic"),lr=c("br"),nr=b(),gl=c("input"),ir=b(),nt&&nt.c(),Ts=b(),it&&it.c(),Ss=b(),st&&st.c(),Ns=b(),ll=c("div"),es=c("strong"),es.textContent="User interface",sr=b(),Bn=c("a"),J(Yn.$$.fragment),or=b(),pi=c("input"),ur=b(),mi=c("div");for(let M=0;MSave',Ds=b(),J(Ql.$$.fragment),Is=b(),J(Xl.$$.fragment),Es=b(),J(Zl.$$.fragment),Fs=b(),J(Jl.$$.fragment),u(i,"class","text-sm"),u(r,"href",Ft("General-configuration")),u(r,"target","_blank"),u(r,"class","float-right"),u(f,"type","hidden"),u(f,"name","g"),f.value="true",u(C,"name","gh"),u(C,"type","text"),u(C,"class","in-f w-full"),u(C,"pattern","[A-Za-z0-9-]+"),u(E,"name","gt"),u(E,"class","in-l w-full"),t[3].g.t===void 0&&tt(()=>t[13].call(E)),u(d,"class","flex"),u(m,"class","my-1"),u(O,"type","hidden"),u(O,"name","p"),O.value="true",ee.__value="10YNO-1--------2",ee.value=ee.__value,le.__value="10YNO-2--------T",le.value=le.__value,de.__value="10YNO-3--------J",de.value=de.__value,ie.__value="10YNO-4--------9",ie.value=ie.__value,we.__value="10Y1001A1001A48H",we.value=we.__value,u(j,"label","Norway"),Ce.__value="10Y1001A1001A44P",Ce.value=Ce.__value,Ee.__value="10Y1001A1001A45N",Ee.value=Ee.__value,ve.__value="10Y1001A1001A46L",ve.value=ve.__value,Pe.__value="10Y1001A1001A47J",Pe.value=Pe.__value,u(Ie,"label","Sweden"),pe.__value="10YDK-1--------W",pe.value=pe.__value,se.__value="10YDK-2--------M",se.value=se.__value,u(Ae,"label","Denmark"),me.__value="10YAT-APG------L",me.value=me.__value,Q.__value="10YBE----------2",Q.value=Q.__value,oe.__value="10YCZ-CEPS-----N",oe.value=oe.__value,Ne.__value="10Y1001A1001A39I",Ne.value=Ne.__value,Me.__value="10YFI-1--------U",Me.value=Me.__value,he.__value="10YFR-RTE------C",he.value=he.__value,x.__value="10Y1001A1001A83F",x.value=x.__value,_e.__value="10YGB----------A",_e.value=_e.__value,Le.__value="10YLV-1001A00074",Le.value=Le.__value,Ge.__value="10YLT-1001A0008Q",Ge.value=Ge.__value,Ke.__value="10YNL----------L",Ke.value=Ke.__value,Fe.__value="10YPL-AREA-----S",Fe.value=Fe.__value,je.__value="10YCH-SWISSGRIDZ",je.value=je.__value,u(W,"name","pr"),u(W,"class","in-f w-full"),t[3].p.r===void 0&&tt(()=>t[14].call(W)),u(q,"class","w-full"),u(ft,"name","pc"),u(ft,"class","in-l"),t[3].p.c===void 0&&tt(()=>t[15].call(ft)),u(Y,"class","flex"),u(U,"class","my-1"),u(Oe,"name","pf"),u(Oe,"type","number"),u(Oe,"min","0.001"),u(Oe,"max","65"),u(Oe,"step","0.001"),u(Oe,"class","in-f tr w-full"),u(dt,"class","w-1/2"),u(be,"name","pm"),u(be,"type","number"),u(be,"min","0.001"),u(be,"max","1000"),u(be,"step","0.001"),u(be,"class","in-l tr w-full"),u(Be,"class","w-1/2"),u(Ot,"class","flex"),u(rl,"class","my-1"),u(Tt,"type","checkbox"),u(Tt,"name","pe"),Tt.__value="true",Tt.value=Tt.__value,u(Tt,"class","rounded mb-1"),u(al,"class","my-1"),cl.__value=0,cl.value=cl.__value,qt.__value=1,qt.value=qt.__value,Ll.__value=2,Ll.value=Ll.__value,u(qe,"name","gs"),u(qe,"class","in-s"),t[3].g.s===void 0&&tt(()=>t[20].call(qe)),u(fl,"class","my-1"),u(n,"class","cnt"),u(on,"class","text-sm"),u(un,"href",Ft("Meter-configuration")),u(un,"target","_blank"),u(un,"class","float-right"),u(oi,"type","hidden"),u(oi,"name","m"),oi.value="true",Tl.__value=0,Tl.value=Tl.__value,Tl.disabled=Fi=t[3].m.b!=0,u(Jt,"name","mb"),u(Jt,"class","in-f"),t[3].m.b===void 0&&tt(()=>t[23].call(Jt)),Sl.__value=0,Sl.value=Sl.__value,Sl.disabled=Ri=t[3].m.b!=0,fn.__value=2,fn.value=fn.__value,cn.__value=3,cn.value=cn.__value,pn.__value=10,pn.value=pn.__value,mn.__value=11,mn.value=mn.__value,u(pt,"name","mp"),u(pt,"class","in-l"),pt.disabled=Li=t[3].m.b==0,t[3].m.p===void 0&&tt(()=>t[24].call(pt)),u(Ut,"name","mi"),Ut.__value="true",Ut.value=Ut.__value,u(Ut,"type","checkbox"),u(Ut,"class","rounded mb-1"),u(ui,"class","mt-2 ml-3 whitespace-nowrap"),u(Cl,"class","flex"),u(an,"class","my-1"),_n.__value=2,_n.value=_n.__value,dn.__value=1,dn.value=dn.__value,u(xt,"name","md"),u(xt,"class","in-s"),t[3].m.d===void 0&&tt(()=>t[26].call(xt)),u(Ol,"class","my-1"),u(Ht,"name","mf"),u(Ht,"type","number"),u(Ht,"min","5"),u(Ht,"max","65535"),u(Ht,"class","in-f tr w-full"),u(Oi,"class","in-post"),u(hn,"class","flex"),u(ql,"class","mx-1"),u(jt,"name","mr"),u(jt,"type","number"),u(jt,"min","0"),u(jt,"max","65535"),u(jt,"class","in-f tr w-full"),u(qi,"class","in-post"),u(bn,"class","flex"),u(Ul,"class","mx-1"),u(vn,"class","my-1 flex"),u(ks,"class","my-1"),u(Wt,"type","checkbox"),u(Wt,"name","me"),Wt.__value="true",Wt.value=Wt.__value,u(Wt,"class","rounded mb-1"),u(Hl,"class","my-1"),u(Gt,"type","checkbox"),u(Gt,"name","mm"),Gt.__value="true",Gt.value=Gt.__value,u(Gt,"class","rounded mb-1"),u(He,"class","cnt"),u(ji,"class","text-sm"),u(gn,"href",Ft("WiFi-configuration")),u(gn,"target","_blank"),u(gn,"class","float-right"),u(ri,"type","hidden"),u(ri,"name","w"),ri.value="true",u(pl,"name","ws"),u(pl,"type","text"),u(pl,"class","in-s"),u(jl,"class","my-1"),u(ml,"name","wp"),u(ml,"type","password"),u(ml,"class","in-s"),u(Wl,"class","my-1"),yn.__value=255,yn.value=yn.__value,$n.__value=0,$n.value=$n.__value,Cn.__value=1,Cn.value=Cn.__value,Tn.__value=2,Tn.value=Tn.__value,u(At,"name","wz"),u(At,"class","in-s"),t[3].w.z===void 0&&tt(()=>t[39].call(At)),u(Gl,"class","w-1/2"),u(Dt,"name","ww"),u(Dt,"type","number"),u(Dt,"min","0"),u(Dt,"max","20.5"),u(Dt,"step","0.5"),u(Dt,"class","in-f tr w-full"),u(Wi,"class","in-post"),u(Sn,"class","flex"),u(Bl,"class","ml-2 w-1/2"),u(wn,"class","my-1 flex"),u(Bt,"type","checkbox"),u(Bt,"name","wa"),Bt.__value="true",Bt.value=Bt.__value,u(Bt,"class","rounded mb-1"),u(Gi,"class","my-3"),u(ct,"class","cnt"),u(Yi,"class","text-sm"),u(Pn,"href",Ft("Network-configuration")),u(Pn,"target","_blank"),u(Pn,"class","float-right"),Mn.__value="dhcp",Mn.value=Mn.__value,An.__value="static",An.value=An.__value,u(el,"name","nm"),u(el,"class","in-f"),t[3].n.m===void 0&&tt(()=>t[42].call(el)),u(St,"name","ni"),u(St,"type","text"),u(St,"class","in-m w-full"),St.disabled=zi=t[3].n.m=="dhcp",St.required=Vi=t[3].n.m=="static",u(Pt,"name","ns"),u(Pt,"class","in-l"),Pt.disabled=Ki=t[3].n.m=="dhcp",Pt.required=Qi=t[3].n.m=="static",t[3].n.s===void 0&&tt(()=>t[44].call(Pt)),u(Pl,"class","flex"),u(Yl,"class","my-1"),u(Yt,"name","nd"),Yt.__value="true",Yt.value=Yt.__value,u(Yt,"type","checkbox"),u(Yt,"class","rounded mb-1"),u(Xi,"class","my-1"),u(ai,"type","hidden"),u(ai,"name","ntp"),ai.value="true",u(zt,"name","ntpd"),zt.__value="true",zt.value=zt.__value,u(zt,"type","checkbox"),u(zt,"class","rounded mb-1"),u(fi,"class","ml-4"),u(_l,"name","ntph"),u(_l,"type","text"),u(_l,"class","in-s"),u(Ji,"class","flex"),u(Nl,"class","my-1"),u(rt,"class","cnt"),u(xi,"class","text-sm"),u(In,"href",Ft("MQTT-configuration")),u(In,"target","_blank"),u(In,"class","float-right"),u(ci,"type","hidden"),u(ci,"name","q"),ci.value="true",u(dl,"name","qh"),u(dl,"type","text"),u(dl,"class","in-f w-3/4"),u(Vt,"name","qp"),u(Vt,"type","number"),u(Vt,"min","1024"),u(Vt,"max","65535"),u(Vt,"class","in-l tr w-1/4"),u(Fn,"class","flex"),u(tl,"class","my-1"),u(vl,"name","qu"),u(vl,"type","text"),u(vl,"class","in-s"),u(zl,"class","my-1"),u(hl,"name","qa"),u(hl,"type","password"),u(hl,"class","in-s"),u(Vl,"class","my-1"),u(bl,"name","qc"),u(bl,"type","text"),u(bl,"class","in-f w-full"),qn.__value=0,qn.value=qn.__value,Un.__value=1,Un.value=Un.__value,Hn.__value=2,Hn.value=Hn.__value,jn.__value=3,jn.value=jn.__value,Wn.__value=4,Wn.value=Wn.__value,Gn.__value=255,Gn.value=Gn.__value,u(vt,"name","qm"),u(vt,"class","in-l"),t[3].q.m===void 0&&tt(()=>t[57].call(vt)),u(Rn,"class","my-1 flex"),u(gl,"name","qb"),u(gl,"type","text"),u(gl,"class","in-s"),u(Kl,"class","my-1"),u(ze,"class","cnt"),u(es,"class","text-sm"),u(Bn,"href",Ft("User-interface")),u(Bn,"target","_blank"),u(Bn,"class","float-right"),u(pi,"type","hidden"),u(pi,"name","u"),pi.value="true",u(mi,"class","flex flex-wrap"),u(ll,"class","cnt"),u(ts,"class","text-sm"),u(zn,"href","https://amsleser.no/blog/post/24-telnet-debug"),u(zn,"target","_blank"),u(zn,"class","float-right"),u(_i,"type","hidden"),u(_i,"name","d"),_i.value="true",u(Kt,"type","checkbox"),u(Kt,"name","ds"),Kt.__value="true",Kt.value=Kt.__value,u(Kt,"class","rounded mb-1"),u(ls,"class","mt-3"),u(Nt,"class","cnt"),u(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),u(Kn,"type","button"),u(Kn,"class","py-2 px-4 rounded bg-red-500 text-white ml-2"),u(Qn,"type","button"),u(Qn,"class","py-2 px-4 rounded bg-yellow-500 text-white"),u(is,"class","text-center"),u(ss,"class","text-right"),u(Ml,"class","grid grid-cols-3"),u(e,"autocomplete","off")},m(M,te){w(M,e,te),s(e,l),s(l,n),s(n,i),s(n,o),s(n,r),X(a,r,null),s(n,p),s(n,f),s(n,_),s(n,m),s(m,d),s(d,v),s(v,h),s(v,g),s(v,y),s(v,C),V(C,t[3].g.h),s(d,T),s(d,P),s(P,I),s(P,S),s(P,A),s(P,E),X(F,E,null),Re(E,t[3].g.t,!0),s(n,z),s(n,O),s(n,R),s(n,U),s(U,Y),s(Y,q),s(q,H),s(q,G),s(q,L),s(q,W),s(W,j),s(j,ee),s(j,le),s(j,de),s(j,ie),s(j,we),s(W,Ie),s(Ie,Ce),s(Ie,Ee),s(Ie,ve),s(Ie,Pe),s(W,Ae),s(Ae,pe),s(Ae,se),s(W,me),s(W,Q),s(W,oe),s(W,Ne),s(W,Me),s(W,he),s(W,x),s(W,_e),s(W,Le),s(W,Ge),s(W,Ke),s(W,Fe),s(W,je),Re(W,t[3].p.r,!0),s(Y,re),s(Y,ge),s(ge,Lt),s(ge,Rl),s(ge,Zt),s(ge,ft);for(let at=0;at<4;at+=1)di[at]&&di[at].m(ft,null);Re(ft,t[3].p.c,!0),s(n,yl),s(n,rl),s(rl,Ot),s(Ot,dt),s(dt,Qe),s(dt,Xe),s(dt,Ze),s(dt,Oe),V(Oe,t[3].p.f),s(Ot,Je),s(Ot,Be),s(Be,xe),s(Be,et),s(Be,ue),s(Be,be),V(be,t[3].p.m),s(n,Si),s(n,al),s(al,sn),s(sn,Tt),Tt.checked=t[3].p.e,s(sn,Pi),s(al,Ni),ht&&ht.m(al,null),s(n,Mi),s(n,fl),s(fl,Ai),s(fl,Di),s(fl,Ii),s(fl,qe),s(qe,cl),s(qe,qt),s(qe,Ll),Re(qe,t[3].g.s,!0),s(n,Ei),bt&&bt.m(n,null),s(l,$l),s(l,He),s(He,on),s(He,vo),s(He,un),X(rn,un,null),s(He,ho),s(He,oi),s(He,bo),s(He,an),s(an,gs),s(an,go),s(an,Cl),s(Cl,Jt),s(Jt,Tl),s(Tl,ko);for(let at=0;at<7;at+=1)vi[at]&&vi[at].m(Jt,null);Re(Jt,t[3].m.b,!0),s(Cl,wo),s(Cl,pt),s(pt,Sl),s(Sl,yo),s(pt,fn),s(pt,cn),s(pt,pn),s(pt,mn),Re(pt,t[3].m.p,!0),s(Cl,$o),s(Cl,ui),s(ui,Ut),Ut.checked=t[3].m.i,s(ui,Co),s(He,To),s(He,Ol),s(Ol,So),s(Ol,Po),s(Ol,No),s(Ol,xt),s(xt,_n),s(xt,dn),Re(xt,t[3].m.d,!0),s(He,Mo),s(He,vn),s(vn,ql),s(ql,Ao),s(ql,Do),s(ql,Io),s(ql,hn),s(hn,Ht),V(Ht,t[3].m.f),s(hn,Eo),s(hn,Oi),s(vn,Fo),s(vn,Ul),s(Ul,Ro),s(Ul,Lo),s(Ul,Oo),s(Ul,bn),s(bn,jt),V(jt,t[3].m.r),s(bn,qo),s(bn,qi),s(He,Uo),s(He,ks),s(He,Ho),s(He,Hl),s(Hl,Ui),s(Ui,Wt),Wt.checked=t[3].m.e.e,s(Ui,jo),s(Hl,Wo),gt&>.m(Hl,null),s(He,Go),kt&&kt.m(He,null),s(He,ws),s(He,Hi),s(Hi,Gt),Gt.checked=t[3].m.m.e,s(Hi,Bo),s(He,Yo),wt&&wt.m(He,null),s(l,zo),s(l,ct),s(ct,ji),s(ct,Vo),s(ct,gn),X(kn,gn,null),s(ct,Ko),s(ct,ri),s(ct,Qo),s(ct,jl),s(jl,Xo),s(jl,Zo),s(jl,Jo),s(jl,pl),V(pl,t[3].w.s),s(ct,xo),s(ct,Wl),s(Wl,eu),s(Wl,tu),s(Wl,lu),s(Wl,ml),V(ml,t[3].w.p),s(ct,nu),s(ct,wn),s(wn,Gl),s(Gl,iu),s(Gl,su),s(Gl,ou),s(Gl,At),s(At,yn),s(At,$n),s(At,Cn),s(At,Tn),Re(At,t[3].w.z,!0),s(wn,uu),s(wn,Bl),s(Bl,ru),s(Bl,au),s(Bl,fu),s(Bl,Sn),s(Sn,Dt),V(Dt,t[3].w.w),s(Sn,cu),s(Sn,Wi),s(ct,pu),s(ct,Gi),s(Gi,Bi),s(Bi,Bt),Bt.checked=t[3].w.a,s(Bi,mu),s(l,_u),s(l,rt),s(rt,Yi),s(rt,du),s(rt,Pn),X(Nn,Pn,null),s(rt,vu),s(rt,Yl),s(Yl,hu),s(Yl,bu),s(Yl,gu),s(Yl,Pl),s(Pl,el),s(el,Mn),s(el,An),Re(el,t[3].n.m,!0),s(Pl,ku),s(Pl,St),V(St,t[3].n.i),s(Pl,wu),s(Pl,Pt),X(Dn,Pt,null),Re(Pt,t[3].n.s,!0),s(rt,yu),yt&&yt.m(rt,null),s(rt,ys),s(rt,Xi),s(Xi,Zi),s(Zi,Yt),Yt.checked=t[3].n.d,s(Zi,$u),s(rt,Cu),s(rt,ai),s(rt,Tu),s(rt,Nl),s(Nl,Su),s(Nl,fi),s(fi,zt),zt.checked=t[3].n.h,s(fi,Pu),s(Nl,Nu),s(Nl,Mu),s(Nl,Ji),s(Ji,_l),V(_l,t[3].n.n1),s(l,Au),s(l,ze),s(ze,xi),s(ze,Du),s(ze,In),X(En,In,null),s(ze,Iu),s(ze,ci),s(ze,Eu),s(ze,tl),s(tl,Fu),$t&&$t.m(tl,null),s(tl,$s),s(tl,Ru),s(tl,Lu),s(tl,Fn),s(Fn,dl),V(dl,t[3].q.h),s(Fn,Ou),s(Fn,Vt),V(Vt,t[3].q.p),s(ze,qu),lt&<.m(ze,null),s(ze,Cs),s(ze,zl),s(zl,Uu),s(zl,Hu),s(zl,ju),s(zl,vl),V(vl,t[3].q.u),s(ze,Wu),s(ze,Vl),s(Vl,Gu),s(Vl,Bu),s(Vl,Yu),s(Vl,hl),V(hl,t[3].q.a),s(ze,zu),s(ze,Rn),s(Rn,Ln),s(Ln,Vu),s(Ln,Ku),s(Ln,Qu),s(Ln,bl),V(bl,t[3].q.c),s(Rn,Xu),s(Rn,On),s(On,Zu),s(On,Ju),s(On,xu),s(On,vt),s(vt,qn),s(vt,Un),s(vt,Hn),s(vt,jn),s(vt,Wn),s(vt,Gn),Re(vt,t[3].q.m,!0),s(ze,er),s(ze,Kl),s(Kl,tr),s(Kl,lr),s(Kl,nr),s(Kl,gl),V(gl,t[3].q.b),s(l,ir),nt&&nt.m(l,null),s(l,Ts),it&&it.m(l,null),s(l,Ss),st&&st.m(l,null),s(l,Ns),s(l,ll),s(ll,es),s(ll,sr),s(ll,Bn),X(Yn,Bn,null),s(ll,or),s(ll,pi),s(ll,ur),s(ll,mi);for(let at=0;at0?bt?bt.p(M,te):(bt=Ka(M),bt.c(),bt.m(n,null)):bt&&(bt.d(1),bt=null),(!Qt||te[0]&8&&Fi!==(Fi=M[3].m.b!=0))&&(Tl.disabled=Fi),te[0]&8&&Re(Jt,M[3].m.b),(!Qt||te[0]&8&&Ri!==(Ri=M[3].m.b!=0))&&(Sl.disabled=Ri),(!Qt||te[0]&8&&Li!==(Li=M[3].m.b==0))&&(pt.disabled=Li),te[0]&8&&Re(pt,M[3].m.p),te[0]&8&&(Ut.checked=M[3].m.i),te[0]&8&&Re(xt,M[3].m.d),te[0]&8&&ae(Ht.value)!==M[3].m.f&&V(Ht,M[3].m.f),te[0]&8&&ae(jt.value)!==M[3].m.r&&V(jt,M[3].m.r),te[0]&8&&(Wt.checked=M[3].m.e.e),M[3].m.e.e?gt?gt.p(M,te):(gt=Qa(M),gt.c(),gt.m(Hl,null)):gt&&(gt.d(1),gt=null),M[3].m.e.e?kt?kt.p(M,te):(kt=Xa(M),kt.c(),kt.m(He,ws)):kt&&(kt.d(1),kt=null),te[0]&8&&(Gt.checked=M[3].m.m.e),M[3].m.m.e?wt?wt.p(M,te):(wt=Za(M),wt.c(),wt.m(He,null)):wt&&(wt.d(1),wt=null),te[0]&8&&pl.value!==M[3].w.s&&V(pl,M[3].w.s),te[0]&8&&ml.value!==M[3].w.p&&V(ml,M[3].w.p),te[0]&8&&Re(At,M[3].w.z),te[0]&8&&ae(Dt.value)!==M[3].w.w&&V(Dt,M[3].w.w),te[0]&8&&(Bt.checked=M[3].w.a),te[0]&8&&Re(el,M[3].n.m),(!Qt||te[0]&8&&zi!==(zi=M[3].n.m=="dhcp"))&&(St.disabled=zi),(!Qt||te[0]&8&&Vi!==(Vi=M[3].n.m=="static"))&&(St.required=Vi),te[0]&8&&St.value!==M[3].n.i&&V(St,M[3].n.i),(!Qt||te[0]&8&&Ki!==(Ki=M[3].n.m=="dhcp"))&&(Pt.disabled=Ki),(!Qt||te[0]&8&&Qi!==(Qi=M[3].n.m=="static"))&&(Pt.required=Qi),te[0]&8&&Re(Pt,M[3].n.s),M[3].n.m=="static"?yt?yt.p(M,te):(yt=Ja(M),yt.c(),yt.m(rt,ys)):yt&&(yt.d(1),yt=null),te[0]&8&&(Yt.checked=M[3].n.d),te[0]&8&&(zt.checked=M[3].n.h),te[0]&8&&_l.value!==M[3].n.n1&&V(_l,M[3].n.n1),M[0].chip!="esp8266"?$t?$t.p(M,te):($t=xa(M),$t.c(),$t.m(tl,$s)):$t&&($t.d(1),$t=null),te[0]&8&&dl.value!==M[3].q.h&&V(dl,M[3].q.h),te[0]&8&&ae(Vt.value)!==M[3].q.p&&V(Vt,M[3].q.p),M[3].q.s.e?lt?(lt.p(M,te),te[0]&8&&N(lt,1)):(lt=ef(M),lt.c(),N(lt,1),lt.m(ze,Cs)):lt&&(Te(),D(lt,1,1,()=>{lt=null}),Se()),te[0]&8&&vl.value!==M[3].q.u&&V(vl,M[3].q.u),te[0]&8&&hl.value!==M[3].q.a&&V(hl,M[3].q.a),te[0]&8&&bl.value!==M[3].q.c&&V(bl,M[3].q.c),te[0]&8&&Re(vt,M[3].q.m),te[0]&8&&gl.value!==M[3].q.b&&V(gl,M[3].q.b),M[3].q.m==3?nt?(nt.p(M,te),te[0]&8&&N(nt,1)):(nt=tf(M),nt.c(),N(nt,1),nt.m(l,Ts)):nt&&(Te(),D(nt,1,1,()=>{nt=null}),Se()),M[3].q.m==4?it?(it.p(M,te),te[0]&8&&N(it,1)):(it=lf(M),it.c(),N(it,1),it.m(l,Ss)):it&&(Te(),D(it,1,1,()=>{it=null}),Se()),te[0]&8&&(Ps=M[3].p.r.startsWith("10YNO")||M[3].p.r=="10Y1001A1001A48H"),Ps?st?(st.p(M,te),te[0]&8&&N(st,1)):(st=nf(M),st.c(),N(st,1),st.m(l,Ns)):st&&(Te(),D(st,1,1,()=>{st=null}),Se()),te[0]&136){Xn=M[7];let It;for(It=0;It20||M[0].chip=="esp8266"?ot?(ot.p(M,te),te[0]&1&&N(ot,1)):(ot=uf(M),ot.c(),N(ot,1),ot.m(l,Ms)):ot&&(Te(),D(ot,1,1,()=>{ot=null}),Se()),te[0]&8&&(Kt.checked=M[3].d.s),M[3].d.s?Ct?Ct.p(M,te):(Ct=mf(M),Ct.c(),Ct.m(Nt,null)):Ct&&(Ct.d(1),Ct=null);const at={};te[0]&2&&(at.active=M[1]),Ql.$set(at);const br={};te[0]&4&&(br.active=M[2]),Xl.$set(br);const gr={};te[0]&16&&(gr.active=M[4]),Zl.$set(gr);const kr={};te[0]&32&&(kr.active=M[5]),Jl.$set(kr)},i(M){Qt||(N(a.$$.fragment,M),N(F.$$.fragment,M),N(rn.$$.fragment,M),N(kn.$$.fragment,M),N(Nn.$$.fragment,M),N(Dn.$$.fragment,M),N(En.$$.fragment,M),N(lt),N(nt),N(it),N(st),N(Yn.$$.fragment,M),N(ot),N(Vn.$$.fragment,M),N(Ql.$$.fragment,M),N(Xl.$$.fragment,M),N(Zl.$$.fragment,M),N(Jl.$$.fragment,M),Qt=!0)},o(M){D(a.$$.fragment,M),D(F.$$.fragment,M),D(rn.$$.fragment,M),D(kn.$$.fragment,M),D(Nn.$$.fragment,M),D(Dn.$$.fragment,M),D(En.$$.fragment,M),D(lt),D(nt),D(it),D(st),D(Yn.$$.fragment,M),D(ot),D(Vn.$$.fragment,M),D(Ql.$$.fragment,M),D(Xl.$$.fragment,M),D(Zl.$$.fragment,M),D(Jl.$$.fragment,M),Qt=!1},d(M){M&&k(e),Z(a),Z(F),ol(di,M),ht&&ht.d(),bt&&bt.d(),Z(rn),ol(vi,M),gt&>.d(),kt&&kt.d(),wt&&wt.d(),Z(kn),Z(Nn),Z(Dn),yt&&yt.d(),Z(En),$t&&$t.d(),lt&<.d(),nt&&nt.d(),it&&it.d(),st&&st.d(),Z(Yn),ol(mt,M),ot&&ot.d(),Z(Vn),Ct&&Ct.d(),M&&k(Ds),Z(Ql,M),M&&k(Is),Z(Xl,M),M&&k(Es),Z(Zl,M),M&&k(Fs),Z(Jl,M),Rs=!1,Ve(hr)}}}async function Qm(){await(await fetch("/reboot",{method:"POST"})).json()}function Xm(t,e,l){let{sysinfo:n={}}=e,i=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{name:"Reactive",key:"r"},{name:"Realtime",key:"c"},{name:"Peaks",key:"t"},{name:"Price",key:"p"},{name:"Day plot",key:"d"},{name:"Month plot",key:"m"},{name:"Temperature plot",key:"s"}],o=!0,r=!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},n:{m:"",i:"",s:"",g:"",d1:"",d2:"",d:!1,n1:"",n2:"",h:!1},q:{h:"",p:1883,u:"",a:"",b:"",s:{e:!1,c:!1,r:!0,k:!1}},o:{e:"",c:"",u1:"",u2:"",u3:""},t:{t:[0,0,0,0,0,0,0,0,0,0],h:1},p:{e:!1,t:"",r:"",c:"",m:1,f:null},d:{s:!1,t:!1,l:5},u:{i:0,e:0,v:0,a:0,r:0,c:0,t:0,p:0,d:0,m:0,s:0},i:{h:{p:null,u:!0},a:null,l:{p:null,i:!1},r:{r:null,g:null,b:null,i:!1},t:{d:null,a:null},v:{p:null,d:{v:null,g:null},o:null,m:null,b:null}},h:{t:"",h:"",n:""}};Mc.subscribe(qe=>{qe.version&&(l(3,a=qe),l(1,o=!1))}),Cm();let p=!1,f=!1;async function _(){if(confirm("Are you sure you want to factory reset the device?")){l(4,p=!0);const qe=new URLSearchParams;qe.append("perform","true");let qt=await(await fetch("/reset",{method:"POST",body:qe})).json();l(4,p=!1),l(5,f=qt.success)}}async function m(qe){l(2,r=!0);const cl=new FormData(qe.target),qt=new URLSearchParams;for(let $l of cl){const[He,on]=$l;qt.append(He,on)}let Ei=await(await fetch("/save",{method:"POST",body:qt})).json();Rt.update($l=>($l.booting=Ei.reboot,$l.ui=a.u,$l)),l(2,r=!1),ti("/")}const d=function(){confirm("Are you sure you want to reboot the device?")&&(Rt.update(qe=>(qe.booting=!0,qe)),Qm())},v=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 h=44;function g(){a.g.h=this.value,l(3,a)}function y(){a.g.t=_t(this),l(3,a)}function C(){a.p.r=_t(this),l(3,a)}function T(){a.p.c=_t(this),l(3,a)}function P(){a.p.f=ae(this.value),l(3,a)}function I(){a.p.m=ae(this.value),l(3,a)}function S(){a.p.e=this.checked,l(3,a)}function A(){a.p.t=this.value,l(3,a)}function E(){a.g.s=_t(this),l(3,a)}function F(){a.g.u=this.value,l(3,a)}function z(){a.g.p=this.value,l(3,a)}function O(){a.m.b=_t(this),l(3,a)}function R(){a.m.p=_t(this),l(3,a)}function U(){a.m.i=this.checked,l(3,a)}function Y(){a.m.d=_t(this),l(3,a)}function q(){a.m.f=ae(this.value),l(3,a)}function H(){a.m.r=ae(this.value),l(3,a)}function G(){a.m.e.e=this.checked,l(3,a)}function L(){a.m.e.k=this.value,l(3,a)}function W(){a.m.e.a=this.value,l(3,a)}function j(){a.m.m.e=this.checked,l(3,a)}function ee(){a.m.m.w=ae(this.value),l(3,a)}function le(){a.m.m.v=ae(this.value),l(3,a)}function de(){a.m.m.a=ae(this.value),l(3,a)}function ie(){a.m.m.c=ae(this.value),l(3,a)}function we(){a.w.s=this.value,l(3,a)}function Ie(){a.w.p=this.value,l(3,a)}function Ce(){a.w.z=_t(this),l(3,a)}function Ee(){a.w.w=ae(this.value),l(3,a)}function ve(){a.w.a=this.checked,l(3,a)}function Pe(){a.n.m=_t(this),l(3,a)}function Ae(){a.n.i=this.value,l(3,a)}function pe(){a.n.s=_t(this),l(3,a)}function se(){a.n.g=this.value,l(3,a)}function me(){a.n.d1=this.value,l(3,a)}function Q(){a.n.d2=this.value,l(3,a)}function oe(){a.n.d=this.checked,l(3,a)}function Ne(){a.n.h=this.checked,l(3,a)}function Me(){a.n.n1=this.value,l(3,a)}function he(){a.q.s.e=this.checked,l(3,a)}function x(){a.q.h=this.value,l(3,a)}function _e(){a.q.p=ae(this.value),l(3,a)}function Le(){a.q.u=this.value,l(3,a)}function Ge(){a.q.a=this.value,l(3,a)}function Ke(){a.q.c=this.value,l(3,a)}function Fe(){a.q.m=_t(this),l(3,a)}function je(){a.q.b=this.value,l(3,a)}function re(){a.o.e=this.value,l(3,a)}function ge(){a.o.c=this.value,l(3,a)}function Lt(){a.o.u1=this.value,l(3,a)}function Rl(){a.o.u2=this.value,l(3,a)}function Zt(){a.o.u3=this.value,l(3,a)}function ft(){a.h.t=this.value,l(3,a)}function yl(){a.h.h=this.value,l(3,a)}function rl(){a.h.n=this.value,l(3,a)}function Ot(qe){a.t.t[qe]=ae(this.value),l(3,a)}function dt(){a.t.h=ae(this.value),l(3,a)}function Qe(qe){a.u[qe.key]=_t(this),l(3,a)}function Xe(){a.i.h.u=this.checked,l(3,a)}function Ze(){a.i.h.p=_t(this),l(3,a)}function Oe(){a.i.a=ae(this.value),l(3,a)}function Je(){a.i.l.i=this.checked,l(3,a)}function Be(){a.i.l.p=ae(this.value),l(3,a)}function xe(){a.i.r.i=this.checked,l(3,a)}function et(){a.i.r.r=ae(this.value),l(3,a)}function ue(){a.i.r.g=ae(this.value),l(3,a)}function be(){a.i.r.b=ae(this.value),l(3,a)}function Si(){a.i.t.d=ae(this.value),l(3,a)}function al(){a.i.t.a=ae(this.value),l(3,a)}function sn(){a.i.v.p=ae(this.value),l(3,a)}function Tt(){a.i.v.d.v=ae(this.value),l(3,a)}function Pi(){a.i.v.d.g=ae(this.value),l(3,a)}function Ni(){a.i.v.o=ae(this.value),l(3,a)}function Mi(){a.i.v.m=ae(this.value),l(3,a)}function fl(){a.i.v.b=ae(this.value),l(3,a)}function Ai(){a.d.s=this.checked,l(3,a)}function Di(){a.d.t=this.checked,l(3,a)}function Ii(){a.d.l=_t(this),l(3,a)}return t.$$set=qe=>{"sysinfo"in qe&&l(0,n=qe.sysinfo)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(6,h=n.chip=="esp8266"?16:n.chip=="esp32s2"?44:39)},[n,o,r,a,p,f,h,i,_,m,d,v,g,y,C,T,P,I,S,A,E,F,z,O,R,U,Y,q,H,G,L,W,j,ee,le,de,ie,we,Ie,Ce,Ee,ve,Pe,Ae,pe,se,me,Q,oe,Ne,Me,he,x,_e,Le,Ge,Ke,Fe,je,re,ge,Lt,Rl,Zt,ft,yl,rl,Ot,dt,Qe,Xe,Ze,Oe,Je,Be,xe,et,ue,be,Si,al,sn,Tt,Pi,Ni,Mi,fl,Ai,Di,Ii]}class Zm extends $e{constructor(e){super(),ye(this,e,Xm,Km,ke,{sysinfo:0},null,[-1,-1,-1,-1])}}function df(t,e,l){const n=t.slice();return n[20]=e[l],n}function Jm(t){let e=fe(t[1].chip,t[1].board)+"",l;return{c(){l=$(e)},m(n,i){w(n,l,i)},p(n,i){i&2&&e!==(e=fe(n[1].chip,n[1].board)+"")&&B(l,e)},d(n){n&&k(l)}}}function vf(t){let e,l,n=t[1].apmac+"",i,o,r,a,p,f,_,m,d,v=qr(t[1])+"",h,g,y=t[1].boot_reason+"",C,T,P=t[1].ex_cause+"",I,S,A;const E=[e0,xm],F=[];function z(O,R){return O[0].u>0?0:1}return p=z(t),f=F[p]=E[p](t),{c(){e=c("div"),l=$("AP MAC: "),i=$(n),o=b(),r=c("div"),a=$(`Last boot: `),f.c(),_=b(),m=c("div"),d=$("Reason: "),h=$(v),g=$(" ("),C=$(y),T=$("/"),I=$(P),S=$(")"),u(e,"class","my-2"),u(r,"class","my-2"),u(m,"class","my-2")},m(O,R){w(O,e,R),s(e,l),s(e,i),w(O,o,R),w(O,r,R),s(r,a),F[p].m(r,null),w(O,_,R),w(O,m,R),s(m,d),s(m,h),s(m,g),s(m,C),s(m,T),s(m,I),s(m,S),A=!0},p(O,R){(!A||R&2)&&n!==(n=O[1].apmac+"")&&B(i,n);let U=p;p=z(O),p===U?F[p].p(O,R):(Te(),D(F[U],1,1,()=>{F[U]=null}),Se(),f=F[p],f?f.p(O,R):(f=F[p]=E[p](O),f.c()),N(f,1),f.m(r,null)),(!A||R&2)&&v!==(v=qr(O[1])+"")&&B(h,v),(!A||R&2)&&y!==(y=O[1].boot_reason+"")&&B(C,y),(!A||R&2)&&P!==(P=O[1].ex_cause+"")&&B(I,P)},i(O){A||(N(f),A=!0)},o(O){D(f),A=!1},d(O){O&&k(e),O&&k(o),O&&k(r),F[p].d(),O&&k(_),O&&k(m)}}}function xm(t){let e;return{c(){e=$("-")},m(l,n){w(l,e,n)},p:ne,i:ne,o:ne,d(l){l&&k(e)}}}function e0(t){let e,l;return e=new Sc({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:""}}),{c(){J(e.$$.fragment)},m(n,i){X(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||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function t0(t){let e;return{c(){e=c("span"),e.textContent="Update consents",u(e,"class","btn-pri-sm")},m(l,n){w(l,e,n)},p:ne,d(l){l&&k(e)}}}function hf(t){let e,l,n,i,o,r=ds(t[1].meter.mfg)+"",a,p,f,_,m=t[1].meter.model+"",d,v,h,g,y=t[1].meter.id+"",C;return{c(){e=c("div"),l=c("strong"),l.textContent="Meter",n=b(),i=c("div"),o=$("Manufacturer: "),a=$(r),p=b(),f=c("div"),_=$("Model: "),d=$(m),v=b(),h=c("div"),g=$("ID: "),C=$(y),u(l,"class","text-sm"),u(i,"class","my-2"),u(f,"class","my-2"),u(h,"class","my-2"),u(e,"class","cnt")},m(T,P){w(T,e,P),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,p),s(e,f),s(f,_),s(f,d),s(e,v),s(e,h),s(h,g),s(h,C)},p(T,P){P&2&&r!==(r=ds(T[1].meter.mfg)+"")&&B(a,r),P&2&&m!==(m=T[1].meter.model+"")&&B(d,m),P&2&&y!==(y=T[1].meter.id+"")&&B(C,y)},d(T){T&&k(e)}}}function bf(t){let e,l,n,i,o,r=t[1].net.ip+"",a,p,f,_,m=t[1].net.mask+"",d,v,h,g,y=t[1].net.gw+"",C,T,P,I,S=t[1].net.dns1+"",A,E,F=t[1].net.dns2&&gf(t);return{c(){e=c("div"),l=c("strong"),l.textContent="Network",n=b(),i=c("div"),o=$("IP: "),a=$(r),p=b(),f=c("div"),_=$("Mask: "),d=$(m),v=b(),h=c("div"),g=$("Gateway: "),C=$(y),T=b(),P=c("div"),I=$("DNS: "),A=$(S),E=b(),F&&F.c(),u(l,"class","text-sm"),u(i,"class","my-2"),u(f,"class","my-2"),u(h,"class","my-2"),u(P,"class","my-2"),u(e,"class","cnt")},m(z,O){w(z,e,O),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,p),s(e,f),s(f,_),s(f,d),s(e,v),s(e,h),s(h,g),s(h,C),s(e,T),s(e,P),s(P,I),s(P,A),s(P,E),F&&F.m(P,null)},p(z,O){O&2&&r!==(r=z[1].net.ip+"")&&B(a,r),O&2&&m!==(m=z[1].net.mask+"")&&B(d,m),O&2&&y!==(y=z[1].net.gw+"")&&B(C,y),O&2&&S!==(S=z[1].net.dns1+"")&&B(A,S),z[1].net.dns2?F?F.p(z,O):(F=gf(z),F.c(),F.m(P,null)):F&&(F.d(1),F=null)},d(z){z&&k(e),F&&F.d()}}}function gf(t){let e,l=t[1].net.dns2+"",n;return{c(){e=$("/ "),n=$(l)},m(i,o){w(i,e,o),w(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns2+"")&&B(n,l)},d(i){i&&k(e),i&&k(n)}}}function kf(t){let e,l,n,i=t[1].upgrade.t+"",o,r,a=t[1].version+"",p,f,_=t[1].upgrade.x+"",m,d,v=t[1].upgrade.e+"",h,g;return{c(){e=c("div"),l=c("div"),n=$("Previous upgrade attempt ("),o=$(i),r=$(") does not match current version ("),p=$(a),f=$(") ["),m=$(_),d=$("/"),h=$(v),g=$("]"),u(l,"class","bd-yellow"),u(e,"class","my-2")},m(y,C){w(y,e,C),s(e,l),s(l,n),s(l,o),s(l,r),s(l,p),s(l,f),s(l,m),s(l,d),s(l,h),s(l,g)},p(y,C){C&2&&i!==(i=y[1].upgrade.t+"")&&B(o,i),C&2&&a!==(a=y[1].version+"")&&B(p,a),C&2&&_!==(_=y[1].upgrade.x+"")&&B(m,_),C&2&&v!==(v=y[1].upgrade.e+"")&&B(h,v)},d(y){y&&k(e)}}}function wf(t){let e,l,n,i=t[2].tag_name+"",o,r,a,p,f,_,m=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[2]&&t[2].tag_name!=t[1].version&&yf(t),d=t[1].fwconsent===2&&$f();return{c(){e=c("div"),l=$(`Latest version: diff --git a/lib/SvelteUi/app/src/app.postcss b/lib/SvelteUi/app/src/app.postcss index 07ce62a8..0a8b8d21 100644 --- a/lib/SvelteUi/app/src/app.postcss +++ b/lib/SvelteUi/app/src/app.postcss @@ -8,7 +8,8 @@ } .cnt { - @apply bg-white m-2 p-2 rounded shadow-lg + @apply bg-white m-2 p-2 rounded shadow-lg; + min-height: 268px; } .gwf { diff --git a/lib/SvelteUi/app/src/lib/AccountingData.svelte b/lib/SvelteUi/app/src/lib/AccountingData.svelte index 4e96c347..9e0f3fb3 100644 --- a/lib/SvelteUi/app/src/lib/AccountingData.svelte +++ b/lib/SvelteUi/app/src/lib/AccountingData.svelte @@ -31,7 +31,7 @@
Month
{fmtnum(data.m.u)} kWh
{#if hasCost}
{fmtnum(data.m.c)} {currency}
{/if} -
Last month
+
Last mo.
{fmtnum(sysinfo.last_month.u)} kWh
{#if hasCost}
{fmtnum(sysinfo.last_month.c)} {currency}
{/if} @@ -46,7 +46,7 @@
Month
{fmtnum(data.m.p)} kWh
{#if hasCost}
{fmtnum(data.m.i)} {currency}
{/if} -
Last month
+
Last mo.
{fmtnum(sysinfo.last_month.p)} kWh
{#if hasCost}
{fmtnum(sysinfo.last_month.i)} {currency}
{/if} diff --git a/lib/SvelteUi/src/AmsWebServer.cpp b/lib/SvelteUi/src/AmsWebServer.cpp index f652593a..6bcc856d 100644 --- a/lib/SvelteUi/src/AmsWebServer.cpp +++ b/lib/SvelteUi/src/AmsWebServer.cpp @@ -2190,15 +2190,15 @@ void AmsWebServer::configFileDownload() { EnergyAccountingConfig eac; config->getEnergyAccountingConfig(eac); EnergyAccountingData ead = ea->getData(); - server.sendContent(buf, snprintf_P(buf, BufferSize, PSTR("energyaccounting %d %d %.2f %d %d %.2f %d %d %d %.2f %d %.2f %d %.2f %d %.2f %d %.2f"), + server.sendContent(buf, snprintf_P(buf, BufferSize, PSTR("energyaccounting %d %d %.2f %d %d %.2f %d %d %d %.2f %d %.2f %d %.2f %d %.2f %d %.2f %.2f %.2f"), ead.version, ead.month, - ead.costYesterday / 10.0, - ead.costThisMonth, - ead.costLastMonth, - ead.incomeYesterday / 10.0, - ead.incomeThisMonth, - ead.incomeLastMonth, + ea->getCostYesterday(), + ea->getCostThisMonth(), + ea->getCostLastMonth(), + ea->getIncomeYesterday(), + ea->getIncomeThisMonth(), + ea->getIncomeLastMonth(), ead.peaks[0].day, ead.peaks[0].value / 100.0, ead.peaks[1].day, @@ -2208,7 +2208,9 @@ void AmsWebServer::configFileDownload() { ead.peaks[3].day, ead.peaks[3].value / 100.0, ead.peaks[4].day, - ead.peaks[4].value / 100.0 + ead.peaks[4].value / 100.0, + ea->getUseLastMonth(), + ea->getProducedLastMonth() )); server.sendContent_P(PSTR("\n")); } diff --git a/src/AmsToMqttBridge.cpp b/src/AmsToMqttBridge.cpp index 3d17527d..27c3296a 100644 --- a/src/AmsToMqttBridge.cpp +++ b/src/AmsToMqttBridge.cpp @@ -2104,6 +2104,7 @@ void configFileParse() { EnergyAccountingData ead = { 0, 0, 0, 0, 0, // Cost 0, 0, 0, // Income + 0, 0, 0, // Last month import, export and accuracy 0, 0, // Peak 1 0, 0, // Peak 2 0, 0, // Peak 3 @@ -2111,6 +2112,7 @@ void configFileParse() { 0, 0 // Peak 5 }; uint8_t peak = 0; + uint64_t totalImport = 0, totalExport = 0; char * pch = strtok (buf+17," "); while (pch != NULL) { if(ead.version < 5) { @@ -2170,7 +2172,7 @@ void configFileParse() { } else if(i == 7) { float val = String(pch).toFloat(); ead.incomeLastMonth = val; - } else if(i >= 8 && i < 20) { + } else if(i >= 8 && i < 18) { uint8_t hour = i-8; { long val = String(pch).toInt(); @@ -2183,12 +2185,28 @@ void configFileParse() { ead.peaks[peak].value = val * 100; } peak++; + } else if(i == 18) { + float val = String(pch).toFloat(); + totalImport = val * 1000; + } else if(i == 19) { + float val = String(pch).toFloat(); + totalExport = val * 1000; } } pch = strtok (NULL, " "); i++; } - ead.version = 5; + uint8_t accuracy = 0; + uint64_t importUpdate = totalImport, exportUpdate = totalExport; + while(importUpdate > UINT32_MAX || exportUpdate > UINT32_MAX) { + accuracy++; + importUpdate = totalImport / pow(10, accuracy); + exportUpdate = totalExport / pow(10, accuracy); + } + ead.lastMonthImport = importUpdate; + ead.lastMonthExport = exportUpdate; + + ead.version = 6; ea.setData(ead); sEa = true; }