diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d39778a5..a6c2153d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,6 +28,8 @@ jobs: run: | sed -i 's/NO_AMS2MQTT_PRICE_KEY/AMS2MQTT_PRICE_KEY="${{secrets.AMS2MQTT_PRICE_KEY}}"/g' platformio.ini sed -i 's/NO_AMS2MQTT_PRICE_AUTHENTICATION/AMS2MQTT_PRICE_AUTHENTICATION="${{secrets.AMS2MQTT_PRICE_AUTHENTICATION}}"/g' platformio.ini + sed -i 's/NO_ENERGY_SPEEDOMETER_USER/ENERGY_SPEEDOMETER_USER=\\"${{secrets.ENERGY_SPEEDOMETER_USER}}\\"/g' platformio.ini + sed -i 's/NO_ENERGY_SPEEDOMETER_PASS/ENERGY_SPEEDOMETER_PASS=\\"${{secrets.ENERGY_SPEEDOMETER_PASS}}\\"/g' platformio.ini - name: Cache Python dependencies uses: actions/cache@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68cd8886..eaf3984e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,6 +28,8 @@ jobs: run: | sed -i 's/NO_AMS2MQTT_PRICE_KEY/AMS2MQTT_PRICE_KEY="${{secrets.AMS2MQTT_PRICE_KEY}}"/g' platformio.ini sed -i 's/NO_AMS2MQTT_PRICE_AUTHENTICATION/AMS2MQTT_PRICE_AUTHENTICATION="${{secrets.AMS2MQTT_PRICE_AUTHENTICATION}}"/g' platformio.ini + sed -i 's/NO_ENERGY_SPEEDOMETER_USER/ENERGY_SPEEDOMETER_USER=\\"${{secrets.ENERGY_SPEEDOMETER_USER}}\\"/g' platformio.ini + sed -i 's/NO_ENERGY_SPEEDOMETER_PASS/ENERGY_SPEEDOMETER_PASS=\\"${{secrets.ENERGY_SPEEDOMETER_PASS}}\\"/g' platformio.ini - name: Cache Python dependencies uses: actions/cache@v1 diff --git a/lib/AmsData/include/AmsData.h b/lib/AmsData/include/AmsData.h index 025b09d4..9381c63d 100644 --- a/lib/AmsData/include/AmsData.h +++ b/lib/AmsData/include/AmsData.h @@ -77,6 +77,7 @@ public: bool isThreePhase(); bool isTwoPhase(); bool isCounterEstimated(); + bool isL2currentEstimated(); int8_t getLastError(); void setLastError(int8_t); @@ -94,7 +95,7 @@ protected: float l1activeExportPower = 0, l2activeExportPower = 0, l3activeExportPower = 0; float powerFactor = 0, l1PowerFactor = 0, l2PowerFactor = 0, l3PowerFactor = 0; double activeImportCounter = 0, reactiveImportCounter = 0, activeExportCounter = 0, reactiveExportCounter = 0; - bool threePhase = false, twoPhase = false, counterEstimated = false; + bool threePhase = false, twoPhase = false, counterEstimated = false, l2currentEstimated = false; int8_t lastError = 0x00; uint8_t lastErrorCount = 0; diff --git a/lib/AmsData/src/AmsData.cpp b/lib/AmsData/src/AmsData.cpp index 829f28f9..f5710d3d 100644 --- a/lib/AmsData/src/AmsData.cpp +++ b/lib/AmsData/src/AmsData.cpp @@ -73,6 +73,7 @@ void AmsData::apply(AmsData& other) { this->reactiveExportPower = other.getReactiveExportPower(); this->l1current = other.getL1Current(); this->l2current = other.getL2Current(); + this->l2currentEstimated = other.isL2currentEstimated(); this->l3current = other.getL3Current(); this->l1voltage = other.getL1Voltage(); this->l2voltage = other.getL2Voltage(); @@ -313,6 +314,10 @@ bool AmsData::isCounterEstimated() { return this->counterEstimated; } +bool AmsData::isL2currentEstimated() { + return this->l2currentEstimated; +} + int8_t AmsData::getLastError() { return lastErrorCount > 2 ? lastError : 0; } diff --git a/lib/PriceService/src/PriceService.cpp b/lib/PriceService/src/PriceService.cpp index 353a82ab..397f6e7f 100644 --- a/lib/PriceService/src/PriceService.cpp +++ b/lib/PriceService/src/PriceService.cpp @@ -323,7 +323,7 @@ float PriceService::getCurrencyMultiplier(const char* from, const char* to, time if(debugger->isActive(RemoteDebug::DEBUG)) debugger->printf_P(PSTR("(PriceService) Resulting currency multiplier: %.4f\n"), currencyMultiplier); tmElements_t tm; breakTime(t, tm); - lastCurrencyFetch = now + (SECS_PER_DAY * 1000) - (((((tm.Hour * 60) + tm.Minute) * 60) + tm.Second) * 1000) + (3600000 * 6); + lastCurrencyFetch = now + (SECS_PER_DAY * 1000) - (((((tm.Hour * 60) + tm.Minute) * 60) + tm.Second) * 1000) + (3600000 * 6) + (tomorrowFetchMinute * 60); this->currencyMultiplier = currencyMultiplier; } else { if(debugger->isActive(RemoteDebug::WARNING)) debugger->printf_P(PSTR("(PriceService) Multiplier ended in success, but without value\n")); diff --git a/lib/SvelteUi/app/dist/index.css b/lib/SvelteUi/app/dist/index.css index 0d11e5b8..f156f0fc 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-4{height:1rem}.h-6{height:1.5rem}.h-64{height:16rem}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-1\/4{width:25%}.w-3\/4{width:75%}.w-4{width:1rem}.w-40{width:10rem}.w-6{width:1.5rem}.w-96{width:24rem}.w-full{width:100%}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-md{border-radius:.375rem}.rounded-l-md{border-bottom-left-radius:.375rem;border-top-left-radius:.375rem}.rounded-r-md{border-bottom-right-radius:.375rem;border-top-right-radius:.375rem}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-green-500{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.bg-violet-600{--tw-bg-opacity:1;background-color:rgb(124 58 237/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-yellow-500{--tw-bg-opacity:1;background-color:rgb(234 179 8/var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity:.5}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.pb-4{padding-bottom:1rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-5{padding-left:1.25rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.text-center{text-align:center}.text-right{text-align:right}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-semibold{font-weight:600}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity))}.text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-green-100{--tw-text-opacity:1;color:rgb(220 252 231/var(--tw-text-opacity))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.text-red-100{--tw-text-opacity:1;color:rgb(254 226 226/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity))}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.gh-logo{height:2rem;width:2rem}.cnt{--tw-bg-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-radius:.25rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);margin:.5rem;padding:.5rem}:is(.dark .cnt){--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);--tw-shadow-color:#111827;--tw-shadow:var(--tw-shadow-colored);--tw-drop-shadow:drop-shadow(0 4px 3px rgba(0,0,0,.07)) drop-shadow(0 2px 2px rgba(0,0,0,.06));background-color:rgb(31 41 55/var(--tw-bg-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.cnt{min-height:268px}.gwf{height:16rem}@media (min-width:640px){.gwf{grid-column:span 2/span 2}}@media (min-width:768px){.gwf{grid-column:span 3/span 3}}@media (min-width:1024px){.gwf{grid-column:span 4/span 4}}@media (min-width:1280px){.gwf{grid-column:span 5/span 5}}@media (min-width:1536px){.gwf{grid-column:span 6/span 6}}.in-pre{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;border-width:1px 0 1px 1px;display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}:is(.dark .in-pre){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity))}.in-post{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-right-radius:.375rem;border-width:1px 1px 1px 0;display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}:is(.dark .in-post){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity))}.in-txt{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-txt:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-txt){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-txt:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-txt:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-f{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-f:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));cursor:not-allowed}:is(.dark .in-f){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-f:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-f:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-f:default{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.in-f:disabled{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .in-f)::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-f)::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-f:default){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.in-m{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-m:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-m){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-m:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-m:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-l{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;border-top-right-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-l:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-l){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-l:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-l:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}:is(.dark .in-l)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-opacity))}:is(.dark .in-l)::placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-opacity))}.in-s{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem;width:100%}.in-s:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-s){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-s:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-s:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-s::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.in-s::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-s){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.tr{text-align:right}.bd-green{background-color:rgb(34 197 94/var(--tw-bg-opacity));color:rgb(220 252 231/var(--tw-text-opacity))}.bd-green,.bd-yellow{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-yellow{background-color:rgb(234 179 8/var(--tw-bg-opacity));color:rgb(254 249 195/var(--tw-text-opacity))}.bd-red{background-color:rgb(239 68 68/var(--tw-bg-opacity));color:rgb(254 226 226/var(--tw-text-opacity))}.bd-blue,.bd-red{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-blue{background-color:rgb(59 130 246/var(--tw-bg-opacity));color:rgb(219 234 254/var(--tw-text-opacity))}.bd-gray{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(243 244 246/var(--tw-text-opacity));font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.btn-pri{padding:.5rem 1rem}.btn-pri,.btn-pri-sm{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));margin-right:.75rem}.btn-pri-sm{font-size:.75rem;line-height:1rem;padding:.25rem .5rem}.pl-root{position:relative}.pl-ov{left:25%;position:absolute;text-align:center;top:27%;width:50%}.pl-val{font-size:1.7rem}.pl-unt{color:gray;font-size:1rem}:is(.dark .pl-unt){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.pl-sub{font-size:1rem;padding-top:10px}.pl-snt{color:gray;font-size:.7rem}:is(.dark .pl-snt){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.pl-lab{font-size:1rem}.chart{height:100%;margin:0 auto;width:100%}svg{position:relative;width:100%}.tick{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity));font-family:Helvetica,Arial;font-size:.85em;font-weight:200}:is(.dark .tick){fill:#fff}.tick line{stroke:#e2e2e2;stroke-dasharray:2}.tick text{fill:#999;text-anchor:start}:is(.dark .tick text){fill:#fff}.tick.tick-0 line{stroke-dasharray:0}.tick.tick-green line{stroke:#32d900!important}.tick.tick-green text{fill:#32d900!important}.tick.tick-orange line{stroke:#d95600!important}.tick.tick-orange text{fill:#d95600!important}.x-axis .tick text{text-anchor:middle}.bars rect{stroke:#000;stroke-opacity:.25;opacity:.9}.bars text{display:block;font-family:Helvetica,Arial;font-size:.85em;text-align:center}.hover\:text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity))}:is(.dark .dark\:bg-gray-600){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-900){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}@media (min-width:640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width:1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width:1536px){.\32xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}} +/*! tailwindcss v3.3.2 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}[multiple],[type=date],[type=datetime-local],[type=email],[type=month],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=time],[type=url],[type=week],select,textarea{--tw-shadow:0 0 #0000;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-radius:0;border-width:1px;font-size:1rem;line-height:1.5rem;padding:.5rem .75rem}[multiple]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=email]:focus,[type=month]:focus,[type=number]:focus,[type=password]:focus,[type=search]:focus,[type=tel]:focus,[type=text]:focus,[type=time]:focus,[type=url]:focus,[type=week]:focus,select:focus,textarea:focus{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);border-color:#2563eb;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-bottom:0;padding-top:0}select{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple]{background-image:none;background-position:0 0;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{--tw-shadow:0 0 #0000;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-origin:border-box;border-color:#6b7280;border-width:1px;color:#2563eb;display:inline-block;flex-shrink:0;height:1rem;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1rem}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}[type=checkbox]:checked,[type=radio]:checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}[type=checkbox]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E")}[type=radio]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")}[type=checkbox]:checked:focus,[type=checkbox]:checked:hover,[type=radio]:checked:focus,[type=radio]:checked:hover{background-color:currentColor;border-color:transparent}[type=checkbox]:indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}[type=checkbox]:indeterminate:focus,[type=checkbox]:indeterminate:hover{background-color:currentColor;border-color:transparent}[type=file]{background:unset;border-color:inherit;border-radius:0;border-width:0;font-size:unset;line-height:inherit;padding:0}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.static{position:static}.fixed{position:fixed}.inset-0{inset:0}.z-40{z-index:40}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.float-right{float:right}.clear-both{clear:both}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-3{margin:.75rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-bottom:.25rem;margin-top:.25rem}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.my-auto{margin-bottom:auto;margin-top:auto}.mb-1{margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mr-3{margin-right:.75rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-4{height:1rem}.h-6{height:1.5rem}.h-64{height:16rem}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-1\/4{width:25%}.w-3\/4{width:75%}.w-4{width:1rem}.w-40{width:10rem}.w-6{width:1.5rem}.w-96{width:24rem}.w-full{width:100%}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-md{border-radius:.375rem}.rounded-l-md{border-bottom-left-radius:.375rem;border-top-left-radius:.375rem}.rounded-r-md{border-bottom-right-radius:.375rem;border-top-right-radius:.375rem}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-green-500{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.bg-violet-600{--tw-bg-opacity:1;background-color:rgb(124 58 237/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-yellow-500{--tw-bg-opacity:1;background-color:rgb(234 179 8/var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity:.5}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.pb-4{padding-bottom:1rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-5{padding-left:1.25rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.text-center{text-align:center}.text-right{text-align:right}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-semibold{font-weight:600}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity))}.text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-green-100{--tw-text-opacity:1;color:rgb(220 252 231/var(--tw-text-opacity))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.text-red-100{--tw-text-opacity:1;color:rgb(254 226 226/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity))}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.gh-logo{height:2rem;width:2rem}.cnt{--tw-bg-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-radius:.25rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);margin:.5rem;padding:.5rem}:is(.dark .cnt){--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);--tw-shadow-color:#111827;--tw-shadow:var(--tw-shadow-colored);--tw-drop-shadow:drop-shadow(0 4px 3px rgba(0,0,0,.07)) drop-shadow(0 2px 2px rgba(0,0,0,.06));background-color:rgb(31 41 55/var(--tw-bg-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.cnt{min-height:268px}.gwf{height:16rem}@media (min-width:640px){.gwf{grid-column:span 2/span 2}}@media (min-width:768px){.gwf{grid-column:span 3/span 3}}@media (min-width:1024px){.gwf{grid-column:span 4/span 4}}@media (min-width:1280px){.gwf{grid-column:span 5/span 5}}@media (min-width:1536px){.gwf{grid-column:span 6/span 6}}.in-pre{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;border-width:1px 0 1px 1px;display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}:is(.dark .in-pre){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity))}.in-post{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-right-radius:.375rem;border-width:1px 1px 1px 0;display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}:is(.dark .in-post){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity))}.in-txt{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-txt:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-txt){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-txt:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-txt:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-f{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-f:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));cursor:not-allowed}:is(.dark .in-f){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-f:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-f:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-f:default{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.in-f:disabled{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .in-f)::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-f)::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-f:default){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.in-m{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-m:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-m){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-m:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-m:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-l{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;border-top-right-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-l:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-l){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-l:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-l:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}:is(.dark .in-l)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-opacity))}:is(.dark .in-l)::placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-opacity))}.in-s{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem;width:100%}.in-s:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-s){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-s:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-s:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-s::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.in-s::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-s){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.tr{text-align:right}.bd-green{background-color:rgb(34 197 94/var(--tw-bg-opacity));color:rgb(220 252 231/var(--tw-text-opacity))}.bd-green,.bd-yellow{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-yellow{background-color:rgb(234 179 8/var(--tw-bg-opacity));color:rgb(254 249 195/var(--tw-text-opacity))}.bd-red{background-color:rgb(239 68 68/var(--tw-bg-opacity));color:rgb(254 226 226/var(--tw-text-opacity))}.bd-blue,.bd-red{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-blue{background-color:rgb(59 130 246/var(--tw-bg-opacity));color:rgb(219 234 254/var(--tw-text-opacity))}.bd-gray{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(243 244 246/var(--tw-text-opacity));font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.btn-pri{padding:.5rem 1rem}.btn-pri,.btn-pri-sm{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));margin-right:.75rem}.btn-pri-sm{font-size:.75rem;line-height:1rem;padding:.25rem .5rem}.pl-root{position:relative}.pl-ov{left:25%;position:absolute;text-align:center;top:27%;width:50%}.pl-val{font-size:1.7rem}.pl-unt{color:gray;font-size:1rem}:is(.dark .pl-unt){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.pl-sub{font-size:1rem;padding-top:10px}.pl-snt{color:gray;font-size:.7rem}:is(.dark .pl-snt){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.pl-lab{font-size:1rem}.chart{height:100%;margin:0 auto;width:100%}svg{position:relative;width:100%}.tick{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity));font-family:Helvetica,Arial;font-size:.85em;font-weight:200}:is(.dark .tick){fill:#fff}.tick line{stroke:#e2e2e2;stroke-dasharray:2}.tick text{fill:#999;text-anchor:start}:is(.dark .tick text){fill:#fff}.tick.tick-0 line{stroke-dasharray:0}.tick.tick-green line{stroke:#32d900!important}.tick.tick-green text{fill:#32d900!important}.tick.tick-orange line{stroke:#d95600!important}.tick.tick-orange text{fill:#d95600!important}.x-axis .tick text{text-anchor:middle}.bars rect{stroke:#000;stroke-opacity:.25;opacity:.9}.bars text{display:block;font-family:Helvetica,Arial;font-size:.85em;text-align:center}.hover\:text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity))}:is(.dark .dark\:bg-gray-600){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-900){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}@media (min-width:640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width:1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width:1536px){.\32xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}} diff --git a/lib/SvelteUi/app/dist/index.js b/lib/SvelteUi/app/dist/index.js index 46ff05c2..b97bb4f3 100644 --- a/lib/SvelteUi/app/dist/index.js +++ b/lib/SvelteUi/app/dist/index.js @@ -1,14 +1,14 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function l(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=l(i);fetch(i.href,o)}})();function _e(){}function sl(t,e){for(const l in e)t[l]=e[l];return t}function tc(t){return t()}function wa(){return Object.create(null)}function Ge(t){t.forEach(tc)}function co(t){return typeof t=="function"}function $e(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ps;function Xs(t,e){return ps||(ps=document.createElement("a")),ps.href=e,t===ps.href}function t0(t){return Object.keys(t).length===0}function mo(t,...e){if(t==null)return _e;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function ri(t){let e;return mo(t,l=>e=l)(),e}function _l(t,e,l){t.$$.on_destroy.push(mo(e,l))}function po(t,e,l,n){if(t){const i=lc(t,e,l,n);return t[0](i)}}function lc(t,e,l,n){return t[1]&&n?sl(l.ctx.slice(),t[1](n(e))):l.ctx}function _o(t,e,l,n){if(t[2]&&n){const i=t[2](n(l));if(e.dirty===void 0)return i;if(typeof i=="object"){const o=[],u=Math.max(e.dirty.length,i.length);for(let a=0;a32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function Ms(t){return function(e){return e.preventDefault(),t.call(this,e)}}function r(t,e,l){l==null?t.removeAttribute(e):t.getAttribute(e)!==l&&t.setAttribute(e,l)}const n0=["width","height"];function ai(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&&n0.indexOf(n)===-1?t[n]=e[n]:r(t,n,e[n])}function he(t){return t===""?null:+t}function i0(t){return Array.from(t.childNodes)}function X(t,e){e=""+e,t.data!==e&&(t.data=e)}function s0(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function o0(t,e,l){~l0.indexOf(l)?s0(t,e):X(t,e)}function ne(t,e){t.value=e==null?"":e}function nc(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function Te(t,e,l){for(let n=0;n{u.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=le(n.contentWindow,"resize",e),e()}),s(t,n),()=>{(i||o&&n.contentWindow)&&o(),w(n)}}function a0(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,l,n,e),i}function ya(t,e){return new t(e)}let Ti;function Ci(t){Ti=t}function Si(){if(!Ti)throw new Error("Function called outside component initialization");return Ti}function sc(t){Si().$$.on_mount.push(t)}function u0(t){Si().$$.on_destroy.push(t)}function f0(){const t=Si();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=a0(e,l,{cancelable:n});return i.slice().forEach(u=>{u.call(t,o)}),!o.defaultPrevented}return!0}}function Mi(t,e){return Si().$$.context.set(t,e),e}function Hl(t){return Si().$$.context.get(t)}const ni=[],ks=[];let ii=[];const Ca=[],oc=Promise.resolve();let Zs=!1;function rc(){Zs||(Zs=!0,oc.then(ac))}function c0(){return rc(),oc}function Ke(t){ii.push(t)}const zs=new Set;let ti=0;function ac(){if(ti!==0)return;const t=Ti;do{try{for(;tit.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),ii=e}const hs=new Set;let rn;function Ie(){rn={r:0,c:[],p:rn}}function Re(){rn.r||Ge(rn.c),rn=rn.p}function R(t,e){t&&t.i&&(hs.delete(t),t.i(e))}function B(t,e,l,n){if(t&&t.o){if(hs.has(t))return;hs.add(t),rn.c.push(()=>{hs.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function uc(t,e){const l={},n={},i={$$scope:1};let o=t.length;for(;o--;){const u=t[o],a=e[o];if(a){for(const c in u)c in a||(n[c]=1);for(const c in a)i[c]||(l[c]=a[c],i[c]=1);t[o]=a}else for(const c in u)i[c]=1}for(const u in n)u in l||(l[u]=void 0);return l}function Ma(t){return typeof t=="object"&&t!==null?t:{}}function re(t){t&&t.c()}function se(t,e,l,n){const{fragment:i,after_update:o}=t.$$;i&&i.m(e,l),n||Ke(()=>{const u=t.$$.on_mount.map(tc).filter(co);t.$$.on_destroy?t.$$.on_destroy.push(...u):Ge(u),t.$$.on_mount=[]}),o.forEach(Ke)}function oe(t,e){const l=t.$$;l.fragment!==null&&(p0(l.after_update),Ge(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function _0(t,e){t.$$.dirty[0]===-1&&(ni.push(t),rc(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const d=v.length?v[0]:h;return f.ctx&&i(f.ctx[_],f.ctx[_]=d)&&(!f.skip_bound&&f.bound[_]&&f.bound[_](d),p&&_0(t,_)),h}):[],f.update(),p=!0,Ge(f.before_update),f.fragment=n?n(f.ctx):!1,e.target){if(e.hydrate){const _=i0(e.target);f.fragment&&f.fragment.l(_),_.forEach(w)}else f.fragment&&f.fragment.c();e.intro&&R(t.$$.fragment),se(t,e.target,e.anchor,e.customElement),ac()}Ci(c)}class De{$destroy(){oe(this,1),this.$destroy=_e}$on(e,l){if(!co(l))return _e;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&&!t0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Ta=t=>typeof t>"u",fc=t=>typeof t=="function",cc=t=>typeof t=="number";function d0(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function mc(){let t=0;return()=>t++}function v0(){return Math.random().toString(36).substring(2)}const Wl=typeof window>"u";function pc(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const _c=(t,e)=>t?{}:{style:e},Js=t=>({"aria-hidden":"true",..._c(t,"display:none;")}),li=[];function dc(t,e){return{subscribe:it(t,e).subscribe}}function it(t,e=_e){let l;const n=new Set;function i(a){if($e(t,a)&&(t=a,l)){const c=!li.length;for(const f of n)f[1](),li.push(f,t);if(c){for(let f=0;f{n.delete(f),n.size===0&&l&&(l(),l=null)}}return{set:i,update:o,subscribe:u}}function h0(t,e,l){const n=!Array.isArray(t),i=n?[t]:t,o=e.length<2;return dc(l,u=>{let a=!1;const c=[];let f=0,p=_e;const _=()=>{if(f)return;p();const v=e(n?c[0]:c,u);o?u(v):p=co(v)?v:_e},h=i.map((v,d)=>mo(v,C=>{c[d]=C,f&=~(1<{f|=1<`@@svnav-ctx__${t}`,xs=$i("LOCATION"),ui=$i("ROUTER"),vc=$i("ROUTE"),b0=$i("ROUTE_PARAMS"),g0=$i("FOCUS_ELEM"),hc=/^:(.+)/,ki=(t,e,l)=>t.substr(e,l),eo=(t,e)=>ki(t,0,e.length)===e,k0=t=>t==="",w0=t=>hc.test(t),bc=t=>t[0]==="*",y0=t=>t.replace(/\*.*$/,""),gc=t=>t.replace(/(^\/+|\/+$)/g,"");function vl(t,e=!1){const l=gc(t).split("/");return e?l.filter(Boolean):l}const Gs=(t,e)=>t+(e?`?${e}`:""),bo=t=>`/${gc(t)}`;function Ni(...t){const e=n=>vl(n,!0).join("/"),l=t.map(e).join("/");return bo(l)}const go=1,Ts=2,mn=3,C0=4,kc=5,M0=6,wc=7,T0=8,S0=9,yc=10,Cc=11,$0={[go]:"Link",[Ts]:"Route",[mn]:"Router",[C0]:"useFocus",[kc]:"useLocation",[M0]:"useMatch",[wc]:"useNavigate",[T0]:"useParams",[S0]:"useResolvable",[yc]:"useResolve",[Cc]:"navigate"},ko=t=>$0[t];function N0(t,e){let l;return t===Ts?l=e.path?`path="${e.path}"`:"default":t===go?l=`to="${e.to}"`:t===mn&&(l=`basepath="${e.basepath||""}"`),`<${ko(t)} ${l||""} />`}function E0(t,e,l,n){const i=l&&N0(n||t,l),o=i?` +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function l(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=l(i);fetch(i.href,o)}})();function _e(){}function sl(t,e){for(const l in e)t[l]=e[l];return t}function ic(t){return t()}function ya(){return Object.create(null)}function Ve(t){t.forEach(ic)}function co(t){return typeof t=="function"}function Ne(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ps;function Xs(t,e){return ps||(ps=document.createElement("a")),ps.href=e,t===ps.href}function n1(t){return Object.keys(t).length===0}function mo(t,...e){if(t==null)return _e;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function ri(t){let e;return mo(t,l=>e=l)(),e}function _l(t,e,l){t.$$.on_destroy.push(mo(e,l))}function po(t,e,l,n){if(t){const i=sc(t,e,l,n);return t[0](i)}}function sc(t,e,l,n){return t[1]&&n?sl(l.ctx.slice(),t[1](n(e))):l.ctx}function _o(t,e,l,n){if(t[2]&&n){const i=t[2](n(l));if(e.dirty===void 0)return i;if(typeof i=="object"){const o=[],u=Math.max(e.dirty.length,i.length);for(let a=0;a32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function Ms(t){return function(e){return e.preventDefault(),t.call(this,e)}}function r(t,e,l){l==null?t.removeAttribute(e):t.getAttribute(e)!==l&&t.setAttribute(e,l)}const s1=["width","height"];function ai(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&&s1.indexOf(n)===-1?t[n]=e[n]:r(t,n,e[n])}function he(t){return t===""?null:+t}function o1(t){return Array.from(t.childNodes)}function X(t,e){e=""+e,t.data!==e&&(t.data=e)}function r1(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function a1(t,e,l){~i1.indexOf(l)?r1(t,e):X(t,e)}function ne(t,e){t.value=e==null?"":e}function oc(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function Se(t,e,l){for(let n=0;n{u.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=le(n.contentWindow,"resize",e),e()}),s(t,n),()=>{(i||o&&n.contentWindow)&&o(),w(n)}}function f1(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,l,n,e),i}function Ca(t,e){return new t(e)}let Si;function Ci(t){Si=t}function Ti(){if(!Si)throw new Error("Function called outside component initialization");return Si}function rc(t){Ti().$$.on_mount.push(t)}function c1(t){Ti().$$.on_destroy.push(t)}function m1(){const t=Ti();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=f1(e,l,{cancelable:n});return i.slice().forEach(u=>{u.call(t,o)}),!o.defaultPrevented}return!0}}function Mi(t,e){return Ti().$$.context.set(t,e),e}function jl(t){return Ti().$$.context.get(t)}const ni=[],ks=[];let ii=[];const Ma=[],ac=Promise.resolve();let Zs=!1;function uc(){Zs||(Zs=!0,ac.then(fc))}function p1(){return uc(),ac}function Ge(t){ii.push(t)}const zs=new Set;let ti=0;function fc(){if(ti!==0)return;const t=Si;do{try{for(;tit.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),ii=e}const hs=new Set;let rn;function Ie(){rn={r:0,c:[],p:rn}}function Re(){rn.r||Ve(rn.c),rn=rn.p}function R(t,e){t&&t.i&&(hs.delete(t),t.i(e))}function B(t,e,l,n){if(t&&t.o){if(hs.has(t))return;hs.add(t),rn.c.push(()=>{hs.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function cc(t,e){const l={},n={},i={$$scope:1};let o=t.length;for(;o--;){const u=t[o],a=e[o];if(a){for(const c in u)c in a||(n[c]=1);for(const c in a)i[c]||(l[c]=a[c],i[c]=1);t[o]=a}else for(const c in u)i[c]=1}for(const u in n)u in l||(l[u]=void 0);return l}function Sa(t){return typeof t=="object"&&t!==null?t:{}}function re(t){t&&t.c()}function se(t,e,l,n){const{fragment:i,after_update:o}=t.$$;i&&i.m(e,l),n||Ge(()=>{const u=t.$$.on_mount.map(ic).filter(co);t.$$.on_destroy?t.$$.on_destroy.push(...u):Ve(u),t.$$.on_mount=[]}),o.forEach(Ge)}function oe(t,e){const l=t.$$;l.fragment!==null&&(d1(l.after_update),Ve(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function v1(t,e){t.$$.dirty[0]===-1&&(ni.push(t),uc(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const d=v.length?v[0]:b;return f.ctx&&i(f.ctx[_],f.ctx[_]=d)&&(!f.skip_bound&&f.bound[_]&&f.bound[_](d),p&&v1(t,_)),b}):[],f.update(),p=!0,Ve(f.before_update),f.fragment=n?n(f.ctx):!1,e.target){if(e.hydrate){const _=o1(e.target);f.fragment&&f.fragment.l(_),_.forEach(w)}else f.fragment&&f.fragment.c();e.intro&&R(t.$$.fragment),se(t,e.target,e.anchor,e.customElement),fc()}Ci(c)}class De{$destroy(){oe(this,1),this.$destroy=_e}$on(e,l){if(!co(l))return _e;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&&!n1(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Ta=t=>typeof t>"u",mc=t=>typeof t=="function",pc=t=>typeof t=="number";function h1(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function _c(){let t=0;return()=>t++}function b1(){return Math.random().toString(36).substring(2)}const Wl=typeof window>"u";function dc(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const vc=(t,e)=>t?{}:{style:e},Js=t=>({"aria-hidden":"true",...vc(t,"display:none;")}),li=[];function hc(t,e){return{subscribe:it(t,e).subscribe}}function it(t,e=_e){let l;const n=new Set;function i(a){if(Ne(t,a)&&(t=a,l)){const c=!li.length;for(const f of n)f[1](),li.push(f,t);if(c){for(let f=0;f{n.delete(f),n.size===0&&l&&(l(),l=null)}}return{set:i,update:o,subscribe:u}}function g1(t,e,l){const n=!Array.isArray(t),i=n?[t]:t,o=e.length<2;return hc(l,u=>{let a=!1;const c=[];let f=0,p=_e;const _=()=>{if(f)return;p();const v=e(n?c[0]:c,u);o?u(v):p=co(v)?v:_e},b=i.map((v,d)=>mo(v,M=>{c[d]=M,f&=~(1<{f|=1<`@@svnav-ctx__${t}`,xs=Ni("LOCATION"),ui=Ni("ROUTER"),bc=Ni("ROUTE"),k1=Ni("ROUTE_PARAMS"),w1=Ni("FOCUS_ELEM"),gc=/^:(.+)/,ki=(t,e,l)=>t.substr(e,l),eo=(t,e)=>ki(t,0,e.length)===e,y1=t=>t==="",C1=t=>gc.test(t),kc=t=>t[0]==="*",M1=t=>t.replace(/\*.*$/,""),wc=t=>t.replace(/(^\/+|\/+$)/g,"");function vl(t,e=!1){const l=wc(t).split("/");return e?l.filter(Boolean):l}const Gs=(t,e)=>t+(e?`?${e}`:""),go=t=>`/${wc(t)}`;function $i(...t){const e=n=>vl(n,!0).join("/"),l=t.map(e).join("/");return go(l)}const ko=1,Ss=2,mn=3,S1=4,yc=5,T1=6,Cc=7,N1=8,$1=9,Mc=10,Sc=11,E1={[ko]:"Link",[Ss]:"Route",[mn]:"Router",[S1]:"useFocus",[yc]:"useLocation",[T1]:"useMatch",[Cc]:"useNavigate",[N1]:"useParams",[$1]:"useResolvable",[Mc]:"useResolve",[Sc]:"navigate"},wo=t=>E1[t];function A1(t,e){let l;return t===Ss?l=e.path?`path="${e.path}"`:"default":t===ko?l=`to="${e.to}"`:t===mn&&(l=`basepath="${e.basepath||""}"`),`<${wo(t)} ${l||""} />`}function P1(t,e,l,n){const i=l&&A1(n||t,l),o=i?` -Occurred in: ${i}`:"",u=ko(t),a=fc(e)?e(u):e;return`<${u}> ${a}${o}`}const Mc=t=>(...e)=>t(E0(...e)),Tc=Mc(t=>{throw new Error(t)}),ws=Mc(console.warn),Sa=4,A0=3,P0=2,D0=1,I0=1;function R0(t,e){const l=t.default?0:vl(t.fullPath).reduce((n,i)=>{let o=n;return o+=Sa,k0(i)?o+=I0:w0(i)?o+=P0:bc(i)?o-=Sa+D0:o+=A0,o},0);return{route:t,score:l,index:e}}function L0(t){return t.map(R0).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function Sc(t,e){let l,n;const[i]=e.split("?"),o=vl(i),u=o[0]==="",a=L0(t);for(let c=0,f=a.length;c({...p,params:h,uri:N});if(p.default){n=v(e);continue}const d=vl(p.fullPath),C=Math.max(o.length,d.length);let M=0;for(;M{f===".."?c.pop():f!=="."&&c.push(f)}),Gs(`/${c.join("/")}`,n)}function $a(t,e){const{pathname:l,hash:n="",search:i="",state:o}=t,u=vl(e,!0),a=vl(l,!0);for(;u.length;)u[0]!==a[0]&&Tc(mn,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),u.shift(),a.shift();return{pathname:Ni(...a),hash:n,search:i,state:o}}const Na=t=>t.length===1?"":t,wo=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,o=i?Na(ki(t,l)):"",u=i?ki(t,0,l):t,a=n?Na(ki(u,e)):"";return{pathname:(n?ki(u,0,e):u)||"/",search:a,hash:o}},F0=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function q0(t,e,l){return Ni(l,O0(t,e))}function B0(t,e){const l=bo(y0(t)),n=vl(l,!0),i=vl(e,!0).slice(0,n.length),o=$c({fullPath:l},Ni(...i));return o&&o.uri}const Vs="POP",U0="PUSH",j0="REPLACE";function Ks(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function H0(t){let e=[],l=Ks(t),n=Vs;const i=(o=e)=>o.forEach(u=>u({location:l,action:n}));return{get location(){return l},listen(o){e.push(o);const u=()=>{l=Ks(t),n=Vs,i([o])};i([o]);const a=pc(t,"popstate",u);return()=>{a(),e=e.filter(c=>c!==o)}},navigate(o,u){const{state:a={},replace:c=!1}=u||{};if(n=c?j0:U0,cc(o))u&&ws(Cc,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=Vs,t.history.go(o);else{const f={...a,_key:v0()};try{t.history[c?"replaceState":"pushState"](f,"",o)}catch{t.location[c?"replace":"assign"](o)}}l=Ks(t),i()}}}function Ys(t,e){return{...wo(e),state:t}}function W0(t="/"){let e=0,l=[Ys(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(Ys(n,o))},replaceState(n,i,o){l[e]=Ys(n,o)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const z0=!!(!Wl&&window.document&&window.document.createElement),G0=!Wl&&window.location.origin==="null",Nc=H0(z0&&!G0?window:W0()),{navigate:si}=Nc;let Sl=null,Ec=!0;function V0(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nSl.level||t.level===Sl.level&&V0(t.routerId,Sl.routerId))&&(Sl=t)}function Y0(){Sl=null}function Q0(){Ec=!1}function Ea(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=pc(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function X0(t,e){return Number(t.dataset.svnavRouteEnd)===e}function Z0(t){return/^H[1-6]$/i.test(t.tagName)}function Aa(t,e=document){return e.querySelector(t)}function J0(t){let l=Aa(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!X0(l,t);){if(Z0(l))return l;const n=Aa("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function x0(t){Promise.resolve(ri(t.focusElement)).then(e=>{const l=e||J0(t.id);l||ws(mn,`Could not find an element to focus. You should always render a header for accessibility reasons, or set a custom focus element via the "useFocus" hook. If you don't want this Route or Router to manage focus, pass "primary={false}" to it.`,t,Ts),!Ea(l)&&Ea(document.documentElement)})}const e1=(t,e,l)=>(n,i)=>c0().then(()=>{if(!Sl||Ec){Q0();return}if(n&&x0(Sl.route),t.announcements&&i){const{path:o,fullPath:u,meta:a,params:c,uri:f}=Sl.route,p=t.createAnnouncement({path:o,fullPath:u,meta:a,params:c,uri:f},ri(l));Promise.resolve(p).then(_=>{e.set(_)})}Y0()}),t1="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 l1(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},_c(t[6],t1)],i={};for(let o=0;o`Navigated to ${x.uri}`,announcements:!0,...d},N=p,T=bo(p),P=Hl(xs),F=Hl(ui),A=!P,I=i1(),D=v&&!(F&&!F.manageFocus),O=it("");_l(t,O,x=>l(0,a=x));const ie=F?F.disableInlineStyles:C,H=it([]);_l(t,H,x=>l(20,u=x));const K=it(null);_l(t,K,x=>l(18,i=x));let G=!1;const Y=A?0:F.level+1,z=A?it((()=>$a(Wl?wo(_):h.location,T))()):P;_l(t,z,x=>l(17,n=x));const Z=it(n);_l(t,Z,x=>l(19,o=x));const V=e1(M,O,z),j=x=>W=>W.filter(U=>U.id!==x);function ee(x){if(Wl){if(G)return;const W=$c(x,n.pathname);if(W)return G=!0,W}else H.update(W=>{const U=j(x.id)(W);return U.push(x),U})}function ue(x){H.update(j(x))}return!A&&p!==Pa&&ws(mn,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:p}),A&&(sc(()=>h.listen(W=>{const U=$a(W.location,T);Z.set(n),z.set(U)})),Mi(xs,z)),Mi(ui,{activeRoute:K,registerRoute:ee,unregisterRoute:ue,manageFocus:D,level:Y,id:I,history:A?h:F.history,basepath:A?T:F.basepath,disableInlineStyles:ie}),t.$$set=x=>{"basepath"in x&&l(11,p=x.basepath),"url"in x&&l(12,_=x.url),"history"in x&&l(13,h=x.history),"primary"in x&&l(14,v=x.primary),"a11y"in x&&l(15,d=x.a11y),"disableInlineStyles"in x&&l(16,C=x.disableInlineStyles),"$$scope"in x&&l(21,f=x.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&p!==N&&ws(mn,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const x=Sc(u,n.pathname);K.set(x)}if(t.$$.dirty[0]&655360&&A){const x=!!n.hash,W=!x&&D,U=!x||n.pathname!==o.pathname;V(W,U)}t.$$.dirty[0]&262144&&D&&i&&i.primary&&K0({level:Y,routerId:I,route:i})},[a,M,A,I,D,O,ie,H,K,z,Z,p,_,h,v,d,C,n,i,o,u,f,c]}class o1 extends De{constructor(e){super(),Pe(this,e,s1,n1,$e,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const Ac=o1;function Ei(t,e,l=ui,n=mn){Hl(l)||Tc(t,o=>`You cannot use ${o} outside of a ${ko(n)}.`,e)}const r1=t=>{const{subscribe:e}=Hl(t);return{subscribe:e}};function Pc(){return Ei(kc),r1(xs)}function Dc(){const{history:t}=Hl(ui);return t}function Ic(){const t=Hl(vc);return t?h0(t,e=>e.base):it("/")}function Rc(){Ei(yc);const t=Ic(),{basepath:e}=Hl(ui);return n=>q0(n,ri(t),e)}function a1(){Ei(wc);const t=Rc(),{navigate:e}=Dc();return(n,i)=>{const o=cc(n)?n:t(n);return e(o,i)}}const u1=t=>({params:t&16,location:t&8}),Da=t=>({params:Wl?ri(t[10]):t[4],location:t[3],navigate:t[11]});function Ia(t){let e,l;return e=new Ac({props:{primary:t[1],$$slots:{default:[m1]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){se(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||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function f1(t){let e;const l=t[18].default,n=po(l,t,t[19],Da);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&524312)&&vo(n,l,i,i[19],e?_o(l,i[19],o,u1):ho(i[19]),Da)},i(i){e||(R(n,i),e=!0)},o(i){B(n,i),e=!1},d(i){n&&n.d(i)}}}function c1(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},Wl?ri(t[10]):t[4],t[12]];var o=t[0];function u(a){let c={};for(let f=0;f{oe(p,1)}),Re()}o?(e=ya(o,u()),re(e.$$.fragment),R(e.$$.fragment,1),se(e,l.parentNode,l)):e=null}else o&&e.$set(f)},i(a){n||(e&&R(e.$$.fragment,a),n=!0)},o(a){e&&B(e.$$.fragment,a),n=!1},d(a){a&&w(l),e&&oe(e,a)}}}function m1(t){let e,l,n,i;const o=[c1,f1],u=[];function a(c,f){return c[0]!==null?0:1}return e=a(t),l=u[e]=o[e](t),{c(){l.c(),n=Ve()},m(c,f){u[e].m(c,f),y(c,n,f),i=!0},p(c,f){let p=e;e=a(c),e===p?u[e].p(c,f):(Ie(),B(u[p],1,1,()=>{u[p]=null}),Re(),l=u[e],l?l.p(c,f):(l=u[e]=o[e](c),l.c()),R(l,1),l.m(n.parentNode,n))},i(c){i||(R(l),i=!0)},o(c){B(l),i=!1},d(c){u[e].d(c),c&&w(n)}}}function p1(t){let e,l,n,i,o,u=[Js(t[7]),{"data-svnav-route-start":t[5]}],a={};for(let _=0;_{c=null}),Re())},i(_){o||(R(c),o=!0)},o(_){B(c),o=!1},d(_){_&&w(e),_&&w(l),c&&c.d(_),_&&w(n),_&&w(i)}}}const _1=mc();function d1(t,e,l){let n;const i=["path","component","meta","primary"];let o=gs(e,i),u,a,c,f,{$$slots:p={},$$scope:_}=e,{path:h=""}=e,{component:v=null}=e,{meta:d={}}=e,{primary:C=!0}=e;Ei(Ts,e);const M=_1(),{registerRoute:N,unregisterRoute:T,activeRoute:P,disableInlineStyles:F}=Hl(ui);_l(t,P,G=>l(16,u=G));const A=Ic();_l(t,A,G=>l(17,c=G));const I=Pc();_l(t,I,G=>l(3,a=G));const D=it(null);let O;const ie=it(),H=it({});_l(t,H,G=>l(4,f=G)),Mi(vc,ie),Mi(b0,H),Mi(g0,D);const K=a1();return Wl||u0(()=>T(M)),t.$$set=G=>{l(24,e=sl(sl({},e),bs(G))),l(12,o=gs(e,i)),"path"in G&&l(13,h=G.path),"component"in G&&l(0,v=G.component),"meta"in G&&l(14,d=G.meta),"primary"in G&&l(1,C=G.primary),"$$scope"in G&&l(19,_=G.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const G=h==="",Y=Ni(c,h),Q={id:M,path:h,meta:d,default:G,fullPath:G?"":Y,base:G?c:B0(Y,a.pathname),primary:C,focusElement:D};ie.set(Q),l(15,O=N(Q))}if(t.$$.dirty&98304&&l(2,n=!!(O||u&&u.id===M)),t.$$.dirty&98308&&n){const{params:G}=O||u;H.set(G)}},e=bs(e),[v,C,n,a,f,M,P,F,A,I,H,K,o,h,d,O,u,c,p,_]}class v1 extends De{constructor(e){super(),Pe(this,e,d1,p1,$e,{path:13,component:0,meta:14,primary:1})}}const Tl=v1;function h1(t){let e,l,n,i;const o=t[13].default,u=po(o,t,t[12],null);let a=[{href:t[0]},t[2],t[1]],c={};for(let f=0;fl(11,_=D));const P=f0(),F=Rc(),{navigate:A}=Dc();function I(D){P("click",D),d0(D)&&(D.preventDefault(),A(n,{state:M,replace:u||C}))}return t.$$set=D=>{l(19,e=sl(sl({},e),bs(D))),l(18,p=gs(e,f)),"to"in D&&l(5,d=D.to),"replace"in D&&l(6,C=D.replace),"state"in D&&l(7,M=D.state),"getProps"in D&&l(8,N=D.getProps),"$$scope"in D&&l(12,v=D.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=F(d,_)),t.$$.dirty&2049&&l(10,i=eo(_.pathname,n)),t.$$.dirty&2049&&l(9,o=n===_.pathname),t.$$.dirty&2049&&(u=wo(n)===F0(_)),t.$$.dirty&512&&l(2,a=o?{"aria-current":"page"}:{}),l(1,c=(()=>{if(fc(N)){const D=N({location:_,href:n,isPartiallyCurrent:i,isCurrent:o});return{...p,...D}}return p})())},e=bs(e),[n,c,a,T,I,d,C,M,N,o,i,_,v,h]}class g1 extends De{constructor(e){super(),Pe(this,e,b1,h1,$e,{to:5,replace:6,state:7,getProps:8})}}const ol=g1;let to=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function jl(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function k1(t){return t>218&&t<242?"#32d900":t>212&&t<248?"#b1d900":t>208&&t<252?"#ffb800":"#d90000"}function Lc(t){return t>90?"#d90000":t>85?"#e32100":t>80?"#ffb800":t>75?"#dcd800":"#32d900"}function w1(t){return t>75?"#32d900":t>50?"#77d900":t>25?"#94d900":"#dcd800"}function ys(t){switch(t){case 1:return"Aidon";case 2:return"Kaifa";case 3:return"Kamstrup";case 8:return"Iskra";case 9:return"Landis+Gyr";case 10:return"Sagemcom";default:return"Unknown"}}function Fe(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function ve(t,e){switch(e){case 5:switch(t){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(t){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 241:return"LilyGO T-ETH-POE";case 242:return"M5 PoESP32";case 243:return"WT32-ETH01";case 200:return"Generic ESP32";case 2:return"HAN Reader 2.0 by Max Spencer";case 0:return"Custom hardware by Roar Fredriksen";case 1:return"Kamstrup module by Egil Opsahl";case 8:return"\xB5HAN mosquito by dbeinder";case 3:return"Pow-K (UART0)";case 4:return"Pow-U (UART0)";case 101:return"Wemos D1 mini";case 100:return"Generic ESP8266";case 70:return"Generic ESP32-C3";case 71:return"ESP32-C3-DevKitM-1"}}function Ra(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 La(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 Oa(t){switch(t){case 400:return"Unrecognized data in request";case 401:case 403:return"Unauthorized, check API key";case 404:return"Price unavailable, not found";case 425:return"Server says its too early";case 429:return"Exceeded API rate limit";case 500:return"Internal server error";case-1:return"Connection error";case-2:return"Incomplete data received";case-3:return"Invalid data, tag missing";case-51:return"Authentication failed";case-52:return"Decryption failed";case-53:return"Encryption key invalid"}return t<0?"Unspecified error "+t:""}function oi(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Qe(t,e){return t==1||t==2&&e}function Ut(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function be(t,e){return isNaN(t)?"-":(isNaN(e)&&(e=t<10?1:0),t.toFixed(e))}function dl(t,e){return t.setTime(t.getTime()+e*36e5),t}function Fa(t){if(t.chip=="esp8266")switch(t.boot_reason){case 0:return"Normal";case 1:return"WDT reset";case 2:return"Exception reset";case 3:return"Soft WDT reset";case 4:return"Software restart";case 5:return"Deep sleep";case 6:return"External reset";default:return"Unknown (8266)"}else switch(t.boot_reason){case 1:return"Vbat power on reset";case 3:return"Software reset";case 4:return"WDT reset";case 5:return"Deep sleep";case 6:return"SLC reset";case 7:return"Timer Group0 WDT reset";case 8:return"Timer Group1 WDT reset";case 9:return"RTC WDT reset";case 10:return"Instrusion test reset CPU";case 11:return"Time Group reset CPU";case 12:return"Software reset CPU";case 13:return"RTC WTD reset CPU";case 14:return"PRO CPU";case 15:return"Brownout";case 16:return"RTC reset";default:return"Unknown"}}function qa(t){return t=="EOE"?"ENTSO-E":t=="HKS"?"hvakosterstrommen.no":t=="EDS"?"Energy Data Service":t=="MIX"?"Mixed sources":"Unknown ("+t+")"}async function $l(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 pl={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 Yt=it(pl);async function yo(){pl=await(await $l("/sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),Yt.set(pl)}let ds=0,Ba=-127,Ua=null,y1={};const Oc=dc(y1,t=>{let e;async function l(){$l("/data.json").then(n=>n.json()).then(n=>{t(n),Ba!=n.t&&(Ba=n.t,setTimeout(jc,2e3)),Ua==null&&n.pe&&n.p!=null&&(Ua=n.p,qc()),pl.upgrading?window.location.reload():(!pl||!pl.chip||pl.booting||ds>1&&!oi(pl.board))&&(yo(),an&&clearTimeout(an),an=setTimeout(Mo,2e3),un&&clearTimeout(un),un=setTimeout(To,3e3));let i=5e3;if(oi(pl.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),ds=0}).catch(n=>{ds++,ds>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(l,15e3)):e=setTimeout(l,oi(pl.board)?1e4:5e3)})}return l(),function(){clearTimeout(e)}});let lo={},wi;const Co=it(lo);async function Fc(){let t=!1;if(Co.update(e=>{for(var l=0;l<36;l++){if(e[Fe(l)]==null){t=l<12;break}e[Fe(l)]=e[Fe(l+1)]}return e}),t)qc();else{let e=new Date;wi=setTimeout(Fc,(60-e.getMinutes())*6e4)}}async function qc(){wi&&(clearTimeout(wi),wi=0),lo=await(await $l("/energyprice.json")).json(),Co.set(lo);let e=new Date;wi=setTimeout(Fc,(60-e.getMinutes())*6e4)}let no={},an;async function Mo(){an&&(clearTimeout(an),an=0),no=await(await $l("/dayplot.json")).json(),Bc.set(no);let e=new Date;an=setTimeout(Mo,(60-e.getMinutes())*6e4+20)}const Bc=it(no,t=>(Mo(),function(){}));let io={},un;async function To(){un&&(clearTimeout(un),un=0),io=await(await $l("/monthplot.json")).json(),Uc.set(io);let e=new Date;un=setTimeout(To,(24-e.getHours())*36e5+40)}const Uc=it(io,t=>(To(),function(){}));let so={};async function jc(){so=await(await $l("/temperature.json")).json(),Hc.set(so)}const Hc=it(so,t=>(jc(),function(){}));let oo={},vs;async function Wc(){vs&&(clearTimeout(vs),vs=0),oo=await(await $l("/tariff.json")).json(),zc.set(oo);let e=new Date;vs=setTimeout(Wc,(60-e.getMinutes())*6e4+30)}const zc=it(oo,t=>function(){});let ro=[];const So=it(ro);async function C1(){ro=await(await $l("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),So.set(ro)}let ao={};async function M1(){ao=await(await $l("/realtime.json")).json(),Gc.set(ao)}const Gc=it(ao,t=>(M1(),function(){}));function Cs(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 Vc(t){await(await fetch("/upgrade?expected_version="+t,{method:"POST"})).json()}function Kc(t,e){if(/^v\d{1,2}\.\d{1,2}\.\d{1,2}$/.test(t)){let l=t.substring(1).split("."),n=parseInt(l[0]),i=parseInt(l[1]),o=parseInt(l[2]),u=[...e];u.reverse();let a,c,f;for(let p=0;po&&(a=_):C==i+1&&(c=_);else if(d==n+1)if(f){let N=f.tag_name.substring(1).split(".");parseInt(N[0]);let T=parseInt(N[1]);parseInt(N[2]),C==T&&(f=_)}else f=_}return c||f||a||!1}else return e[0]}const T1="/github.svg";function ja(t){let e,l;function n(u,a){return u[1]>1?D1:u[1]>0?P1:u[2]>1?A1:u[2]>0?E1:u[3]>1?N1:u[3]>0?$1:S1}let i=n(t),o=i(t);return{c(){e=$(`Up - `),o.c(),l=Ve()},m(u,a){y(u,e,a),o.m(u,a),y(u,l,a)},p(u,a){i===(i=n(u))&&o?o.p(u,a):(o.d(1),o=i(u),o&&(o.c(),o.m(l.parentNode,l)))},d(u){u&&w(e),o.d(u),u&&w(l)}}}function S1(t){let e,l;return{c(){e=$(t[0]),l=$(" seconds")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&1&&X(e,n[0])},d(n){n&&w(e),n&&w(l)}}}function $1(t){let e,l;return{c(){e=$(t[3]),l=$(" minute")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&8&&X(e,n[3])},d(n){n&&w(e),n&&w(l)}}}function N1(t){let e,l;return{c(){e=$(t[3]),l=$(" minutes")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&8&&X(e,n[3])},d(n){n&&w(e),n&&w(l)}}}function E1(t){let e,l;return{c(){e=$(t[2]),l=$(" hour")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&4&&X(e,n[2])},d(n){n&&w(e),n&&w(l)}}}function A1(t){let e,l;return{c(){e=$(t[2]),l=$(" hours")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&4&&X(e,n[2])},d(n){n&&w(e),n&&w(l)}}}function P1(t){let e,l;return{c(){e=$(t[1]),l=$(" day")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&2&&X(e,n[1])},d(n){n&&w(e),n&&w(l)}}}function D1(t){let e,l;return{c(){e=$(t[1]),l=$(" days")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&2&&X(e,n[1])},d(n){n&&w(e),n&&w(l)}}}function I1(t){let e,l=t[0]&&ja(t);return{c(){l&&l.c(),e=Ve()},m(n,i){l&&l.m(n,i),y(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:_e,o:_e,d(n){l&&l.d(n),n&&w(e)}}}function R1(t,e,l){let{epoch:n}=e,i=0,o=0,u=0;return t.$$set=a=>{"epoch"in a&&l(0,n=a.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(1,i=Math.floor(n/86400)),l(2,o=Math.floor(n/3600)),l(3,u=Math.floor(n/60)))},[n,i,o,u]}class L1 extends De{constructor(e){super(),Pe(this,e,R1,I1,$e,{epoch:0})}}function O1(t){let e,l,n;return{c(){e=m("span"),l=$(t[2]),r(e,"title",t[1]),r(e,"class",n="bd-"+t[0])},m(i,o){y(i,e,o),s(e,l)},p(i,[o]){o&4&&X(l,i[2]),o&2&&r(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&r(e,"class",n)},i:_e,o:_e,d(i){i&&w(e)}}}function F1(t,e,l){let{color:n}=e,{title:i}=e,{text:o}=e;return t.$$set=u=>{"color"in u&&l(0,n=u.color),"title"in u&&l(1,i=u.title),"text"in u&&l(2,o=u.text)},[n,i,o]}class fn extends De{constructor(e){super(),Pe(this,e,F1,O1,$e,{color:0,title:1,text:2})}}function q1(t){let e,l=`${Fe(t[0].getDate())}.${Fe(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Fe(t[0].getHours())}:${Fe(t[0].getMinutes())}`,n;return{c(){e=m("span"),n=$(l),r(e,"class",t[1])},m(i,o){y(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${Fe(i[0].getDate())}.${Fe(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Fe(i[0].getHours())}:${Fe(i[0].getMinutes())}`)&&X(n,l),o&2&&r(e,"class",i[1])},d(i){i&&w(e)}}}function B1(t){let e=`${Fe(t[0].getDate())}. ${to[t[0].getMonth()]} ${Fe(t[0].getHours())}:${Fe(t[0].getMinutes())}`,l;return{c(){l=$(e)},m(n,i){y(n,l,i)},p(n,i){i&1&&e!==(e=`${Fe(n[0].getDate())}. ${to[n[0].getMonth()]} ${Fe(n[0].getHours())}:${Fe(n[0].getMinutes())}`)&&X(l,e)},d(n){n&&w(l)}}}function U1(t){let e;function l(o,u){return o[2]?B1:q1}let n=l(t),i=n(t);return{c(){i.c(),e=Ve()},m(o,u){i.m(o,u),y(o,e,u)},p(o,[u]){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:_e,o:_e,d(o){i.d(o),o&&w(e)}}}function j1(t,e,l){let{timestamp:n}=e,{fullTimeColor:i}=e,{offset:o}=e,u;return t.$$set=a=>{"timestamp"in a&&l(0,n=a.timestamp),"fullTimeColor"in a&&l(1,i=a.fullTimeColor),"offset"in a&&l(3,o=a.offset)},t.$$.update=()=>{t.$$.dirty&9&&(l(2,u=Math.abs(new Date().getTime()-n.getTime())<3e5),isNaN(o)||dl(n,o-(24+n.getHours()-n.getUTCHours())%24))},[n,i,u,o]}class Yc extends De{constructor(e){super(),Pe(this,e,j1,U1,$e,{timestamp:0,fullTimeColor:1,offset:3})}}function H1(t){let e,l,n;return{c(){e=Se("svg"),l=Se("path"),n=Se("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z"),r(n,"stroke-linecap","round"),r(n,"stroke-linejoin","round"),r(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(i,o){y(i,e,o),s(e,l),s(e,n)},p:_e,i:_e,o:_e,d(i){i&&w(e)}}}class W1 extends De{constructor(e){super(),Pe(this,e,null,H1,$e,{})}}function z1(t){let e,l;return{c(){e=Se("svg"),l=Se("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){y(n,e,i),s(e,l)},p:_e,i:_e,o:_e,d(n){n&&w(e)}}}class G1 extends De{constructor(e){super(),Pe(this,e,null,z1,$e,{})}}function V1(t){let e,l;return{c(){e=Se("svg"),l=Se("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){y(n,e,i),s(e,l)},p:_e,i:_e,o:_e,d(n){n&&w(e)}}}class Bt extends De{constructor(e){super(),Pe(this,e,null,V1,$e,{})}}function K1(t){let e,l;return{c(){e=Se("svg"),l=Se("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9 8.25H7.5a2.25 2.25 0 00-2.25 2.25v9a2.25 2.25 0 002.25 2.25h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25H15M9 12l3 3m0 0l3-3m-3 3V2.25"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){y(n,e,i),s(e,l)},p:_e,i:_e,o:_e,d(n){n&&w(e)}}}class Qc extends De{constructor(e){super(),Pe(this,e,null,K1,$e,{})}}function Y1(t){let e,l,n=t[1].version+"",i;return{c(){e=$("AMS reader "),l=m("span"),i=$(n)},m(o,u){y(o,e,u),y(o,l,u),s(l,i)},p(o,u){u&2&&n!==(n=o[1].version+"")&&X(i,n)},d(o){o&&w(e),o&&w(l)}}}function Ha(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=m("div"),n=$(l),i=$("\xB0C"),r(e,"class","flex-none my-auto")},m(o,u){y(o,e,u),s(e,n),s(e,i)},p(o,u){u&1&&l!==(l=(o[0].t>-50?o[0].t.toFixed(1):"-")+"")&&X(n,l)},d(o){o&&w(e)}}}function Wa(t){let e,l="HAN: "+Ra(t[0].he),n;return{c(){e=m("div"),n=$(l),r(e,"class","bd-red")},m(i,o){y(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="HAN: "+Ra(i[0].he))&&X(n,l)},d(i){i&&w(e)}}}function za(t){let e,l="MQTT: "+La(t[0].me),n;return{c(){e=m("div"),n=$(l),r(e,"class","bd-red")},m(i,o){y(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="MQTT: "+La(i[0].me))&&X(n,l)},d(i){i&&w(e)}}}function Ga(t){let e,l="Pricps: "+Oa(t[0].ee),n;return{c(){e=m("div"),n=$(l),r(e,"class","bd-red")},m(i,o){y(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="Pricps: "+Oa(i[0].ee))&&X(n,l)},d(i){i&&w(e)}}}function Va(t){let e,l,n,i,o,u;return l=new ol({props:{to:"/configuration",$$slots:{default:[Q1]},$$scope:{ctx:t}}}),o=new ol({props:{to:"/status",$$slots:{default:[X1]},$$scope:{ctx:t}}}),{c(){e=m("div"),re(l.$$.fragment),n=b(),i=m("div"),re(o.$$.fragment),r(e,"class","flex-none px-1 mt-1"),r(e,"title","Configuration"),r(i,"class","flex-none px-1 mt-1"),r(i,"title","Device information")},m(a,c){y(a,e,c),se(l,e,null),y(a,n,c),y(a,i,c),se(o,i,null),u=!0},i(a){u||(R(l.$$.fragment,a),R(o.$$.fragment,a),u=!0)},o(a){B(l.$$.fragment,a),B(o.$$.fragment,a),u=!1},d(a){a&&w(e),oe(l),a&&w(n),a&&w(i),oe(o)}}}function Q1(t){let e,l;return e=new W1({}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function X1(t){let e,l;return e=new G1({}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function Ka(t){let e,l,n,i,o;const u=[J1,Z1],a=[];function c(f,p){return f[1].security==0||f[0].a?0:1}return l=c(t),n=a[l]=u[l](t),{c(){e=m("div"),n.c(),r(e,"class","flex-none mr-3 text-yellow-500"),r(e,"title",i="New version: "+t[2].tag_name)},m(f,p){y(f,e,p),a[l].m(e,null),o=!0},p(f,p){let _=l;l=c(f),l===_?a[l].p(f,p):(Ie(),B(a[_],1,1,()=>{a[_]=null}),Re(),n=a[l],n?n.p(f,p):(n=a[l]=u[l](f),n.c()),R(n,1),n.m(e,null)),(!o||p&4&&i!==(i="New version: "+f[2].tag_name))&&r(e,"title",i)},i(f){o||(R(n),o=!0)},o(f){B(n),o=!1},d(f){f&&w(e),a[l].d()}}}function Z1(t){let e,l,n=t[2].tag_name+"",i;return{c(){e=m("span"),l=$("New version: "),i=$(n)},m(o,u){y(o,e,u),s(e,l),s(e,i)},p(o,u){u&4&&n!==(n=o[2].tag_name+"")&&X(i,n)},i:_e,o:_e,d(o){o&&w(e)}}}function J1(t){let e,l,n,i=t[2].tag_name+"",o,u,a,c,f,p;return a=new Qc({}),{c(){e=m("button"),l=m("span"),n=$("New version: "),o=$(i),u=b(),re(a.$$.fragment),r(l,"class","mt-1"),r(e,"class","flex")},m(_,h){y(_,e,h),s(e,l),s(l,n),s(l,o),s(e,u),se(a,e,null),c=!0,f||(p=le(e,"click",t[3]),f=!0)},p(_,h){(!c||h&4)&&i!==(i=_[2].tag_name+"")&&X(o,i)},i(_){c||(R(a.$$.fragment,_),c=!0)},o(_){B(a.$$.fragment,_),c=!1},d(_){_&&w(e),oe(a),f=!1,p()}}}function x1(t){let e,l,n,i,o,u,a,c,f,p,_,h,v=(t[0].m?(t[0].m/1e3).toFixed(1):"-")+"",d,C,M,N,T,P,F,A,I,D,O,ie,H,K,G,Y,Q,z,Z,V,j,ee,ue,x,W,U,ke,He,Be,We;i=new ol({props:{to:"/",$$slots:{default:[Y1]},$$scope:{ctx:t}}}),c=new L1({props:{epoch:t[0].u}});let Ne=t[0].t>-50&&Ha(t);T=new fn({props:{title:"ESP",text:t[1].booting?"Booting":t[0].v>2?t[0].v.toFixed(2)+"V":"ESP",color:jl(t[1].booting?2:t[0].em)}}),F=new fn({props:{title:"HAN",text:"HAN",color:jl(t[1].booting?9:t[0].hm)}}),I=new fn({props:{title:"WiFi",text:t[0].r?t[0].r.toFixed(0)+"dBm":"WiFi",color:jl(t[1].booting?9:t[0].wm)}}),O=new fn({props:{title:"MQTT",text:"MQTT",color:jl(t[1].booting?9:t[0].mm)}});let ge=(t[0].he<0||t[0].he>0)&&Wa(t),Le=t[0].me<0&&za(t),Me=(t[0].ee>0||t[0].ee<0)&&Ga(t);ue=new Yc({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),offset:t[1].clock_offset,fullTimeColor:"text-red-500"}});let S=t[1].vndcfg&&t[1].usrcfg&&Va(t);He=new Bt({});let g=t[1].fwconsent===1&&t[2]&&Ka(t);return{c(){e=m("nav"),l=m("div"),n=m("div"),re(i.$$.fragment),o=b(),u=m("div"),a=m("div"),re(c.$$.fragment),f=b(),Ne&&Ne.c(),p=b(),_=m("div"),h=$("Free mem: "),d=$(v),C=$("kb"),M=b(),N=m("div"),re(T.$$.fragment),P=b(),re(F.$$.fragment),A=b(),re(I.$$.fragment),D=b(),re(O.$$.fragment),ie=b(),ge&&ge.c(),H=b(),Le&&Le.c(),K=b(),Me&&Me.c(),G=b(),Y=m("div"),Q=m("div"),z=m("a"),Z=m("img"),j=b(),ee=m("div"),re(ue.$$.fragment),x=b(),S&&S.c(),W=b(),U=m("div"),ke=m("a"),re(He.$$.fragment),Be=b(),g&&g.c(),r(n,"class","flex text-lg text-gray-100 p-2"),r(a,"class","flex-none my-auto"),r(_,"class","flex-none my-auto"),r(u,"class","flex-none my-auto p-2 flex space-x-4"),r(N,"class","flex-auto flex-wrap my-auto justify-center p-2"),r(Z,"class","gh-logo"),Xs(Z.src,V=T1)||r(Z,"src",V),r(Z,"alt","GitHub repo"),r(z,"class","float-right"),r(z,"href","https://github.com/UtilitechAS/amsreader-firmware"),r(z,"target","_blank"),r(z,"rel","noreferrer"),r(z,"aria-label","GitHub"),r(Q,"class","flex-none"),r(ee,"class","flex-none my-auto px-2"),r(ke,"href",Ut("")),r(ke,"target","_blank"),r(ke,"rel","noreferrer"),r(U,"class","flex-none px-1 mt-1"),r(U,"title","Documentation"),r(Y,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),r(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),r(e,"class","bg-violet-600 p-1 rounded-md mx-2")},m(k,E){y(k,e,E),s(e,l),s(l,n),se(i,n,null),s(l,o),s(l,u),s(u,a),se(c,a,null),s(u,f),Ne&&Ne.m(u,null),s(u,p),s(u,_),s(_,h),s(_,d),s(_,C),s(l,M),s(l,N),se(T,N,null),s(N,P),se(F,N,null),s(N,A),se(I,N,null),s(N,D),se(O,N,null),s(l,ie),ge&&ge.m(l,null),s(l,H),Le&&Le.m(l,null),s(l,K),Me&&Me.m(l,null),s(l,G),s(l,Y),s(Y,Q),s(Q,z),s(z,Z),s(Y,j),s(Y,ee),se(ue,ee,null),s(Y,x),S&&S.m(Y,null),s(Y,W),s(Y,U),s(U,ke),se(He,ke,null),s(Y,Be),g&&g.m(Y,null),We=!0},p(k,[E]){const L={};E&18&&(L.$$scope={dirty:E,ctx:k}),i.$set(L);const J={};E&1&&(J.epoch=k[0].u),c.$set(J),k[0].t>-50?Ne?Ne.p(k,E):(Ne=Ha(k),Ne.c(),Ne.m(u,p)):Ne&&(Ne.d(1),Ne=null),(!We||E&1)&&v!==(v=(k[0].m?(k[0].m/1e3).toFixed(1):"-")+"")&&X(d,v);const te={};E&3&&(te.text=k[1].booting?"Booting":k[0].v>2?k[0].v.toFixed(2)+"V":"ESP"),E&3&&(te.color=jl(k[1].booting?2:k[0].em)),T.$set(te);const fe={};E&3&&(fe.color=jl(k[1].booting?9:k[0].hm)),F.$set(fe);const de={};E&1&&(de.text=k[0].r?k[0].r.toFixed(0)+"dBm":"WiFi"),E&3&&(de.color=jl(k[1].booting?9:k[0].wm)),I.$set(de);const we={};E&3&&(we.color=jl(k[1].booting?9:k[0].mm)),O.$set(we),k[0].he<0||k[0].he>0?ge?ge.p(k,E):(ge=Wa(k),ge.c(),ge.m(l,H)):ge&&(ge.d(1),ge=null),k[0].me<0?Le?Le.p(k,E):(Le=za(k),Le.c(),Le.m(l,K)):Le&&(Le.d(1),Le=null),k[0].ee>0||k[0].ee<0?Me?Me.p(k,E):(Me=Ga(k),Me.c(),Me.m(l,G)):Me&&(Me.d(1),Me=null);const Ee={};E&1&&(Ee.timestamp=k[0].c?new Date(k[0].c*1e3):new Date(0)),E&2&&(Ee.offset=k[1].clock_offset),ue.$set(Ee),k[1].vndcfg&&k[1].usrcfg?S?E&2&&R(S,1):(S=Va(k),S.c(),R(S,1),S.m(Y,W)):S&&(Ie(),B(S,1,1,()=>{S=null}),Re()),k[1].fwconsent===1&&k[2]?g?(g.p(k,E),E&6&&R(g,1)):(g=Ka(k),g.c(),R(g,1),g.m(Y,null)):g&&(Ie(),B(g,1,1,()=>{g=null}),Re())},i(k){We||(R(i.$$.fragment,k),R(c.$$.fragment,k),R(T.$$.fragment,k),R(F.$$.fragment,k),R(I.$$.fragment,k),R(O.$$.fragment,k),R(ue.$$.fragment,k),R(S),R(He.$$.fragment,k),R(g),We=!0)},o(k){B(i.$$.fragment,k),B(c.$$.fragment,k),B(T.$$.fragment,k),B(F.$$.fragment,k),B(I.$$.fragment,k),B(O.$$.fragment,k),B(ue.$$.fragment,k),B(S),B(He.$$.fragment,k),B(g),We=!1},d(k){k&&w(e),oe(i),oe(c),Ne&&Ne.d(),oe(T),oe(F),oe(I),oe(O),ge&&ge.d(),Le&&Le.d(),Me&&Me.d(),oe(ue),S&&S.d(),oe(He),g&&g.d()}}}function em(t,e,l){let{data:n={}}=e,i={},o={};function u(){confirm("Do you want to upgrade this device to "+o.tag_name+"?")&&(!oi(i.board)||confirm(Cs(ve(i.chip,i.board))))&&(Yt.update(a=>(a.upgrading=!0,a)),Vc(o.tag_name))}return Yt.subscribe(a=>{l(1,i=a),a.fwconsent===1&&C1()}),So.subscribe(a=>{l(2,o=Kc(i.version,a))}),t.$$set=a=>{"data"in a&&l(0,n=a.data)},[n,i,o,u]}class tm extends De{constructor(e){super(),Pe(this,e,em,x1,$e,{data:0})}}function lm(t){let e,l,n,i;return{c(){e=Se("svg"),l=Se("path"),n=Se("path"),r(l,"d",Qs(150,150,115,210,510)),r(l,"stroke","rgba(128, 128, 128, 0.15)"),r(l,"fill","none"),r(l,"stroke-width","55"),r(n,"d",i=Qs(150,150,115,210,210+300*t[0]/100)),r(n,"stroke",t[1]),r(n,"fill","none"),r(n,"stroke-width","55"),r(e,"viewBox","0 0 300 300"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"height","100%")},m(o,u){y(o,e,u),s(e,l),s(e,n)},p(o,[u]){u&1&&i!==(i=Qs(150,150,115,210,210+300*o[0]/100))&&r(n,"d",i),u&2&&r(n,"stroke",o[1])},i:_e,o:_e,d(o){o&&w(e)}}}function Ya(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 Qs(t,e,l,n,i){var o=Ya(t,e,l,i),u=Ya(t,e,l,n),a=i-n<=180?"0":"1",c=["M",o.x,o.y,"A",l,l,0,a,0,u.x,u.y].join(" ");return c}function nm(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 im extends De{constructor(e){super(),Pe(this,e,nm,lm,$e,{pct:0,color:1})}}function Qa(t){let e,l,n,i,o,u,a,c;return{c(){e=m("br"),l=b(),n=m("span"),i=$(t[3]),o=b(),u=m("span"),a=$(t[4]),c=$("/kWh"),r(n,"class","pl-sub"),r(u,"class","pl-snt")},m(f,p){y(f,e,p),y(f,l,p),y(f,n,p),s(n,i),y(f,o,p),y(f,u,p),s(u,a),s(u,c)},p(f,p){p&8&&X(i,f[3]),p&16&&X(a,f[4])},d(f){f&&w(e),f&&w(l),f&&w(n),f&&w(o),f&&w(u)}}}function sm(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M;l=new im({props:{pct:t[6],color:t[5](t[6])}});let N=t[3]&&Qa(t);return{c(){e=m("div"),re(l.$$.fragment),n=b(),i=m("span"),o=m("span"),u=$(t[2]),a=b(),c=m("br"),f=b(),p=m("span"),_=$(t[0]),h=b(),v=m("span"),d=$(t[1]),C=b(),N&&N.c(),r(o,"class","pl-lab"),r(p,"class","pl-val"),r(v,"class","pl-unt"),r(i,"class","pl-ov"),r(e,"class","pl-root")},m(T,P){y(T,e,P),se(l,e,null),s(e,n),s(e,i),s(i,o),s(o,u),s(i,a),s(i,c),s(i,f),s(i,p),s(p,_),s(i,h),s(i,v),s(v,d),s(i,C),N&&N.m(i,null),M=!0},p(T,[P]){const F={};P&64&&(F.pct=T[6]),P&96&&(F.color=T[5](T[6])),l.$set(F),(!M||P&4)&&X(u,T[2]),(!M||P&1)&&X(_,T[0]),(!M||P&2)&&X(d,T[1]),T[3]?N?N.p(T,P):(N=Qa(T),N.c(),N.m(i,null)):N&&(N.d(1),N=null)},i(T){M||(R(l.$$.fragment,T),M=!0)},o(T){B(l.$$.fragment,T),M=!1},d(T){T&&w(e),oe(l),N&&N.d()}}}function om(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:u}=e,{sub:a=""}=e,{subunit:c=""}=e,{colorFn:f}=e,p=0;return t.$$set=_=>{"val"in _&&l(0,n=_.val),"max"in _&&l(7,i=_.max),"unit"in _&&l(1,o=_.unit),"label"in _&&l(2,u=_.label),"sub"in _&&l(3,a=_.sub),"subunit"in _&&l(4,c=_.subunit),"colorFn"in _&&l(5,f=_.colorFn)},t.$$.update=()=>{t.$$.dirty&129&&l(6,p=Math.min(n,i)/i*100)},[n,o,u,a,c,f,p,i]}class Xc extends De{constructor(e){super(),Pe(this,e,om,sm,$e,{val:0,max:7,unit:1,label:2,sub:3,subunit:4,colorFn:5})}}function Xa(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function Za(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function Ja(t,e,l){const n=t.slice();return n[13]=e[l],n}function xa(t){let e,l,n,i,o,u,a=t[0].title&&eu(t),c=t[0].y.ticks,f=[];for(let d=0;d20||t[11]%2==0)&&iu(t);return{c(){e=Se("g"),n&&n.c(),r(e,"class","tick"),r(e,"transform",l="translate("+t[5](t[11])+","+t[4]+")")},m(i,o){y(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[11]%2==0?n?n.p(i,o):(n=iu(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&48&&l!==(l="translate("+i[5](i[11])+","+i[4]+")")&&r(e,"transform",l)},d(i){i&&w(e),n&&n.d()}}}function iu(t){let e,l=t[9].label+"",n,i;return{c(){e=Se("text"),n=$(l),r(e,"x",i=t[3]/2),r(e,"y","-4")},m(o,u){y(o,e,u),s(e,n)},p(o,u){u&1&&l!==(l=o[9].label+"")&&X(n,l),u&8&&i!==(i=o[3]/2)&&r(e,"x",i)},d(o){o&&w(e)}}}function su(t){let e=!isNaN(t[5](t[11])),l,n=e&&nu(t);return{c(){n&&n.c(),l=Ve()},m(i,o){n&&n.m(i,o),y(i,l,o)},p(i,o){o&32&&(e=!isNaN(i[5](i[11]))),e?n?n.p(i,o):(n=nu(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&w(l)}}}function ou(t){let e,l,n=t[9].value!==void 0&&ru(t),i=t[9].value2>1e-4&&fu(t);return{c(){e=Se("g"),n&&n.c(),l=Se("g"),i&&i.c()},m(o,u){y(o,e,u),n&&n.m(e,null),y(o,l,u),i&&i.m(l,null)},p(o,u){o[9].value!==void 0?n?n.p(o,u):(n=ru(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[9].value2>1e-4?i?i.p(o,u):(i=fu(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&w(e),n&&n.d(),o&&w(l),i&&i.d()}}}function ru(t){let e,l,n,i,o,u,a,c=t[3]>15&&au(t);return{c(){e=Se("rect"),c&&c.c(),a=Ve(),r(e,"x",l=t[5](t[11])+2),r(e,"y",n=t[6](t[9].value)),r(e,"width",i=t[3]-4),r(e,"height",o=t[6](t[0].y.min)-t[6](Math.min(t[0].y.min,0)+t[9].value)),r(e,"fill",u=t[9].color)},m(f,p){y(f,e,p),c&&c.m(f,p),y(f,a,p)},p(f,p){p&32&&l!==(l=f[5](f[11])+2)&&r(e,"x",l),p&65&&n!==(n=f[6](f[9].value))&&r(e,"y",n),p&8&&i!==(i=f[3]-4)&&r(e,"width",i),p&65&&o!==(o=f[6](f[0].y.min)-f[6](Math.min(f[0].y.min,0)+f[9].value))&&r(e,"height",o),p&1&&u!==(u=f[9].color)&&r(e,"fill",u),f[3]>15?c?c.p(f,p):(c=au(f),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(f){f&&w(e),c&&c.d(f),f&&w(a)}}}function au(t){let e,l=t[9].label+"",n,i,o,u,a,c,f=t[9].title&&uu(t);return{c(){e=Se("text"),n=$(l),f&&f.c(),c=Ve(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor",o=t[3]t[6](0)-t[7]?t[9].color:"white"),r(e,"transform",a="translate("+(t[5](t[11])+t[3]/2)+" "+(t[6](t[9].value)>t[6](0)-t[7]?t[6](t[9].value)-t[7]:t[6](t[9].value)+10)+") rotate("+(t[3]p[6](0)-p[7]?p[9].color:"white")&&r(e,"fill",u),_&233&&a!==(a="translate("+(p[5](p[11])+p[3]/2)+" "+(p[6](p[9].value)>p[6](0)-p[7]?p[6](p[9].value)-p[7]:p[6](p[9].value)+10)+") rotate("+(p[3]15&&cu(t);return{c(){e=Se("rect"),c&&c.c(),a=Ve(),r(e,"x",l=t[5](t[11])+2),r(e,"y",n=t[6](0)),r(e,"width",i=t[3]-4),r(e,"height",o=t[6](t[0].y.min)-t[6](t[0].y.min+t[9].value2)),r(e,"fill",u=t[9].color2?t[9].color2:t[9].color)},m(f,p){y(f,e,p),c&&c.m(f,p),y(f,a,p)},p(f,p){p&32&&l!==(l=f[5](f[11])+2)&&r(e,"x",l),p&64&&n!==(n=f[6](0))&&r(e,"y",n),p&8&&i!==(i=f[3]-4)&&r(e,"width",i),p&65&&o!==(o=f[6](f[0].y.min)-f[6](f[0].y.min+f[9].value2))&&r(e,"height",o),p&1&&u!==(u=f[9].color2?f[9].color2:f[9].color)&&r(e,"fill",u),f[3]>15?c?c.p(f,p):(c=cu(f),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(f){f&&w(e),c&&c.d(f),f&&w(a)}}}function cu(t){let e,l=t[9].label2+"",n,i,o,u,a,c=t[9].title2&&mu(t);return{c(){e=Se("text"),n=$(l),c&&c.c(),a=Ve(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor","middle"),r(e,"fill",o=t[6](-t[9].value2)t[8].call(e))},m(i,o){y(i,e,o),n&&n.m(e,null),l=ic(e,t[8].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=xa(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:_e,o:_e,d(i){i&&w(e),n&&n.d(),l()}}}let cn=30;function am(t,e,l){let{config:n}=e,i,o,u,a,c,f,p;function _(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return t.$$set=h=>{"config"in h&&l(0,n=h.config)},t.$$.update=()=>{if(t.$$.dirty&31){l(4,f=o-(n.title?20:0));let h=i-(n.padding.left+n.padding.right);l(3,u=h/n.points.length),l(7,p=un.y.max?C=n.padding.bottom:df||C<0?0:C})}},[n,i,o,u,f,a,c,p,_]}class pn extends De{constructor(e){super(),Pe(this,e,am,rm,$e,{config:0})}}function um(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function fm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{ds:u}=e,a={};function c(f){return{label:be(f)+"V",title:f.toFixed(1)+" V",value:isNaN(f)?0:f,color:k1(f||0)}}return t.$$set=f=>{"u1"in f&&l(1,n=f.u1),"u2"in f&&l(2,i=f.u2),"u3"in f&&l(3,o=f.u3),"ds"in f&&l(4,u=f.ds)},t.$$.update=()=>{if(t.$$.dirty&30){let f=[],p=[];n>0&&(f.push({label:u===1?"L1-L2":"L1"}),p.push(c(n))),i>0&&(f.push({label:u===1?"L1-L3":"L2"}),p.push(c(i))),o>0&&(f.push({label:u===1?"L2-L3":"L3"}),p.push(c(o))),l(0,a={padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:f},points:p})}},[a,n,i,o,u]}class cm extends De{constructor(e){super(),Pe(this,e,fm,um,$e,{u1:1,u2:2,u3:3,ds:4})}}function mm(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function pm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{i1:u}=e,{i2:a}=e,{i3:c}=e,{max:f}=e,p={};function _(h){return{label:be(h)+"A",title:h.toFixed(1)+" A",value:isNaN(h)?0:h,color:Lc(h?h/f*100:0)}}return t.$$set=h=>{"u1"in h&&l(1,n=h.u1),"u2"in h&&l(2,i=h.u2),"u3"in h&&l(3,o=h.u3),"i1"in h&&l(4,u=h.i1),"i2"in h&&l(5,a=h.i2),"i3"in h&&l(6,c=h.i3),"max"in h&&l(7,f=h.max)},t.$$.update=()=>{if(t.$$.dirty&254){let h=[],v=[];n>0&&(h.push({label:"L1"}),v.push(_(u))),i>0&&(h.push({label:"L2"}),v.push(_(a))),o>0&&(h.push({label:"L3"}),v.push(_(c))),l(0,p={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:h},points:v})}},[p,n,i,o,u,a,c,f]}class _m extends De{constructor(e){super(),Pe(this,e,pm,mm,$e,{u1:1,u2:2,u3:3,i1:4,i2:5,i3:6,max:7})}}function dm(t){let e,l,n,i,o,u,a,c=(typeof t[0]<"u"?t[0].toFixed(0):"-")+"",f,p,_,h,v,d,C=(typeof t[1]<"u"?t[1].toFixed(0):"-")+"",M,N,T,P,F,A,I,D=(typeof t[2]<"u"?t[2].toFixed(1):"-")+"",O,ie,H,K,G,Y,Q=(typeof t[3]<"u"?t[3].toFixed(1):"-")+"",z,Z;return{c(){e=m("div"),l=m("strong"),l.textContent="Reactive",n=b(),i=m("div"),o=m("div"),o.textContent="Instant in",u=b(),a=m("div"),f=$(c),p=$(" VAr"),_=b(),h=m("div"),h.textContent="Instant out",v=b(),d=m("div"),M=$(C),N=$(" VAr"),T=b(),P=m("div"),F=m("div"),F.textContent="Total in",A=b(),I=m("div"),O=$(D),ie=$(" kVArh"),H=b(),K=m("div"),K.textContent="Total out",G=b(),Y=m("div"),z=$(Q),Z=$(" kVArh"),r(a,"class","text-right"),r(d,"class","text-right"),r(i,"class","grid grid-cols-2 mt-4"),r(I,"class","text-right"),r(Y,"class","text-right"),r(P,"class","grid grid-cols-2 mt-4"),r(e,"class","mx-2 text-sm")},m(V,j){y(V,e,j),s(e,l),s(e,n),s(e,i),s(i,o),s(i,u),s(i,a),s(a,f),s(a,p),s(i,_),s(i,h),s(i,v),s(i,d),s(d,M),s(d,N),s(e,T),s(e,P),s(P,F),s(P,A),s(P,I),s(I,O),s(I,ie),s(P,H),s(P,K),s(P,G),s(P,Y),s(Y,z),s(Y,Z)},p(V,[j]){j&1&&c!==(c=(typeof V[0]<"u"?V[0].toFixed(0):"-")+"")&&X(f,c),j&2&&C!==(C=(typeof V[1]<"u"?V[1].toFixed(0):"-")+"")&&X(M,C),j&4&&D!==(D=(typeof V[2]<"u"?V[2].toFixed(1):"-")+"")&&X(O,D),j&8&&Q!==(Q=(typeof V[3]<"u"?V[3].toFixed(1):"-")+"")&&X(z,Q)},i:_e,o:_e,d(V){V&&w(e)}}}function vm(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:o}=e,{exportTotal:u}=e;return t.$$set=a=>{"importInstant"in a&&l(0,n=a.importInstant),"exportInstant"in a&&l(1,i=a.exportInstant),"importTotal"in a&&l(2,o=a.importTotal),"exportTotal"in a&&l(3,u=a.exportTotal)},[n,i,o,u]}class hm extends De{constructor(e){super(),Pe(this,e,vm,dm,$e,{importInstant:0,exportInstant:1,importTotal:2,exportTotal:3})}}function _u(t){let e;function l(o,u){return o[3]?gm:bm}let n=l(t),i=n(t);return{c(){i.c(),e=Ve()},m(o,u){i.m(o,u),y(o,e,u)},p(o,u){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&w(e)}}}function bm(t){let e,l,n,i,o,u,a=be(t[1].h.u,2)+"",c,f,p,_,h,v,d=be(t[1].d.u,1)+"",C,M,N,T,P,F,A=be(t[1].m.u)+"",I,D,O,ie,H,K,G=be(t[0].last_month.u)+"",Y,Q,z,Z,V=t[4]&&du(t);return{c(){e=m("strong"),e.textContent="Consumption",l=b(),n=m("div"),i=m("div"),i.textContent="Hour",o=b(),u=m("div"),c=$(a),f=$(" kWh"),p=b(),_=m("div"),_.textContent="Day",h=b(),v=m("div"),C=$(d),M=$(" kWh"),N=b(),T=m("div"),T.textContent="Month",P=b(),F=m("div"),I=$(A),D=$(" kWh"),O=b(),ie=m("div"),ie.textContent="Last month",H=b(),K=m("div"),Y=$(G),Q=$(" kWh"),z=b(),V&&V.c(),Z=Ve(),r(u,"class","text-right"),r(v,"class","text-right"),r(F,"class","text-right"),r(K,"class","text-right"),r(n,"class","grid grid-cols-2 mb-3")},m(j,ee){y(j,e,ee),y(j,l,ee),y(j,n,ee),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(n,p),s(n,_),s(n,h),s(n,v),s(v,C),s(v,M),s(n,N),s(n,T),s(n,P),s(n,F),s(F,I),s(F,D),s(n,O),s(n,ie),s(n,H),s(n,K),s(K,Y),s(K,Q),y(j,z,ee),V&&V.m(j,ee),y(j,Z,ee)},p(j,ee){ee&2&&a!==(a=be(j[1].h.u,2)+"")&&X(c,a),ee&2&&d!==(d=be(j[1].d.u,1)+"")&&X(C,d),ee&2&&A!==(A=be(j[1].m.u)+"")&&X(I,A),ee&1&&G!==(G=be(j[0].last_month.u)+"")&&X(Y,G),j[4]?V?V.p(j,ee):(V=du(j),V.c(),V.m(Z.parentNode,Z)):V&&(V.d(1),V=null)},d(j){j&&w(e),j&&w(l),j&&w(n),j&&w(z),V&&V.d(j),j&&w(Z)}}}function gm(t){let e,l,n,i,o,u,a=be(t[1].h.u,2)+"",c,f,p,_,h,v,d,C=be(t[1].d.u,1)+"",M,N,T,P,F,A,I,D=be(t[1].m.u)+"",O,ie,H,K,G,Y,Q,z=be(t[0].last_month.u)+"",Z,V,j,ee,ue,x,W,U,ke,He,Be,We=be(t[1].h.p,2)+"",Ne,ge,Le,Me,S,g,k,E=be(t[1].d.p,1)+"",L,J,te,fe,de,we,Ee,ae=be(t[1].m.p)+"",Ce,Je,Et,st,ht,lt,At,Ye=be(t[0].last_month.p)+"",Qt,Ht,bt,ze,xe=t[4]&&vu(t),Xe=t[4]&&hu(t),Ue=t[4]&&bu(t),qe=t[4]&&gu(t),et=t[4]&&ku(t),Ae=t[4]&&wu(t),Oe=t[4]&&yu(t),pe=t[4]&&Cu(t);return{c(){e=m("strong"),e.textContent="Import",l=b(),n=m("div"),i=m("div"),i.textContent="Hour",o=b(),u=m("div"),c=$(a),f=$(" kWh"),p=b(),xe&&xe.c(),_=b(),h=m("div"),h.textContent="Day",v=b(),d=m("div"),M=$(C),N=$(" kWh"),T=b(),Xe&&Xe.c(),P=b(),F=m("div"),F.textContent="Month",A=b(),I=m("div"),O=$(D),ie=$(" kWh"),H=b(),Ue&&Ue.c(),K=b(),G=m("div"),G.textContent="Last mo.",Y=b(),Q=m("div"),Z=$(z),V=$(" kWh"),j=b(),qe&&qe.c(),ue=b(),x=m("strong"),x.textContent="Export",W=b(),U=m("div"),ke=m("div"),ke.textContent="Hour",He=b(),Be=m("div"),Ne=$(We),ge=$(" kWh"),Le=b(),et&&et.c(),Me=b(),S=m("div"),S.textContent="Day",g=b(),k=m("div"),L=$(E),J=$(" kWh"),te=b(),Ae&&Ae.c(),fe=b(),de=m("div"),de.textContent="Month",we=b(),Ee=m("div"),Ce=$(ae),Je=$(" kWh"),Et=b(),Oe&&Oe.c(),st=b(),ht=m("div"),ht.textContent="Last mo.",lt=b(),At=m("div"),Qt=$(Ye),Ht=$(" kWh"),bt=b(),pe&&pe.c(),r(u,"class","text-right"),r(d,"class","text-right"),r(I,"class","text-right"),r(Q,"class","text-right"),r(n,"class",ee="grid grid-cols-"+t[5]+" mb-3"),r(Be,"class","text-right"),r(k,"class","text-right"),r(Ee,"class","text-right"),r(At,"class","text-right"),r(U,"class",ze="grid grid-cols-"+t[5])},m(ce,ye){y(ce,e,ye),y(ce,l,ye),y(ce,n,ye),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(n,p),xe&&xe.m(n,null),s(n,_),s(n,h),s(n,v),s(n,d),s(d,M),s(d,N),s(n,T),Xe&&Xe.m(n,null),s(n,P),s(n,F),s(n,A),s(n,I),s(I,O),s(I,ie),s(n,H),Ue&&Ue.m(n,null),s(n,K),s(n,G),s(n,Y),s(n,Q),s(Q,Z),s(Q,V),s(n,j),qe&&qe.m(n,null),y(ce,ue,ye),y(ce,x,ye),y(ce,W,ye),y(ce,U,ye),s(U,ke),s(U,He),s(U,Be),s(Be,Ne),s(Be,ge),s(U,Le),et&&et.m(U,null),s(U,Me),s(U,S),s(U,g),s(U,k),s(k,L),s(k,J),s(U,te),Ae&&Ae.m(U,null),s(U,fe),s(U,de),s(U,we),s(U,Ee),s(Ee,Ce),s(Ee,Je),s(U,Et),Oe&&Oe.m(U,null),s(U,st),s(U,ht),s(U,lt),s(U,At),s(At,Qt),s(At,Ht),s(U,bt),pe&&pe.m(U,null)},p(ce,ye){ye&2&&a!==(a=be(ce[1].h.u,2)+"")&&X(c,a),ce[4]?xe?xe.p(ce,ye):(xe=vu(ce),xe.c(),xe.m(n,_)):xe&&(xe.d(1),xe=null),ye&2&&C!==(C=be(ce[1].d.u,1)+"")&&X(M,C),ce[4]?Xe?Xe.p(ce,ye):(Xe=hu(ce),Xe.c(),Xe.m(n,P)):Xe&&(Xe.d(1),Xe=null),ye&2&&D!==(D=be(ce[1].m.u)+"")&&X(O,D),ce[4]?Ue?Ue.p(ce,ye):(Ue=bu(ce),Ue.c(),Ue.m(n,K)):Ue&&(Ue.d(1),Ue=null),ye&1&&z!==(z=be(ce[0].last_month.u)+"")&&X(Z,z),ce[4]?qe?qe.p(ce,ye):(qe=gu(ce),qe.c(),qe.m(n,null)):qe&&(qe.d(1),qe=null),ye&32&&ee!==(ee="grid grid-cols-"+ce[5]+" mb-3")&&r(n,"class",ee),ye&2&&We!==(We=be(ce[1].h.p,2)+"")&&X(Ne,We),ce[4]?et?et.p(ce,ye):(et=ku(ce),et.c(),et.m(U,Me)):et&&(et.d(1),et=null),ye&2&&E!==(E=be(ce[1].d.p,1)+"")&&X(L,E),ce[4]?Ae?Ae.p(ce,ye):(Ae=wu(ce),Ae.c(),Ae.m(U,fe)):Ae&&(Ae.d(1),Ae=null),ye&2&&ae!==(ae=be(ce[1].m.p)+"")&&X(Ce,ae),ce[4]?Oe?Oe.p(ce,ye):(Oe=yu(ce),Oe.c(),Oe.m(U,st)):Oe&&(Oe.d(1),Oe=null),ye&1&&Ye!==(Ye=be(ce[0].last_month.p)+"")&&X(Qt,Ye),ce[4]?pe?pe.p(ce,ye):(pe=Cu(ce),pe.c(),pe.m(U,null)):pe&&(pe.d(1),pe=null),ye&32&&ze!==(ze="grid grid-cols-"+ce[5])&&r(U,"class",ze)},d(ce){ce&&w(e),ce&&w(l),ce&&w(n),xe&&xe.d(),Xe&&Xe.d(),Ue&&Ue.d(),qe&&qe.d(),ce&&w(ue),ce&&w(x),ce&&w(W),ce&&w(U),et&&et.d(),Ae&&Ae.d(),Oe&&Oe.d(),pe&&pe.d()}}}function du(t){let e,l,n,i,o,u,a=be(t[1].h.c,2)+"",c,f,p,_,h,v,d,C=be(t[1].d.c,1)+"",M,N,T,P,F,A,I,D=be(t[1].m.c)+"",O,ie,H,K,G,Y,Q,z=be(t[0].last_month.c)+"",Z,V,j;return{c(){e=m("strong"),e.textContent="Cost",l=b(),n=m("div"),i=m("div"),i.textContent="Hour",o=b(),u=m("div"),c=$(a),f=b(),p=$(t[2]),_=b(),h=m("div"),h.textContent="Day",v=b(),d=m("div"),M=$(C),N=b(),T=$(t[2]),P=b(),F=m("div"),F.textContent="Month",A=b(),I=m("div"),O=$(D),ie=b(),H=$(t[2]),K=b(),G=m("div"),G.textContent="Last month",Y=b(),Q=m("div"),Z=$(z),V=b(),j=$(t[2]),r(u,"class","text-right"),r(d,"class","text-right"),r(I,"class","text-right"),r(Q,"class","text-right"),r(n,"class","grid grid-cols-2")},m(ee,ue){y(ee,e,ue),y(ee,l,ue),y(ee,n,ue),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(u,p),s(n,_),s(n,h),s(n,v),s(n,d),s(d,M),s(d,N),s(d,T),s(n,P),s(n,F),s(n,A),s(n,I),s(I,O),s(I,ie),s(I,H),s(n,K),s(n,G),s(n,Y),s(n,Q),s(Q,Z),s(Q,V),s(Q,j)},p(ee,ue){ue&2&&a!==(a=be(ee[1].h.c,2)+"")&&X(c,a),ue&4&&X(p,ee[2]),ue&2&&C!==(C=be(ee[1].d.c,1)+"")&&X(M,C),ue&4&&X(T,ee[2]),ue&2&&D!==(D=be(ee[1].m.c)+"")&&X(O,D),ue&4&&X(H,ee[2]),ue&1&&z!==(z=be(ee[0].last_month.c)+"")&&X(Z,z),ue&4&&X(j,ee[2])},d(ee){ee&&w(e),ee&&w(l),ee&&w(n)}}}function vu(t){let e,l=be(t[1].h.c,2)+"",n,i,o;return{c(){e=m("div"),n=$(l),i=b(),o=$(t[2]),r(e,"class","text-right")},m(u,a){y(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=be(u[1].h.c,2)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&w(e)}}}function hu(t){let e,l=be(t[1].d.c,1)+"",n,i,o;return{c(){e=m("div"),n=$(l),i=b(),o=$(t[2]),r(e,"class","text-right")},m(u,a){y(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=be(u[1].d.c,1)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&w(e)}}}function bu(t){let e,l=be(t[1].m.c)+"",n,i,o;return{c(){e=m("div"),n=$(l),i=b(),o=$(t[2]),r(e,"class","text-right")},m(u,a){y(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=be(u[1].m.c)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&w(e)}}}function gu(t){let e,l=be(t[0].last_month.c)+"",n,i,o;return{c(){e=m("div"),n=$(l),i=b(),o=$(t[2]),r(e,"class","text-right")},m(u,a){y(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=be(u[0].last_month.c)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&w(e)}}}function ku(t){let e,l=be(t[1].h.i,2)+"",n,i,o;return{c(){e=m("div"),n=$(l),i=b(),o=$(t[2]),r(e,"class","text-right")},m(u,a){y(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=be(u[1].h.i,2)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&w(e)}}}function wu(t){let e,l=be(t[1].d.i,1)+"",n,i,o;return{c(){e=m("div"),n=$(l),i=b(),o=$(t[2]),r(e,"class","text-right")},m(u,a){y(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=be(u[1].d.i,1)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&w(e)}}}function yu(t){let e,l=be(t[1].m.i)+"",n,i,o;return{c(){e=m("div"),n=$(l),i=b(),o=$(t[2]),r(e,"class","text-right")},m(u,a){y(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=be(u[1].m.i)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&w(e)}}}function Cu(t){let e,l=be(t[0].last_month.i)+"",n,i,o;return{c(){e=m("div"),n=$(l),i=b(),o=$(t[2]),r(e,"class","text-right")},m(u,a){y(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=be(u[0].last_month.i)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&w(e)}}}function km(t){let e,l,n,i,o,u,a=t[1]&&_u(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Real time calculation",n=b(),i=m("br"),o=m("br"),u=b(),a&&a.c(),r(e,"class","mx-2 text-sm")},m(c,f){y(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),s(e,u),a&&a.m(e,null)},p(c,[f]){c[1]?a?a.p(c,f):(a=_u(c),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i:_e,o:_e,d(c){c&&w(e),a&&a.d()}}}function wm(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:u}=e,a=!1,c=3;return t.$$set=f=>{"sysinfo"in f&&l(0,n=f.sysinfo),"data"in f&&l(1,i=f.data),"currency"in f&&l(2,o=f.currency),"hasExport"in f&&l(3,u=f.hasExport)},t.$$.update=()=>{t.$$.dirty&18&&(l(4,a=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(5,c=a?3:2))},[n,i,o,u,a,c]}class ym extends De{constructor(e){super(),Pe(this,e,wm,km,$e,{sysinfo:0,data:1,currency:2,hasExport:3})}}function Cm(t){let e,l,n=qa(t[0].source)+"",i,o,u,a;return u=new pn({props:{config:t[1]}}),{c(){e=m("a"),l=$("Provided by: "),i=$(n),o=b(),re(u.$$.fragment),r(e,"href","https://transparency.entsoe.eu/"),r(e,"target","_blank"),r(e,"class","text-xs float-right z-40")},m(c,f){y(c,e,f),s(e,l),s(e,i),y(c,o,f),se(u,c,f),a=!0},p(c,[f]){(!a||f&1)&&n!==(n=qa(c[0].source)+"")&&X(i,n);const p={};f&2&&(p.config=c[1]),u.$set(p)},i(c){a||(R(u.$$.fragment,c),a=!0)},o(c){B(u.$$.fragment,c),a=!1},d(c){c&&w(e),c&&w(o),oe(u,c)}}}function Mm(t,e,l){let{json:n}=e,{sysinfo:i}=e,o={},u,a;return t.$$set=c=>{"json"in c&&l(0,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&29){let c=n.currency,f=new Date().getUTCHours(),p=0,_=0,h=0,v=[],d=[],C=[];l(4,a=l(3,u=0));let M=new Date;for(dl(M,i.clock_offset-(24+M.getHours()-M.getUTCHours())%24),p=f;p<24&&(_=n[Fe(h++)],_!=null);p++)d.push({label:Fe(M.getHours())}),C.push(_*100),l(4,a=Math.min(a,_*100)),l(3,u=Math.max(u,_*100)),dl(M,1);for(p=0;p<24&&(_=n[Fe(h++)],_!=null);p++)d.push({label:Fe(M.getHours())}),C.push(_*100),l(4,a=Math.min(a,_*100)),l(3,u=Math.max(u,_*100)),dl(M,1);if(a>-100&&u<100){switch(c){case"NOK":case"SEK":case"DKK":c="\xF8re";break;case"EUR":c="cent";break;default:c=c+"/100"}for(l(4,a*=100),l(3,u*=100),p=0;p=0?A.toFixed(I):"",title:A>=0?A.toFixed(2)+" "+c:"",value:_>=0?Math.abs(_):0,label2:A<0?A.toFixed(I):"",title2:A<0?A.toFixed(2)+" "+c:"",value2:_<0?Math.abs(_):0,color:"#7c3aed"})}let T=Math.max(u,Math.abs(a));if(a<0){l(4,a=Math.min(T/4*-1,a));let A=Math.ceil(Math.abs(a)/T*4),I=a/A;for(p=1;p{"json"in c&&l(1,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let c=0,f=[],p=[],_=[];l(4,a=l(3,u=0));let h=dl(new Date,-24),v=new Date().getUTCHours();for(dl(h,i.clock_offset-(24+h.getHours()-h.getUTCHours())%24),c=v;c<24;c++){let N=n["i"+Fe(c)],T=n["e"+Fe(c)];N===void 0&&(N=0),T===void 0&&(T=0),p.push({label:Fe(h.getHours())}),_.push({label:N.toFixed(1),title:N.toFixed(2)+" kWh",value:N*10,label2:T.toFixed(1),title2:T.toFixed(2)+" kWh",value2:T*10,color:"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,T*10)),l(3,u=Math.max(u,N*10)),dl(h,1)}for(c=0;c{"json"in c&&l(1,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let c=0,f=[],p=[],_=[];l(4,a=l(3,u=0));let h=new Date,v=new Date;for(dl(h,i.clock_offset-(24+h.getHours()-h.getUTCHours())%24),dl(v,i.clock_offset-(24+v.getHours()-v.getUTCHours())%24),v.setDate(0),c=h.getDate();c<=v.getDate();c++){let N=n["i"+Fe(c)],T=n["e"+Fe(c)];N===void 0&&(N=0),T===void 0&&(T=0),p.push({label:Fe(c)}),_.push({label:N.toFixed(N<10?1:0),title:N.toFixed(2)+" kWh",value:N,label2:T.toFixed(T<10?1:0),title2:T.toFixed(2)+" kWh",value2:T,color:"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,T)),l(3,u=Math.max(u,N))}for(c=1;c{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=0,c=0,f=[],p=[],_=[];n.s&&n.s.forEach((d,C)=>{var M=d.n?d.n:d.a;c=d.v,c==-127&&(c=0),p.push({label:M.slice(-4)}),_.push({label:c.toFixed(1),value:c,color:"#7c3aed"}),l(3,u=Math.min(u,c)),l(2,o=Math.max(o,c))}),l(2,o=Math.ceil(o)),l(3,u=Math.floor(u));let h=o;u<0&&(h+=Math.abs(u));let v=h/4;for(a=0;a<5;a++)c=u+v*a,f.push({value:c,label:c.toFixed(1)});l(0,i={title:"Temperature sensors (\xB0C)",height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:u,max:o,ticks:f},x:{ticks:p},points:_})}},[i,n,o,u]}class Rm extends De{constructor(e){super(),Pe(this,e,Im,Dm,$e,{json:1})}}function Lm(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}let Om=0;function Fm(t,e,l){let n={},i=0,o;return zc.subscribe(u=>{l(2,o=u)}),Wc(),t.$$.update=()=>{if(t.$$.dirty&6){let u=0,a=[],c=[],f=[];if(a.push({value:0,label:0}),o&&o.p)for(u=0;u0?Fe(p.d)+"."+to[new Date().getMonth()]:"-"}),l(1,i=Math.max(i,p.v))}if(o&&o.t){for(u=0;u=i)break;a.push({value:p,label:p})}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:Om,max:i,ticks:a},x:{ticks:c},points:f})}},[n,i,o]}class qm extends De{constructor(e){super(),Pe(this,e,Fm,Lm,$e,{})}}function Mu(t,e,l){const n=t.slice();return n[18]=e[l],n[20]=l,n}function Tu(t,e,l){const n=t.slice();return n[21]=e[l],n}function Su(t){let e,l,n,i,o,u=t[7],a=[];for(let p=0;pt[14].call(e))},m(f,p){y(f,e,p),s(e,l),s(l,n),s(l,i),s(l,o),s(e,u),c&&c.m(e,null),a=ic(e,t[14].bind(e))},p(f,[p]){p&1024&&X(i,f[10]),f[7]?c?c.p(f,p):(c=Su(f),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i:_e,o:_e,d(f){f&&w(e),c&&c.d(),a()}}}let Um=12;function jm(t,e,l){let n;Gc.subscribe(A=>{l(11,n=A)});let i,o=0;function u(){n.data.unshift(0),l(11,n.data=n.data.slice(0,n.size),n),o+=10,i=setTimeout(u,1e4)}Oc.subscribe(A=>{o>0?n.data&&A.u-o>=10&&(i&&clearTimeout(i),n.data.unshift(A.i-A.e),l(11,n.data=n.data.slice(0,n.size),n),o+=10,i=setTimeout(u,1e4)):o=A.u});let a,c,f,p,_,h,v,d,C,M,N,T,P;function F(){f=this.clientWidth,p=this.clientHeight,l(0,f),l(1,p)}return t.$$.update=()=>{if(t.$$.dirty&14847&&(l(2,_=parseInt(p)-50),l(3,h=f-35),l(9,T=h/n.size),l(13,c=0),l(12,a=0),n.data)){for(let I in n.data){let D=n.data[I];l(12,a=Math.max(Math.ceil(D/1e3)*1e3,a)),l(13,c=Math.min(Math.ceil(D/1e3)*1e3,c))}l(10,P=a>2500?"kW":"W"),l(7,M=[]);for(let I=c;I2500?(I/1e3).toFixed(1):I});l(8,N=[]);for(let I=c;I0||t[0].e>0}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt")},m(i,o){y(i,e,o),se(l,e,null),n=!0},p(i,o){const u={};o&2&&(u.sysinfo=i[1]),o&1&&(u.data=i[0].ea),o&1&&(u.currency=i[0].pc),o&1&&(u.hasExport=i[0].om>0||i[0].e>0),l.$set(u)},i(i){n||(R(l.$$.fragment,i),n=!0)},o(i){B(l.$$.fragment,i),n=!1},d(i){i&&w(e),oe(l)}}}function qu(t){let e,l,n;return l=new qm({}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt h-64")},m(i,o){y(i,e,o),se(l,e,null),n=!0},i(i){n||(R(l.$$.fragment,i),n=!0)},o(i){B(l.$$.fragment,i),n=!1},d(i){i&&w(e),oe(l)}}}function Bu(t){let e,l,n;return l=new Hm({}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){y(i,e,o),se(l,e,null),n=!0},i(i){n||(R(l.$$.fragment,i),n=!0)},o(i){B(l.$$.fragment,i),n=!1},d(i){i&&w(e),oe(l)}}}function Uu(t){let e,l,n;return l=new Tm({props:{json:t[2],sysinfo:t[1]}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){y(i,e,o),se(l,e,null),n=!0},p(i,o){const u={};o&4&&(u.json=i[2]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(R(l.$$.fragment,i),n=!0)},o(i){B(l.$$.fragment,i),n=!1},d(i){i&&w(e),oe(l)}}}function ju(t){let e,l,n;return l=new Nm({props:{json:t[3],sysinfo:t[1]}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){y(i,e,o),se(l,e,null),n=!0},p(i,o){const u={};o&8&&(u.json=i[3]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(R(l.$$.fragment,i),n=!0)},o(i){B(l.$$.fragment,i),n=!1},d(i){i&&w(e),oe(l)}}}function Hu(t){let e,l,n;return l=new Pm({props:{json:t[4],sysinfo:t[1]}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){y(i,e,o),se(l,e,null),n=!0},p(i,o){const u={};o&16&&(u.json=i[4]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(R(l.$$.fragment,i),n=!0)},o(i){B(l.$$.fragment,i),n=!1},d(i){i&&w(e),oe(l)}}}function Wu(t){let e,l,n;return l=new Rm({props:{json:t[5]}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){y(i,e,o),se(l,e,null),n=!0},p(i,o){const u={};o&32&&(u.json=i[5]),l.$set(u)},i(i){n||(R(l.$$.fragment,i),n=!0)},o(i){B(l.$$.fragment,i),n=!1},d(i){i&&w(e),oe(l)}}}function Wm(t){let e,l=Qe(t[1].ui.i,t[0].i),n,i=Qe(t[1].ui.e,t[0].om||t[0].e>0),o,u=Qe(t[1].ui.v,t[0].u1>100||t[0].u2>100||t[0].u3>100),a,c=Qe(t[1].ui.a,t[0].i1>.01||t[0].i2>.01||t[0].i3>.01),f,p=Qe(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),_,h=Qe(t[1].ui.c,t[0].ea),v,d=Qe(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),C,M=Qe(t[1].ui.l),N,T=Qe(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),P,F=Qe(t[1].ui.d,t[3]),A,I=Qe(t[1].ui.m,t[4]),D,O=Qe(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),ie,H=l&&Du(t),K=i&&Iu(t),G=u&&Ru(t),Y=c&&Lu(t),Q=p&&Ou(t),z=h&&Fu(t),Z=d&&qu(),V=M&&Bu(),j=T&&Uu(t),ee=F&&ju(t),ue=I&&Hu(t),x=O&&Wu(t);return{c(){e=m("div"),H&&H.c(),n=b(),K&&K.c(),o=b(),G&&G.c(),a=b(),Y&&Y.c(),f=b(),Q&&Q.c(),_=b(),z&&z.c(),v=b(),Z&&Z.c(),C=b(),V&&V.c(),N=b(),j&&j.c(),P=b(),ee&&ee.c(),A=b(),ue&&ue.c(),D=b(),x&&x.c(),r(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(W,U){y(W,e,U),H&&H.m(e,null),s(e,n),K&&K.m(e,null),s(e,o),G&&G.m(e,null),s(e,a),Y&&Y.m(e,null),s(e,f),Q&&Q.m(e,null),s(e,_),z&&z.m(e,null),s(e,v),Z&&Z.m(e,null),s(e,C),V&&V.m(e,null),s(e,N),j&&j.m(e,null),s(e,P),ee&&ee.m(e,null),s(e,A),ue&&ue.m(e,null),s(e,D),x&&x.m(e,null),ie=!0},p(W,[U]){U&3&&(l=Qe(W[1].ui.i,W[0].i)),l?H?(H.p(W,U),U&3&&R(H,1)):(H=Du(W),H.c(),R(H,1),H.m(e,n)):H&&(Ie(),B(H,1,1,()=>{H=null}),Re()),U&3&&(i=Qe(W[1].ui.e,W[0].om||W[0].e>0)),i?K?(K.p(W,U),U&3&&R(K,1)):(K=Iu(W),K.c(),R(K,1),K.m(e,o)):K&&(Ie(),B(K,1,1,()=>{K=null}),Re()),U&3&&(u=Qe(W[1].ui.v,W[0].u1>100||W[0].u2>100||W[0].u3>100)),u?G?(G.p(W,U),U&3&&R(G,1)):(G=Ru(W),G.c(),R(G,1),G.m(e,a)):G&&(Ie(),B(G,1,1,()=>{G=null}),Re()),U&3&&(c=Qe(W[1].ui.a,W[0].i1>.01||W[0].i2>.01||W[0].i3>.01)),c?Y?(Y.p(W,U),U&3&&R(Y,1)):(Y=Lu(W),Y.c(),R(Y,1),Y.m(e,f)):Y&&(Ie(),B(Y,1,1,()=>{Y=null}),Re()),U&3&&(p=Qe(W[1].ui.r,W[0].ri>0||W[0].re>0||W[0].ric>0||W[0].rec>0)),p?Q?(Q.p(W,U),U&3&&R(Q,1)):(Q=Ou(W),Q.c(),R(Q,1),Q.m(e,_)):Q&&(Ie(),B(Q,1,1,()=>{Q=null}),Re()),U&3&&(h=Qe(W[1].ui.c,W[0].ea)),h?z?(z.p(W,U),U&3&&R(z,1)):(z=Fu(W),z.c(),R(z,1),z.m(e,v)):z&&(Ie(),B(z,1,1,()=>{z=null}),Re()),U&3&&(d=Qe(W[1].ui.t,W[0].pr&&(W[0].pr.startsWith("10YNO")||W[0].pr.startsWith("10Y1001A1001A4")))),d?Z?U&3&&R(Z,1):(Z=qu(),Z.c(),R(Z,1),Z.m(e,C)):Z&&(Ie(),B(Z,1,1,()=>{Z=null}),Re()),U&2&&(M=Qe(W[1].ui.l)),M?V?U&2&&R(V,1):(V=Bu(),V.c(),R(V,1),V.m(e,N)):V&&(Ie(),B(V,1,1,()=>{V=null}),Re()),U&3&&(T=Qe(W[1].ui.p,W[0].pe&&!Number.isNaN(W[0].p))),T?j?(j.p(W,U),U&3&&R(j,1)):(j=Uu(W),j.c(),R(j,1),j.m(e,P)):j&&(Ie(),B(j,1,1,()=>{j=null}),Re()),U&10&&(F=Qe(W[1].ui.d,W[3])),F?ee?(ee.p(W,U),U&10&&R(ee,1)):(ee=ju(W),ee.c(),R(ee,1),ee.m(e,A)):ee&&(Ie(),B(ee,1,1,()=>{ee=null}),Re()),U&18&&(I=Qe(W[1].ui.m,W[4])),I?ue?(ue.p(W,U),U&18&&R(ue,1)):(ue=Hu(W),ue.c(),R(ue,1),ue.m(e,D)):ue&&(Ie(),B(ue,1,1,()=>{ue=null}),Re()),U&35&&(O=Qe(W[1].ui.s,W[0].t&&W[0].t!=-127&&W[5].c>1)),O?x?(x.p(W,U),U&35&&R(x,1)):(x=Wu(W),x.c(),R(x,1),x.m(e,null)):x&&(Ie(),B(x,1,1,()=>{x=null}),Re())},i(W){ie||(R(H),R(K),R(G),R(Y),R(Q),R(z),R(Z),R(V),R(j),R(ee),R(ue),R(x),ie=!0)},o(W){B(H),B(K),B(G),B(Y),B(Q),B(z),B(Z),B(V),B(j),B(ee),B(ue),B(x),ie=!1},d(W){W&&w(e),H&&H.d(),K&&K.d(),G&&G.d(),Y&&Y.d(),Q&&Q.d(),z&&z.d(),Z&&Z.d(),V&&V.d(),j&&j.d(),ee&&ee.d(),ue&&ue.d(),x&&x.d()}}}function zm(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},u={},a={},c={};return Co.subscribe(f=>{l(2,o=f)}),Bc.subscribe(f=>{l(3,u=f)}),Uc.subscribe(f=>{l(4,a=f)}),Hc.subscribe(f=>{l(5,c=f)}),t.$$set=f=>{"data"in f&&l(0,n=f.data),"sysinfo"in f&&l(1,i=f.sysinfo)},[n,i,o,u,a,c]}class Gm extends De{constructor(e){super(),Pe(this,e,zm,Wm,$e,{data:0,sysinfo:1})}}let uo={};const yi=it(uo);async function Vm(){uo=await(await fetch("/configuration.json")).json(),yi.set(uo)}function zu(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Km(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Ym(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Gu(t){let e;return{c(){e=m("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Vu(t){let e,l,n;return{c(){e=m("option"),e.textContent="UART1",l=b(),n=m("option"),n.textContent="UART2",e.__value=9,e.value=e.__value,n.__value=16,n.value=n.__value},m(i,o){y(i,e,o),y(i,l,o),y(i,n,o)},d(i){i&&w(e),i&&w(l),i&&w(n)}}}function Ku(t){let e;return{c(){e=m("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Yu(t){let e,l,n;return{c(){e=m("option"),l=$("GPIO"),n=$(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){y(i,e,o),s(e,l),s(e,n)},d(i){i&&w(e)}}}function Qu(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))&&Yu(t);return{c(){l&&l.c(),e=Ve()},m(n,i){l&&l.m(n,i),y(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=Yu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&w(e)}}}function Qm(t){let e,l,n,i,o;function u(d,C){return d[0]=="esp32c3"?Ym:Km}let a=u(t),c=a(t),f=t[0]=="esp8266"&&Gu(),p=(t[0]=="esp32"||t[0]=="esp32solo")&&Vu(),_=t[0]=="esp32s2"&&Ku(),h={length:t[1]+1},v=[];for(let d=0;d{"chip"in o&&l(0,n=o.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32c3":l(1,i=19);break}},[n,i]}class fo extends De{constructor(e){super(),Pe(this,e,Xm,Qm,$e,{chip:0})}}function Xu(t){let e,l,n=t[1]&&Zu(t);return{c(){e=m("div"),l=m("div"),n&&n.c(),r(l,"class","fixed inset-0 bg-gray-500 dark:bg-gray-900 bg-opacity-50 flex items-center justify-center"),r(e,"class","z-50"),r(e,"aria-modal","true")},m(i,o){y(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=Zu(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&w(e),n&&n.d()}}}function Zu(t){let e,l;return{c(){e=m("div"),l=$(t[1]),r(e,"class","bg-white dark:bg-gray-600 m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 dark:text-white w-96")},m(n,i){y(n,e,i),s(e,l)},p(n,i){i&2&&X(l,n[1])},d(n){n&&w(e)}}}function Zm(t){let e,l=t[0]&&Xu(t);return{c(){l&&l.c(),e=Ve()},m(n,i){l&&l.m(n,i),y(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Xu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:_e,o:_e,d(n){l&&l.d(n),n&&w(e)}}}function Jm(t,e,l){let{active:n}=e,{message:i}=e;return t.$$set=o=>{"active"in o&&l(0,n=o.active),"message"in o&&l(1,i=o.message)},[n,i]}class jt extends De{constructor(e){super(),Pe(this,e,Jm,Zm,$e,{active:0,message:1})}}function Ju(t,e,l){const n=t.slice();return n[1]=e[l],n}function xu(t){let e,l,n=t[1]+"",i;return{c(){e=m("option"),l=$("Europe/"),i=$(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,u){y(o,e,u),s(e,l),s(e,i)},p:_e,d(o){o&&w(e)}}}function xm(t){let e,l,n,i=t[0],o=[];for(let u=0;u>1&1,E=0;E0;g--)E[g]=E[g]?E[g-1]^A.EXPONENT[O._modN(A.LOG[E[g]]+S)]:E[g-1];E[0]=A.EXPONENT[O._modN(A.LOG[E[0]]+S)]}for(S=0;S<=k;S++)E[S]=A.LOG[E[S]]},_checkBadness:function(){var S,g,k,E,L,J=0,te=this._badness,fe=this.buffer,de=this.width;for(L=0;Lde*de;)ae-=de*de,Ee++;for(J+=Ee*O.N4,E=0;E=te-2&&(S=te-2,L>9&&S--);var fe=S;if(L>9){for(J[fe+2]=0,J[fe+3]=0;fe--;)g=J[fe],J[fe+3]|=255&g<<4,J[fe+2]=g>>4;J[2]|=255&S<<4,J[1]=S>>4,J[0]=64|S>>12}else{for(J[fe+1]=0,J[fe+2]=0;fe--;)g=J[fe],J[fe+2]|=255&g<<4,J[fe+1]=g>>4;J[1]|=255&S<<4,J[0]=64|S>>4}for(fe=S+3-(L<10);fe=5&&(k+=O.N1+E[g]-5);for(g=3;gS||E[g-3]*3>=E[g]*4||E[g+3]*3>=E[g]*4)&&(k+=O.N3);return k},_finish:function(){this._stringBuffer=this.buffer.slice();var S,g,k=0,E=3e4;for(g=0;g<8&&(this._applyMask(g),S=this._checkBadness(),S>=1)E&1&&(L[J-1-g+J*8]=1,g<6?L[8+J*g]=1:L[8+J*(g+1)]=1);for(g=0;g<7;g++,E>>=1)E&1&&(L[8+J*(J-7+g)]=1,g?L[6-g+J*8]=1:L[7+J*8]=1)},_interleaveBlocks:function(){var S,g,k=this._dataBlock,E=this._ecc,L=this._eccBlock,J=0,te=this._calculateMaxLength(),fe=this._neccBlock1,de=this._neccBlock2,we=this._stringBuffer;for(S=0;S1)for(S=N.BLOCK[E],k=L-7;;){for(g=L-7;g>S-3&&(this._addAlignment(g,k),!(g6)for(S=D.BLOCK[J-7],g=17,k=0;k<6;k++)for(E=0;E<3;E++,g--)1&(g>11?J>>g-12:S>>g)?(L[5-k+te*(2-E+te-11)]=1,L[2-E+te-11+te*(5-k)]=1):(this._setMask(5-k,2-E+te-11),this._setMask(2-E+te-11,5-k))},_isMasked:function(S,g){var k=O._getMaskBit(S,g);return this._mask[k]===1},_pack:function(){var S,g,k,E=1,L=1,J=this.width,te=J-1,fe=J-1,de=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(g=0;gg&&(k=S,S=g,g=k),k=g,k+=g*g,k>>=1,k+=S,k},_modN:function(S){for(;S>=255;)S-=255,S=(S>>8)+(S&255);return S},N1:3,N2:3,N3:40,N4:10}),ie=O,H=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var S=this.element;S.width=S.height=this.qrious.size}}),K=H,G=_.extend(function(S,g,k,E){this.name=S,this.modifiable=Boolean(g),this.defaultValue=k,this._valueTransformer=E},{transform:function(S){var g=this._valueTransformer;return typeof g=="function"?g(S,this):S}}),Y=G,Q=_.extend(null,{abs:function(S){return S!=null?Math.abs(S):null},hasOwn:function(S,g){return Object.prototype.hasOwnProperty.call(S,g)},noop:function(){},toUpperCase:function(S){return S!=null?S.toUpperCase():null}}),z=Q,Z=_.extend(function(S){this.options={},S.forEach(function(g){this.options[g.name]=g},this)},{exists:function(S){return this.options[S]!=null},get:function(S,g){return Z._get(this.options[S],g)},getAll:function(S){var g,k=this.options,E={};for(g in k)z.hasOwn(k,g)&&(E[g]=Z._get(k[g],S));return E},init:function(S,g,k){typeof k!="function"&&(k=z.noop);var E,L;for(E in this.options)z.hasOwn(this.options,E)&&(L=this.options[E],Z._set(L,L.defaultValue,g),Z._createAccessor(L,g,k));this._setAll(S,g,!0)},set:function(S,g,k){return this._set(S,g,k)},setAll:function(S,g){return this._setAll(S,g)},_set:function(S,g,k,E){var L=this.options[S];if(!L)throw new Error("Invalid option: "+S);if(!L.modifiable&&!E)throw new Error("Option cannot be modified: "+S);return Z._set(L,g,k)},_setAll:function(S,g,k){if(!S)return!1;var E,L=!1;for(E in S)z.hasOwn(S,E)&&this._set(E,S[E],g,k)&&(L=!0);return L}},{_createAccessor:function(S,g,k){var E={get:function(){return Z._get(S,g)}};S.modifiable&&(E.set=function(L){Z._set(S,L,g)&&k(L,S)}),Object.defineProperty(g,S.name,E)},_get:function(S,g){return g["_"+S.name]},_set:function(S,g,k){var E="_"+S.name,L=k[E],J=S.transform(g!=null?g:S.defaultValue);return k[E]=J,J!==L}}),V=Z,j=_.extend(function(){this._services={}},{getService:function(S){var g=this._services[S];if(!g)throw new Error("Service is not being managed with name: "+S);return g},setService:function(S,g){if(this._services[S])throw new Error("Service is already managed with name: "+S);g&&(this._services[S]=g)}}),ee=j,ue=new V([new Y("background",!0,"white"),new Y("backgroundAlpha",!0,1,z.abs),new Y("element"),new Y("foreground",!0,"black"),new Y("foregroundAlpha",!0,1,z.abs),new Y("level",!0,"L",z.toUpperCase),new Y("mime",!0,"image/png"),new Y("padding",!0,null,z.abs),new Y("size",!0,100,z.abs),new Y("value",!0,"")]),x=new ee,W=_.extend(function(S){ue.init(S,this,this.update.bind(this));var g=ue.get("element",this),k=x.getService("element"),E=g&&k.isCanvas(g)?g:k.createCanvas(),L=g&&k.isImage(g)?g:k.createImage();this._canvasRenderer=new C(this,E,!0),this._imageRenderer=new K(this,L,L===g),this.update()},{get:function(){return ue.getAll(this)},set:function(S){ue.setAll(S,this)&&this.update()},toDataURL:function(S){return this.canvas.toDataURL(S||this.mime)},update:function(){var S=new ie({level:this.level,value:this.value});this._canvasRenderer.render(S),this._imageRenderer.render(S)}},{use:function(S){x.setService(S.getName(),S)}});Object.defineProperties(W.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var U=W,ke=U,He=_.extend({getName:function(){}}),Be=He,We=Be.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(S){},isImage:function(S){}}),Ne=We,ge=Ne.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(S){return S instanceof HTMLCanvasElement},isImage:function(S){return S instanceof HTMLImageElement}}),Le=ge;ke.use(new Le);var Me=ke;return Me})})(Jc);const sp=Jc.exports;function op(t){let e,l;return{c(){e=m("img"),Xs(e.src,l=t[2])||r(e,"src",l),r(e,"alt",t[0]),r(e,"class",t[1])},m(n,i){y(n,e,i)},p(n,[i]){i&4&&!Xs(e.src,l=n[2])&&r(e,"src",l),i&1&&r(e,"alt",n[0]),i&2&&r(e,"class",n[1])},i:_e,o:_e,d(n){n&&w(e)}}}function rp(t,e,l){const n=new sp;let{errorCorrection:i="L"}=e,{background:o="#fff"}=e,{color:u="#000"}=e,{size:a="200"}=e,{value:c=""}=e,{padding:f=0}=e,{className:p="qrcode"}=e,_="";function h(){n.set({background:o,foreground:u,level:i,padding:f,size:a,value:c}),l(2,_=n.toDataURL("image/jpeg"))}return sc(()=>{h()}),t.$$set=v=>{"errorCorrection"in v&&l(3,i=v.errorCorrection),"background"in v&&l(4,o=v.background),"color"in v&&l(5,u=v.color),"size"in v&&l(6,a=v.size),"value"in v&&l(0,c=v.value),"padding"in v&&l(7,f=v.padding),"className"in v&&l(1,p=v.className)},t.$$.update=()=>{t.$$.dirty&1&&c&&h()},[c,p,_,i,o,u,a,f]}class ap extends De{constructor(e){super(),Pe(this,e,rp,op,$e,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function ef(t,e,l){const n=t.slice();return n[103]=e[l],n[104]=e,n[105]=l,n}function tf(t,e,l){const n=t.slice();return n[106]=e[l],n[107]=e,n[108]=l,n}function up(t,e,l){const n=t.slice();return n[109]=e[l],n}function fp(t,e,l){const n=t.slice();return n[112]=e[l],n}function cp(t){let e,l;return{c(){e=m("option"),l=$(t[112]),e.__value=t[112],e.value=e.__value},m(n,i){y(n,e,i),s(e,l)},p:_e,d(n){n&&w(e)}}}function lf(t){let e,l,n,i;return{c(){e=m("br"),l=m("input"),r(l,"name","pt"),r(l,"type","text"),r(l,"class","in-s"),r(l,"placeholder","ENTSO-E API key, optional, read docs")},m(o,u){y(o,e,u),y(o,l,u),ne(l,t[3].p.t),n||(i=le(l,"input",t[22]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].p.t&&ne(l,o[3].p.t)},d(o){o&&w(e),o&&w(l),n=!1,i()}}}function nf(t){let e,l,n,i,o,u,a,c,f,p,_,h,v;return{c(){e=m("div"),l=$("Username"),n=m("br"),i=b(),o=m("input"),u=b(),a=m("div"),c=$("Password"),f=m("br"),p=b(),_=m("input"),r(o,"name","gu"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(_,"name","gp"),r(_,"type","password"),r(_,"class","in-s"),r(a,"class","my-1")},m(d,C){y(d,e,C),s(e,l),s(e,n),s(e,i),s(e,o),ne(o,t[3].g.u),y(d,u,C),y(d,a,C),s(a,c),s(a,f),s(a,p),s(a,_),ne(_,t[3].g.p),h||(v=[le(o,"input",t[24]),le(_,"input",t[25])],h=!0)},p(d,C){C[0]&8&&o.value!==d[3].g.u&&ne(o,d[3].g.u),C[0]&8&&_.value!==d[3].g.p&&ne(_,d[3].g.p)},d(d){d&&w(e),d&&w(u),d&&w(a),h=!1,Ge(v)}}}function mp(t){let e,l=t[109]*100+"",n;return{c(){e=m("option"),n=$(l),e.__value=t[109]*100,e.value=e.__value},m(i,o){y(i,e,o),s(e,n)},p:_e,d(i){i&&w(e)}}}function sf(t){let e,l,n,i;return{c(){e=m("br"),l=m("input"),r(l,"name","mek"),r(l,"type","text"),r(l,"class","in-s")},m(o,u){y(o,e,u),y(o,l,u),ne(l,t[3].m.e.k),n||(i=le(l,"input",t[35]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].m.e.k&&ne(l,o[3].m.e.k)},d(o){o&&w(e),o&&w(l),n=!1,i()}}}function of(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=$("Authentication key"),n=m("br"),i=b(),o=m("input"),r(o,"name","mea"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1")},m(c,f){y(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),ne(o,t[3].m.e.a),u||(a=le(o,"input",t[36]),u=!0)},p(c,f){f[0]&8&&o.value!==c[3].m.e.a&&ne(o,c[3].m.e.a)},d(c){c&&w(e),u=!1,a()}}}function rf(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M,N,T,P,F,A,I,D,O,ie,H;return{c(){e=m("div"),l=m("div"),n=$("Watt"),i=m("br"),o=b(),u=m("input"),a=b(),c=m("div"),f=$("Volt"),p=m("br"),_=b(),h=m("input"),v=b(),d=m("div"),C=$("Amp"),M=m("br"),N=b(),T=m("input"),P=b(),F=m("div"),A=$("kWh"),I=m("br"),D=b(),O=m("input"),r(u,"name","mmw"),r(u,"type","number"),r(u,"min","0.00"),r(u,"max","1000"),r(u,"step","0.001"),r(u,"class","in-f tr w-full"),r(l,"class","w-1/4"),r(h,"name","mmv"),r(h,"type","number"),r(h,"min","0.00"),r(h,"max","1000"),r(h,"step","0.001"),r(h,"class","in-m tr w-full"),r(c,"class","w-1/4"),r(T,"name","mma"),r(T,"type","number"),r(T,"min","0.00"),r(T,"max","1000"),r(T,"step","0.001"),r(T,"class","in-m tr w-full"),r(d,"class","w-1/4"),r(O,"name","mmc"),r(O,"type","number"),r(O,"min","0.00"),r(O,"max","1000"),r(O,"step","0.001"),r(O,"class","in-l tr w-full"),r(F,"class","w-1/4"),r(e,"class","flex my-1")},m(K,G){y(K,e,G),s(e,l),s(l,n),s(l,i),s(l,o),s(l,u),ne(u,t[3].m.m.w),s(e,a),s(e,c),s(c,f),s(c,p),s(c,_),s(c,h),ne(h,t[3].m.m.v),s(e,v),s(e,d),s(d,C),s(d,M),s(d,N),s(d,T),ne(T,t[3].m.m.a),s(e,P),s(e,F),s(F,A),s(F,I),s(F,D),s(F,O),ne(O,t[3].m.m.c),ie||(H=[le(u,"input",t[38]),le(h,"input",t[39]),le(T,"input",t[40]),le(O,"input",t[41])],ie=!0)},p(K,G){G[0]&8&&he(u.value)!==K[3].m.m.w&&ne(u,K[3].m.m.w),G[0]&8&&he(h.value)!==K[3].m.m.v&&ne(h,K[3].m.m.v),G[0]&8&&he(T.value)!==K[3].m.m.a&&ne(T,K[3].m.m.a),G[0]&8&&he(O.value)!==K[3].m.m.c&&ne(O,K[3].m.m.c)},d(K){K&&w(e),ie=!1,Ge(H)}}}function af(t){let e;return{c(){e=m("option"),e.textContent="Ethernet",e.__value=3,e.value=e.__value},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function uf(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M,N,T,P,F,A,I,D,O,ie,H,K,G,Y,Q,z,Z,V,j,ee,ue,x,W;return{c(){e=m("div"),l=$("SSID"),n=m("br"),i=b(),o=m("input"),u=b(),a=m("div"),c=$("Password"),f=m("br"),p=b(),_=m("input"),h=b(),v=m("div"),d=m("div"),C=$("Power saving"),M=m("br"),N=b(),T=m("select"),P=m("option"),P.textContent="Default",F=m("option"),F.textContent="Off",A=m("option"),A.textContent="Minimum",I=m("option"),I.textContent="Maximum",D=b(),O=m("div"),ie=$("Power"),H=m("br"),K=b(),G=m("div"),Y=m("input"),Q=b(),z=m("span"),z.textContent="dBm",Z=b(),V=m("div"),j=m("label"),ee=m("input"),ue=$(" Allow 802.11b legacy rates"),r(o,"name","ws"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(_,"name","wp"),r(_,"type","password"),r(_,"class","in-s"),r(a,"class","my-1"),P.__value=255,P.value=P.__value,F.__value=0,F.value=F.__value,A.__value=1,A.value=A.__value,I.__value=2,I.value=I.__value,r(T,"name","wz"),r(T,"class","in-s"),t[3].w.z===void 0&&Ke(()=>t[45].call(T)),r(d,"class","w-1/2"),r(Y,"name","ww"),r(Y,"type","number"),r(Y,"min","0"),r(Y,"max","20.5"),r(Y,"step","0.5"),r(Y,"class","in-f tr w-full"),r(z,"class","in-post"),r(G,"class","flex"),r(O,"class","ml-2 w-1/2"),r(v,"class","my-1 flex"),r(ee,"type","checkbox"),r(ee,"name","wb"),ee.__value="true",ee.value=ee.__value,r(ee,"class","rounded mb-1"),r(V,"class","my-3")},m(U,ke){y(U,e,ke),s(e,l),s(e,n),s(e,i),s(e,o),ne(o,t[3].w.s),y(U,u,ke),y(U,a,ke),s(a,c),s(a,f),s(a,p),s(a,_),ne(_,t[3].w.p),y(U,h,ke),y(U,v,ke),s(v,d),s(d,C),s(d,M),s(d,N),s(d,T),s(T,P),s(T,F),s(T,A),s(T,I),Te(T,t[3].w.z,!0),s(v,D),s(v,O),s(O,ie),s(O,H),s(O,K),s(O,G),s(G,Y),ne(Y,t[3].w.w),s(G,Q),s(G,z),y(U,Z,ke),y(U,V,ke),s(V,j),s(j,ee),ee.checked=t[3].w.b,s(j,ue),x||(W=[le(o,"input",t[43]),le(_,"input",t[44]),le(T,"change",t[45]),le(Y,"input",t[46]),le(ee,"change",t[47])],x=!0)},p(U,ke){ke[0]&8&&o.value!==U[3].w.s&&ne(o,U[3].w.s),ke[0]&8&&_.value!==U[3].w.p&&ne(_,U[3].w.p),ke[0]&8&&Te(T,U[3].w.z),ke[0]&8&&he(Y.value)!==U[3].w.w&&ne(Y,U[3].w.w),ke[0]&8&&(ee.checked=U[3].w.b)},d(U){U&&w(e),U&&w(u),U&&w(a),U&&w(h),U&&w(v),U&&w(Z),U&&w(V),x=!1,Ge(W)}}}function ff(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M;return{c(){e=m("div"),l=$("Gateway"),n=m("br"),i=b(),o=m("input"),u=b(),a=m("div"),c=$("DNS"),f=m("br"),p=b(),_=m("div"),h=m("input"),v=b(),d=m("input"),r(o,"name","ng"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(h,"name","nd1"),r(h,"type","text"),r(h,"class","in-f w-full"),r(d,"name","nd2"),r(d,"type","text"),r(d,"class","in-l w-full"),r(_,"class","flex"),r(a,"class","my-1")},m(N,T){y(N,e,T),s(e,l),s(e,n),s(e,i),s(e,o),ne(o,t[3].n.g),y(N,u,T),y(N,a,T),s(a,c),s(a,f),s(a,p),s(a,_),s(_,h),ne(h,t[3].n.d1),s(_,v),s(_,d),ne(d,t[3].n.d2),C||(M=[le(o,"input",t[51]),le(h,"input",t[52]),le(d,"input",t[53])],C=!0)},p(N,T){T[0]&8&&o.value!==N[3].n.g&&ne(o,N[3].n.g),T[0]&8&&h.value!==N[3].n.d1&&ne(h,N[3].n.d1),T[0]&8&&d.value!==N[3].n.d2&&ne(d,N[3].n.d2)},d(N){N&&w(e),N&&w(u),N&&w(a),C=!1,Ge(M)}}}function cf(t){let e,l,n,i,o;return{c(){e=m("label"),l=m("input"),n=$(" SSL"),r(l,"type","checkbox"),r(l,"name","qs"),l.__value="true",l.value=l.__value,r(l,"class","rounded mb-1"),r(e,"class","float-right mr-3")},m(u,a){y(u,e,a),s(e,l),l.checked=t[3].q.s.e,s(e,n),i||(o=[le(l,"change",t[57]),le(l,"change",t[14])],i=!0)},p(u,a){a[0]&8&&(l.checked=u[3].q.s.e)},d(u){u&&w(e),i=!1,Ge(o)}}}function mf(t){let e,l,n,i,o,u,a,c,f,p,_,h,v;const d=[_p,pp],C=[];function M(D,O){return D[3].q.s.c?0:1}n=M(t),i=C[n]=d[n](t);const N=[bp,hp],T=[];function P(D,O){return D[3].q.s.r?0:1}a=P(t),c=T[a]=N[a](t);const F=[yp,wp],A=[];function I(D,O){return D[3].q.s.k?0:1}return _=I(t),h=A[_]=F[_](t),{c(){e=m("div"),l=m("span"),i.c(),o=b(),u=m("span"),c.c(),f=b(),p=m("span"),h.c(),r(l,"class","flex pr-2"),r(u,"class","flex pr-2"),r(p,"class","flex pr-2"),r(e,"class","my-1 flex")},m(D,O){y(D,e,O),s(e,l),C[n].m(l,null),s(e,o),s(e,u),T[a].m(u,null),s(e,f),s(e,p),A[_].m(p,null),v=!0},p(D,O){let ie=n;n=M(D),n===ie?C[n].p(D,O):(Ie(),B(C[ie],1,1,()=>{C[ie]=null}),Re(),i=C[n],i?i.p(D,O):(i=C[n]=d[n](D),i.c()),R(i,1),i.m(l,null));let H=a;a=P(D),a===H?T[a].p(D,O):(Ie(),B(T[H],1,1,()=>{T[H]=null}),Re(),c=T[a],c?c.p(D,O):(c=T[a]=N[a](D),c.c()),R(c,1),c.m(u,null));let K=_;_=I(D),_===K?A[_].p(D,O):(Ie(),B(A[K],1,1,()=>{A[K]=null}),Re(),h=A[_],h?h.p(D,O):(h=A[_]=F[_](D),h.c()),R(h,1),h.m(p,null))},i(D){v||(R(i),R(c),R(h),v=!0)},o(D){B(i),B(c),B(h),v=!1},d(D){D&&w(e),C[n].d(),T[a].d(),A[_].d()}}}function pp(t){let e,l;return e=new ol({props:{to:"/mqtt-ca",$$slots:{default:[dp]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i[3]&4194304&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function _p(t){let e,l,n,i,o,u,a,c;return l=new ol({props:{to:"/mqtt-ca",$$slots:{default:[vp]},$$scope:{ctx:t}}}),o=new $o({}),{c(){e=m("span"),re(l.$$.fragment),n=b(),i=m("span"),re(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,p){y(f,e,p),se(l,e,null),y(f,n,p),y(f,i,p),se(o,i,null),u=!0,a||(c=[le(i,"click",t[11]),le(i,"keypress",t[11])],a=!0)},p(f,p){const _={};p[3]&4194304&&(_.$$scope={dirty:p,ctx:f}),l.$set(_)},i(f){u||(R(l.$$.fragment,f),R(o.$$.fragment,f),u=!0)},o(f){B(l.$$.fragment,f),B(o.$$.fragment,f),u=!1},d(f){f&&w(e),oe(l),f&&w(n),f&&w(i),oe(o),a=!1,Ge(c)}}}function dp(t){let e,l;return e=new fn({props:{color:"blue",text:"Upload CA",title:"Click here to upload CA"}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p:_e,i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function vp(t){let e;return{c(){e=$("CA OK")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function hp(t){let e,l;return e=new ol({props:{to:"/mqtt-cert",$$slots:{default:[gp]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i[3]&4194304&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function bp(t){let e,l,n,i,o,u,a,c;return l=new ol({props:{to:"/mqtt-cert",$$slots:{default:[kp]},$$scope:{ctx:t}}}),o=new $o({}),{c(){e=m("span"),re(l.$$.fragment),n=b(),i=m("span"),re(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,p){y(f,e,p),se(l,e,null),y(f,n,p),y(f,i,p),se(o,i,null),u=!0,a||(c=[le(i,"click",t[12]),le(i,"keypress",t[12])],a=!0)},p(f,p){const _={};p[3]&4194304&&(_.$$scope={dirty:p,ctx:f}),l.$set(_)},i(f){u||(R(l.$$.fragment,f),R(o.$$.fragment,f),u=!0)},o(f){B(l.$$.fragment,f),B(o.$$.fragment,f),u=!1},d(f){f&&w(e),oe(l),f&&w(n),f&&w(i),oe(o),a=!1,Ge(c)}}}function gp(t){let e,l;return e=new fn({props:{color:"blue",text:"Upload cert",title:"Click here to upload certificate"}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p:_e,i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function kp(t){let e;return{c(){e=$("Cert OK")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function wp(t){let e,l;return e=new ol({props:{to:"/mqtt-key",$$slots:{default:[Cp]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i[3]&4194304&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function yp(t){let e,l,n,i,o,u,a,c;return l=new ol({props:{to:"/mqtt-key",$$slots:{default:[Mp]},$$scope:{ctx:t}}}),o=new $o({}),{c(){e=m("span"),re(l.$$.fragment),n=b(),i=m("span"),re(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,p){y(f,e,p),se(l,e,null),y(f,n,p),y(f,i,p),se(o,i,null),u=!0,a||(c=[le(i,"click",t[13]),le(i,"keypress",t[13])],a=!0)},p(f,p){const _={};p[3]&4194304&&(_.$$scope={dirty:p,ctx:f}),l.$set(_)},i(f){u||(R(l.$$.fragment,f),R(o.$$.fragment,f),u=!0)},o(f){B(l.$$.fragment,f),B(o.$$.fragment,f),u=!1},d(f){f&&w(e),oe(l),f&&w(n),f&&w(i),oe(o),a=!1,Ge(c)}}}function Cp(t){let e,l;return e=new fn({props:{color:"blue",text:"Upload key",title:"Click here to upload key"}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p:_e,i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function Mp(t){let e;return{c(){e=$("Key OK")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function pf(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M,N,T,P,F,A,I,D,O,ie,H,K,G,Y,Q,z,Z;return o=new Bt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Domoticz",n=b(),i=m("a"),re(o.$$.fragment),u=b(),a=m("input"),c=b(),f=m("div"),p=m("div"),_=$("Electricity IDX"),h=m("br"),v=b(),d=m("input"),C=b(),M=m("div"),N=$("Current IDX"),T=m("br"),P=b(),F=m("input"),A=b(),I=m("div"),D=$(`Voltage IDX: L1, L2 & L3 - `),O=m("div"),ie=m("input"),H=b(),K=m("input"),G=b(),Y=m("input"),r(l,"class","text-sm"),r(i,"href",Ut("MQTT-configuration#domoticz")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","o"),a.value="true",r(d,"name","oe"),r(d,"type","text"),r(d,"class","in-f tr w-full"),r(p,"class","w-1/2"),r(F,"name","oc"),r(F,"type","text"),r(F,"class","in-l tr w-full"),r(M,"class","w-1/2"),r(f,"class","my-1 flex"),r(ie,"name","ou1"),r(ie,"type","text"),r(ie,"class","in-f tr w-1/3"),r(K,"name","ou2"),r(K,"type","text"),r(K,"class","in-m tr w-1/3"),r(Y,"name","ou3"),r(Y,"type","text"),r(Y,"class","in-l tr w-1/3"),r(O,"class","flex"),r(I,"class","my-1"),r(e,"class","cnt")},m(V,j){y(V,e,j),s(e,l),s(e,n),s(e,i),se(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,p),s(p,_),s(p,h),s(p,v),s(p,d),ne(d,t[3].o.e),s(f,C),s(f,M),s(M,N),s(M,T),s(M,P),s(M,F),ne(F,t[3].o.c),s(e,A),s(e,I),s(I,D),s(I,O),s(O,ie),ne(ie,t[3].o.u1),s(O,H),s(O,K),ne(K,t[3].o.u2),s(O,G),s(O,Y),ne(Y,t[3].o.u3),Q=!0,z||(Z=[le(d,"input",t[65]),le(F,"input",t[66]),le(ie,"input",t[67]),le(K,"input",t[68]),le(Y,"input",t[69])],z=!0)},p(V,j){j[0]&8&&d.value!==V[3].o.e&&ne(d,V[3].o.e),j[0]&8&&F.value!==V[3].o.c&&ne(F,V[3].o.c),j[0]&8&&ie.value!==V[3].o.u1&&ne(ie,V[3].o.u1),j[0]&8&&K.value!==V[3].o.u2&&ne(K,V[3].o.u2),j[0]&8&&Y.value!==V[3].o.u3&&ne(Y,V[3].o.u3)},i(V){Q||(R(o.$$.fragment,V),Q=!0)},o(V){B(o.$$.fragment,V),Q=!1},d(V){V&&w(e),oe(o),z=!1,Ge(Z)}}}function _f(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M,N,T,P,F,A,I,D,O,ie,H,K,G,Y;return o=new Bt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Home-Assistant",n=b(),i=m("a"),re(o.$$.fragment),u=b(),a=m("input"),c=b(),f=m("div"),p=$("Discovery topic prefix"),_=m("br"),h=b(),v=m("input"),d=b(),C=m("div"),M=$("Hostname for URL"),N=m("br"),T=b(),P=m("input"),A=b(),I=m("div"),D=$("Name tag"),O=m("br"),ie=b(),H=m("input"),r(l,"class","text-sm"),r(i,"href",Ut("MQTT-configuration#home-assistant")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","h"),a.value="true",r(v,"name","ht"),r(v,"type","text"),r(v,"class","in-s"),r(v,"placeholder","homeassistant"),r(f,"class","my-1"),r(P,"name","hh"),r(P,"type","text"),r(P,"class","in-s"),r(P,"placeholder",F=t[3].g.h+".local"),r(C,"class","my-1"),r(H,"name","hn"),r(H,"type","text"),r(H,"class","in-s"),r(I,"class","my-1"),r(e,"class","cnt")},m(Q,z){y(Q,e,z),s(e,l),s(e,n),s(e,i),se(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,p),s(f,_),s(f,h),s(f,v),ne(v,t[3].h.t),s(e,d),s(e,C),s(C,M),s(C,N),s(C,T),s(C,P),ne(P,t[3].h.h),s(e,A),s(e,I),s(I,D),s(I,O),s(I,ie),s(I,H),ne(H,t[3].h.n),K=!0,G||(Y=[le(v,"input",t[70]),le(P,"input",t[71]),le(H,"input",t[72])],G=!0)},p(Q,z){z[0]&8&&v.value!==Q[3].h.t&&ne(v,Q[3].h.t),(!K||z[0]&8&&F!==(F=Q[3].g.h+".local"))&&r(P,"placeholder",F),z[0]&8&&P.value!==Q[3].h.h&&ne(P,Q[3].h.h),z[0]&8&&H.value!==Q[3].h.n&&ne(H,Q[3].h.n)},i(Q){K||(R(o.$$.fragment,Q),K=!0)},o(Q){B(o.$$.fragment,Q),K=!1},d(Q){Q&&w(e),oe(o),G=!1,Ge(Y)}}}function df(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M,N,T,P,F,A,I,D,O,ie,H,K,G,Y,Q,z,Z,V,j,ee,ue;o=new Bt({});let x=t[3].c.es&&vf(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Cloud connections",n=b(),i=m("a"),re(o.$$.fragment),u=b(),a=m("input"),c=b(),f=m("div"),p=m("label"),_=m("input"),h=$(" Enable cloud upload"),v=b(),d=m("div"),C=$("Client ID"),M=m("br"),N=b(),T=m("input"),A=b(),I=m("div"),D=$("Client secret"),O=m("br"),ie=b(),H=m("input"),G=b(),Y=m("div"),Q=m("label"),z=m("input"),Z=$(" Energy Speedometer"),V=b(),x&&x.c(),r(l,"class","text-sm"),r(i,"href",Ut("Cloud")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","c"),a.value="true",r(_,"type","checkbox"),r(_,"name","ce"),_.__value="true",_.value=_.__value,r(_,"class","rounded mb-1"),r(f,"class","my-1"),r(T,"name","ci"),r(T,"type","text"),r(T,"class","in-s"),r(T,"pattern",P=t[3].c.e?"[A-Z0-9]{16}":".*"),T.required=F=t[3].c.e,r(d,"class","my-1"),r(H,"name","cs"),r(H,"type","text"),r(H,"class","in-s"),r(H,"pattern",K=t[3].c.e&&t[3].c.s!="***"?"[A-Z0-9]{16}":".*"),r(I,"class","my-1"),r(z,"type","checkbox"),r(z,"class","rounded mb-1"),r(z,"name","ces"),z.__value="true",z.value=z.__value,r(Y,"class","my-1"),r(e,"class","cnt")},m(W,U){y(W,e,U),s(e,l),s(e,n),s(e,i),se(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,p),s(p,_),_.checked=t[3].c.e,s(p,h),s(e,v),s(e,d),s(d,C),s(d,M),s(d,N),s(d,T),ne(T,t[3].c.i),s(e,A),s(e,I),s(I,D),s(I,O),s(I,ie),s(I,H),ne(H,t[3].c.s),s(e,G),s(e,Y),s(Y,Q),s(Q,z),z.checked=t[3].c.es,s(Q,Z),s(Y,V),x&&x.m(Y,null),j=!0,ee||(ue=[le(_,"change",t[73]),le(T,"input",t[74]),le(H,"input",t[75]),le(z,"change",t[76])],ee=!0)},p(W,U){U[0]&8&&(_.checked=W[3].c.e),(!j||U[0]&8&&P!==(P=W[3].c.e?"[A-Z0-9]{16}":".*"))&&r(T,"pattern",P),(!j||U[0]&8&&F!==(F=W[3].c.e))&&(T.required=F),U[0]&8&&T.value!==W[3].c.i&&ne(T,W[3].c.i),(!j||U[0]&8&&K!==(K=W[3].c.e&&W[3].c.s!="***"?"[A-Z0-9]{16}":".*"))&&r(H,"pattern",K),U[0]&8&&H.value!==W[3].c.s&&ne(H,W[3].c.s),U[0]&8&&(z.checked=W[3].c.es),W[3].c.es?x?(x.p(W,U),U[0]&8&&R(x,1)):(x=vf(W),x.c(),R(x,1),x.m(Y,null)):x&&(Ie(),B(x,1,1,()=>{x=null}),Re())},i(W){j||(R(o.$$.fragment,W),R(x),j=!0)},o(W){B(o.$$.fragment,W),B(x),j=!1},d(W){W&&w(e),oe(o),x&&x.d(),ee=!1,Ge(ue)}}}function vf(t){let e,l,n=t[0].mac+"",i,o,u,a,c=(t[0].meter.id?t[0].meter.id:"missing, required")+"",f,p,_,h,v=t[0].mac&&t[0].meter.id&&hf(t);return{c(){e=m("div"),l=$("MAC: "),i=$(n),o=b(),u=m("div"),a=$("Meter ID: "),f=$(c),p=b(),v&&v.c(),_=Ve(),r(e,"class","pl-5"),r(u,"class","pl-5")},m(d,C){y(d,e,C),s(e,l),s(e,i),y(d,o,C),y(d,u,C),s(u,a),s(u,f),y(d,p,C),v&&v.m(d,C),y(d,_,C),h=!0},p(d,C){(!h||C[0]&1)&&n!==(n=d[0].mac+"")&&X(i,n),(!h||C[0]&1)&&c!==(c=(d[0].meter.id?d[0].meter.id:"missing, required")+"")&&X(f,c),d[0].mac&&d[0].meter.id?v?(v.p(d,C),C[0]&1&&R(v,1)):(v=hf(d),v.c(),R(v,1),v.m(_.parentNode,_)):v&&(Ie(),B(v,1,1,()=>{v=null}),Re())},i(d){h||(R(v),h=!0)},o(d){B(v),h=!1},d(d){d&&w(e),d&&w(o),d&&w(u),d&&w(p),v&&v.d(d),d&&w(_)}}}function hf(t){let e,l,n;return l=new ap({props:{value:'{"mac":"'+t[0].mac+'","meter":"'+t[0].meter.id+'"}'}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","pl-2")},m(i,o){y(i,e,o),se(l,e,null),n=!0},p(i,o){const u={};o[0]&1&&(u.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(u)},i(i){n||(R(l.$$.fragment,i),n=!0)},o(i){B(l.$$.fragment,i),n=!1},d(i){i&&w(e),oe(l)}}}function bf(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M,N,T,P;o=new Bt({});let F={length:9},A=[];for(let I=0;I20&&yf(t),_=t[3].i.d.d>0&&Tf(t),h=t[0].chip=="esp8266"&&Sf(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Hardware",n=b(),i=m("a"),re(o.$$.fragment),u=b(),p&&p.c(),a=b(),_&&_.c(),c=b(),h&&h.c(),r(l,"class","text-sm"),r(i,"href",Ut("GPIO-configuration")),r(i,"target","_blank"),r(i,"class","float-right"),r(e,"class","cnt")},m(v,d){y(v,e,d),s(e,l),s(e,n),s(e,i),se(o,i,null),s(e,u),p&&p.m(e,null),s(e,a),_&&_.m(e,null),s(e,c),h&&h.m(e,null),f=!0},p(v,d){v[0].board>20?p?(p.p(v,d),d[0]&1&&R(p,1)):(p=yf(v),p.c(),R(p,1),p.m(e,a)):p&&(Ie(),B(p,1,1,()=>{p=null}),Re()),v[3].i.d.d>0?_?_.p(v,d):(_=Tf(v),_.c(),_.m(e,c)):_&&(_.d(1),_=null),v[0].chip=="esp8266"?h?h.p(v,d):(h=Sf(v),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i(v){f||(R(o.$$.fragment,v),R(p),f=!0)},o(v){B(o.$$.fragment,v),B(p),f=!1},d(v){v&&w(e),oe(o),p&&p.d(),_&&_.d(),h&&h.d()}}}function yf(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M,N,T,P,F,A,I,D,O,ie,H,K,G,Y,Q,z,Z,V,j,ee,ue,x,W,U,ke,He,Be,We,Ne,ge,Le,Me,S,g,k,E,L,J,te,fe,de,we,Ee,ae,Ce,Je,Et,st,ht,lt,At,Ye,Qt,Ht,bt,ze,xe,Xe,Ue,qe,et;f=new fo({props:{chip:t[0].chip}}),M=new fo({props:{chip:t[0].chip}});let Ae=t[0].chip!="esp8266"&&Cf(t),Oe=t[3].i.v.p>0&&Mf(t);return{c(){e=m("input"),l=b(),n=m("div"),i=m("div"),o=$("HAN RX"),u=m("br"),a=b(),c=m("select"),re(f.$$.fragment),p=b(),_=m("div"),h=$("HAN TX"),v=m("br"),d=b(),C=m("select"),re(M.$$.fragment),N=b(),T=m("div"),P=m("label"),F=m("input"),A=$(" pullup"),I=b(),D=m("div"),O=m("div"),ie=$("AP button"),H=m("br"),K=b(),G=m("input"),Y=b(),Q=m("div"),z=$("LED"),Z=m("br"),V=b(),j=m("div"),ee=m("input"),ue=b(),x=m("div"),W=m("label"),U=m("input"),ke=$(" inverted"),He=b(),Be=m("div"),We=$("RGB"),Ne=m("label"),ge=m("input"),Le=$(" inverted"),Me=m("br"),S=b(),g=m("div"),k=m("input"),E=b(),L=m("input"),J=b(),te=m("input"),fe=b(),de=m("div"),we=m("div"),Ee=$(`LED dis. GPIO - `),ae=m("input"),Ce=b(),Je=m("div"),Et=$("Temperature"),st=m("br"),ht=b(),lt=m("input"),At=b(),Ye=m("div"),Qt=$("Analog temp"),Ht=m("br"),bt=b(),ze=m("input"),xe=b(),Ae&&Ae.c(),Xe=b(),Oe&&Oe.c(),r(e,"type","hidden"),r(e,"name","i"),e.value="true",r(c,"name","ihp"),r(c,"class","in-f w-full"),t[3].i.h.p===void 0&&Ke(()=>t[80].call(c)),r(i,"class","w-1/3"),r(C,"name","iht"),r(C,"class","in-l w-full"),t[3].i.h.t===void 0&&Ke(()=>t[81].call(C)),r(_,"class","w-1/3"),r(F,"name","ihu"),F.__value="true",F.value=F.__value,r(F,"type","checkbox"),r(F,"class","rounded mb-1"),r(P,"class","ml-2"),r(T,"class","w-1/3"),r(n,"class","flex flex-wrap"),r(G,"name","ia"),r(G,"type","number"),r(G,"min","0"),r(G,"max",t[6]),r(G,"class","in-f tr w-full"),r(O,"class","w-1/3"),r(ee,"name","ilp"),r(ee,"type","number"),r(ee,"min","0"),r(ee,"max",t[6]),r(ee,"class","in-l tr w-full"),r(j,"class","flex"),r(Q,"class","w-1/3"),r(U,"name","ili"),U.__value="true",U.value=U.__value,r(U,"type","checkbox"),r(U,"class","rounded mb-1"),r(W,"class","ml-4"),r(x,"class","w-1/3"),r(ge,"name","iri"),ge.__value="true",ge.value=ge.__value,r(ge,"type","checkbox"),r(ge,"class","rounded mb-1"),r(Ne,"class","ml-4"),r(k,"name","irr"),r(k,"type","number"),r(k,"min","0"),r(k,"max",t[6]),r(k,"class","in-f tr w-1/3"),r(L,"name","irg"),r(L,"type","number"),r(L,"min","0"),r(L,"max",t[6]),r(L,"class","in-m tr w-1/3"),r(te,"name","irb"),r(te,"type","number"),r(te,"min","0"),r(te,"max",t[6]),r(te,"class","in-l tr w-1/3"),r(g,"class","flex"),r(Be,"class","w-full"),r(ae,"name","idd"),r(ae,"type","number"),r(ae,"min","0"),r(ae,"max",t[6]),r(ae,"class","in-s tr"),r(we,"class","my-1 pr-1 w-1/3"),r(de,"class","w-full"),r(lt,"name","itd"),r(lt,"type","number"),r(lt,"min","0"),r(lt,"max",t[6]),r(lt,"class","in-f tr w-full"),r(Je,"class","my-1 w-1/3"),r(ze,"name","ita"),r(ze,"type","number"),r(ze,"min","0"),r(ze,"max",t[6]),r(ze,"class","in-l tr w-full"),r(Ye,"class","my-1 pr-1 w-1/3"),r(D,"class","flex flex-wrap")},m(pe,ce){y(pe,e,ce),y(pe,l,ce),y(pe,n,ce),s(n,i),s(i,o),s(i,u),s(i,a),s(i,c),se(f,c,null),Te(c,t[3].i.h.p,!0),s(n,p),s(n,_),s(_,h),s(_,v),s(_,d),s(_,C),se(M,C,null),Te(C,t[3].i.h.t,!0),s(n,N),s(n,T),s(T,P),s(P,F),F.checked=t[3].i.h.u,s(P,A),y(pe,I,ce),y(pe,D,ce),s(D,O),s(O,ie),s(O,H),s(O,K),s(O,G),ne(G,t[3].i.a),s(D,Y),s(D,Q),s(Q,z),s(Q,Z),s(Q,V),s(Q,j),s(j,ee),ne(ee,t[3].i.l.p),s(D,ue),s(D,x),s(x,W),s(W,U),U.checked=t[3].i.l.i,s(W,ke),s(D,He),s(D,Be),s(Be,We),s(Be,Ne),s(Ne,ge),ge.checked=t[3].i.r.i,s(Ne,Le),s(Be,Me),s(Be,S),s(Be,g),s(g,k),ne(k,t[3].i.r.r),s(g,E),s(g,L),ne(L,t[3].i.r.g),s(g,J),s(g,te),ne(te,t[3].i.r.b),s(D,fe),s(D,de),s(de,we),s(we,Ee),s(we,ae),ne(ae,t[3].i.d.d),s(D,Ce),s(D,Je),s(Je,Et),s(Je,st),s(Je,ht),s(Je,lt),ne(lt,t[3].i.t.d),s(D,At),s(D,Ye),s(Ye,Qt),s(Ye,Ht),s(Ye,bt),s(Ye,ze),ne(ze,t[3].i.t.a),s(D,xe),Ae&&Ae.m(D,null),s(D,Xe),Oe&&Oe.m(D,null),Ue=!0,qe||(et=[le(c,"change",t[80]),le(C,"change",t[81]),le(F,"change",t[82]),le(G,"input",t[83]),le(ee,"input",t[84]),le(U,"change",t[85]),le(ge,"change",t[86]),le(k,"input",t[87]),le(L,"input",t[88]),le(te,"input",t[89]),le(ae,"input",t[90]),le(lt,"input",t[91]),le(ze,"input",t[92])],qe=!0)},p(pe,ce){const ye={};ce[0]&1&&(ye.chip=pe[0].chip),f.$set(ye),ce[0]&8&&Te(c,pe[3].i.h.p);const zl={};ce[0]&1&&(zl.chip=pe[0].chip),M.$set(zl),ce[0]&8&&Te(C,pe[3].i.h.t),ce[0]&8&&(F.checked=pe[3].i.h.u),(!Ue||ce[0]&64)&&r(G,"max",pe[6]),ce[0]&8&&he(G.value)!==pe[3].i.a&&ne(G,pe[3].i.a),(!Ue||ce[0]&64)&&r(ee,"max",pe[6]),ce[0]&8&&he(ee.value)!==pe[3].i.l.p&&ne(ee,pe[3].i.l.p),ce[0]&8&&(U.checked=pe[3].i.l.i),ce[0]&8&&(ge.checked=pe[3].i.r.i),(!Ue||ce[0]&64)&&r(k,"max",pe[6]),ce[0]&8&&he(k.value)!==pe[3].i.r.r&&ne(k,pe[3].i.r.r),(!Ue||ce[0]&64)&&r(L,"max",pe[6]),ce[0]&8&&he(L.value)!==pe[3].i.r.g&&ne(L,pe[3].i.r.g),(!Ue||ce[0]&64)&&r(te,"max",pe[6]),ce[0]&8&&he(te.value)!==pe[3].i.r.b&&ne(te,pe[3].i.r.b),(!Ue||ce[0]&64)&&r(ae,"max",pe[6]),ce[0]&8&&he(ae.value)!==pe[3].i.d.d&&ne(ae,pe[3].i.d.d),(!Ue||ce[0]&64)&&r(lt,"max",pe[6]),ce[0]&8&&he(lt.value)!==pe[3].i.t.d&&ne(lt,pe[3].i.t.d),(!Ue||ce[0]&64)&&r(ze,"max",pe[6]),ce[0]&8&&he(ze.value)!==pe[3].i.t.a&&ne(ze,pe[3].i.t.a),pe[0].chip!="esp8266"?Ae?Ae.p(pe,ce):(Ae=Cf(pe),Ae.c(),Ae.m(D,Xe)):Ae&&(Ae.d(1),Ae=null),pe[3].i.v.p>0?Oe?Oe.p(pe,ce):(Oe=Mf(pe),Oe.c(),Oe.m(D,null)):Oe&&(Oe.d(1),Oe=null)},i(pe){Ue||(R(f.$$.fragment,pe),R(M.$$.fragment,pe),Ue=!0)},o(pe){B(f.$$.fragment,pe),B(M.$$.fragment,pe),Ue=!1},d(pe){pe&&w(e),pe&&w(l),pe&&w(n),oe(f),oe(M),pe&&w(I),pe&&w(D),Ae&&Ae.d(),Oe&&Oe.d(),qe=!1,Ge(et)}}}function Cf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=$("Vcc"),n=m("br"),i=b(),o=m("input"),r(o,"name","ivp"),r(o,"type","number"),r(o,"min","0"),r(o,"max",t[6]),r(o,"class","in-s tr w-full"),r(e,"class","my-1 pl-1 w-1/3")},m(c,f){y(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),ne(o,t[3].i.v.p),u||(a=le(o,"input",t[93]),u=!0)},p(c,f){f[0]&64&&r(o,"max",c[6]),f[0]&8&&he(o.value)!==c[3].i.v.p&&ne(o,c[3].i.v.p)},d(c){c&&w(e),u=!1,a()}}}function Mf(t){let e,l,n,i,o,u,a,c,f,p;return{c(){e=m("div"),l=$("Voltage divider"),n=m("br"),i=b(),o=m("div"),u=m("input"),a=b(),c=m("input"),r(u,"name","ivdv"),r(u,"type","number"),r(u,"min","0"),r(u,"max","65535"),r(u,"class","in-f tr w-full"),r(u,"placeholder","VCC"),r(c,"name","ivdg"),r(c,"type","number"),r(c,"min","0"),r(c,"max","65535"),r(c,"class","in-l tr w-full"),r(c,"placeholder","GND"),r(o,"class","flex"),r(e,"class","my-1")},m(_,h){y(_,e,h),s(e,l),s(e,n),s(e,i),s(e,o),s(o,u),ne(u,t[3].i.v.d.v),s(o,a),s(o,c),ne(c,t[3].i.v.d.g),f||(p=[le(u,"input",t[94]),le(c,"input",t[95])],f=!0)},p(_,h){h[0]&8&&he(u.value)!==_[3].i.v.d.v&&ne(u,_[3].i.v.d.v),h[0]&8&&he(c.value)!==_[3].i.v.d.g&&ne(c,_[3].i.v.d.g)},d(_){_&&w(e),f=!1,Ge(p)}}}function Tf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=$(`LED behaviour - `),n=m("select"),i=m("option"),i.textContent="Enabled",o=m("option"),o.textContent="Disabled",i.__value=0,i.value=i.__value,o.__value=1,o.value=o.__value,r(n,"name","idb"),r(n,"class","in-s"),t[3].i.d.b===void 0&&Ke(()=>t[96].call(n)),r(e,"class","my-1 w-full")},m(c,f){y(c,e,f),s(e,l),s(e,n),s(n,i),s(n,o),Te(n,t[3].i.d.b,!0),u||(a=le(n,"change",t[96]),u=!0)},p(c,f){f[0]&8&&Te(n,c[3].i.d.b)},d(c){c&&w(e),u=!1,a()}}}function Sf(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M,N,T=(t[0].board==2||t[0].board==100)&&$f(t);return{c(){e=m("input"),l=b(),n=m("div"),i=m("div"),o=$("Vcc offset"),u=m("br"),a=b(),c=m("input"),f=b(),p=m("div"),_=$("Multiplier"),h=m("br"),v=b(),d=m("input"),C=b(),T&&T.c(),r(e,"type","hidden"),r(e,"name","iv"),e.value="true",r(c,"name","ivo"),r(c,"type","number"),r(c,"min","0.0"),r(c,"max","3.5"),r(c,"step","0.01"),r(c,"class","in-f tr w-full"),r(i,"class","w-1/3"),r(d,"name","ivm"),r(d,"type","number"),r(d,"min","0.1"),r(d,"max","10"),r(d,"step","0.01"),r(d,"class","in-l tr w-full"),r(p,"class","w-1/3 pr-1"),r(n,"class","my-1 flex flex-wrap")},m(P,F){y(P,e,F),y(P,l,F),y(P,n,F),s(n,i),s(i,o),s(i,u),s(i,a),s(i,c),ne(c,t[3].i.v.o),s(n,f),s(n,p),s(p,_),s(p,h),s(p,v),s(p,d),ne(d,t[3].i.v.m),s(n,C),T&&T.m(n,null),M||(N=[le(c,"input",t[97]),le(d,"input",t[98])],M=!0)},p(P,F){F[0]&8&&he(c.value)!==P[3].i.v.o&&ne(c,P[3].i.v.o),F[0]&8&&he(d.value)!==P[3].i.v.m&&ne(d,P[3].i.v.m),P[0].board==2||P[0].board==100?T?T.p(P,F):(T=$f(P),T.c(),T.m(n,null)):T&&(T.d(1),T=null)},d(P){P&&w(e),P&&w(l),P&&w(n),T&&T.d(),M=!1,Ge(N)}}}function $f(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=$("Boot limit"),n=m("br"),i=b(),o=m("input"),r(o,"name","ivb"),r(o,"type","number"),r(o,"min","2.5"),r(o,"max","3.5"),r(o,"step","0.1"),r(o,"class","in-s tr w-full"),r(e,"class","w-1/3 pl-1")},m(c,f){y(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),ne(o,t[3].i.v.b),u||(a=le(o,"input",t[99]),u=!0)},p(c,f){f[0]&8&&he(o.value)!==c[3].i.v.b&&ne(o,c[3].i.v.b)},d(c){c&&w(e),u=!1,a()}}}function Nf(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M,N=t[3].d.t&&Ef();return{c(){e=m("div"),e.textContent="Debug can cause sudden reboots. Do not leave on!",l=b(),n=m("div"),i=m("label"),o=m("input"),u=$(" Enable telnet"),a=b(),N&&N.c(),c=b(),f=m("div"),p=m("select"),_=m("option"),_.textContent="Verbose",h=m("option"),h.textContent="Debug",v=m("option"),v.textContent="Info",d=m("option"),d.textContent="Warning",r(e,"class","bd-red"),r(o,"type","checkbox"),r(o,"name","dt"),o.__value="true",o.value=o.__value,r(o,"class","rounded mb-1"),r(n,"class","my-1"),_.__value=1,_.value=_.__value,h.__value=2,h.value=h.__value,v.__value=3,v.value=v.__value,d.__value=4,d.value=d.__value,r(p,"name","dl"),r(p,"class","in-s"),t[3].d.l===void 0&&Ke(()=>t[102].call(p)),r(f,"class","my-1")},m(T,P){y(T,e,P),y(T,l,P),y(T,n,P),s(n,i),s(i,o),o.checked=t[3].d.t,s(i,u),y(T,a,P),N&&N.m(T,P),y(T,c,P),y(T,f,P),s(f,p),s(p,_),s(p,h),s(p,v),s(p,d),Te(p,t[3].d.l,!0),C||(M=[le(o,"change",t[101]),le(p,"change",t[102])],C=!0)},p(T,P){P[0]&8&&(o.checked=T[3].d.t),T[3].d.t?N||(N=Ef(),N.c(),N.m(c.parentNode,c)):N&&(N.d(1),N=null),P[0]&8&&Te(p,T[3].d.l)},d(T){T&&w(e),T&&w(l),T&&w(n),T&&w(a),N&&N.d(T),T&&w(c),T&&w(f),C=!1,Ge(M)}}}function Ef(t){let e;return{c(){e=m("div"),e.textContent="Telnet is unsafe and should be off when not in use",r(e,"class","bd-red")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Tp(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M,N,T,P,F,A,I,D,O,ie,H,K,G,Y,Q,z,Z,V,j,ee,ue,x,W,U,ke,He,Be,We,Ne,ge,Le,Me,S,g,k,E,L,J,te,fe,de,we,Ee,ae,Ce,Je,Et,st,ht,lt,At,Ye,Qt,Ht,bt,ze,xe,Xe,Ue,qe,et,Ae,Oe,pe,ce,ye,zl,hl,_n,Pt,Ai,Pi,Di,bl,Ii,Ri,Li,Dt,Nl,El,Al,Oi,Fi,je,dn,qi,Pl,Dl,Bi,Gl,Ze,mt,Vl,Il,Ui,Rl,ji,Wt,vn,hn,Eo,rl,Hi,Ao,Ss,Po,fi,Xt,Do,Io,Ll,al,Ol,Ro,Wi,Lo,dt,Fl,Oo,zi,bn,gn,kn,wn,Gi,Fo,It,Vi,qo,Kl,Bo,Uo,jo,ul,yn,Cn,Ho,Mn,Yl,Wo,zo,Go,Tn,Zt,Vo,Ki,Ko,Ql,Yo,Qo,Xo,Sn,Jt,Zo,Yi,Jo,$s,xo,Xl,Qi,xt,er,tr,lr,Ns,Xi,el,nr,ir,sr,Rt,Zi,or,$n,Nn,rr,ci,ar,Zl,ur,fr,cr,zt,En,An,mr,pr,pt,Ji,_r,Pn,Dn,dr,Jl,vr,hr,br,ql,fl,In,Rn,gr,Lt,xi,es,kr,Ot,Ln,ts,ls,wr,Es,ns,is,tl,yr,Cr,mi,Mr,Bl,Tr,pi,ll,Sr,$r,Nr,ss,gl,Er,tt,os,Ar,On,Fn,Pr,_i,Dr,cl,Ir,As,Rr,Lr,qn,kl,Or,nl,Fr,Ps,xl,qr,Br,Ur,wl,jr,en,Hr,Wr,zr,yl,Gr,Bn,Un,Vr,Kr,Yr,Cl,Qr,jn,Xr,Zr,Jr,gt,Hn,Wn,zn,Gn,Vn,Kn,xr,tn,ea,ta,la,Ml,na,Ds,Is,Rs,Ls=t[3].p.r.startsWith("10YNO")||t[3].p.r.startsWith("10Y1001A1001A4"),Os,ml,rs,ia,Yn,Qn,sa,di,oa,vi,ra,Fs,Ft,as,aa,Xn,Zn,ua,hi,fa,us,fs,il,ca,ma,pa,Ul,qs,Jn,_a,cs,xn,da,ms,Bs,ln,Us,nn,js,sn,Hs,on,Gt,Ws,va;a=new Bt({}),O=new tp({});let xc=["NOK","SEK","DKK","EUR"],bi=[];for(let q=0;q<4;q+=1)bi[q]=cp(fp(t,xc,q));let kt=t[3].p.e&&t[0].chip!="esp8266"&&lf(t),wt=t[3].g.s>0&&nf(t);Dl=new Bt({});let e0=[24,48,96,192,384,576,1152],gi=[];for(let q=0;q<7;q+=1)gi[q]=mp(up(t,e0,q));let yt=t[3].m.e.e&&sf(t),Ct=t[3].m.e.e&&of(t),Mt=t[3].m.m.e&&rf(t);Nn=new Bt({});let qt=t[0].if&&t[0].if.eth&&af(),Tt=(t[3].n.c==1||t[3].n.c==2)&&uf(t);Dn=new Bt({}),Ln=new Zc({});let St=t[3].n.m=="static"&&ff(t);Fn=new Bt({});let $t=t[0].chip!="esp8266"&&cf(t),ot=t[3].q.s.e&&mf(t),rt=t[3].q.m==3&&pf(t),at=t[3].q.m==4&&_f(t),ut=t[3].c.es!=null&&df(t),ft=Ls&&bf(t);Qn=new Bt({});let ei=t[7],vt=[];for(let q=0;q20||t[0].chip=="esp8266"||t[3].i.d.d>0)&&wf(t);Zn=new Bt({});let Nt=t[3].d.s&&Nf(t);return ln=new jt({props:{active:t[1],message:"Loading configuration"}}),nn=new jt({props:{active:t[2],message:"Saving configuration"}}),sn=new jt({props:{active:t[4],message:"Performing factory reset"}}),on=new jt({props:{active:t[5],message:"Device have been factory reset and switched to AP mode"}}),{c(){e=m("form"),l=m("div"),n=m("div"),i=m("strong"),i.textContent="General",o=b(),u=m("a"),re(a.$$.fragment),c=b(),f=m("input"),p=b(),_=m("div"),h=m("div"),v=m("div"),d=$("Hostname"),C=m("br"),M=b(),N=m("input"),T=b(),P=m("div"),F=$("Time zone"),A=m("br"),I=b(),D=m("select"),re(O.$$.fragment),ie=b(),H=m("input"),K=b(),G=m("div"),Y=m("div"),Q=m("div"),z=$("Price region"),Z=m("br"),V=b(),j=m("select"),ee=m("optgroup"),ue=m("option"),ue.textContent="NO1",x=m("option"),x.textContent="NO2",W=m("option"),W.textContent="NO3",U=m("option"),U.textContent="NO4",ke=m("option"),ke.textContent="NO5",He=m("optgroup"),Be=m("option"),Be.textContent="SE1",We=m("option"),We.textContent="SE2",Ne=m("option"),Ne.textContent="SE3",ge=m("option"),ge.textContent="SE4",Le=m("optgroup"),Me=m("option"),Me.textContent="DK1",S=m("option"),S.textContent="DK2",g=m("option"),g.textContent="Austria",k=m("option"),k.textContent="Belgium",E=m("option"),E.textContent="Czech Republic",L=m("option"),L.textContent="Estonia",J=m("option"),J.textContent="Finland",te=m("option"),te.textContent="France",fe=m("option"),fe.textContent="Germany",de=m("option"),de.textContent="Great Britain",we=m("option"),we.textContent="Latvia",Ee=m("option"),Ee.textContent="Lithuania",ae=m("option"),ae.textContent="Netherland",Ce=m("option"),Ce.textContent="Poland",Je=m("option"),Je.textContent="Switzerland",Et=b(),st=m("div"),ht=$("Currency"),lt=m("br"),At=b(),Ye=m("select");for(let q=0;q<4;q+=1)bi[q].c();Qt=b(),Ht=m("div"),bt=m("div"),ze=m("div"),xe=$("Fixed price"),Xe=m("br"),Ue=b(),qe=m("input"),et=b(),Ae=m("div"),Oe=$("Multiplier"),pe=m("br"),ce=b(),ye=m("input"),zl=b(),hl=m("div"),_n=m("label"),Pt=m("input"),Ai=$(" Enable price fetch from remote server"),Pi=b(),kt&&kt.c(),Di=b(),bl=m("div"),Ii=$("Security"),Ri=m("br"),Li=b(),Dt=m("select"),Nl=m("option"),Nl.textContent="None",El=m("option"),El.textContent="Only configuration",Al=m("option"),Al.textContent="Everything",Oi=b(),wt&&wt.c(),Fi=b(),je=m("div"),dn=m("strong"),dn.textContent="Meter",qi=b(),Pl=m("a"),re(Dl.$$.fragment),Bi=b(),Gl=m("input"),Ze=b(),mt=m("input"),Vl=b(),Il=m("div"),Ui=$("Communication"),Rl=m("br"),ji=b(),Wt=m("select"),vn=m("option"),vn.textContent="Passive (Push)",hn=m("option"),hn.textContent="Kamstrup (Pull)",Eo=b(),rl=m("div"),Hi=m("span"),Hi.textContent="Buffer size",Ao=b(),Ss=m("span"),Ss.textContent="Serial conf.",Po=b(),fi=m("label"),Xt=m("input"),Do=$(" inverted"),Io=b(),Ll=m("div"),al=m("select"),Ol=m("option"),Ro=$("Autodetect");for(let q=0;q<7;q+=1)gi[q].c();Lo=b(),dt=m("select"),Fl=m("option"),Oo=$("-"),bn=m("option"),bn.textContent="7N1",gn=m("option"),gn.textContent="8N1",kn=m("option"),kn.textContent="7E1",wn=m("option"),wn.textContent="8E1",Fo=b(),It=m("input"),qo=b(),Kl=m("div"),Bo=$("Voltage"),Uo=m("br"),jo=b(),ul=m("select"),yn=m("option"),yn.textContent="400V (TN)",Cn=m("option"),Cn.textContent="230V (IT/TT)",Ho=b(),Mn=m("div"),Yl=m("div"),Wo=$("Main fuse"),zo=m("br"),Go=b(),Tn=m("label"),Zt=m("input"),Vo=b(),Ki=m("span"),Ki.textContent="A",Ko=b(),Ql=m("div"),Yo=$("Production"),Qo=m("br"),Xo=b(),Sn=m("label"),Jt=m("input"),Zo=b(),Yi=m("span"),Yi.textContent="kWp",Jo=b(),$s=m("div"),xo=b(),Xl=m("div"),Qi=m("label"),xt=m("input"),er=$(" Meter is encrypted"),tr=b(),yt&&yt.c(),lr=b(),Ct&&Ct.c(),Ns=b(),Xi=m("label"),el=m("input"),nr=$(" Multipliers"),ir=b(),Mt&&Mt.c(),sr=b(),Rt=m("div"),Zi=m("strong"),Zi.textContent="Connection",or=b(),$n=m("a"),re(Nn.$$.fragment),rr=b(),ci=m("input"),ar=b(),Zl=m("div"),ur=$("Connection"),fr=m("br"),cr=b(),zt=m("select"),En=m("option"),En.textContent="WiFi",An=m("option"),An.textContent="Access point",qt&&qt.c(),mr=b(),Tt&&Tt.c(),pr=b(),pt=m("div"),Ji=m("strong"),Ji.textContent="Network",_r=b(),Pn=m("a"),re(Dn.$$.fragment),dr=b(),Jl=m("div"),vr=$("IP"),hr=m("br"),br=b(),ql=m("div"),fl=m("select"),In=m("option"),In.textContent="DHCP",Rn=m("option"),Rn.textContent="Static",gr=b(),Lt=m("input"),kr=b(),Ot=m("select"),re(Ln.$$.fragment),wr=b(),St&&St.c(),Es=b(),ns=m("div"),is=m("label"),tl=m("input"),yr=$(" enable mDNS"),Cr=b(),mi=m("input"),Mr=b(),Bl=m("div"),Tr=$("NTP "),pi=m("label"),ll=m("input"),Sr=$(" obtain from DHCP"),$r=m("br"),Nr=b(),ss=m("div"),gl=m("input"),Er=b(),tt=m("div"),os=m("strong"),os.textContent="MQTT",Ar=b(),On=m("a"),re(Fn.$$.fragment),Pr=b(),_i=m("input"),Dr=b(),cl=m("div"),Ir=$(`Server - `),$t&&$t.c(),As=b(),Rr=m("br"),Lr=b(),qn=m("div"),kl=m("input"),Or=b(),nl=m("input"),Fr=b(),ot&&ot.c(),Ps=b(),xl=m("div"),qr=$("Username"),Br=m("br"),Ur=b(),wl=m("input"),jr=b(),en=m("div"),Hr=$("Password"),Wr=m("br"),zr=b(),yl=m("input"),Gr=b(),Bn=m("div"),Un=m("div"),Vr=$("Client ID"),Kr=m("br"),Yr=b(),Cl=m("input"),Qr=b(),jn=m("div"),Xr=$("Payload"),Zr=m("br"),Jr=b(),gt=m("select"),Hn=m("option"),Hn.textContent="JSON",Wn=m("option"),Wn.textContent="Raw (minimal)",zn=m("option"),zn.textContent="Raw (full)",Gn=m("option"),Gn.textContent="Domoticz",Vn=m("option"),Vn.textContent="HomeAssistant",Kn=m("option"),Kn.textContent="HEX dump",xr=b(),tn=m("div"),ea=$("Publish topic"),ta=m("br"),la=b(),Ml=m("input"),na=b(),rt&&rt.c(),Ds=b(),at&&at.c(),Is=b(),ut&&ut.c(),Rs=b(),ft&&ft.c(),Os=b(),ml=m("div"),rs=m("strong"),rs.textContent="User interface",ia=b(),Yn=m("a"),re(Qn.$$.fragment),sa=b(),di=m("input"),oa=b(),vi=m("div");for(let q=0;qSave',Bs=b(),re(ln.$$.fragment),Us=b(),re(nn.$$.fragment),js=b(),re(sn.$$.fragment),Hs=b(),re(on.$$.fragment),r(i,"class","text-sm"),r(u,"href",Ut("General-configuration")),r(u,"target","_blank"),r(u,"class","float-right"),r(f,"type","hidden"),r(f,"name","g"),f.value="true",r(N,"name","gh"),r(N,"type","text"),r(N,"class","in-f w-full"),r(N,"pattern","[A-Za-z0-9-]+"),r(D,"name","gt"),r(D,"class","in-l w-full"),t[3].g.t===void 0&&Ke(()=>t[16].call(D)),r(h,"class","flex"),r(_,"class","my-1"),r(H,"type","hidden"),r(H,"name","p"),H.value="true",ue.__value="10YNO-1--------2",ue.value=ue.__value,x.__value="10YNO-2--------T",x.value=x.__value,W.__value="10YNO-3--------J",W.value=W.__value,U.__value="10YNO-4--------9",U.value=U.__value,ke.__value="10Y1001A1001A48H",ke.value=ke.__value,r(ee,"label","Norway"),Be.__value="10Y1001A1001A44P",Be.value=Be.__value,We.__value="10Y1001A1001A45N",We.value=We.__value,Ne.__value="10Y1001A1001A46L",Ne.value=Ne.__value,ge.__value="10Y1001A1001A47J",ge.value=ge.__value,r(He,"label","Sweden"),Me.__value="10YDK-1--------W",Me.value=Me.__value,S.__value="10YDK-2--------M",S.value=S.__value,r(Le,"label","Denmark"),g.__value="10YAT-APG------L",g.value=g.__value,k.__value="10YBE----------2",k.value=k.__value,E.__value="10YCZ-CEPS-----N",E.value=E.__value,L.__value="10Y1001A1001A39I",L.value=L.__value,J.__value="10YFI-1--------U",J.value=J.__value,te.__value="10YFR-RTE------C",te.value=te.__value,fe.__value="10Y1001A1001A83F",fe.value=fe.__value,de.__value="10YGB----------A",de.value=de.__value,we.__value="10YLV-1001A00074",we.value=we.__value,Ee.__value="10YLT-1001A0008Q",Ee.value=Ee.__value,ae.__value="10YNL----------L",ae.value=ae.__value,Ce.__value="10YPL-AREA-----S",Ce.value=Ce.__value,Je.__value="10YCH-SWISSGRIDZ",Je.value=Je.__value,r(j,"name","pr"),r(j,"class","in-f w-full"),t[3].p.r===void 0&&Ke(()=>t[17].call(j)),r(Q,"class","w-full"),r(Ye,"name","pc"),r(Ye,"class","in-l"),t[3].p.c===void 0&&Ke(()=>t[18].call(Ye)),r(Y,"class","flex"),r(G,"class","my-1"),r(qe,"name","pf"),r(qe,"type","number"),r(qe,"min","0.001"),r(qe,"max","65"),r(qe,"step","0.001"),r(qe,"class","in-f tr w-full"),r(ze,"class","w-1/2"),r(ye,"name","pm"),r(ye,"type","number"),r(ye,"min","0.001"),r(ye,"max","1000"),r(ye,"step","0.001"),r(ye,"class","in-l tr w-full"),r(Ae,"class","w-1/2"),r(bt,"class","flex"),r(Ht,"class","my-1"),r(Pt,"type","checkbox"),r(Pt,"name","pe"),Pt.__value="true",Pt.value=Pt.__value,r(Pt,"class","rounded mb-1"),r(hl,"class","my-1"),Nl.__value=0,Nl.value=Nl.__value,El.__value=1,El.value=El.__value,Al.__value=2,Al.value=Al.__value,r(Dt,"name","gs"),r(Dt,"class","in-s"),t[3].g.s===void 0&&Ke(()=>t[23].call(Dt)),r(bl,"class","my-1"),r(n,"class","cnt"),r(dn,"class","text-sm"),r(Pl,"href",Ut("Meter-configuration")),r(Pl,"target","_blank"),r(Pl,"class","float-right"),r(Gl,"type","hidden"),r(Gl,"name","m"),Gl.value="true",r(mt,"type","hidden"),r(mt,"name","mo"),mt.value="1",vn.__value=0,vn.value=vn.__value,hn.__value=9,hn.value=hn.__value,r(Wt,"name","ma"),r(Wt,"class","in-s"),t[3].m.a===void 0&&Ke(()=>t[26].call(Wt)),r(Il,"class","my-1"),r(Hi,"class","float-right"),r(Xt,"name","mi"),Xt.__value="true",Xt.value=Xt.__value,r(Xt,"type","checkbox"),r(Xt,"class","rounded mb-1"),r(fi,"class","mt-2 ml-3 whitespace-nowrap"),Ol.__value=0,Ol.value=Ol.__value,Ol.disabled=Wi=t[3].m.b!=0,r(al,"name","mb"),r(al,"class","in-f tr w-1/2"),t[3].m.b===void 0&&Ke(()=>t[28].call(al)),Fl.__value=0,Fl.value=Fl.__value,Fl.disabled=zi=t[3].m.b!=0,bn.__value=2,bn.value=bn.__value,gn.__value=3,gn.value=gn.__value,kn.__value=10,kn.value=kn.__value,wn.__value=11,wn.value=wn.__value,r(dt,"name","mp"),r(dt,"class","in-m"),dt.disabled=Gi=t[3].m.b==0,t[3].m.p===void 0&&Ke(()=>t[29].call(dt)),r(It,"name","ms"),r(It,"type","number"),r(It,"min",64),r(It,"max",Vi=t[0].chip=="esp8266"?t[3].i.h.p==3||t[3].i.h.p==113?512:128:4096),r(It,"step",64),r(It,"class","in-l tr w-1/2"),r(Ll,"class","flex w-full"),r(rl,"class","my-1"),yn.__value=2,yn.value=yn.__value,Cn.__value=1,Cn.value=Cn.__value,r(ul,"name","md"),r(ul,"class","in-s"),t[3].m.d===void 0&&Ke(()=>t[31].call(ul)),r(Kl,"class","my-1"),r(Zt,"name","mf"),r(Zt,"type","number"),r(Zt,"min","5"),r(Zt,"max","65535"),r(Zt,"class","in-f tr w-full"),r(Ki,"class","in-post"),r(Tn,"class","flex"),r(Yl,"class","mx-1"),r(Jt,"name","mr"),r(Jt,"type","number"),r(Jt,"min","0"),r(Jt,"max","65535"),r(Jt,"class","in-f tr w-full"),r(Yi,"class","in-post"),r(Sn,"class","flex"),r(Ql,"class","mx-1"),r(Mn,"class","my-1 flex"),r($s,"class","my-1"),r(xt,"type","checkbox"),r(xt,"name","me"),xt.__value="true",xt.value=xt.__value,r(xt,"class","rounded mb-1"),r(Xl,"class","my-1"),r(el,"type","checkbox"),r(el,"name","mm"),el.__value="true",el.value=el.__value,r(el,"class","rounded mb-1"),r(je,"class","cnt"),r(Zi,"class","text-sm"),r($n,"href",Ut("WiFi-configuration")),r($n,"target","_blank"),r($n,"class","float-right"),r(ci,"type","hidden"),r(ci,"name","w"),ci.value="true",En.__value=1,En.value=En.__value,An.__value=2,An.value=An.__value,r(zt,"name","nc"),r(zt,"class","in-s"),t[3].n.c===void 0&&Ke(()=>t[42].call(zt)),r(Zl,"class","my-1"),r(Rt,"class","cnt"),r(Ji,"class","text-sm"),r(Pn,"href",Ut("Network-configuration")),r(Pn,"target","_blank"),r(Pn,"class","float-right"),In.__value="dhcp",In.value=In.__value,Rn.__value="static",Rn.value=Rn.__value,r(fl,"name","nm"),r(fl,"class","in-f"),t[3].n.m===void 0&&Ke(()=>t[48].call(fl)),r(Lt,"name","ni"),r(Lt,"type","text"),r(Lt,"class","in-m w-full"),Lt.disabled=xi=t[3].n.m=="dhcp",Lt.required=es=t[3].n.m=="static",r(Ot,"name","ns"),r(Ot,"class","in-l"),Ot.disabled=ts=t[3].n.m=="dhcp",Ot.required=ls=t[3].n.m=="static",t[3].n.s===void 0&&Ke(()=>t[50].call(Ot)),r(ql,"class","flex"),r(Jl,"class","my-1"),r(tl,"name","nd"),tl.__value="true",tl.value=tl.__value,r(tl,"type","checkbox"),r(tl,"class","rounded mb-1"),r(ns,"class","my-1"),r(mi,"type","hidden"),r(mi,"name","ntp"),mi.value="true",r(ll,"name","ntpd"),ll.__value="true",ll.value=ll.__value,r(ll,"type","checkbox"),r(ll,"class","rounded mb-1"),r(pi,"class","ml-4"),r(gl,"name","ntph"),r(gl,"type","text"),r(gl,"class","in-s"),r(ss,"class","flex"),r(Bl,"class","my-1"),r(pt,"class","cnt"),r(os,"class","text-sm"),r(On,"href",Ut("MQTT-configuration")),r(On,"target","_blank"),r(On,"class","float-right"),r(_i,"type","hidden"),r(_i,"name","q"),_i.value="true",r(kl,"name","qh"),r(kl,"type","text"),r(kl,"class","in-f w-3/4"),r(nl,"name","qp"),r(nl,"type","number"),r(nl,"min","1024"),r(nl,"max","65535"),r(nl,"class","in-l tr w-1/4"),r(qn,"class","flex"),r(cl,"class","my-1"),r(wl,"name","qu"),r(wl,"type","text"),r(wl,"class","in-s"),r(xl,"class","my-1"),r(yl,"name","qa"),r(yl,"type","password"),r(yl,"class","in-s"),r(en,"class","my-1"),r(Cl,"name","qc"),r(Cl,"type","text"),r(Cl,"class","in-f w-full"),Hn.__value=0,Hn.value=Hn.__value,Wn.__value=1,Wn.value=Wn.__value,zn.__value=2,zn.value=zn.__value,Gn.__value=3,Gn.value=Gn.__value,Vn.__value=4,Vn.value=Vn.__value,Kn.__value=255,Kn.value=Kn.__value,r(gt,"name","qm"),r(gt,"class","in-l"),t[3].q.m===void 0&&Ke(()=>t[63].call(gt)),r(Bn,"class","my-1 flex"),r(Ml,"name","qb"),r(Ml,"type","text"),r(Ml,"class","in-s"),r(tn,"class","my-1"),r(tt,"class","cnt"),r(rs,"class","text-sm"),r(Yn,"href",Ut("User-interface")),r(Yn,"target","_blank"),r(Yn,"class","float-right"),r(di,"type","hidden"),r(di,"name","u"),di.value="true",r(vi,"class","flex flex-wrap"),r(ml,"class","cnt"),r(as,"class","text-sm"),r(Xn,"href","https://amsleser.no/blog/post/24-telnet-debug"),r(Xn,"target","_blank"),r(Xn,"class","float-right"),r(hi,"type","hidden"),r(hi,"name","d"),hi.value="true",r(il,"type","checkbox"),r(il,"name","ds"),il.__value="true",il.value=il.__value,r(il,"class","rounded mb-1"),r(us,"class","mt-3"),r(Ft,"class","cnt"),r(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),r(Jn,"type","button"),r(Jn,"class","py-2 px-4 rounded bg-red-500 text-white ml-2"),r(xn,"type","button"),r(xn,"class","py-2 px-4 rounded bg-yellow-500 text-white"),r(cs,"class","text-center"),r(ms,"class","text-right"),r(Ul,"class","grid grid-cols-3"),r(e,"autocomplete","off")},m(q,me){y(q,e,me),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),se(a,u,null),s(n,c),s(n,f),s(n,p),s(n,_),s(_,h),s(h,v),s(v,d),s(v,C),s(v,M),s(v,N),ne(N,t[3].g.h),s(h,T),s(h,P),s(P,F),s(P,A),s(P,I),s(P,D),se(O,D,null),Te(D,t[3].g.t,!0),s(n,ie),s(n,H),s(n,K),s(n,G),s(G,Y),s(Y,Q),s(Q,z),s(Q,Z),s(Q,V),s(Q,j),s(j,ee),s(ee,ue),s(ee,x),s(ee,W),s(ee,U),s(ee,ke),s(j,He),s(He,Be),s(He,We),s(He,Ne),s(He,ge),s(j,Le),s(Le,Me),s(Le,S),s(j,g),s(j,k),s(j,E),s(j,L),s(j,J),s(j,te),s(j,fe),s(j,de),s(j,we),s(j,Ee),s(j,ae),s(j,Ce),s(j,Je),Te(j,t[3].p.r,!0),s(Y,Et),s(Y,st),s(st,ht),s(st,lt),s(st,At),s(st,Ye);for(let _t=0;_t<4;_t+=1)bi[_t]&&bi[_t].m(Ye,null);Te(Ye,t[3].p.c,!0),s(n,Qt),s(n,Ht),s(Ht,bt),s(bt,ze),s(ze,xe),s(ze,Xe),s(ze,Ue),s(ze,qe),ne(qe,t[3].p.f),s(bt,et),s(bt,Ae),s(Ae,Oe),s(Ae,pe),s(Ae,ce),s(Ae,ye),ne(ye,t[3].p.m),s(n,zl),s(n,hl),s(hl,_n),s(_n,Pt),Pt.checked=t[3].p.e,s(_n,Ai),s(hl,Pi),kt&&kt.m(hl,null),s(n,Di),s(n,bl),s(bl,Ii),s(bl,Ri),s(bl,Li),s(bl,Dt),s(Dt,Nl),s(Dt,El),s(Dt,Al),Te(Dt,t[3].g.s,!0),s(n,Oi),wt&&wt.m(n,null),s(l,Fi),s(l,je),s(je,dn),s(je,qi),s(je,Pl),se(Dl,Pl,null),s(je,Bi),s(je,Gl),s(je,Ze),s(je,mt),s(je,Vl),s(je,Il),s(Il,Ui),s(Il,Rl),s(Il,ji),s(Il,Wt),s(Wt,vn),s(Wt,hn),Te(Wt,t[3].m.a,!0),s(je,Eo),s(je,rl),s(rl,Hi),s(rl,Ao),s(rl,Ss),s(rl,Po),s(rl,fi),s(fi,Xt),Xt.checked=t[3].m.i,s(fi,Do),s(rl,Io),s(rl,Ll),s(Ll,al),s(al,Ol),s(Ol,Ro);for(let _t=0;_t<7;_t+=1)gi[_t]&&gi[_t].m(al,null);Te(al,t[3].m.b,!0),s(Ll,Lo),s(Ll,dt),s(dt,Fl),s(Fl,Oo),s(dt,bn),s(dt,gn),s(dt,kn),s(dt,wn),Te(dt,t[3].m.p,!0),s(Ll,Fo),s(Ll,It),ne(It,t[3].m.s),s(je,qo),s(je,Kl),s(Kl,Bo),s(Kl,Uo),s(Kl,jo),s(Kl,ul),s(ul,yn),s(ul,Cn),Te(ul,t[3].m.d,!0),s(je,Ho),s(je,Mn),s(Mn,Yl),s(Yl,Wo),s(Yl,zo),s(Yl,Go),s(Yl,Tn),s(Tn,Zt),ne(Zt,t[3].m.f),s(Tn,Vo),s(Tn,Ki),s(Mn,Ko),s(Mn,Ql),s(Ql,Yo),s(Ql,Qo),s(Ql,Xo),s(Ql,Sn),s(Sn,Jt),ne(Jt,t[3].m.r),s(Sn,Zo),s(Sn,Yi),s(je,Jo),s(je,$s),s(je,xo),s(je,Xl),s(Xl,Qi),s(Qi,xt),xt.checked=t[3].m.e.e,s(Qi,er),s(Xl,tr),yt&&yt.m(Xl,null),s(je,lr),Ct&&Ct.m(je,null),s(je,Ns),s(je,Xi),s(Xi,el),el.checked=t[3].m.m.e,s(Xi,nr),s(je,ir),Mt&&Mt.m(je,null),s(l,sr),s(l,Rt),s(Rt,Zi),s(Rt,or),s(Rt,$n),se(Nn,$n,null),s(Rt,rr),s(Rt,ci),s(Rt,ar),s(Rt,Zl),s(Zl,ur),s(Zl,fr),s(Zl,cr),s(Zl,zt),s(zt,En),s(zt,An),qt&&qt.m(zt,null),Te(zt,t[3].n.c,!0),s(Rt,mr),Tt&&Tt.m(Rt,null),s(l,pr),s(l,pt),s(pt,Ji),s(pt,_r),s(pt,Pn),se(Dn,Pn,null),s(pt,dr),s(pt,Jl),s(Jl,vr),s(Jl,hr),s(Jl,br),s(Jl,ql),s(ql,fl),s(fl,In),s(fl,Rn),Te(fl,t[3].n.m,!0),s(ql,gr),s(ql,Lt),ne(Lt,t[3].n.i),s(ql,kr),s(ql,Ot),se(Ln,Ot,null),Te(Ot,t[3].n.s,!0),s(pt,wr),St&&St.m(pt,null),s(pt,Es),s(pt,ns),s(ns,is),s(is,tl),tl.checked=t[3].n.d,s(is,yr),s(pt,Cr),s(pt,mi),s(pt,Mr),s(pt,Bl),s(Bl,Tr),s(Bl,pi),s(pi,ll),ll.checked=t[3].n.h,s(pi,Sr),s(Bl,$r),s(Bl,Nr),s(Bl,ss),s(ss,gl),ne(gl,t[3].n.n1),s(l,Er),s(l,tt),s(tt,os),s(tt,Ar),s(tt,On),se(Fn,On,null),s(tt,Pr),s(tt,_i),s(tt,Dr),s(tt,cl),s(cl,Ir),$t&&$t.m(cl,null),s(cl,As),s(cl,Rr),s(cl,Lr),s(cl,qn),s(qn,kl),ne(kl,t[3].q.h),s(qn,Or),s(qn,nl),ne(nl,t[3].q.p),s(tt,Fr),ot&&ot.m(tt,null),s(tt,Ps),s(tt,xl),s(xl,qr),s(xl,Br),s(xl,Ur),s(xl,wl),ne(wl,t[3].q.u),s(tt,jr),s(tt,en),s(en,Hr),s(en,Wr),s(en,zr),s(en,yl),ne(yl,t[3].q.a),s(tt,Gr),s(tt,Bn),s(Bn,Un),s(Un,Vr),s(Un,Kr),s(Un,Yr),s(Un,Cl),ne(Cl,t[3].q.c),s(Bn,Qr),s(Bn,jn),s(jn,Xr),s(jn,Zr),s(jn,Jr),s(jn,gt),s(gt,Hn),s(gt,Wn),s(gt,zn),s(gt,Gn),s(gt,Vn),s(gt,Kn),Te(gt,t[3].q.m,!0),s(tt,xr),s(tt,tn),s(tn,ea),s(tn,ta),s(tn,la),s(tn,Ml),ne(Ml,t[3].q.b),s(l,na),rt&&rt.m(l,null),s(l,Ds),at&&at.m(l,null),s(l,Is),ut&&ut.m(l,null),s(l,Rs),ft&&ft.m(l,null),s(l,Os),s(l,ml),s(ml,rs),s(ml,ia),s(ml,Yn),se(Qn,Yn,null),s(ml,sa),s(ml,di),s(ml,oa),s(ml,vi);for(let _t=0;_t0?wt?wt.p(q,me):(wt=nf(q),wt.c(),wt.m(n,null)):wt&&(wt.d(1),wt=null),me[0]&8&&Te(Wt,q[3].m.a),me[0]&8&&(Xt.checked=q[3].m.i),(!Gt||me[0]&8&&Wi!==(Wi=q[3].m.b!=0))&&(Ol.disabled=Wi),me[0]&8&&Te(al,q[3].m.b),(!Gt||me[0]&8&&zi!==(zi=q[3].m.b!=0))&&(Fl.disabled=zi),(!Gt||me[0]&8&&Gi!==(Gi=q[3].m.b==0))&&(dt.disabled=Gi),me[0]&8&&Te(dt,q[3].m.p),(!Gt||me[0]&9&&Vi!==(Vi=q[0].chip=="esp8266"?q[3].i.h.p==3||q[3].i.h.p==113?512:128:4096))&&r(It,"max",Vi),me[0]&8&&he(It.value)!==q[3].m.s&&ne(It,q[3].m.s),me[0]&8&&Te(ul,q[3].m.d),me[0]&8&&he(Zt.value)!==q[3].m.f&&ne(Zt,q[3].m.f),me[0]&8&&he(Jt.value)!==q[3].m.r&&ne(Jt,q[3].m.r),me[0]&8&&(xt.checked=q[3].m.e.e),q[3].m.e.e?yt?yt.p(q,me):(yt=sf(q),yt.c(),yt.m(Xl,null)):yt&&(yt.d(1),yt=null),q[3].m.e.e?Ct?Ct.p(q,me):(Ct=of(q),Ct.c(),Ct.m(je,Ns)):Ct&&(Ct.d(1),Ct=null),me[0]&8&&(el.checked=q[3].m.m.e),q[3].m.m.e?Mt?Mt.p(q,me):(Mt=rf(q),Mt.c(),Mt.m(je,null)):Mt&&(Mt.d(1),Mt=null),q[0].if&&q[0].if.eth?qt||(qt=af(),qt.c(),qt.m(zt,null)):qt&&(qt.d(1),qt=null),me[0]&8&&Te(zt,q[3].n.c),q[3].n.c==1||q[3].n.c==2?Tt?Tt.p(q,me):(Tt=uf(q),Tt.c(),Tt.m(Rt,null)):Tt&&(Tt.d(1),Tt=null),me[0]&8&&Te(fl,q[3].n.m),(!Gt||me[0]&8&&xi!==(xi=q[3].n.m=="dhcp"))&&(Lt.disabled=xi),(!Gt||me[0]&8&&es!==(es=q[3].n.m=="static"))&&(Lt.required=es),me[0]&8&&Lt.value!==q[3].n.i&&ne(Lt,q[3].n.i),(!Gt||me[0]&8&&ts!==(ts=q[3].n.m=="dhcp"))&&(Ot.disabled=ts),(!Gt||me[0]&8&&ls!==(ls=q[3].n.m=="static"))&&(Ot.required=ls),me[0]&8&&Te(Ot,q[3].n.s),q[3].n.m=="static"?St?St.p(q,me):(St=ff(q),St.c(),St.m(pt,Es)):St&&(St.d(1),St=null),me[0]&8&&(tl.checked=q[3].n.d),me[0]&8&&(ll.checked=q[3].n.h),me[0]&8&&gl.value!==q[3].n.n1&&ne(gl,q[3].n.n1),q[0].chip!="esp8266"?$t?$t.p(q,me):($t=cf(q),$t.c(),$t.m(cl,As)):$t&&($t.d(1),$t=null),me[0]&8&&kl.value!==q[3].q.h&&ne(kl,q[3].q.h),me[0]&8&&he(nl.value)!==q[3].q.p&&ne(nl,q[3].q.p),q[3].q.s.e?ot?(ot.p(q,me),me[0]&8&&R(ot,1)):(ot=mf(q),ot.c(),R(ot,1),ot.m(tt,Ps)):ot&&(Ie(),B(ot,1,1,()=>{ot=null}),Re()),me[0]&8&&wl.value!==q[3].q.u&&ne(wl,q[3].q.u),me[0]&8&&yl.value!==q[3].q.a&&ne(yl,q[3].q.a),me[0]&8&&Cl.value!==q[3].q.c&&ne(Cl,q[3].q.c),me[0]&8&&Te(gt,q[3].q.m),me[0]&8&&Ml.value!==q[3].q.b&&ne(Ml,q[3].q.b),q[3].q.m==3?rt?(rt.p(q,me),me[0]&8&&R(rt,1)):(rt=pf(q),rt.c(),R(rt,1),rt.m(l,Ds)):rt&&(Ie(),B(rt,1,1,()=>{rt=null}),Re()),q[3].q.m==4?at?(at.p(q,me),me[0]&8&&R(at,1)):(at=_f(q),at.c(),R(at,1),at.m(l,Is)):at&&(Ie(),B(at,1,1,()=>{at=null}),Re()),q[3].c.es!=null?ut?(ut.p(q,me),me[0]&8&&R(ut,1)):(ut=df(q),ut.c(),R(ut,1),ut.m(l,Rs)):ut&&(Ie(),B(ut,1,1,()=>{ut=null}),Re()),me[0]&8&&(Ls=q[3].p.r.startsWith("10YNO")||q[3].p.r.startsWith("10Y1001A1001A4")),Ls?ft?(ft.p(q,me),me[0]&8&&R(ft,1)):(ft=bf(q),ft.c(),R(ft,1),ft.m(l,Os)):ft&&(Ie(),B(ft,1,1,()=>{ft=null}),Re()),me[0]&136){ei=q[7];let Vt;for(Vt=0;Vt20||q[0].chip=="esp8266"||q[3].i.d.d>0?ct?(ct.p(q,me),me[0]&9&&R(ct,1)):(ct=wf(q),ct.c(),R(ct,1),ct.m(l,Fs)):ct&&(Ie(),B(ct,1,1,()=>{ct=null}),Re()),me[0]&8&&(il.checked=q[3].d.s),q[3].d.s?Nt?Nt.p(q,me):(Nt=Nf(q),Nt.c(),Nt.m(Ft,null)):Nt&&(Nt.d(1),Nt=null);const _t={};me[0]&2&&(_t.active=q[1]),ln.$set(_t);const ha={};me[0]&4&&(ha.active=q[2]),nn.$set(ha);const ba={};me[0]&16&&(ba.active=q[4]),sn.$set(ba);const ga={};me[0]&32&&(ga.active=q[5]),on.$set(ga)},i(q){Gt||(R(a.$$.fragment,q),R(O.$$.fragment,q),R(Dl.$$.fragment,q),R(Nn.$$.fragment,q),R(Dn.$$.fragment,q),R(Ln.$$.fragment,q),R(Fn.$$.fragment,q),R(ot),R(rt),R(at),R(ut),R(ft),R(Qn.$$.fragment,q),R(ct),R(Zn.$$.fragment,q),R(ln.$$.fragment,q),R(nn.$$.fragment,q),R(sn.$$.fragment,q),R(on.$$.fragment,q),Gt=!0)},o(q){B(a.$$.fragment,q),B(O.$$.fragment,q),B(Dl.$$.fragment,q),B(Nn.$$.fragment,q),B(Dn.$$.fragment,q),B(Ln.$$.fragment,q),B(Fn.$$.fragment,q),B(ot),B(rt),B(at),B(ut),B(ft),B(Qn.$$.fragment,q),B(ct),B(Zn.$$.fragment,q),B(ln.$$.fragment,q),B(nn.$$.fragment,q),B(sn.$$.fragment,q),B(on.$$.fragment,q),Gt=!1},d(q){q&&w(e),oe(a),oe(O),Kt(bi,q),kt&&kt.d(),wt&&wt.d(),oe(Dl),Kt(gi,q),yt&&yt.d(),Ct&&Ct.d(),Mt&&Mt.d(),oe(Nn),qt&&qt.d(),Tt&&Tt.d(),oe(Dn),oe(Ln),St&&St.d(),oe(Fn),$t&&$t.d(),ot&&ot.d(),rt&&rt.d(),at&&at.d(),ut&&ut.d(),ft&&ft.d(),oe(Qn),Kt(vt,q),ct&&ct.d(),oe(Zn),Nt&&Nt.d(),q&&w(Bs),oe(ln,q),q&&w(Us),oe(nn,q),q&&w(js),oe(sn,q),q&&w(Hs),oe(on,q),Ws=!1,Ge(va)}}}async function Sp(){await(await fetch("/reboot",{method:"POST"})).json()}function $p(t,e,l){let{sysinfo:n={}}=e,i=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{name:"Reactive",key:"r"},{name:"Realtime",key:"c"},{name:"Peaks",key:"t"},{name:"Realtime plot",key:"l"},{name:"Price",key:"p"},{name:"Day plot",key:"d"},{name:"Month plot",key:"m"},{name:"Temperature plot",key:"s"},{name:"Dark mode",key:"k"}],o=!0,u=!1,a={g:{t:"",h:"",s:0,u:"",p:""},m:{b:2400,p:11,i:!1,d:0,f:0,r:0,e:{e:!1,k:"",a:""},m:{e:!1,w:!1,v:!1,a:!1,c:!1}},w:{s:"",p:"",w:0,z:255,a:!0,b:!0},n:{m:"",i:"",s:"",g:"",d1:"",d2:"",d:!1,n1:"",n2:"",h:!1},q:{h:"",p:1883,u:"",a:"",b:"",s:{e:!1,c:!1,r:!0,k:!1}},o:{e:"",c:"",u1:"",u2:"",u3:""},t:{t:[0,0,0,0,0,0,0,0,0,0],h:1},p:{e:!1,t:"",r:"",c:"",m:1,f:null},d:{s:!1,t:!1,l:5},u:{i:0,e:0,v:0,a:0,r:0,c:0,t:0,p:0,d:0,m:0,s:0},i:{h:{p:null,u:!0},a:null,l:{p:null,i:!1},r:{r:null,g:null,b:null,i:!1},d:{d:null,b:0},t:{d:null,a:null},v:{p:null,d:{v:null,g:null},o:null,m:null,b:null}},h:{t:"",h:"",n:""},c:{e:!1,i:null,s:null,es:null}};yi.subscribe(Ze=>{Ze.version&&(l(3,a=Ze),l(1,o=!1))}),Vm();let c=!1,f=!1;async function p(){if(confirm("Are you sure you want to factory reset the device?")){l(4,c=!0);const Ze=new URLSearchParams;Ze.append("perform","true");let Vl=await(await fetch("/reset",{method:"POST",body:Ze})).json();l(4,c=!1),l(5,f=Vl.success)}}async function _(Ze){l(2,u=!0);const mt=new FormData(Ze.target),Vl=new URLSearchParams;for(let Rl of mt){const[ji,Wt]=Rl;Vl.append(ji,Wt)}let Ui=await(await fetch("/save",{method:"POST",body:Vl})).json();Yt.update(Rl=>(Rl.booting=Ui.reboot,Rl.ui=a.u,Rl)),l(2,u=!1),si("/")}const h=function(){confirm("Are you sure you want to reboot the device?")&&(Yt.update(Ze=>(Ze.booting=!0,Ze)),Sp())};async function v(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("/mqtt-ca",{method:"POST"})).text(),yi.update(mt=>(mt.q.s.c=!1,mt)))}async function d(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("/mqtt-cert",{method:"POST"})).text(),yi.update(mt=>(mt.q.s.r=!1,mt)))}async function C(){confirm("Are you sure you want to delete key?")&&(await(await fetch("/mqtt-key",{method:"POST"})).text(),yi.update(mt=>(mt.q.s.k=!1,mt)))}const M=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 N=44;function T(){a.g.h=this.value,l(3,a)}function P(){a.g.t=nt(this),l(3,a)}function F(){a.p.r=nt(this),l(3,a)}function A(){a.p.c=nt(this),l(3,a)}function I(){a.p.f=he(this.value),l(3,a)}function D(){a.p.m=he(this.value),l(3,a)}function O(){a.p.e=this.checked,l(3,a)}function ie(){a.p.t=this.value,l(3,a)}function H(){a.g.s=nt(this),l(3,a)}function K(){a.g.u=this.value,l(3,a)}function G(){a.g.p=this.value,l(3,a)}function Y(){a.m.a=nt(this),l(3,a)}function Q(){a.m.i=this.checked,l(3,a)}function z(){a.m.b=nt(this),l(3,a)}function Z(){a.m.p=nt(this),l(3,a)}function V(){a.m.s=he(this.value),l(3,a)}function j(){a.m.d=nt(this),l(3,a)}function ee(){a.m.f=he(this.value),l(3,a)}function ue(){a.m.r=he(this.value),l(3,a)}function x(){a.m.e.e=this.checked,l(3,a)}function W(){a.m.e.k=this.value,l(3,a)}function U(){a.m.e.a=this.value,l(3,a)}function ke(){a.m.m.e=this.checked,l(3,a)}function He(){a.m.m.w=he(this.value),l(3,a)}function Be(){a.m.m.v=he(this.value),l(3,a)}function We(){a.m.m.a=he(this.value),l(3,a)}function Ne(){a.m.m.c=he(this.value),l(3,a)}function ge(){a.n.c=nt(this),l(3,a)}function Le(){a.w.s=this.value,l(3,a)}function Me(){a.w.p=this.value,l(3,a)}function S(){a.w.z=nt(this),l(3,a)}function g(){a.w.w=he(this.value),l(3,a)}function k(){a.w.b=this.checked,l(3,a)}function E(){a.n.m=nt(this),l(3,a)}function L(){a.n.i=this.value,l(3,a)}function J(){a.n.s=nt(this),l(3,a)}function te(){a.n.g=this.value,l(3,a)}function fe(){a.n.d1=this.value,l(3,a)}function de(){a.n.d2=this.value,l(3,a)}function we(){a.n.d=this.checked,l(3,a)}function Ee(){a.n.h=this.checked,l(3,a)}function ae(){a.n.n1=this.value,l(3,a)}function Ce(){a.q.s.e=this.checked,l(3,a)}function Je(){a.q.h=this.value,l(3,a)}function Et(){a.q.p=he(this.value),l(3,a)}function st(){a.q.u=this.value,l(3,a)}function ht(){a.q.a=this.value,l(3,a)}function lt(){a.q.c=this.value,l(3,a)}function At(){a.q.m=nt(this),l(3,a)}function Ye(){a.q.b=this.value,l(3,a)}function Qt(){a.o.e=this.value,l(3,a)}function Ht(){a.o.c=this.value,l(3,a)}function bt(){a.o.u1=this.value,l(3,a)}function ze(){a.o.u2=this.value,l(3,a)}function xe(){a.o.u3=this.value,l(3,a)}function Xe(){a.h.t=this.value,l(3,a)}function Ue(){a.h.h=this.value,l(3,a)}function qe(){a.h.n=this.value,l(3,a)}function et(){a.c.e=this.checked,l(3,a)}function Ae(){a.c.i=this.value,l(3,a)}function Oe(){a.c.s=this.value,l(3,a)}function pe(){a.c.es=this.checked,l(3,a)}function ce(Ze){a.t.t[Ze]=he(this.value),l(3,a)}function ye(){a.t.h=he(this.value),l(3,a)}function zl(Ze){a.u[Ze.key]=nt(this),l(3,a)}function hl(){a.i.h.p=nt(this),l(3,a)}function _n(){a.i.h.t=nt(this),l(3,a)}function Pt(){a.i.h.u=this.checked,l(3,a)}function Ai(){a.i.a=he(this.value),l(3,a)}function Pi(){a.i.l.p=he(this.value),l(3,a)}function Di(){a.i.l.i=this.checked,l(3,a)}function bl(){a.i.r.i=this.checked,l(3,a)}function Ii(){a.i.r.r=he(this.value),l(3,a)}function Ri(){a.i.r.g=he(this.value),l(3,a)}function Li(){a.i.r.b=he(this.value),l(3,a)}function Dt(){a.i.d.d=he(this.value),l(3,a)}function Nl(){a.i.t.d=he(this.value),l(3,a)}function El(){a.i.t.a=he(this.value),l(3,a)}function Al(){a.i.v.p=he(this.value),l(3,a)}function Oi(){a.i.v.d.v=he(this.value),l(3,a)}function Fi(){a.i.v.d.g=he(this.value),l(3,a)}function je(){a.i.d.b=nt(this),l(3,a)}function dn(){a.i.v.o=he(this.value),l(3,a)}function qi(){a.i.v.m=he(this.value),l(3,a)}function Pl(){a.i.v.b=he(this.value),l(3,a)}function Dl(){a.d.s=this.checked,l(3,a)}function Bi(){a.d.t=this.checked,l(3,a)}function Gl(){a.d.l=nt(this),l(3,a)}return t.$$set=Ze=>{"sysinfo"in Ze&&l(0,n=Ze.sysinfo)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(6,N=n.chip=="esp8266"?16:n.chip=="esp32s2"?44:39)},[n,o,u,a,c,f,N,i,p,_,h,v,d,C,M,T,P,F,A,I,D,O,ie,H,K,G,Y,Q,z,Z,V,j,ee,ue,x,W,U,ke,He,Be,We,Ne,ge,Le,Me,S,g,k,E,L,J,te,fe,de,we,Ee,ae,Ce,Je,Et,st,ht,lt,At,Ye,Qt,Ht,bt,ze,xe,Xe,Ue,qe,et,Ae,Oe,pe,ce,ye,zl,hl,_n,Pt,Ai,Pi,Di,bl,Ii,Ri,Li,Dt,Nl,El,Al,Oi,Fi,je,dn,qi,Pl,Dl,Bi,Gl]}class Np extends De{constructor(e){super(),Pe(this,e,$p,Tp,$e,{sysinfo:0},null,[-1,-1,-1,-1])}}function Af(t,e,l){const n=t.slice();return n[20]=e[l],n}function Ep(t){let e=ve(t[1].chip,t[1].board)+"",l;return{c(){l=$(e)},m(n,i){y(n,l,i)},p(n,i){i&2&&e!==(e=ve(n[1].chip,n[1].board)+"")&&X(l,e)},d(n){n&&w(l)}}}function Pf(t){let e,l,n=t[1].apmac+"",i,o,u,a,c,f,p,_,h,v=Fa(t[1])+"",d,C,M=t[1].boot_reason+"",N,T,P=t[1].ex_cause+"",F,A,I;const D=[Pp,Ap],O=[];function ie(H,K){return H[0].u>0?0:1}return c=ie(t),f=O[c]=D[c](t),{c(){e=m("div"),l=$("AP MAC: "),i=$(n),o=b(),u=m("div"),a=$(`Last boot: - `),f.c(),p=b(),_=m("div"),h=$("Reason: "),d=$(v),C=$(" ("),N=$(M),T=$("/"),F=$(P),A=$(")"),r(e,"class","my-2"),r(u,"class","my-2"),r(_,"class","my-2")},m(H,K){y(H,e,K),s(e,l),s(e,i),y(H,o,K),y(H,u,K),s(u,a),O[c].m(u,null),y(H,p,K),y(H,_,K),s(_,h),s(_,d),s(_,C),s(_,N),s(_,T),s(_,F),s(_,A),I=!0},p(H,K){(!I||K&2)&&n!==(n=H[1].apmac+"")&&X(i,n);let G=c;c=ie(H),c===G?O[c].p(H,K):(Ie(),B(O[G],1,1,()=>{O[G]=null}),Re(),f=O[c],f?f.p(H,K):(f=O[c]=D[c](H),f.c()),R(f,1),f.m(u,null)),(!I||K&2)&&v!==(v=Fa(H[1])+"")&&X(d,v),(!I||K&2)&&M!==(M=H[1].boot_reason+"")&&X(N,M),(!I||K&2)&&P!==(P=H[1].ex_cause+"")&&X(F,P)},i(H){I||(R(f),I=!0)},o(H){B(f),I=!1},d(H){H&&w(e),H&&w(o),H&&w(u),O[c].d(),H&&w(p),H&&w(_)}}}function Ap(t){let e;return{c(){e=$("-")},m(l,n){y(l,e,n)},p:_e,i:_e,o:_e,d(l){l&&w(e)}}}function Pp(t){let e,l;return e=new Yc({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:""}}),{c(){re(e.$$.fragment)},m(n,i){se(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||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function Dp(t){let e;return{c(){e=m("span"),e.textContent="Update consents",r(e,"class","btn-pri-sm")},m(l,n){y(l,e,n)},p:_e,d(l){l&&w(e)}}}function Df(t){let e,l,n,i,o,u=ys(t[1].meter.mfg)+"",a,c,f,p,_=(t[1].meter.model?t[1].meter.model:"unknown")+"",h,v,d,C,M=(t[1].meter.id?t[1].meter.id:"unknown")+"",N;return{c(){e=m("div"),l=m("strong"),l.textContent="Meter",n=b(),i=m("div"),o=$("Manufacturer: "),a=$(u),c=b(),f=m("div"),p=$("Model: "),h=$(_),v=b(),d=m("div"),C=$("ID: "),N=$(M),r(l,"class","text-sm"),r(i,"class","my-2"),r(f,"class","my-2"),r(d,"class","my-2"),r(e,"class","cnt")},m(T,P){y(T,e,P),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,c),s(e,f),s(f,p),s(f,h),s(e,v),s(e,d),s(d,C),s(d,N)},p(T,P){P&2&&u!==(u=ys(T[1].meter.mfg)+"")&&X(a,u),P&2&&_!==(_=(T[1].meter.model?T[1].meter.model:"unknown")+"")&&X(h,_),P&2&&M!==(M=(T[1].meter.id?T[1].meter.id:"unknown")+"")&&X(N,M)},d(T){T&&w(e)}}}function If(t){let e,l,n,i,o,u=t[1].net.ip+"",a,c,f,p,_=t[1].net.mask+"",h,v,d,C,M=t[1].net.gw+"",N,T,P,F,A=t[1].net.dns1+"",I,D,O=t[1].net.dns2&&Rf(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Network",n=b(),i=m("div"),o=$("IP: "),a=$(u),c=b(),f=m("div"),p=$("Mask: "),h=$(_),v=b(),d=m("div"),C=$("Gateway: "),N=$(M),T=b(),P=m("div"),F=$("DNS: "),I=$(A),D=b(),O&&O.c(),r(l,"class","text-sm"),r(i,"class","my-2"),r(f,"class","my-2"),r(d,"class","my-2"),r(P,"class","my-2"),r(e,"class","cnt")},m(ie,H){y(ie,e,H),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,c),s(e,f),s(f,p),s(f,h),s(e,v),s(e,d),s(d,C),s(d,N),s(e,T),s(e,P),s(P,F),s(P,I),s(P,D),O&&O.m(P,null)},p(ie,H){H&2&&u!==(u=ie[1].net.ip+"")&&X(a,u),H&2&&_!==(_=ie[1].net.mask+"")&&X(h,_),H&2&&M!==(M=ie[1].net.gw+"")&&X(N,M),H&2&&A!==(A=ie[1].net.dns1+"")&&X(I,A),ie[1].net.dns2?O?O.p(ie,H):(O=Rf(ie),O.c(),O.m(P,null)):O&&(O.d(1),O=null)},d(ie){ie&&w(e),O&&O.d()}}}function Rf(t){let e,l=t[1].net.dns2+"",n;return{c(){e=$("/ "),n=$(l)},m(i,o){y(i,e,o),y(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns2+"")&&X(n,l)},d(i){i&&w(e),i&&w(n)}}}function Lf(t){let e,l,n,i=t[1].upgrade.t+"",o,u,a=t[1].version+"",c,f,p=t[1].upgrade.x+"",_,h,v=t[1].upgrade.e+"",d,C;return{c(){e=m("div"),l=m("div"),n=$("Previous upgrade attempt ("),o=$(i),u=$(") does not match current version ("),c=$(a),f=$(") ["),_=$(p),h=$("/"),d=$(v),C=$("]"),r(l,"class","bd-yellow"),r(e,"class","my-2")},m(M,N){y(M,e,N),s(e,l),s(l,n),s(l,o),s(l,u),s(l,c),s(l,f),s(l,_),s(l,h),s(l,d),s(l,C)},p(M,N){N&2&&i!==(i=M[1].upgrade.t+"")&&X(o,i),N&2&&a!==(a=M[1].version+"")&&X(c,a),N&2&&p!==(p=M[1].upgrade.x+"")&&X(_,p),N&2&&v!==(v=M[1].upgrade.e+"")&&X(d,v)},d(M){M&&w(e)}}}function Of(t){let e,l,n,i=t[2].tag_name+"",o,u,a,c,f,p,_=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[2]&&t[2].tag_name!=t[1].version&&Ff(t),h=t[1].fwconsent===2&&qf();return{c(){e=m("div"),l=$(`Latest version: - `),n=m("a"),o=$(i),a=b(),_&&_.c(),c=b(),h&&h.c(),f=Ve(),r(n,"href",u=t[2].html_url),r(n,"class","ml-2 text-blue-600 hover:text-blue-800"),r(n,"target","_blank"),r(n,"rel","noreferrer"),r(e,"class","my-2 flex")},m(v,d){y(v,e,d),s(e,l),s(e,n),s(n,o),s(e,a),_&&_.m(e,null),y(v,c,d),h&&h.m(v,d),y(v,f,d),p=!0},p(v,d){(!p||d&4)&&i!==(i=v[2].tag_name+"")&&X(o,i),(!p||d&4&&u!==(u=v[2].html_url))&&r(n,"href",u),(v[1].security==0||v[0].a)&&v[1].fwconsent===1&&v[2]&&v[2].tag_name!=v[1].version?_?(_.p(v,d),d&7&&R(_,1)):(_=Ff(v),_.c(),R(_,1),_.m(e,null)):_&&(Ie(),B(_,1,1,()=>{_=null}),Re()),v[1].fwconsent===2?h||(h=qf(),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},i(v){p||(R(_),p=!0)},o(v){B(_),p=!1},d(v){v&&w(e),_&&_.d(),v&&w(c),h&&h.d(v),v&&w(f)}}}function Ff(t){let e,l,n,i,o,u;return n=new Qc({}),{c(){e=m("div"),l=m("button"),re(n.$$.fragment),r(e,"class","flex-none ml-2 text-green-500"),r(e,"title","Install this version")},m(a,c){y(a,e,c),s(e,l),se(n,l,null),i=!0,o||(u=le(l,"click",t[10]),o=!0)},p:_e,i(a){i||(R(n.$$.fragment,a),i=!0)},o(a){B(n.$$.fragment,a),i=!1},d(a){a&&w(e),oe(n),o=!1,u()}}}function qf(t){let e;return{c(){e=m("div"),e.innerHTML='
You have disabled one-click firmware upgrade, link to self-upgrade is disabled
',r(e,"class","my-2")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Bf(t){let e,l=Cs(ve(t[1].chip,t[1].board))+"",n;return{c(){e=m("div"),n=$(l),r(e,"class","bd-red")},m(i,o){y(i,e,o),s(e,n)},p(i,o){o&2&&l!==(l=Cs(ve(i[1].chip,i[1].board))+"")&&X(n,l)},d(i){i&&w(e)}}}function Uf(t){let e,l,n,i,o,u;function a(p,_){return p[4].length==0?Rp:Ip}let c=a(t),f=c(t);return{c(){e=m("div"),l=m("form"),n=m("input"),i=b(),f.c(),nc(n,"display","none"),r(n,"name","file"),r(n,"type","file"),r(n,"accept",".bin"),r(l,"action","/firmware"),r(l,"enctype","multipart/form-data"),r(l,"method","post"),r(l,"autocomplete","off"),r(e,"class","my-2 flex")},m(p,_){y(p,e,_),s(e,l),s(l,n),t[12](n),s(l,i),f.m(l,null),o||(u=[le(n,"change",t[13]),le(l,"submit",t[15])],o=!0)},p(p,_){c===(c=a(p))&&f?f.p(p,_):(f.d(1),f=c(p),f&&(f.c(),f.m(l,null)))},d(p){p&&w(e),t[12](null),f.d(),o=!1,Ge(u)}}}function Ip(t){let e=t[4][0].name+"",l,n,i;return{c(){l=$(e),n=b(),i=m("button"),i.textContent="Upload",r(i,"type","submit"),r(i,"class","btn-pri-sm float-right")},m(o,u){y(o,l,u),y(o,n,u),y(o,i,u)},p(o,u){u&16&&e!==(e=o[4][0].name+"")&&X(l,e)},d(o){o&&w(l),o&&w(n),o&&w(i)}}}function Rp(t){let e,l,n;return{c(){e=m("button"),e.textContent="Select firmware file for upgrade",r(e,"type","button"),r(e,"class","btn-pri-sm float-right")},m(i,o){y(i,e,o),l||(n=le(e,"click",t[14]),l=!0)},p:_e,d(i){i&&w(e),l=!1,n()}}}function jf(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C=t[9],M=[];for(let A=0;A Include Secrets
(SSID, PSK, passwords and tokens)',c=b(),N&&N.c(),f=b(),p=m("form"),_=m("input"),h=b(),F.c(),r(l,"class","text-sm"),r(a,"class","my-1 mx-3 col-span-2"),r(o,"class","grid grid-cols-2"),r(i,"method","get"),r(i,"action","/configfile.cfg"),r(i,"autocomplete","off"),nc(_,"display","none"),r(_,"name","file"),r(_,"type","file"),r(_,"accept",".cfg"),r(p,"action","/configfile"),r(p,"enctype","multipart/form-data"),r(p,"method","post"),r(p,"autocomplete","off"),r(e,"class","cnt")},m(A,I){y(A,e,I),s(e,l),s(e,n),s(e,i),s(i,o);for(let D=0;D{E=null}),Re());const Et={};Ce&8388608&&(Et.$$scope={dirty:Ce,ctx:ae}),ie.$set(Et),ae[1].meter?L?L.p(ae,Ce):(L=Df(ae),L.c(),L.m(e,Y)):L&&(L.d(1),L=null),ae[1].net?J?J.p(ae,Ce):(J=If(ae),J.c(),J.m(e,Q)):J&&(J.d(1),J=null),(!S||Ce&2)&&ue!==(ue=ae[1].version+"")&&X(x,ue),ae[1].upgrade.t&&ae[1].upgrade.t!=ae[1].version?te?te.p(ae,Ce):(te=Lf(ae),te.c(),te.m(z,U)):te&&(te.d(1),te=null),ae[2]?fe?(fe.p(ae,Ce),Ce&4&&R(fe,1)):(fe=Of(ae),fe.c(),R(fe,1),fe.m(z,ke)):fe&&(Ie(),B(fe,1,1,()=>{fe=null}),Re()),Ce&3&&(He=(ae[1].security==0||ae[0].a)&&oi(ae[1].board)),He?de?de.p(ae,Ce):(de=Bf(ae),de.c(),de.m(z,Be)):de&&(de.d(1),de=null),ae[1].security==0||ae[0].a?we?we.p(ae,Ce):(we=Uf(ae),we.c(),we.m(z,null)):we&&(we.d(1),we=null),ae[1].security==0||ae[0].a?Ee?Ee.p(ae,Ce):(Ee=jf(ae),Ee.c(),Ee.m(e,null)):Ee&&(Ee.d(1),Ee=null);const st={};Ce&32&&(st.active=ae[5]),ge.$set(st);const ht={};Ce&256&&(ht.active=ae[8]),Me.$set(ht)},i(ae){S||(R(M.$$.fragment,ae),R(E),R(ie.$$.fragment,ae),R(fe),R(ge.$$.fragment,ae),R(Me.$$.fragment,ae),S=!0)},o(ae){B(M.$$.fragment,ae),B(E),B(ie.$$.fragment,ae),B(fe),B(ge.$$.fragment,ae),B(Me.$$.fragment,ae),S=!1},d(ae){ae&&w(e),oe(M),E&&E.d(),oe(ie),L&&L.d(),J&&J.d(),te&&te.d(),fe&&fe.d(),de&&de.d(),we&&we.d(),Ee&&Ee.d(),ae&&w(Ne),oe(ge,ae),ae&&w(Le),oe(Me,ae),g=!1,k()}}}async function qp(){await(await fetch("/reboot",{method:"POST"})).json()}function Bp(t,e,l){let{data:n}=e,{sysinfo:i}=e,o=[{name:"WiFi",key:"iw"},{name:"MQTT",key:"im"},{name:"Web",key:"ie"},{name:"Meter",key:"it"},{name:"Thresholds",key:"ih"},{name:"GPIO",key:"ig"},{name:"NTP",key:"in"},{name:"Price API",key:"is"}],u={};So.subscribe(D=>{l(2,u=Kc(i.version,D)),u||l(2,u=D[0])});function a(){confirm("Do you want to upgrade this device to "+u.tag_name+"?")&&(i.board!=2&&i.board!=4&&i.board!=7||confirm(Cs(ve(i.chip,i.board))))&&(Yt.update(D=>(D.upgrading=!0,D)),Vc(u.tag_name))}const c=function(){confirm("Are you sure you want to reboot the device?")&&(Yt.update(D=>(D.booting=!0,D)),qp())};let f,p=[],_=!1,h,v=[],d=!1;yo();function C(D){ks[D?"unshift":"push"](()=>{f=D,l(3,f)})}function M(){p=this.files,l(4,p)}const N=()=>{f.click()},T=()=>l(5,_=!0);function P(D){ks[D?"unshift":"push"](()=>{h=D,l(6,h)})}function F(){v=this.files,l(7,v)}const A=()=>{h.click()},I=()=>l(8,d=!0);return t.$$set=D=>{"data"in D&&l(0,n=D.data),"sysinfo"in D&&l(1,i=D.sysinfo)},[n,i,u,f,p,_,h,v,d,o,a,c,C,M,N,T,P,F,A,I]}class Up extends De{constructor(e){super(),Pe(this,e,Bp,Fp,$e,{data:0,sysinfo:1})}}function zf(t){let e,l,n=ve(t[0],7)+"",i,o,u=ve(t[0],5)+"",a,c,f=ve(t[0],4)+"",p,_,h=ve(t[0],3)+"",v,d,C,M,N=ve(t[0],2)+"",T,P,F=ve(t[0],1)+"",A,I,D=ve(t[0],0)+"",O,ie,H,K,G=ve(t[0],101)+"",Y,Q,z=ve(t[0],100)+"",Z;return{c(){e=m("optgroup"),l=m("option"),i=$(n),o=m("option"),a=$(u),c=m("option"),p=$(f),_=m("option"),v=$(h),d=b(),C=m("optgroup"),M=m("option"),T=$(N),P=m("option"),A=$(F),I=m("option"),O=$(D),ie=b(),H=m("optgroup"),K=m("option"),Y=$(G),Q=m("option"),Z=$(z),l.__value=7,l.value=l.__value,o.__value=5,o.value=o.__value,c.__value=4,c.value=c.__value,_.__value=3,_.value=_.__value,r(e,"label","amsleser.no"),M.__value=2,M.value=M.__value,P.__value=1,P.value=P.__value,I.__value=0,I.value=I.__value,r(C,"label","Custom hardware"),K.__value=101,K.value=K.__value,Q.__value=100,Q.value=Q.__value,r(H,"label","Generic hardware")},m(V,j){y(V,e,j),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,p),s(e,_),s(_,v),y(V,d,j),y(V,C,j),s(C,M),s(M,T),s(C,P),s(P,A),s(C,I),s(I,O),y(V,ie,j),y(V,H,j),s(H,K),s(K,Y),s(H,Q),s(Q,Z)},p(V,j){j&1&&n!==(n=ve(V[0],7)+"")&&X(i,n),j&1&&u!==(u=ve(V[0],5)+"")&&X(a,u),j&1&&f!==(f=ve(V[0],4)+"")&&X(p,f),j&1&&h!==(h=ve(V[0],3)+"")&&X(v,h),j&1&&N!==(N=ve(V[0],2)+"")&&X(T,N),j&1&&F!==(F=ve(V[0],1)+"")&&X(A,F),j&1&&D!==(D=ve(V[0],0)+"")&&X(O,D),j&1&&G!==(G=ve(V[0],101)+"")&&X(Y,G),j&1&&z!==(z=ve(V[0],100)+"")&&X(Z,z)},d(V){V&&w(e),V&&w(d),V&&w(C),V&&w(ie),V&&w(H)}}}function Gf(t){let e,l,n=ve(t[0],201)+"",i,o,u=ve(t[0],202)+"",a,c,f=ve(t[0],203)+"",p,_,h=ve(t[0],241)+"",v,d,C=ve(t[0],242)+"",M,N,T=ve(t[0],243)+"",P,F,A=ve(t[0],200)+"",I;return{c(){e=m("optgroup"),l=m("option"),i=$(n),o=m("option"),a=$(u),c=m("option"),p=$(f),_=m("option"),v=$(h),d=m("option"),M=$(C),N=m("option"),P=$(T),F=m("option"),I=$(A),l.__value=201,l.value=l.__value,o.__value=202,o.value=o.__value,c.__value=203,c.value=c.__value,_.__value=241,_.value=_.__value,d.__value=242,d.value=d.__value,N.__value=243,N.value=N.__value,F.__value=200,F.value=F.__value,r(e,"label","Generic hardware")},m(D,O){y(D,e,O),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,p),s(e,_),s(_,v),s(e,d),s(d,M),s(e,N),s(N,P),s(e,F),s(F,I)},p(D,O){O&1&&n!==(n=ve(D[0],201)+"")&&X(i,n),O&1&&u!==(u=ve(D[0],202)+"")&&X(a,u),O&1&&f!==(f=ve(D[0],203)+"")&&X(p,f),O&1&&h!==(h=ve(D[0],241)+"")&&X(v,h),O&1&&C!==(C=ve(D[0],242)+"")&&X(M,C),O&1&&T!==(T=ve(D[0],243)+"")&&X(P,T),O&1&&A!==(A=ve(D[0],200)+"")&&X(I,A)},d(D){D&&w(e)}}}function Vf(t){let e,l,n=ve(t[0],7)+"",i,o,u=ve(t[0],6)+"",a,c,f=ve(t[0],5)+"",p,_,h,v,d=ve(t[0],51)+"",C,M,N=ve(t[0],50)+"",T;return{c(){e=m("optgroup"),l=m("option"),i=$(n),o=m("option"),a=$(u),c=m("option"),p=$(f),_=b(),h=m("optgroup"),v=m("option"),C=$(d),M=m("option"),T=$(N),l.__value=7,l.value=l.__value,o.__value=6,o.value=o.__value,c.__value=5,c.value=c.__value,r(e,"label","amsleser.no"),v.__value=51,v.value=v.__value,M.__value=50,M.value=M.__value,r(h,"label","Generic hardware")},m(P,F){y(P,e,F),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,p),y(P,_,F),y(P,h,F),s(h,v),s(v,C),s(h,M),s(M,T)},p(P,F){F&1&&n!==(n=ve(P[0],7)+"")&&X(i,n),F&1&&u!==(u=ve(P[0],6)+"")&&X(a,u),F&1&&f!==(f=ve(P[0],5)+"")&&X(p,f),F&1&&d!==(d=ve(P[0],51)+"")&&X(C,d),F&1&&N!==(N=ve(P[0],50)+"")&&X(T,N)},d(P){P&&w(e),P&&w(_),P&&w(h)}}}function Kf(t){let e,l,n=ve(t[0],8)+"",i,o,u,a,c=ve(t[0],71)+"",f,p,_=ve(t[0],70)+"",h;return{c(){e=m("optgroup"),l=m("option"),i=$(n),o=b(),u=m("optgroup"),a=m("option"),f=$(c),p=m("option"),h=$(_),l.__value=8,l.value=l.__value,r(e,"label","Custom hardware"),a.__value=71,a.value=a.__value,p.__value=70,p.value=p.__value,r(u,"label","Generic hardware")},m(v,d){y(v,e,d),s(e,l),s(l,i),y(v,o,d),y(v,u,d),s(u,a),s(a,f),s(u,p),s(p,h)},p(v,d){d&1&&n!==(n=ve(v[0],8)+"")&&X(i,n),d&1&&c!==(c=ve(v[0],71)+"")&&X(f,c),d&1&&_!==(_=ve(v[0],70)+"")&&X(h,_)},d(v){v&&w(e),v&&w(o),v&&w(u)}}}function Yf(t){let e,l,n=ve(t[0],200)+"",i;return{c(){e=m("optgroup"),l=m("option"),i=$(n),l.__value=200,l.value=l.__value,r(e,"label","Generic hardware")},m(o,u){y(o,e,u),s(e,l),s(l,i)},p(o,u){u&1&&n!==(n=ve(o[0],200)+"")&&X(i,n)},d(o){o&&w(e)}}}function jp(t){let e,l,n,i,o,u,a,c=t[0]=="esp8266"&&zf(t),f=t[0]=="esp32"&&Gf(t),p=t[0]=="esp32s2"&&Vf(t),_=t[0]=="esp32c3"&&Kf(t),h=t[0]=="esp32solo"&&Yf(t);return{c(){e=m("option"),l=b(),c&&c.c(),n=b(),f&&f.c(),i=b(),p&&p.c(),o=b(),_&&_.c(),u=b(),h&&h.c(),a=Ve(),e.__value=-1,e.value=e.__value},m(v,d){y(v,e,d),y(v,l,d),c&&c.m(v,d),y(v,n,d),f&&f.m(v,d),y(v,i,d),p&&p.m(v,d),y(v,o,d),_&&_.m(v,d),y(v,u,d),h&&h.m(v,d),y(v,a,d)},p(v,[d]){v[0]=="esp8266"?c?c.p(v,d):(c=zf(v),c.c(),c.m(n.parentNode,n)):c&&(c.d(1),c=null),v[0]=="esp32"?f?f.p(v,d):(f=Gf(v),f.c(),f.m(i.parentNode,i)):f&&(f.d(1),f=null),v[0]=="esp32s2"?p?p.p(v,d):(p=Vf(v),p.c(),p.m(o.parentNode,o)):p&&(p.d(1),p=null),v[0]=="esp32c3"?_?_.p(v,d):(_=Kf(v),_.c(),_.m(u.parentNode,u)):_&&(_.d(1),_=null),v[0]=="esp32solo"?h?h.p(v,d):(h=Yf(v),h.c(),h.m(a.parentNode,a)):h&&(h.d(1),h=null)},i:_e,o:_e,d(v){v&&w(e),v&&w(l),c&&c.d(v),v&&w(n),f&&f.d(v),v&&w(i),p&&p.d(v),v&&w(o),_&&_.d(v),v&&w(u),h&&h.d(v),v&&w(a)}}}function Hp(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class Wp extends De{constructor(e){super(),Pe(this,e,Hp,jp,$e,{chip:0})}}function Qf(t){let e;return{c(){e=m("div"),e.textContent="WARNING: Changing this configuration will affect basic configuration of your device. Only make changes here if instructed by vendor",r(e,"class","bd-red")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Xf(t){let e,l,n,i,o,u,a;return u=new fo({props:{chip:t[0].chip}}),{c(){e=m("div"),l=$("HAN GPIO"),n=m("br"),i=b(),o=m("select"),re(u.$$.fragment),r(o,"name","vh"),r(o,"class","in-s"),r(e,"class","my-3")},m(c,f){y(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),se(u,o,null),a=!0},p(c,f){const p={};f&1&&(p.chip=c[0].chip),u.$set(p)},i(c){a||(R(u.$$.fragment,c),a=!0)},o(c){B(u.$$.fragment,c),a=!1},d(c){c&&w(e),oe(u)}}}function zp(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M,N,T,P,F,A,I,D,O,ie,H,K,G,Y,Q=t[0].usrcfg&&Qf();d=new Wp({props:{chip:t[0].chip}});let z=t[0].board&&t[0].board>20&&Xf(t);return H=new jt({props:{active:t[1],message:"Saving device configuration"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=b(),u=m("strong"),u.textContent="Initial configuration",a=b(),Q&&Q.c(),c=b(),f=m("div"),p=$("Board type"),_=m("br"),h=b(),v=m("select"),re(d.$$.fragment),C=b(),z&&z.c(),M=b(),N=m("div"),T=m("label"),P=m("input"),F=$(" Clear all other configuration"),A=b(),I=m("div"),I.innerHTML='',D=b(),O=m("span"),O.textContent="\xA0",ie=b(),re(H.$$.fragment),r(i,"type","hidden"),r(i,"name","v"),i.value="true",r(u,"class","text-sm"),r(v,"name","vb"),r(v,"class","in-s"),t[0].board===void 0&&Ke(()=>t[4].call(v)),r(f,"class","my-3"),r(P,"type","checkbox"),r(P,"name","vr"),P.__value="true",P.value=P.__value,r(P,"class","rounded mb-1"),r(N,"class","my-3"),r(I,"class","my-3"),r(O,"class","clear-both"),r(n,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(Z,V){y(Z,e,V),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),Q&&Q.m(n,null),s(n,c),s(n,f),s(f,p),s(f,_),s(f,h),s(f,v),se(d,v,null),Te(v,t[0].board,!0),s(n,C),z&&z.m(n,null),s(n,M),s(n,N),s(N,T),s(T,P),P.checked=t[2],s(T,F),s(n,A),s(n,I),s(n,D),s(n,O),y(Z,ie,V),se(H,Z,V),K=!0,G||(Y=[le(v,"change",t[4]),le(P,"change",t[5]),le(n,"submit",Ms(t[3]))],G=!0)},p(Z,[V]){Z[0].usrcfg?Q||(Q=Qf(),Q.c(),Q.m(n,c)):Q&&(Q.d(1),Q=null);const j={};V&1&&(j.chip=Z[0].chip),d.$set(j),V&1&&Te(v,Z[0].board),Z[0].board&&Z[0].board>20?z?(z.p(Z,V),V&1&&R(z,1)):(z=Xf(Z),z.c(),R(z,1),z.m(n,M)):z&&(Ie(),B(z,1,1,()=>{z=null}),Re()),V&4&&(P.checked=Z[2]);const ee={};V&2&&(ee.active=Z[1]),H.$set(ee)},i(Z){K||(R(d.$$.fragment,Z),R(z),R(H.$$.fragment,Z),K=!0)},o(Z){B(d.$$.fragment,Z),B(z),B(H.$$.fragment,Z),K=!1},d(Z){Z&&w(e),Q&&Q.d(),oe(d),z&&z.d(),Z&&w(ie),oe(H,Z),G=!1,Ge(Y)}}}function Gp(t,e,l){let{sysinfo:n={}}=e,i=!1;async function o(f){l(1,i=!0);const p=new FormData(f.target),_=new URLSearchParams;for(let d of p){const[C,M]=d;_.append(C,M)}let v=await(await fetch("/save",{method:"POST",body:_})).json();l(1,i=!1),Yt.update(d=>(d.vndcfg=v.success,d.booting=v.reboot,d)),si(n.usrcfg?"/":"/setup")}let u=!1;function a(){n.board=nt(this),l(0,n)}function c(){u=this.checked,l(2,u),l(0,n)}return t.$$set=f=>{"sysinfo"in f&&l(0,n=f.sysinfo)},t.$$.update=()=>{t.$$.dirty&1&&l(2,u=!n.usrcfg)},[n,i,u,o,a,c]}class Vp extends De{constructor(e){super(),Pe(this,e,Gp,zp,$e,{sysinfo:0})}}function Zf(t){let e;return{c(){e=m("option"),e.textContent="Ethernet",e.__value=3,e.value=e.__value},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Jf(t){let e,l,n,i,o,u,a,c,f,p,_,h,v;return{c(){e=m("div"),l=$("SSID"),n=m("br"),i=b(),o=m("input"),a=b(),c=m("div"),f=$("PSK"),p=m("br"),_=b(),h=m("input"),r(o,"name","ss"),r(o,"type","text"),r(o,"class","in-s"),o.required=u=t[2]==1||t[2]==2,r(e,"class","my-3"),r(h,"name","sp"),r(h,"type","password"),r(h,"class","in-s"),r(h,"autocomplete","off"),h.required=v=t[2]==2,r(c,"class","my-3")},m(d,C){y(d,e,C),s(e,l),s(e,n),s(e,i),s(e,o),y(d,a,C),y(d,c,C),s(c,f),s(c,p),s(c,_),s(c,h)},p(d,C){C&4&&u!==(u=d[2]==1||d[2]==2)&&(o.required=u),C&4&&v!==(v=d[2]==2)&&(h.required=v)},d(d){d&&w(e),d&&w(a),d&&w(c)}}}function xf(t){let e,l,n,i,o,u,a,c;return a=new Zc({}),{c(){e=m("br"),l=b(),n=m("div"),i=m("input"),o=b(),u=m("select"),re(a.$$.fragment),r(i,"name","si"),r(i,"type","text"),r(i,"class","in-f w-full"),i.required=t[1],r(u,"name","su"),r(u,"class","in-l"),u.required=t[1],r(n,"class","flex")},m(f,p){y(f,e,p),y(f,l,p),y(f,n,p),s(n,i),s(n,o),s(n,u),se(a,u,null),c=!0},p(f,p){(!c||p&2)&&(i.required=f[1]),(!c||p&2)&&(u.required=f[1])},i(f){c||(R(a.$$.fragment,f),c=!0)},o(f){B(a.$$.fragment,f),c=!1},d(f){f&&w(e),f&&w(l),f&&w(n),oe(a)}}}function ec(t){let e;return{c(){e=m("div"),e.innerHTML=`
Gateway
+Occurred in: ${i}`:"",u=wo(t),a=mc(e)?e(u):e;return`<${u}> ${a}${o}`}const Tc=t=>(...e)=>t(P1(...e)),Nc=Tc(t=>{throw new Error(t)}),ws=Tc(console.warn),Na=4,D1=3,I1=2,R1=1,L1=1;function O1(t,e){const l=t.default?0:vl(t.fullPath).reduce((n,i)=>{let o=n;return o+=Na,y1(i)?o+=L1:C1(i)?o+=I1:kc(i)?o-=Na+R1:o+=D1,o},0);return{route:t,score:l,index:e}}function F1(t){return t.map(O1).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function $c(t,e){let l,n;const[i]=e.split("?"),o=vl(i),u=o[0]==="",a=F1(t);for(let c=0,f=a.length;c({...p,params:b,uri:N});if(p.default){n=v(e);continue}const d=vl(p.fullPath),M=Math.max(o.length,d.length);let C=0;for(;C{f===".."?c.pop():f!=="."&&c.push(f)}),Gs(`/${c.join("/")}`,n)}function $a(t,e){const{pathname:l,hash:n="",search:i="",state:o}=t,u=vl(e,!0),a=vl(l,!0);for(;u.length;)u[0]!==a[0]&&Nc(mn,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),u.shift(),a.shift();return{pathname:$i(...a),hash:n,search:i,state:o}}const Ea=t=>t.length===1?"":t,yo=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,o=i?Ea(ki(t,l)):"",u=i?ki(t,0,l):t,a=n?Ea(ki(u,e)):"";return{pathname:(n?ki(u,0,e):u)||"/",search:a,hash:o}},B1=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function U1(t,e,l){return $i(l,q1(t,e))}function H1(t,e){const l=go(M1(t)),n=vl(l,!0),i=vl(e,!0).slice(0,n.length),o=Ec({fullPath:l},$i(...i));return o&&o.uri}const Vs="POP",j1="PUSH",W1="REPLACE";function Ks(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function z1(t){let e=[],l=Ks(t),n=Vs;const i=(o=e)=>o.forEach(u=>u({location:l,action:n}));return{get location(){return l},listen(o){e.push(o);const u=()=>{l=Ks(t),n=Vs,i([o])};i([o]);const a=dc(t,"popstate",u);return()=>{a(),e=e.filter(c=>c!==o)}},navigate(o,u){const{state:a={},replace:c=!1}=u||{};if(n=c?W1:j1,pc(o))u&&ws(Sc,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=Vs,t.history.go(o);else{const f={...a,_key:b1()};try{t.history[c?"replaceState":"pushState"](f,"",o)}catch{t.location[c?"replace":"assign"](o)}}l=Ks(t),i()}}}function Ys(t,e){return{...yo(e),state:t}}function G1(t="/"){let e=0,l=[Ys(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(Ys(n,o))},replaceState(n,i,o){l[e]=Ys(n,o)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const V1=!!(!Wl&&window.document&&window.document.createElement),K1=!Wl&&window.location.origin==="null",Ac=z1(V1&&!K1?window:G1()),{navigate:si}=Ac;let Tl=null,Pc=!0;function Y1(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nTl.level||t.level===Tl.level&&Y1(t.routerId,Tl.routerId))&&(Tl=t)}function X1(){Tl=null}function Z1(){Pc=!1}function Aa(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=dc(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function J1(t,e){return Number(t.dataset.svnavRouteEnd)===e}function x1(t){return/^H[1-6]$/i.test(t.tagName)}function Pa(t,e=document){return e.querySelector(t)}function e0(t){let l=Pa(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!J1(l,t);){if(x1(l))return l;const n=Pa("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function t0(t){Promise.resolve(ri(t.focusElement)).then(e=>{const l=e||e0(t.id);l||ws(mn,`Could not find an element to focus. You should always render a header for accessibility reasons, or set a custom focus element via the "useFocus" hook. If you don't want this Route or Router to manage focus, pass "primary={false}" to it.`,t,Ss),!Aa(l)&&Aa(document.documentElement)})}const l0=(t,e,l)=>(n,i)=>p1().then(()=>{if(!Tl||Pc){Z1();return}if(n&&t0(Tl.route),t.announcements&&i){const{path:o,fullPath:u,meta:a,params:c,uri:f}=Tl.route,p=t.createAnnouncement({path:o,fullPath:u,meta:a,params:c,uri:f},ri(l));Promise.resolve(p).then(_=>{e.set(_)})}X1()}),n0="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 i0(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},vc(t[6],n0)],i={};for(let o=0;o`Navigated to ${x.uri}`,announcements:!0,...d},N=p,S=go(p),P=jl(xs),F=jl(ui),A=!P,I=o0(),D=v&&!(F&&!F.manageFocus),O=it("");_l(t,O,x=>l(0,a=x));const ie=F?F.disableInlineStyles:M,j=it([]);_l(t,j,x=>l(20,u=x));const K=it(null);_l(t,K,x=>l(18,i=x));let G=!1;const Y=A?0:F.level+1,z=A?it((()=>$a(Wl?yo(_):b.location,S))()):P;_l(t,z,x=>l(17,n=x));const Z=it(n);_l(t,Z,x=>l(19,o=x));const V=l0(C,O,z),H=x=>W=>W.filter(U=>U.id!==x);function ee(x){if(Wl){if(G)return;const W=Ec(x,n.pathname);if(W)return G=!0,W}else j.update(W=>{const U=H(x.id)(W);return U.push(x),U})}function ue(x){j.update(H(x))}return!A&&p!==Da&&ws(mn,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:p}),A&&(rc(()=>b.listen(W=>{const U=$a(W.location,S);Z.set(n),z.set(U)})),Mi(xs,z)),Mi(ui,{activeRoute:K,registerRoute:ee,unregisterRoute:ue,manageFocus:D,level:Y,id:I,history:A?b:F.history,basepath:A?S:F.basepath,disableInlineStyles:ie}),t.$$set=x=>{"basepath"in x&&l(11,p=x.basepath),"url"in x&&l(12,_=x.url),"history"in x&&l(13,b=x.history),"primary"in x&&l(14,v=x.primary),"a11y"in x&&l(15,d=x.a11y),"disableInlineStyles"in x&&l(16,M=x.disableInlineStyles),"$$scope"in x&&l(21,f=x.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&p!==N&&ws(mn,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const x=$c(u,n.pathname);K.set(x)}if(t.$$.dirty[0]&655360&&A){const x=!!n.hash,W=!x&&D,U=!x||n.pathname!==o.pathname;V(W,U)}t.$$.dirty[0]&262144&&D&&i&&i.primary&&Q1({level:Y,routerId:I,route:i})},[a,C,A,I,D,O,ie,j,K,z,Z,p,_,b,v,d,M,n,i,o,u,f,c]}class a0 extends De{constructor(e){super(),Pe(this,e,r0,s0,Ne,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const Dc=a0;function Ei(t,e,l=ui,n=mn){jl(l)||Nc(t,o=>`You cannot use ${o} outside of a ${wo(n)}.`,e)}const u0=t=>{const{subscribe:e}=jl(t);return{subscribe:e}};function Ic(){return Ei(yc),u0(xs)}function Rc(){const{history:t}=jl(ui);return t}function Lc(){const t=jl(bc);return t?g1(t,e=>e.base):it("/")}function Oc(){Ei(Mc);const t=Lc(),{basepath:e}=jl(ui);return n=>U1(n,ri(t),e)}function f0(){Ei(Cc);const t=Oc(),{navigate:e}=Rc();return(n,i)=>{const o=pc(n)?n:t(n);return e(o,i)}}const c0=t=>({params:t&16,location:t&8}),Ia=t=>({params:Wl?ri(t[10]):t[4],location:t[3],navigate:t[11]});function Ra(t){let e,l;return e=new Dc({props:{primary:t[1],$$slots:{default:[_0]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){se(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||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function m0(t){let e;const l=t[18].default,n=po(l,t,t[19],Ia);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&524312)&&vo(n,l,i,i[19],e?_o(l,i[19],o,c0):ho(i[19]),Ia)},i(i){e||(R(n,i),e=!0)},o(i){B(n,i),e=!1},d(i){n&&n.d(i)}}}function p0(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},Wl?ri(t[10]):t[4],t[12]];var o=t[0];function u(a){let c={};for(let f=0;f{oe(p,1)}),Re()}o?(e=Ca(o,u()),re(e.$$.fragment),R(e.$$.fragment,1),se(e,l.parentNode,l)):e=null}else o&&e.$set(f)},i(a){n||(e&&R(e.$$.fragment,a),n=!0)},o(a){e&&B(e.$$.fragment,a),n=!1},d(a){a&&w(l),e&&oe(e,a)}}}function _0(t){let e,l,n,i;const o=[p0,m0],u=[];function a(c,f){return c[0]!==null?0:1}return e=a(t),l=u[e]=o[e](t),{c(){l.c(),n=Ke()},m(c,f){u[e].m(c,f),y(c,n,f),i=!0},p(c,f){let p=e;e=a(c),e===p?u[e].p(c,f):(Ie(),B(u[p],1,1,()=>{u[p]=null}),Re(),l=u[e],l?l.p(c,f):(l=u[e]=o[e](c),l.c()),R(l,1),l.m(n.parentNode,n))},i(c){i||(R(l),i=!0)},o(c){B(l),i=!1},d(c){u[e].d(c),c&&w(n)}}}function d0(t){let e,l,n,i,o,u=[Js(t[7]),{"data-svnav-route-start":t[5]}],a={};for(let _=0;_{c=null}),Re())},i(_){o||(R(c),o=!0)},o(_){B(c),o=!1},d(_){_&&w(e),_&&w(l),c&&c.d(_),_&&w(n),_&&w(i)}}}const v0=_c();function h0(t,e,l){let n;const i=["path","component","meta","primary"];let o=gs(e,i),u,a,c,f,{$$slots:p={},$$scope:_}=e,{path:b=""}=e,{component:v=null}=e,{meta:d={}}=e,{primary:M=!0}=e;Ei(Ss,e);const C=v0(),{registerRoute:N,unregisterRoute:S,activeRoute:P,disableInlineStyles:F}=jl(ui);_l(t,P,G=>l(16,u=G));const A=Lc();_l(t,A,G=>l(17,c=G));const I=Ic();_l(t,I,G=>l(3,a=G));const D=it(null);let O;const ie=it(),j=it({});_l(t,j,G=>l(4,f=G)),Mi(bc,ie),Mi(k1,j),Mi(w1,D);const K=f0();return Wl||c1(()=>S(C)),t.$$set=G=>{l(24,e=sl(sl({},e),bs(G))),l(12,o=gs(e,i)),"path"in G&&l(13,b=G.path),"component"in G&&l(0,v=G.component),"meta"in G&&l(14,d=G.meta),"primary"in G&&l(1,M=G.primary),"$$scope"in G&&l(19,_=G.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const G=b==="",Y=$i(c,b),Q={id:C,path:b,meta:d,default:G,fullPath:G?"":Y,base:G?c:H1(Y,a.pathname),primary:M,focusElement:D};ie.set(Q),l(15,O=N(Q))}if(t.$$.dirty&98304&&l(2,n=!!(O||u&&u.id===C)),t.$$.dirty&98308&&n){const{params:G}=O||u;j.set(G)}},e=bs(e),[v,M,n,a,f,C,P,F,A,I,j,K,o,b,d,O,u,c,p,_]}class b0 extends De{constructor(e){super(),Pe(this,e,h0,d0,Ne,{path:13,component:0,meta:14,primary:1})}}const Sl=b0;function g0(t){let e,l,n,i;const o=t[13].default,u=po(o,t,t[12],null);let a=[{href:t[0]},t[2],t[1]],c={};for(let f=0;fl(11,_=D));const P=m1(),F=Oc(),{navigate:A}=Rc();function I(D){P("click",D),h1(D)&&(D.preventDefault(),A(n,{state:C,replace:u||M}))}return t.$$set=D=>{l(19,e=sl(sl({},e),bs(D))),l(18,p=gs(e,f)),"to"in D&&l(5,d=D.to),"replace"in D&&l(6,M=D.replace),"state"in D&&l(7,C=D.state),"getProps"in D&&l(8,N=D.getProps),"$$scope"in D&&l(12,v=D.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=F(d,_)),t.$$.dirty&2049&&l(10,i=eo(_.pathname,n)),t.$$.dirty&2049&&l(9,o=n===_.pathname),t.$$.dirty&2049&&(u=yo(n)===B1(_)),t.$$.dirty&512&&l(2,a=o?{"aria-current":"page"}:{}),l(1,c=(()=>{if(mc(N)){const D=N({location:_,href:n,isPartiallyCurrent:i,isCurrent:o});return{...p,...D}}return p})())},e=bs(e),[n,c,a,S,I,d,M,C,N,o,i,_,v,b]}class w0 extends De{constructor(e){super(),Pe(this,e,k0,g0,Ne,{to:5,replace:6,state:7,getProps:8})}}const ol=w0;let to=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Hl(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function y0(t){return t>218&&t<242?"#32d900":t>212&&t<248?"#b1d900":t>208&&t<252?"#ffb800":"#d90000"}function Fc(t,e){let l;return t>90?l="#d90000":t>85?l="#e32100":t>80?l="#ffb800":t>75?l="#dcd800":l="#32d900",l+(e?"88":"")}function C0(t){return t>75?"#32d900":t>50?"#77d900":t>25?"#94d900":"#dcd800"}function ys(t){switch(t){case 1:return"Aidon";case 2:return"Kaifa";case 3:return"Kamstrup";case 8:return"Iskra";case 9:return"Landis+Gyr";case 10:return"Sagemcom";default:return"Unknown"}}function Fe(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function ve(t,e){switch(e){case 5:switch(t){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(t){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 241:return"LilyGO T-ETH-POE";case 242:return"M5 PoESP32";case 243:return"WT32-ETH01";case 200:return"Generic ESP32";case 2:return"HAN Reader 2.0 by Max Spencer";case 0:return"Custom hardware by Roar Fredriksen";case 1:return"Kamstrup module by Egil Opsahl";case 8:return"\xB5HAN mosquito by dbeinder";case 3:return"Pow-K (UART0)";case 4:return"Pow-U (UART0)";case 101:return"Wemos D1 mini";case 100:return"Generic ESP8266";case 70:return"Generic ESP32-C3";case 71:return"ESP32-C3-DevKitM-1"}}function La(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 Oa(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 Fa(t){switch(t){case 400:return"Unrecognized data in request";case 401:case 403:return"Unauthorized, check API key";case 404:return"Price unavailable, not found";case 425:return"Server says its too early";case 429:return"Exceeded API rate limit";case 500:return"Internal server error";case-1:return"Connection error";case-2:return"Incomplete data received";case-3:return"Invalid data, tag missing";case-51:return"Authentication failed";case-52:return"Decryption failed";case-53:return"Encryption key invalid"}return t<0?"Unspecified error "+t:""}function qa(t){switch(t){case 255:return"Unable to start upgrade";case-1:return"Connection refused";case-2:return"Failed to send headers";case-3:return"Failed to send payload";case-4:return"Not connected";case-5:return"Connection lost";case-6:return"No stream";case-7:return"Not a HTTP server";case-8:return"Not enough memory";case-9:return"Encoding error";case-10:return"Stream write";case-11:return"Read timeout"}return"Unknown "+t}function oi(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Qe(t,e){return t==1||t==2&&e}function Ut(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function be(t,e){return isNaN(t)?"-":(isNaN(e)&&(e=t<10?1:0),t.toFixed(e))}function dl(t,e){return t.setTime(t.getTime()+e*36e5),t}function Ba(t){if(t.chip=="esp8266")switch(t.boot_reason){case 0:return"Normal";case 1:return"WDT reset";case 2:return"Exception reset";case 3:return"Soft WDT reset";case 4:return"Software restart";case 5:return"Deep sleep";case 6:return"External reset";default:return"Unknown (8266)"}else switch(t.boot_reason){case 1:return"Vbat power on reset";case 3:return"Software reset";case 4:return"WDT reset";case 5:return"Deep sleep";case 6:return"SLC reset";case 7:return"Timer Group0 WDT reset";case 8:return"Timer Group1 WDT reset";case 9:return"RTC WDT reset";case 10:return"Instrusion test reset CPU";case 11:return"Time Group reset CPU";case 12:return"Software reset CPU";case 13:return"RTC WTD reset CPU";case 14:return"PRO CPU";case 15:return"Brownout";case 16:return"RTC reset";default:return"Unknown"}}function Ua(t){return t=="EOE"?"ENTSO-E":t=="HKS"?"hvakosterstrommen.no":t=="EDS"?"Energi Data Service":t=="MIX"?"Mixed sources":"Unknown ("+t+")"}function Ha(t){return t=="EOE"?"https://transparency.entsoe.eu/-E":t=="HKS"?"https://www.hvakosterstrommen.no/":t=="EDS"?"https://www.energidataservice.dk/":"#"}async function Nl(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 pl={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 Yt=it(pl);async function Co(){pl=await(await Nl("/sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),Yt.set(pl)}let ds=0,ja=-127,Wa=null,M0={};const qc=hc(M0,t=>{let e;async function l(){Nl("/data.json").then(n=>n.json()).then(n=>{t(n),ja!=n.t&&(ja=n.t,setTimeout(Wc,2e3)),Wa==null&&n.pe&&n.p!=null&&(Wa=n.p,Uc()),pl.upgrading?window.location.reload():(!pl||!pl.chip||pl.booting||ds>1&&!oi(pl.board))&&(Co(),an&&clearTimeout(an),an=setTimeout(So,2e3),un&&clearTimeout(un),un=setTimeout(To,3e3));let i=5e3;if(oi(pl.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),ds=0}).catch(n=>{ds++,ds>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(l,15e3)):e=setTimeout(l,oi(pl.board)?1e4:5e3)})}return l(),function(){clearTimeout(e)}});let lo={},wi;const Mo=it(lo);async function Bc(){let t=!1;if(Mo.update(e=>{for(var l=0;l<36;l++){if(e[Fe(l)]==null){t=l<12;break}e[Fe(l)]=e[Fe(l+1)]}return e}),t)Uc();else{let e=new Date;wi=setTimeout(Bc,(60-e.getMinutes())*6e4)}}async function Uc(){wi&&(clearTimeout(wi),wi=0),lo=await(await Nl("/energyprice.json")).json(),Mo.set(lo);let e=new Date;wi=setTimeout(Bc,(60-e.getMinutes())*6e4)}let no={},an;async function So(){an&&(clearTimeout(an),an=0),no=await(await Nl("/dayplot.json")).json(),Hc.set(no);let e=new Date;an=setTimeout(So,(60-e.getMinutes())*6e4+20)}const Hc=it(no,t=>(So(),function(){}));let io={},un;async function To(){un&&(clearTimeout(un),un=0),io=await(await Nl("/monthplot.json")).json(),jc.set(io);let e=new Date;un=setTimeout(To,(24-e.getHours())*36e5+40)}const jc=it(io,t=>(To(),function(){}));let so={};async function Wc(){so=await(await Nl("/temperature.json")).json(),zc.set(so)}const zc=it(so,t=>(Wc(),function(){}));let oo={},vs;async function Gc(){vs&&(clearTimeout(vs),vs=0),oo=await(await Nl("/tariff.json")).json(),Vc.set(oo);let e=new Date;vs=setTimeout(Gc,(60-e.getMinutes())*6e4+30)}const Vc=it(oo,t=>function(){});let ro=[];const No=it(ro);async function S0(){ro=await(await Nl("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),No.set(ro)}let ao={};async function T0(){ao=await(await Nl("/realtime.json")).json(),Kc.set(ao)}const Kc=it(ao,t=>(T0(),function(){}));function Cs(t){return"WARNING: "+t+" must be connected to an external power supply during firmware upgrade. Failure to do so may cause power-down during upload resulting in non-functioning unit."}async function Yc(t){await(await fetch("/upgrade?expected_version="+t,{method:"POST"})).json()}function Qc(t,e){if(/^v\d{1,2}\.\d{1,2}\.\d{1,2}$/.test(t)){let l=t.substring(1).split("."),n=parseInt(l[0]),i=parseInt(l[1]),o=parseInt(l[2]),u=[...e];u.reverse();let a,c,f;for(let p=0;po&&(a=_):M==i+1&&(c=_);else if(d==n+1)if(f){let N=f.tag_name.substring(1).split(".");parseInt(N[0]);let S=parseInt(N[1]);parseInt(N[2]),M==S&&(f=_)}else f=_}return c||f||a||!1}else return e[0]}const N0="/github.svg";function za(t){let e,l;function n(u,a){return u[1]>1?R0:u[1]>0?I0:u[2]>1?D0:u[2]>0?P0:u[3]>1?A0:u[3]>0?E0:$0}let i=n(t),o=i(t);return{c(){e=$(`Up + `),o.c(),l=Ke()},m(u,a){y(u,e,a),o.m(u,a),y(u,l,a)},p(u,a){i===(i=n(u))&&o?o.p(u,a):(o.d(1),o=i(u),o&&(o.c(),o.m(l.parentNode,l)))},d(u){u&&w(e),o.d(u),u&&w(l)}}}function $0(t){let e,l;return{c(){e=$(t[0]),l=$(" seconds")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&1&&X(e,n[0])},d(n){n&&w(e),n&&w(l)}}}function E0(t){let e,l;return{c(){e=$(t[3]),l=$(" minute")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&8&&X(e,n[3])},d(n){n&&w(e),n&&w(l)}}}function A0(t){let e,l;return{c(){e=$(t[3]),l=$(" minutes")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&8&&X(e,n[3])},d(n){n&&w(e),n&&w(l)}}}function P0(t){let e,l;return{c(){e=$(t[2]),l=$(" hour")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&4&&X(e,n[2])},d(n){n&&w(e),n&&w(l)}}}function D0(t){let e,l;return{c(){e=$(t[2]),l=$(" hours")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&4&&X(e,n[2])},d(n){n&&w(e),n&&w(l)}}}function I0(t){let e,l;return{c(){e=$(t[1]),l=$(" day")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&2&&X(e,n[1])},d(n){n&&w(e),n&&w(l)}}}function R0(t){let e,l;return{c(){e=$(t[1]),l=$(" days")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&2&&X(e,n[1])},d(n){n&&w(e),n&&w(l)}}}function L0(t){let e,l=t[0]&&za(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),y(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=za(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:_e,o:_e,d(n){l&&l.d(n),n&&w(e)}}}function O0(t,e,l){let{epoch:n}=e,i=0,o=0,u=0;return t.$$set=a=>{"epoch"in a&&l(0,n=a.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(1,i=Math.floor(n/86400)),l(2,o=Math.floor(n/3600)),l(3,u=Math.floor(n/60)))},[n,i,o,u]}class F0 extends De{constructor(e){super(),Pe(this,e,O0,L0,Ne,{epoch:0})}}function q0(t){let e,l,n;return{c(){e=m("span"),l=$(t[2]),r(e,"title",t[1]),r(e,"class",n="bd-"+t[0])},m(i,o){y(i,e,o),s(e,l)},p(i,[o]){o&4&&X(l,i[2]),o&2&&r(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&r(e,"class",n)},i:_e,o:_e,d(i){i&&w(e)}}}function B0(t,e,l){let{color:n}=e,{title:i}=e,{text:o}=e;return t.$$set=u=>{"color"in u&&l(0,n=u.color),"title"in u&&l(1,i=u.title),"text"in u&&l(2,o=u.text)},[n,i,o]}class fn extends De{constructor(e){super(),Pe(this,e,B0,q0,Ne,{color:0,title:1,text:2})}}function U0(t){let e,l=`${Fe(t[0].getDate())}.${Fe(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Fe(t[0].getHours())}:${Fe(t[0].getMinutes())}`,n;return{c(){e=m("span"),n=$(l),r(e,"class",t[1])},m(i,o){y(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${Fe(i[0].getDate())}.${Fe(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Fe(i[0].getHours())}:${Fe(i[0].getMinutes())}`)&&X(n,l),o&2&&r(e,"class",i[1])},d(i){i&&w(e)}}}function H0(t){let e=`${Fe(t[0].getDate())}. ${to[t[0].getMonth()]} ${Fe(t[0].getHours())}:${Fe(t[0].getMinutes())}`,l;return{c(){l=$(e)},m(n,i){y(n,l,i)},p(n,i){i&1&&e!==(e=`${Fe(n[0].getDate())}. ${to[n[0].getMonth()]} ${Fe(n[0].getHours())}:${Fe(n[0].getMinutes())}`)&&X(l,e)},d(n){n&&w(l)}}}function j0(t){let e;function l(o,u){return o[2]?H0:U0}let n=l(t),i=n(t);return{c(){i.c(),e=Ke()},m(o,u){i.m(o,u),y(o,e,u)},p(o,[u]){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:_e,o:_e,d(o){i.d(o),o&&w(e)}}}function W0(t,e,l){let{timestamp:n}=e,{fullTimeColor:i}=e,{offset:o}=e,u;return t.$$set=a=>{"timestamp"in a&&l(0,n=a.timestamp),"fullTimeColor"in a&&l(1,i=a.fullTimeColor),"offset"in a&&l(3,o=a.offset)},t.$$.update=()=>{t.$$.dirty&9&&(l(2,u=Math.abs(new Date().getTime()-n.getTime())<3e5),isNaN(o)||dl(n,o-(24+n.getHours()-n.getUTCHours())%24))},[n,i,u,o]}class Xc extends De{constructor(e){super(),Pe(this,e,W0,j0,Ne,{timestamp:0,fullTimeColor:1,offset:3})}}function z0(t){let e,l,n;return{c(){e=Te("svg"),l=Te("path"),n=Te("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z"),r(n,"stroke-linecap","round"),r(n,"stroke-linejoin","round"),r(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(i,o){y(i,e,o),s(e,l),s(e,n)},p:_e,i:_e,o:_e,d(i){i&&w(e)}}}class G0 extends De{constructor(e){super(),Pe(this,e,null,z0,Ne,{})}}function V0(t){let e,l;return{c(){e=Te("svg"),l=Te("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){y(n,e,i),s(e,l)},p:_e,i:_e,o:_e,d(n){n&&w(e)}}}class K0 extends De{constructor(e){super(),Pe(this,e,null,V0,Ne,{})}}function Y0(t){let e,l;return{c(){e=Te("svg"),l=Te("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){y(n,e,i),s(e,l)},p:_e,i:_e,o:_e,d(n){n&&w(e)}}}class Bt extends De{constructor(e){super(),Pe(this,e,null,Y0,Ne,{})}}function Q0(t){let e,l;return{c(){e=Te("svg"),l=Te("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9 8.25H7.5a2.25 2.25 0 00-2.25 2.25v9a2.25 2.25 0 002.25 2.25h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25H15M9 12l3 3m0 0l3-3m-3 3V2.25"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){y(n,e,i),s(e,l)},p:_e,i:_e,o:_e,d(n){n&&w(e)}}}class Zc extends De{constructor(e){super(),Pe(this,e,null,Q0,Ne,{})}}function X0(t){let e,l,n=t[1].version+"",i;return{c(){e=$("AMS reader "),l=m("span"),i=$(n)},m(o,u){y(o,e,u),y(o,l,u),s(l,i)},p(o,u){u&2&&n!==(n=o[1].version+"")&&X(i,n)},d(o){o&&w(e),o&&w(l)}}}function Ga(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=m("div"),n=$(l),i=$("\xB0C"),r(e,"class","flex-none my-auto")},m(o,u){y(o,e,u),s(e,n),s(e,i)},p(o,u){u&1&&l!==(l=(o[0].t>-50?o[0].t.toFixed(1):"-")+"")&&X(n,l)},d(o){o&&w(e)}}}function Va(t){let e,l="HAN: "+La(t[0].he),n;return{c(){e=m("div"),n=$(l),r(e,"class","bd-red")},m(i,o){y(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="HAN: "+La(i[0].he))&&X(n,l)},d(i){i&&w(e)}}}function Ka(t){let e,l="MQTT: "+Oa(t[0].me),n;return{c(){e=m("div"),n=$(l),r(e,"class","bd-red")},m(i,o){y(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="MQTT: "+Oa(i[0].me))&&X(n,l)},d(i){i&&w(e)}}}function Ya(t){let e,l="Pricps: "+Fa(t[0].ee),n;return{c(){e=m("div"),n=$(l),r(e,"class","bd-red")},m(i,o){y(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="Pricps: "+Fa(i[0].ee))&&X(n,l)},d(i){i&&w(e)}}}function Qa(t){let e,l,n,i,o,u;return l=new ol({props:{to:"/configuration",$$slots:{default:[Z0]},$$scope:{ctx:t}}}),o=new ol({props:{to:"/status",$$slots:{default:[J0]},$$scope:{ctx:t}}}),{c(){e=m("div"),re(l.$$.fragment),n=h(),i=m("div"),re(o.$$.fragment),r(e,"class","flex-none px-1 mt-1"),r(e,"title","Configuration"),r(i,"class","flex-none px-1 mt-1"),r(i,"title","Device information")},m(a,c){y(a,e,c),se(l,e,null),y(a,n,c),y(a,i,c),se(o,i,null),u=!0},i(a){u||(R(l.$$.fragment,a),R(o.$$.fragment,a),u=!0)},o(a){B(l.$$.fragment,a),B(o.$$.fragment,a),u=!1},d(a){a&&w(e),oe(l),a&&w(n),a&&w(i),oe(o)}}}function Z0(t){let e,l;return e=new G0({}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function J0(t){let e,l;return e=new K0({}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function Xa(t){let e,l,n,i,o;const u=[em,x0],a=[];function c(f,p){return f[1].security==0||f[0].a?0:1}return l=c(t),n=a[l]=u[l](t),{c(){e=m("div"),n.c(),r(e,"class","flex-none mr-3 text-yellow-500"),r(e,"title",i="New version: "+t[2].tag_name)},m(f,p){y(f,e,p),a[l].m(e,null),o=!0},p(f,p){let _=l;l=c(f),l===_?a[l].p(f,p):(Ie(),B(a[_],1,1,()=>{a[_]=null}),Re(),n=a[l],n?n.p(f,p):(n=a[l]=u[l](f),n.c()),R(n,1),n.m(e,null)),(!o||p&4&&i!==(i="New version: "+f[2].tag_name))&&r(e,"title",i)},i(f){o||(R(n),o=!0)},o(f){B(n),o=!1},d(f){f&&w(e),a[l].d()}}}function x0(t){let e,l,n=t[2].tag_name+"",i;return{c(){e=m("span"),l=$("New version: "),i=$(n)},m(o,u){y(o,e,u),s(e,l),s(e,i)},p(o,u){u&4&&n!==(n=o[2].tag_name+"")&&X(i,n)},i:_e,o:_e,d(o){o&&w(e)}}}function em(t){let e,l,n,i=t[2].tag_name+"",o,u,a,c,f,p;return a=new Zc({}),{c(){e=m("button"),l=m("span"),n=$("New version: "),o=$(i),u=h(),re(a.$$.fragment),r(l,"class","mt-1"),r(e,"class","flex")},m(_,b){y(_,e,b),s(e,l),s(l,n),s(l,o),s(e,u),se(a,e,null),c=!0,f||(p=le(e,"click",t[3]),f=!0)},p(_,b){(!c||b&4)&&i!==(i=_[2].tag_name+"")&&X(o,i)},i(_){c||(R(a.$$.fragment,_),c=!0)},o(_){B(a.$$.fragment,_),c=!1},d(_){_&&w(e),oe(a),f=!1,p()}}}function tm(t){let e,l,n,i,o,u,a,c,f,p,_,b,v=(t[0].m?(t[0].m/1e3).toFixed(1):"-")+"",d,M,C,N,S,P,F,A,I,D,O,ie,j,K,G,Y,Q,z,Z,V,H,ee,ue,x,W,U,ke,je,Be,We;i=new ol({props:{to:"/",$$slots:{default:[X0]},$$scope:{ctx:t}}}),c=new F0({props:{epoch:t[0].u}});let $e=t[0].t>-50&&Ga(t);S=new fn({props:{title:"ESP",text:t[1].booting?"Booting":t[0].v>2?t[0].v.toFixed(2)+"V":"ESP",color:Hl(t[1].booting?2:t[0].em)}}),F=new fn({props:{title:"HAN",text:"HAN",color:Hl(t[1].booting?9:t[0].hm)}}),I=new fn({props:{title:"WiFi",text:t[0].r?t[0].r.toFixed(0)+"dBm":"WiFi",color:Hl(t[1].booting?9:t[0].wm)}}),O=new fn({props:{title:"MQTT",text:"MQTT",color:Hl(t[1].booting?9:t[0].mm)}});let ge=(t[0].he<0||t[0].he>0)&&Va(t),Le=t[0].me<0&&Ka(t),Me=(t[0].ee>0||t[0].ee<0)&&Ya(t);ue=new Xc({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),offset:t[1].clock_offset,fullTimeColor:"text-red-500"}});let T=t[1].vndcfg&&t[1].usrcfg&&Qa(t);je=new Bt({});let g=t[1].fwconsent===1&&t[2]&&Xa(t);return{c(){e=m("nav"),l=m("div"),n=m("div"),re(i.$$.fragment),o=h(),u=m("div"),a=m("div"),re(c.$$.fragment),f=h(),$e&&$e.c(),p=h(),_=m("div"),b=$("Free mem: "),d=$(v),M=$("kb"),C=h(),N=m("div"),re(S.$$.fragment),P=h(),re(F.$$.fragment),A=h(),re(I.$$.fragment),D=h(),re(O.$$.fragment),ie=h(),ge&&ge.c(),j=h(),Le&&Le.c(),K=h(),Me&&Me.c(),G=h(),Y=m("div"),Q=m("div"),z=m("a"),Z=m("img"),H=h(),ee=m("div"),re(ue.$$.fragment),x=h(),T&&T.c(),W=h(),U=m("div"),ke=m("a"),re(je.$$.fragment),Be=h(),g&&g.c(),r(n,"class","flex text-lg text-gray-100 p-2"),r(a,"class","flex-none my-auto"),r(_,"class","flex-none my-auto"),r(u,"class","flex-none my-auto p-2 flex space-x-4"),r(N,"class","flex-auto flex-wrap my-auto justify-center p-2"),r(Z,"class","gh-logo"),Xs(Z.src,V=N0)||r(Z,"src",V),r(Z,"alt","GitHub repo"),r(z,"class","float-right"),r(z,"href","https://github.com/UtilitechAS/amsreader-firmware"),r(z,"target","_blank"),r(z,"rel","noreferrer"),r(z,"aria-label","GitHub"),r(Q,"class","flex-none"),r(ee,"class","flex-none my-auto px-2"),r(ke,"href",Ut("")),r(ke,"target","_blank"),r(ke,"rel","noreferrer"),r(U,"class","flex-none px-1 mt-1"),r(U,"title","Documentation"),r(Y,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),r(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),r(e,"class","bg-violet-600 p-1 rounded-md mx-2")},m(k,E){y(k,e,E),s(e,l),s(l,n),se(i,n,null),s(l,o),s(l,u),s(u,a),se(c,a,null),s(u,f),$e&&$e.m(u,null),s(u,p),s(u,_),s(_,b),s(_,d),s(_,M),s(l,C),s(l,N),se(S,N,null),s(N,P),se(F,N,null),s(N,A),se(I,N,null),s(N,D),se(O,N,null),s(l,ie),ge&&ge.m(l,null),s(l,j),Le&&Le.m(l,null),s(l,K),Me&&Me.m(l,null),s(l,G),s(l,Y),s(Y,Q),s(Q,z),s(z,Z),s(Y,H),s(Y,ee),se(ue,ee,null),s(Y,x),T&&T.m(Y,null),s(Y,W),s(Y,U),s(U,ke),se(je,ke,null),s(Y,Be),g&&g.m(Y,null),We=!0},p(k,[E]){const L={};E&18&&(L.$$scope={dirty:E,ctx:k}),i.$set(L);const J={};E&1&&(J.epoch=k[0].u),c.$set(J),k[0].t>-50?$e?$e.p(k,E):($e=Ga(k),$e.c(),$e.m(u,p)):$e&&($e.d(1),$e=null),(!We||E&1)&&v!==(v=(k[0].m?(k[0].m/1e3).toFixed(1):"-")+"")&&X(d,v);const te={};E&3&&(te.text=k[1].booting?"Booting":k[0].v>2?k[0].v.toFixed(2)+"V":"ESP"),E&3&&(te.color=Hl(k[1].booting?2:k[0].em)),S.$set(te);const fe={};E&3&&(fe.color=Hl(k[1].booting?9:k[0].hm)),F.$set(fe);const de={};E&1&&(de.text=k[0].r?k[0].r.toFixed(0)+"dBm":"WiFi"),E&3&&(de.color=Hl(k[1].booting?9:k[0].wm)),I.$set(de);const we={};E&3&&(we.color=Hl(k[1].booting?9:k[0].mm)),O.$set(we),k[0].he<0||k[0].he>0?ge?ge.p(k,E):(ge=Va(k),ge.c(),ge.m(l,j)):ge&&(ge.d(1),ge=null),k[0].me<0?Le?Le.p(k,E):(Le=Ka(k),Le.c(),Le.m(l,K)):Le&&(Le.d(1),Le=null),k[0].ee>0||k[0].ee<0?Me?Me.p(k,E):(Me=Ya(k),Me.c(),Me.m(l,G)):Me&&(Me.d(1),Me=null);const Ee={};E&1&&(Ee.timestamp=k[0].c?new Date(k[0].c*1e3):new Date(0)),E&2&&(Ee.offset=k[1].clock_offset),ue.$set(Ee),k[1].vndcfg&&k[1].usrcfg?T?E&2&&R(T,1):(T=Qa(k),T.c(),R(T,1),T.m(Y,W)):T&&(Ie(),B(T,1,1,()=>{T=null}),Re()),k[1].fwconsent===1&&k[2]?g?(g.p(k,E),E&6&&R(g,1)):(g=Xa(k),g.c(),R(g,1),g.m(Y,null)):g&&(Ie(),B(g,1,1,()=>{g=null}),Re())},i(k){We||(R(i.$$.fragment,k),R(c.$$.fragment,k),R(S.$$.fragment,k),R(F.$$.fragment,k),R(I.$$.fragment,k),R(O.$$.fragment,k),R(ue.$$.fragment,k),R(T),R(je.$$.fragment,k),R(g),We=!0)},o(k){B(i.$$.fragment,k),B(c.$$.fragment,k),B(S.$$.fragment,k),B(F.$$.fragment,k),B(I.$$.fragment,k),B(O.$$.fragment,k),B(ue.$$.fragment,k),B(T),B(je.$$.fragment,k),B(g),We=!1},d(k){k&&w(e),oe(i),oe(c),$e&&$e.d(),oe(S),oe(F),oe(I),oe(O),ge&&ge.d(),Le&&Le.d(),Me&&Me.d(),oe(ue),T&&T.d(),oe(je),g&&g.d()}}}function lm(t,e,l){let{data:n={}}=e,i={},o={};function u(){confirm("Do you want to upgrade this device to "+o.tag_name+"?")&&(!oi(i.board)||confirm(Cs(ve(i.chip,i.board))))&&(Yt.update(a=>(a.upgrading=!0,a)),Yc(o.tag_name))}return Yt.subscribe(a=>{l(1,i=a),a.fwconsent===1&&S0()}),No.subscribe(a=>{l(2,o=Qc(i.version,a))}),t.$$set=a=>{"data"in a&&l(0,n=a.data)},[n,i,o,u]}class nm extends De{constructor(e){super(),Pe(this,e,lm,tm,Ne,{data:0})}}function im(t){let e,l,n,i;return{c(){e=Te("svg"),l=Te("path"),n=Te("path"),r(l,"d",Qs(150,150,115,210,510)),r(l,"stroke","rgba(128, 128, 128, 0.15)"),r(l,"fill","none"),r(l,"stroke-width","55"),r(n,"d",i=Qs(150,150,115,210,210+300*t[0]/100)),r(n,"stroke",t[1]),r(n,"fill","none"),r(n,"stroke-width","55"),r(e,"viewBox","0 0 300 300"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"height","100%")},m(o,u){y(o,e,u),s(e,l),s(e,n)},p(o,[u]){u&1&&i!==(i=Qs(150,150,115,210,210+300*o[0]/100))&&r(n,"d",i),u&2&&r(n,"stroke",o[1])},i:_e,o:_e,d(o){o&&w(e)}}}function Za(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 Qs(t,e,l,n,i){var o=Za(t,e,l,i),u=Za(t,e,l,n),a=i-n<=180?"0":"1",c=["M",o.x,o.y,"A",l,l,0,a,0,u.x,u.y].join(" ");return c}function sm(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 om extends De{constructor(e){super(),Pe(this,e,sm,im,Ne,{pct:0,color:1})}}function Ja(t){let e,l,n,i,o,u,a,c;return{c(){e=m("br"),l=h(),n=m("span"),i=$(t[3]),o=h(),u=m("span"),a=$(t[4]),c=$("/kWh"),r(n,"class","pl-sub"),r(u,"class","pl-snt")},m(f,p){y(f,e,p),y(f,l,p),y(f,n,p),s(n,i),y(f,o,p),y(f,u,p),s(u,a),s(u,c)},p(f,p){p&8&&X(i,f[3]),p&16&&X(a,f[4])},d(f){f&&w(e),f&&w(l),f&&w(n),f&&w(o),f&&w(u)}}}function rm(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C;l=new om({props:{pct:t[6],color:t[5](t[6])}});let N=t[3]&&Ja(t);return{c(){e=m("div"),re(l.$$.fragment),n=h(),i=m("span"),o=m("span"),u=$(t[2]),a=h(),c=m("br"),f=h(),p=m("span"),_=$(t[0]),b=h(),v=m("span"),d=$(t[1]),M=h(),N&&N.c(),r(o,"class","pl-lab"),r(p,"class","pl-val"),r(v,"class","pl-unt"),r(i,"class","pl-ov"),r(e,"class","pl-root")},m(S,P){y(S,e,P),se(l,e,null),s(e,n),s(e,i),s(i,o),s(o,u),s(i,a),s(i,c),s(i,f),s(i,p),s(p,_),s(i,b),s(i,v),s(v,d),s(i,M),N&&N.m(i,null),C=!0},p(S,[P]){const F={};P&64&&(F.pct=S[6]),P&96&&(F.color=S[5](S[6])),l.$set(F),(!C||P&4)&&X(u,S[2]),(!C||P&1)&&X(_,S[0]),(!C||P&2)&&X(d,S[1]),S[3]?N?N.p(S,P):(N=Ja(S),N.c(),N.m(i,null)):N&&(N.d(1),N=null)},i(S){C||(R(l.$$.fragment,S),C=!0)},o(S){B(l.$$.fragment,S),C=!1},d(S){S&&w(e),oe(l),N&&N.d()}}}function am(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:u}=e,{sub:a=""}=e,{subunit:c=""}=e,{colorFn:f}=e,p=0;return t.$$set=_=>{"val"in _&&l(0,n=_.val),"max"in _&&l(7,i=_.max),"unit"in _&&l(1,o=_.unit),"label"in _&&l(2,u=_.label),"sub"in _&&l(3,a=_.sub),"subunit"in _&&l(4,c=_.subunit),"colorFn"in _&&l(5,f=_.colorFn)},t.$$.update=()=>{t.$$.dirty&129&&l(6,p=Math.min(n,i)/i*100)},[n,o,u,a,c,f,p,i]}class Jc extends De{constructor(e){super(),Pe(this,e,am,rm,Ne,{val:0,max:7,unit:1,label:2,sub:3,subunit:4,colorFn:5})}}function xa(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function eu(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function tu(t,e,l){const n=t.slice();return n[15]=e[l],n}function lu(t){let e,l,n,i,o,u,a=t[0].title&&nu(t),c=t[0].y.ticks,f=[];for(let d=0;dt[9].call(e))},m(o,u){y(o,e,u),s(e,n),i=bo(e,t[9].bind(e))},p(o,u){u&1&&l!==(l=o[0].title+"")&&X(n,l)},d(o){o&&w(e),i()}}}function iu(t){let e,l,n,i=t[15].label+"",o,u,a,c;return{c(){e=Te("g"),l=Te("line"),n=Te("text"),o=$(i),r(l,"x2","100%"),r(n,"y","-4"),r(n,"x",u=t[15].align=="right"?"85%":""),r(e,"class",a="tick tick-"+t[15].value+" tick-"+t[15].color),r(e,"transform",c="translate(0, "+t[7](t[15].value)+")")},m(f,p){y(f,e,p),s(e,l),s(e,n),s(n,o)},p(f,p){p&1&&i!==(i=f[15].label+"")&&X(o,i),p&1&&u!==(u=f[15].align=="right"?"85%":"")&&r(n,"x",u),p&1&&a!==(a="tick tick-"+f[15].value+" tick-"+f[15].color)&&r(e,"class",a),p&129&&c!==(c="translate(0, "+f[7](f[15].value)+")")&&r(e,"transform",c)},d(f){f&&w(e)}}}function su(t){let e=!isNaN(t[7](t[15].value)),l,n=e&&iu(t);return{c(){n&&n.c(),l=Ke()},m(i,o){n&&n.m(i,o),y(i,l,o)},p(i,o){o&129&&(e=!isNaN(i[7](i[15].value))),e?n?n.p(i,o):(n=iu(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&w(l)}}}function ou(t){let e,l,n=(t[3]>20||t[13]%2==0)&&ru(t);return{c(){e=Te("g"),n&&n.c(),r(e,"class","tick"),r(e,"transform",l="translate("+t[6](t[13])+","+t[4]+")")},m(i,o){y(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[13]%2==0?n?n.p(i,o):(n=ru(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&80&&l!==(l="translate("+i[6](i[13])+","+i[4]+")")&&r(e,"transform",l)},d(i){i&&w(e),n&&n.d()}}}function ru(t){let e,l=t[11].label+"",n,i;return{c(){e=Te("text"),n=$(l),r(e,"x",i=t[3]/2),r(e,"y","-4")},m(o,u){y(o,e,u),s(e,n)},p(o,u){u&1&&l!==(l=o[11].label+"")&&X(n,l),u&8&&i!==(i=o[3]/2)&&r(e,"x",i)},d(o){o&&w(e)}}}function au(t){let e=!isNaN(t[6](t[13])),l,n=e&&ou(t);return{c(){n&&n.c(),l=Ke()},m(i,o){n&&n.m(i,o),y(i,l,o)},p(i,o){o&64&&(e=!isNaN(i[6](i[13]))),e?n?n.p(i,o):(n=ou(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&w(l)}}}function uu(t){let e,l,n=t[11].value!==void 0&&fu(t),i=t[11].value2>1e-4&&pu(t);return{c(){e=Te("g"),n&&n.c(),l=Te("g"),i&&i.c()},m(o,u){y(o,e,u),n&&n.m(e,null),y(o,l,u),i&&i.m(l,null)},p(o,u){o[11].value!==void 0?n?n.p(o,u):(n=fu(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[11].value2>1e-4?i?i.p(o,u):(i=pu(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&w(e),n&&n.d(),o&&w(l),i&&i.d()}}}function fu(t){let e,l,n,i,o,u,a,c=t[3]>15&&cu(t);return{c(){e=Te("rect"),c&&c.c(),a=Ke(),r(e,"x",l=t[6](t[13])+2),r(e,"y",n=t[7](t[11].value)),r(e,"width",i=t[3]-4),r(e,"height",o=t[7](t[0].y.min)-t[7](Math.min(t[0].y.min,0)+t[11].value)),r(e,"fill",u=t[11].color)},m(f,p){y(f,e,p),c&&c.m(f,p),y(f,a,p)},p(f,p){p&64&&l!==(l=f[6](f[13])+2)&&r(e,"x",l),p&129&&n!==(n=f[7](f[11].value))&&r(e,"y",n),p&8&&i!==(i=f[3]-4)&&r(e,"width",i),p&129&&o!==(o=f[7](f[0].y.min)-f[7](Math.min(f[0].y.min,0)+f[11].value))&&r(e,"height",o),p&1&&u!==(u=f[11].color)&&r(e,"fill",u),f[3]>15?c?c.p(f,p):(c=cu(f),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(f){f&&w(e),c&&c.d(f),f&&w(a)}}}function cu(t){let e,l=t[11].label+"",n,i,o,u,a,c,f=t[11].title&&mu(t);return{c(){e=Te("text"),n=$(l),f&&f.c(),c=Ke(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor",o=t[3]t[7](0)-t[8]?t[11].color:"white"),r(e,"transform",a="translate("+(t[6](t[13])+t[3]/2)+" "+(t[7](t[11].value)>t[7](0)-t[8]?t[7](t[11].value)-t[8]:t[7](t[11].value)+10)+") rotate("+(t[3]p[7](0)-p[8]?p[11].color:"white")&&r(e,"fill",u),_&457&&a!==(a="translate("+(p[6](p[13])+p[3]/2)+" "+(p[7](p[11].value)>p[7](0)-p[8]?p[7](p[11].value)-p[8]:p[7](p[11].value)+10)+") rotate("+(p[3]15&&_u(t);return{c(){e=Te("rect"),c&&c.c(),a=Ke(),r(e,"x",l=t[6](t[13])+2),r(e,"y",n=t[7](0)),r(e,"width",i=t[3]-4),r(e,"height",o=t[7](t[0].y.min)-t[7](t[0].y.min+t[11].value2)),r(e,"fill",u=t[11].color2?t[11].color2:t[11].color)},m(f,p){y(f,e,p),c&&c.m(f,p),y(f,a,p)},p(f,p){p&64&&l!==(l=f[6](f[13])+2)&&r(e,"x",l),p&128&&n!==(n=f[7](0))&&r(e,"y",n),p&8&&i!==(i=f[3]-4)&&r(e,"width",i),p&129&&o!==(o=f[7](f[0].y.min)-f[7](f[0].y.min+f[11].value2))&&r(e,"height",o),p&1&&u!==(u=f[11].color2?f[11].color2:f[11].color)&&r(e,"fill",u),f[3]>15?c?c.p(f,p):(c=_u(f),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(f){f&&w(e),c&&c.d(f),f&&w(a)}}}function _u(t){let e,l=t[11].label2+"",n,i,o,u,a,c=t[11].title2&&du(t);return{c(){e=Te("text"),n=$(l),c&&c.c(),a=Ke(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor","middle"),r(e,"fill",o=t[7](-t[11].value2)t[10].call(e))},m(i,o){y(i,e,o),n&&n.m(e,null),l=bo(e,t[10].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=lu(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:_e,o:_e,d(i){i&&w(e),n&&n.d(),l()}}}let cn=30;function fm(t,e,l){let{config:n}=e,i,o,u,a,c,f,p,_=0;function b(){_=this.clientHeight,l(5,_)}function v(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return t.$$set=d=>{"config"in d&&l(0,n=d.config)},t.$$.update=()=>{if(t.$$.dirty&63){l(4,f=o-_);let d=i-(n.padding.left+n.padding.right);l(3,u=d/n.points.length),l(8,p=un.y.max?N=n.padding.bottom:Cf||N<0?0:N})}},[n,i,o,u,f,_,a,c,p,b,v]}class pn extends De{constructor(e){super(),Pe(this,e,fm,um,Ne,{config:0})}}function cm(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function mm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{ds:u}=e,a={};function c(f){return{label:be(f)+"V",title:f.toFixed(1)+" V",value:isNaN(f)?0:f,color:y0(f||0)}}return t.$$set=f=>{"u1"in f&&l(1,n=f.u1),"u2"in f&&l(2,i=f.u2),"u3"in f&&l(3,o=f.u3),"ds"in f&&l(4,u=f.ds)},t.$$.update=()=>{if(t.$$.dirty&30){let f=[],p=[];n>0&&(f.push({label:u===1?"L1-L2":"L1"}),p.push(c(n))),i>0&&(f.push({label:u===1?"L1-L3":"L2"}),p.push(c(i))),o>0&&(f.push({label:u===1?"L2-L3":"L3"}),p.push(c(o))),l(0,a={title:"Voltage",padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:f},points:p})}},[a,n,i,o,u]}class pm extends De{constructor(e){super(),Pe(this,e,mm,cm,Ne,{u1:1,u2:2,u3:3,ds:4})}}function _m(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function dm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{i1:u}=e,{i2:a}=e,{i2e:c}=e,{i3:f}=e,{max:p}=e,_={};function b(v,d){return{label:be(v)+"A",title:(d?"Estimated ":"")+v.toFixed(1)+" A",value:isNaN(v)?0:v,color:Fc(v?v/p*100:0,d)}}return t.$$set=v=>{"u1"in v&&l(1,n=v.u1),"u2"in v&&l(2,i=v.u2),"u3"in v&&l(3,o=v.u3),"i1"in v&&l(4,u=v.i1),"i2"in v&&l(5,a=v.i2),"i2e"in v&&l(6,c=v.i2e),"i3"in v&&l(7,f=v.i3),"max"in v&&l(8,p=v.max)},t.$$.update=()=>{if(t.$$.dirty&510){let v=[],d=[];n>0&&(v.push({label:"L1"}),d.push(b(u))),i>0&&(v.push({label:"L2"}),d.push(b(a,c))),o>0&&(v.push({label:"L3"}),d.push(b(f))),l(0,_={title:"Amperage",padding:{top:20,right:15,bottom:20,left:35},y:{min:0,max:p,ticks:[{value:0,label:"0%"},{value:p/4,label:"25%"},{value:p/2,label:"50%"},{value:p/4*3,label:"75%"},{value:p,label:"100%"}]},x:{ticks:v},points:d})}},[_,n,i,o,u,a,c,f,p]}class vm extends De{constructor(e){super(),Pe(this,e,dm,_m,Ne,{u1:1,u2:2,u3:3,i1:4,i2:5,i2e:6,i3:7,max:8})}}function hm(t){let e,l,n,i,o,u,a,c=(typeof t[0]<"u"?t[0].toFixed(0):"-")+"",f,p,_,b,v,d,M=(typeof t[1]<"u"?t[1].toFixed(0):"-")+"",C,N,S,P,F,A,I,D=(typeof t[2]<"u"?t[2].toFixed(1):"-")+"",O,ie,j,K,G,Y,Q=(typeof t[3]<"u"?t[3].toFixed(1):"-")+"",z,Z;return{c(){e=m("div"),l=m("strong"),l.textContent="Reactive",n=h(),i=m("div"),o=m("div"),o.textContent="Instant in",u=h(),a=m("div"),f=$(c),p=$(" VAr"),_=h(),b=m("div"),b.textContent="Instant out",v=h(),d=m("div"),C=$(M),N=$(" VAr"),S=h(),P=m("div"),F=m("div"),F.textContent="Total in",A=h(),I=m("div"),O=$(D),ie=$(" kVArh"),j=h(),K=m("div"),K.textContent="Total out",G=h(),Y=m("div"),z=$(Q),Z=$(" kVArh"),r(a,"class","text-right"),r(d,"class","text-right"),r(i,"class","grid grid-cols-2 mt-4"),r(I,"class","text-right"),r(Y,"class","text-right"),r(P,"class","grid grid-cols-2 mt-4"),r(e,"class","mx-2 text-sm")},m(V,H){y(V,e,H),s(e,l),s(e,n),s(e,i),s(i,o),s(i,u),s(i,a),s(a,f),s(a,p),s(i,_),s(i,b),s(i,v),s(i,d),s(d,C),s(d,N),s(e,S),s(e,P),s(P,F),s(P,A),s(P,I),s(I,O),s(I,ie),s(P,j),s(P,K),s(P,G),s(P,Y),s(Y,z),s(Y,Z)},p(V,[H]){H&1&&c!==(c=(typeof V[0]<"u"?V[0].toFixed(0):"-")+"")&&X(f,c),H&2&&M!==(M=(typeof V[1]<"u"?V[1].toFixed(0):"-")+"")&&X(C,M),H&4&&D!==(D=(typeof V[2]<"u"?V[2].toFixed(1):"-")+"")&&X(O,D),H&8&&Q!==(Q=(typeof V[3]<"u"?V[3].toFixed(1):"-")+"")&&X(z,Q)},i:_e,o:_e,d(V){V&&w(e)}}}function bm(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:o}=e,{exportTotal:u}=e;return t.$$set=a=>{"importInstant"in a&&l(0,n=a.importInstant),"exportInstant"in a&&l(1,i=a.exportInstant),"importTotal"in a&&l(2,o=a.importTotal),"exportTotal"in a&&l(3,u=a.exportTotal)},[n,i,o,u]}class gm extends De{constructor(e){super(),Pe(this,e,bm,hm,Ne,{importInstant:0,exportInstant:1,importTotal:2,exportTotal:3})}}function hu(t){let e;function l(o,u){return o[3]?wm:km}let n=l(t),i=n(t);return{c(){i.c(),e=Ke()},m(o,u){i.m(o,u),y(o,e,u)},p(o,u){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&w(e)}}}function km(t){let e,l,n,i,o,u,a=be(t[1].h.u,2)+"",c,f,p,_,b,v,d=be(t[1].d.u,1)+"",M,C,N,S,P,F,A=be(t[1].m.u)+"",I,D,O,ie,j,K,G=be(t[0].last_month.u)+"",Y,Q,z,Z,V=t[4]&&bu(t);return{c(){e=m("strong"),e.textContent="Consumption",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=$(a),f=$(" kWh"),p=h(),_=m("div"),_.textContent="Day",b=h(),v=m("div"),M=$(d),C=$(" kWh"),N=h(),S=m("div"),S.textContent="Month",P=h(),F=m("div"),I=$(A),D=$(" kWh"),O=h(),ie=m("div"),ie.textContent="Last month",j=h(),K=m("div"),Y=$(G),Q=$(" kWh"),z=h(),V&&V.c(),Z=Ke(),r(u,"class","text-right"),r(v,"class","text-right"),r(F,"class","text-right"),r(K,"class","text-right"),r(n,"class","grid grid-cols-2 mb-3")},m(H,ee){y(H,e,ee),y(H,l,ee),y(H,n,ee),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(n,p),s(n,_),s(n,b),s(n,v),s(v,M),s(v,C),s(n,N),s(n,S),s(n,P),s(n,F),s(F,I),s(F,D),s(n,O),s(n,ie),s(n,j),s(n,K),s(K,Y),s(K,Q),y(H,z,ee),V&&V.m(H,ee),y(H,Z,ee)},p(H,ee){ee&2&&a!==(a=be(H[1].h.u,2)+"")&&X(c,a),ee&2&&d!==(d=be(H[1].d.u,1)+"")&&X(M,d),ee&2&&A!==(A=be(H[1].m.u)+"")&&X(I,A),ee&1&&G!==(G=be(H[0].last_month.u)+"")&&X(Y,G),H[4]?V?V.p(H,ee):(V=bu(H),V.c(),V.m(Z.parentNode,Z)):V&&(V.d(1),V=null)},d(H){H&&w(e),H&&w(l),H&&w(n),H&&w(z),V&&V.d(H),H&&w(Z)}}}function wm(t){let e,l,n,i,o,u,a=be(t[1].h.u,2)+"",c,f,p,_,b,v,d,M=be(t[1].d.u,1)+"",C,N,S,P,F,A,I,D=be(t[1].m.u)+"",O,ie,j,K,G,Y,Q,z=be(t[0].last_month.u)+"",Z,V,H,ee,ue,x,W,U,ke,je,Be,We=be(t[1].h.p,2)+"",$e,ge,Le,Me,T,g,k,E=be(t[1].d.p,1)+"",L,J,te,fe,de,we,Ee,ae=be(t[1].m.p)+"",Ce,Je,Et,st,ht,lt,At,Ye=be(t[0].last_month.p)+"",Qt,jt,bt,ze,xe=t[4]&&gu(t),Xe=t[4]&&ku(t),Ue=t[4]&&wu(t),qe=t[4]&&yu(t),et=t[4]&&Cu(t),Ae=t[4]&&Mu(t),Oe=t[4]&&Su(t),pe=t[4]&&Tu(t);return{c(){e=m("strong"),e.textContent="Import",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=$(a),f=$(" kWh"),p=h(),xe&&xe.c(),_=h(),b=m("div"),b.textContent="Day",v=h(),d=m("div"),C=$(M),N=$(" kWh"),S=h(),Xe&&Xe.c(),P=h(),F=m("div"),F.textContent="Month",A=h(),I=m("div"),O=$(D),ie=$(" kWh"),j=h(),Ue&&Ue.c(),K=h(),G=m("div"),G.textContent="Last mo.",Y=h(),Q=m("div"),Z=$(z),V=$(" kWh"),H=h(),qe&&qe.c(),ue=h(),x=m("strong"),x.textContent="Export",W=h(),U=m("div"),ke=m("div"),ke.textContent="Hour",je=h(),Be=m("div"),$e=$(We),ge=$(" kWh"),Le=h(),et&&et.c(),Me=h(),T=m("div"),T.textContent="Day",g=h(),k=m("div"),L=$(E),J=$(" kWh"),te=h(),Ae&&Ae.c(),fe=h(),de=m("div"),de.textContent="Month",we=h(),Ee=m("div"),Ce=$(ae),Je=$(" kWh"),Et=h(),Oe&&Oe.c(),st=h(),ht=m("div"),ht.textContent="Last mo.",lt=h(),At=m("div"),Qt=$(Ye),jt=$(" kWh"),bt=h(),pe&&pe.c(),r(u,"class","text-right"),r(d,"class","text-right"),r(I,"class","text-right"),r(Q,"class","text-right"),r(n,"class",ee="grid grid-cols-"+t[5]+" mb-3"),r(Be,"class","text-right"),r(k,"class","text-right"),r(Ee,"class","text-right"),r(At,"class","text-right"),r(U,"class",ze="grid grid-cols-"+t[5])},m(ce,ye){y(ce,e,ye),y(ce,l,ye),y(ce,n,ye),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(n,p),xe&&xe.m(n,null),s(n,_),s(n,b),s(n,v),s(n,d),s(d,C),s(d,N),s(n,S),Xe&&Xe.m(n,null),s(n,P),s(n,F),s(n,A),s(n,I),s(I,O),s(I,ie),s(n,j),Ue&&Ue.m(n,null),s(n,K),s(n,G),s(n,Y),s(n,Q),s(Q,Z),s(Q,V),s(n,H),qe&&qe.m(n,null),y(ce,ue,ye),y(ce,x,ye),y(ce,W,ye),y(ce,U,ye),s(U,ke),s(U,je),s(U,Be),s(Be,$e),s(Be,ge),s(U,Le),et&&et.m(U,null),s(U,Me),s(U,T),s(U,g),s(U,k),s(k,L),s(k,J),s(U,te),Ae&&Ae.m(U,null),s(U,fe),s(U,de),s(U,we),s(U,Ee),s(Ee,Ce),s(Ee,Je),s(U,Et),Oe&&Oe.m(U,null),s(U,st),s(U,ht),s(U,lt),s(U,At),s(At,Qt),s(At,jt),s(U,bt),pe&&pe.m(U,null)},p(ce,ye){ye&2&&a!==(a=be(ce[1].h.u,2)+"")&&X(c,a),ce[4]?xe?xe.p(ce,ye):(xe=gu(ce),xe.c(),xe.m(n,_)):xe&&(xe.d(1),xe=null),ye&2&&M!==(M=be(ce[1].d.u,1)+"")&&X(C,M),ce[4]?Xe?Xe.p(ce,ye):(Xe=ku(ce),Xe.c(),Xe.m(n,P)):Xe&&(Xe.d(1),Xe=null),ye&2&&D!==(D=be(ce[1].m.u)+"")&&X(O,D),ce[4]?Ue?Ue.p(ce,ye):(Ue=wu(ce),Ue.c(),Ue.m(n,K)):Ue&&(Ue.d(1),Ue=null),ye&1&&z!==(z=be(ce[0].last_month.u)+"")&&X(Z,z),ce[4]?qe?qe.p(ce,ye):(qe=yu(ce),qe.c(),qe.m(n,null)):qe&&(qe.d(1),qe=null),ye&32&&ee!==(ee="grid grid-cols-"+ce[5]+" mb-3")&&r(n,"class",ee),ye&2&&We!==(We=be(ce[1].h.p,2)+"")&&X($e,We),ce[4]?et?et.p(ce,ye):(et=Cu(ce),et.c(),et.m(U,Me)):et&&(et.d(1),et=null),ye&2&&E!==(E=be(ce[1].d.p,1)+"")&&X(L,E),ce[4]?Ae?Ae.p(ce,ye):(Ae=Mu(ce),Ae.c(),Ae.m(U,fe)):Ae&&(Ae.d(1),Ae=null),ye&2&&ae!==(ae=be(ce[1].m.p)+"")&&X(Ce,ae),ce[4]?Oe?Oe.p(ce,ye):(Oe=Su(ce),Oe.c(),Oe.m(U,st)):Oe&&(Oe.d(1),Oe=null),ye&1&&Ye!==(Ye=be(ce[0].last_month.p)+"")&&X(Qt,Ye),ce[4]?pe?pe.p(ce,ye):(pe=Tu(ce),pe.c(),pe.m(U,null)):pe&&(pe.d(1),pe=null),ye&32&&ze!==(ze="grid grid-cols-"+ce[5])&&r(U,"class",ze)},d(ce){ce&&w(e),ce&&w(l),ce&&w(n),xe&&xe.d(),Xe&&Xe.d(),Ue&&Ue.d(),qe&&qe.d(),ce&&w(ue),ce&&w(x),ce&&w(W),ce&&w(U),et&&et.d(),Ae&&Ae.d(),Oe&&Oe.d(),pe&&pe.d()}}}function bu(t){let e,l,n,i,o,u,a=be(t[1].h.c,2)+"",c,f,p,_,b,v,d,M=be(t[1].d.c,1)+"",C,N,S,P,F,A,I,D=be(t[1].m.c)+"",O,ie,j,K,G,Y,Q,z=be(t[0].last_month.c)+"",Z,V,H;return{c(){e=m("strong"),e.textContent="Cost",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=$(a),f=h(),p=$(t[2]),_=h(),b=m("div"),b.textContent="Day",v=h(),d=m("div"),C=$(M),N=h(),S=$(t[2]),P=h(),F=m("div"),F.textContent="Month",A=h(),I=m("div"),O=$(D),ie=h(),j=$(t[2]),K=h(),G=m("div"),G.textContent="Last month",Y=h(),Q=m("div"),Z=$(z),V=h(),H=$(t[2]),r(u,"class","text-right"),r(d,"class","text-right"),r(I,"class","text-right"),r(Q,"class","text-right"),r(n,"class","grid grid-cols-2")},m(ee,ue){y(ee,e,ue),y(ee,l,ue),y(ee,n,ue),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(u,p),s(n,_),s(n,b),s(n,v),s(n,d),s(d,C),s(d,N),s(d,S),s(n,P),s(n,F),s(n,A),s(n,I),s(I,O),s(I,ie),s(I,j),s(n,K),s(n,G),s(n,Y),s(n,Q),s(Q,Z),s(Q,V),s(Q,H)},p(ee,ue){ue&2&&a!==(a=be(ee[1].h.c,2)+"")&&X(c,a),ue&4&&X(p,ee[2]),ue&2&&M!==(M=be(ee[1].d.c,1)+"")&&X(C,M),ue&4&&X(S,ee[2]),ue&2&&D!==(D=be(ee[1].m.c)+"")&&X(O,D),ue&4&&X(j,ee[2]),ue&1&&z!==(z=be(ee[0].last_month.c)+"")&&X(Z,z),ue&4&&X(H,ee[2])},d(ee){ee&&w(e),ee&&w(l),ee&&w(n)}}}function gu(t){let e,l=be(t[1].h.c,2)+"",n,i,o;return{c(){e=m("div"),n=$(l),i=h(),o=$(t[2]),r(e,"class","text-right")},m(u,a){y(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=be(u[1].h.c,2)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&w(e)}}}function ku(t){let e,l=be(t[1].d.c,1)+"",n,i,o;return{c(){e=m("div"),n=$(l),i=h(),o=$(t[2]),r(e,"class","text-right")},m(u,a){y(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=be(u[1].d.c,1)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&w(e)}}}function wu(t){let e,l=be(t[1].m.c)+"",n,i,o;return{c(){e=m("div"),n=$(l),i=h(),o=$(t[2]),r(e,"class","text-right")},m(u,a){y(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=be(u[1].m.c)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&w(e)}}}function yu(t){let e,l=be(t[0].last_month.c)+"",n,i,o;return{c(){e=m("div"),n=$(l),i=h(),o=$(t[2]),r(e,"class","text-right")},m(u,a){y(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=be(u[0].last_month.c)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&w(e)}}}function Cu(t){let e,l=be(t[1].h.i,2)+"",n,i,o;return{c(){e=m("div"),n=$(l),i=h(),o=$(t[2]),r(e,"class","text-right")},m(u,a){y(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=be(u[1].h.i,2)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&w(e)}}}function Mu(t){let e,l=be(t[1].d.i,1)+"",n,i,o;return{c(){e=m("div"),n=$(l),i=h(),o=$(t[2]),r(e,"class","text-right")},m(u,a){y(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=be(u[1].d.i,1)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&w(e)}}}function Su(t){let e,l=be(t[1].m.i)+"",n,i,o;return{c(){e=m("div"),n=$(l),i=h(),o=$(t[2]),r(e,"class","text-right")},m(u,a){y(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=be(u[1].m.i)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&w(e)}}}function Tu(t){let e,l=be(t[0].last_month.i)+"",n,i,o;return{c(){e=m("div"),n=$(l),i=h(),o=$(t[2]),r(e,"class","text-right")},m(u,a){y(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=be(u[0].last_month.i)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&w(e)}}}function ym(t){let e,l,n,i,o,u,a=t[1]&&hu(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Real time calculation",n=h(),i=m("br"),o=m("br"),u=h(),a&&a.c(),r(e,"class","mx-2 text-sm")},m(c,f){y(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),s(e,u),a&&a.m(e,null)},p(c,[f]){c[1]?a?a.p(c,f):(a=hu(c),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i:_e,o:_e,d(c){c&&w(e),a&&a.d()}}}function Cm(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:u}=e,a=!1,c=3;return t.$$set=f=>{"sysinfo"in f&&l(0,n=f.sysinfo),"data"in f&&l(1,i=f.data),"currency"in f&&l(2,o=f.currency),"hasExport"in f&&l(3,u=f.hasExport)},t.$$.update=()=>{t.$$.dirty&18&&(l(4,a=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(5,c=a?3:2))},[n,i,o,u,a,c]}class Mm extends De{constructor(e){super(),Pe(this,e,Cm,ym,Ne,{sysinfo:0,data:1,currency:2,hasExport:3})}}function Sm(t){let e,l,n=Ua(t[0].source)+"",i,o,u,a,c;return a=new pn({props:{config:t[1]}}),{c(){e=m("a"),l=$("Provided by: "),i=$(n),u=h(),re(a.$$.fragment),r(e,"href",o=Ha(t[0].source)),r(e,"target","_blank"),r(e,"class","text-xs float-right z-40")},m(f,p){y(f,e,p),s(e,l),s(e,i),y(f,u,p),se(a,f,p),c=!0},p(f,[p]){(!c||p&1)&&n!==(n=Ua(f[0].source)+"")&&X(i,n),(!c||p&1&&o!==(o=Ha(f[0].source)))&&r(e,"href",o);const _={};p&2&&(_.config=f[1]),a.$set(_)},i(f){c||(R(a.$$.fragment,f),c=!0)},o(f){B(a.$$.fragment,f),c=!1},d(f){f&&w(e),f&&w(u),oe(a,f)}}}function Tm(t,e,l){let{json:n}=e,{sysinfo:i}=e,o={},u,a;return t.$$set=c=>{"json"in c&&l(0,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&29){let c=n.currency,f=new Date().getUTCHours(),p=0,_=0,b=0,v=[],d=[],M=[];l(4,a=l(3,u=0));let C=new Date;for(dl(C,i.clock_offset-(24+C.getHours()-C.getUTCHours())%24),p=f;p<24&&(_=n[Fe(b++)],_!=null);p++)d.push({label:Fe(C.getHours())}),M.push(_*100),l(4,a=Math.min(a,_*100)),l(3,u=Math.max(u,_*100)),dl(C,1);for(p=0;p<24&&(_=n[Fe(b++)],_!=null);p++)d.push({label:Fe(C.getHours())}),M.push(_*100),l(4,a=Math.min(a,_*100)),l(3,u=Math.max(u,_*100)),dl(C,1);if(a>-100&&u<100){switch(c){case"NOK":case"DKK":c="\xF8re";break;case"SEK":c="\xF6re";break;case"EUR":c="cent";break;case"CHF":c="rp.";break;default:c=c+"/100"}for(l(4,a*=100),l(3,u*=100),p=0;p=0?A.toFixed(I):"",title:A>=0?A.toFixed(2)+" "+c:"",value:_>=0?Math.abs(_):0,label2:A<0?A.toFixed(I):"",title2:A<0?A.toFixed(2)+" "+c:"",value2:_<0?Math.abs(_):0,color:"#7c3aed"})}let S=Math.max(u,Math.abs(a));if(a<0){l(4,a=Math.min(S/4*-1,a));let A=Math.ceil(Math.abs(a)/S*4),I=a/A;for(p=1;p{"json"in c&&l(1,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let c=0,f=[],p=[],_=[];l(4,a=l(3,u=0));let b=dl(new Date,-24),v=new Date().getUTCHours();for(dl(b,i.clock_offset-(24+b.getHours()-b.getUTCHours())%24),c=v;c<24;c++){let N=n["i"+Fe(c)],S=n["e"+Fe(c)];N===void 0&&(N=0),S===void 0&&(S=0),p.push({label:Fe(b.getHours())}),_.push({label:N.toFixed(1),title:N.toFixed(2)+" kWh",value:N*10,label2:S.toFixed(1),title2:S.toFixed(2)+" kWh",value2:S*10,color:"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,S*10)),l(3,u=Math.max(u,N*10)),dl(b,1)}for(c=0;c{"json"in c&&l(1,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let c=0,f=[],p=[],_=[];l(4,a=l(3,u=0));let b=new Date,v=new Date;for(dl(b,i.clock_offset-(24+b.getHours()-b.getUTCHours())%24),dl(v,i.clock_offset-(24+v.getHours()-v.getUTCHours())%24),v.setDate(0),c=b.getDate();c<=v.getDate();c++){let N=n["i"+Fe(c)],S=n["e"+Fe(c)];N===void 0&&(N=0),S===void 0&&(S=0),p.push({label:Fe(c)}),_.push({label:N.toFixed(N<10?1:0),title:N.toFixed(2)+" kWh",value:N,label2:S.toFixed(S<10?1:0),title2:S.toFixed(2)+" kWh",value2:S,color:"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,S)),l(3,u=Math.max(u,N))}for(c=1;c{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=0,c=0,f=[],p=[],_=[];n.s&&n.s.forEach((d,M)=>{var C=d.n?d.n:d.a;c=d.v,c==-127&&(c=0),p.push({label:C.slice(-4)}),_.push({label:c.toFixed(1),value:c,color:"#7c3aed"}),l(3,u=Math.min(u,c)),l(2,o=Math.max(o,c))}),l(2,o=Math.ceil(o)),l(3,u=Math.floor(u));let b=o;u<0&&(b+=Math.abs(u));let v=b/4;for(a=0;a<5;a++)c=u+v*a,f.push({value:c,label:c.toFixed(1)});l(0,i={title:"Temperature sensors (\xB0C)",height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:u,max:o,ticks:f},x:{ticks:p},points:_})}},[i,n,o,u]}class Om extends De{constructor(e){super(),Pe(this,e,Lm,Rm,Ne,{json:1})}}function Fm(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}let qm=0;function Bm(t,e,l){let n={},i=0,o;return Vc.subscribe(u=>{l(2,o=u)}),Gc(),t.$$.update=()=>{if(t.$$.dirty&6){let u=0,a=[],c=[],f=[];if(a.push({value:0,label:0}),o&&o.p)for(u=0;u0?Fe(p.d)+"."+to[new Date().getMonth()]:"-"}),l(1,i=Math.max(i,p.v))}if(o&&o.t){for(u=0;u=i)break;a.push({value:p,label:p})}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:qm,max:i,ticks:a},x:{ticks:c},points:f})}},[n,i,o]}class Um extends De{constructor(e){super(),Pe(this,e,Bm,Fm,Ne,{})}}function Nu(t,e,l){const n=t.slice();return n[18]=e[l],n[20]=l,n}function $u(t,e,l){const n=t.slice();return n[21]=e[l],n}function Eu(t){let e,l,n,i,o,u=t[7],a=[];for(let p=0;pt[14].call(e))},m(f,p){y(f,e,p),s(e,l),s(l,n),s(l,i),s(l,o),s(e,u),c&&c.m(e,null),a=bo(e,t[14].bind(e))},p(f,[p]){p&1024&&X(i,f[10]),f[7]?c?c.p(f,p):(c=Eu(f),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i:_e,o:_e,d(f){f&&w(e),c&&c.d(),a()}}}let jm=12;function Wm(t,e,l){let n;Kc.subscribe(A=>{l(11,n=A)});let i,o=0;function u(){n.data.unshift(0),l(11,n.data=n.data.slice(0,n.size),n),o+=10,i=setTimeout(u,1e4)}qc.subscribe(A=>{o>0?n.data&&A.u-o>=10&&(i&&clearTimeout(i),n.data.unshift(A.i-A.e),l(11,n.data=n.data.slice(0,n.size),n),o+=10,i=setTimeout(u,1e4)):o=A.u});let a,c,f,p,_,b,v,d,M,C,N,S,P;function F(){f=this.clientWidth,p=this.clientHeight,l(0,f),l(1,p)}return t.$$.update=()=>{if(t.$$.dirty&14847&&(l(2,_=parseInt(p)-50),l(3,b=f-35),l(9,S=b/n.size),l(13,c=0),l(12,a=0),n.data)){for(let I in n.data){let D=n.data[I];l(12,a=Math.max(Math.ceil(D/1e3)*1e3,a)),l(13,c=Math.min(Math.ceil(D/1e3)*1e3,c))}l(10,P=a>2500?"kW":"W"),l(7,C=[]);for(let I=c;I2500?(I/1e3).toFixed(1):I});l(8,N=[]);for(let I=c;I0||t[0].e>0}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt")},m(i,o){y(i,e,o),se(l,e,null),n=!0},p(i,o){const u={};o&2&&(u.sysinfo=i[1]),o&1&&(u.data=i[0].ea),o&1&&(u.currency=i[0].pc),o&1&&(u.hasExport=i[0].om>0||i[0].e>0),l.$set(u)},i(i){n||(R(l.$$.fragment,i),n=!0)},o(i){B(l.$$.fragment,i),n=!1},d(i){i&&w(e),oe(l)}}}function Hu(t){let e,l,n;return l=new Um({}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt h-64")},m(i,o){y(i,e,o),se(l,e,null),n=!0},i(i){n||(R(l.$$.fragment,i),n=!0)},o(i){B(l.$$.fragment,i),n=!1},d(i){i&&w(e),oe(l)}}}function ju(t){let e,l,n;return l=new zm({}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){y(i,e,o),se(l,e,null),n=!0},i(i){n||(R(l.$$.fragment,i),n=!0)},o(i){B(l.$$.fragment,i),n=!1},d(i){i&&w(e),oe(l)}}}function Wu(t){let e,l,n;return l=new Nm({props:{json:t[2],sysinfo:t[1]}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){y(i,e,o),se(l,e,null),n=!0},p(i,o){const u={};o&4&&(u.json=i[2]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(R(l.$$.fragment,i),n=!0)},o(i){B(l.$$.fragment,i),n=!1},d(i){i&&w(e),oe(l)}}}function zu(t){let e,l,n;return l=new Am({props:{json:t[3],sysinfo:t[1]}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){y(i,e,o),se(l,e,null),n=!0},p(i,o){const u={};o&8&&(u.json=i[3]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(R(l.$$.fragment,i),n=!0)},o(i){B(l.$$.fragment,i),n=!1},d(i){i&&w(e),oe(l)}}}function Gu(t){let e,l,n;return l=new Im({props:{json:t[4],sysinfo:t[1]}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){y(i,e,o),se(l,e,null),n=!0},p(i,o){const u={};o&16&&(u.json=i[4]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(R(l.$$.fragment,i),n=!0)},o(i){B(l.$$.fragment,i),n=!1},d(i){i&&w(e),oe(l)}}}function Vu(t){let e,l,n;return l=new Om({props:{json:t[5]}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){y(i,e,o),se(l,e,null),n=!0},p(i,o){const u={};o&32&&(u.json=i[5]),l.$set(u)},i(i){n||(R(l.$$.fragment,i),n=!0)},o(i){B(l.$$.fragment,i),n=!1},d(i){i&&w(e),oe(l)}}}function Gm(t){let e,l=Qe(t[1].ui.i,t[0].i),n,i=Qe(t[1].ui.e,t[0].om||t[0].e>0),o,u=Qe(t[1].ui.v,t[0].u1>100||t[0].u2>100||t[0].u3>100),a,c=Qe(t[1].ui.a,t[0].i1>.01||t[0].i2>.01||t[0].i3>.01),f,p=Qe(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),_,b=Qe(t[1].ui.c,t[0].ea),v,d=Qe(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),M,C=Qe(t[1].ui.l),N,S=Qe(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),P,F=Qe(t[1].ui.d,t[3]),A,I=Qe(t[1].ui.m,t[4]),D,O=Qe(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),ie,j=l&&Lu(t),K=i&&Ou(t),G=u&&Fu(t),Y=c&&qu(t),Q=p&&Bu(t),z=b&&Uu(t),Z=d&&Hu(),V=C&&ju(),H=S&&Wu(t),ee=F&&zu(t),ue=I&&Gu(t),x=O&&Vu(t);return{c(){e=m("div"),j&&j.c(),n=h(),K&&K.c(),o=h(),G&&G.c(),a=h(),Y&&Y.c(),f=h(),Q&&Q.c(),_=h(),z&&z.c(),v=h(),Z&&Z.c(),M=h(),V&&V.c(),N=h(),H&&H.c(),P=h(),ee&&ee.c(),A=h(),ue&&ue.c(),D=h(),x&&x.c(),r(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(W,U){y(W,e,U),j&&j.m(e,null),s(e,n),K&&K.m(e,null),s(e,o),G&&G.m(e,null),s(e,a),Y&&Y.m(e,null),s(e,f),Q&&Q.m(e,null),s(e,_),z&&z.m(e,null),s(e,v),Z&&Z.m(e,null),s(e,M),V&&V.m(e,null),s(e,N),H&&H.m(e,null),s(e,P),ee&&ee.m(e,null),s(e,A),ue&&ue.m(e,null),s(e,D),x&&x.m(e,null),ie=!0},p(W,[U]){U&3&&(l=Qe(W[1].ui.i,W[0].i)),l?j?(j.p(W,U),U&3&&R(j,1)):(j=Lu(W),j.c(),R(j,1),j.m(e,n)):j&&(Ie(),B(j,1,1,()=>{j=null}),Re()),U&3&&(i=Qe(W[1].ui.e,W[0].om||W[0].e>0)),i?K?(K.p(W,U),U&3&&R(K,1)):(K=Ou(W),K.c(),R(K,1),K.m(e,o)):K&&(Ie(),B(K,1,1,()=>{K=null}),Re()),U&3&&(u=Qe(W[1].ui.v,W[0].u1>100||W[0].u2>100||W[0].u3>100)),u?G?(G.p(W,U),U&3&&R(G,1)):(G=Fu(W),G.c(),R(G,1),G.m(e,a)):G&&(Ie(),B(G,1,1,()=>{G=null}),Re()),U&3&&(c=Qe(W[1].ui.a,W[0].i1>.01||W[0].i2>.01||W[0].i3>.01)),c?Y?(Y.p(W,U),U&3&&R(Y,1)):(Y=qu(W),Y.c(),R(Y,1),Y.m(e,f)):Y&&(Ie(),B(Y,1,1,()=>{Y=null}),Re()),U&3&&(p=Qe(W[1].ui.r,W[0].ri>0||W[0].re>0||W[0].ric>0||W[0].rec>0)),p?Q?(Q.p(W,U),U&3&&R(Q,1)):(Q=Bu(W),Q.c(),R(Q,1),Q.m(e,_)):Q&&(Ie(),B(Q,1,1,()=>{Q=null}),Re()),U&3&&(b=Qe(W[1].ui.c,W[0].ea)),b?z?(z.p(W,U),U&3&&R(z,1)):(z=Uu(W),z.c(),R(z,1),z.m(e,v)):z&&(Ie(),B(z,1,1,()=>{z=null}),Re()),U&3&&(d=Qe(W[1].ui.t,W[0].pr&&(W[0].pr.startsWith("10YNO")||W[0].pr.startsWith("10Y1001A1001A4")))),d?Z?U&3&&R(Z,1):(Z=Hu(),Z.c(),R(Z,1),Z.m(e,M)):Z&&(Ie(),B(Z,1,1,()=>{Z=null}),Re()),U&2&&(C=Qe(W[1].ui.l)),C?V?U&2&&R(V,1):(V=ju(),V.c(),R(V,1),V.m(e,N)):V&&(Ie(),B(V,1,1,()=>{V=null}),Re()),U&3&&(S=Qe(W[1].ui.p,W[0].pe&&!Number.isNaN(W[0].p))),S?H?(H.p(W,U),U&3&&R(H,1)):(H=Wu(W),H.c(),R(H,1),H.m(e,P)):H&&(Ie(),B(H,1,1,()=>{H=null}),Re()),U&10&&(F=Qe(W[1].ui.d,W[3])),F?ee?(ee.p(W,U),U&10&&R(ee,1)):(ee=zu(W),ee.c(),R(ee,1),ee.m(e,A)):ee&&(Ie(),B(ee,1,1,()=>{ee=null}),Re()),U&18&&(I=Qe(W[1].ui.m,W[4])),I?ue?(ue.p(W,U),U&18&&R(ue,1)):(ue=Gu(W),ue.c(),R(ue,1),ue.m(e,D)):ue&&(Ie(),B(ue,1,1,()=>{ue=null}),Re()),U&35&&(O=Qe(W[1].ui.s,W[0].t&&W[0].t!=-127&&W[5].c>1)),O?x?(x.p(W,U),U&35&&R(x,1)):(x=Vu(W),x.c(),R(x,1),x.m(e,null)):x&&(Ie(),B(x,1,1,()=>{x=null}),Re())},i(W){ie||(R(j),R(K),R(G),R(Y),R(Q),R(z),R(Z),R(V),R(H),R(ee),R(ue),R(x),ie=!0)},o(W){B(j),B(K),B(G),B(Y),B(Q),B(z),B(Z),B(V),B(H),B(ee),B(ue),B(x),ie=!1},d(W){W&&w(e),j&&j.d(),K&&K.d(),G&&G.d(),Y&&Y.d(),Q&&Q.d(),z&&z.d(),Z&&Z.d(),V&&V.d(),H&&H.d(),ee&&ee.d(),ue&&ue.d(),x&&x.d()}}}function Vm(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},u={},a={},c={};return Mo.subscribe(f=>{l(2,o=f)}),Hc.subscribe(f=>{l(3,u=f)}),jc.subscribe(f=>{l(4,a=f)}),zc.subscribe(f=>{l(5,c=f)}),t.$$set=f=>{"data"in f&&l(0,n=f.data),"sysinfo"in f&&l(1,i=f.sysinfo)},[n,i,o,u,a,c]}class Km extends De{constructor(e){super(),Pe(this,e,Vm,Gm,Ne,{data:0,sysinfo:1})}}let uo={};const yi=it(uo);async function Ym(){uo=await(await fetch("/configuration.json")).json(),yi.set(uo)}function Ku(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Qm(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Xm(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Yu(t){let e;return{c(){e=m("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Qu(t){let e,l,n;return{c(){e=m("option"),e.textContent="UART1",l=h(),n=m("option"),n.textContent="UART2",e.__value=9,e.value=e.__value,n.__value=16,n.value=n.__value},m(i,o){y(i,e,o),y(i,l,o),y(i,n,o)},d(i){i&&w(e),i&&w(l),i&&w(n)}}}function Xu(t){let e;return{c(){e=m("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Zu(t){let e,l,n;return{c(){e=m("option"),l=$("GPIO"),n=$(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){y(i,e,o),s(e,l),s(e,n)},d(i){i&&w(e)}}}function Ju(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))&&Zu(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),y(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=Zu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&w(e)}}}function Zm(t){let e,l,n,i,o;function u(d,M){return d[0]=="esp32c3"?Xm:Qm}let a=u(t),c=a(t),f=t[0]=="esp8266"&&Yu(),p=(t[0]=="esp32"||t[0]=="esp32solo")&&Qu(),_=t[0]=="esp32s2"&&Xu(),b={length:t[1]+1},v=[];for(let d=0;d{"chip"in o&&l(0,n=o.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32c3":l(1,i=19);break}},[n,i]}class fo extends De{constructor(e){super(),Pe(this,e,Jm,Zm,Ne,{chip:0})}}function xu(t){let e,l,n=t[1]&&ef(t);return{c(){e=m("div"),l=m("div"),n&&n.c(),r(l,"class","fixed inset-0 bg-gray-500 dark:bg-gray-900 bg-opacity-50 flex items-center justify-center"),r(e,"class","z-50"),r(e,"aria-modal","true")},m(i,o){y(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=ef(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&w(e),n&&n.d()}}}function ef(t){let e,l;return{c(){e=m("div"),l=$(t[1]),r(e,"class","bg-white dark:bg-gray-600 m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 dark:text-white w-96")},m(n,i){y(n,e,i),s(e,l)},p(n,i){i&2&&X(l,n[1])},d(n){n&&w(e)}}}function xm(t){let e,l=t[0]&&xu(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),y(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=xu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:_e,o:_e,d(n){l&&l.d(n),n&&w(e)}}}function ep(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 Ht extends De{constructor(e){super(),Pe(this,e,ep,xm,Ne,{active:0,message:1})}}function tf(t,e,l){const n=t.slice();return n[1]=e[l],n}function lf(t){let e,l,n=t[1]+"",i;return{c(){e=m("option"),l=$("Europe/"),i=$(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,u){y(o,e,u),s(e,l),s(e,i)},p:_e,d(o){o&&w(e)}}}function tp(t){let e,l,n,i=t[0],o=[];for(let u=0;u>1&1,E=0;E0;g--)E[g]=E[g]?E[g-1]^A.EXPONENT[O._modN(A.LOG[E[g]]+T)]:E[g-1];E[0]=A.EXPONENT[O._modN(A.LOG[E[0]]+T)]}for(T=0;T<=k;T++)E[T]=A.LOG[E[T]]},_checkBadness:function(){var T,g,k,E,L,J=0,te=this._badness,fe=this.buffer,de=this.width;for(L=0;Lde*de;)ae-=de*de,Ee++;for(J+=Ee*O.N4,E=0;E=te-2&&(T=te-2,L>9&&T--);var fe=T;if(L>9){for(J[fe+2]=0,J[fe+3]=0;fe--;)g=J[fe],J[fe+3]|=255&g<<4,J[fe+2]=g>>4;J[2]|=255&T<<4,J[1]=T>>4,J[0]=64|T>>12}else{for(J[fe+1]=0,J[fe+2]=0;fe--;)g=J[fe],J[fe+2]|=255&g<<4,J[fe+1]=g>>4;J[1]|=255&T<<4,J[0]=64|T>>4}for(fe=T+3-(L<10);fe=5&&(k+=O.N1+E[g]-5);for(g=3;gT||E[g-3]*3>=E[g]*4||E[g+3]*3>=E[g]*4)&&(k+=O.N3);return k},_finish:function(){this._stringBuffer=this.buffer.slice();var T,g,k=0,E=3e4;for(g=0;g<8&&(this._applyMask(g),T=this._checkBadness(),T>=1)E&1&&(L[J-1-g+J*8]=1,g<6?L[8+J*g]=1:L[8+J*(g+1)]=1);for(g=0;g<7;g++,E>>=1)E&1&&(L[8+J*(J-7+g)]=1,g?L[6-g+J*8]=1:L[7+J*8]=1)},_interleaveBlocks:function(){var T,g,k=this._dataBlock,E=this._ecc,L=this._eccBlock,J=0,te=this._calculateMaxLength(),fe=this._neccBlock1,de=this._neccBlock2,we=this._stringBuffer;for(T=0;T1)for(T=N.BLOCK[E],k=L-7;;){for(g=L-7;g>T-3&&(this._addAlignment(g,k),!(g6)for(T=D.BLOCK[J-7],g=17,k=0;k<6;k++)for(E=0;E<3;E++,g--)1&(g>11?J>>g-12:T>>g)?(L[5-k+te*(2-E+te-11)]=1,L[2-E+te-11+te*(5-k)]=1):(this._setMask(5-k,2-E+te-11),this._setMask(2-E+te-11,5-k))},_isMasked:function(T,g){var k=O._getMaskBit(T,g);return this._mask[k]===1},_pack:function(){var T,g,k,E=1,L=1,J=this.width,te=J-1,fe=J-1,de=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(g=0;gg&&(k=T,T=g,g=k),k=g,k+=g*g,k>>=1,k+=T,k},_modN:function(T){for(;T>=255;)T-=255,T=(T>>8)+(T&255);return T},N1:3,N2:3,N3:40,N4:10}),ie=O,j=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var T=this.element;T.width=T.height=this.qrious.size}}),K=j,G=_.extend(function(T,g,k,E){this.name=T,this.modifiable=Boolean(g),this.defaultValue=k,this._valueTransformer=E},{transform:function(T){var g=this._valueTransformer;return typeof g=="function"?g(T,this):T}}),Y=G,Q=_.extend(null,{abs:function(T){return T!=null?Math.abs(T):null},hasOwn:function(T,g){return Object.prototype.hasOwnProperty.call(T,g)},noop:function(){},toUpperCase:function(T){return T!=null?T.toUpperCase():null}}),z=Q,Z=_.extend(function(T){this.options={},T.forEach(function(g){this.options[g.name]=g},this)},{exists:function(T){return this.options[T]!=null},get:function(T,g){return Z._get(this.options[T],g)},getAll:function(T){var g,k=this.options,E={};for(g in k)z.hasOwn(k,g)&&(E[g]=Z._get(k[g],T));return E},init:function(T,g,k){typeof k!="function"&&(k=z.noop);var E,L;for(E in this.options)z.hasOwn(this.options,E)&&(L=this.options[E],Z._set(L,L.defaultValue,g),Z._createAccessor(L,g,k));this._setAll(T,g,!0)},set:function(T,g,k){return this._set(T,g,k)},setAll:function(T,g){return this._setAll(T,g)},_set:function(T,g,k,E){var L=this.options[T];if(!L)throw new Error("Invalid option: "+T);if(!L.modifiable&&!E)throw new Error("Option cannot be modified: "+T);return Z._set(L,g,k)},_setAll:function(T,g,k){if(!T)return!1;var E,L=!1;for(E in T)z.hasOwn(T,E)&&this._set(E,T[E],g,k)&&(L=!0);return L}},{_createAccessor:function(T,g,k){var E={get:function(){return Z._get(T,g)}};T.modifiable&&(E.set=function(L){Z._set(T,L,g)&&k(L,T)}),Object.defineProperty(g,T.name,E)},_get:function(T,g){return g["_"+T.name]},_set:function(T,g,k){var E="_"+T.name,L=k[E],J=T.transform(g!=null?g:T.defaultValue);return k[E]=J,J!==L}}),V=Z,H=_.extend(function(){this._services={}},{getService:function(T){var g=this._services[T];if(!g)throw new Error("Service is not being managed with name: "+T);return g},setService:function(T,g){if(this._services[T])throw new Error("Service is already managed with name: "+T);g&&(this._services[T]=g)}}),ee=H,ue=new V([new Y("background",!0,"white"),new Y("backgroundAlpha",!0,1,z.abs),new Y("element"),new Y("foreground",!0,"black"),new Y("foregroundAlpha",!0,1,z.abs),new Y("level",!0,"L",z.toUpperCase),new Y("mime",!0,"image/png"),new Y("padding",!0,null,z.abs),new Y("size",!0,100,z.abs),new Y("value",!0,"")]),x=new ee,W=_.extend(function(T){ue.init(T,this,this.update.bind(this));var g=ue.get("element",this),k=x.getService("element"),E=g&&k.isCanvas(g)?g:k.createCanvas(),L=g&&k.isImage(g)?g:k.createImage();this._canvasRenderer=new M(this,E,!0),this._imageRenderer=new K(this,L,L===g),this.update()},{get:function(){return ue.getAll(this)},set:function(T){ue.setAll(T,this)&&this.update()},toDataURL:function(T){return this.canvas.toDataURL(T||this.mime)},update:function(){var T=new ie({level:this.level,value:this.value});this._canvasRenderer.render(T),this._imageRenderer.render(T)}},{use:function(T){x.setService(T.getName(),T)}});Object.defineProperties(W.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var U=W,ke=U,je=_.extend({getName:function(){}}),Be=je,We=Be.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(T){},isImage:function(T){}}),$e=We,ge=$e.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(T){return T instanceof HTMLCanvasElement},isImage:function(T){return T instanceof HTMLImageElement}}),Le=ge;ke.use(new Le);var Me=ke;return Me})})(e1);const rp=e1.exports;function ap(t){let e,l;return{c(){e=m("img"),Xs(e.src,l=t[2])||r(e,"src",l),r(e,"alt",t[0]),r(e,"class",t[1])},m(n,i){y(n,e,i)},p(n,[i]){i&4&&!Xs(e.src,l=n[2])&&r(e,"src",l),i&1&&r(e,"alt",n[0]),i&2&&r(e,"class",n[1])},i:_e,o:_e,d(n){n&&w(e)}}}function up(t,e,l){const n=new rp;let{errorCorrection:i="L"}=e,{background:o="#fff"}=e,{color:u="#000"}=e,{size:a="200"}=e,{value:c=""}=e,{padding:f=0}=e,{className:p="qrcode"}=e,_="";function b(){n.set({background:o,foreground:u,level:i,padding:f,size:a,value:c}),l(2,_=n.toDataURL("image/jpeg"))}return rc(()=>{b()}),t.$$set=v=>{"errorCorrection"in v&&l(3,i=v.errorCorrection),"background"in v&&l(4,o=v.background),"color"in v&&l(5,u=v.color),"size"in v&&l(6,a=v.size),"value"in v&&l(0,c=v.value),"padding"in v&&l(7,f=v.padding),"className"in v&&l(1,p=v.className)},t.$$.update=()=>{t.$$.dirty&1&&c&&b()},[c,p,_,i,o,u,a,f]}class fp extends De{constructor(e){super(),Pe(this,e,up,ap,Ne,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function nf(t,e,l){const n=t.slice();return n[103]=e[l],n[104]=e,n[105]=l,n}function sf(t,e,l){const n=t.slice();return n[106]=e[l],n[107]=e,n[108]=l,n}function cp(t,e,l){const n=t.slice();return n[109]=e[l],n}function mp(t,e,l){const n=t.slice();return n[112]=e[l],n}function pp(t){let e,l;return{c(){e=m("option"),l=$(t[112]),e.__value=t[112],e.value=e.__value},m(n,i){y(n,e,i),s(e,l)},p:_e,d(n){n&&w(e)}}}function of(t){let e,l,n,i;return{c(){e=m("br"),l=m("input"),r(l,"name","pt"),r(l,"type","text"),r(l,"class","in-s"),r(l,"placeholder","ENTSO-E API key, optional, read docs")},m(o,u){y(o,e,u),y(o,l,u),ne(l,t[3].p.t),n||(i=le(l,"input",t[22]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].p.t&&ne(l,o[3].p.t)},d(o){o&&w(e),o&&w(l),n=!1,i()}}}function rf(t){let e,l,n,i,o,u,a,c,f,p,_,b,v;return{c(){e=m("div"),l=$("Username"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=$("Password"),f=m("br"),p=h(),_=m("input"),r(o,"name","gu"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(_,"name","gp"),r(_,"type","password"),r(_,"class","in-s"),r(a,"class","my-1")},m(d,M){y(d,e,M),s(e,l),s(e,n),s(e,i),s(e,o),ne(o,t[3].g.u),y(d,u,M),y(d,a,M),s(a,c),s(a,f),s(a,p),s(a,_),ne(_,t[3].g.p),b||(v=[le(o,"input",t[24]),le(_,"input",t[25])],b=!0)},p(d,M){M[0]&8&&o.value!==d[3].g.u&&ne(o,d[3].g.u),M[0]&8&&_.value!==d[3].g.p&&ne(_,d[3].g.p)},d(d){d&&w(e),d&&w(u),d&&w(a),b=!1,Ve(v)}}}function _p(t){let e,l=t[109]*100+"",n;return{c(){e=m("option"),n=$(l),e.__value=t[109]*100,e.value=e.__value},m(i,o){y(i,e,o),s(e,n)},p:_e,d(i){i&&w(e)}}}function af(t){let e,l,n,i;return{c(){e=m("br"),l=m("input"),r(l,"name","mek"),r(l,"type","text"),r(l,"class","in-s")},m(o,u){y(o,e,u),y(o,l,u),ne(l,t[3].m.e.k),n||(i=le(l,"input",t[35]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].m.e.k&&ne(l,o[3].m.e.k)},d(o){o&&w(e),o&&w(l),n=!1,i()}}}function uf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=$("Authentication key"),n=m("br"),i=h(),o=m("input"),r(o,"name","mea"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1")},m(c,f){y(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),ne(o,t[3].m.e.a),u||(a=le(o,"input",t[36]),u=!0)},p(c,f){f[0]&8&&o.value!==c[3].m.e.a&&ne(o,c[3].m.e.a)},d(c){c&&w(e),u=!1,a()}}}function ff(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C,N,S,P,F,A,I,D,O,ie,j;return{c(){e=m("div"),l=m("div"),n=$("Watt"),i=m("br"),o=h(),u=m("input"),a=h(),c=m("div"),f=$("Volt"),p=m("br"),_=h(),b=m("input"),v=h(),d=m("div"),M=$("Amp"),C=m("br"),N=h(),S=m("input"),P=h(),F=m("div"),A=$("kWh"),I=m("br"),D=h(),O=m("input"),r(u,"name","mmw"),r(u,"type","number"),r(u,"min","0.00"),r(u,"max","1000"),r(u,"step","0.001"),r(u,"class","in-f tr w-full"),r(l,"class","w-1/4"),r(b,"name","mmv"),r(b,"type","number"),r(b,"min","0.00"),r(b,"max","1000"),r(b,"step","0.001"),r(b,"class","in-m tr w-full"),r(c,"class","w-1/4"),r(S,"name","mma"),r(S,"type","number"),r(S,"min","0.00"),r(S,"max","1000"),r(S,"step","0.001"),r(S,"class","in-m tr w-full"),r(d,"class","w-1/4"),r(O,"name","mmc"),r(O,"type","number"),r(O,"min","0.00"),r(O,"max","1000"),r(O,"step","0.001"),r(O,"class","in-l tr w-full"),r(F,"class","w-1/4"),r(e,"class","flex my-1")},m(K,G){y(K,e,G),s(e,l),s(l,n),s(l,i),s(l,o),s(l,u),ne(u,t[3].m.m.w),s(e,a),s(e,c),s(c,f),s(c,p),s(c,_),s(c,b),ne(b,t[3].m.m.v),s(e,v),s(e,d),s(d,M),s(d,C),s(d,N),s(d,S),ne(S,t[3].m.m.a),s(e,P),s(e,F),s(F,A),s(F,I),s(F,D),s(F,O),ne(O,t[3].m.m.c),ie||(j=[le(u,"input",t[38]),le(b,"input",t[39]),le(S,"input",t[40]),le(O,"input",t[41])],ie=!0)},p(K,G){G[0]&8&&he(u.value)!==K[3].m.m.w&&ne(u,K[3].m.m.w),G[0]&8&&he(b.value)!==K[3].m.m.v&&ne(b,K[3].m.m.v),G[0]&8&&he(S.value)!==K[3].m.m.a&&ne(S,K[3].m.m.a),G[0]&8&&he(O.value)!==K[3].m.m.c&&ne(O,K[3].m.m.c)},d(K){K&&w(e),ie=!1,Ve(j)}}}function cf(t){let e;return{c(){e=m("option"),e.textContent="Ethernet",e.__value=3,e.value=e.__value},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function mf(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C,N,S,P,F,A,I,D,O,ie,j,K,G,Y,Q,z,Z,V,H,ee,ue,x,W;return{c(){e=m("div"),l=$("SSID"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=$("Password"),f=m("br"),p=h(),_=m("input"),b=h(),v=m("div"),d=m("div"),M=$("Power saving"),C=m("br"),N=h(),S=m("select"),P=m("option"),P.textContent="Default",F=m("option"),F.textContent="Off",A=m("option"),A.textContent="Minimum",I=m("option"),I.textContent="Maximum",D=h(),O=m("div"),ie=$("Power"),j=m("br"),K=h(),G=m("div"),Y=m("input"),Q=h(),z=m("span"),z.textContent="dBm",Z=h(),V=m("div"),H=m("label"),ee=m("input"),ue=$(" Allow 802.11b legacy rates"),r(o,"name","ws"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(_,"name","wp"),r(_,"type","password"),r(_,"class","in-s"),r(a,"class","my-1"),P.__value=255,P.value=P.__value,F.__value=0,F.value=F.__value,A.__value=1,A.value=A.__value,I.__value=2,I.value=I.__value,r(S,"name","wz"),r(S,"class","in-s"),t[3].w.z===void 0&&Ge(()=>t[45].call(S)),r(d,"class","w-1/2"),r(Y,"name","ww"),r(Y,"type","number"),r(Y,"min","0"),r(Y,"max","20.5"),r(Y,"step","0.5"),r(Y,"class","in-f tr w-full"),r(z,"class","in-post"),r(G,"class","flex"),r(O,"class","ml-2 w-1/2"),r(v,"class","my-1 flex"),r(ee,"type","checkbox"),r(ee,"name","wb"),ee.__value="true",ee.value=ee.__value,r(ee,"class","rounded mb-1"),r(V,"class","my-3")},m(U,ke){y(U,e,ke),s(e,l),s(e,n),s(e,i),s(e,o),ne(o,t[3].w.s),y(U,u,ke),y(U,a,ke),s(a,c),s(a,f),s(a,p),s(a,_),ne(_,t[3].w.p),y(U,b,ke),y(U,v,ke),s(v,d),s(d,M),s(d,C),s(d,N),s(d,S),s(S,P),s(S,F),s(S,A),s(S,I),Se(S,t[3].w.z,!0),s(v,D),s(v,O),s(O,ie),s(O,j),s(O,K),s(O,G),s(G,Y),ne(Y,t[3].w.w),s(G,Q),s(G,z),y(U,Z,ke),y(U,V,ke),s(V,H),s(H,ee),ee.checked=t[3].w.b,s(H,ue),x||(W=[le(o,"input",t[43]),le(_,"input",t[44]),le(S,"change",t[45]),le(Y,"input",t[46]),le(ee,"change",t[47])],x=!0)},p(U,ke){ke[0]&8&&o.value!==U[3].w.s&&ne(o,U[3].w.s),ke[0]&8&&_.value!==U[3].w.p&&ne(_,U[3].w.p),ke[0]&8&&Se(S,U[3].w.z),ke[0]&8&&he(Y.value)!==U[3].w.w&&ne(Y,U[3].w.w),ke[0]&8&&(ee.checked=U[3].w.b)},d(U){U&&w(e),U&&w(u),U&&w(a),U&&w(b),U&&w(v),U&&w(Z),U&&w(V),x=!1,Ve(W)}}}function pf(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C;return{c(){e=m("div"),l=$("Gateway"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=$("DNS"),f=m("br"),p=h(),_=m("div"),b=m("input"),v=h(),d=m("input"),r(o,"name","ng"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(b,"name","nd1"),r(b,"type","text"),r(b,"class","in-f w-full"),r(d,"name","nd2"),r(d,"type","text"),r(d,"class","in-l w-full"),r(_,"class","flex"),r(a,"class","my-1")},m(N,S){y(N,e,S),s(e,l),s(e,n),s(e,i),s(e,o),ne(o,t[3].n.g),y(N,u,S),y(N,a,S),s(a,c),s(a,f),s(a,p),s(a,_),s(_,b),ne(b,t[3].n.d1),s(_,v),s(_,d),ne(d,t[3].n.d2),M||(C=[le(o,"input",t[51]),le(b,"input",t[52]),le(d,"input",t[53])],M=!0)},p(N,S){S[0]&8&&o.value!==N[3].n.g&&ne(o,N[3].n.g),S[0]&8&&b.value!==N[3].n.d1&&ne(b,N[3].n.d1),S[0]&8&&d.value!==N[3].n.d2&&ne(d,N[3].n.d2)},d(N){N&&w(e),N&&w(u),N&&w(a),M=!1,Ve(C)}}}function _f(t){let e,l,n,i,o;return{c(){e=m("label"),l=m("input"),n=$(" SSL"),r(l,"type","checkbox"),r(l,"name","qs"),l.__value="true",l.value=l.__value,r(l,"class","rounded mb-1"),r(e,"class","float-right mr-3")},m(u,a){y(u,e,a),s(e,l),l.checked=t[3].q.s.e,s(e,n),i||(o=[le(l,"change",t[57]),le(l,"change",t[14])],i=!0)},p(u,a){a[0]&8&&(l.checked=u[3].q.s.e)},d(u){u&&w(e),i=!1,Ve(o)}}}function df(t){let e,l,n,i,o,u,a,c,f,p,_,b,v;const d=[vp,dp],M=[];function C(D,O){return D[3].q.s.c?0:1}n=C(t),i=M[n]=d[n](t);const N=[kp,gp],S=[];function P(D,O){return D[3].q.s.r?0:1}a=P(t),c=S[a]=N[a](t);const F=[Mp,Cp],A=[];function I(D,O){return D[3].q.s.k?0:1}return _=I(t),b=A[_]=F[_](t),{c(){e=m("div"),l=m("span"),i.c(),o=h(),u=m("span"),c.c(),f=h(),p=m("span"),b.c(),r(l,"class","flex pr-2"),r(u,"class","flex pr-2"),r(p,"class","flex pr-2"),r(e,"class","my-1 flex")},m(D,O){y(D,e,O),s(e,l),M[n].m(l,null),s(e,o),s(e,u),S[a].m(u,null),s(e,f),s(e,p),A[_].m(p,null),v=!0},p(D,O){let ie=n;n=C(D),n===ie?M[n].p(D,O):(Ie(),B(M[ie],1,1,()=>{M[ie]=null}),Re(),i=M[n],i?i.p(D,O):(i=M[n]=d[n](D),i.c()),R(i,1),i.m(l,null));let j=a;a=P(D),a===j?S[a].p(D,O):(Ie(),B(S[j],1,1,()=>{S[j]=null}),Re(),c=S[a],c?c.p(D,O):(c=S[a]=N[a](D),c.c()),R(c,1),c.m(u,null));let K=_;_=I(D),_===K?A[_].p(D,O):(Ie(),B(A[K],1,1,()=>{A[K]=null}),Re(),b=A[_],b?b.p(D,O):(b=A[_]=F[_](D),b.c()),R(b,1),b.m(p,null))},i(D){v||(R(i),R(c),R(b),v=!0)},o(D){B(i),B(c),B(b),v=!1},d(D){D&&w(e),M[n].d(),S[a].d(),A[_].d()}}}function dp(t){let e,l;return e=new ol({props:{to:"/mqtt-ca",$$slots:{default:[hp]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i[3]&4194304&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function vp(t){let e,l,n,i,o,u,a,c;return l=new ol({props:{to:"/mqtt-ca",$$slots:{default:[bp]},$$scope:{ctx:t}}}),o=new $o({}),{c(){e=m("span"),re(l.$$.fragment),n=h(),i=m("span"),re(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,p){y(f,e,p),se(l,e,null),y(f,n,p),y(f,i,p),se(o,i,null),u=!0,a||(c=[le(i,"click",t[11]),le(i,"keypress",t[11])],a=!0)},p(f,p){const _={};p[3]&4194304&&(_.$$scope={dirty:p,ctx:f}),l.$set(_)},i(f){u||(R(l.$$.fragment,f),R(o.$$.fragment,f),u=!0)},o(f){B(l.$$.fragment,f),B(o.$$.fragment,f),u=!1},d(f){f&&w(e),oe(l),f&&w(n),f&&w(i),oe(o),a=!1,Ve(c)}}}function hp(t){let e,l;return e=new fn({props:{color:"blue",text:"Upload CA",title:"Click here to upload CA"}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p:_e,i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function bp(t){let e;return{c(){e=$("CA OK")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function gp(t){let e,l;return e=new ol({props:{to:"/mqtt-cert",$$slots:{default:[wp]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i[3]&4194304&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function kp(t){let e,l,n,i,o,u,a,c;return l=new ol({props:{to:"/mqtt-cert",$$slots:{default:[yp]},$$scope:{ctx:t}}}),o=new $o({}),{c(){e=m("span"),re(l.$$.fragment),n=h(),i=m("span"),re(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,p){y(f,e,p),se(l,e,null),y(f,n,p),y(f,i,p),se(o,i,null),u=!0,a||(c=[le(i,"click",t[12]),le(i,"keypress",t[12])],a=!0)},p(f,p){const _={};p[3]&4194304&&(_.$$scope={dirty:p,ctx:f}),l.$set(_)},i(f){u||(R(l.$$.fragment,f),R(o.$$.fragment,f),u=!0)},o(f){B(l.$$.fragment,f),B(o.$$.fragment,f),u=!1},d(f){f&&w(e),oe(l),f&&w(n),f&&w(i),oe(o),a=!1,Ve(c)}}}function wp(t){let e,l;return e=new fn({props:{color:"blue",text:"Upload cert",title:"Click here to upload certificate"}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p:_e,i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function yp(t){let e;return{c(){e=$("Cert OK")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Cp(t){let e,l;return e=new ol({props:{to:"/mqtt-key",$$slots:{default:[Sp]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i[3]&4194304&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function Mp(t){let e,l,n,i,o,u,a,c;return l=new ol({props:{to:"/mqtt-key",$$slots:{default:[Tp]},$$scope:{ctx:t}}}),o=new $o({}),{c(){e=m("span"),re(l.$$.fragment),n=h(),i=m("span"),re(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,p){y(f,e,p),se(l,e,null),y(f,n,p),y(f,i,p),se(o,i,null),u=!0,a||(c=[le(i,"click",t[13]),le(i,"keypress",t[13])],a=!0)},p(f,p){const _={};p[3]&4194304&&(_.$$scope={dirty:p,ctx:f}),l.$set(_)},i(f){u||(R(l.$$.fragment,f),R(o.$$.fragment,f),u=!0)},o(f){B(l.$$.fragment,f),B(o.$$.fragment,f),u=!1},d(f){f&&w(e),oe(l),f&&w(n),f&&w(i),oe(o),a=!1,Ve(c)}}}function Sp(t){let e,l;return e=new fn({props:{color:"blue",text:"Upload key",title:"Click here to upload key"}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p:_e,i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function Tp(t){let e;return{c(){e=$("Key OK")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function vf(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C,N,S,P,F,A,I,D,O,ie,j,K,G,Y,Q,z,Z;return o=new Bt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Domoticz",n=h(),i=m("a"),re(o.$$.fragment),u=h(),a=m("input"),c=h(),f=m("div"),p=m("div"),_=$("Electricity IDX"),b=m("br"),v=h(),d=m("input"),M=h(),C=m("div"),N=$("Current IDX"),S=m("br"),P=h(),F=m("input"),A=h(),I=m("div"),D=$(`Voltage IDX: L1, L2 & L3 + `),O=m("div"),ie=m("input"),j=h(),K=m("input"),G=h(),Y=m("input"),r(l,"class","text-sm"),r(i,"href",Ut("MQTT-configuration#domoticz")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","o"),a.value="true",r(d,"name","oe"),r(d,"type","text"),r(d,"class","in-f tr w-full"),r(p,"class","w-1/2"),r(F,"name","oc"),r(F,"type","text"),r(F,"class","in-l tr w-full"),r(C,"class","w-1/2"),r(f,"class","my-1 flex"),r(ie,"name","ou1"),r(ie,"type","text"),r(ie,"class","in-f tr w-1/3"),r(K,"name","ou2"),r(K,"type","text"),r(K,"class","in-m tr w-1/3"),r(Y,"name","ou3"),r(Y,"type","text"),r(Y,"class","in-l tr w-1/3"),r(O,"class","flex"),r(I,"class","my-1"),r(e,"class","cnt")},m(V,H){y(V,e,H),s(e,l),s(e,n),s(e,i),se(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,p),s(p,_),s(p,b),s(p,v),s(p,d),ne(d,t[3].o.e),s(f,M),s(f,C),s(C,N),s(C,S),s(C,P),s(C,F),ne(F,t[3].o.c),s(e,A),s(e,I),s(I,D),s(I,O),s(O,ie),ne(ie,t[3].o.u1),s(O,j),s(O,K),ne(K,t[3].o.u2),s(O,G),s(O,Y),ne(Y,t[3].o.u3),Q=!0,z||(Z=[le(d,"input",t[65]),le(F,"input",t[66]),le(ie,"input",t[67]),le(K,"input",t[68]),le(Y,"input",t[69])],z=!0)},p(V,H){H[0]&8&&d.value!==V[3].o.e&&ne(d,V[3].o.e),H[0]&8&&F.value!==V[3].o.c&&ne(F,V[3].o.c),H[0]&8&&ie.value!==V[3].o.u1&&ne(ie,V[3].o.u1),H[0]&8&&K.value!==V[3].o.u2&&ne(K,V[3].o.u2),H[0]&8&&Y.value!==V[3].o.u3&&ne(Y,V[3].o.u3)},i(V){Q||(R(o.$$.fragment,V),Q=!0)},o(V){B(o.$$.fragment,V),Q=!1},d(V){V&&w(e),oe(o),z=!1,Ve(Z)}}}function hf(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C,N,S,P,F,A,I,D,O,ie,j,K,G,Y;return o=new Bt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Home-Assistant",n=h(),i=m("a"),re(o.$$.fragment),u=h(),a=m("input"),c=h(),f=m("div"),p=$("Discovery topic prefix"),_=m("br"),b=h(),v=m("input"),d=h(),M=m("div"),C=$("Hostname for URL"),N=m("br"),S=h(),P=m("input"),A=h(),I=m("div"),D=$("Name tag"),O=m("br"),ie=h(),j=m("input"),r(l,"class","text-sm"),r(i,"href",Ut("MQTT-configuration#home-assistant")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","h"),a.value="true",r(v,"name","ht"),r(v,"type","text"),r(v,"class","in-s"),r(v,"placeholder","homeassistant"),r(f,"class","my-1"),r(P,"name","hh"),r(P,"type","text"),r(P,"class","in-s"),r(P,"placeholder",F=t[3].g.h+".local"),r(M,"class","my-1"),r(j,"name","hn"),r(j,"type","text"),r(j,"class","in-s"),r(I,"class","my-1"),r(e,"class","cnt")},m(Q,z){y(Q,e,z),s(e,l),s(e,n),s(e,i),se(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,p),s(f,_),s(f,b),s(f,v),ne(v,t[3].h.t),s(e,d),s(e,M),s(M,C),s(M,N),s(M,S),s(M,P),ne(P,t[3].h.h),s(e,A),s(e,I),s(I,D),s(I,O),s(I,ie),s(I,j),ne(j,t[3].h.n),K=!0,G||(Y=[le(v,"input",t[70]),le(P,"input",t[71]),le(j,"input",t[72])],G=!0)},p(Q,z){z[0]&8&&v.value!==Q[3].h.t&&ne(v,Q[3].h.t),(!K||z[0]&8&&F!==(F=Q[3].g.h+".local"))&&r(P,"placeholder",F),z[0]&8&&P.value!==Q[3].h.h&&ne(P,Q[3].h.h),z[0]&8&&j.value!==Q[3].h.n&&ne(j,Q[3].h.n)},i(Q){K||(R(o.$$.fragment,Q),K=!0)},o(Q){B(o.$$.fragment,Q),K=!1},d(Q){Q&&w(e),oe(o),G=!1,Ve(Y)}}}function bf(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C,N,S,P,F,A,I,D,O,ie,j,K,G,Y,Q,z,Z,V,H,ee,ue;o=new Bt({});let x=t[3].c.es&&gf(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Cloud connections",n=h(),i=m("a"),re(o.$$.fragment),u=h(),a=m("input"),c=h(),f=m("div"),p=m("label"),_=m("input"),b=$(" Enable cloud upload"),v=h(),d=m("div"),M=$("Client ID"),C=m("br"),N=h(),S=m("input"),A=h(),I=m("div"),D=$("Client secret"),O=m("br"),ie=h(),j=m("input"),G=h(),Y=m("div"),Q=m("label"),z=m("input"),Z=$(" Energy Speedometer"),V=h(),x&&x.c(),r(l,"class","text-sm"),r(i,"href",Ut("Cloud")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","c"),a.value="true",r(_,"type","checkbox"),r(_,"name","ce"),_.__value="true",_.value=_.__value,r(_,"class","rounded mb-1"),r(f,"class","my-1"),r(S,"name","ci"),r(S,"type","text"),r(S,"class","in-s"),r(S,"pattern",P=t[3].c.e?"[A-Z0-9]{16}":".*"),S.required=F=t[3].c.e,r(d,"class","my-1"),r(j,"name","cs"),r(j,"type","text"),r(j,"class","in-s"),r(j,"pattern",K=t[3].c.e&&t[3].c.s!="***"?"[A-Z0-9]{16}":".*"),r(I,"class","my-1"),r(z,"type","checkbox"),r(z,"class","rounded mb-1"),r(z,"name","ces"),z.__value="true",z.value=z.__value,r(Y,"class","my-1"),r(e,"class","cnt")},m(W,U){y(W,e,U),s(e,l),s(e,n),s(e,i),se(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,p),s(p,_),_.checked=t[3].c.e,s(p,b),s(e,v),s(e,d),s(d,M),s(d,C),s(d,N),s(d,S),ne(S,t[3].c.i),s(e,A),s(e,I),s(I,D),s(I,O),s(I,ie),s(I,j),ne(j,t[3].c.s),s(e,G),s(e,Y),s(Y,Q),s(Q,z),z.checked=t[3].c.es,s(Q,Z),s(Y,V),x&&x.m(Y,null),H=!0,ee||(ue=[le(_,"change",t[73]),le(S,"input",t[74]),le(j,"input",t[75]),le(z,"change",t[76])],ee=!0)},p(W,U){U[0]&8&&(_.checked=W[3].c.e),(!H||U[0]&8&&P!==(P=W[3].c.e?"[A-Z0-9]{16}":".*"))&&r(S,"pattern",P),(!H||U[0]&8&&F!==(F=W[3].c.e))&&(S.required=F),U[0]&8&&S.value!==W[3].c.i&&ne(S,W[3].c.i),(!H||U[0]&8&&K!==(K=W[3].c.e&&W[3].c.s!="***"?"[A-Z0-9]{16}":".*"))&&r(j,"pattern",K),U[0]&8&&j.value!==W[3].c.s&&ne(j,W[3].c.s),U[0]&8&&(z.checked=W[3].c.es),W[3].c.es?x?(x.p(W,U),U[0]&8&&R(x,1)):(x=gf(W),x.c(),R(x,1),x.m(Y,null)):x&&(Ie(),B(x,1,1,()=>{x=null}),Re())},i(W){H||(R(o.$$.fragment,W),R(x),H=!0)},o(W){B(o.$$.fragment,W),B(x),H=!1},d(W){W&&w(e),oe(o),x&&x.d(),ee=!1,Ve(ue)}}}function gf(t){let e,l,n=t[0].mac+"",i,o,u,a,c=(t[0].meter.id?t[0].meter.id:"missing, required")+"",f,p,_,b,v=t[0].mac&&t[0].meter.id&&kf(t);return{c(){e=m("div"),l=$("MAC: "),i=$(n),o=h(),u=m("div"),a=$("Meter ID: "),f=$(c),p=h(),v&&v.c(),_=Ke(),r(e,"class","pl-5"),r(u,"class","pl-5")},m(d,M){y(d,e,M),s(e,l),s(e,i),y(d,o,M),y(d,u,M),s(u,a),s(u,f),y(d,p,M),v&&v.m(d,M),y(d,_,M),b=!0},p(d,M){(!b||M[0]&1)&&n!==(n=d[0].mac+"")&&X(i,n),(!b||M[0]&1)&&c!==(c=(d[0].meter.id?d[0].meter.id:"missing, required")+"")&&X(f,c),d[0].mac&&d[0].meter.id?v?(v.p(d,M),M[0]&1&&R(v,1)):(v=kf(d),v.c(),R(v,1),v.m(_.parentNode,_)):v&&(Ie(),B(v,1,1,()=>{v=null}),Re())},i(d){b||(R(v),b=!0)},o(d){B(v),b=!1},d(d){d&&w(e),d&&w(o),d&&w(u),d&&w(p),v&&v.d(d),d&&w(_)}}}function kf(t){let e,l,n;return l=new fp({props:{value:'{"mac":"'+t[0].mac+'","meter":"'+t[0].meter.id+'"}'}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","pl-2")},m(i,o){y(i,e,o),se(l,e,null),n=!0},p(i,o){const u={};o[0]&1&&(u.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(u)},i(i){n||(R(l.$$.fragment,i),n=!0)},o(i){B(l.$$.fragment,i),n=!1},d(i){i&&w(e),oe(l)}}}function wf(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C,N,S,P;o=new Bt({});let F={length:9},A=[];for(let I=0;I20&&Sf(t),_=t[3].i.d.d>0&&$f(t),b=t[0].chip=="esp8266"&&Ef(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Hardware",n=h(),i=m("a"),re(o.$$.fragment),u=h(),p&&p.c(),a=h(),_&&_.c(),c=h(),b&&b.c(),r(l,"class","text-sm"),r(i,"href",Ut("GPIO-configuration")),r(i,"target","_blank"),r(i,"class","float-right"),r(e,"class","cnt")},m(v,d){y(v,e,d),s(e,l),s(e,n),s(e,i),se(o,i,null),s(e,u),p&&p.m(e,null),s(e,a),_&&_.m(e,null),s(e,c),b&&b.m(e,null),f=!0},p(v,d){v[0].board>20?p?(p.p(v,d),d[0]&1&&R(p,1)):(p=Sf(v),p.c(),R(p,1),p.m(e,a)):p&&(Ie(),B(p,1,1,()=>{p=null}),Re()),v[3].i.d.d>0?_?_.p(v,d):(_=$f(v),_.c(),_.m(e,c)):_&&(_.d(1),_=null),v[0].chip=="esp8266"?b?b.p(v,d):(b=Ef(v),b.c(),b.m(e,null)):b&&(b.d(1),b=null)},i(v){f||(R(o.$$.fragment,v),R(p),f=!0)},o(v){B(o.$$.fragment,v),B(p),f=!1},d(v){v&&w(e),oe(o),p&&p.d(),_&&_.d(),b&&b.d()}}}function Sf(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C,N,S,P,F,A,I,D,O,ie,j,K,G,Y,Q,z,Z,V,H,ee,ue,x,W,U,ke,je,Be,We,$e,ge,Le,Me,T,g,k,E,L,J,te,fe,de,we,Ee,ae,Ce,Je,Et,st,ht,lt,At,Ye,Qt,jt,bt,ze,xe,Xe,Ue,qe,et;f=new fo({props:{chip:t[0].chip}}),C=new fo({props:{chip:t[0].chip}});let Ae=t[0].chip!="esp8266"&&Tf(t),Oe=t[3].i.v.p>0&&Nf(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=$("HAN RX"),u=m("br"),a=h(),c=m("select"),re(f.$$.fragment),p=h(),_=m("div"),b=$("HAN TX"),v=m("br"),d=h(),M=m("select"),re(C.$$.fragment),N=h(),S=m("div"),P=m("label"),F=m("input"),A=$(" pullup"),I=h(),D=m("div"),O=m("div"),ie=$("AP button"),j=m("br"),K=h(),G=m("input"),Y=h(),Q=m("div"),z=$("LED"),Z=m("br"),V=h(),H=m("div"),ee=m("input"),ue=h(),x=m("div"),W=m("label"),U=m("input"),ke=$(" inverted"),je=h(),Be=m("div"),We=$("RGB"),$e=m("label"),ge=m("input"),Le=$(" inverted"),Me=m("br"),T=h(),g=m("div"),k=m("input"),E=h(),L=m("input"),J=h(),te=m("input"),fe=h(),de=m("div"),we=m("div"),Ee=$(`LED dis. GPIO + `),ae=m("input"),Ce=h(),Je=m("div"),Et=$("Temperature"),st=m("br"),ht=h(),lt=m("input"),At=h(),Ye=m("div"),Qt=$("Analog temp"),jt=m("br"),bt=h(),ze=m("input"),xe=h(),Ae&&Ae.c(),Xe=h(),Oe&&Oe.c(),r(e,"type","hidden"),r(e,"name","i"),e.value="true",r(c,"name","ihp"),r(c,"class","in-f w-full"),t[3].i.h.p===void 0&&Ge(()=>t[80].call(c)),r(i,"class","w-1/3"),r(M,"name","iht"),r(M,"class","in-l w-full"),t[3].i.h.t===void 0&&Ge(()=>t[81].call(M)),r(_,"class","w-1/3"),r(F,"name","ihu"),F.__value="true",F.value=F.__value,r(F,"type","checkbox"),r(F,"class","rounded mb-1"),r(P,"class","ml-2"),r(S,"class","w-1/3"),r(n,"class","flex flex-wrap"),r(G,"name","ia"),r(G,"type","number"),r(G,"min","0"),r(G,"max",t[6]),r(G,"class","in-f tr w-full"),r(O,"class","w-1/3"),r(ee,"name","ilp"),r(ee,"type","number"),r(ee,"min","0"),r(ee,"max",t[6]),r(ee,"class","in-l tr w-full"),r(H,"class","flex"),r(Q,"class","w-1/3"),r(U,"name","ili"),U.__value="true",U.value=U.__value,r(U,"type","checkbox"),r(U,"class","rounded mb-1"),r(W,"class","ml-4"),r(x,"class","w-1/3"),r(ge,"name","iri"),ge.__value="true",ge.value=ge.__value,r(ge,"type","checkbox"),r(ge,"class","rounded mb-1"),r($e,"class","ml-4"),r(k,"name","irr"),r(k,"type","number"),r(k,"min","0"),r(k,"max",t[6]),r(k,"class","in-f tr w-1/3"),r(L,"name","irg"),r(L,"type","number"),r(L,"min","0"),r(L,"max",t[6]),r(L,"class","in-m tr w-1/3"),r(te,"name","irb"),r(te,"type","number"),r(te,"min","0"),r(te,"max",t[6]),r(te,"class","in-l tr w-1/3"),r(g,"class","flex"),r(Be,"class","w-full"),r(ae,"name","idd"),r(ae,"type","number"),r(ae,"min","0"),r(ae,"max",t[6]),r(ae,"class","in-s tr"),r(we,"class","my-1 pr-1 w-1/3"),r(de,"class","w-full"),r(lt,"name","itd"),r(lt,"type","number"),r(lt,"min","0"),r(lt,"max",t[6]),r(lt,"class","in-f tr w-full"),r(Je,"class","my-1 w-1/3"),r(ze,"name","ita"),r(ze,"type","number"),r(ze,"min","0"),r(ze,"max",t[6]),r(ze,"class","in-l tr w-full"),r(Ye,"class","my-1 pr-1 w-1/3"),r(D,"class","flex flex-wrap")},m(pe,ce){y(pe,e,ce),y(pe,l,ce),y(pe,n,ce),s(n,i),s(i,o),s(i,u),s(i,a),s(i,c),se(f,c,null),Se(c,t[3].i.h.p,!0),s(n,p),s(n,_),s(_,b),s(_,v),s(_,d),s(_,M),se(C,M,null),Se(M,t[3].i.h.t,!0),s(n,N),s(n,S),s(S,P),s(P,F),F.checked=t[3].i.h.u,s(P,A),y(pe,I,ce),y(pe,D,ce),s(D,O),s(O,ie),s(O,j),s(O,K),s(O,G),ne(G,t[3].i.a),s(D,Y),s(D,Q),s(Q,z),s(Q,Z),s(Q,V),s(Q,H),s(H,ee),ne(ee,t[3].i.l.p),s(D,ue),s(D,x),s(x,W),s(W,U),U.checked=t[3].i.l.i,s(W,ke),s(D,je),s(D,Be),s(Be,We),s(Be,$e),s($e,ge),ge.checked=t[3].i.r.i,s($e,Le),s(Be,Me),s(Be,T),s(Be,g),s(g,k),ne(k,t[3].i.r.r),s(g,E),s(g,L),ne(L,t[3].i.r.g),s(g,J),s(g,te),ne(te,t[3].i.r.b),s(D,fe),s(D,de),s(de,we),s(we,Ee),s(we,ae),ne(ae,t[3].i.d.d),s(D,Ce),s(D,Je),s(Je,Et),s(Je,st),s(Je,ht),s(Je,lt),ne(lt,t[3].i.t.d),s(D,At),s(D,Ye),s(Ye,Qt),s(Ye,jt),s(Ye,bt),s(Ye,ze),ne(ze,t[3].i.t.a),s(D,xe),Ae&&Ae.m(D,null),s(D,Xe),Oe&&Oe.m(D,null),Ue=!0,qe||(et=[le(c,"change",t[80]),le(M,"change",t[81]),le(F,"change",t[82]),le(G,"input",t[83]),le(ee,"input",t[84]),le(U,"change",t[85]),le(ge,"change",t[86]),le(k,"input",t[87]),le(L,"input",t[88]),le(te,"input",t[89]),le(ae,"input",t[90]),le(lt,"input",t[91]),le(ze,"input",t[92])],qe=!0)},p(pe,ce){const ye={};ce[0]&1&&(ye.chip=pe[0].chip),f.$set(ye),ce[0]&8&&Se(c,pe[3].i.h.p);const zl={};ce[0]&1&&(zl.chip=pe[0].chip),C.$set(zl),ce[0]&8&&Se(M,pe[3].i.h.t),ce[0]&8&&(F.checked=pe[3].i.h.u),(!Ue||ce[0]&64)&&r(G,"max",pe[6]),ce[0]&8&&he(G.value)!==pe[3].i.a&&ne(G,pe[3].i.a),(!Ue||ce[0]&64)&&r(ee,"max",pe[6]),ce[0]&8&&he(ee.value)!==pe[3].i.l.p&&ne(ee,pe[3].i.l.p),ce[0]&8&&(U.checked=pe[3].i.l.i),ce[0]&8&&(ge.checked=pe[3].i.r.i),(!Ue||ce[0]&64)&&r(k,"max",pe[6]),ce[0]&8&&he(k.value)!==pe[3].i.r.r&&ne(k,pe[3].i.r.r),(!Ue||ce[0]&64)&&r(L,"max",pe[6]),ce[0]&8&&he(L.value)!==pe[3].i.r.g&&ne(L,pe[3].i.r.g),(!Ue||ce[0]&64)&&r(te,"max",pe[6]),ce[0]&8&&he(te.value)!==pe[3].i.r.b&&ne(te,pe[3].i.r.b),(!Ue||ce[0]&64)&&r(ae,"max",pe[6]),ce[0]&8&&he(ae.value)!==pe[3].i.d.d&&ne(ae,pe[3].i.d.d),(!Ue||ce[0]&64)&&r(lt,"max",pe[6]),ce[0]&8&&he(lt.value)!==pe[3].i.t.d&&ne(lt,pe[3].i.t.d),(!Ue||ce[0]&64)&&r(ze,"max",pe[6]),ce[0]&8&&he(ze.value)!==pe[3].i.t.a&&ne(ze,pe[3].i.t.a),pe[0].chip!="esp8266"?Ae?Ae.p(pe,ce):(Ae=Tf(pe),Ae.c(),Ae.m(D,Xe)):Ae&&(Ae.d(1),Ae=null),pe[3].i.v.p>0?Oe?Oe.p(pe,ce):(Oe=Nf(pe),Oe.c(),Oe.m(D,null)):Oe&&(Oe.d(1),Oe=null)},i(pe){Ue||(R(f.$$.fragment,pe),R(C.$$.fragment,pe),Ue=!0)},o(pe){B(f.$$.fragment,pe),B(C.$$.fragment,pe),Ue=!1},d(pe){pe&&w(e),pe&&w(l),pe&&w(n),oe(f),oe(C),pe&&w(I),pe&&w(D),Ae&&Ae.d(),Oe&&Oe.d(),qe=!1,Ve(et)}}}function Tf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=$("Vcc"),n=m("br"),i=h(),o=m("input"),r(o,"name","ivp"),r(o,"type","number"),r(o,"min","0"),r(o,"max",t[6]),r(o,"class","in-s tr w-full"),r(e,"class","my-1 pl-1 w-1/3")},m(c,f){y(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),ne(o,t[3].i.v.p),u||(a=le(o,"input",t[93]),u=!0)},p(c,f){f[0]&64&&r(o,"max",c[6]),f[0]&8&&he(o.value)!==c[3].i.v.p&&ne(o,c[3].i.v.p)},d(c){c&&w(e),u=!1,a()}}}function Nf(t){let e,l,n,i,o,u,a,c,f,p;return{c(){e=m("div"),l=$("Voltage divider"),n=m("br"),i=h(),o=m("div"),u=m("input"),a=h(),c=m("input"),r(u,"name","ivdv"),r(u,"type","number"),r(u,"min","0"),r(u,"max","65535"),r(u,"class","in-f tr w-full"),r(u,"placeholder","VCC"),r(c,"name","ivdg"),r(c,"type","number"),r(c,"min","0"),r(c,"max","65535"),r(c,"class","in-l tr w-full"),r(c,"placeholder","GND"),r(o,"class","flex"),r(e,"class","my-1")},m(_,b){y(_,e,b),s(e,l),s(e,n),s(e,i),s(e,o),s(o,u),ne(u,t[3].i.v.d.v),s(o,a),s(o,c),ne(c,t[3].i.v.d.g),f||(p=[le(u,"input",t[94]),le(c,"input",t[95])],f=!0)},p(_,b){b[0]&8&&he(u.value)!==_[3].i.v.d.v&&ne(u,_[3].i.v.d.v),b[0]&8&&he(c.value)!==_[3].i.v.d.g&&ne(c,_[3].i.v.d.g)},d(_){_&&w(e),f=!1,Ve(p)}}}function $f(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=$(`LED behaviour + `),n=m("select"),i=m("option"),i.textContent="Enabled",o=m("option"),o.textContent="Disabled",i.__value=0,i.value=i.__value,o.__value=1,o.value=o.__value,r(n,"name","idb"),r(n,"class","in-s"),t[3].i.d.b===void 0&&Ge(()=>t[96].call(n)),r(e,"class","my-1 w-full")},m(c,f){y(c,e,f),s(e,l),s(e,n),s(n,i),s(n,o),Se(n,t[3].i.d.b,!0),u||(a=le(n,"change",t[96]),u=!0)},p(c,f){f[0]&8&&Se(n,c[3].i.d.b)},d(c){c&&w(e),u=!1,a()}}}function Ef(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C,N,S=(t[0].board==2||t[0].board==100)&&Af(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=$("Vcc offset"),u=m("br"),a=h(),c=m("input"),f=h(),p=m("div"),_=$("Multiplier"),b=m("br"),v=h(),d=m("input"),M=h(),S&&S.c(),r(e,"type","hidden"),r(e,"name","iv"),e.value="true",r(c,"name","ivo"),r(c,"type","number"),r(c,"min","0.0"),r(c,"max","3.5"),r(c,"step","0.01"),r(c,"class","in-f tr w-full"),r(i,"class","w-1/3"),r(d,"name","ivm"),r(d,"type","number"),r(d,"min","0.1"),r(d,"max","10"),r(d,"step","0.01"),r(d,"class","in-l tr w-full"),r(p,"class","w-1/3 pr-1"),r(n,"class","my-1 flex flex-wrap")},m(P,F){y(P,e,F),y(P,l,F),y(P,n,F),s(n,i),s(i,o),s(i,u),s(i,a),s(i,c),ne(c,t[3].i.v.o),s(n,f),s(n,p),s(p,_),s(p,b),s(p,v),s(p,d),ne(d,t[3].i.v.m),s(n,M),S&&S.m(n,null),C||(N=[le(c,"input",t[97]),le(d,"input",t[98])],C=!0)},p(P,F){F[0]&8&&he(c.value)!==P[3].i.v.o&&ne(c,P[3].i.v.o),F[0]&8&&he(d.value)!==P[3].i.v.m&&ne(d,P[3].i.v.m),P[0].board==2||P[0].board==100?S?S.p(P,F):(S=Af(P),S.c(),S.m(n,null)):S&&(S.d(1),S=null)},d(P){P&&w(e),P&&w(l),P&&w(n),S&&S.d(),C=!1,Ve(N)}}}function Af(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=$("Boot limit"),n=m("br"),i=h(),o=m("input"),r(o,"name","ivb"),r(o,"type","number"),r(o,"min","2.5"),r(o,"max","3.5"),r(o,"step","0.1"),r(o,"class","in-s tr w-full"),r(e,"class","w-1/3 pl-1")},m(c,f){y(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),ne(o,t[3].i.v.b),u||(a=le(o,"input",t[99]),u=!0)},p(c,f){f[0]&8&&he(o.value)!==c[3].i.v.b&&ne(o,c[3].i.v.b)},d(c){c&&w(e),u=!1,a()}}}function Pf(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C,N=t[3].d.t&&Df();return{c(){e=m("div"),e.textContent="Debug can cause sudden reboots. Do not leave on!",l=h(),n=m("div"),i=m("label"),o=m("input"),u=$(" Enable telnet"),a=h(),N&&N.c(),c=h(),f=m("div"),p=m("select"),_=m("option"),_.textContent="Verbose",b=m("option"),b.textContent="Debug",v=m("option"),v.textContent="Info",d=m("option"),d.textContent="Warning",r(e,"class","bd-red"),r(o,"type","checkbox"),r(o,"name","dt"),o.__value="true",o.value=o.__value,r(o,"class","rounded mb-1"),r(n,"class","my-1"),_.__value=1,_.value=_.__value,b.__value=2,b.value=b.__value,v.__value=3,v.value=v.__value,d.__value=4,d.value=d.__value,r(p,"name","dl"),r(p,"class","in-s"),t[3].d.l===void 0&&Ge(()=>t[102].call(p)),r(f,"class","my-1")},m(S,P){y(S,e,P),y(S,l,P),y(S,n,P),s(n,i),s(i,o),o.checked=t[3].d.t,s(i,u),y(S,a,P),N&&N.m(S,P),y(S,c,P),y(S,f,P),s(f,p),s(p,_),s(p,b),s(p,v),s(p,d),Se(p,t[3].d.l,!0),M||(C=[le(o,"change",t[101]),le(p,"change",t[102])],M=!0)},p(S,P){P[0]&8&&(o.checked=S[3].d.t),S[3].d.t?N||(N=Df(),N.c(),N.m(c.parentNode,c)):N&&(N.d(1),N=null),P[0]&8&&Se(p,S[3].d.l)},d(S){S&&w(e),S&&w(l),S&&w(n),S&&w(a),N&&N.d(S),S&&w(c),S&&w(f),M=!1,Ve(C)}}}function Df(t){let e;return{c(){e=m("div"),e.textContent="Telnet is unsafe and should be off when not in use",r(e,"class","bd-red")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Np(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C,N,S,P,F,A,I,D,O,ie,j,K,G,Y,Q,z,Z,V,H,ee,ue,x,W,U,ke,je,Be,We,$e,ge,Le,Me,T,g,k,E,L,J,te,fe,de,we,Ee,ae,Ce,Je,Et,st,ht,lt,At,Ye,Qt,jt,bt,ze,xe,Xe,Ue,qe,et,Ae,Oe,pe,ce,ye,zl,hl,_n,Pt,Ai,Pi,Di,bl,Ii,Ri,Li,Dt,$l,El,Al,Oi,Fi,He,dn,qi,Pl,Dl,Bi,Gl,Ze,mt,Vl,Il,Ui,Rl,Hi,Wt,vn,hn,Ao,rl,ji,Po,Ts,Do,fi,Xt,Io,Ro,Ll,al,Ol,Lo,Wi,Oo,dt,Fl,Fo,zi,bn,gn,kn,wn,Gi,qo,It,Vi,Bo,Kl,Uo,Ho,jo,ul,yn,Cn,Wo,Mn,Yl,zo,Go,Vo,Sn,Zt,Ko,Ki,Yo,Ql,Qo,Xo,Zo,Tn,Jt,Jo,Yi,xo,Ns,er,Xl,Qi,xt,tr,lr,nr,$s,Xi,el,ir,sr,or,Rt,Zi,rr,Nn,$n,ar,ci,ur,Zl,fr,cr,mr,zt,En,An,pr,_r,pt,Ji,dr,Pn,Dn,vr,Jl,hr,br,gr,ql,fl,In,Rn,kr,Lt,xi,es,wr,Ot,Ln,ts,ls,yr,Es,ns,is,tl,Cr,Mr,mi,Sr,Bl,Tr,pi,ll,Nr,$r,Er,ss,gl,Ar,tt,os,Pr,On,Fn,Dr,_i,Ir,cl,Rr,As,Lr,Or,qn,kl,Fr,nl,qr,Ps,xl,Br,Ur,Hr,wl,jr,en,Wr,zr,Gr,yl,Vr,Bn,Un,Kr,Yr,Qr,Cl,Xr,Hn,Zr,Jr,xr,gt,jn,Wn,zn,Gn,Vn,Kn,ea,tn,ta,la,na,Ml,ia,Ds,Is,Rs,Ls=t[3].p.r.startsWith("10YNO")||t[3].p.r.startsWith("10Y1001A1001A4"),Os,ml,rs,sa,Yn,Qn,oa,di,ra,vi,aa,Fs,Ft,as,ua,Xn,Zn,fa,hi,ca,us,fs,il,ma,pa,_a,Ul,qs,Jn,da,cs,xn,va,ms,Bs,ln,Us,nn,Hs,sn,js,on,Gt,Ws,ha;a=new Bt({}),O=new np({});let t1=["NOK","SEK","DKK","EUR","CHF"],bi=[];for(let q=0;q<5;q+=1)bi[q]=pp(mp(t,t1,q));let kt=t[3].p.e&&t[0].chip!="esp8266"&&of(t),wt=t[3].g.s>0&&rf(t);Dl=new Bt({});let l1=[24,48,96,192,384,576,1152],gi=[];for(let q=0;q<7;q+=1)gi[q]=_p(cp(t,l1,q));let yt=t[3].m.e.e&&af(t),Ct=t[3].m.e.e&&uf(t),Mt=t[3].m.m.e&&ff(t);$n=new Bt({});let qt=t[0].if&&t[0].if.eth&&cf(),St=(t[3].n.c==1||t[3].n.c==2)&&mf(t);Dn=new Bt({}),Ln=new xc({});let Tt=t[3].n.m=="static"&&pf(t);Fn=new Bt({});let Nt=t[0].chip!="esp8266"&&_f(t),ot=t[3].q.s.e&&df(t),rt=t[3].q.m==3&&vf(t),at=t[3].q.m==4&&hf(t),ut=t[3].c.es!=null&&bf(t),ft=Ls&&wf(t);Qn=new Bt({});let ei=t[7],vt=[];for(let q=0;q20||t[0].chip=="esp8266"||t[3].i.d.d>0)&&Mf(t);Zn=new Bt({});let $t=t[3].d.s&&Pf(t);return ln=new Ht({props:{active:t[1],message:"Loading configuration"}}),nn=new Ht({props:{active:t[2],message:"Saving configuration"}}),sn=new Ht({props:{active:t[4],message:"Performing factory reset"}}),on=new Ht({props:{active:t[5],message:"Device have been factory reset and switched to AP mode"}}),{c(){e=m("form"),l=m("div"),n=m("div"),i=m("strong"),i.textContent="General",o=h(),u=m("a"),re(a.$$.fragment),c=h(),f=m("input"),p=h(),_=m("div"),b=m("div"),v=m("div"),d=$("Hostname"),M=m("br"),C=h(),N=m("input"),S=h(),P=m("div"),F=$("Time zone"),A=m("br"),I=h(),D=m("select"),re(O.$$.fragment),ie=h(),j=m("input"),K=h(),G=m("div"),Y=m("div"),Q=m("div"),z=$("Price region"),Z=m("br"),V=h(),H=m("select"),ee=m("optgroup"),ue=m("option"),ue.textContent="NO1",x=m("option"),x.textContent="NO2",W=m("option"),W.textContent="NO3",U=m("option"),U.textContent="NO4",ke=m("option"),ke.textContent="NO5",je=m("optgroup"),Be=m("option"),Be.textContent="SE1",We=m("option"),We.textContent="SE2",$e=m("option"),$e.textContent="SE3",ge=m("option"),ge.textContent="SE4",Le=m("optgroup"),Me=m("option"),Me.textContent="DK1",T=m("option"),T.textContent="DK2",g=m("option"),g.textContent="Austria",k=m("option"),k.textContent="Belgium",E=m("option"),E.textContent="Czech Republic",L=m("option"),L.textContent="Estonia",J=m("option"),J.textContent="Finland",te=m("option"),te.textContent="France",fe=m("option"),fe.textContent="Germany",de=m("option"),de.textContent="Great Britain",we=m("option"),we.textContent="Latvia",Ee=m("option"),Ee.textContent="Lithuania",ae=m("option"),ae.textContent="Netherland",Ce=m("option"),Ce.textContent="Poland",Je=m("option"),Je.textContent="Switzerland",Et=h(),st=m("div"),ht=$("Currency"),lt=m("br"),At=h(),Ye=m("select");for(let q=0;q<5;q+=1)bi[q].c();Qt=h(),jt=m("div"),bt=m("div"),ze=m("div"),xe=$("Fixed price"),Xe=m("br"),Ue=h(),qe=m("input"),et=h(),Ae=m("div"),Oe=$("Multiplier"),pe=m("br"),ce=h(),ye=m("input"),zl=h(),hl=m("div"),_n=m("label"),Pt=m("input"),Ai=$(" Enable price fetch from remote server"),Pi=h(),kt&&kt.c(),Di=h(),bl=m("div"),Ii=$("Security"),Ri=m("br"),Li=h(),Dt=m("select"),$l=m("option"),$l.textContent="None",El=m("option"),El.textContent="Only configuration",Al=m("option"),Al.textContent="Everything",Oi=h(),wt&&wt.c(),Fi=h(),He=m("div"),dn=m("strong"),dn.textContent="Meter",qi=h(),Pl=m("a"),re(Dl.$$.fragment),Bi=h(),Gl=m("input"),Ze=h(),mt=m("input"),Vl=h(),Il=m("div"),Ui=$("Communication"),Rl=m("br"),Hi=h(),Wt=m("select"),vn=m("option"),vn.textContent="Passive (Push)",hn=m("option"),hn.textContent="Kamstrup (Pull)",Ao=h(),rl=m("div"),ji=m("span"),ji.textContent="Buffer size",Po=h(),Ts=m("span"),Ts.textContent="Serial conf.",Do=h(),fi=m("label"),Xt=m("input"),Io=$(" inverted"),Ro=h(),Ll=m("div"),al=m("select"),Ol=m("option"),Lo=$("Autodetect");for(let q=0;q<7;q+=1)gi[q].c();Oo=h(),dt=m("select"),Fl=m("option"),Fo=$("-"),bn=m("option"),bn.textContent="7N1",gn=m("option"),gn.textContent="8N1",kn=m("option"),kn.textContent="7E1",wn=m("option"),wn.textContent="8E1",qo=h(),It=m("input"),Bo=h(),Kl=m("div"),Uo=$("Voltage"),Ho=m("br"),jo=h(),ul=m("select"),yn=m("option"),yn.textContent="400V (TN)",Cn=m("option"),Cn.textContent="230V (IT/TT)",Wo=h(),Mn=m("div"),Yl=m("div"),zo=$("Main fuse"),Go=m("br"),Vo=h(),Sn=m("label"),Zt=m("input"),Ko=h(),Ki=m("span"),Ki.textContent="A",Yo=h(),Ql=m("div"),Qo=$("Production"),Xo=m("br"),Zo=h(),Tn=m("label"),Jt=m("input"),Jo=h(),Yi=m("span"),Yi.textContent="kWp",xo=h(),Ns=m("div"),er=h(),Xl=m("div"),Qi=m("label"),xt=m("input"),tr=$(" Meter is encrypted"),lr=h(),yt&&yt.c(),nr=h(),Ct&&Ct.c(),$s=h(),Xi=m("label"),el=m("input"),ir=$(" Multipliers"),sr=h(),Mt&&Mt.c(),or=h(),Rt=m("div"),Zi=m("strong"),Zi.textContent="Connection",rr=h(),Nn=m("a"),re($n.$$.fragment),ar=h(),ci=m("input"),ur=h(),Zl=m("div"),fr=$("Connection"),cr=m("br"),mr=h(),zt=m("select"),En=m("option"),En.textContent="WiFi",An=m("option"),An.textContent="Access point",qt&&qt.c(),pr=h(),St&&St.c(),_r=h(),pt=m("div"),Ji=m("strong"),Ji.textContent="Network",dr=h(),Pn=m("a"),re(Dn.$$.fragment),vr=h(),Jl=m("div"),hr=$("IP"),br=m("br"),gr=h(),ql=m("div"),fl=m("select"),In=m("option"),In.textContent="DHCP",Rn=m("option"),Rn.textContent="Static",kr=h(),Lt=m("input"),wr=h(),Ot=m("select"),re(Ln.$$.fragment),yr=h(),Tt&&Tt.c(),Es=h(),ns=m("div"),is=m("label"),tl=m("input"),Cr=$(" enable mDNS"),Mr=h(),mi=m("input"),Sr=h(),Bl=m("div"),Tr=$("NTP "),pi=m("label"),ll=m("input"),Nr=$(" obtain from DHCP"),$r=m("br"),Er=h(),ss=m("div"),gl=m("input"),Ar=h(),tt=m("div"),os=m("strong"),os.textContent="MQTT",Pr=h(),On=m("a"),re(Fn.$$.fragment),Dr=h(),_i=m("input"),Ir=h(),cl=m("div"),Rr=$(`Server + `),Nt&&Nt.c(),As=h(),Lr=m("br"),Or=h(),qn=m("div"),kl=m("input"),Fr=h(),nl=m("input"),qr=h(),ot&&ot.c(),Ps=h(),xl=m("div"),Br=$("Username"),Ur=m("br"),Hr=h(),wl=m("input"),jr=h(),en=m("div"),Wr=$("Password"),zr=m("br"),Gr=h(),yl=m("input"),Vr=h(),Bn=m("div"),Un=m("div"),Kr=$("Client ID"),Yr=m("br"),Qr=h(),Cl=m("input"),Xr=h(),Hn=m("div"),Zr=$("Payload"),Jr=m("br"),xr=h(),gt=m("select"),jn=m("option"),jn.textContent="JSON",Wn=m("option"),Wn.textContent="Raw (minimal)",zn=m("option"),zn.textContent="Raw (full)",Gn=m("option"),Gn.textContent="Domoticz",Vn=m("option"),Vn.textContent="HomeAssistant",Kn=m("option"),Kn.textContent="HEX dump",ea=h(),tn=m("div"),ta=$("Publish topic"),la=m("br"),na=h(),Ml=m("input"),ia=h(),rt&&rt.c(),Ds=h(),at&&at.c(),Is=h(),ut&&ut.c(),Rs=h(),ft&&ft.c(),Os=h(),ml=m("div"),rs=m("strong"),rs.textContent="User interface",sa=h(),Yn=m("a"),re(Qn.$$.fragment),oa=h(),di=m("input"),ra=h(),vi=m("div");for(let q=0;qSave',Bs=h(),re(ln.$$.fragment),Us=h(),re(nn.$$.fragment),Hs=h(),re(sn.$$.fragment),js=h(),re(on.$$.fragment),r(i,"class","text-sm"),r(u,"href",Ut("General-configuration")),r(u,"target","_blank"),r(u,"class","float-right"),r(f,"type","hidden"),r(f,"name","g"),f.value="true",r(N,"name","gh"),r(N,"type","text"),r(N,"class","in-f w-full"),r(N,"pattern","[A-Za-z0-9-]+"),r(D,"name","gt"),r(D,"class","in-l w-full"),t[3].g.t===void 0&&Ge(()=>t[16].call(D)),r(b,"class","flex"),r(_,"class","my-1"),r(j,"type","hidden"),r(j,"name","p"),j.value="true",ue.__value="10YNO-1--------2",ue.value=ue.__value,x.__value="10YNO-2--------T",x.value=x.__value,W.__value="10YNO-3--------J",W.value=W.__value,U.__value="10YNO-4--------9",U.value=U.__value,ke.__value="10Y1001A1001A48H",ke.value=ke.__value,r(ee,"label","Norway"),Be.__value="10Y1001A1001A44P",Be.value=Be.__value,We.__value="10Y1001A1001A45N",We.value=We.__value,$e.__value="10Y1001A1001A46L",$e.value=$e.__value,ge.__value="10Y1001A1001A47J",ge.value=ge.__value,r(je,"label","Sweden"),Me.__value="10YDK-1--------W",Me.value=Me.__value,T.__value="10YDK-2--------M",T.value=T.__value,r(Le,"label","Denmark"),g.__value="10YAT-APG------L",g.value=g.__value,k.__value="10YBE----------2",k.value=k.__value,E.__value="10YCZ-CEPS-----N",E.value=E.__value,L.__value="10Y1001A1001A39I",L.value=L.__value,J.__value="10YFI-1--------U",J.value=J.__value,te.__value="10YFR-RTE------C",te.value=te.__value,fe.__value="10Y1001A1001A83F",fe.value=fe.__value,de.__value="10YGB----------A",de.value=de.__value,we.__value="10YLV-1001A00074",we.value=we.__value,Ee.__value="10YLT-1001A0008Q",Ee.value=Ee.__value,ae.__value="10YNL----------L",ae.value=ae.__value,Ce.__value="10YPL-AREA-----S",Ce.value=Ce.__value,Je.__value="10YCH-SWISSGRIDZ",Je.value=Je.__value,r(H,"name","pr"),r(H,"class","in-f w-full"),t[3].p.r===void 0&&Ge(()=>t[17].call(H)),r(Q,"class","w-full"),r(Ye,"name","pc"),r(Ye,"class","in-l"),t[3].p.c===void 0&&Ge(()=>t[18].call(Ye)),r(Y,"class","flex"),r(G,"class","my-1"),r(qe,"name","pf"),r(qe,"type","number"),r(qe,"min","0.001"),r(qe,"max","65"),r(qe,"step","0.001"),r(qe,"class","in-f tr w-full"),r(ze,"class","w-1/2"),r(ye,"name","pm"),r(ye,"type","number"),r(ye,"min","0.001"),r(ye,"max","1000"),r(ye,"step","0.001"),r(ye,"class","in-l tr w-full"),r(Ae,"class","w-1/2"),r(bt,"class","flex"),r(jt,"class","my-1"),r(Pt,"type","checkbox"),r(Pt,"name","pe"),Pt.__value="true",Pt.value=Pt.__value,r(Pt,"class","rounded mb-1"),r(hl,"class","my-1"),$l.__value=0,$l.value=$l.__value,El.__value=1,El.value=El.__value,Al.__value=2,Al.value=Al.__value,r(Dt,"name","gs"),r(Dt,"class","in-s"),t[3].g.s===void 0&&Ge(()=>t[23].call(Dt)),r(bl,"class","my-1"),r(n,"class","cnt"),r(dn,"class","text-sm"),r(Pl,"href",Ut("Meter-configuration")),r(Pl,"target","_blank"),r(Pl,"class","float-right"),r(Gl,"type","hidden"),r(Gl,"name","m"),Gl.value="true",r(mt,"type","hidden"),r(mt,"name","mo"),mt.value="1",vn.__value=0,vn.value=vn.__value,hn.__value=9,hn.value=hn.__value,r(Wt,"name","ma"),r(Wt,"class","in-s"),t[3].m.a===void 0&&Ge(()=>t[26].call(Wt)),r(Il,"class","my-1"),r(ji,"class","float-right"),r(Xt,"name","mi"),Xt.__value="true",Xt.value=Xt.__value,r(Xt,"type","checkbox"),r(Xt,"class","rounded mb-1"),r(fi,"class","mt-2 ml-3 whitespace-nowrap"),Ol.__value=0,Ol.value=Ol.__value,Ol.disabled=Wi=t[3].m.b!=0,r(al,"name","mb"),r(al,"class","in-f tr w-1/2"),t[3].m.b===void 0&&Ge(()=>t[28].call(al)),Fl.__value=0,Fl.value=Fl.__value,Fl.disabled=zi=t[3].m.b!=0,bn.__value=2,bn.value=bn.__value,gn.__value=3,gn.value=gn.__value,kn.__value=10,kn.value=kn.__value,wn.__value=11,wn.value=wn.__value,r(dt,"name","mp"),r(dt,"class","in-m"),dt.disabled=Gi=t[3].m.b==0,t[3].m.p===void 0&&Ge(()=>t[29].call(dt)),r(It,"name","ms"),r(It,"type","number"),r(It,"min",64),r(It,"max",Vi=t[0].chip=="esp8266"?t[3].i.h.p==3||t[3].i.h.p==113?512:128:4096),r(It,"step",64),r(It,"class","in-l tr w-1/2"),r(Ll,"class","flex w-full"),r(rl,"class","my-1"),yn.__value=2,yn.value=yn.__value,Cn.__value=1,Cn.value=Cn.__value,r(ul,"name","md"),r(ul,"class","in-s"),t[3].m.d===void 0&&Ge(()=>t[31].call(ul)),r(Kl,"class","my-1"),r(Zt,"name","mf"),r(Zt,"type","number"),r(Zt,"min","5"),r(Zt,"max","65535"),r(Zt,"class","in-f tr w-full"),r(Ki,"class","in-post"),r(Sn,"class","flex"),r(Yl,"class","mx-1"),r(Jt,"name","mr"),r(Jt,"type","number"),r(Jt,"min","0"),r(Jt,"max","65535"),r(Jt,"class","in-f tr w-full"),r(Yi,"class","in-post"),r(Tn,"class","flex"),r(Ql,"class","mx-1"),r(Mn,"class","my-1 flex"),r(Ns,"class","my-1"),r(xt,"type","checkbox"),r(xt,"name","me"),xt.__value="true",xt.value=xt.__value,r(xt,"class","rounded mb-1"),r(Xl,"class","my-1"),r(el,"type","checkbox"),r(el,"name","mm"),el.__value="true",el.value=el.__value,r(el,"class","rounded mb-1"),r(He,"class","cnt"),r(Zi,"class","text-sm"),r(Nn,"href",Ut("WiFi-configuration")),r(Nn,"target","_blank"),r(Nn,"class","float-right"),r(ci,"type","hidden"),r(ci,"name","w"),ci.value="true",En.__value=1,En.value=En.__value,An.__value=2,An.value=An.__value,r(zt,"name","nc"),r(zt,"class","in-s"),t[3].n.c===void 0&&Ge(()=>t[42].call(zt)),r(Zl,"class","my-1"),r(Rt,"class","cnt"),r(Ji,"class","text-sm"),r(Pn,"href",Ut("Network-configuration")),r(Pn,"target","_blank"),r(Pn,"class","float-right"),In.__value="dhcp",In.value=In.__value,Rn.__value="static",Rn.value=Rn.__value,r(fl,"name","nm"),r(fl,"class","in-f"),t[3].n.m===void 0&&Ge(()=>t[48].call(fl)),r(Lt,"name","ni"),r(Lt,"type","text"),r(Lt,"class","in-m w-full"),Lt.disabled=xi=t[3].n.m=="dhcp",Lt.required=es=t[3].n.m=="static",r(Ot,"name","ns"),r(Ot,"class","in-l"),Ot.disabled=ts=t[3].n.m=="dhcp",Ot.required=ls=t[3].n.m=="static",t[3].n.s===void 0&&Ge(()=>t[50].call(Ot)),r(ql,"class","flex"),r(Jl,"class","my-1"),r(tl,"name","nd"),tl.__value="true",tl.value=tl.__value,r(tl,"type","checkbox"),r(tl,"class","rounded mb-1"),r(ns,"class","my-1"),r(mi,"type","hidden"),r(mi,"name","ntp"),mi.value="true",r(ll,"name","ntpd"),ll.__value="true",ll.value=ll.__value,r(ll,"type","checkbox"),r(ll,"class","rounded mb-1"),r(pi,"class","ml-4"),r(gl,"name","ntph"),r(gl,"type","text"),r(gl,"class","in-s"),r(ss,"class","flex"),r(Bl,"class","my-1"),r(pt,"class","cnt"),r(os,"class","text-sm"),r(On,"href",Ut("MQTT-configuration")),r(On,"target","_blank"),r(On,"class","float-right"),r(_i,"type","hidden"),r(_i,"name","q"),_i.value="true",r(kl,"name","qh"),r(kl,"type","text"),r(kl,"class","in-f w-3/4"),r(nl,"name","qp"),r(nl,"type","number"),r(nl,"min","1024"),r(nl,"max","65535"),r(nl,"class","in-l tr w-1/4"),r(qn,"class","flex"),r(cl,"class","my-1"),r(wl,"name","qu"),r(wl,"type","text"),r(wl,"class","in-s"),r(xl,"class","my-1"),r(yl,"name","qa"),r(yl,"type","password"),r(yl,"class","in-s"),r(en,"class","my-1"),r(Cl,"name","qc"),r(Cl,"type","text"),r(Cl,"class","in-f w-full"),jn.__value=0,jn.value=jn.__value,Wn.__value=1,Wn.value=Wn.__value,zn.__value=2,zn.value=zn.__value,Gn.__value=3,Gn.value=Gn.__value,Vn.__value=4,Vn.value=Vn.__value,Kn.__value=255,Kn.value=Kn.__value,r(gt,"name","qm"),r(gt,"class","in-l"),t[3].q.m===void 0&&Ge(()=>t[63].call(gt)),r(Bn,"class","my-1 flex"),r(Ml,"name","qb"),r(Ml,"type","text"),r(Ml,"class","in-s"),r(tn,"class","my-1"),r(tt,"class","cnt"),r(rs,"class","text-sm"),r(Yn,"href",Ut("User-interface")),r(Yn,"target","_blank"),r(Yn,"class","float-right"),r(di,"type","hidden"),r(di,"name","u"),di.value="true",r(vi,"class","flex flex-wrap"),r(ml,"class","cnt"),r(as,"class","text-sm"),r(Xn,"href","https://amsleser.no/blog/post/24-telnet-debug"),r(Xn,"target","_blank"),r(Xn,"class","float-right"),r(hi,"type","hidden"),r(hi,"name","d"),hi.value="true",r(il,"type","checkbox"),r(il,"name","ds"),il.__value="true",il.value=il.__value,r(il,"class","rounded mb-1"),r(us,"class","mt-3"),r(Ft,"class","cnt"),r(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),r(Jn,"type","button"),r(Jn,"class","py-2 px-4 rounded bg-red-500 text-white ml-2"),r(xn,"type","button"),r(xn,"class","py-2 px-4 rounded bg-yellow-500 text-white"),r(cs,"class","text-center"),r(ms,"class","text-right"),r(Ul,"class","grid grid-cols-3"),r(e,"autocomplete","off")},m(q,me){y(q,e,me),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),se(a,u,null),s(n,c),s(n,f),s(n,p),s(n,_),s(_,b),s(b,v),s(v,d),s(v,M),s(v,C),s(v,N),ne(N,t[3].g.h),s(b,S),s(b,P),s(P,F),s(P,A),s(P,I),s(P,D),se(O,D,null),Se(D,t[3].g.t,!0),s(n,ie),s(n,j),s(n,K),s(n,G),s(G,Y),s(Y,Q),s(Q,z),s(Q,Z),s(Q,V),s(Q,H),s(H,ee),s(ee,ue),s(ee,x),s(ee,W),s(ee,U),s(ee,ke),s(H,je),s(je,Be),s(je,We),s(je,$e),s(je,ge),s(H,Le),s(Le,Me),s(Le,T),s(H,g),s(H,k),s(H,E),s(H,L),s(H,J),s(H,te),s(H,fe),s(H,de),s(H,we),s(H,Ee),s(H,ae),s(H,Ce),s(H,Je),Se(H,t[3].p.r,!0),s(Y,Et),s(Y,st),s(st,ht),s(st,lt),s(st,At),s(st,Ye);for(let _t=0;_t<5;_t+=1)bi[_t]&&bi[_t].m(Ye,null);Se(Ye,t[3].p.c,!0),s(n,Qt),s(n,jt),s(jt,bt),s(bt,ze),s(ze,xe),s(ze,Xe),s(ze,Ue),s(ze,qe),ne(qe,t[3].p.f),s(bt,et),s(bt,Ae),s(Ae,Oe),s(Ae,pe),s(Ae,ce),s(Ae,ye),ne(ye,t[3].p.m),s(n,zl),s(n,hl),s(hl,_n),s(_n,Pt),Pt.checked=t[3].p.e,s(_n,Ai),s(hl,Pi),kt&&kt.m(hl,null),s(n,Di),s(n,bl),s(bl,Ii),s(bl,Ri),s(bl,Li),s(bl,Dt),s(Dt,$l),s(Dt,El),s(Dt,Al),Se(Dt,t[3].g.s,!0),s(n,Oi),wt&&wt.m(n,null),s(l,Fi),s(l,He),s(He,dn),s(He,qi),s(He,Pl),se(Dl,Pl,null),s(He,Bi),s(He,Gl),s(He,Ze),s(He,mt),s(He,Vl),s(He,Il),s(Il,Ui),s(Il,Rl),s(Il,Hi),s(Il,Wt),s(Wt,vn),s(Wt,hn),Se(Wt,t[3].m.a,!0),s(He,Ao),s(He,rl),s(rl,ji),s(rl,Po),s(rl,Ts),s(rl,Do),s(rl,fi),s(fi,Xt),Xt.checked=t[3].m.i,s(fi,Io),s(rl,Ro),s(rl,Ll),s(Ll,al),s(al,Ol),s(Ol,Lo);for(let _t=0;_t<7;_t+=1)gi[_t]&&gi[_t].m(al,null);Se(al,t[3].m.b,!0),s(Ll,Oo),s(Ll,dt),s(dt,Fl),s(Fl,Fo),s(dt,bn),s(dt,gn),s(dt,kn),s(dt,wn),Se(dt,t[3].m.p,!0),s(Ll,qo),s(Ll,It),ne(It,t[3].m.s),s(He,Bo),s(He,Kl),s(Kl,Uo),s(Kl,Ho),s(Kl,jo),s(Kl,ul),s(ul,yn),s(ul,Cn),Se(ul,t[3].m.d,!0),s(He,Wo),s(He,Mn),s(Mn,Yl),s(Yl,zo),s(Yl,Go),s(Yl,Vo),s(Yl,Sn),s(Sn,Zt),ne(Zt,t[3].m.f),s(Sn,Ko),s(Sn,Ki),s(Mn,Yo),s(Mn,Ql),s(Ql,Qo),s(Ql,Xo),s(Ql,Zo),s(Ql,Tn),s(Tn,Jt),ne(Jt,t[3].m.r),s(Tn,Jo),s(Tn,Yi),s(He,xo),s(He,Ns),s(He,er),s(He,Xl),s(Xl,Qi),s(Qi,xt),xt.checked=t[3].m.e.e,s(Qi,tr),s(Xl,lr),yt&&yt.m(Xl,null),s(He,nr),Ct&&Ct.m(He,null),s(He,$s),s(He,Xi),s(Xi,el),el.checked=t[3].m.m.e,s(Xi,ir),s(He,sr),Mt&&Mt.m(He,null),s(l,or),s(l,Rt),s(Rt,Zi),s(Rt,rr),s(Rt,Nn),se($n,Nn,null),s(Rt,ar),s(Rt,ci),s(Rt,ur),s(Rt,Zl),s(Zl,fr),s(Zl,cr),s(Zl,mr),s(Zl,zt),s(zt,En),s(zt,An),qt&&qt.m(zt,null),Se(zt,t[3].n.c,!0),s(Rt,pr),St&&St.m(Rt,null),s(l,_r),s(l,pt),s(pt,Ji),s(pt,dr),s(pt,Pn),se(Dn,Pn,null),s(pt,vr),s(pt,Jl),s(Jl,hr),s(Jl,br),s(Jl,gr),s(Jl,ql),s(ql,fl),s(fl,In),s(fl,Rn),Se(fl,t[3].n.m,!0),s(ql,kr),s(ql,Lt),ne(Lt,t[3].n.i),s(ql,wr),s(ql,Ot),se(Ln,Ot,null),Se(Ot,t[3].n.s,!0),s(pt,yr),Tt&&Tt.m(pt,null),s(pt,Es),s(pt,ns),s(ns,is),s(is,tl),tl.checked=t[3].n.d,s(is,Cr),s(pt,Mr),s(pt,mi),s(pt,Sr),s(pt,Bl),s(Bl,Tr),s(Bl,pi),s(pi,ll),ll.checked=t[3].n.h,s(pi,Nr),s(Bl,$r),s(Bl,Er),s(Bl,ss),s(ss,gl),ne(gl,t[3].n.n1),s(l,Ar),s(l,tt),s(tt,os),s(tt,Pr),s(tt,On),se(Fn,On,null),s(tt,Dr),s(tt,_i),s(tt,Ir),s(tt,cl),s(cl,Rr),Nt&&Nt.m(cl,null),s(cl,As),s(cl,Lr),s(cl,Or),s(cl,qn),s(qn,kl),ne(kl,t[3].q.h),s(qn,Fr),s(qn,nl),ne(nl,t[3].q.p),s(tt,qr),ot&&ot.m(tt,null),s(tt,Ps),s(tt,xl),s(xl,Br),s(xl,Ur),s(xl,Hr),s(xl,wl),ne(wl,t[3].q.u),s(tt,jr),s(tt,en),s(en,Wr),s(en,zr),s(en,Gr),s(en,yl),ne(yl,t[3].q.a),s(tt,Vr),s(tt,Bn),s(Bn,Un),s(Un,Kr),s(Un,Yr),s(Un,Qr),s(Un,Cl),ne(Cl,t[3].q.c),s(Bn,Xr),s(Bn,Hn),s(Hn,Zr),s(Hn,Jr),s(Hn,xr),s(Hn,gt),s(gt,jn),s(gt,Wn),s(gt,zn),s(gt,Gn),s(gt,Vn),s(gt,Kn),Se(gt,t[3].q.m,!0),s(tt,ea),s(tt,tn),s(tn,ta),s(tn,la),s(tn,na),s(tn,Ml),ne(Ml,t[3].q.b),s(l,ia),rt&&rt.m(l,null),s(l,Ds),at&&at.m(l,null),s(l,Is),ut&&ut.m(l,null),s(l,Rs),ft&&ft.m(l,null),s(l,Os),s(l,ml),s(ml,rs),s(ml,sa),s(ml,Yn),se(Qn,Yn,null),s(ml,oa),s(ml,di),s(ml,ra),s(ml,vi);for(let _t=0;_t0?wt?wt.p(q,me):(wt=rf(q),wt.c(),wt.m(n,null)):wt&&(wt.d(1),wt=null),me[0]&8&&Se(Wt,q[3].m.a),me[0]&8&&(Xt.checked=q[3].m.i),(!Gt||me[0]&8&&Wi!==(Wi=q[3].m.b!=0))&&(Ol.disabled=Wi),me[0]&8&&Se(al,q[3].m.b),(!Gt||me[0]&8&&zi!==(zi=q[3].m.b!=0))&&(Fl.disabled=zi),(!Gt||me[0]&8&&Gi!==(Gi=q[3].m.b==0))&&(dt.disabled=Gi),me[0]&8&&Se(dt,q[3].m.p),(!Gt||me[0]&9&&Vi!==(Vi=q[0].chip=="esp8266"?q[3].i.h.p==3||q[3].i.h.p==113?512:128:4096))&&r(It,"max",Vi),me[0]&8&&he(It.value)!==q[3].m.s&&ne(It,q[3].m.s),me[0]&8&&Se(ul,q[3].m.d),me[0]&8&&he(Zt.value)!==q[3].m.f&&ne(Zt,q[3].m.f),me[0]&8&&he(Jt.value)!==q[3].m.r&&ne(Jt,q[3].m.r),me[0]&8&&(xt.checked=q[3].m.e.e),q[3].m.e.e?yt?yt.p(q,me):(yt=af(q),yt.c(),yt.m(Xl,null)):yt&&(yt.d(1),yt=null),q[3].m.e.e?Ct?Ct.p(q,me):(Ct=uf(q),Ct.c(),Ct.m(He,$s)):Ct&&(Ct.d(1),Ct=null),me[0]&8&&(el.checked=q[3].m.m.e),q[3].m.m.e?Mt?Mt.p(q,me):(Mt=ff(q),Mt.c(),Mt.m(He,null)):Mt&&(Mt.d(1),Mt=null),q[0].if&&q[0].if.eth?qt||(qt=cf(),qt.c(),qt.m(zt,null)):qt&&(qt.d(1),qt=null),me[0]&8&&Se(zt,q[3].n.c),q[3].n.c==1||q[3].n.c==2?St?St.p(q,me):(St=mf(q),St.c(),St.m(Rt,null)):St&&(St.d(1),St=null),me[0]&8&&Se(fl,q[3].n.m),(!Gt||me[0]&8&&xi!==(xi=q[3].n.m=="dhcp"))&&(Lt.disabled=xi),(!Gt||me[0]&8&&es!==(es=q[3].n.m=="static"))&&(Lt.required=es),me[0]&8&&Lt.value!==q[3].n.i&&ne(Lt,q[3].n.i),(!Gt||me[0]&8&&ts!==(ts=q[3].n.m=="dhcp"))&&(Ot.disabled=ts),(!Gt||me[0]&8&&ls!==(ls=q[3].n.m=="static"))&&(Ot.required=ls),me[0]&8&&Se(Ot,q[3].n.s),q[3].n.m=="static"?Tt?Tt.p(q,me):(Tt=pf(q),Tt.c(),Tt.m(pt,Es)):Tt&&(Tt.d(1),Tt=null),me[0]&8&&(tl.checked=q[3].n.d),me[0]&8&&(ll.checked=q[3].n.h),me[0]&8&&gl.value!==q[3].n.n1&&ne(gl,q[3].n.n1),q[0].chip!="esp8266"?Nt?Nt.p(q,me):(Nt=_f(q),Nt.c(),Nt.m(cl,As)):Nt&&(Nt.d(1),Nt=null),me[0]&8&&kl.value!==q[3].q.h&&ne(kl,q[3].q.h),me[0]&8&&he(nl.value)!==q[3].q.p&&ne(nl,q[3].q.p),q[3].q.s.e?ot?(ot.p(q,me),me[0]&8&&R(ot,1)):(ot=df(q),ot.c(),R(ot,1),ot.m(tt,Ps)):ot&&(Ie(),B(ot,1,1,()=>{ot=null}),Re()),me[0]&8&&wl.value!==q[3].q.u&&ne(wl,q[3].q.u),me[0]&8&&yl.value!==q[3].q.a&&ne(yl,q[3].q.a),me[0]&8&&Cl.value!==q[3].q.c&&ne(Cl,q[3].q.c),me[0]&8&&Se(gt,q[3].q.m),me[0]&8&&Ml.value!==q[3].q.b&&ne(Ml,q[3].q.b),q[3].q.m==3?rt?(rt.p(q,me),me[0]&8&&R(rt,1)):(rt=vf(q),rt.c(),R(rt,1),rt.m(l,Ds)):rt&&(Ie(),B(rt,1,1,()=>{rt=null}),Re()),q[3].q.m==4?at?(at.p(q,me),me[0]&8&&R(at,1)):(at=hf(q),at.c(),R(at,1),at.m(l,Is)):at&&(Ie(),B(at,1,1,()=>{at=null}),Re()),q[3].c.es!=null?ut?(ut.p(q,me),me[0]&8&&R(ut,1)):(ut=bf(q),ut.c(),R(ut,1),ut.m(l,Rs)):ut&&(Ie(),B(ut,1,1,()=>{ut=null}),Re()),me[0]&8&&(Ls=q[3].p.r.startsWith("10YNO")||q[3].p.r.startsWith("10Y1001A1001A4")),Ls?ft?(ft.p(q,me),me[0]&8&&R(ft,1)):(ft=wf(q),ft.c(),R(ft,1),ft.m(l,Os)):ft&&(Ie(),B(ft,1,1,()=>{ft=null}),Re()),me[0]&136){ei=q[7];let Vt;for(Vt=0;Vt20||q[0].chip=="esp8266"||q[3].i.d.d>0?ct?(ct.p(q,me),me[0]&9&&R(ct,1)):(ct=Mf(q),ct.c(),R(ct,1),ct.m(l,Fs)):ct&&(Ie(),B(ct,1,1,()=>{ct=null}),Re()),me[0]&8&&(il.checked=q[3].d.s),q[3].d.s?$t?$t.p(q,me):($t=Pf(q),$t.c(),$t.m(Ft,null)):$t&&($t.d(1),$t=null);const _t={};me[0]&2&&(_t.active=q[1]),ln.$set(_t);const ba={};me[0]&4&&(ba.active=q[2]),nn.$set(ba);const ga={};me[0]&16&&(ga.active=q[4]),sn.$set(ga);const ka={};me[0]&32&&(ka.active=q[5]),on.$set(ka)},i(q){Gt||(R(a.$$.fragment,q),R(O.$$.fragment,q),R(Dl.$$.fragment,q),R($n.$$.fragment,q),R(Dn.$$.fragment,q),R(Ln.$$.fragment,q),R(Fn.$$.fragment,q),R(ot),R(rt),R(at),R(ut),R(ft),R(Qn.$$.fragment,q),R(ct),R(Zn.$$.fragment,q),R(ln.$$.fragment,q),R(nn.$$.fragment,q),R(sn.$$.fragment,q),R(on.$$.fragment,q),Gt=!0)},o(q){B(a.$$.fragment,q),B(O.$$.fragment,q),B(Dl.$$.fragment,q),B($n.$$.fragment,q),B(Dn.$$.fragment,q),B(Ln.$$.fragment,q),B(Fn.$$.fragment,q),B(ot),B(rt),B(at),B(ut),B(ft),B(Qn.$$.fragment,q),B(ct),B(Zn.$$.fragment,q),B(ln.$$.fragment,q),B(nn.$$.fragment,q),B(sn.$$.fragment,q),B(on.$$.fragment,q),Gt=!1},d(q){q&&w(e),oe(a),oe(O),Kt(bi,q),kt&&kt.d(),wt&&wt.d(),oe(Dl),Kt(gi,q),yt&&yt.d(),Ct&&Ct.d(),Mt&&Mt.d(),oe($n),qt&&qt.d(),St&&St.d(),oe(Dn),oe(Ln),Tt&&Tt.d(),oe(Fn),Nt&&Nt.d(),ot&&ot.d(),rt&&rt.d(),at&&at.d(),ut&&ut.d(),ft&&ft.d(),oe(Qn),Kt(vt,q),ct&&ct.d(),oe(Zn),$t&&$t.d(),q&&w(Bs),oe(ln,q),q&&w(Us),oe(nn,q),q&&w(Hs),oe(sn,q),q&&w(js),oe(on,q),Ws=!1,Ve(ha)}}}async function $p(){await(await fetch("/reboot",{method:"POST"})).json()}function Ep(t,e,l){let{sysinfo:n={}}=e,i=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{name:"Reactive",key:"r"},{name:"Realtime",key:"c"},{name:"Peaks",key:"t"},{name:"Realtime plot",key:"l"},{name:"Price",key:"p"},{name:"Day plot",key:"d"},{name:"Month plot",key:"m"},{name:"Temperature plot",key:"s"},{name:"Dark mode",key:"k"}],o=!0,u=!1,a={g:{t:"",h:"",s:0,u:"",p:""},m:{b:2400,p:11,i:!1,d:0,f:0,r:0,e:{e:!1,k:"",a:""},m:{e:!1,w:!1,v:!1,a:!1,c:!1}},w:{s:"",p:"",w:0,z:255,a:!0,b:!0},n:{m:"",i:"",s:"",g:"",d1:"",d2:"",d:!1,n1:"",n2:"",h:!1},q:{h:"",p:1883,u:"",a:"",b:"",s:{e:!1,c:!1,r:!0,k:!1}},o:{e:"",c:"",u1:"",u2:"",u3:""},t:{t:[0,0,0,0,0,0,0,0,0,0],h:1},p:{e:!1,t:"",r:"",c:"",m:1,f:null},d:{s:!1,t:!1,l:5},u:{i:0,e:0,v:0,a:0,r:0,c:0,t:0,p:0,d:0,m:0,s:0},i:{h:{p:null,u:!0},a:null,l:{p:null,i:!1},r:{r:null,g:null,b:null,i:!1},d:{d:null,b:0},t:{d:null,a:null},v:{p:null,d:{v:null,g:null},o:null,m:null,b:null}},h:{t:"",h:"",n:""},c:{e:!1,i:null,s:null,es:null}};yi.subscribe(Ze=>{Ze.version&&(l(3,a=Ze),l(1,o=!1))}),Ym();let c=!1,f=!1;async function p(){if(confirm("Are you sure you want to factory reset the device?")){l(4,c=!0);const Ze=new URLSearchParams;Ze.append("perform","true");let Vl=await(await fetch("/reset",{method:"POST",body:Ze})).json();l(4,c=!1),l(5,f=Vl.success)}}async function _(Ze){l(2,u=!0);const mt=new FormData(Ze.target),Vl=new URLSearchParams;for(let Rl of mt){const[Hi,Wt]=Rl;Vl.append(Hi,Wt)}let Ui=await(await fetch("/save",{method:"POST",body:Vl})).json();Yt.update(Rl=>(Rl.booting=Ui.reboot,Rl.ui=a.u,Rl)),l(2,u=!1),si("/")}const b=function(){confirm("Are you sure you want to reboot the device?")&&(Yt.update(Ze=>(Ze.booting=!0,Ze)),$p())};async function v(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("/mqtt-ca",{method:"POST"})).text(),yi.update(mt=>(mt.q.s.c=!1,mt)))}async function d(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("/mqtt-cert",{method:"POST"})).text(),yi.update(mt=>(mt.q.s.r=!1,mt)))}async function M(){confirm("Are you sure you want to delete key?")&&(await(await fetch("/mqtt-key",{method:"POST"})).text(),yi.update(mt=>(mt.q.s.k=!1,mt)))}const C=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 N=44;function S(){a.g.h=this.value,l(3,a)}function P(){a.g.t=nt(this),l(3,a)}function F(){a.p.r=nt(this),l(3,a)}function A(){a.p.c=nt(this),l(3,a)}function I(){a.p.f=he(this.value),l(3,a)}function D(){a.p.m=he(this.value),l(3,a)}function O(){a.p.e=this.checked,l(3,a)}function ie(){a.p.t=this.value,l(3,a)}function j(){a.g.s=nt(this),l(3,a)}function K(){a.g.u=this.value,l(3,a)}function G(){a.g.p=this.value,l(3,a)}function Y(){a.m.a=nt(this),l(3,a)}function Q(){a.m.i=this.checked,l(3,a)}function z(){a.m.b=nt(this),l(3,a)}function Z(){a.m.p=nt(this),l(3,a)}function V(){a.m.s=he(this.value),l(3,a)}function H(){a.m.d=nt(this),l(3,a)}function ee(){a.m.f=he(this.value),l(3,a)}function ue(){a.m.r=he(this.value),l(3,a)}function x(){a.m.e.e=this.checked,l(3,a)}function W(){a.m.e.k=this.value,l(3,a)}function U(){a.m.e.a=this.value,l(3,a)}function ke(){a.m.m.e=this.checked,l(3,a)}function je(){a.m.m.w=he(this.value),l(3,a)}function Be(){a.m.m.v=he(this.value),l(3,a)}function We(){a.m.m.a=he(this.value),l(3,a)}function $e(){a.m.m.c=he(this.value),l(3,a)}function ge(){a.n.c=nt(this),l(3,a)}function Le(){a.w.s=this.value,l(3,a)}function Me(){a.w.p=this.value,l(3,a)}function T(){a.w.z=nt(this),l(3,a)}function g(){a.w.w=he(this.value),l(3,a)}function k(){a.w.b=this.checked,l(3,a)}function E(){a.n.m=nt(this),l(3,a)}function L(){a.n.i=this.value,l(3,a)}function J(){a.n.s=nt(this),l(3,a)}function te(){a.n.g=this.value,l(3,a)}function fe(){a.n.d1=this.value,l(3,a)}function de(){a.n.d2=this.value,l(3,a)}function we(){a.n.d=this.checked,l(3,a)}function Ee(){a.n.h=this.checked,l(3,a)}function ae(){a.n.n1=this.value,l(3,a)}function Ce(){a.q.s.e=this.checked,l(3,a)}function Je(){a.q.h=this.value,l(3,a)}function Et(){a.q.p=he(this.value),l(3,a)}function st(){a.q.u=this.value,l(3,a)}function ht(){a.q.a=this.value,l(3,a)}function lt(){a.q.c=this.value,l(3,a)}function At(){a.q.m=nt(this),l(3,a)}function Ye(){a.q.b=this.value,l(3,a)}function Qt(){a.o.e=this.value,l(3,a)}function jt(){a.o.c=this.value,l(3,a)}function bt(){a.o.u1=this.value,l(3,a)}function ze(){a.o.u2=this.value,l(3,a)}function xe(){a.o.u3=this.value,l(3,a)}function Xe(){a.h.t=this.value,l(3,a)}function Ue(){a.h.h=this.value,l(3,a)}function qe(){a.h.n=this.value,l(3,a)}function et(){a.c.e=this.checked,l(3,a)}function Ae(){a.c.i=this.value,l(3,a)}function Oe(){a.c.s=this.value,l(3,a)}function pe(){a.c.es=this.checked,l(3,a)}function ce(Ze){a.t.t[Ze]=he(this.value),l(3,a)}function ye(){a.t.h=he(this.value),l(3,a)}function zl(Ze){a.u[Ze.key]=nt(this),l(3,a)}function hl(){a.i.h.p=nt(this),l(3,a)}function _n(){a.i.h.t=nt(this),l(3,a)}function Pt(){a.i.h.u=this.checked,l(3,a)}function Ai(){a.i.a=he(this.value),l(3,a)}function Pi(){a.i.l.p=he(this.value),l(3,a)}function Di(){a.i.l.i=this.checked,l(3,a)}function bl(){a.i.r.i=this.checked,l(3,a)}function Ii(){a.i.r.r=he(this.value),l(3,a)}function Ri(){a.i.r.g=he(this.value),l(3,a)}function Li(){a.i.r.b=he(this.value),l(3,a)}function Dt(){a.i.d.d=he(this.value),l(3,a)}function $l(){a.i.t.d=he(this.value),l(3,a)}function El(){a.i.t.a=he(this.value),l(3,a)}function Al(){a.i.v.p=he(this.value),l(3,a)}function Oi(){a.i.v.d.v=he(this.value),l(3,a)}function Fi(){a.i.v.d.g=he(this.value),l(3,a)}function He(){a.i.d.b=nt(this),l(3,a)}function dn(){a.i.v.o=he(this.value),l(3,a)}function qi(){a.i.v.m=he(this.value),l(3,a)}function Pl(){a.i.v.b=he(this.value),l(3,a)}function Dl(){a.d.s=this.checked,l(3,a)}function Bi(){a.d.t=this.checked,l(3,a)}function Gl(){a.d.l=nt(this),l(3,a)}return t.$$set=Ze=>{"sysinfo"in Ze&&l(0,n=Ze.sysinfo)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(6,N=n.chip=="esp8266"?16:n.chip=="esp32s2"?44:39)},[n,o,u,a,c,f,N,i,p,_,b,v,d,M,C,S,P,F,A,I,D,O,ie,j,K,G,Y,Q,z,Z,V,H,ee,ue,x,W,U,ke,je,Be,We,$e,ge,Le,Me,T,g,k,E,L,J,te,fe,de,we,Ee,ae,Ce,Je,Et,st,ht,lt,At,Ye,Qt,jt,bt,ze,xe,Xe,Ue,qe,et,Ae,Oe,pe,ce,ye,zl,hl,_n,Pt,Ai,Pi,Di,bl,Ii,Ri,Li,Dt,$l,El,Al,Oi,Fi,He,dn,qi,Pl,Dl,Bi,Gl]}class Ap extends De{constructor(e){super(),Pe(this,e,Ep,Np,Ne,{sysinfo:0},null,[-1,-1,-1,-1])}}function If(t,e,l){const n=t.slice();return n[20]=e[l],n}function Pp(t){let e=ve(t[1].chip,t[1].board)+"",l;return{c(){l=$(e)},m(n,i){y(n,l,i)},p(n,i){i&2&&e!==(e=ve(n[1].chip,n[1].board)+"")&&X(l,e)},d(n){n&&w(l)}}}function Rf(t){let e,l,n=t[1].apmac+"",i,o,u,a,c,f,p,_,b,v=Ba(t[1])+"",d,M,C=t[1].boot_reason+"",N,S,P=t[1].ex_cause+"",F,A,I;const D=[Ip,Dp],O=[];function ie(j,K){return j[0].u>0?0:1}return c=ie(t),f=O[c]=D[c](t),{c(){e=m("div"),l=$("AP MAC: "),i=$(n),o=h(),u=m("div"),a=$(`Last boot: + `),f.c(),p=h(),_=m("div"),b=$("Reason: "),d=$(v),M=$(" ("),N=$(C),S=$("/"),F=$(P),A=$(")"),r(e,"class","my-2"),r(u,"class","my-2"),r(_,"class","my-2")},m(j,K){y(j,e,K),s(e,l),s(e,i),y(j,o,K),y(j,u,K),s(u,a),O[c].m(u,null),y(j,p,K),y(j,_,K),s(_,b),s(_,d),s(_,M),s(_,N),s(_,S),s(_,F),s(_,A),I=!0},p(j,K){(!I||K&2)&&n!==(n=j[1].apmac+"")&&X(i,n);let G=c;c=ie(j),c===G?O[c].p(j,K):(Ie(),B(O[G],1,1,()=>{O[G]=null}),Re(),f=O[c],f?f.p(j,K):(f=O[c]=D[c](j),f.c()),R(f,1),f.m(u,null)),(!I||K&2)&&v!==(v=Ba(j[1])+"")&&X(d,v),(!I||K&2)&&C!==(C=j[1].boot_reason+"")&&X(N,C),(!I||K&2)&&P!==(P=j[1].ex_cause+"")&&X(F,P)},i(j){I||(R(f),I=!0)},o(j){B(f),I=!1},d(j){j&&w(e),j&&w(o),j&&w(u),O[c].d(),j&&w(p),j&&w(_)}}}function Dp(t){let e;return{c(){e=$("-")},m(l,n){y(l,e,n)},p:_e,i:_e,o:_e,d(l){l&&w(e)}}}function Ip(t){let e,l;return e=new Xc({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:""}}),{c(){re(e.$$.fragment)},m(n,i){se(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||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function Rp(t){let e;return{c(){e=m("span"),e.textContent="Update consents",r(e,"class","btn-pri-sm")},m(l,n){y(l,e,n)},p:_e,d(l){l&&w(e)}}}function Lf(t){let e,l,n,i,o,u=ys(t[1].meter.mfg)+"",a,c,f,p,_=(t[1].meter.model?t[1].meter.model:"unknown")+"",b,v,d,M,C=(t[1].meter.id?t[1].meter.id:"unknown")+"",N;return{c(){e=m("div"),l=m("strong"),l.textContent="Meter",n=h(),i=m("div"),o=$("Manufacturer: "),a=$(u),c=h(),f=m("div"),p=$("Model: "),b=$(_),v=h(),d=m("div"),M=$("ID: "),N=$(C),r(l,"class","text-sm"),r(i,"class","my-2"),r(f,"class","my-2"),r(d,"class","my-2"),r(e,"class","cnt")},m(S,P){y(S,e,P),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,c),s(e,f),s(f,p),s(f,b),s(e,v),s(e,d),s(d,M),s(d,N)},p(S,P){P&2&&u!==(u=ys(S[1].meter.mfg)+"")&&X(a,u),P&2&&_!==(_=(S[1].meter.model?S[1].meter.model:"unknown")+"")&&X(b,_),P&2&&C!==(C=(S[1].meter.id?S[1].meter.id:"unknown")+"")&&X(N,C)},d(S){S&&w(e)}}}function Of(t){let e,l,n,i,o,u=t[1].net.ip+"",a,c,f,p,_=t[1].net.mask+"",b,v,d,M,C=t[1].net.gw+"",N,S,P,F,A=t[1].net.dns1+"",I,D,O=t[1].net.dns2&&Ff(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Network",n=h(),i=m("div"),o=$("IP: "),a=$(u),c=h(),f=m("div"),p=$("Mask: "),b=$(_),v=h(),d=m("div"),M=$("Gateway: "),N=$(C),S=h(),P=m("div"),F=$("DNS: "),I=$(A),D=h(),O&&O.c(),r(l,"class","text-sm"),r(i,"class","my-2"),r(f,"class","my-2"),r(d,"class","my-2"),r(P,"class","my-2"),r(e,"class","cnt")},m(ie,j){y(ie,e,j),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,c),s(e,f),s(f,p),s(f,b),s(e,v),s(e,d),s(d,M),s(d,N),s(e,S),s(e,P),s(P,F),s(P,I),s(P,D),O&&O.m(P,null)},p(ie,j){j&2&&u!==(u=ie[1].net.ip+"")&&X(a,u),j&2&&_!==(_=ie[1].net.mask+"")&&X(b,_),j&2&&C!==(C=ie[1].net.gw+"")&&X(N,C),j&2&&A!==(A=ie[1].net.dns1+"")&&X(I,A),ie[1].net.dns2?O?O.p(ie,j):(O=Ff(ie),O.c(),O.m(P,null)):O&&(O.d(1),O=null)},d(ie){ie&&w(e),O&&O.d()}}}function Ff(t){let e,l=t[1].net.dns2+"",n;return{c(){e=$("/ "),n=$(l)},m(i,o){y(i,e,o),y(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns2+"")&&X(n,l)},d(i){i&&w(e),i&&w(n)}}}function qf(t){let e,l,n,i=t[1].upgrade.f+"",o,u,a=t[1].upgrade.t+"",c,f,p=qa(t[1].upgrade.e)+"",_;return{c(){e=m("div"),l=m("div"),n=$("Previous upgrade attempt from "),o=$(i),u=$(" to "),c=$(a),f=$(" failed. "),_=$(p),r(l,"class","bd-yellow"),r(e,"class","my-2")},m(b,v){y(b,e,v),s(e,l),s(l,n),s(l,o),s(l,u),s(l,c),s(l,f),s(l,_)},p(b,v){v&2&&i!==(i=b[1].upgrade.f+"")&&X(o,i),v&2&&a!==(a=b[1].upgrade.t+"")&&X(c,a),v&2&&p!==(p=qa(b[1].upgrade.e)+"")&&X(_,p)},d(b){b&&w(e)}}}function Bf(t){let e,l,n,i=t[2].tag_name+"",o,u,a,c,f,p,_=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[2]&&t[2].tag_name!=t[1].version&&Uf(t),b=t[1].fwconsent===2&&Hf();return{c(){e=m("div"),l=$(`Latest version: + `),n=m("a"),o=$(i),a=h(),_&&_.c(),c=h(),b&&b.c(),f=Ke(),r(n,"href",u=t[2].html_url),r(n,"class","ml-2 text-blue-600 hover:text-blue-800"),r(n,"target","_blank"),r(n,"rel","noreferrer"),r(e,"class","my-2 flex")},m(v,d){y(v,e,d),s(e,l),s(e,n),s(n,o),s(e,a),_&&_.m(e,null),y(v,c,d),b&&b.m(v,d),y(v,f,d),p=!0},p(v,d){(!p||d&4)&&i!==(i=v[2].tag_name+"")&&X(o,i),(!p||d&4&&u!==(u=v[2].html_url))&&r(n,"href",u),(v[1].security==0||v[0].a)&&v[1].fwconsent===1&&v[2]&&v[2].tag_name!=v[1].version?_?(_.p(v,d),d&7&&R(_,1)):(_=Uf(v),_.c(),R(_,1),_.m(e,null)):_&&(Ie(),B(_,1,1,()=>{_=null}),Re()),v[1].fwconsent===2?b||(b=Hf(),b.c(),b.m(f.parentNode,f)):b&&(b.d(1),b=null)},i(v){p||(R(_),p=!0)},o(v){B(_),p=!1},d(v){v&&w(e),_&&_.d(),v&&w(c),b&&b.d(v),v&&w(f)}}}function Uf(t){let e,l,n,i,o,u;return n=new Zc({}),{c(){e=m("div"),l=m("button"),re(n.$$.fragment),r(e,"class","flex-none ml-2 text-green-500"),r(e,"title","Install this version")},m(a,c){y(a,e,c),s(e,l),se(n,l,null),i=!0,o||(u=le(l,"click",t[10]),o=!0)},p:_e,i(a){i||(R(n.$$.fragment,a),i=!0)},o(a){B(n.$$.fragment,a),i=!1},d(a){a&&w(e),oe(n),o=!1,u()}}}function Hf(t){let e;return{c(){e=m("div"),e.innerHTML='
You have disabled one-click firmware upgrade, link to self-upgrade is disabled
',r(e,"class","my-2")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function jf(t){let e,l=Cs(ve(t[1].chip,t[1].board))+"",n;return{c(){e=m("div"),n=$(l),r(e,"class","bd-red")},m(i,o){y(i,e,o),s(e,n)},p(i,o){o&2&&l!==(l=Cs(ve(i[1].chip,i[1].board))+"")&&X(n,l)},d(i){i&&w(e)}}}function Wf(t){let e,l,n,i,o,u;function a(p,_){return p[4].length==0?Op:Lp}let c=a(t),f=c(t);return{c(){e=m("div"),l=m("form"),n=m("input"),i=h(),f.c(),oc(n,"display","none"),r(n,"name","file"),r(n,"type","file"),r(n,"accept",".bin"),r(l,"action","/firmware"),r(l,"enctype","multipart/form-data"),r(l,"method","post"),r(l,"autocomplete","off"),r(e,"class","my-2 flex")},m(p,_){y(p,e,_),s(e,l),s(l,n),t[12](n),s(l,i),f.m(l,null),o||(u=[le(n,"change",t[13]),le(l,"submit",t[15])],o=!0)},p(p,_){c===(c=a(p))&&f?f.p(p,_):(f.d(1),f=c(p),f&&(f.c(),f.m(l,null)))},d(p){p&&w(e),t[12](null),f.d(),o=!1,Ve(u)}}}function Lp(t){let e=t[4][0].name+"",l,n,i;return{c(){l=$(e),n=h(),i=m("button"),i.textContent="Upload",r(i,"type","submit"),r(i,"class","btn-pri-sm float-right")},m(o,u){y(o,l,u),y(o,n,u),y(o,i,u)},p(o,u){u&16&&e!==(e=o[4][0].name+"")&&X(l,e)},d(o){o&&w(l),o&&w(n),o&&w(i)}}}function Op(t){let e,l,n;return{c(){e=m("button"),e.textContent="Select firmware file for upgrade",r(e,"type","button"),r(e,"class","btn-pri-sm float-right")},m(i,o){y(i,e,o),l||(n=le(e,"click",t[14]),l=!0)},p:_e,d(i){i&&w(e),l=!1,n()}}}function zf(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M=t[9],C=[];for(let A=0;A Include Secrets
(SSID, PSK, passwords and tokens)',c=h(),N&&N.c(),f=h(),p=m("form"),_=m("input"),b=h(),F.c(),r(l,"class","text-sm"),r(a,"class","my-1 mx-3 col-span-2"),r(o,"class","grid grid-cols-2"),r(i,"method","get"),r(i,"action","/configfile.cfg"),r(i,"autocomplete","off"),oc(_,"display","none"),r(_,"name","file"),r(_,"type","file"),r(_,"accept",".cfg"),r(p,"action","/configfile"),r(p,"enctype","multipart/form-data"),r(p,"method","post"),r(p,"autocomplete","off"),r(e,"class","cnt")},m(A,I){y(A,e,I),s(e,l),s(e,n),s(e,i),s(i,o);for(let D=0;D{E=null}),Re());const Et={};Ce&8388608&&(Et.$$scope={dirty:Ce,ctx:ae}),ie.$set(Et),ae[1].meter?L?L.p(ae,Ce):(L=Lf(ae),L.c(),L.m(e,Y)):L&&(L.d(1),L=null),ae[1].net?J?J.p(ae,Ce):(J=Of(ae),J.c(),J.m(e,Q)):J&&(J.d(1),J=null),(!T||Ce&2)&&ue!==(ue=ae[1].version+"")&&X(x,ue),ae[1].upgrade.t&&ae[1].upgrade.t!=ae[1].version?te?te.p(ae,Ce):(te=qf(ae),te.c(),te.m(z,U)):te&&(te.d(1),te=null),ae[2]?fe?(fe.p(ae,Ce),Ce&4&&R(fe,1)):(fe=Bf(ae),fe.c(),R(fe,1),fe.m(z,ke)):fe&&(Ie(),B(fe,1,1,()=>{fe=null}),Re()),Ce&3&&(je=(ae[1].security==0||ae[0].a)&&oi(ae[1].board)),je?de?de.p(ae,Ce):(de=jf(ae),de.c(),de.m(z,Be)):de&&(de.d(1),de=null),ae[1].security==0||ae[0].a?we?we.p(ae,Ce):(we=Wf(ae),we.c(),we.m(z,null)):we&&(we.d(1),we=null),ae[1].security==0||ae[0].a?Ee?Ee.p(ae,Ce):(Ee=zf(ae),Ee.c(),Ee.m(e,null)):Ee&&(Ee.d(1),Ee=null);const st={};Ce&32&&(st.active=ae[5]),ge.$set(st);const ht={};Ce&256&&(ht.active=ae[8]),Me.$set(ht)},i(ae){T||(R(C.$$.fragment,ae),R(E),R(ie.$$.fragment,ae),R(fe),R(ge.$$.fragment,ae),R(Me.$$.fragment,ae),T=!0)},o(ae){B(C.$$.fragment,ae),B(E),B(ie.$$.fragment,ae),B(fe),B(ge.$$.fragment,ae),B(Me.$$.fragment,ae),T=!1},d(ae){ae&&w(e),oe(C),E&&E.d(),oe(ie),L&&L.d(),J&&J.d(),te&&te.d(),fe&&fe.d(),de&&de.d(),we&&we.d(),Ee&&Ee.d(),ae&&w($e),oe(ge,ae),ae&&w(Le),oe(Me,ae),g=!1,k()}}}async function Up(){await(await fetch("/reboot",{method:"POST"})).json()}function Hp(t,e,l){let{data:n}=e,{sysinfo:i}=e,o=[{name:"WiFi",key:"iw"},{name:"MQTT",key:"im"},{name:"Web",key:"ie"},{name:"Meter",key:"it"},{name:"Thresholds",key:"ih"},{name:"GPIO",key:"ig"},{name:"NTP",key:"in"},{name:"Price API",key:"is"}],u={};No.subscribe(D=>{l(2,u=Qc(i.version,D)),u||l(2,u=D[0])});function a(){confirm("Do you want to upgrade this device to "+u.tag_name+"?")&&(i.board!=2&&i.board!=4&&i.board!=7||confirm(Cs(ve(i.chip,i.board))))&&(Yt.update(D=>(D.upgrading=!0,D)),Yc(u.tag_name))}const c=function(){confirm("Are you sure you want to reboot the device?")&&(Yt.update(D=>(D.booting=!0,D)),Up())};let f,p=[],_=!1,b,v=[],d=!1;Co();function M(D){ks[D?"unshift":"push"](()=>{f=D,l(3,f)})}function C(){p=this.files,l(4,p)}const N=()=>{f.click()},S=()=>l(5,_=!0);function P(D){ks[D?"unshift":"push"](()=>{b=D,l(6,b)})}function F(){v=this.files,l(7,v)}const A=()=>{b.click()},I=()=>l(8,d=!0);return t.$$set=D=>{"data"in D&&l(0,n=D.data),"sysinfo"in D&&l(1,i=D.sysinfo)},[n,i,u,f,p,_,b,v,d,o,a,c,M,C,N,S,P,F,A,I]}class jp extends De{constructor(e){super(),Pe(this,e,Hp,Bp,Ne,{data:0,sysinfo:1})}}function Kf(t){let e,l,n=ve(t[0],7)+"",i,o,u=ve(t[0],5)+"",a,c,f=ve(t[0],4)+"",p,_,b=ve(t[0],3)+"",v,d,M,C,N=ve(t[0],2)+"",S,P,F=ve(t[0],1)+"",A,I,D=ve(t[0],0)+"",O,ie,j,K,G=ve(t[0],101)+"",Y,Q,z=ve(t[0],100)+"",Z;return{c(){e=m("optgroup"),l=m("option"),i=$(n),o=m("option"),a=$(u),c=m("option"),p=$(f),_=m("option"),v=$(b),d=h(),M=m("optgroup"),C=m("option"),S=$(N),P=m("option"),A=$(F),I=m("option"),O=$(D),ie=h(),j=m("optgroup"),K=m("option"),Y=$(G),Q=m("option"),Z=$(z),l.__value=7,l.value=l.__value,o.__value=5,o.value=o.__value,c.__value=4,c.value=c.__value,_.__value=3,_.value=_.__value,r(e,"label","amsleser.no"),C.__value=2,C.value=C.__value,P.__value=1,P.value=P.__value,I.__value=0,I.value=I.__value,r(M,"label","Custom hardware"),K.__value=101,K.value=K.__value,Q.__value=100,Q.value=Q.__value,r(j,"label","Generic hardware")},m(V,H){y(V,e,H),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,p),s(e,_),s(_,v),y(V,d,H),y(V,M,H),s(M,C),s(C,S),s(M,P),s(P,A),s(M,I),s(I,O),y(V,ie,H),y(V,j,H),s(j,K),s(K,Y),s(j,Q),s(Q,Z)},p(V,H){H&1&&n!==(n=ve(V[0],7)+"")&&X(i,n),H&1&&u!==(u=ve(V[0],5)+"")&&X(a,u),H&1&&f!==(f=ve(V[0],4)+"")&&X(p,f),H&1&&b!==(b=ve(V[0],3)+"")&&X(v,b),H&1&&N!==(N=ve(V[0],2)+"")&&X(S,N),H&1&&F!==(F=ve(V[0],1)+"")&&X(A,F),H&1&&D!==(D=ve(V[0],0)+"")&&X(O,D),H&1&&G!==(G=ve(V[0],101)+"")&&X(Y,G),H&1&&z!==(z=ve(V[0],100)+"")&&X(Z,z)},d(V){V&&w(e),V&&w(d),V&&w(M),V&&w(ie),V&&w(j)}}}function Yf(t){let e,l,n=ve(t[0],201)+"",i,o,u=ve(t[0],202)+"",a,c,f=ve(t[0],203)+"",p,_,b=ve(t[0],241)+"",v,d,M=ve(t[0],242)+"",C,N,S=ve(t[0],243)+"",P,F,A=ve(t[0],200)+"",I;return{c(){e=m("optgroup"),l=m("option"),i=$(n),o=m("option"),a=$(u),c=m("option"),p=$(f),_=m("option"),v=$(b),d=m("option"),C=$(M),N=m("option"),P=$(S),F=m("option"),I=$(A),l.__value=201,l.value=l.__value,o.__value=202,o.value=o.__value,c.__value=203,c.value=c.__value,_.__value=241,_.value=_.__value,d.__value=242,d.value=d.__value,N.__value=243,N.value=N.__value,F.__value=200,F.value=F.__value,r(e,"label","Generic hardware")},m(D,O){y(D,e,O),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,p),s(e,_),s(_,v),s(e,d),s(d,C),s(e,N),s(N,P),s(e,F),s(F,I)},p(D,O){O&1&&n!==(n=ve(D[0],201)+"")&&X(i,n),O&1&&u!==(u=ve(D[0],202)+"")&&X(a,u),O&1&&f!==(f=ve(D[0],203)+"")&&X(p,f),O&1&&b!==(b=ve(D[0],241)+"")&&X(v,b),O&1&&M!==(M=ve(D[0],242)+"")&&X(C,M),O&1&&S!==(S=ve(D[0],243)+"")&&X(P,S),O&1&&A!==(A=ve(D[0],200)+"")&&X(I,A)},d(D){D&&w(e)}}}function Qf(t){let e,l,n=ve(t[0],7)+"",i,o,u=ve(t[0],6)+"",a,c,f=ve(t[0],5)+"",p,_,b,v,d=ve(t[0],51)+"",M,C,N=ve(t[0],50)+"",S;return{c(){e=m("optgroup"),l=m("option"),i=$(n),o=m("option"),a=$(u),c=m("option"),p=$(f),_=h(),b=m("optgroup"),v=m("option"),M=$(d),C=m("option"),S=$(N),l.__value=7,l.value=l.__value,o.__value=6,o.value=o.__value,c.__value=5,c.value=c.__value,r(e,"label","amsleser.no"),v.__value=51,v.value=v.__value,C.__value=50,C.value=C.__value,r(b,"label","Generic hardware")},m(P,F){y(P,e,F),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,p),y(P,_,F),y(P,b,F),s(b,v),s(v,M),s(b,C),s(C,S)},p(P,F){F&1&&n!==(n=ve(P[0],7)+"")&&X(i,n),F&1&&u!==(u=ve(P[0],6)+"")&&X(a,u),F&1&&f!==(f=ve(P[0],5)+"")&&X(p,f),F&1&&d!==(d=ve(P[0],51)+"")&&X(M,d),F&1&&N!==(N=ve(P[0],50)+"")&&X(S,N)},d(P){P&&w(e),P&&w(_),P&&w(b)}}}function Xf(t){let e,l,n=ve(t[0],8)+"",i,o,u,a,c=ve(t[0],71)+"",f,p,_=ve(t[0],70)+"",b;return{c(){e=m("optgroup"),l=m("option"),i=$(n),o=h(),u=m("optgroup"),a=m("option"),f=$(c),p=m("option"),b=$(_),l.__value=8,l.value=l.__value,r(e,"label","Custom hardware"),a.__value=71,a.value=a.__value,p.__value=70,p.value=p.__value,r(u,"label","Generic hardware")},m(v,d){y(v,e,d),s(e,l),s(l,i),y(v,o,d),y(v,u,d),s(u,a),s(a,f),s(u,p),s(p,b)},p(v,d){d&1&&n!==(n=ve(v[0],8)+"")&&X(i,n),d&1&&c!==(c=ve(v[0],71)+"")&&X(f,c),d&1&&_!==(_=ve(v[0],70)+"")&&X(b,_)},d(v){v&&w(e),v&&w(o),v&&w(u)}}}function Zf(t){let e,l,n=ve(t[0],200)+"",i;return{c(){e=m("optgroup"),l=m("option"),i=$(n),l.__value=200,l.value=l.__value,r(e,"label","Generic hardware")},m(o,u){y(o,e,u),s(e,l),s(l,i)},p(o,u){u&1&&n!==(n=ve(o[0],200)+"")&&X(i,n)},d(o){o&&w(e)}}}function Wp(t){let e,l,n,i,o,u,a,c=t[0]=="esp8266"&&Kf(t),f=t[0]=="esp32"&&Yf(t),p=t[0]=="esp32s2"&&Qf(t),_=t[0]=="esp32c3"&&Xf(t),b=t[0]=="esp32solo"&&Zf(t);return{c(){e=m("option"),l=h(),c&&c.c(),n=h(),f&&f.c(),i=h(),p&&p.c(),o=h(),_&&_.c(),u=h(),b&&b.c(),a=Ke(),e.__value=-1,e.value=e.__value},m(v,d){y(v,e,d),y(v,l,d),c&&c.m(v,d),y(v,n,d),f&&f.m(v,d),y(v,i,d),p&&p.m(v,d),y(v,o,d),_&&_.m(v,d),y(v,u,d),b&&b.m(v,d),y(v,a,d)},p(v,[d]){v[0]=="esp8266"?c?c.p(v,d):(c=Kf(v),c.c(),c.m(n.parentNode,n)):c&&(c.d(1),c=null),v[0]=="esp32"?f?f.p(v,d):(f=Yf(v),f.c(),f.m(i.parentNode,i)):f&&(f.d(1),f=null),v[0]=="esp32s2"?p?p.p(v,d):(p=Qf(v),p.c(),p.m(o.parentNode,o)):p&&(p.d(1),p=null),v[0]=="esp32c3"?_?_.p(v,d):(_=Xf(v),_.c(),_.m(u.parentNode,u)):_&&(_.d(1),_=null),v[0]=="esp32solo"?b?b.p(v,d):(b=Zf(v),b.c(),b.m(a.parentNode,a)):b&&(b.d(1),b=null)},i:_e,o:_e,d(v){v&&w(e),v&&w(l),c&&c.d(v),v&&w(n),f&&f.d(v),v&&w(i),p&&p.d(v),v&&w(o),_&&_.d(v),v&&w(u),b&&b.d(v),v&&w(a)}}}function zp(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class Gp extends De{constructor(e){super(),Pe(this,e,zp,Wp,Ne,{chip:0})}}function Jf(t){let e;return{c(){e=m("div"),e.textContent="WARNING: Changing this configuration will affect basic configuration of your device. Only make changes here if instructed by vendor",r(e,"class","bd-red")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function xf(t){let e,l,n,i,o,u,a;return u=new fo({props:{chip:t[0].chip}}),{c(){e=m("div"),l=$("HAN GPIO"),n=m("br"),i=h(),o=m("select"),re(u.$$.fragment),r(o,"name","vh"),r(o,"class","in-s"),r(e,"class","my-3")},m(c,f){y(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),se(u,o,null),a=!0},p(c,f){const p={};f&1&&(p.chip=c[0].chip),u.$set(p)},i(c){a||(R(u.$$.fragment,c),a=!0)},o(c){B(u.$$.fragment,c),a=!1},d(c){c&&w(e),oe(u)}}}function Vp(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C,N,S,P,F,A,I,D,O,ie,j,K,G,Y,Q=t[0].usrcfg&&Jf();d=new Gp({props:{chip:t[0].chip}});let z=t[0].board&&t[0].board>20&&xf(t);return j=new Ht({props:{active:t[1],message:"Saving device configuration"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=h(),u=m("strong"),u.textContent="Initial configuration",a=h(),Q&&Q.c(),c=h(),f=m("div"),p=$("Board type"),_=m("br"),b=h(),v=m("select"),re(d.$$.fragment),M=h(),z&&z.c(),C=h(),N=m("div"),S=m("label"),P=m("input"),F=$(" Clear all other configuration"),A=h(),I=m("div"),I.innerHTML='',D=h(),O=m("span"),O.textContent="\xA0",ie=h(),re(j.$$.fragment),r(i,"type","hidden"),r(i,"name","v"),i.value="true",r(u,"class","text-sm"),r(v,"name","vb"),r(v,"class","in-s"),t[0].board===void 0&&Ge(()=>t[4].call(v)),r(f,"class","my-3"),r(P,"type","checkbox"),r(P,"name","vr"),P.__value="true",P.value=P.__value,r(P,"class","rounded mb-1"),r(N,"class","my-3"),r(I,"class","my-3"),r(O,"class","clear-both"),r(n,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(Z,V){y(Z,e,V),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),Q&&Q.m(n,null),s(n,c),s(n,f),s(f,p),s(f,_),s(f,b),s(f,v),se(d,v,null),Se(v,t[0].board,!0),s(n,M),z&&z.m(n,null),s(n,C),s(n,N),s(N,S),s(S,P),P.checked=t[2],s(S,F),s(n,A),s(n,I),s(n,D),s(n,O),y(Z,ie,V),se(j,Z,V),K=!0,G||(Y=[le(v,"change",t[4]),le(P,"change",t[5]),le(n,"submit",Ms(t[3]))],G=!0)},p(Z,[V]){Z[0].usrcfg?Q||(Q=Jf(),Q.c(),Q.m(n,c)):Q&&(Q.d(1),Q=null);const H={};V&1&&(H.chip=Z[0].chip),d.$set(H),V&1&&Se(v,Z[0].board),Z[0].board&&Z[0].board>20?z?(z.p(Z,V),V&1&&R(z,1)):(z=xf(Z),z.c(),R(z,1),z.m(n,C)):z&&(Ie(),B(z,1,1,()=>{z=null}),Re()),V&4&&(P.checked=Z[2]);const ee={};V&2&&(ee.active=Z[1]),j.$set(ee)},i(Z){K||(R(d.$$.fragment,Z),R(z),R(j.$$.fragment,Z),K=!0)},o(Z){B(d.$$.fragment,Z),B(z),B(j.$$.fragment,Z),K=!1},d(Z){Z&&w(e),Q&&Q.d(),oe(d),z&&z.d(),Z&&w(ie),oe(j,Z),G=!1,Ve(Y)}}}function Kp(t,e,l){let{sysinfo:n={}}=e,i=!1;async function o(f){l(1,i=!0);const p=new FormData(f.target),_=new URLSearchParams;for(let d of p){const[M,C]=d;_.append(M,C)}let v=await(await fetch("/save",{method:"POST",body:_})).json();l(1,i=!1),Yt.update(d=>(d.vndcfg=v.success,d.booting=v.reboot,d)),si(n.usrcfg?"/":"/setup")}let u=!1;function a(){n.board=nt(this),l(0,n)}function c(){u=this.checked,l(2,u),l(0,n)}return t.$$set=f=>{"sysinfo"in f&&l(0,n=f.sysinfo)},t.$$.update=()=>{t.$$.dirty&1&&l(2,u=!n.usrcfg)},[n,i,u,o,a,c]}class Yp extends De{constructor(e){super(),Pe(this,e,Kp,Vp,Ne,{sysinfo:0})}}function ec(t){let e;return{c(){e=m("option"),e.textContent="Ethernet",e.__value=3,e.value=e.__value},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function tc(t){let e,l,n,i,o,u,a,c,f,p,_,b,v;return{c(){e=m("div"),l=$("SSID"),n=m("br"),i=h(),o=m("input"),a=h(),c=m("div"),f=$("PSK"),p=m("br"),_=h(),b=m("input"),r(o,"name","ss"),r(o,"type","text"),r(o,"class","in-s"),o.required=u=t[2]==1||t[2]==2,r(e,"class","my-3"),r(b,"name","sp"),r(b,"type","password"),r(b,"class","in-s"),r(b,"autocomplete","off"),b.required=v=t[2]==2,r(c,"class","my-3")},m(d,M){y(d,e,M),s(e,l),s(e,n),s(e,i),s(e,o),y(d,a,M),y(d,c,M),s(c,f),s(c,p),s(c,_),s(c,b)},p(d,M){M&4&&u!==(u=d[2]==1||d[2]==2)&&(o.required=u),M&4&&v!==(v=d[2]==2)&&(b.required=v)},d(d){d&&w(e),d&&w(a),d&&w(c)}}}function lc(t){let e,l,n,i,o,u,a,c;return a=new xc({}),{c(){e=m("br"),l=h(),n=m("div"),i=m("input"),o=h(),u=m("select"),re(a.$$.fragment),r(i,"name","si"),r(i,"type","text"),r(i,"class","in-f w-full"),i.required=t[1],r(u,"name","su"),r(u,"class","in-l"),u.required=t[1],r(n,"class","flex")},m(f,p){y(f,e,p),y(f,l,p),y(f,n,p),s(n,i),s(n,o),s(n,u),se(a,u,null),c=!0},p(f,p){(!c||p&2)&&(i.required=f[1]),(!c||p&2)&&(u.required=f[1])},i(f){c||(R(a.$$.fragment,f),c=!0)},o(f){B(a.$$.fragment,f),c=!1},d(f){f&&w(e),f&&w(l),f&&w(n),oe(a)}}}function nc(t){let e;return{c(){e=m("div"),e.innerHTML=`
Gateway
DNS
-
`,r(e,"class","my-3 flex")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Kp(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M,N,T,P,F,A,I,D,O,ie,H,K,G,Y,Q,z,Z,V,j=t[0].if&&t[0].if.eth&&Zf(),ee=(t[2]==1||t[2]==2)&&Jf(t),ue=t[1]&&xf(t),x=t[1]&&ec();return Q=new jt({props:{active:t[3],message:"Saving your configuration to the device"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=b(),u=m("strong"),u.textContent="Setup",a=b(),c=m("div"),f=$("Connection"),p=m("br"),_=b(),h=m("select"),v=m("option"),v.textContent="Connect to WiFi",d=m("option"),d.textContent="Standalone access point",j&&j.c(),C=b(),ee&&ee.c(),M=b(),N=m("div"),T=$(`Hostname - `),P=m("input"),F=b(),A=m("div"),I=m("label"),D=m("input"),O=$(" Static IP"),ie=b(),ue&&ue.c(),H=b(),x&&x.c(),K=b(),G=m("div"),G.innerHTML='',Y=b(),re(Q.$$.fragment),r(i,"type","hidden"),r(i,"name","s"),i.value="true",r(u,"class","text-sm"),v.__value=1,v.value=v.__value,d.__value=2,d.value=d.__value,r(h,"name","sc"),r(h,"class","in-s"),t[2]===void 0&&Ke(()=>t[5].call(h)),r(c,"class","my-3"),r(P,"name","sh"),r(P,"type","text"),r(P,"class","in-s"),r(P,"maxlength","32"),r(P,"pattern","[a-z0-9_-]+"),r(P,"placeholder","Optional, ex.: ams-reader"),r(P,"autocomplete","off"),r(D,"type","checkbox"),r(D,"name","sm"),D.__value="static",D.value=D.__value,r(D,"class","rounded mb-1"),r(A,"class","my-3"),r(G,"class","my-3"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(W,U){y(W,e,U),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),s(n,c),s(c,f),s(c,p),s(c,_),s(c,h),s(h,v),s(h,d),j&&j.m(h,null),Te(h,t[2],!0),s(n,C),ee&&ee.m(n,null),s(n,M),s(n,N),s(N,T),s(N,P),ne(P,t[0].hostname),s(n,F),s(n,A),s(A,I),s(I,D),D.checked=t[1],s(I,O),s(A,ie),ue&&ue.m(A,null),s(n,H),x&&x.m(n,null),s(n,K),s(n,G),y(W,Y,U),se(Q,W,U),z=!0,Z||(V=[le(h,"change",t[5]),le(P,"input",t[6]),le(D,"change",t[7]),le(n,"submit",Ms(t[4]))],Z=!0)},p(W,[U]){W[0].if&&W[0].if.eth?j||(j=Zf(),j.c(),j.m(h,null)):j&&(j.d(1),j=null),U&4&&Te(h,W[2]),W[2]==1||W[2]==2?ee?ee.p(W,U):(ee=Jf(W),ee.c(),ee.m(n,M)):ee&&(ee.d(1),ee=null),U&1&&P.value!==W[0].hostname&&ne(P,W[0].hostname),U&2&&(D.checked=W[1]),W[1]?ue?(ue.p(W,U),U&2&&R(ue,1)):(ue=xf(W),ue.c(),R(ue,1),ue.m(A,null)):ue&&(Ie(),B(ue,1,1,()=>{ue=null}),Re()),W[1]?x||(x=ec(),x.c(),x.m(n,K)):x&&(x.d(1),x=null);const ke={};U&8&&(ke.active=W[3]),Q.$set(ke)},i(W){z||(R(ue),R(Q.$$.fragment,W),z=!0)},o(W){B(ue),B(Q.$$.fragment,W),z=!1},d(W){W&&w(e),j&&j.d(),ee&&ee.d(),ue&&ue.d(),x&&x.d(),W&&w(Y),oe(Q,W),Z=!1,Ge(V)}}}function Yp(t,e,l){let{sysinfo:n={}}=e,i=!1,o=1,u=!1,a=0;function c(){var v="";a++;var d=function(){setTimeout(c,1e3)};if(n.net.ip&&a%3==0){if(!n.net.ip){d();return}v="http://"+n.net.ip}else n.hostname&&a%3==1?v="http://"+n.hostname:n.hostname&&a%3==2?v="http://"+n.hostname+".local":v="";console&&console.log("Trying url "+v),Yt.update(M=>(M.trying=v,M));var C=new XMLHttpRequest;C.timeout=5e3,C.addEventListener("abort",d),C.addEventListener("error",d),C.addEventListener("timeout",d),C.addEventListener("load",function(M){window.location.href=v||"/"}),C.open("GET",v+"/is-alive",!0),C.send()}async function f(v){l(3,u=!0);const d=new FormData(v.target),C=new URLSearchParams;for(let T of d){const[P,F]=T;C.append(P,F)}let N=await(await fetch("/save",{method:"POST",body:C})).json();l(3,u=!1),Yt.update(T=>(T.hostname=d.get("sh"),T.usrcfg=N.success,T.booting=N.reboot,i&&(T.net.ip=d.get("si"),T.net.mask=d.get("su"),T.net.gw=d.get("sg"),T.net.dns1=d.get("sd")),setTimeout(c,5e3),T))}function p(){o=nt(this),l(2,o)}function _(){n.hostname=this.value,l(0,n)}function h(){i=this.checked,l(1,i)}return t.$$set=v=>{"sysinfo"in v&&l(0,n=v.sysinfo)},[n,i,o,u,f,p,_,h]}class Qp extends De{constructor(e){super(),Pe(this,e,Yp,Kp,$e,{sysinfo:0})}}function Xp(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M,N;return d=new jt({props:{active:t[2],message:"Uploading file, please wait"}}),{c(){e=m("div"),l=m("div"),n=m("strong"),i=$("Upload "),o=$(t[1]),u=b(),a=m("p"),a.textContent="Select a suitable file and click upload",c=b(),f=m("form"),p=m("input"),_=b(),h=m("div"),h.innerHTML='',v=b(),re(d.$$.fragment),r(a,"class","mb-4"),r(p,"name","file"),r(p,"type","file"),r(h,"class","w-full text-right mt-4"),r(f,"action",t[0]),r(f,"enctype","multipart/form-data"),r(f,"method","post"),r(f,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2")},m(T,P){y(T,e,P),s(e,l),s(l,n),s(n,i),s(n,o),s(l,u),s(l,a),s(l,c),s(l,f),s(f,p),s(f,_),s(f,h),y(T,v,P),se(d,T,P),C=!0,M||(N=le(f,"submit",t[3]),M=!0)},p(T,[P]){(!C||P&2)&&X(o,T[1]),(!C||P&1)&&r(f,"action",T[0]);const F={};P&4&&(F.active=T[2]),d.$set(F)},i(T){C||(R(d.$$.fragment,T),C=!0)},o(T){B(d.$$.fragment,T),C=!1},d(T){T&&w(e),T&&w(v),oe(d,T),M=!1,N()}}}function Zp(t,e,l){let{action:n}=e,{title:i}=e,o=!1;const u=()=>l(2,o=!0);return t.$$set=a=>{"action"in a&&l(0,n=a.action),"title"in a&&l(1,i=a.title)},[n,i,o,u]}class No extends De{constructor(e){super(),Pe(this,e,Zp,Xp,$e,{action:0,title:1})}}function Jp(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M,N,T,P,F,A,I,D,O,ie,H,K,G,Y,Q,z;return G=new jt({props:{active:t[1],message:"Saving preferences"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("div"),i.textContent="Various permissions we need to do stuff:",o=b(),u=m("hr"),a=b(),c=m("div"),f=$("Enable one-click upgrade? (implies data collection)"),p=m("br"),_=b(),h=m("a"),v=$("Read more"),d=m("br"),C=b(),M=m("label"),N=m("input"),P=$(" Yes"),F=m("label"),A=m("input"),D=$(" No"),O=m("br"),ie=b(),H=m("div"),H.innerHTML='',K=b(),re(G.$$.fragment),r(h,"href",Ut("Data-collection-on-one-click-firmware-upgrade")),r(h,"target","_blank"),r(h,"class","text-blue-600 hover:text-blue-800"),r(N,"type","radio"),r(N,"name","sf"),N.value=1,N.checked=T=t[0].fwconsent===1,r(N,"class","rounded m-2"),N.required=!0,r(A,"type","radio"),r(A,"name","sf"),A.value=2,A.checked=I=t[0].fwconsent===2,r(A,"class","rounded m-2"),A.required=!0,r(c,"class","my-3"),r(H,"class","my-3"),r(n,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-3 lg:grid-cols-2")},m(Z,V){y(Z,e,V),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),s(n,c),s(c,f),s(c,p),s(c,_),s(c,h),s(h,v),s(c,d),s(c,C),s(c,M),s(M,N),s(M,P),s(c,F),s(F,A),s(F,D),s(c,O),s(n,ie),s(n,H),y(Z,K,V),se(G,Z,V),Y=!0,Q||(z=le(n,"submit",Ms(t[2])),Q=!0)},p(Z,[V]){(!Y||V&1&&T!==(T=Z[0].fwconsent===1))&&(N.checked=T),(!Y||V&1&&I!==(I=Z[0].fwconsent===2))&&(A.checked=I);const j={};V&2&&(j.active=Z[1]),G.$set(j)},i(Z){Y||(R(G.$$.fragment,Z),Y=!0)},o(Z){B(G.$$.fragment,Z),Y=!1},d(Z){Z&&w(e),Z&&w(K),oe(G,Z),Q=!1,z()}}}function xp(t,e,l){let{sysinfo:n={}}=e,i=!1;async function o(u){l(1,i=!0);const a=new FormData(u.target),c=new URLSearchParams;for(let _ of a){const[h,v]=_;c.append(h,v)}let p=await(await fetch("/save",{method:"POST",body:c})).json();l(1,i=!1),Yt.update(_=>(_.fwconsent=a.sf===!0?1:a.sf===!1?2:0,_.booting=p.reboot,_)),si("/")}return t.$$set=u=>{"sysinfo"in u&&l(0,n=u.sysinfo)},[n,i,o]}class e_ extends De{constructor(e){super(),Pe(this,e,xp,Jp,$e,{sysinfo:0})}}function t_(t){let e,l;return e=new Gm({props:{data:t[1],sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.data=n[1]),i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function l_(t){let e,l;return e=new Np({props:{sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function n_(t){let e,l;return e=new Up({props:{sysinfo:t[0],data:t[1]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),i&2&&(o.data=n[1]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function i_(t){let e,l;return e=new No({props:{title:"CA",action:"/mqtt-ca"}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p:_e,i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function s_(t){let e,l;return e=new No({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p:_e,i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function o_(t){let e,l;return e=new No({props:{title:"private key",action:"/mqtt-key"}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p:_e,i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function r_(t){let e,l;return e=new e_({props:{sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function a_(t){let e,l;return e=new Qp({props:{sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function u_(t){let e,l;return e=new Vp({props:{sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function f_(t){let e,l,n,i,o,u,a,c,f,p,_,h,v,d,C,M,N,T,P,F;return e=new tm({props:{data:t[1]}}),n=new Tl({props:{path:"/",$$slots:{default:[t_]},$$scope:{ctx:t}}}),o=new Tl({props:{path:"/configuration",$$slots:{default:[l_]},$$scope:{ctx:t}}}),a=new Tl({props:{path:"/status",$$slots:{default:[n_]},$$scope:{ctx:t}}}),f=new Tl({props:{path:"/mqtt-ca",$$slots:{default:[i_]},$$scope:{ctx:t}}}),_=new Tl({props:{path:"/mqtt-cert",$$slots:{default:[s_]},$$scope:{ctx:t}}}),v=new Tl({props:{path:"/mqtt-key",$$slots:{default:[o_]},$$scope:{ctx:t}}}),C=new Tl({props:{path:"/consent",$$slots:{default:[r_]},$$scope:{ctx:t}}}),N=new Tl({props:{path:"/setup",$$slots:{default:[a_]},$$scope:{ctx:t}}}),P=new Tl({props:{path:"/vendor",$$slots:{default:[u_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment),l=b(),re(n.$$.fragment),i=b(),re(o.$$.fragment),u=b(),re(a.$$.fragment),c=b(),re(f.$$.fragment),p=b(),re(_.$$.fragment),h=b(),re(v.$$.fragment),d=b(),re(C.$$.fragment),M=b(),re(N.$$.fragment),T=b(),re(P.$$.fragment)},m(A,I){se(e,A,I),y(A,l,I),se(n,A,I),y(A,i,I),se(o,A,I),y(A,u,I),se(a,A,I),y(A,c,I),se(f,A,I),y(A,p,I),se(_,A,I),y(A,h,I),se(v,A,I),y(A,d,I),se(C,A,I),y(A,M,I),se(N,A,I),y(A,T,I),se(P,A,I),F=!0},p(A,I){const D={};I&2&&(D.data=A[1]),e.$set(D);const O={};I&7&&(O.$$scope={dirty:I,ctx:A}),n.$set(O);const ie={};I&5&&(ie.$$scope={dirty:I,ctx:A}),o.$set(ie);const H={};I&7&&(H.$$scope={dirty:I,ctx:A}),a.$set(H);const K={};I&4&&(K.$$scope={dirty:I,ctx:A}),f.$set(K);const G={};I&4&&(G.$$scope={dirty:I,ctx:A}),_.$set(G);const Y={};I&4&&(Y.$$scope={dirty:I,ctx:A}),v.$set(Y);const Q={};I&5&&(Q.$$scope={dirty:I,ctx:A}),C.$set(Q);const z={};I&5&&(z.$$scope={dirty:I,ctx:A}),N.$set(z);const Z={};I&5&&(Z.$$scope={dirty:I,ctx:A}),P.$set(Z)},i(A){F||(R(e.$$.fragment,A),R(n.$$.fragment,A),R(o.$$.fragment,A),R(a.$$.fragment,A),R(f.$$.fragment,A),R(_.$$.fragment,A),R(v.$$.fragment,A),R(C.$$.fragment,A),R(N.$$.fragment,A),R(P.$$.fragment,A),F=!0)},o(A){B(e.$$.fragment,A),B(n.$$.fragment,A),B(o.$$.fragment,A),B(a.$$.fragment,A),B(f.$$.fragment,A),B(_.$$.fragment,A),B(v.$$.fragment,A),B(C.$$.fragment,A),B(N.$$.fragment,A),B(P.$$.fragment,A),F=!1},d(A){oe(e,A),A&&w(l),oe(n,A),A&&w(i),oe(o,A),A&&w(u),oe(a,A),A&&w(c),oe(f,A),A&&w(p),oe(_,A),A&&w(h),oe(v,A),A&&w(d),oe(C,A),A&&w(M),oe(N,A),A&&w(T),oe(P,A)}}}function c_(t){let e,l,n,i;const o=[__,p_],u=[];function a(c,f){return c[0].trying?0:1}return e=a(t),l=u[e]=o[e](t),{c(){l.c(),n=Ve()},m(c,f){u[e].m(c,f),y(c,n,f),i=!0},p(c,f){let p=e;e=a(c),e===p?u[e].p(c,f):(Ie(),B(u[p],1,1,()=>{u[p]=null}),Re(),l=u[e],l?l.p(c,f):(l=u[e]=o[e](c),l.c()),R(l,1),l.m(n.parentNode,n))},i(c){i||(R(l),i=!0)},o(c){B(l),i=!1},d(c){u[e].d(c),c&&w(n)}}}function m_(t){let e,l;return e=new jt({props:{active:"true",message:"Device is upgrading, please wait"}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p:_e,i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function p_(t){let e,l;return e=new jt({props:{active:"true",message:"Device is booting, please wait"}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p:_e,i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function __(t){let e,l;return e=new jt({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[0].trying}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.message="Device is booting, please wait. Trying to reach it on "+n[0].trying),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function d_(t){let e,l,n,i,o,u;l=new Ac({props:{$$slots:{default:[f_]},$$scope:{ctx:t}}});const a=[m_,c_],c=[];function f(p,_){return p[0].upgrading?0:p[0].booting?1:-1}return~(i=f(t))&&(o=c[i]=a[i](t)),{c(){e=m("div"),re(l.$$.fragment),n=b(),o&&o.c(),r(e,"class","container mx-auto m-3")},m(p,_){y(p,e,_),se(l,e,null),s(e,n),~i&&c[i].m(e,null),u=!0},p(p,[_]){const h={};_&7&&(h.$$scope={dirty:_,ctx:p}),l.$set(h);let v=i;i=f(p),i===v?~i&&c[i].p(p,_):(o&&(Ie(),B(c[v],1,1,()=>{c[v]=null}),Re()),~i?(o=c[i],o?o.p(p,_):(o=c[i]=a[i](p),o.c()),R(o,1),o.m(e,null)):o=null)},i(p){u||(R(l.$$.fragment,p),R(o),u=!0)},o(p){B(l.$$.fragment,p),B(o),u=!1},d(p){p&&w(e),oe(l),~i&&c[i].d()}}}function v_(t,e,l){let n={};Yt.subscribe(o=>{l(0,n=o),n.vndcfg===!1?si("/vendor"):n.usrcfg===!1?si("/setup"):n.fwconsent===0&&si("/consent"),n.ui.k===1?(console.log("dark"),document.documentElement.classList.add("dark")):n.ui.k===0?(console.log("light"),document.documentElement.classList.remove("dark")):window.matchMedia("(prefers-color-scheme: dark)").matches?(console.log("dark auto"),document.documentElement.classList.add("dark")):(console.log("light auto"),document.documentElement.classList.remove("dark"))}),yo();let i={};return Oc.subscribe(o=>{l(1,i=o)}),[n,i]}class h_ extends De{constructor(e){super(),Pe(this,e,v_,d_,$e,{})}}new h_({target:document.getElementById("app")}); +
`,r(e,"class","my-3 flex")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Qp(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C,N,S,P,F,A,I,D,O,ie,j,K,G,Y,Q,z,Z,V,H=t[0].if&&t[0].if.eth&&ec(),ee=(t[2]==1||t[2]==2)&&tc(t),ue=t[1]&&lc(t),x=t[1]&&nc();return Q=new Ht({props:{active:t[3],message:"Saving your configuration to the device"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=h(),u=m("strong"),u.textContent="Setup",a=h(),c=m("div"),f=$("Connection"),p=m("br"),_=h(),b=m("select"),v=m("option"),v.textContent="Connect to WiFi",d=m("option"),d.textContent="Standalone access point",H&&H.c(),M=h(),ee&&ee.c(),C=h(),N=m("div"),S=$(`Hostname + `),P=m("input"),F=h(),A=m("div"),I=m("label"),D=m("input"),O=$(" Static IP"),ie=h(),ue&&ue.c(),j=h(),x&&x.c(),K=h(),G=m("div"),G.innerHTML='',Y=h(),re(Q.$$.fragment),r(i,"type","hidden"),r(i,"name","s"),i.value="true",r(u,"class","text-sm"),v.__value=1,v.value=v.__value,d.__value=2,d.value=d.__value,r(b,"name","sc"),r(b,"class","in-s"),t[2]===void 0&&Ge(()=>t[5].call(b)),r(c,"class","my-3"),r(P,"name","sh"),r(P,"type","text"),r(P,"class","in-s"),r(P,"maxlength","32"),r(P,"pattern","[a-z0-9_-]+"),r(P,"placeholder","Optional, ex.: ams-reader"),r(P,"autocomplete","off"),r(D,"type","checkbox"),r(D,"name","sm"),D.__value="static",D.value=D.__value,r(D,"class","rounded mb-1"),r(A,"class","my-3"),r(G,"class","my-3"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(W,U){y(W,e,U),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),s(n,c),s(c,f),s(c,p),s(c,_),s(c,b),s(b,v),s(b,d),H&&H.m(b,null),Se(b,t[2],!0),s(n,M),ee&&ee.m(n,null),s(n,C),s(n,N),s(N,S),s(N,P),ne(P,t[0].hostname),s(n,F),s(n,A),s(A,I),s(I,D),D.checked=t[1],s(I,O),s(A,ie),ue&&ue.m(A,null),s(n,j),x&&x.m(n,null),s(n,K),s(n,G),y(W,Y,U),se(Q,W,U),z=!0,Z||(V=[le(b,"change",t[5]),le(P,"input",t[6]),le(D,"change",t[7]),le(n,"submit",Ms(t[4]))],Z=!0)},p(W,[U]){W[0].if&&W[0].if.eth?H||(H=ec(),H.c(),H.m(b,null)):H&&(H.d(1),H=null),U&4&&Se(b,W[2]),W[2]==1||W[2]==2?ee?ee.p(W,U):(ee=tc(W),ee.c(),ee.m(n,C)):ee&&(ee.d(1),ee=null),U&1&&P.value!==W[0].hostname&&ne(P,W[0].hostname),U&2&&(D.checked=W[1]),W[1]?ue?(ue.p(W,U),U&2&&R(ue,1)):(ue=lc(W),ue.c(),R(ue,1),ue.m(A,null)):ue&&(Ie(),B(ue,1,1,()=>{ue=null}),Re()),W[1]?x||(x=nc(),x.c(),x.m(n,K)):x&&(x.d(1),x=null);const ke={};U&8&&(ke.active=W[3]),Q.$set(ke)},i(W){z||(R(ue),R(Q.$$.fragment,W),z=!0)},o(W){B(ue),B(Q.$$.fragment,W),z=!1},d(W){W&&w(e),H&&H.d(),ee&&ee.d(),ue&&ue.d(),x&&x.d(),W&&w(Y),oe(Q,W),Z=!1,Ve(V)}}}function Xp(t,e,l){let{sysinfo:n={}}=e,i=!1,o=1,u=!1,a=0;function c(){var v="";a++;var d=function(){setTimeout(c,1e3)};if(n.net.ip&&a%3==0){if(!n.net.ip){d();return}v="http://"+n.net.ip}else n.hostname&&a%3==1?v="http://"+n.hostname:n.hostname&&a%3==2?v="http://"+n.hostname+".local":v="";console&&console.log("Trying url "+v),Yt.update(C=>(C.trying=v,C));var M=new XMLHttpRequest;M.timeout=5e3,M.addEventListener("abort",d),M.addEventListener("error",d),M.addEventListener("timeout",d),M.addEventListener("load",function(C){window.location.href=v||"/"}),M.open("GET",v+"/is-alive",!0),M.send()}async function f(v){l(3,u=!0);const d=new FormData(v.target),M=new URLSearchParams;for(let S of d){const[P,F]=S;M.append(P,F)}let N=await(await fetch("/save",{method:"POST",body:M})).json();l(3,u=!1),Yt.update(S=>(S.hostname=d.get("sh"),S.usrcfg=N.success,S.booting=N.reboot,i&&(S.net.ip=d.get("si"),S.net.mask=d.get("su"),S.net.gw=d.get("sg"),S.net.dns1=d.get("sd")),setTimeout(c,5e3),S))}function p(){o=nt(this),l(2,o)}function _(){n.hostname=this.value,l(0,n)}function b(){i=this.checked,l(1,i)}return t.$$set=v=>{"sysinfo"in v&&l(0,n=v.sysinfo)},[n,i,o,u,f,p,_,b]}class Zp extends De{constructor(e){super(),Pe(this,e,Xp,Qp,Ne,{sysinfo:0})}}function Jp(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C,N;return d=new Ht({props:{active:t[2],message:"Uploading file, please wait"}}),{c(){e=m("div"),l=m("div"),n=m("strong"),i=$("Upload "),o=$(t[1]),u=h(),a=m("p"),a.textContent="Select a suitable file and click upload",c=h(),f=m("form"),p=m("input"),_=h(),b=m("div"),b.innerHTML='',v=h(),re(d.$$.fragment),r(a,"class","mb-4"),r(p,"name","file"),r(p,"type","file"),r(b,"class","w-full text-right mt-4"),r(f,"action",t[0]),r(f,"enctype","multipart/form-data"),r(f,"method","post"),r(f,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2")},m(S,P){y(S,e,P),s(e,l),s(l,n),s(n,i),s(n,o),s(l,u),s(l,a),s(l,c),s(l,f),s(f,p),s(f,_),s(f,b),y(S,v,P),se(d,S,P),M=!0,C||(N=le(f,"submit",t[3]),C=!0)},p(S,[P]){(!M||P&2)&&X(o,S[1]),(!M||P&1)&&r(f,"action",S[0]);const F={};P&4&&(F.active=S[2]),d.$set(F)},i(S){M||(R(d.$$.fragment,S),M=!0)},o(S){B(d.$$.fragment,S),M=!1},d(S){S&&w(e),S&&w(v),oe(d,S),C=!1,N()}}}function xp(t,e,l){let{action:n}=e,{title:i}=e,o=!1;const u=()=>l(2,o=!0);return t.$$set=a=>{"action"in a&&l(0,n=a.action),"title"in a&&l(1,i=a.title)},[n,i,o,u]}class Eo extends De{constructor(e){super(),Pe(this,e,xp,Jp,Ne,{action:0,title:1})}}function e_(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C,N,S,P,F,A,I,D,O,ie,j,K,G,Y,Q,z;return G=new Ht({props:{active:t[1],message:"Saving preferences"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("div"),i.textContent="Various permissions we need to do stuff:",o=h(),u=m("hr"),a=h(),c=m("div"),f=$("Enable one-click upgrade? (implies data collection)"),p=m("br"),_=h(),b=m("a"),v=$("Read more"),d=m("br"),M=h(),C=m("label"),N=m("input"),P=$(" Yes"),F=m("label"),A=m("input"),D=$(" No"),O=m("br"),ie=h(),j=m("div"),j.innerHTML='',K=h(),re(G.$$.fragment),r(b,"href",Ut("Data-collection-on-one-click-firmware-upgrade")),r(b,"target","_blank"),r(b,"class","text-blue-600 hover:text-blue-800"),r(N,"type","radio"),r(N,"name","sf"),N.value=1,N.checked=S=t[0].fwconsent===1,r(N,"class","rounded m-2"),N.required=!0,r(A,"type","radio"),r(A,"name","sf"),A.value=2,A.checked=I=t[0].fwconsent===2,r(A,"class","rounded m-2"),A.required=!0,r(c,"class","my-3"),r(j,"class","my-3"),r(n,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-3 lg:grid-cols-2")},m(Z,V){y(Z,e,V),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),s(n,c),s(c,f),s(c,p),s(c,_),s(c,b),s(b,v),s(c,d),s(c,M),s(c,C),s(C,N),s(C,P),s(c,F),s(F,A),s(F,D),s(c,O),s(n,ie),s(n,j),y(Z,K,V),se(G,Z,V),Y=!0,Q||(z=le(n,"submit",Ms(t[2])),Q=!0)},p(Z,[V]){(!Y||V&1&&S!==(S=Z[0].fwconsent===1))&&(N.checked=S),(!Y||V&1&&I!==(I=Z[0].fwconsent===2))&&(A.checked=I);const H={};V&2&&(H.active=Z[1]),G.$set(H)},i(Z){Y||(R(G.$$.fragment,Z),Y=!0)},o(Z){B(G.$$.fragment,Z),Y=!1},d(Z){Z&&w(e),Z&&w(K),oe(G,Z),Q=!1,z()}}}function t_(t,e,l){let{sysinfo:n={}}=e,i=!1;async function o(u){l(1,i=!0);const a=new FormData(u.target),c=new URLSearchParams;for(let _ of a){const[b,v]=_;c.append(b,v)}let p=await(await fetch("/save",{method:"POST",body:c})).json();l(1,i=!1),Yt.update(_=>(_.fwconsent=a.sf===!0?1:a.sf===!1?2:0,_.booting=p.reboot,_)),si("/")}return t.$$set=u=>{"sysinfo"in u&&l(0,n=u.sysinfo)},[n,i,o]}class l_ extends De{constructor(e){super(),Pe(this,e,t_,e_,Ne,{sysinfo:0})}}function n_(t){let e,l;return e=new Km({props:{data:t[1],sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.data=n[1]),i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function i_(t){let e,l;return e=new Ap({props:{sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function s_(t){let e,l;return e=new jp({props:{sysinfo:t[0],data:t[1]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),i&2&&(o.data=n[1]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function o_(t){let e,l;return e=new Eo({props:{title:"CA",action:"/mqtt-ca"}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p:_e,i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function r_(t){let e,l;return e=new Eo({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p:_e,i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function a_(t){let e,l;return e=new Eo({props:{title:"private key",action:"/mqtt-key"}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p:_e,i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function u_(t){let e,l;return e=new l_({props:{sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function f_(t){let e,l;return e=new Zp({props:{sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function c_(t){let e,l;return e=new Yp({props:{sysinfo:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function m_(t){let e,l,n,i,o,u,a,c,f,p,_,b,v,d,M,C,N,S,P,F;return e=new nm({props:{data:t[1]}}),n=new Sl({props:{path:"/",$$slots:{default:[n_]},$$scope:{ctx:t}}}),o=new Sl({props:{path:"/configuration",$$slots:{default:[i_]},$$scope:{ctx:t}}}),a=new Sl({props:{path:"/status",$$slots:{default:[s_]},$$scope:{ctx:t}}}),f=new Sl({props:{path:"/mqtt-ca",$$slots:{default:[o_]},$$scope:{ctx:t}}}),_=new Sl({props:{path:"/mqtt-cert",$$slots:{default:[r_]},$$scope:{ctx:t}}}),v=new Sl({props:{path:"/mqtt-key",$$slots:{default:[a_]},$$scope:{ctx:t}}}),M=new Sl({props:{path:"/consent",$$slots:{default:[u_]},$$scope:{ctx:t}}}),N=new Sl({props:{path:"/setup",$$slots:{default:[f_]},$$scope:{ctx:t}}}),P=new Sl({props:{path:"/vendor",$$slots:{default:[c_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment),l=h(),re(n.$$.fragment),i=h(),re(o.$$.fragment),u=h(),re(a.$$.fragment),c=h(),re(f.$$.fragment),p=h(),re(_.$$.fragment),b=h(),re(v.$$.fragment),d=h(),re(M.$$.fragment),C=h(),re(N.$$.fragment),S=h(),re(P.$$.fragment)},m(A,I){se(e,A,I),y(A,l,I),se(n,A,I),y(A,i,I),se(o,A,I),y(A,u,I),se(a,A,I),y(A,c,I),se(f,A,I),y(A,p,I),se(_,A,I),y(A,b,I),se(v,A,I),y(A,d,I),se(M,A,I),y(A,C,I),se(N,A,I),y(A,S,I),se(P,A,I),F=!0},p(A,I){const D={};I&2&&(D.data=A[1]),e.$set(D);const O={};I&7&&(O.$$scope={dirty:I,ctx:A}),n.$set(O);const ie={};I&5&&(ie.$$scope={dirty:I,ctx:A}),o.$set(ie);const j={};I&7&&(j.$$scope={dirty:I,ctx:A}),a.$set(j);const K={};I&4&&(K.$$scope={dirty:I,ctx:A}),f.$set(K);const G={};I&4&&(G.$$scope={dirty:I,ctx:A}),_.$set(G);const Y={};I&4&&(Y.$$scope={dirty:I,ctx:A}),v.$set(Y);const Q={};I&5&&(Q.$$scope={dirty:I,ctx:A}),M.$set(Q);const z={};I&5&&(z.$$scope={dirty:I,ctx:A}),N.$set(z);const Z={};I&5&&(Z.$$scope={dirty:I,ctx:A}),P.$set(Z)},i(A){F||(R(e.$$.fragment,A),R(n.$$.fragment,A),R(o.$$.fragment,A),R(a.$$.fragment,A),R(f.$$.fragment,A),R(_.$$.fragment,A),R(v.$$.fragment,A),R(M.$$.fragment,A),R(N.$$.fragment,A),R(P.$$.fragment,A),F=!0)},o(A){B(e.$$.fragment,A),B(n.$$.fragment,A),B(o.$$.fragment,A),B(a.$$.fragment,A),B(f.$$.fragment,A),B(_.$$.fragment,A),B(v.$$.fragment,A),B(M.$$.fragment,A),B(N.$$.fragment,A),B(P.$$.fragment,A),F=!1},d(A){oe(e,A),A&&w(l),oe(n,A),A&&w(i),oe(o,A),A&&w(u),oe(a,A),A&&w(c),oe(f,A),A&&w(p),oe(_,A),A&&w(b),oe(v,A),A&&w(d),oe(M,A),A&&w(C),oe(N,A),A&&w(S),oe(P,A)}}}function p_(t){let e,l,n,i;const o=[v_,d_],u=[];function a(c,f){return c[0].trying?0:1}return e=a(t),l=u[e]=o[e](t),{c(){l.c(),n=Ke()},m(c,f){u[e].m(c,f),y(c,n,f),i=!0},p(c,f){let p=e;e=a(c),e===p?u[e].p(c,f):(Ie(),B(u[p],1,1,()=>{u[p]=null}),Re(),l=u[e],l?l.p(c,f):(l=u[e]=o[e](c),l.c()),R(l,1),l.m(n.parentNode,n))},i(c){i||(R(l),i=!0)},o(c){B(l),i=!1},d(c){u[e].d(c),c&&w(n)}}}function __(t){let e,l;return e=new Ht({props:{active:"true",message:"Device is upgrading, please wait"}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p:_e,i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function d_(t){let e,l;return e=new Ht({props:{active:"true",message:"Device is booting, please wait"}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p:_e,i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function v_(t){let e,l;return e=new Ht({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[0].trying}}),{c(){re(e.$$.fragment)},m(n,i){se(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.message="Device is booting, please wait. Trying to reach it on "+n[0].trying),e.$set(o)},i(n){l||(R(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){oe(e,n)}}}function h_(t){let e,l,n,i,o,u;l=new Dc({props:{$$slots:{default:[m_]},$$scope:{ctx:t}}});const a=[__,p_],c=[];function f(p,_){return p[0].upgrading?0:p[0].booting?1:-1}return~(i=f(t))&&(o=c[i]=a[i](t)),{c(){e=m("div"),re(l.$$.fragment),n=h(),o&&o.c(),r(e,"class","container mx-auto m-3")},m(p,_){y(p,e,_),se(l,e,null),s(e,n),~i&&c[i].m(e,null),u=!0},p(p,[_]){const b={};_&7&&(b.$$scope={dirty:_,ctx:p}),l.$set(b);let v=i;i=f(p),i===v?~i&&c[i].p(p,_):(o&&(Ie(),B(c[v],1,1,()=>{c[v]=null}),Re()),~i?(o=c[i],o?o.p(p,_):(o=c[i]=a[i](p),o.c()),R(o,1),o.m(e,null)):o=null)},i(p){u||(R(l.$$.fragment,p),R(o),u=!0)},o(p){B(l.$$.fragment,p),B(o),u=!1},d(p){p&&w(e),oe(l),~i&&c[i].d()}}}function b_(t,e,l){let n={};Yt.subscribe(o=>{l(0,n=o),n.vndcfg===!1?si("/vendor"):n.usrcfg===!1?si("/setup"):n.fwconsent===0&&si("/consent"),n.ui.k===1?(console.log("dark"),document.documentElement.classList.add("dark")):n.ui.k===0?(console.log("light"),document.documentElement.classList.remove("dark")):window.matchMedia("(prefers-color-scheme: dark)").matches?(console.log("dark auto"),document.documentElement.classList.add("dark")):(console.log("light auto"),document.documentElement.classList.remove("dark"))}),Co();let i={};return qc.subscribe(o=>{l(1,i=o)}),[n,i]}class g_ extends De{constructor(e){super(),Pe(this,e,b_,h_,Ne,{})}}new g_({target:document.getElementById("app")}); diff --git a/lib/SvelteUi/app/src/lib/AmpPlot.svelte b/lib/SvelteUi/app/src/lib/AmpPlot.svelte index 0dc40547..cf8b0e2a 100644 --- a/lib/SvelteUi/app/src/lib/AmpPlot.svelte +++ b/lib/SvelteUi/app/src/lib/AmpPlot.svelte @@ -7,17 +7,18 @@ export let u3; export let i1; export let i2; + export let i2e; export let i3; export let max; let config = {}; - function point(v) { + function point(v,e) { return { label: fmtnum(v) + 'A', - title: v.toFixed(1) + ' A', + title: (e ? 'Estimated ' : '') + v.toFixed(1) + ' A', value: isNaN(v) ? 0 : v, - color: ampcol(v ? (v)/(max)*100 : 0) + color: ampcol(v ? (v)/(max)*100 : 0, e) }; }; @@ -30,13 +31,14 @@ } if(u2 > 0) { xTicks.push({ label: 'L2' }); - points.push(point(i2)); + points.push(point(i2, i2e)); } if(u3 > 0) { xTicks.push({ label: 'L3' }); points.push(point(i3)); } config = { + title: 'Amperage', padding: { top: 20, right: 15, bottom: 20, left: 35 }, y: { min: 0, diff --git a/lib/SvelteUi/app/src/lib/BarChart.svelte b/lib/SvelteUi/app/src/lib/BarChart.svelte index 6b7b4464..e1a64db6 100644 --- a/lib/SvelteUi/app/src/lib/BarChart.svelte +++ b/lib/SvelteUi/app/src/lib/BarChart.svelte @@ -9,9 +9,10 @@ let heightAvailable; let labelOffset; let vertSwitch = 30; + let titleHeight = 0; $: { - heightAvailable = height-(config.title ? 20 : 0); + heightAvailable = height-titleHeight; let innerWidth = width - (config.padding.left + config.padding.right); barWidth = innerWidth / config.points.length; labelOffset = barWidth < vertSwitch ? 30 : 15; @@ -36,7 +37,7 @@
{#if config.x.ticks && config.points && heightAvailable} {#if config.title} - {config.title} +
{config.title}
{/if} diff --git a/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte b/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte index 96363184..3008a75b 100644 --- a/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte +++ b/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte @@ -292,7 +292,7 @@
Currency
diff --git a/lib/SvelteUi/app/src/lib/Dashboard.svelte b/lib/SvelteUi/app/src/lib/Dashboard.svelte index 82437295..4a4dc6f5 100644 --- a/lib/SvelteUi/app/src/lib/Dashboard.svelte +++ b/lib/SvelteUi/app/src/lib/Dashboard.svelte @@ -63,7 +63,7 @@ {/if} {#if uiVisibility(sysinfo.ui.a, data.i1 > 0.01 || data.i2 > 0.01 || data.i3 > 0.01)}
- +
{/if} {#if uiVisibility(sysinfo.ui.r, data.ri > 0 || data.re > 0 || data.ric > 0 || data.rec > 0)} diff --git a/lib/SvelteUi/app/src/lib/Helpers.js b/lib/SvelteUi/app/src/lib/Helpers.js index 1ab3d9e2..6dc86a28 100644 --- a/lib/SvelteUi/app/src/lib/Helpers.js +++ b/lib/SvelteUi/app/src/lib/Helpers.js @@ -11,12 +11,15 @@ export function voltcol(volt) { return '#d90000'; }; -export function ampcol(pct) { - if(pct > 90) return '#d90000'; - else if(pct > 85) return'#e32100'; - else if(pct > 80) return '#ffb800'; - else if(pct > 75) return '#dcd800'; - else return '#32d900'; +export function ampcol(pct, est) { + let col; + if(pct > 90) col = '#d90000'; + else if(pct > 85) col = '#e32100'; + else if(pct > 80) col = '#ffb800'; + else if(pct > 75) col = '#dcd800'; + else col = '#32d900'; + + return col+(est?'88':''); }; export function exportcol(pct) { @@ -176,6 +179,24 @@ export function priceError(err) { return ""; } +export function httpError(err) { + switch(err) { + case 255: return "Unable to start upgrade"; + case -1: return "Connection refused"; + case -2: return "Failed to send headers"; + case -3: return "Failed to send payload"; + case -4: return "Not connected"; + case -5: return "Connection lost"; + case -6: return "No stream"; + case -7: return "Not a HTTP server"; + case -8: return "Not enough memory"; + case -9: return "Encoding error"; + case -10: return "Stream write"; + case -11: return "Read timeout"; + } + return "Unknown " + err; +} + export function isBusPowered(boardType) { switch(boardType) { case 2: @@ -243,7 +264,14 @@ export function getResetReason(sysinfo) { export function getPriceSourceName(code) { if(code == "EOE") return "ENTSO-E"; if(code == "HKS") return "hvakosterstrommen.no"; - if(code == "EDS") return "Energy Data Service"; + if(code == "EDS") return "Energi Data Service"; if(code == "MIX") return "Mixed sources"; return "Unknown (" + code + ")"; -} \ No newline at end of file +} + +export function getPriceSourceUrl(code) { + if(code == "EOE") return "https://transparency.entsoe.eu/-E"; + if(code == "HKS") return "https://www.hvakosterstrommen.no/"; + if(code == "EDS") return "https://www.energidataservice.dk/"; + return "#"; +} diff --git a/lib/SvelteUi/app/src/lib/PricePlot.svelte b/lib/SvelteUi/app/src/lib/PricePlot.svelte index 4325f4e9..da642c9e 100644 --- a/lib/SvelteUi/app/src/lib/PricePlot.svelte +++ b/lib/SvelteUi/app/src/lib/PricePlot.svelte @@ -1,5 +1,5 @@ -Provided by: {getPriceSourceName(json.source)} +Provided by: {getPriceSourceName(json.source)} diff --git a/lib/SvelteUi/app/src/lib/StatusPage.svelte b/lib/SvelteUi/app/src/lib/StatusPage.svelte index e8e96a41..0d91d42e 100644 --- a/lib/SvelteUi/app/src/lib/StatusPage.svelte +++ b/lib/SvelteUi/app/src/lib/StatusPage.svelte @@ -1,5 +1,5 @@