diff --git a/lib/CloudConnector/include/CloudConnector.h b/lib/CloudConnector/include/CloudConnector.h index b10b0efd..e150768a 100644 --- a/lib/CloudConnector/include/CloudConnector.h +++ b/lib/CloudConnector/include/CloudConnector.h @@ -59,6 +59,7 @@ public: void setEnergyAccountingConfig(EnergyAccountingConfig&); void forceUpdate(); void setConnectionHandler(ConnectionHandler* ch); + String generateSeed(); private: RemoteDebug* debugger = NULL; @@ -85,6 +86,8 @@ private: char mac[18]; char apmac[18]; + String seed = ""; + char clearBuffer[CC_BUF_SIZE]; unsigned char encryptedBuffer[256]; mbedtls_rsa_context* rsa = nullptr; diff --git a/lib/CloudConnector/src/CloudConnector.cpp b/lib/CloudConnector/src/CloudConnector.cpp index 274f9626..c3234c2f 100644 --- a/lib/CloudConnector/src/CloudConnector.cpp +++ b/lib/CloudConnector/src/CloudConnector.cpp @@ -165,8 +165,12 @@ void CloudConnector::update(AmsData& data, EnergyAccounting& ea) { int pos = 0; pos += snprintf_P(clearBuffer+pos, CC_BUF_SIZE-pos, PSTR("{\"id\":\"%s\""), uuid.c_str()); + if(!seed.isEmpty()) { + pos += snprintf_P(clearBuffer+pos, CC_BUF_SIZE-pos, PSTR(",\"seed\":\"%s\""), seed.c_str()); + } if(lastUpdate == 0) { + seed.clear(); if(mainFuse > 0 && distributionSystem > 0) { int voltage = distributionSystem == 2 ? 400 : 230; if(data.isThreePhase()) { @@ -433,3 +437,10 @@ void CloudConnector::debugPrint(byte *buffer, int start, int length) { } debugger->println(F("")); } + +String CloudConnector::generateSeed() { + uint8_t key[16]; + ESPRandom::uuid4(key); + seed = ESPRandom::uuidToString(key); + return seed; +} diff --git a/lib/SvelteUi/app/dist/index.css b/lib/SvelteUi/app/dist/index.css index 4371936e..b1f0620f 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}}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.inset-0{inset:0}.z-40{z-index:40}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.float-right{float:right}.clear-both{clear:both}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-3{margin:.75rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-bottom:.25rem;margin-top:.25rem}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.my-auto{margin-bottom:auto;margin-top:auto}.mb-1{margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-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-2\/3{width:66.666667%}.w-40{width:10rem}.w-6{width:1.5rem}.w-96{width:24rem}.w-full{width:100%}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-md{border-radius:.375rem}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity:.5}.p-2{padding:.5rem}.p-3{padding:.75rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.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}.capitalize{text-transform:capitalize}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity))}.text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity))}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hdr{--tw-bg-opacity:1;background-color:rgb(124 58 237/var(--tw-bg-opacity));border-radius:.375rem;margin-left:.5rem;margin-right:.5rem;padding:.25rem}:is(.dark .hdr){--tw-bg-opacity:1;background-color:rgb(76 29 149/var(--tw-bg-opacity))}.logo{height:2rem;width:2rem}.cnt{--tw-bg-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-radius:.25rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);margin:.5rem;padding:.5rem}:is(.dark .cnt){--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow-color:#111827;--tw-shadow:var(--tw-shadow-colored);--tw-drop-shadow:drop-shadow(0 4px 3px rgba(0,0,0,.07)) drop-shadow(0 2px 2px rgba(0,0,0,.06));background-color:rgb(31 41 55/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.cnt{min-height:268px}.gwf{height:16rem}@media (min-width:640px){.gwf{grid-column:span 2/span 2}}@media (min-width:768px){.gwf{grid-column:span 3/span 3}}@media (min-width:1024px){.gwf{grid-column:span 4/span 4}}@media (min-width:1280px){.gwf{grid-column:span 5/span 5}}@media (min-width:1536px){.gwf{grid-column:span 6/span 6}}.in-pre{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;border-width:1px 0 1px 1px;display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}:is(.dark .in-pre){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity))}.in-post{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-right-radius:.375rem;border-width:1px 1px 1px 0;display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}:is(.dark .in-post){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity))}.in-txt{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-txt:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-txt){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-txt:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-txt:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-f{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-f:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));cursor:not-allowed}:is(.dark .in-f){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-f:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-f:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-f:default{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.in-f:disabled{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .in-f)::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-f)::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-f:default){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.in-m{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-m:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-m){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-m:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-m:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-l{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;border-top-right-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-l:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-l){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-l:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-l:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}:is(.dark .in-l)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-opacity))}:is(.dark .in-l)::placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-opacity))}.in-s{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem;width:100%}.in-s:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-s){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-s:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-s:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-s::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.in-s::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-s){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.tr{text-align:right}.bd-green{background-color:rgb(22 163 74/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(202 138 4/var(--tw-bg-opacity));color:rgb(254 249 195/var(--tw-text-opacity))}.bd-red{background-color:rgb(220 38 38/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(37 99 235/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(75 85 99/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(243 244 246/var(--tw-text-opacity));font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-on{background-color:rgb(22 163 74/var(--tw-bg-opacity));color:rgb(220 252 231/var(--tw-text-opacity))}.bd-off,.bd-on{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.25rem;margin-top:auto;padding:.125rem .25rem}.bd-off{background-color:rgb(75 85 99/var(--tw-bg-opacity));color:rgb(243 244 246/var(--tw-text-opacity))}.btn-pri{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));margin-right:.75rem;padding:.5rem 1rem}.btn-red{background-color:rgb(220 38 38/var(--tw-bg-opacity))}.btn-red,.btn-yellow{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));margin-left:.5rem;padding:.5rem 1rem}.btn-yellow{background-color:rgb(202 138 4/var(--tw-bg-opacity))}.btn-pri-sm{background-color:rgb(37 99 235/var(--tw-bg-opacity))}.btn-pri-sm,.btn-yellow-sm{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));font-size:.75rem;line-height:1rem;margin-right:.75rem;padding:.25rem .5rem}.btn-yellow-sm{background-color:rgb(202 138 4/var(--tw-bg-opacity))}.pl-root{position:relative}.pl-ov{left:25%;position:absolute;text-align:center;top:27%;width:50%}.pl-val{font-size:1.7rem}.pl-unt{color:gray;font-size:1rem}:is(.dark .pl-unt){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.pl-sub{font-size:1rem;padding-top:10px}.pl-snt{color:gray;font-size:.7rem}:is(.dark .pl-snt){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.pl-lab{font-size:1rem}.chart{height:100%;margin:0 auto;width:100%}svg{position:relative;width:100%}.tick{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity));font-family:Helvetica,Arial;font-size:.85em;font-weight:200}:is(.dark .tick){fill:#fff}.tick line{stroke:#e2e2e2;stroke-dasharray:2}.tick text{fill:#999;text-anchor:start}:is(.dark .tick text){fill:#fff}.tick.tick-0 line{stroke-dasharray:0}.tick.tick-green line{stroke:#23ac05!important}.tick.tick-green text{fill:#23ac05!important}.tick.tick-orange line{stroke:#b19601!important}.tick.tick-orange text{fill:#b19601!important}.x-axis .tick text{text-anchor:middle}.bars rect{stroke:#000;stroke-opacity:.25;opacity:.9}.bars text{display:block;font-family:Helvetica,Arial;font-size:.85em;text-align:center}.hover\:text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity))}:is(.dark .dark\:bg-gray-600){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-900){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}:is(.dark .dark\:bg-opacity-80){--tw-bg-opacity:.8}:is(.dark .dark\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}@media (min-width:640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width:1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width:1536px){.\32xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}} +/*! 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}}.visible{visibility:visible}.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}.ml-6{margin-left:1.5rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-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-2\/3{width:66.666667%}.w-40{width:10rem}.w-6{width:1.5rem}.w-96{width:24rem}.w-full{width:100%}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-md{border-radius:.375rem}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity:.5}.p-2{padding:.5rem}.p-3{padding:.75rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.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}.capitalize{text-transform:capitalize}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity))}.text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity))}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hdr{--tw-bg-opacity:1;background-color:rgb(124 58 237/var(--tw-bg-opacity));border-radius:.375rem;margin-left:.5rem;margin-right:.5rem;padding:.25rem}:is(.dark .hdr){--tw-bg-opacity:1;background-color:rgb(76 29 149/var(--tw-bg-opacity))}.logo{height:2rem;width:2rem}.cnt{--tw-bg-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-radius:.25rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);margin:.5rem;padding:.5rem}:is(.dark .cnt){--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow-color:#111827;--tw-shadow:var(--tw-shadow-colored);--tw-drop-shadow:drop-shadow(0 4px 3px rgba(0,0,0,.07)) drop-shadow(0 2px 2px rgba(0,0,0,.06));background-color:rgb(31 41 55/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.cnt{min-height:268px}.gwf{height:16rem}@media (min-width:640px){.gwf{grid-column:span 2/span 2}}@media (min-width:768px){.gwf{grid-column:span 3/span 3}}@media (min-width:1024px){.gwf{grid-column:span 4/span 4}}@media (min-width:1280px){.gwf{grid-column:span 5/span 5}}@media (min-width:1536px){.gwf{grid-column:span 6/span 6}}.in-pre{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;border-width:1px 0 1px 1px;display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}:is(.dark .in-pre){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity))}.in-post{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-right-radius:.375rem;border-width:1px 1px 1px 0;display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}:is(.dark .in-post){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity))}.in-txt{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-txt:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-txt){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-txt:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-txt:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-f{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-f:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));cursor:not-allowed}:is(.dark .in-f){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-f:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-f:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-f:default{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.in-f:disabled{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .in-f)::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-f)::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-f:default){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.in-m{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-m:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-m){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-m:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-m:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-l{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;border-top-right-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-l:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-l){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(255 255 255/var(--tw-text-opacity));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-l:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-l:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}:is(.dark .in-l)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-opacity))}:is(.dark .in-l)::placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-opacity))}.in-s{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem;width:100%}.in-s:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity));cursor:not-allowed}:is(.dark .in-s){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);--tw-drop-shadow:drop-shadow(0 10px 8px rgba(0,0,0,.04)) drop-shadow(0 4px 3px rgba(0,0,0,.1));background-color:rgb(55 65 81/var(--tw-bg-opacity));border-color:rgb(31 41 55/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:is(.dark .in-s:focus){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}:is(.dark .in-s:disabled){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.in-s::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.in-s::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}:is(.dark .in-s){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.tr{text-align:right}.bd-green{background-color:rgb(22 163 74/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(202 138 4/var(--tw-bg-opacity));color:rgb(254 249 195/var(--tw-text-opacity))}.bd-red{background-color:rgb(220 38 38/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(37 99 235/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(75 85 99/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(243 244 246/var(--tw-text-opacity));font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-on{background-color:rgb(22 163 74/var(--tw-bg-opacity));color:rgb(220 252 231/var(--tw-text-opacity))}.bd-off,.bd-on{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.25rem;margin-top:auto;padding:.125rem .25rem}.bd-off{background-color:rgb(75 85 99/var(--tw-bg-opacity));color:rgb(243 244 246/var(--tw-text-opacity))}.btn-pri{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));margin-right:.75rem;padding:.5rem 1rem}.btn-red{background-color:rgb(220 38 38/var(--tw-bg-opacity))}.btn-red,.btn-yellow{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));margin-left:.5rem;padding:.5rem 1rem}.btn-yellow{background-color:rgb(202 138 4/var(--tw-bg-opacity))}.btn-pri-sm{background-color:rgb(37 99 235/var(--tw-bg-opacity))}.btn-pri-sm,.btn-yellow-sm{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));font-size:.75rem;line-height:1rem;margin-right:.75rem;padding:.25rem .5rem}.btn-yellow-sm{background-color:rgb(202 138 4/var(--tw-bg-opacity))}.pl-root{position:relative}.pl-ov{left:25%;position:absolute;text-align:center;top:27%;width:50%}.pl-val{font-size:1.7rem}.pl-unt{color:gray;font-size:1rem}:is(.dark .pl-unt){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.pl-sub{font-size:1rem;padding-top:10px}.pl-snt{color:gray;font-size:.7rem}:is(.dark .pl-snt){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.pl-lab{font-size:1rem}.chart{height:100%;margin:0 auto;width:100%}svg{position:relative;width:100%}.tick{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity));font-family:Helvetica,Arial;font-size:.85em;font-weight:200}:is(.dark .tick){fill:#fff}.tick line{stroke:#e2e2e2;stroke-dasharray:2}.tick text{fill:#999;text-anchor:start}:is(.dark .tick text){fill:#fff}.tick.tick-0 line{stroke-dasharray:0}.tick.tick-green line{stroke:#23ac05!important}.tick.tick-green text{fill:#23ac05!important}.tick.tick-orange line{stroke:#b19601!important}.tick.tick-orange text{fill:#b19601!important}.x-axis .tick text{text-anchor:middle}.bars rect{stroke:#000;stroke-opacity:.25;opacity:.9}.bars text{display:block;font-family:Helvetica,Arial;font-size:.85em;text-align:center}.hover\:text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity))}:is(.dark .dark\:bg-gray-600){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-900){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}:is(.dark .dark\:bg-opacity-80){--tw-bg-opacity:.8}:is(.dark .dark\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}@media (min-width:640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width:1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width:1536px){.\32xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}} diff --git a/lib/SvelteUi/app/dist/index.js b/lib/SvelteUi/app/dist/index.js index b1cea584..fc9fdf0e 100644 --- a/lib/SvelteUi/app/dist/index.js +++ b/lib/SvelteUi/app/dist/index.js @@ -1,7 +1,7 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).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 Xe(){}function Pl(t,e){for(const l in e)t[l]=e[l];return t}function Lf(t){return t()}function ps(){return Object.create(null)}function zt(t){t.forEach(Lf)}function ji(t){return typeof t=="function"}function Nt(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ei;function ai(t,e){return ei||(ei=document.createElement("a")),ei.href=e,t===ei.href}function Pu(t){return Object.keys(t).length===0}function Hi(t,...e){if(t==null)return Xe;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function un(t){let e;return Hi(t,l=>e=l)(),e}function Dl(t,e,l){t.$$.on_destroy.push(Hi(e,l))}function yi(t,e,l,n){if(t){const i=Of(t,e,l,n);return t[0](i)}}function Of(t,e,l,n){return t[1]&&n?Pl(l.ctx.slice(),t[1](n(e))):l.ctx}function zi(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=[],a=Math.max(e.dirty.length,i.length);for(let c=0;c32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function _n(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 qu=["width","height"];function rn(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&&qu.indexOf(n)===-1?t[n]=e[n]:r(t,n,e[n])}function st(t){return t===""?null:+t}function Du(t){return Array.from(t.childNodes)}function D(t,e){e=""+e,t.data!==e&&(t.data=e)}function Lu(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Ou(t,e,l){~Au.indexOf(l)?Lu(t,e):D(t,e)}function Ee(t,e){t.value=e==null?"":e}function Gn(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function ot(t,e,l){for(let n=0;n{a.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=ve(n.contentWindow,"resize",e),e()}),s(t,n),()=>{(i||o&&n.contentWindow)&&o(),A(n)}}function Ru(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,l,n,e),i}function ds(t,e){return new t(e)}let Yn;function Vn(t){Yn=t}function Zn(){if(!Yn)throw new Error("Function called outside component initialization");return Yn}function If(t){Zn().$$.on_mount.push(t)}function Fu(t){Zn().$$.on_destroy.push(t)}function Uu(){const t=Zn();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=Ru(e,l,{cancelable:n});return i.slice().forEach(a=>{a.call(t,o)}),!o.defaultPrevented}return!0}}function Kn(t,e){return Zn().$$.context.set(t,e),e}function Kl(t){return Zn().$$.context.get(t)}const on=[],ri=[];let an=[];const vs=[],Rf=Promise.resolve();let Mi=!1;function Ff(){Mi||(Mi=!0,Rf.then(Uf))}function Bu(){return Ff(),Rf}function Gt(t){an.push(t)}const di=new Set;let nn=0;function Uf(){if(nn!==0)return;const t=Yn;do{try{for(;nnt.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),an=e}const si=new Set;let Xl;function gt(){Xl={r:0,c:[],p:Xl}}function kt(){Xl.r||zt(Xl.c),Xl=Xl.p}function $(t,e){t&&t.i&&(si.delete(t),t.i(e))}function fe(t,e,l,n){if(t&&t.o){if(si.has(t))return;si.add(t),Xl.c.push(()=>{si.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function Bf(t,e){const l={},n={},i={$$scope:1};let o=t.length;for(;o--;){const a=t[o],c=e[o];if(c){for(const _ in a)_ in c||(n[_]=1);for(const _ in c)i[_]||(l[_]=c[_],i[_]=1);t[o]=c}else for(const _ in a)i[_]=1}for(const a in n)a in l||(l[a]=void 0);return l}function hs(t){return typeof t=="object"&&t!==null?t:{}}function Re(t){t&&t.c()}function De(t,e,l,n){const{fragment:i,after_update:o}=t.$$;i&&i.m(e,l),n||Gt(()=>{const a=t.$$.on_mount.map(Lf).filter(ji);t.$$.on_destroy?t.$$.on_destroy.push(...a):zt(a),t.$$.on_mount=[]}),o.forEach(Gt)}function Le(t,e){const l=t.$$;l.fragment!==null&&(Hu(l.after_update),zt(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function yu(t,e){t.$$.dirty[0]===-1&&(on.push(t),Ff(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const h=v.length?v[0]:d;return u.ctx&&i(u.ctx[p],u.ctx[p]=h)&&(!u.skip_bound&&u.bound[p]&&u.bound[p](h),f&&yu(t,p)),d}):[],u.update(),f=!0,zt(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const p=Du(e.target);u.fragment&&u.fragment.l(p),p.forEach(A)}else u.fragment&&u.fragment.c();e.intro&&$(t.$$.fragment),De(t,e.target,e.anchor,e.customElement),Uf()}Vn(_)}class Dt{$destroy(){Le(this,1),this.$destroy=Xe}$on(e,l){if(!ji(l))return Xe;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&&!Pu(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const bs=t=>typeof t>"u",jf=t=>typeof t=="function",Hf=t=>typeof t=="number";function zu(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function yf(){let t=0;return()=>t++}function Wu(){return Math.random().toString(36).substring(2)}const Yl=typeof window>"u";function zf(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const Wf=(t,e)=>t?{}:{style:e},Si=t=>({"aria-hidden":"true",...Wf(t,"display:none;")}),sn=[];function Gf(t,e){return{subscribe:xt(t,e).subscribe}}function xt(t,e=Xe){let l;const n=new Set;function i(c){if(Nt(t,c)&&(t=c,l)){const _=!sn.length;for(const u of n)u[1](),sn.push(u,t);if(_){for(let u=0;u{n.delete(u),n.size===0&&l&&(l(),l=null)}}return{set:i,update:o,subscribe:a}}function Gu(t,e,l){const n=!Array.isArray(t),i=n?[t]:t,o=e.length<2;return Gf(l,a=>{let c=!1;const _=[];let u=0,f=Xe;const p=()=>{if(u)return;f();const v=e(n?_[0]:_,a);o?a(v):f=ji(v)?v:Xe},d=i.map((v,h)=>Hi(v,k=>{_[h]=k,u&=~(1<{u|=1<`@@svnav-ctx__${t}`,Ci=Jn("LOCATION"),cn=Jn("ROUTER"),Vf=Jn("ROUTE"),Vu=Jn("ROUTE_PARAMS"),Ku=Jn("FOCUS_ELEM"),Kf=/^:(.+)/,yn=(t,e,l)=>t.substr(e,l),Ni=(t,e)=>yn(t,0,e.length)===e,Yu=t=>t==="",Qu=t=>Kf.test(t),Yf=t=>t[0]==="*",Xu=t=>t.replace(/\*.*$/,""),Qf=t=>t.replace(/(^\/+|\/+$)/g,"");function Ol(t,e=!1){const l=Qf(t).split("/");return e?l.filter(Boolean):l}const vi=(t,e)=>t+(e?`?${e}`:""),Ki=t=>`/${Qf(t)}`;function $n(...t){const e=n=>Ol(n,!0).join("/"),l=t.map(e).join("/");return Ki(l)}const Yi=1,pi=2,tn=3,Zu=4,Xf=5,Ju=6,Zf=7,$u=8,xu=9,Jf=10,$f=11,er={[Yi]:"Link",[pi]:"Route",[tn]:"Router",[Zu]:"useFocus",[Xf]:"useLocation",[Ju]:"useMatch",[Zf]:"useNavigate",[$u]:"useParams",[xu]:"useResolvable",[Jf]:"useResolve",[$f]:"navigate"},Qi=t=>er[t];function tr(t,e){let l;return t===pi?l=e.path?`path="${e.path}"`:"default":t===Yi?l=`to="${e.to}"`:t===tn&&(l=`basepath="${e.basepath||""}"`),`<${Qi(t)} ${l||""} />`}function lr(t,e,l,n){const i=l&&tr(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 a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).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 Ze(){}function Al(t,e){for(const l in e)t[l]=e[l];return t}function Of(t){return t()}function ps(){return Object.create(null)}function zt(t){t.forEach(Of)}function ji(t){return typeof t=="function"}function Nt(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ei;function ai(t,e){return ei||(ei=document.createElement("a")),ei.href=e,t===ei.href}function Au(t){return Object.keys(t).length===0}function Hi(t,...e){if(t==null)return Ze;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function un(t){let e;return Hi(t,l=>e=l)(),e}function Dl(t,e,l){t.$$.on_destroy.push(Hi(e,l))}function yi(t,e,l,n){if(t){const i=If(t,e,l,n);return t[0](i)}}function If(t,e,l,n){return t[1]&&n?Al(l.ctx.slice(),t[1](n(e))):l.ctx}function zi(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=[],a=Math.max(e.dirty.length,i.length);for(let r=0;r32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function _n(t){return function(e){return e.preventDefault(),t.call(this,e)}}function u(t,e,l){l==null?t.removeAttribute(e):t.getAttribute(e)!==l&&t.setAttribute(e,l)}const Du=["width","height"];function rn(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&&Du.indexOf(n)===-1?t[n]=e[n]:u(t,n,e[n])}function at(t){return t===""?null:+t}function Lu(t){return Array.from(t.childNodes)}function L(t,e){e=""+e,t.data!==e&&(t.data=e)}function Ou(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Iu(t,e,l){~qu.indexOf(l)?Ou(t,e):L(t,e)}function Te(t,e){t.value=e==null?"":e}function Gn(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function ft(t,e,l){for(let n=0;n{a.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=ve(n.contentWindow,"resize",e),e()}),s(t,n),()=>{(i||o&&n.contentWindow)&&o(),A(n)}}function Fu(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,l,n,e),i}function ds(t,e){return new t(e)}let Yn;function Vn(t){Yn=t}function Zn(){if(!Yn)throw new Error("Function called outside component initialization");return Yn}function Rf(t){Zn().$$.on_mount.push(t)}function Bu(t){Zn().$$.on_destroy.push(t)}function Uu(){const t=Zn();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=Fu(e,l,{cancelable:n});return i.slice().forEach(a=>{a.call(t,o)}),!o.defaultPrevented}return!0}}function Kn(t,e){return Zn().$$.context.set(t,e),e}function Kl(t){return Zn().$$.context.get(t)}const on=[],ri=[];let an=[];const vs=[],Ff=Promise.resolve();let Mi=!1;function Bf(){Mi||(Mi=!0,Ff.then(Uf))}function ju(){return Bf(),Ff}function Gt(t){an.push(t)}const di=new Set;let nn=0;function Uf(){if(nn!==0)return;const t=Yn;do{try{for(;nnt.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),an=e}const si=new Set;let Xl;function gt(){Xl={r:0,c:[],p:Xl}}function kt(){Xl.r||zt(Xl.c),Xl=Xl.p}function $(t,e){t&&t.i&&(si.delete(t),t.i(e))}function oe(t,e,l,n){if(t&&t.o){if(si.has(t))return;si.add(t),Xl.c.push(()=>{si.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function jf(t,e){const l={},n={},i={$$scope:1};let o=t.length;for(;o--;){const a=t[o],r=e[o];if(r){for(const c in a)c in r||(n[c]=1);for(const c in r)i[c]||(l[c]=r[c],i[c]=1);t[o]=r}else for(const c in a)i[c]=1}for(const a in n)a in l||(l[a]=void 0);return l}function hs(t){return typeof t=="object"&&t!==null?t:{}}function Re(t){t&&t.c()}function De(t,e,l,n){const{fragment:i,after_update:o}=t.$$;i&&i.m(e,l),n||Gt(()=>{const a=t.$$.on_mount.map(Of).filter(ji);t.$$.on_destroy?t.$$.on_destroy.push(...a):zt(a),t.$$.on_mount=[]}),o.forEach(Gt)}function Le(t,e){const l=t.$$;l.fragment!==null&&(yu(l.after_update),zt(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function zu(t,e){t.$$.dirty[0]===-1&&(on.push(t),Bf(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const h=v.length?v[0]:d;return f.ctx&&i(f.ctx[m],f.ctx[m]=h)&&(!f.skip_bound&&f.bound[m]&&f.bound[m](h),_&&zu(t,m)),d}):[],f.update(),_=!0,zt(f.before_update),f.fragment=n?n(f.ctx):!1,e.target){if(e.hydrate){const m=Lu(e.target);f.fragment&&f.fragment.l(m),m.forEach(A)}else f.fragment&&f.fragment.c();e.intro&&$(t.$$.fragment),De(t,e.target,e.anchor,e.customElement),Uf()}Vn(c)}class qt{$destroy(){Le(this,1),this.$destroy=Ze}$on(e,l){if(!ji(l))return Ze;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&&!Au(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const bs=t=>typeof t>"u",Hf=t=>typeof t=="function",yf=t=>typeof t=="number";function Wu(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function zf(){let t=0;return()=>t++}function Gu(){return Math.random().toString(36).substring(2)}const Yl=typeof window>"u";function Wf(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const Gf=(t,e)=>t?{}:{style:e},Si=t=>({"aria-hidden":"true",...Gf(t,"display:none;")}),sn=[];function Vf(t,e){return{subscribe:ll(t,e).subscribe}}function ll(t,e=Ze){let l;const n=new Set;function i(r){if(Nt(t,r)&&(t=r,l)){const c=!sn.length;for(const f of n)f[1](),sn.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:a}}function Vu(t,e,l){const n=!Array.isArray(t),i=n?[t]:t,o=e.length<2;return Vf(l,a=>{let r=!1;const c=[];let f=0,_=Ze;const m=()=>{if(f)return;_();const v=e(n?c[0]:c,a);o?a(v):_=ji(v)?v:Ze},d=i.map((v,h)=>Hi(v,k=>{c[h]=k,f&=~(1<{f|=1<`@@svnav-ctx__${t}`,Ci=Jn("LOCATION"),cn=Jn("ROUTER"),Kf=Jn("ROUTE"),Ku=Jn("ROUTE_PARAMS"),Yu=Jn("FOCUS_ELEM"),Yf=/^:(.+)/,yn=(t,e,l)=>t.substr(e,l),Ni=(t,e)=>yn(t,0,e.length)===e,Qu=t=>t==="",Xu=t=>Yf.test(t),Qf=t=>t[0]==="*",Zu=t=>t.replace(/\*.*$/,""),Xf=t=>t.replace(/(^\/+|\/+$)/g,"");function Ol(t,e=!1){const l=Xf(t).split("/");return e?l.filter(Boolean):l}const vi=(t,e)=>t+(e?`?${e}`:""),Ki=t=>`/${Xf(t)}`;function $n(...t){const e=n=>Ol(n,!0).join("/"),l=t.map(e).join("/");return Ki(l)}const Yi=1,pi=2,tn=3,Ju=4,Zf=5,$u=6,Jf=7,xu=8,er=9,$f=10,xf=11,tr={[Yi]:"Link",[pi]:"Route",[tn]:"Router",[Ju]:"useFocus",[Zf]:"useLocation",[$u]:"useMatch",[Jf]:"useNavigate",[xu]:"useParams",[er]:"useResolvable",[$f]:"useResolve",[xf]:"navigate"},Qi=t=>tr[t];function lr(t,e){let l;return t===pi?l=e.path?`path="${e.path}"`:"default":t===Yi?l=`to="${e.to}"`:t===tn&&(l=`basepath="${e.basepath||""}"`),`<${Qi(t)} ${l||""} />`}function nr(t,e,l,n){const i=l&&lr(n||t,l),o=i?` -Occurred in: ${i}`:"",a=Qi(t),c=jf(e)?e(a):e;return`<${a}> ${c}${o}`}const xf=t=>(...e)=>t(lr(...e)),eu=xf(t=>{throw new Error(t)}),ci=xf(console.warn),gs=4,nr=3,ir=2,sr=1,or=1;function ar(t,e){const l=t.default?0:Ol(t.fullPath).reduce((n,i)=>{let o=n;return o+=gs,Yu(i)?o+=or:Qu(i)?o+=ir:Yf(i)?o-=gs+sr:o+=nr,o},0);return{route:t,score:l,index:e}}function fr(t){return t.map(ar).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function tu(t,e){let l,n;const[i]=e.split("?"),o=Ol(i),a=o[0]==="",c=fr(t);for(let _=0,u=c.length;_({...f,params:d,uri:T});if(f.default){n=v(e);continue}const h=Ol(f.fullPath),k=Math.max(o.length,h.length);let g=0;for(;g{u===".."?_.pop():u!=="."&&_.push(u)}),vi(`/${_.join("/")}`,n)}function ks(t,e){const{pathname:l,hash:n="",search:i="",state:o}=t,a=Ol(e,!0),c=Ol(l,!0);for(;a.length;)a[0]!==c[0]&&eu(tn,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),a.shift(),c.shift();return{pathname:$n(...c),hash:n,search:i,state:o}}const ws=t=>t.length===1?"":t,Xi=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,o=i?ws(yn(t,l)):"",a=i?yn(t,0,l):t,c=n?ws(yn(a,e)):"";return{pathname:(n?yn(a,0,e):a)||"/",search:c,hash:o}},rr=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function cr(t,e,l){return $n(l,ur(t,e))}function _r(t,e){const l=Ki(Xu(t)),n=Ol(l,!0),i=Ol(e,!0).slice(0,n.length),o=lu({fullPath:l},$n(...i));return o&&o.uri}const hi="POP",mr="PUSH",pr="REPLACE";function bi(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function dr(t){let e=[],l=bi(t),n=hi;const i=(o=e)=>o.forEach(a=>a({location:l,action:n}));return{get location(){return l},listen(o){e.push(o);const a=()=>{l=bi(t),n=hi,i([o])};i([o]);const c=zf(t,"popstate",a);return()=>{c(),e=e.filter(_=>_!==o)}},navigate(o,a){const{state:c={},replace:_=!1}=a||{};if(n=_?pr:mr,Hf(o))a&&ci($f,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=hi,t.history.go(o);else{const u={...c,_key:Wu()};try{t.history[_?"replaceState":"pushState"](u,"",o)}catch{t.location[_?"replace":"assign"](o)}}l=bi(t),i()}}}function gi(t,e){return{...Xi(e),state:t}}function vr(t="/"){let e=0,l=[gi(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(gi(n,o))},replaceState(n,i,o){l[e]=gi(n,o)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const hr=!!(!Yl&&window.document&&window.document.createElement),br=!Yl&&window.location.origin==="null",nu=dr(hr&&!br?window:vr()),{navigate:en}=nu;let Il=null,iu=!0;function gr(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nIl.level||t.level===Il.level&&gr(t.routerId,Il.routerId))&&(Il=t)}function wr(){Il=null}function Mr(){iu=!1}function Ms(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=zf(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function Sr(t,e){return Number(t.dataset.svnavRouteEnd)===e}function Cr(t){return/^H[1-6]$/i.test(t.tagName)}function Ss(t,e=document){return e.querySelector(t)}function Nr(t){let l=Ss(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!Sr(l,t);){if(Cr(l))return l;const n=Ss("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function Tr(t){Promise.resolve(un(t.focusElement)).then(e=>{const l=e||Nr(t.id);l||ci(tn,`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,pi),!Ms(l)&&Ms(document.documentElement)})}const Er=(t,e,l)=>(n,i)=>Bu().then(()=>{if(!Il||iu){Mr();return}if(n&&Tr(Il.route),t.announcements&&i){const{path:o,fullPath:a,meta:c,params:_,uri:u}=Il.route,f=t.createAnnouncement({path:o,fullPath:a,meta:c,params:_,uri:u},un(l));Promise.resolve(f).then(p=>{e.set(p)})}wr()}),Pr="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 Ar(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},Wf(t[6],Pr)],i={};for(let o=0;o`Navigated to ${Z.uri}`,announcements:!0,...h},T=f,O=Ki(f),E=Kl(Ci),I=Kl(cn),N=!E,B=Dr(),S=v&&!(I&&!I.manageFocus),U=xt("");Dl(t,U,Z=>l(0,c=Z));const z=I?I.disableInlineStyles:k,V=xt([]);Dl(t,V,Z=>l(20,a=Z));const F=xt(null);Dl(t,F,Z=>l(18,i=Z));let R=!1;const G=N?0:I.level+1,H=N?xt((()=>ks(Yl?Xi(p):d.location,O))()):E;Dl(t,H,Z=>l(17,n=Z));const W=xt(n);Dl(t,W,Z=>l(19,o=Z));const K=Er(g,U,H),Q=Z=>X=>X.filter(oe=>oe.id!==Z);function J(Z){if(Yl){if(R)return;const X=lu(Z,n.pathname);if(X)return R=!0,X}else V.update(X=>{const oe=Q(Z.id)(X);return oe.push(Z),oe})}function ae(Z){V.update(Q(Z))}return!N&&f!==Cs&&ci(tn,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:f}),N&&(If(()=>d.listen(X=>{const oe=ks(X.location,O);W.set(n),H.set(oe)})),Kn(Ci,H)),Kn(cn,{activeRoute:F,registerRoute:J,unregisterRoute:ae,manageFocus:S,level:G,id:B,history:N?d:I.history,basepath:N?O:I.basepath,disableInlineStyles:z}),t.$$set=Z=>{"basepath"in Z&&l(11,f=Z.basepath),"url"in Z&&l(12,p=Z.url),"history"in Z&&l(13,d=Z.history),"primary"in Z&&l(14,v=Z.primary),"a11y"in Z&&l(15,h=Z.a11y),"disableInlineStyles"in Z&&l(16,k=Z.disableInlineStyles),"$$scope"in Z&&l(21,u=Z.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&f!==T&&ci(tn,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const Z=tu(a,n.pathname);F.set(Z)}if(t.$$.dirty[0]&655360&&N){const Z=!!n.hash,X=!Z&&S,oe=!Z||n.pathname!==o.pathname;K(X,oe)}t.$$.dirty[0]&262144&&S&&i&&i.primary&&kr({level:G,routerId:B,route:i})},[c,g,N,B,S,U,z,V,F,H,W,f,p,d,v,h,k,n,i,o,a,u,_]}class Or extends Dt{constructor(e){super(),qt(this,e,Lr,qr,Nt,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const su=Or;function xn(t,e,l=cn,n=tn){Kl(l)||eu(t,o=>`You cannot use ${o} outside of a ${Qi(n)}.`,e)}const Ir=t=>{const{subscribe:e}=Kl(t);return{subscribe:e}};function ou(){return xn(Xf),Ir(Ci)}function au(){const{history:t}=Kl(cn);return t}function fu(){const t=Kl(Vf);return t?Gu(t,e=>e.base):xt("/")}function uu(){xn(Jf);const t=fu(),{basepath:e}=Kl(cn);return n=>cr(n,un(t),e)}function Rr(){xn(Zf);const t=uu(),{navigate:e}=au();return(n,i)=>{const o=Hf(n)?n:t(n);return e(o,i)}}const Fr=t=>({params:t&16,location:t&8}),Ns=t=>({params:Yl?un(t[10]):t[4],location:t[3],navigate:t[11]});function Ts(t){let e,l;return e=new su({props:{primary:t[1],$$slots:{default:[jr]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(n,i){De(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||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Ur(t){let e;const l=t[18].default,n=yi(l,t,t[19],Ns);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&524312)&&Wi(n,l,i,i[19],e?zi(l,i[19],o,Fr):Gi(i[19]),Ns)},i(i){e||($(n,i),e=!0)},o(i){fe(n,i),e=!1},d(i){n&&n.d(i)}}}function Br(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},Yl?un(t[10]):t[4],t[12]];var o=t[0];function a(c){let _={};for(let u=0;u{Le(f,1)}),kt()}o?(e=ds(o,a()),Re(e.$$.fragment),$(e.$$.fragment,1),De(e,l.parentNode,l)):e=null}else o&&e.$set(u)},i(c){n||(e&&$(e.$$.fragment,c),n=!0)},o(c){e&&fe(e.$$.fragment,c),n=!1},d(c){c&&A(l),e&&Le(e,c)}}}function jr(t){let e,l,n,i;const o=[Br,Ur],a=[];function c(_,u){return _[0]!==null?0:1}return e=c(t),l=a[e]=o[e](t),{c(){l.c(),n=Qt()},m(_,u){a[e].m(_,u),q(_,n,u),i=!0},p(_,u){let f=e;e=c(_),e===f?a[e].p(_,u):(gt(),fe(a[f],1,1,()=>{a[f]=null}),kt(),l=a[e],l?l.p(_,u):(l=a[e]=o[e](_),l.c()),$(l,1),l.m(n.parentNode,n))},i(_){i||($(l),i=!0)},o(_){fe(l),i=!1},d(_){a[e].d(_),_&&A(n)}}}function Hr(t){let e,l,n,i,o,a=[Si(t[7]),{"data-svnav-route-start":t[5]}],c={};for(let p=0;p{_=null}),kt())},i(p){o||($(_),o=!0)},o(p){fe(_),o=!1},d(p){p&&A(e),p&&A(l),_&&_.d(p),p&&A(n),p&&A(i)}}}const yr=yf();function zr(t,e,l){let n;const i=["path","component","meta","primary"];let o=ui(e,i),a,c,_,u,{$$slots:f={},$$scope:p}=e,{path:d=""}=e,{component:v=null}=e,{meta:h={}}=e,{primary:k=!0}=e;xn(pi,e);const g=yr(),{registerRoute:T,unregisterRoute:O,activeRoute:E,disableInlineStyles:I}=Kl(cn);Dl(t,E,R=>l(16,a=R));const N=fu();Dl(t,N,R=>l(17,_=R));const B=ou();Dl(t,B,R=>l(3,c=R));const S=xt(null);let U;const z=xt(),V=xt({});Dl(t,V,R=>l(4,u=R)),Kn(Vf,z),Kn(Vu,V),Kn(Ku,S);const F=Rr();return Yl||Fu(()=>O(g)),t.$$set=R=>{l(24,e=Pl(Pl({},e),fi(R))),l(12,o=ui(e,i)),"path"in R&&l(13,d=R.path),"component"in R&&l(0,v=R.component),"meta"in R&&l(14,h=R.meta),"primary"in R&&l(1,k=R.primary),"$$scope"in R&&l(19,p=R.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const R=d==="",G=$n(_,d),j={id:g,path:d,meta:h,default:R,fullPath:R?"":G,base:R?_:_r(G,c.pathname),primary:k,focusElement:S};z.set(j),l(15,U=T(j))}if(t.$$.dirty&98304&&l(2,n=!!(U||a&&a.id===g)),t.$$.dirty&98308&&n){const{params:R}=U||a;V.set(R)}},e=fi(e),[v,k,n,c,u,g,E,I,N,B,V,F,o,d,h,U,a,_,f,p]}class Wr extends Dt{constructor(e){super(),qt(this,e,zr,Hr,Nt,{path:13,component:0,meta:14,primary:1})}}const ql=Wr;function Gr(t){let e,l,n,i;const o=t[13].default,a=yi(o,t,t[12],null);let c=[{href:t[0]},t[2],t[1]],_={};for(let u=0;ul(11,p=S));const E=Uu(),I=uu(),{navigate:N}=au();function B(S){E("click",S),zu(S)&&(S.preventDefault(),N(n,{state:g,replace:a||k}))}return t.$$set=S=>{l(19,e=Pl(Pl({},e),fi(S))),l(18,f=ui(e,u)),"to"in S&&l(5,h=S.to),"replace"in S&&l(6,k=S.replace),"state"in S&&l(7,g=S.state),"getProps"in S&&l(8,T=S.getProps),"$$scope"in S&&l(12,v=S.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=I(h,p)),t.$$.dirty&2049&&l(10,i=Ni(p.pathname,n)),t.$$.dirty&2049&&l(9,o=n===p.pathname),t.$$.dirty&2049&&(a=Xi(n)===rr(p)),t.$$.dirty&512&&l(2,c=o?{"aria-current":"page"}:{}),l(1,_=(()=>{if(jf(T)){const S=T({location:p,href:n,isPartiallyCurrent:i,isCurrent:o});return{...f,...S}}return f})())},e=fi(e),[n,_,c,O,B,h,k,g,T,o,i,p,v,d]}class Kr extends Dt{constructor(e){super(),qt(this,e,Vr,Gr,Nt,{to:5,replace:6,state:7,getProps:8})}}const Ml=Kr;function Vl(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function Yr(t,e){return t>218&&t<242?"#23ac05":t>212&&t<248?"#b1d900":t>208&&t<252?"#a3b200":"#b20000"}function Zi(t,e){let l;return t>90?l="#b20000":t>85?l="#b19601":t>80?l="#a3b200":t>75?l="#569f12":l="#23ac05",l}function Qn(t){return t>75?"#23ac05":t>50?"#77d900":t>25?"#94d900":"#569f12"}function _i(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 Rt(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function xe(t,e){switch(e){case 5:switch(t){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(t){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 241:return"LilyGO T-ETH-POE";case 242:return"M5 PoESP32";case 243:return"WT32-ETH01";case 200:return"Generic ESP32";case 2:return"HAN Reader 2.0 by Max Spencer";case 0:return"Custom hardware by Roar Fredriksen";case 1:return"Kamstrup module by Egil Opsahl";case 8:return"\xB5HAN mosquito by dbeinder";case 3:return"Pow-K (UART0)";case 4:return"Pow-U (UART0)";case 101:return"Wemos D1 mini";case 100:return"Generic ESP8266";case 70:return"Generic ESP32-C3";case 71:return"ESP32-C3-DevKitM-1";case 80:return"Generic ESP32-S3"}return"Unknown"}function fn(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Vt(t,e){return t==1||t==2&&e}function kl(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function Yt(t,e){return isNaN(t)?"-":(isNaN(e)&&(e=t<1?2:t<10?1:0),t.toFixed(e))}function Ll(t,e){return t.setTime(t.getTime()+e*36e5),t}function Es(t){return t=="EOE"?"ENTSO-E":t=="HKS"?"hvakosterstrommen.no":t=="EDS"?"Energi Data Service":t=="MIX"?"Mixed sources":"Unknown ("+t+")"}function Ps(t){return t=="EOE"?"https://transparency.entsoe.eu/-E":t=="HKS"?"https://www.hvakosterstrommen.no/":t=="EDS"?"https://www.energidataservice.dk/":"#"}let li=0;function Xn(t,e){var l="";li++;var n=function(){setTimeout(Xn,1e3,t,e)};if(t.net.ip&&li%3==0){if(!t.net.ip){n();return}l="http://"+t.net.ip}else t.hostname&&li%3==1?l="http://"+t.hostname:t.hostname&&li%3==2?l="http://"+t.hostname+".local":l="";console&&console.log("Trying url "+l),e&&e(l);var i=new XMLHttpRequest;i.timeout=5e3,i.addEventListener("abort",n),i.addEventListener("error",n),i.addEventListener("timeout",n),i.addEventListener("load",function(o){window.location.href=l||"/"}),i.open("GET",l+"/is-alive",!0),i.send()}function Jt(t){return t.charAt(0).toUpperCase()+t.slice(1)}function As(t){return t.startsWith("esp32")?"esp32":t}function ml(t,e){let l=[t,e];return typeof t>"u"?(l[0]="-",l[1]=e):t>=1e9?(l[0]=(t/1e6).toFixed(t>1e10?0:1),l[1]="M"+e):t>1e4?(l[0]=(t/1e3).toFixed(t>1e6?0:t>1e5?1:2),l[1]="k"+e):(l[0]=t.toFixed(0),l[1]=e),l}let oi={},Ti=[];async function Qr(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 ki;async function ru(){if(Ti.length){let t=Ti.shift();delete oi[t.resource];try{let e=await Qr(t.resource,t.options);for(let l in t.callbacks)t.callbacks[l](e.clone())}catch(e){console.error("Error calling "+t.resource,e);for(let l in t.callbacks)t.callbacks[l]()}}ki&&clearTimeout(ki),ki=setTimeout(ru,100)}ru();async function Al(t,e={}){let l;return oi[t]?l=oi[t]:(l={resource:t,options:e,callbacks:[]},oi[t]=l,Ti.push(l)),new Promise(i=>l.callbacks.push(i))}let El={version:"",chip:"",mac:null,apmac:null,vndcfg:null,usrcfg:null,fwconsent:null,booting:!1,upgrading:!1,ui:{},security:0,boot_reason:0,upgrade:{x:-1,e:0,f:null,t:null},trying:null,if:{eth:!1}};const dl=xt(El);async function Ji(){El=await(await Al("sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),dl.set(El)}function Xr(t){dl.update(e=>(e.trying=t,e))}let ni=0,qs=-127,Ds=null,Zr={};const cu=Gf(Zr,t=>{let e,l;async function n(){Al("data.json").then(i=>i.json()).then(i=>{t(i),qs!=i.t&&(qs=i.t,setTimeout(vu,2e3)),Ds==null&&i.pe&&i.p!=null&&(Ds=i.p,mu()),El.upgrading?window.location.reload():(!El||!El.chip||El.booting||ni>1&&!fn(El.board))&&(Ji(),Zl&&clearTimeout(Zl),Zl=setTimeout(xi,2e3),Jl&&clearTimeout(Jl),Jl=setTimeout(es,3e3));let o=5e3;if(fn(El.board)&&i.v>2.5){let a=3.3-Math.min(3.3,i.v);a>0&&(o=Math.max(a,.1)*10*5e3)}o>5e3&&console.log("Next in "+o+"ms"),e&&clearTimeout(e),e=setTimeout(n,o),ni=0}).catch(i=>{ni++,ni>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(n,15e3),l||(l=setTimeout(Xn,5e3,El,Xr))):e=setTimeout(n,fn(El.board)?1e4:5e3)})}return n(),function(){clearTimeout(e)}});let Ei={},zn;const $i=xt(Ei);async function _u(){let t=!1;if($i.update(e=>{for(var l=0;l<36;l++){if(e[Rt(l)]==null){t=l<12;break}e[Rt(l)]=e[Rt(l+1)]}return e}),t)mu();else{let e=new Date;zn=setTimeout(_u,(60-e.getMinutes())*6e4)}}async function mu(){zn&&(clearTimeout(zn),zn=0),Ei=await(await Al("energyprice.json")).json(),$i.set(Ei);let e=new Date;zn=setTimeout(_u,(60-e.getMinutes())*6e4)}let Pi={},Zl;async function xi(){Zl&&(clearTimeout(Zl),Zl=0),Pi=await(await Al("dayplot.json")).json(),pu.set(Pi);let e=new Date;Zl=setTimeout(xi,(60-e.getMinutes())*6e4+20)}const pu=xt(Pi,t=>(xi(),function(){}));let Ai={},Jl;async function es(){Jl&&(clearTimeout(Jl),Jl=0),Ai=await(await Al("monthplot.json")).json(),du.set(Ai);let e=new Date;Jl=setTimeout(es,(24-e.getHours())*36e5+40)}const du=xt(Ai,t=>(es(),function(){}));let qi={};async function vu(){qi=await(await Al("temperature.json")).json(),hu.set(qi)}const hu=xt(qi,t=>(vu(),function(){}));let Di={},ii;async function bu(){ii&&(clearTimeout(ii),ii=0),Di=await(await Al("tariff.json")).json(),gu.set(Di);let e=new Date;ii=setTimeout(bu,(60-e.getMinutes())*6e4+30)}const gu=xt(Di,t=>function(){});let Li=[];const ts=xt(Li);async function Jr(){Li=await(await Al("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),ts.set(Li)}let Ql=0,$r={data:[]};async function Oi(){let e=await(await Al(Ql<0?"realtime.json":"realtime.json?offset="+Ql)).json();Ii.update(l=>{for(let n=0;n=0&&(Ql+=e.size,Qlo&&(c=p):k==i+1&&(_=p);else if(h==n+1)if(u){let T=u.tag_name.substring(1).split(".");parseInt(T[0]);let O=parseInt(T[1]);parseInt(T[2]),k==O&&(u=p)}else u=p}return _||u||c||!1}else return e[0]}function Ls(t){var _,u;let e=((u=(_=t[1].header)==null?void 0:_.uptime)!=null?u:"Up")+"",l,n,i;function o(f,p){return f[2]>1?o1:f[2]>0?s1:f[3]>1?i1:f[3]>0?n1:f[4]>1?l1:f[4]>0?t1:e1}let a=o(t),c=a(t);return{c(){l=M(e),n=b(),c.c(),i=Qt()},m(f,p){q(f,l,p),q(f,n,p),c.m(f,p),q(f,i,p)},p(f,p){var d,v;p&2&&e!==(e=((v=(d=f[1].header)==null?void 0:d.uptime)!=null?v:"Up")+"")&&D(l,e),a===(a=o(f))&&c?c.p(f,p):(c.d(1),c=a(f),c&&(c.c(),c.m(i.parentNode,i)))},d(f){f&&A(l),f&&A(n),c.d(f),f&&A(i)}}}function e1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.seconds)!=null?a:"s")+"",i;return{c(){e=M(t[0]),l=b(),i=M(n)},m(c,_){q(c,e,_),q(c,l,_),q(c,i,_)},p(c,_){var u,f;_&1&&D(e,c[0]),_&2&&n!==(n=((f=(u=c[1].common)==null?void 0:u.seconds)!=null?f:"s")+"")&&D(i,n)},d(c){c&&A(e),c&&A(l),c&&A(i)}}}function t1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.minute)!=null?a:"m")+"",i;return{c(){e=M(t[4]),l=b(),i=M(n)},m(c,_){q(c,e,_),q(c,l,_),q(c,i,_)},p(c,_){var u,f;_&16&&D(e,c[4]),_&2&&n!==(n=((f=(u=c[1].common)==null?void 0:u.minute)!=null?f:"m")+"")&&D(i,n)},d(c){c&&A(e),c&&A(l),c&&A(i)}}}function l1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.minutes)!=null?a:"m")+"",i;return{c(){e=M(t[4]),l=b(),i=M(n)},m(c,_){q(c,e,_),q(c,l,_),q(c,i,_)},p(c,_){var u,f;_&16&&D(e,c[4]),_&2&&n!==(n=((f=(u=c[1].common)==null?void 0:u.minutes)!=null?f:"m")+"")&&D(i,n)},d(c){c&&A(e),c&&A(l),c&&A(i)}}}function n1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.hour)!=null?a:"h")+"",i;return{c(){e=M(t[3]),l=b(),i=M(n)},m(c,_){q(c,e,_),q(c,l,_),q(c,i,_)},p(c,_){var u,f;_&8&&D(e,c[3]),_&2&&n!==(n=((f=(u=c[1].common)==null?void 0:u.hour)!=null?f:"h")+"")&&D(i,n)},d(c){c&&A(e),c&&A(l),c&&A(i)}}}function i1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.hours)!=null?a:"h")+"",i;return{c(){e=M(t[3]),l=b(),i=M(n)},m(c,_){q(c,e,_),q(c,l,_),q(c,i,_)},p(c,_){var u,f;_&8&&D(e,c[3]),_&2&&n!==(n=((f=(u=c[1].common)==null?void 0:u.hours)!=null?f:"h")+"")&&D(i,n)},d(c){c&&A(e),c&&A(l),c&&A(i)}}}function s1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.day)!=null?a:"d")+"",i;return{c(){e=M(t[2]),l=b(),i=M(n)},m(c,_){q(c,e,_),q(c,l,_),q(c,i,_)},p(c,_){var u,f;_&4&&D(e,c[2]),_&2&&n!==(n=((f=(u=c[1].common)==null?void 0:u.day)!=null?f:"d")+"")&&D(i,n)},d(c){c&&A(e),c&&A(l),c&&A(i)}}}function o1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.days)!=null?a:"d")+"",i;return{c(){e=M(t[2]),l=b(),i=M(n)},m(c,_){q(c,e,_),q(c,l,_),q(c,i,_)},p(c,_){var u,f;_&4&&D(e,c[2]),_&2&&n!==(n=((f=(u=c[1].common)==null?void 0:u.days)!=null?f:"d")+"")&&D(i,n)},d(c){c&&A(e),c&&A(l),c&&A(i)}}}function a1(t){let e,l=t[0]&&Ls(t);return{c(){l&&l.c(),e=Qt()},m(n,i){l&&l.m(n,i),q(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Ls(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Xe,o:Xe,d(n){l&&l.d(n),n&&A(e)}}}function f1(t,e,l){let{epoch:n}=e,i={};vl.subscribe(_=>{l(1,i=_)});let o=0,a=0,c=0;return t.$$set=_=>{"epoch"in _&&l(0,n=_.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(2,o=Math.floor(n/86400)),l(3,a=Math.floor(n/3600)),l(4,c=Math.floor(n/60)))},[n,i,o,a,c]}class u1 extends Dt{constructor(e){super(),qt(this,e,f1,a1,Nt,{epoch:0})}}function r1(t){let e,l,n;return{c(){e=m("span"),l=M(t[2]),r(e,"title",t[1]),r(e,"class",n="bd-"+t[0])},m(i,o){q(i,e,o),s(e,l)},p(i,[o]){o&4&&D(l,i[2]),o&2&&r(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&r(e,"class",n)},i:Xe,o:Xe,d(i){i&&A(e)}}}function c1(t,e,l){let{color:n}=e,{title:i}=e,{text:o}=e;return t.$$set=a=>{"color"in a&&l(0,n=a.color),"title"in a&&l(1,i=a.title),"text"in a&&l(2,o=a.text)},[n,i,o]}class $l extends Dt{constructor(e){super(),qt(this,e,c1,r1,Nt,{color:0,title:1,text:2})}}function _1(t){let e,l=`${Rt(t[0].getDate())}.${Rt(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Rt(t[0].getHours())}:${Rt(t[0].getMinutes())}`,n;return{c(){e=m("span"),n=M(l),r(e,"class",t[1])},m(i,o){q(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${Rt(i[0].getDate())}.${Rt(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Rt(i[0].getHours())}:${Rt(i[0].getMinutes())}`)&&D(n,l),o&2&&r(e,"class",i[1])},d(i){i&&A(e)}}}function m1(t){var n;let e=`${Rt(t[0].getDate())}. ${t[2].months?(n=t[2].months)==null?void 0:n[t[0].getMonth()]:Rt(t[0].getMonth())} ${Rt(t[0].getHours())}:${Rt(t[0].getMinutes())}`,l;return{c(){l=M(e)},m(i,o){q(i,l,o)},p(i,o){var a;o&5&&e!==(e=`${Rt(i[0].getDate())}. ${i[2].months?(a=i[2].months)==null?void 0:a[i[0].getMonth()]:Rt(i[0].getMonth())} ${Rt(i[0].getHours())}:${Rt(i[0].getMinutes())}`)&&D(l,e)},d(i){i&&A(l)}}}function p1(t){let e;function l(o,a){return o[3]?m1:_1}let n=l(t),i=n(t);return{c(){i.c(),e=Qt()},m(o,a){i.m(o,a),q(o,e,a)},p(o,[a]){n===(n=l(o))&&i?i.p(o,a):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:Xe,o:Xe,d(o){i.d(o),o&&A(e)}}}function d1(t,e,l){let n={};vl.subscribe(_=>{l(2,n=_)});let{timestamp:i}=e,{fullTimeColor:o}=e,{offset:a}=e,c;return t.$$set=_=>{"timestamp"in _&&l(0,i=_.timestamp),"fullTimeColor"in _&&l(1,o=_.fullTimeColor),"offset"in _&&l(4,a=_.offset)},t.$$.update=()=>{t.$$.dirty&17&&(l(3,c=Math.abs(new Date().getTime()-i.getTime())<3e5),isNaN(a)||Ll(i,a-(24+i.getHours()-i.getUTCHours())%24))},[i,o,n,c,a]}class Su extends Dt{constructor(e){super(),qt(this,e,d1,p1,Nt,{timestamp:0,fullTimeColor:1,offset:4})}}function v1(t){let e,l,n;return{c(){e=Ft("svg"),l=Ft("path"),n=Ft("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){q(i,e,o),s(e,l),s(e,n)},p:Xe,i:Xe,o:Xe,d(i){i&&A(e)}}}class h1 extends Dt{constructor(e){super(),qt(this,e,null,v1,Nt,{})}}function b1(t){let e,l;return{c(){e=Ft("svg"),l=Ft("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){q(n,e,i),s(e,l)},p:Xe,i:Xe,o:Xe,d(n){n&&A(e)}}}class g1 extends Dt{constructor(e){super(),qt(this,e,null,b1,Nt,{})}}function k1(t){let e,l;return{c(){e=Ft("svg"),l=Ft("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){q(n,e,i),s(e,l)},p:Xe,i:Xe,o:Xe,d(n){n&&A(e)}}}class w1 extends Dt{constructor(e){super(),qt(this,e,null,k1,Nt,{})}}function M1(t){let e,l,n=t[2].version+"",i;return{c(){e=M("AMS reader "),l=m("span"),i=M(n)},m(o,a){q(o,e,a),q(o,l,a),s(l,i)},p(o,a){a&4&&n!==(n=o[2].version+"")&&D(i,n)},d(o){o&&A(e),o&&A(l)}}}function Os(t){let e,l=(t[1].t>-50?t[1].t.toFixed(1):"-")+"",n,i;return{c(){e=m("div"),n=M(l),i=M("\xB0C"),r(e,"class","flex-none my-auto")},m(o,a){q(o,e,a),s(e,n),s(e,i)},p(o,a){a&2&&l!==(l=(o[1].t>-50?o[1].t.toFixed(1):"-")+"")&&D(n,l)},d(o){o&&A(e)}}}function Is(t){var i,o,a,c,_;let e,l=((o=(i=t[4].header)==null?void 0:i.han)!=null?o:"HAN")+": "+((_=(c=(a=t[4].errors)==null?void 0:a.han)==null?void 0:c[t[1].he])!=null?_:t[1].he),n;return{c(){e=m("div"),n=M(l),r(e,"class","bd-red")},m(u,f){q(u,e,f),s(e,n)},p(u,f){var p,d,v,h,k;f&18&&l!==(l=((d=(p=u[4].header)==null?void 0:p.han)!=null?d:"HAN")+": "+((k=(h=(v=u[4].errors)==null?void 0:v.han)==null?void 0:h[u[1].he])!=null?k:u[1].he))&&D(n,l)},d(u){u&&A(e)}}}function Rs(t){var i,o,a,c,_;let e,l=((o=(i=t[4].header)==null?void 0:i.mqtt)!=null?o:"MQTT")+": "+((_=(c=(a=t[4].errors)==null?void 0:a.mqtt)==null?void 0:c[t[1].me])!=null?_:t[1].me),n;return{c(){e=m("div"),n=M(l),r(e,"class","bd-red")},m(u,f){q(u,e,f),s(e,n)},p(u,f){var p,d,v,h,k;f&18&&l!==(l=((d=(p=u[4].header)==null?void 0:p.mqtt)!=null?d:"MQTT")+": "+((k=(h=(v=u[4].errors)==null?void 0:v.mqtt)==null?void 0:h[u[1].me])!=null?k:u[1].me))&&D(n,l)},d(u){u&&A(e)}}}function Fs(t){var i,o,a,c,_;let e,l=((o=(i=t[4].header)==null?void 0:i.price)!=null?o:"PS")+": "+((_=(c=(a=t[4].errors)==null?void 0:a.price)==null?void 0:c[t[1].ee])!=null?_:t[1].ee),n;return{c(){e=m("div"),n=M(l),r(e,"class","bd-red")},m(u,f){q(u,e,f),s(e,n)},p(u,f){var p,d,v,h,k;f&18&&l!==(l=((d=(p=u[4].header)==null?void 0:p.price)!=null?d:"PS")+": "+((k=(h=(v=u[4].errors)==null?void 0:v.price)==null?void 0:h[u[1].ee])!=null?k:u[1].ee))&&D(n,l)},d(u){u&&A(e)}}}function Us(t){let e,l,n,i,o,a,c,_;return l=new Ml({props:{to:"/configuration",$$slots:{default:[S1]},$$scope:{ctx:t}}}),a=new Ml({props:{to:"/status",$$slots:{default:[C1]},$$scope:{ctx:t}}}),{c(){var u,f,p,d;e=m("div"),Re(l.$$.fragment),i=b(),o=m("div"),Re(a.$$.fragment),r(e,"class","flex-none px-1 mt-1"),r(e,"title",n=(f=(u=t[4].header)==null?void 0:u.config)!=null?f:""),r(o,"class","flex-none px-1 mt-1"),r(o,"title",c=(d=(p=t[4].header)==null?void 0:p.status)!=null?d:"")},m(u,f){q(u,e,f),De(l,e,null),q(u,i,f),q(u,o,f),De(a,o,null),_=!0},p(u,f){var v,h,k,g;const p={};f&64&&(p.$$scope={dirty:f,ctx:u}),l.$set(p),(!_||f&16&&n!==(n=(h=(v=u[4].header)==null?void 0:v.config)!=null?h:""))&&r(e,"title",n);const d={};f&64&&(d.$$scope={dirty:f,ctx:u}),a.$set(d),(!_||f&16&&c!==(c=(g=(k=u[4].header)==null?void 0:k.status)!=null?g:""))&&r(o,"title",c)},i(u){_||($(l.$$.fragment,u),$(a.$$.fragment,u),_=!0)},o(u){fe(l.$$.fragment,u),fe(a.$$.fragment,u),_=!1},d(u){u&&A(e),Le(l),u&&A(i),u&&A(o),Le(a)}}}function S1(t){let e,l;return e=new h1({}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function C1(t){let e,l;return e=new g1({}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Bs(t){let e,l;function n(a,c){return a[2].security==0||a[1].a?T1:N1}let i=n(t),o=i(t);return{c(){var a,c;e=m("div"),o.c(),r(e,"class","flex-none mr-3 text-yellow-500"),r(e,"title",l=((c=(a=t[4].header)==null?void 0:a.new_version)!=null?c:"New version")+": "+t[3].tag_name)},m(a,c){q(a,e,c),o.m(e,null)},p(a,c){var _,u;i===(i=n(a))&&o?o.p(a,c):(o.d(1),o=i(a),o&&(o.c(),o.m(e,null))),c&24&&l!==(l=((u=(_=a[4].header)==null?void 0:_.new_version)!=null?u:"New version")+": "+a[3].tag_name)&&r(e,"title",l)},d(a){a&&A(e),o.d()}}}function N1(t){var c,_;let e,l=((_=(c=t[4].header)==null?void 0:c.new_version)!=null?_:"New version")+"",n,i,o=t[3].tag_name+"",a;return{c(){e=m("span"),n=M(l),i=M(": "),a=M(o)},m(u,f){q(u,e,f),s(e,n),s(e,i),s(e,a)},p(u,f){var p,d;f&16&&l!==(l=((d=(p=u[4].header)==null?void 0:p.new_version)!=null?d:"New version")+"")&&D(n,l),f&8&&o!==(o=u[3].tag_name+"")&&D(a,o)},d(u){u&&A(e)}}}function T1(t){var f,p;let e,l,n=((p=(f=t[4].header)==null?void 0:f.new_version)!=null?p:"New version")+"",i,o,a=t[3].tag_name+"",c,_,u;return{c(){e=m("button"),l=m("span"),i=M(n),o=M(": "),c=M(a),r(l,"class","mt-1"),r(e,"class","flex")},m(d,v){q(d,e,v),s(e,l),s(l,i),s(l,o),s(l,c),_||(u=ve(e,"click",t[5]),_=!0)},p(d,v){var h,k;v&16&&n!==(n=((k=(h=d[4].header)==null?void 0:h.new_version)!=null?k:"New version")+"")&&D(i,n),v&8&&a!==(a=d[3].tag_name+"")&&D(c,a)},d(d){d&&A(e),_=!1,u()}}}function E1(t){var ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye,et,He,Oe;let e,l,n,i,o,a,c,_,u,f,p,d=((le=(ee=t[4].header)==null?void 0:ee.mem)!=null?le:"Free")+"",v,h,k=(t[1].m?(t[1].m/1e3).toFixed(1):"-")+"",g,T,O,E,I,N,B,S,U,z,V,F,R,G,j,H,W,K,Q,J,ae,Z,X,oe,ne,ie,re,me,Y,x,ke;i=new Ml({props:{to:"/",$$slots:{default:[M1]},$$scope:{ctx:t}}}),_=new u1({props:{epoch:t[1].u}});let pe=t[1].t>-50&&Os(t);I=new $l({props:{title:(_e=(se=t[4].header)==null?void 0:se.esp)!=null?_e:"ESP",text:t[2].booting?(Se=(Te=t[4].header)==null?void 0:Te.booting)!=null?Se:"Booting":t[1].v>2?t[1].v.toFixed(2)+"V":(Ne=(de=t[4].header)==null?void 0:de.esp)!=null?Ne:"ESP",color:Vl(t[2].booting?2:t[1].em)}}),B=new $l({props:{title:(ge=(we=t[4].header)==null?void 0:we.han)!=null?ge:"HAN",text:(je=(he=t[4].header)==null?void 0:he.han)!=null?je:"HAN",color:Vl(t[2].booting?9:t[1].hm)}}),U=new $l({props:{title:(We=(Ue=t[4].header)==null?void 0:Ue.wifi)!=null?We:"WiFi",text:t[1].r?t[1].r.toFixed(0)+"dBm":(Je=(Ze=t[4].header)==null?void 0:Ze.wifi)!=null?Je:"WiFi",color:Vl(t[2].booting?9:t[1].wm)}}),V=new $l({props:{title:(et=(Ye=t[4].header)==null?void 0:Ye.mqtt)!=null?et:"MQTT",text:(Oe=(He=t[4].header)==null?void 0:He.mqtt)!=null?Oe:"MQTT",color:Vl(t[2].booting?9:t[1].mm)}});let C=(t[1].he<0||t[1].he>0)&&Is(t),w=t[1].me<0&&Rs(t),P=(t[1].ee>0||t[1].ee<0)&&Fs(t);X=new Su({props:{timestamp:t[1].c?new Date(t[1].c*1e3):new Date(0),offset:t[2].clock_offset,fullTimeColor:"text-red-500"}});let L=t[2].vndcfg&&t[2].usrcfg&&Us(t);me=new w1({});let y=t[2].fwconsent===1&&t[3]&&Bs(t);return{c(){var ce,Pe;e=m("nav"),l=m("div"),n=m("div"),Re(i.$$.fragment),o=b(),a=m("div"),c=m("div"),Re(_.$$.fragment),u=b(),pe&&pe.c(),f=b(),p=m("div"),v=M(d),h=M(": "),g=M(k),T=M("kb"),O=b(),E=m("div"),Re(I.$$.fragment),N=b(),Re(B.$$.fragment),S=b(),Re(U.$$.fragment),z=b(),Re(V.$$.fragment),F=b(),C&&C.c(),R=b(),w&&w.c(),G=b(),P&&P.c(),j=b(),H=m("div"),W=m("div"),K=m("a"),Q=m("img"),ae=b(),Z=m("div"),Re(X.$$.fragment),oe=b(),L&&L.c(),ne=b(),ie=m("div"),re=m("a"),Re(me.$$.fragment),x=b(),y&&y.c(),r(n,"class","flex text-lg text-gray-100 p-2"),r(c,"class","flex-none my-auto"),r(p,"class","flex-none my-auto"),r(a,"class","flex-none my-auto p-2 flex space-x-4"),r(E,"class","flex-auto flex-wrap my-auto justify-center p-2"),r(Q,"class","logo"),ai(Q.src,J=(t[0]+"/logo.svg").replace("//","/"))||r(Q,"src",J),r(Q,"alt","GitHub repo"),r(K,"class","float-right"),r(K,"href","https://github.com/UtilitechAS/amsreader-firmware"),r(K,"target","_blank"),r(K,"rel","noreferrer"),r(K,"aria-label","GitHub"),r(W,"class","flex-none"),r(Z,"class","flex-none my-auto px-2"),r(re,"href",kl("")),r(re,"target","_blank"),r(re,"rel","noreferrer"),r(ie,"class","flex-none px-1 mt-1"),r(ie,"title",Y=(Pe=(ce=t[4].header)==null?void 0:ce.doc)!=null?Pe:""),r(H,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),r(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),r(e,"class","hdr")},m(ce,Pe){q(ce,e,Pe),s(e,l),s(l,n),De(i,n,null),s(l,o),s(l,a),s(a,c),De(_,c,null),s(a,u),pe&&pe.m(a,null),s(a,f),s(a,p),s(p,v),s(p,h),s(p,g),s(p,T),s(l,O),s(l,E),De(I,E,null),s(E,N),De(B,E,null),s(E,S),De(U,E,null),s(E,z),De(V,E,null),s(l,F),C&&C.m(l,null),s(l,R),w&&w.m(l,null),s(l,G),P&&P.m(l,null),s(l,j),s(l,H),s(H,W),s(W,K),s(K,Q),s(H,ae),s(H,Z),De(X,Z,null),s(H,oe),L&&L.m(H,null),s(H,ne),s(H,ie),s(ie,re),De(me,re,null),s(H,x),y&&y.m(H,null),ke=!0},p(ce,[Pe]){var vt,Mt,dt,te,be,Tt,Ce,qe,pt,at,ft,ut,Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut;const $e={};Pe&68&&($e.$$scope={dirty:Pe,ctx:ce}),i.$set($e);const Qe={};Pe&2&&(Qe.epoch=ce[1].u),_.$set(Qe),ce[1].t>-50?pe?pe.p(ce,Pe):(pe=Os(ce),pe.c(),pe.m(a,f)):pe&&(pe.d(1),pe=null),(!ke||Pe&16)&&d!==(d=((Mt=(vt=ce[4].header)==null?void 0:vt.mem)!=null?Mt:"Free")+"")&&D(v,d),(!ke||Pe&2)&&k!==(k=(ce[1].m?(ce[1].m/1e3).toFixed(1):"-")+"")&&D(g,k);const mt={};Pe&16&&(mt.title=(te=(dt=ce[4].header)==null?void 0:dt.esp)!=null?te:"ESP"),Pe&22&&(mt.text=ce[2].booting?(Tt=(be=ce[4].header)==null?void 0:be.booting)!=null?Tt:"Booting":ce[1].v>2?ce[1].v.toFixed(2)+"V":(qe=(Ce=ce[4].header)==null?void 0:Ce.esp)!=null?qe:"ESP"),Pe&6&&(mt.color=Vl(ce[2].booting?2:ce[1].em)),I.$set(mt);const ye={};Pe&16&&(ye.title=(at=(pt=ce[4].header)==null?void 0:pt.han)!=null?at:"HAN"),Pe&16&&(ye.text=(ut=(ft=ce[4].header)==null?void 0:ft.han)!=null?ut:"HAN"),Pe&6&&(ye.color=Vl(ce[2].booting?9:ce[1].hm)),B.$set(ye);const Ge={};Pe&16&&(Ge.title=(Ot=(Et=ce[4].header)==null?void 0:Et.wifi)!=null?Ot:"WiFi"),Pe&18&&(Ge.text=ce[1].r?ce[1].r.toFixed(0)+"dBm":(Pt=(St=ce[4].header)==null?void 0:St.wifi)!=null?Pt:"WiFi"),Pe&6&&(Ge.color=Vl(ce[2].booting?9:ce[1].wm)),U.$set(Ge);const ze={};Pe&16&&(ze.title=(yt=(It=ce[4].header)==null?void 0:It.mqtt)!=null?yt:"MQTT"),Pe&16&&(ze.text=(ht=(Ct=ce[4].header)==null?void 0:Ct.mqtt)!=null?ht:"MQTT"),Pe&6&&(ze.color=Vl(ce[2].booting?9:ce[1].mm)),V.$set(ze),ce[1].he<0||ce[1].he>0?C?C.p(ce,Pe):(C=Is(ce),C.c(),C.m(l,R)):C&&(C.d(1),C=null),ce[1].me<0?w?w.p(ce,Pe):(w=Rs(ce),w.c(),w.m(l,G)):w&&(w.d(1),w=null),ce[1].ee>0||ce[1].ee<0?P?P.p(ce,Pe):(P=Fs(ce),P.c(),P.m(l,j)):P&&(P.d(1),P=null),(!ke||Pe&1&&!ai(Q.src,J=(ce[0]+"/logo.svg").replace("//","/")))&&r(Q,"src",J);const tt={};Pe&2&&(tt.timestamp=ce[1].c?new Date(ce[1].c*1e3):new Date(0)),Pe&4&&(tt.offset=ce[2].clock_offset),X.$set(tt),ce[2].vndcfg&&ce[2].usrcfg?L?(L.p(ce,Pe),Pe&4&&$(L,1)):(L=Us(ce),L.c(),$(L,1),L.m(H,ne)):L&&(gt(),fe(L,1,1,()=>{L=null}),kt()),(!ke||Pe&16&&Y!==(Y=(Ut=(Lt=ce[4].header)==null?void 0:Lt.doc)!=null?Ut:""))&&r(ie,"title",Y),ce[2].fwconsent===1&&ce[3]?y?y.p(ce,Pe):(y=Bs(ce),y.c(),y.m(H,null)):y&&(y.d(1),y=null)},i(ce){ke||($(i.$$.fragment,ce),$(_.$$.fragment,ce),$(I.$$.fragment,ce),$(B.$$.fragment,ce),$(U.$$.fragment,ce),$(V.$$.fragment,ce),$(X.$$.fragment,ce),$(L),$(me.$$.fragment,ce),ke=!0)},o(ce){fe(i.$$.fragment,ce),fe(_.$$.fragment,ce),fe(I.$$.fragment,ce),fe(B.$$.fragment,ce),fe(U.$$.fragment,ce),fe(V.$$.fragment,ce),fe(X.$$.fragment,ce),fe(L),fe(me.$$.fragment,ce),ke=!1},d(ce){ce&&A(e),Le(i),Le(_),pe&&pe.d(),Le(I),Le(B),Le(U),Le(V),C&&C.d(),w&&w.d(),P&&P.d(),Le(X),L&&L.d(),Le(me),y&&y.d()}}}function P1(t,e,l){let{basepath:n="/"}=e,{data:i={}}=e,o={},a={};function c(){var u,f;confirm(((f=(u=_.header)==null?void 0:u.upgrade)!=null?f:"Upgrade to {0}?").replace("{0}",a.tag_name))&&(!fn(o.board)||confirm(mi(xe(o.chip,o.board))))&&(dl.update(p=>(p.upgrading=!0,p)),wu(a.tag_name))}dl.subscribe(u=>{l(2,o=u),u.fwconsent===1&&Jr()}),ts.subscribe(u=>{l(3,a=Mu(o.version,u))});let _={};return vl.subscribe(u=>{l(4,_=u)}),t.$$set=u=>{"basepath"in u&&l(0,n=u.basepath),"data"in u&&l(1,i=u.data)},[n,i,o,a,_,c]}class A1 extends Dt{constructor(e){super(),qt(this,e,P1,E1,Nt,{basepath:0,data:1})}}function q1(t){let e,l,n,i;return{c(){e=Ft("svg"),l=Ft("path"),n=Ft("path"),r(l,"d",wi(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=wi(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,a){q(o,e,a),s(e,l),s(e,n)},p(o,[a]){a&1&&i!==(i=wi(150,150,115,210,210+300*o[0]/100))&&r(n,"d",i),a&2&&r(n,"stroke",o[1])},i:Xe,o:Xe,d(o){o&&A(e)}}}function js(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 wi(t,e,l,n,i){var o=js(t,e,l,i),a=js(t,e,l,n),c=i-n<=180?"0":"1",_=["M",o.x,o.y,"A",l,l,0,c,0,a.x,a.y].join(" ");return _}function D1(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 L1 extends Dt{constructor(e){super(),qt(this,e,D1,q1,Nt,{pct:0,color:1})}}function Hs(t){let e,l,n,i,o,a,c,_;return{c(){e=m("br"),l=b(),n=m("span"),i=M(t[1]),o=b(),a=m("span"),c=M(t[2]),_=M("/kWh"),r(n,"class","pl-sub"),r(a,"class","pl-snt")},m(u,f){q(u,e,f),q(u,l,f),q(u,n,f),s(n,i),q(u,o,f),q(u,a,f),s(a,c),s(a,_)},p(u,f){f&2&&D(i,u[1]),f&4&&D(c,u[2])},d(u){u&&A(e),u&&A(l),u&&A(n),u&&A(o),u&&A(a)}}}function O1(t){let e,l,n,i,o,a,c,_,u,f,p=t[4][0]+"",d,v,h,k=t[4][1]+"",g,T,O;l=new L1({props:{pct:t[5],color:t[3](t[5],document.documentElement.classList.contains("dark"))}});let E=t[1]&&Hs(t);return{c(){e=m("div"),Re(l.$$.fragment),n=b(),i=m("span"),o=m("span"),a=M(t[0]),c=b(),_=m("br"),u=b(),f=m("span"),d=M(p),v=b(),h=m("span"),g=M(k),T=b(),E&&E.c(),r(o,"class","pl-lab"),r(f,"class","pl-val"),r(h,"class","pl-unt"),r(i,"class","pl-ov"),r(e,"class","pl-root")},m(I,N){q(I,e,N),De(l,e,null),s(e,n),s(e,i),s(i,o),s(o,a),s(i,c),s(i,_),s(i,u),s(i,f),s(f,d),s(i,v),s(i,h),s(h,g),s(i,T),E&&E.m(i,null),O=!0},p(I,[N]){const B={};N&32&&(B.pct=I[5]),N&40&&(B.color=I[3](I[5],document.documentElement.classList.contains("dark"))),l.$set(B),(!O||N&1)&&D(a,I[0]),(!O||N&16)&&p!==(p=I[4][0]+"")&&D(d,p),(!O||N&16)&&k!==(k=I[4][1]+"")&&D(g,k),I[1]?E?E.p(I,N):(E=Hs(I),E.c(),E.m(i,null)):E&&(E.d(1),E=null)},i(I){O||($(l.$$.fragment,I),O=!0)},o(I){fe(l.$$.fragment,I),O=!1},d(I){I&&A(e),Le(l),E&&E.d()}}}function I1(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:a}=e,{sub:c=""}=e,{subunit:_=""}=e,{colorFn:u}=e,f,p=0;return t.$$set=d=>{"val"in d&&l(6,n=d.val),"max"in d&&l(7,i=d.max),"unit"in d&&l(8,o=d.unit),"label"in d&&l(0,a=d.label),"sub"in d&&l(1,c=d.sub),"subunit"in d&&l(2,_=d.subunit),"colorFn"in d&&l(3,u=d.colorFn)},t.$$.update=()=>{t.$$.dirty&448&&(l(4,f=ml(n,o)),l(5,p=Math.min(n,i)/i*100))},[a,c,_,u,f,p,n,i,o]}class Cu extends Dt{constructor(e){super(),qt(this,e,I1,O1,Nt,{val:6,max:7,unit:8,label:0,sub:1,subunit:2,colorFn:3})}}function ys(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function zs(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Ws(t,e,l){const n=t.slice();return n[15]=e[l],n}function Gs(t){let e,l,n,i,o,a,c=t[0].title&&Vs(t),_=t[0].y.ticks,u=[];for(let h=0;h<_.length;h+=1)u[h]=Ys(Ws(t,_,h));let f=t[0].x.ticks,p=[];for(let h=0;ht[9].call(e))},m(o,a){q(o,e,a),s(e,n),i=Vi(e,t[9].bind(e))},p(o,a){a&1&&l!==(l=o[0].title+"")&&D(n,l)},d(o){o&&A(e),i()}}}function Ks(t){let e,l,n,i=t[15].label+"",o,a,c,_;return{c(){e=Ft("g"),l=Ft("line"),n=Ft("text"),o=M(i),r(l,"x2","100%"),r(n,"y","-4"),r(n,"x",a=t[15].align=="right"?"85%":""),r(e,"class",c="tick tick-"+t[15].value+" tick-"+t[15].color),r(e,"transform",_="translate(0, "+t[7](t[15].value)+")")},m(u,f){q(u,e,f),s(e,l),s(e,n),s(n,o)},p(u,f){f&1&&i!==(i=u[15].label+"")&&D(o,i),f&1&&a!==(a=u[15].align=="right"?"85%":"")&&r(n,"x",a),f&1&&c!==(c="tick tick-"+u[15].value+" tick-"+u[15].color)&&r(e,"class",c),f&129&&_!==(_="translate(0, "+u[7](u[15].value)+")")&&r(e,"transform",_)},d(u){u&&A(e)}}}function Ys(t){let e=!isNaN(t[7](t[15].value)),l,n=e&&Ks(t);return{c(){n&&n.c(),l=Qt()},m(i,o){n&&n.m(i,o),q(i,l,o)},p(i,o){o&129&&(e=!isNaN(i[7](i[15].value))),e?n?n.p(i,o):(n=Ks(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&A(l)}}}function Qs(t){let e,l,n=(t[3]>20||t[13]%2==0)&&Xs(t);return{c(){e=Ft("g"),n&&n.c(),r(e,"class","tick"),r(e,"transform",l="translate("+t[6](t[13])+","+t[4]+")")},m(i,o){q(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[13]%2==0?n?n.p(i,o):(n=Xs(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&&A(e),n&&n.d()}}}function Xs(t){let e,l=t[11].label+"",n,i;return{c(){e=Ft("text"),n=M(l),r(e,"x",i=t[3]/2),r(e,"y","-4")},m(o,a){q(o,e,a),s(e,n)},p(o,a){a&1&&l!==(l=o[11].label+"")&&D(n,l),a&8&&i!==(i=o[3]/2)&&r(e,"x",i)},d(o){o&&A(e)}}}function Zs(t){let e=!isNaN(t[6](t[13])),l,n=e&&Qs(t);return{c(){n&&n.c(),l=Qt()},m(i,o){n&&n.m(i,o),q(i,l,o)},p(i,o){o&64&&(e=!isNaN(i[6](i[13]))),e?n?n.p(i,o):(n=Qs(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&A(l)}}}function Js(t){let e,l,n=t[11].value!==void 0&&$s(t),i=t[11].value2>1e-4&&to(t);return{c(){e=Ft("g"),n&&n.c(),l=Ft("g"),i&&i.c()},m(o,a){q(o,e,a),n&&n.m(e,null),q(o,l,a),i&&i.m(l,null)},p(o,a){o[11].value!==void 0?n?n.p(o,a):(n=$s(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[11].value2>1e-4?i?i.p(o,a):(i=to(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&A(e),n&&n.d(),o&&A(l),i&&i.d()}}}function $s(t){let e,l,n,i,o,a,c,_=t[3]>15&&xs(t);return{c(){e=Ft("rect"),_&&_.c(),c=Qt(),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",a=t[11].color)},m(u,f){q(u,e,f),_&&_.m(u,f),q(u,c,f)},p(u,f){f&64&&l!==(l=u[6](u[13])+2)&&r(e,"x",l),f&129&&n!==(n=u[7](u[11].value))&&r(e,"y",n),f&8&&i!==(i=u[3]-4)&&r(e,"width",i),f&129&&o!==(o=u[7](u[0].y.min)-u[7](Math.min(u[0].y.min,0)+u[11].value))&&r(e,"height",o),f&1&&a!==(a=u[11].color)&&r(e,"fill",a),u[3]>15?_?_.p(u,f):(_=xs(u),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null)},d(u){u&&A(e),_&&_.d(u),u&&A(c)}}}function xs(t){let e,l=t[11].label+"",n,i,o,a,c,_,u=t[11].title&&eo(t);return{c(){e=Ft("text"),n=M(l),u&&u.c(),_=Qt(),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[0].dark?t[11].color:"white"),r(e,"transform",c="translate("+(t[6](t[13])+t[3]/2)+" "+(t[7](t[11].value)>t[7](0)-t[8]?t[7](t[11].value)-t[8]:t[7](t[11].value)+10)+") rotate("+(t[11].labelAngle?t[11].labelAngle:t[3]f[7](0)-f[8]&&!f[0].dark?f[11].color:"white")&&r(e,"fill",a),p&457&&c!==(c="translate("+(f[6](f[13])+f[3]/2)+" "+(f[7](f[11].value)>f[7](0)-f[8]?f[7](f[11].value)-f[8]:f[7](f[11].value)+10)+") rotate("+(f[11].labelAngle?f[11].labelAngle:f[3]15&&lo(t);return{c(){e=Ft("rect"),_&&_.c(),c=Qt(),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",a=t[11].color2?t[11].color2:t[11].color)},m(u,f){q(u,e,f),_&&_.m(u,f),q(u,c,f)},p(u,f){f&64&&l!==(l=u[6](u[13])+2)&&r(e,"x",l),f&128&&n!==(n=u[7](0))&&r(e,"y",n),f&8&&i!==(i=u[3]-4)&&r(e,"width",i),f&129&&o!==(o=u[7](u[0].y.min)-u[7](u[0].y.min+u[11].value2))&&r(e,"height",o),f&1&&a!==(a=u[11].color2?u[11].color2:u[11].color)&&r(e,"fill",a),u[3]>15?_?_.p(u,f):(_=lo(u),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null)},d(u){u&&A(e),_&&_.d(u),u&&A(c)}}}function lo(t){let e,l=t[11].label2+"",n,i,o,a,c,_=t[11].title2&&no(t);return{c(){e=Ft("text"),n=M(l),_&&_.c(),c=Qt(),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){q(i,e,o),n&&n.m(e,null),l=Vi(e,t[10].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=Gs(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:Xe,o:Xe,d(i){i&&A(e),n&&n.d(),l()}}}let xl=30;function F1(t,e,l){let{config:n}=e,i,o,a,c,_,u,f,p=0;function d(){p=this.clientHeight,l(5,p)}function v(){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&63){l(4,u=o-p);let h=i-(n.padding.left+n.padding.right);l(3,a=h/n.points.length),l(8,f=an.y.max?T=n.padding.bottom:gu||T<0?0:T})}},[n,i,o,a,u,p,c,_,f,d,v]}class ln extends Dt{constructor(e){super(),qt(this,e,F1,R1,Nt,{config:0})}}function U1(t){let e,l;return e=new ln({props:{config:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function B1(t,e,l){let{title:n}=e,{u1:i}=e,{u2:o}=e,{u3:a}=e,{ds:c}=e,_={};function u(f){return{label:Yt(f)+"V",title:f.toFixed(1)+" V",value:isNaN(f)?0:f,color:Yr(f||0,document.documentElement.classList.contains("dark"))}}return t.$$set=f=>{"title"in f&&l(1,n=f.title),"u1"in f&&l(2,i=f.u1),"u2"in f&&l(3,o=f.u2),"u3"in f&&l(4,a=f.u3),"ds"in f&&l(5,c=f.ds)},t.$$.update=()=>{if(t.$$.dirty&62){let f=[],p=[];i>0&&(f.push({label:c===1?"L1-L2":"L1"}),p.push(u(i))),o>0&&(f.push({label:c===1?"L1-L3":"L2"}),p.push(u(o))),a>0&&(f.push({label:c===1?"L2-L3":"L3"}),p.push(u(a))),l(0,_={title:n,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})}},[_,n,i,o,a,c]}class j1 extends Dt{constructor(e){super(),qt(this,e,B1,U1,Nt,{title:1,u1:2,u2:3,u3:4,ds:5})}}function H1(t){var L,y,ee,le,se,_e,Te,Se,de,Ne;let e,l,n=((y=(L=t[0].reactive)==null?void 0:L.title)!=null?y:"Reactive")+"",i,o,a,c,_=((le=(ee=t[0].reactive)==null?void 0:ee.instant_in)!=null?le:"Instant in")+"",u,f,p,d=t[1][0]+"",v,h,k=t[1][1]+"",g,T,O,E=((_e=(se=t[0].reactive)==null?void 0:se.instant_out)!=null?_e:"Instant out")+"",I,N,B,S=t[2][0]+"",U,z,V=t[2][1]+"",F,R,G,j,H=((Se=(Te=t[0].reactive)==null?void 0:Te.total_in)!=null?Se:"Total in")+"",W,K,Q,J=t[3][0]+"",ae,Z,X=t[3][1]+"",oe,ne,ie,re=((Ne=(de=t[0].reactive)==null?void 0:de.total_out)!=null?Ne:"Total out")+"",me,Y,x,ke=t[4][0]+"",pe,C,w=t[4][1]+"",P;return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("div"),c=m("div"),u=M(_),f=b(),p=m("div"),v=M(d),h=b(),g=M(k),T=b(),O=m("div"),I=M(E),N=b(),B=m("div"),U=M(S),z=b(),F=M(V),R=b(),G=m("div"),j=m("div"),W=M(H),K=b(),Q=m("div"),ae=M(J),Z=b(),oe=M(X),ne=b(),ie=m("div"),me=M(re),Y=b(),x=m("div"),pe=M(ke),C=b(),P=M(w),r(p,"class","text-right"),r(B,"class","text-right"),r(a,"class","grid grid-cols-2 mt-4"),r(Q,"class","text-right"),r(x,"class","text-right"),r(G,"class","grid grid-cols-2 mt-4"),r(e,"class","mx-2 text-sm")},m(we,ge){q(we,e,ge),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(c,u),s(a,f),s(a,p),s(p,v),s(p,h),s(p,g),s(a,T),s(a,O),s(O,I),s(a,N),s(a,B),s(B,U),s(B,z),s(B,F),s(e,R),s(e,G),s(G,j),s(j,W),s(G,K),s(G,Q),s(Q,ae),s(Q,Z),s(Q,oe),s(G,ne),s(G,ie),s(ie,me),s(G,Y),s(G,x),s(x,pe),s(x,C),s(x,P)},p(we,[ge]){var he,je,Ue,We,Ze,Je,Ye,et,He,Oe;ge&1&&n!==(n=((je=(he=we[0].reactive)==null?void 0:he.title)!=null?je:"Reactive")+"")&&D(i,n),ge&1&&_!==(_=((We=(Ue=we[0].reactive)==null?void 0:Ue.instant_in)!=null?We:"Instant in")+"")&&D(u,_),ge&2&&d!==(d=we[1][0]+"")&&D(v,d),ge&2&&k!==(k=we[1][1]+"")&&D(g,k),ge&1&&E!==(E=((Je=(Ze=we[0].reactive)==null?void 0:Ze.instant_out)!=null?Je:"Instant out")+"")&&D(I,E),ge&4&&S!==(S=we[2][0]+"")&&D(U,S),ge&4&&V!==(V=we[2][1]+"")&&D(F,V),ge&1&&H!==(H=((et=(Ye=we[0].reactive)==null?void 0:Ye.total_in)!=null?et:"Total in")+"")&&D(W,H),ge&8&&J!==(J=we[3][0]+"")&&D(ae,J),ge&8&&X!==(X=we[3][1]+"")&&D(oe,X),ge&1&&re!==(re=((Oe=(He=we[0].reactive)==null?void 0:He.total_out)!=null?Oe:"Total out")+"")&&D(me,re),ge&16&&ke!==(ke=we[4][0]+"")&&D(pe,ke),ge&16&&w!==(w=we[4][1]+"")&&D(P,w)},i:Xe,o:Xe,d(we){we&&A(e)}}}function y1(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:o}=e,{exportTotal:a}=e,c={};vl.subscribe(d=>{l(0,c=d)});let _,u,f,p;return t.$$set=d=>{"importInstant"in d&&l(5,n=d.importInstant),"exportInstant"in d&&l(6,i=d.exportInstant),"importTotal"in d&&l(7,o=d.importTotal),"exportTotal"in d&&l(8,a=d.exportTotal)},t.$$.update=()=>{t.$$.dirty&480&&(l(1,_=ml(n,"VAr")),l(2,u=ml(i,"VAr")),l(3,f=ml(o*1e3,"VArh")),l(4,p=ml(a*1e3,"VArh")))},[c,_,u,f,p,n,i,o,a]}class z1 extends Dt{constructor(e){super(),qt(this,e,y1,H1,Nt,{importInstant:5,exportInstant:6,importTotal:7,exportTotal:8})}}function so(t){let e;function l(o,a){return o[3]?G1:W1}let n=l(t),i=n(t);return{c(){i.c(),e=Qt()},m(o,a){i.m(o,a),q(o,e,a)},p(o,a){n===(n=l(o))&&i?i.p(o,a):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&A(e)}}}function W1(t){var y,ee,le,se,_e,Te,Se,de,Ne,we;let e,l=((ee=(y=t[5].realtime)==null?void 0:y.consumption)!=null?ee:"Consumption")+"",n,i,o,a,c=Jt((se=(le=t[5].common)==null?void 0:le.hour)!=null?se:"Hour")+"",_,u,f,p=t[6][0]+"",d,v,h=t[6][1]+"",k,g,T,O=Jt((Te=(_e=t[5].common)==null?void 0:_e.day)!=null?Te:"Day")+"",E,I,N,B=t[7][0]+"",S,U,z=t[7][1]+"",V,F,R,G=Jt((de=(Se=t[5].common)==null?void 0:Se.month)!=null?de:"Month")+"",j,H,W,K=t[8][0]+"",Q,J,ae=t[8][1]+"",Z,X,oe,ne=((we=(Ne=t[5].realtime)==null?void 0:Ne.last_month)!=null?we:"Last month")+"",ie,re,me,Y=t[9][0]+"",x,ke,pe=t[9][1]+"",C,w,P,L=t[4]&&oo(t);return{c(){e=m("strong"),n=M(l),i=b(),o=m("div"),a=m("div"),_=M(c),u=b(),f=m("div"),d=M(p),v=b(),k=M(h),g=b(),T=m("div"),E=M(O),I=b(),N=m("div"),S=M(B),U=b(),V=M(z),F=b(),R=m("div"),j=M(G),H=b(),W=m("div"),Q=M(K),J=b(),Z=M(ae),X=b(),oe=m("div"),ie=M(ne),re=b(),me=m("div"),x=M(Y),ke=b(),C=M(pe),w=b(),L&&L.c(),P=Qt(),r(f,"class","text-right"),r(N,"class","text-right"),r(W,"class","text-right"),r(me,"class","text-right"),r(o,"class","grid grid-cols-2 mb-3")},m(ge,he){q(ge,e,he),s(e,n),q(ge,i,he),q(ge,o,he),s(o,a),s(a,_),s(o,u),s(o,f),s(f,d),s(f,v),s(f,k),s(o,g),s(o,T),s(T,E),s(o,I),s(o,N),s(N,S),s(N,U),s(N,V),s(o,F),s(o,R),s(R,j),s(o,H),s(o,W),s(W,Q),s(W,J),s(W,Z),s(o,X),s(o,oe),s(oe,ie),s(o,re),s(o,me),s(me,x),s(me,ke),s(me,C),q(ge,w,he),L&&L.m(ge,he),q(ge,P,he)},p(ge,he){var je,Ue,We,Ze,Je,Ye,et,He,Oe,ce;he&32&&l!==(l=((Ue=(je=ge[5].realtime)==null?void 0:je.consumption)!=null?Ue:"Consumption")+"")&&D(n,l),he&32&&c!==(c=Jt((Ze=(We=ge[5].common)==null?void 0:We.hour)!=null?Ze:"Hour")+"")&&D(_,c),he&64&&p!==(p=ge[6][0]+"")&&D(d,p),he&64&&h!==(h=ge[6][1]+"")&&D(k,h),he&32&&O!==(O=Jt((Ye=(Je=ge[5].common)==null?void 0:Je.day)!=null?Ye:"Day")+"")&&D(E,O),he&128&&B!==(B=ge[7][0]+"")&&D(S,B),he&128&&z!==(z=ge[7][1]+"")&&D(V,z),he&32&&G!==(G=Jt((He=(et=ge[5].common)==null?void 0:et.month)!=null?He:"Month")+"")&&D(j,G),he&256&&K!==(K=ge[8][0]+"")&&D(Q,K),he&256&&ae!==(ae=ge[8][1]+"")&&D(Z,ae),he&32&&ne!==(ne=((ce=(Oe=ge[5].realtime)==null?void 0:Oe.last_month)!=null?ce:"Last month")+"")&&D(ie,ne),he&512&&Y!==(Y=ge[9][0]+"")&&D(x,Y),he&512&&pe!==(pe=ge[9][1]+"")&&D(C,pe),ge[4]?L?L.p(ge,he):(L=oo(ge),L.c(),L.m(P.parentNode,P)):L&&(L.d(1),L=null)},d(ge){ge&&A(e),ge&&A(i),ge&&A(o),ge&&A(w),L&&L.d(ge),ge&&A(P)}}}function G1(t){var At,Xt,Zt,el,tl,ll,nl,il,sl,ol,al,fl,ul,Ie,jt,rl,cl,hl,bl,gl;let e,l=((Xt=(At=t[5].common)==null?void 0:At.import)!=null?Xt:"Import")+"",n,i,o,a,c=Jt((el=(Zt=t[5].common)==null?void 0:Zt.hour)!=null?el:"Hour")+"",_,u,f,p=t[6][0]+"",d,v,h=t[6][1]+"",k,g,T,O,E=Jt((ll=(tl=t[5].common)==null?void 0:tl.day)!=null?ll:"Day")+"",I,N,B,S=t[7][0]+"",U,z,V=t[7][1]+"",F,R,G,j,H=Jt((il=(nl=t[5].common)==null?void 0:nl.month)!=null?il:"Month")+"",W,K,Q,J=t[8][0]+"",ae,Z,X=t[8][1]+"",oe,ne,ie,re,me=((ol=(sl=t[5].realtime)==null?void 0:sl.last_mo)!=null?ol:"Last mo.")+"",Y,x,ke,pe=t[9][0]+"",C,w,P=t[9][1]+"",L,y,ee,le,se,_e=((fl=(al=t[5].common)==null?void 0:al.export)!=null?fl:"Export")+"",Te,Se,de,Ne,we=Jt((Ie=(ul=t[5].common)==null?void 0:ul.hour)!=null?Ie:"Hour")+"",ge,he,je,Ue=t[10][0]+"",We,Ze,Je=t[10][1]+"",Ye,et,He,Oe,ce=Jt((rl=(jt=t[5].common)==null?void 0:jt.day)!=null?rl:"Day")+"",Pe,$e,Qe,mt=t[11][0]+"",ye,Ge,ze=t[11][1]+"",tt,vt,Mt,dt,te=Jt((hl=(cl=t[5].common)==null?void 0:cl.month)!=null?hl:"Month")+"",be,Tt,Ce,qe=t[12][0]+"",pt,at,ft=t[12][1]+"",ut,Et,Ot,St,Pt=((gl=(bl=t[5].realtime)==null?void 0:bl.last_mo)!=null?gl:"Last mo.")+"",It,yt,Ct,ht=t[13][0]+"",Lt,Ut,Wt=t[13][1]+"",Ve,Ke,Bt,nt=t[4]&&ao(t),bt=t[4]&&fo(t),wt=t[4]&&uo(t),ue=t[4]&&ro(t),Me=t[4]&&co(t),Ae=t[4]&&_o(t),it=t[4]&&mo(t),rt=t[4]&&po(t);return{c(){e=m("strong"),n=M(l),i=b(),o=m("div"),a=m("div"),_=M(c),u=b(),f=m("div"),d=M(p),v=b(),k=M(h),g=b(),nt&&nt.c(),T=b(),O=m("div"),I=M(E),N=b(),B=m("div"),U=M(S),z=b(),F=M(V),R=b(),bt&&bt.c(),G=b(),j=m("div"),W=M(H),K=b(),Q=m("div"),ae=M(J),Z=b(),oe=M(X),ne=b(),wt&&wt.c(),ie=b(),re=m("div"),Y=M(me),x=b(),ke=m("div"),C=M(pe),w=b(),L=M(P),y=b(),ue&&ue.c(),le=b(),se=m("strong"),Te=M(_e),Se=b(),de=m("div"),Ne=m("div"),ge=M(we),he=b(),je=m("div"),We=M(Ue),Ze=b(),Ye=M(Je),et=b(),Me&&Me.c(),He=b(),Oe=m("div"),Pe=M(ce),$e=b(),Qe=m("div"),ye=M(mt),Ge=b(),tt=M(ze),vt=b(),Ae&&Ae.c(),Mt=b(),dt=m("div"),be=M(te),Tt=b(),Ce=m("div"),pt=M(qe),at=b(),ut=M(ft),Et=b(),it&&it.c(),Ot=b(),St=m("div"),It=M(Pt),yt=b(),Ct=m("div"),Lt=M(ht),Ut=b(),Ve=M(Wt),Ke=b(),rt&&rt.c(),r(f,"class","text-right"),r(B,"class","text-right"),r(Q,"class","text-right"),r(ke,"class","text-right"),r(o,"class",ee="grid grid-cols-"+t[14]+" mb-3"),r(je,"class","text-right"),r(Qe,"class","text-right"),r(Ce,"class","text-right"),r(Ct,"class","text-right"),r(de,"class",Bt="grid grid-cols-"+t[14])},m(Fe,ct){q(Fe,e,ct),s(e,n),q(Fe,i,ct),q(Fe,o,ct),s(o,a),s(a,_),s(o,u),s(o,f),s(f,d),s(f,v),s(f,k),s(o,g),nt&&nt.m(o,null),s(o,T),s(o,O),s(O,I),s(o,N),s(o,B),s(B,U),s(B,z),s(B,F),s(o,R),bt&&bt.m(o,null),s(o,G),s(o,j),s(j,W),s(o,K),s(o,Q),s(Q,ae),s(Q,Z),s(Q,oe),s(o,ne),wt&&wt.m(o,null),s(o,ie),s(o,re),s(re,Y),s(o,x),s(o,ke),s(ke,C),s(ke,w),s(ke,L),s(o,y),ue&&ue.m(o,null),q(Fe,le,ct),q(Fe,se,ct),s(se,Te),q(Fe,Se,ct),q(Fe,de,ct),s(de,Ne),s(Ne,ge),s(de,he),s(de,je),s(je,We),s(je,Ze),s(je,Ye),s(de,et),Me&&Me.m(de,null),s(de,He),s(de,Oe),s(Oe,Pe),s(de,$e),s(de,Qe),s(Qe,ye),s(Qe,Ge),s(Qe,tt),s(de,vt),Ae&&Ae.m(de,null),s(de,Mt),s(de,dt),s(dt,be),s(de,Tt),s(de,Ce),s(Ce,pt),s(Ce,at),s(Ce,ut),s(de,Et),it&&it.m(de,null),s(de,Ot),s(de,St),s(St,It),s(de,yt),s(de,Ct),s(Ct,Lt),s(Ct,Ut),s(Ct,Ve),s(de,Ke),rt&&rt.m(de,null)},p(Fe,ct){var Be,_t,Sl,Cl,Nl,Tl,Rl,Fl,Ul,Bl,jl,Hl,yl,zl,Wl,lt,Ht,_l,wl,Gl;ct&32&&l!==(l=((_t=(Be=Fe[5].common)==null?void 0:Be.import)!=null?_t:"Import")+"")&&D(n,l),ct&32&&c!==(c=Jt((Cl=(Sl=Fe[5].common)==null?void 0:Sl.hour)!=null?Cl:"Hour")+"")&&D(_,c),ct&64&&p!==(p=Fe[6][0]+"")&&D(d,p),ct&64&&h!==(h=Fe[6][1]+"")&&D(k,h),Fe[4]?nt?nt.p(Fe,ct):(nt=ao(Fe),nt.c(),nt.m(o,T)):nt&&(nt.d(1),nt=null),ct&32&&E!==(E=Jt((Tl=(Nl=Fe[5].common)==null?void 0:Nl.day)!=null?Tl:"Day")+"")&&D(I,E),ct&128&&S!==(S=Fe[7][0]+"")&&D(U,S),ct&128&&V!==(V=Fe[7][1]+"")&&D(F,V),Fe[4]?bt?bt.p(Fe,ct):(bt=fo(Fe),bt.c(),bt.m(o,G)):bt&&(bt.d(1),bt=null),ct&32&&H!==(H=Jt((Fl=(Rl=Fe[5].common)==null?void 0:Rl.month)!=null?Fl:"Month")+"")&&D(W,H),ct&256&&J!==(J=Fe[8][0]+"")&&D(ae,J),ct&256&&X!==(X=Fe[8][1]+"")&&D(oe,X),Fe[4]?wt?wt.p(Fe,ct):(wt=uo(Fe),wt.c(),wt.m(o,ie)):wt&&(wt.d(1),wt=null),ct&32&&me!==(me=((Bl=(Ul=Fe[5].realtime)==null?void 0:Ul.last_mo)!=null?Bl:"Last mo.")+"")&&D(Y,me),ct&512&&pe!==(pe=Fe[9][0]+"")&&D(C,pe),ct&512&&P!==(P=Fe[9][1]+"")&&D(L,P),Fe[4]?ue?ue.p(Fe,ct):(ue=ro(Fe),ue.c(),ue.m(o,null)):ue&&(ue.d(1),ue=null),ct&16384&&ee!==(ee="grid grid-cols-"+Fe[14]+" mb-3")&&r(o,"class",ee),ct&32&&_e!==(_e=((Hl=(jl=Fe[5].common)==null?void 0:jl.export)!=null?Hl:"Export")+"")&&D(Te,_e),ct&32&&we!==(we=Jt((zl=(yl=Fe[5].common)==null?void 0:yl.hour)!=null?zl:"Hour")+"")&&D(ge,we),ct&1024&&Ue!==(Ue=Fe[10][0]+"")&&D(We,Ue),ct&1024&&Je!==(Je=Fe[10][1]+"")&&D(Ye,Je),Fe[4]?Me?Me.p(Fe,ct):(Me=co(Fe),Me.c(),Me.m(de,He)):Me&&(Me.d(1),Me=null),ct&32&&ce!==(ce=Jt((lt=(Wl=Fe[5].common)==null?void 0:Wl.day)!=null?lt:"Day")+"")&&D(Pe,ce),ct&2048&&mt!==(mt=Fe[11][0]+"")&&D(ye,mt),ct&2048&&ze!==(ze=Fe[11][1]+"")&&D(tt,ze),Fe[4]?Ae?Ae.p(Fe,ct):(Ae=_o(Fe),Ae.c(),Ae.m(de,Mt)):Ae&&(Ae.d(1),Ae=null),ct&32&&te!==(te=Jt((_l=(Ht=Fe[5].common)==null?void 0:Ht.month)!=null?_l:"Month")+"")&&D(be,te),ct&4096&&qe!==(qe=Fe[12][0]+"")&&D(pt,qe),ct&4096&&ft!==(ft=Fe[12][1]+"")&&D(ut,ft),Fe[4]?it?it.p(Fe,ct):(it=mo(Fe),it.c(),it.m(de,Ot)):it&&(it.d(1),it=null),ct&32&&Pt!==(Pt=((Gl=(wl=Fe[5].realtime)==null?void 0:wl.last_mo)!=null?Gl:"Last mo.")+"")&&D(It,Pt),ct&8192&&ht!==(ht=Fe[13][0]+"")&&D(Lt,ht),ct&8192&&Wt!==(Wt=Fe[13][1]+"")&&D(Ve,Wt),Fe[4]?rt?rt.p(Fe,ct):(rt=po(Fe),rt.c(),rt.m(de,null)):rt&&(rt.d(1),rt=null),ct&16384&&Bt!==(Bt="grid grid-cols-"+Fe[14])&&r(de,"class",Bt)},d(Fe){Fe&&A(e),Fe&&A(i),Fe&&A(o),nt&&nt.d(),bt&&bt.d(),wt&&wt.d(),ue&&ue.d(),Fe&&A(le),Fe&&A(se),Fe&&A(Se),Fe&&A(de),Me&&Me.d(),Ae&&Ae.d(),it&&it.d(),rt&&rt.d()}}}function oo(t){var x,ke,pe,C,w,P,L,y,ee,le;let e,l=((ke=(x=t[5].realtime)==null?void 0:x.cost)!=null?ke:"Cost")+"",n,i,o,a,c=Jt((C=(pe=t[5].common)==null?void 0:pe.hour)!=null?C:"Hour")+"",_,u,f,p=Yt(t[1].h.c,2)+"",d,v,h,k,g,T=Jt((P=(w=t[5].common)==null?void 0:w.day)!=null?P:"Day")+"",O,E,I,N=Yt(t[1].d.c,1)+"",B,S,U,z,V,F=Jt((y=(L=t[5].common)==null?void 0:L.month)!=null?y:"Month")+"",R,G,j,H=Yt(t[1].m.c)+"",W,K,Q,J,ae,Z=((le=(ee=t[5].realtime)==null?void 0:ee.last_month)!=null?le:"Last month")+"",X,oe,ne,ie=Yt(t[0].last_month.c)+"",re,me,Y;return{c(){e=m("strong"),n=M(l),i=b(),o=m("div"),a=m("div"),_=M(c),u=b(),f=m("div"),d=M(p),v=b(),h=M(t[2]),k=b(),g=m("div"),O=M(T),E=b(),I=m("div"),B=M(N),S=b(),U=M(t[2]),z=b(),V=m("div"),R=M(F),G=b(),j=m("div"),W=M(H),K=b(),Q=M(t[2]),J=b(),ae=m("div"),X=M(Z),oe=b(),ne=m("div"),re=M(ie),me=b(),Y=M(t[2]),r(f,"class","text-right"),r(I,"class","text-right"),r(j,"class","text-right"),r(ne,"class","text-right"),r(o,"class","grid grid-cols-2")},m(se,_e){q(se,e,_e),s(e,n),q(se,i,_e),q(se,o,_e),s(o,a),s(a,_),s(o,u),s(o,f),s(f,d),s(f,v),s(f,h),s(o,k),s(o,g),s(g,O),s(o,E),s(o,I),s(I,B),s(I,S),s(I,U),s(o,z),s(o,V),s(V,R),s(o,G),s(o,j),s(j,W),s(j,K),s(j,Q),s(o,J),s(o,ae),s(ae,X),s(o,oe),s(o,ne),s(ne,re),s(ne,me),s(ne,Y)},p(se,_e){var Te,Se,de,Ne,we,ge,he,je,Ue,We;_e&32&&l!==(l=((Se=(Te=se[5].realtime)==null?void 0:Te.cost)!=null?Se:"Cost")+"")&&D(n,l),_e&32&&c!==(c=Jt((Ne=(de=se[5].common)==null?void 0:de.hour)!=null?Ne:"Hour")+"")&&D(_,c),_e&2&&p!==(p=Yt(se[1].h.c,2)+"")&&D(d,p),_e&4&&D(h,se[2]),_e&32&&T!==(T=Jt((ge=(we=se[5].common)==null?void 0:we.day)!=null?ge:"Day")+"")&&D(O,T),_e&2&&N!==(N=Yt(se[1].d.c,1)+"")&&D(B,N),_e&4&&D(U,se[2]),_e&32&&F!==(F=Jt((je=(he=se[5].common)==null?void 0:he.month)!=null?je:"Month")+"")&&D(R,F),_e&2&&H!==(H=Yt(se[1].m.c)+"")&&D(W,H),_e&4&&D(Q,se[2]),_e&32&&Z!==(Z=((We=(Ue=se[5].realtime)==null?void 0:Ue.last_month)!=null?We:"Last month")+"")&&D(X,Z),_e&1&&ie!==(ie=Yt(se[0].last_month.c)+"")&&D(re,ie),_e&4&&D(Y,se[2])},d(se){se&&A(e),se&&A(i),se&&A(o)}}}function ao(t){let e,l=Yt(t[1].h.c,2)+"",n,i,o;return{c(){e=m("div"),n=M(l),i=b(),o=M(t[2]),r(e,"class","text-right")},m(a,c){q(a,e,c),s(e,n),s(e,i),s(e,o)},p(a,c){c&2&&l!==(l=Yt(a[1].h.c,2)+"")&&D(n,l),c&4&&D(o,a[2])},d(a){a&&A(e)}}}function fo(t){let e,l=Yt(t[1].d.c,1)+"",n,i,o;return{c(){e=m("div"),n=M(l),i=b(),o=M(t[2]),r(e,"class","text-right")},m(a,c){q(a,e,c),s(e,n),s(e,i),s(e,o)},p(a,c){c&2&&l!==(l=Yt(a[1].d.c,1)+"")&&D(n,l),c&4&&D(o,a[2])},d(a){a&&A(e)}}}function uo(t){let e,l=Yt(t[1].m.c)+"",n,i,o;return{c(){e=m("div"),n=M(l),i=b(),o=M(t[2]),r(e,"class","text-right")},m(a,c){q(a,e,c),s(e,n),s(e,i),s(e,o)},p(a,c){c&2&&l!==(l=Yt(a[1].m.c)+"")&&D(n,l),c&4&&D(o,a[2])},d(a){a&&A(e)}}}function ro(t){let e,l=Yt(t[0].last_month.c)+"",n,i,o;return{c(){e=m("div"),n=M(l),i=b(),o=M(t[2]),r(e,"class","text-right")},m(a,c){q(a,e,c),s(e,n),s(e,i),s(e,o)},p(a,c){c&1&&l!==(l=Yt(a[0].last_month.c)+"")&&D(n,l),c&4&&D(o,a[2])},d(a){a&&A(e)}}}function co(t){let e,l=Yt(t[1].h.i,2)+"",n,i,o;return{c(){e=m("div"),n=M(l),i=b(),o=M(t[2]),r(e,"class","text-right")},m(a,c){q(a,e,c),s(e,n),s(e,i),s(e,o)},p(a,c){c&2&&l!==(l=Yt(a[1].h.i,2)+"")&&D(n,l),c&4&&D(o,a[2])},d(a){a&&A(e)}}}function _o(t){let e,l=Yt(t[1].d.i,1)+"",n,i,o;return{c(){e=m("div"),n=M(l),i=b(),o=M(t[2]),r(e,"class","text-right")},m(a,c){q(a,e,c),s(e,n),s(e,i),s(e,o)},p(a,c){c&2&&l!==(l=Yt(a[1].d.i,1)+"")&&D(n,l),c&4&&D(o,a[2])},d(a){a&&A(e)}}}function mo(t){let e,l=Yt(t[1].m.i)+"",n,i,o;return{c(){e=m("div"),n=M(l),i=b(),o=M(t[2]),r(e,"class","text-right")},m(a,c){q(a,e,c),s(e,n),s(e,i),s(e,o)},p(a,c){c&2&&l!==(l=Yt(a[1].m.i)+"")&&D(n,l),c&4&&D(o,a[2])},d(a){a&&A(e)}}}function po(t){let e,l=Yt(t[0].last_month.i)+"",n,i,o;return{c(){e=m("div"),n=M(l),i=b(),o=M(t[2]),r(e,"class","text-right")},m(a,c){q(a,e,c),s(e,n),s(e,i),s(e,o)},p(a,c){c&1&&l!==(l=Yt(a[0].last_month.i)+"")&&D(n,l),c&4&&D(o,a[2])},d(a){a&&A(e)}}}function V1(t){var f,p;let e,l,n=((p=(f=t[5].realtime)==null?void 0:f.title)!=null?p:"Real time calculations")+"",i,o,a,c,_,u=t[1]&&so(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("br"),c=m("br"),_=b(),u&&u.c(),r(e,"class","mx-2 text-sm")},m(d,v){q(d,e,v),s(e,l),s(l,i),s(e,o),s(e,a),s(e,c),s(e,_),u&&u.m(e,null)},p(d,[v]){var h,k;v&32&&n!==(n=((k=(h=d[5].realtime)==null?void 0:h.title)!=null?k:"Real time calculations")+"")&&D(i,n),d[1]?u?u.p(d,v):(u=so(d),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i:Xe,o:Xe,d(d){d&&A(e),u&&u.d()}}}function K1(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:a}=e,c={};vl.subscribe(O=>{l(5,c=O)});let _,u,f,p,d,v,h,k,g=!1,T=3;return t.$$set=O=>{"sysinfo"in O&&l(0,n=O.sysinfo),"data"in O&&l(1,i=O.data),"currency"in O&&l(2,o=O.currency),"hasExport"in O&&l(3,a=O.hasExport)},t.$$.update=()=>{var O,E,I,N,B,S,U,z;t.$$.dirty&19&&(l(4,g=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(14,T=g?3:2),l(6,_=ml(((O=i==null?void 0:i.h)==null?void 0:O.u)*1e3,"Wh")),l(7,u=ml(((E=i==null?void 0:i.d)==null?void 0:E.u)*1e3,"Wh")),l(8,f=ml(((I=i==null?void 0:i.m)==null?void 0:I.u)*1e3,"Wh")),l(9,p=ml(((N=n==null?void 0:n.last_month)==null?void 0:N.u)*1e3,"Wh")),l(10,d=ml(((B=i==null?void 0:i.h)==null?void 0:B.p)*1e3,"Wh")),l(11,v=ml(((S=i==null?void 0:i.d)==null?void 0:S.p)*1e3,"Wh")),l(12,h=ml(((U=i==null?void 0:i.m)==null?void 0:U.p)*1e3,"Wh")),l(13,k=ml(((z=n==null?void 0:n.last_month)==null?void 0:z.p)*1e3,"Wh")))},[n,i,o,a,g,c,_,u,f,p,d,v,h,k,T]}class Y1 extends Dt{constructor(e){super(),qt(this,e,K1,V1,Nt,{sysinfo:0,data:1,currency:2,hasExport:3})}}function Q1(t){let e,l,n=Es(t[0].source)+"",i,o,a,c,_;return c=new ln({props:{config:t[1]}}),{c(){e=m("a"),l=M("Provided by: "),i=M(n),a=b(),Re(c.$$.fragment),r(e,"href",o=Ps(t[0].source)),r(e,"target","_blank"),r(e,"class","text-xs float-right z-40")},m(u,f){q(u,e,f),s(e,l),s(e,i),q(u,a,f),De(c,u,f),_=!0},p(u,[f]){(!_||f&1)&&n!==(n=Es(u[0].source)+"")&&D(i,n),(!_||f&1&&o!==(o=Ps(u[0].source)))&&r(e,"href",o);const p={};f&2&&(p.config=u[1]),c.$set(p)},i(u){_||($(c.$$.fragment,u),_=!0)},o(u){fe(c.$$.fragment,u),_=!1},d(u){u&&A(e),u&&A(a),Le(c,u)}}}function X1(t,e,l){let{title:n}=e,{json:i}=e,{sysinfo:o}=e,a={},c,_,u=document.documentElement.classList.contains("dark");return t.$$set=f=>{"title"in f&&l(2,n=f.title),"json"in f&&l(0,i=f.json),"sysinfo"in f&&l(3,o=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&61){let f=i.currency,p=new Date().getUTCHours(),d=0,v=0,h=0,k=[],g=[],T=[];l(5,_=l(4,c=0));let O=new Date;for(Ll(O,o.clock_offset-(24+O.getHours()-O.getUTCHours())%24),d=p;d<24&&(v=i[Rt(h++)],v!=null);d++)g.push({label:Rt(O.getHours())}),T.push(v*100),l(5,_=Math.min(_,v*100)),l(4,c=Math.max(c,v*100)),Ll(O,1);for(d=0;d<24&&(v=i[Rt(h++)],v!=null);d++)g.push({label:Rt(O.getHours())}),T.push(v*100),l(5,_=Math.min(_,v*100)),l(4,c=Math.max(c,v*100)),Ll(O,1);if(_>-100&&c<100){switch(f){case"NOK":case"DKK":f="\xF8re";break;case"SEK":f="\xF6re";break;case"EUR":f="cent";break;case"CHF":f="rp.";break;default:f=f+"/100"}for(l(5,_*=100),l(4,c*=100),d=0;d=0?S.toFixed(U):"",title:S>=0?S.toFixed(2)+" "+f:"",value:v>=0?Math.abs(v):0,label2:S<0?S.toFixed(U):"",title2:S<0?S.toFixed(2)+" "+f:"",value2:v<0?Math.abs(v):0,color:u?"#5c2da5":"#7c3aed"})}let I=Math.max(c,Math.abs(_));if(_<0){l(5,_=Math.min(I/4*-1,_));let S=Math.ceil(Math.abs(_)/I*4),U=_/S;for(d=1;d{"title"in f&&l(1,n=f.title),"json"in f&&l(2,i=f.json),"sysinfo"in f&&l(3,o=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let f=0,p=[],d=[],v=[];l(5,_=l(4,c=0));let h=Ll(new Date,-24),k=new Date().getUTCHours();for(Ll(h,o.clock_offset-(24+h.getHours()-h.getUTCHours())%24),f=k;f<24;f++){let E=i["i"+Rt(f)],I=i["e"+Rt(f)];E===void 0&&(E=0),I===void 0&&(I=0),d.push({label:Rt(h.getHours())}),v.push({label:E.toFixed(1),title:E.toFixed(2)+" kWh",value:E*10,label2:I.toFixed(1),title2:I.toFixed(2)+" kWh",value2:I*10,color:u?"#5c2da5":"#7c3aed",color2:u?"#27728e":"#37829e"}),l(5,_=Math.max(_,I*10)),l(4,c=Math.max(c,E*10)),Ll(h,1)}for(f=0;f{"title"in f&&l(1,n=f.title),"json"in f&&l(2,i=f.json),"sysinfo"in f&&l(3,o=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let f=0,p=[],d=[],v=[];l(5,_=l(4,c=0));let h=new Date,k=new Date;for(Ll(h,o.clock_offset-(24+h.getHours()-h.getUTCHours())%24),Ll(k,o.clock_offset-(24+k.getHours()-k.getUTCHours())%24),k.setDate(0),f=h.getDate();f<=k.getDate();f++){let E=i["i"+Rt(f)],I=i["e"+Rt(f)];E===void 0&&(E=0),I===void 0&&(I=0),d.push({label:Rt(f)}),v.push({label:E.toFixed(E<10?1:0),title:E.toFixed(2)+" kWh",value:E,label2:I.toFixed(I<10?1:0),title2:I.toFixed(2)+" kWh",value2:I,color:u?"#5c2da5":"#7c3aed",color2:u?"#27728e":"#37829e"}),l(5,_=Math.max(_,I)),l(4,c=Math.max(c,E))}for(f=1;f{"title"in u&&l(1,n=u.title),"json"in u&&l(2,i=u.json)},t.$$.update=()=>{if(t.$$.dirty&30){let u=0,f=0,p=[],d=[],v=[];i.s&&i.s.forEach((g,T)=>{var O=g.n?g.n:g.a;f=g.v,f==-127&&(f=0),d.push({label:O.slice(-4)}),v.push({label:f.toFixed(1),value:f,color:o?"#5c2da5":"#7c3aed"}),l(4,_=Math.min(_,f)),l(3,c=Math.max(c,f))}),l(3,c=Math.ceil(c)),l(4,_=Math.floor(_));let h=c;_<0&&(h+=Math.abs(_));let k=h/4;for(u=0;u<5;u++)f=_+k*u,p.push({value:f,label:f.toFixed(1)});l(0,a={title:n+" (\xB0C)",dark:document.documentElement.classList.contains("dark"),height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:_,max:c,ticks:p},x:{ticks:d},points:v})}},[a,n,i,c,_]}class s0 extends Dt{constructor(e){super(),qt(this,e,i0,n0,Nt,{title:1,json:2})}}function o0(t){let e,l;return e=new ln({props:{config:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}let a0=0;function f0(t,e,l){let n={};vl.subscribe(u=>{l(2,n=u)});let{title:i}=e,o=document.documentElement.classList.contains("dark"),a={},c=0,_;return gu.subscribe(u=>{l(4,_=u)}),bu(),t.$$set=u=>{"title"in u&&l(1,i=u.title)},t.$$.update=()=>{var u;if(t.$$.dirty&30){let f=0,p=[],d=[],v=[];if(p.push({value:0,label:0}),_&&_.p)for(f=0;f<_.p.length;f++){let h=_.p[f];v.push({label:h.v.toFixed(2),value:h.v,color:o?"#5c2da5":"#7c3aed"}),d.push({label:h.d>0?Rt(h.d)+"."+((u=n.months)==null?void 0:u[new Date().getMonth()]):"-"}),l(3,c=Math.max(c,h.v))}if(_&&_.t){for(f=0;f<_.t.length;f++){let h=_.t[f];if(h>=c)break;p.push({value:h,label:h})}p.push({label:_.m.toFixed(1),align:"right",color:"green",value:_.m})}_&&_.c&&(p.push({label:_.c.toFixed(0),color:"orange",value:_.c}),l(3,c=Math.max(c,_.c))),l(3,c=Math.ceil(c)),l(0,a={title:i,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:35,bottom:20,left:35},y:{min:a0,max:c,ticks:p},x:{ticks:d},points:v})}},[a,i,n,c,_]}class u0 extends Dt{constructor(e){super(),qt(this,e,f0,o0,Nt,{title:1})}}function vo(t,e,l){const n=t.slice();return n[24]=e[l],n[26]=l,n}function ho(t,e,l){const n=t.slice();return n[27]=e[l],n}function r0(t){let e,l,n;return{c(){e=m("strong"),l=M(t[0]),n=M(" not available"),r(e,"class","text-sm")},m(i,o){q(i,e,o),s(e,l),s(e,n)},p(i,o){o&1&&D(l,i[0])},d(i){i&&A(e)}}}function c0(t){let e,l,n,i,o,a,c,_=t[8]&&bo(t);return{c(){e=m("strong"),l=M(t[0]),n=M(" ("),i=M(t[12]),o=M(")"),a=b(),_&&_.c(),c=Qt(),r(e,"class","text-sm")},m(u,f){q(u,e,f),s(e,l),s(e,n),s(e,i),s(e,o),q(u,a,f),_&&_.m(u,f),q(u,c,f)},p(u,f){f&1&&D(l,u[0]),f&4096&&D(i,u[12]),u[8]?_?_.p(u,f):(_=bo(u),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null)},d(u){u&&A(e),u&&A(a),_&&_.d(u),u&&A(c)}}}function bo(t){let e,l,n,i,o,a=t[8],c=[];for(let f=0;ft[17].call(e))},m(a,c){q(a,e,c),o.m(e,null),l=Vi(e,t[17].bind(e))},p(a,[c]){i===(i=n(a))&&o?o.p(a,c):(o.d(1),o=i(a),o&&(o.c(),o.m(e,null)))},i:Xe,o:Xe,d(a){a&&A(e),o.d(),l()}}}function m0(t,e,l){let{title:n}=e,i=document.documentElement.classList.contains("dark"),o=0,a=0,c=0,_=0,u=!1,f=null;Ii.subscribe(F=>{l(16,f=F)});let p=!1;function d(){_==60||c>o||c-o>300?(Oi(),_=0):Ii.update(F=>{if(F.lastUpdate)for(;o>F.lastUpdate;)F.data.unshift(a),F.data=F.data.slice(0,F.size),F.lastUpdate+=10,_++;else F.lastUpdate=o;return F})}cu.subscribe(F=>{if(a=F.i-F.e,o=F.u,!u){Oi(),u=!0,c=o;return}!xr()||d()});let v,h,k,g,T,O,E,I=function(F,R,G){return Math.ceil(T-(F-R)/(G-R)*T)-25},N=function(F){return 30+Math.ceil(F/f.size*(O-35))},B,S,U,z;function V(){k=this.clientWidth,g=this.clientHeight,l(3,k),l(4,g)}return t.$$set=F=>{"title"in F&&l(0,n=F.title)},t.$$.update=()=>{if(t.$$.dirty&67582)if(l(5,T=parseInt(g)-50),l(6,O=k-35),l(10,U=O/f.size),l(2,h=0),l(1,v=0),f.data&&T>10&&O>100&&U>.1){l(11,p=!0);for(let G in f.data){let j=f.data[G];isNaN(j)&&(j=0),l(1,v=Math.max(Math.ceil(j/1e3)*1e3,v)),l(2,h=Math.min(Math.floor(j/1e3)*1e3,h))}let F=v-h;l(12,z=v>2500?"kW":"W"),l(8,B=[]);for(let G=h;G2500?(G/1e3).toFixed(1):G}),!(B.length>6));G+=F/5);l(9,S=[]);for(let G=0;G12));G+=Math.round(f.size/Math.round(O/120)));let R=f.size;l(7,E=N(f.size)+","+I(0,h,v)+" "+N(1)+","+I(0,h,v));for(let G in f.data){if(R<0)break;let j=f.data[G];isNaN(j)&&(j=0),l(7,E=N(R--)+","+I(j,h,v)+" "+E)}}else l(11,p=!1)},[n,v,h,k,g,T,O,E,B,S,U,p,z,i,I,N,f,V]}class p0 extends Dt{constructor(e){super(),qt(this,e,m0,_0,Nt,{title:0})}}function d0(t){let e,l;return e=new ln({props:{config:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function v0(t,e,l){let{title:n}=e,{unit:i=""}=e,{l1:o=!1}=e,{l2:a=!1}=e,{l2x:c=!1}=e,{l3:_=!1}=e,{l1i:u=0}=e,{l2i:f=0}=e,{l3i:p=0}=e,{l1e:d=0}=e,{l2e:v=0}=e,{l3e:h=0}=e,{maxImport:k=0}=e,{maxExport:g=0}=e,{importColorFn:T}=e,{exportColorFn:O}=e,E={};function I(N,B){return{label:Yt(N>900?N/1e3:N)+(N>900?"k":"")+i,title:N.toFixed(2)+" "+i,value:isNaN(N)?0:N,color:T(N?N/k*100:0,document.documentElement.classList.contains("dark")),label2:Yt(B>900?B/1e3:B)+(B>900?"k":"")+i,title2:B.toFixed(2)+" "+i,value2:isNaN(B)?0:B,color2:O(B?B/g*100:0)}}return t.$$set=N=>{"title"in N&&l(1,n=N.title),"unit"in N&&l(2,i=N.unit),"l1"in N&&l(3,o=N.l1),"l2"in N&&l(4,a=N.l2),"l2x"in N&&l(5,c=N.l2x),"l3"in N&&l(6,_=N.l3),"l1i"in N&&l(7,u=N.l1i),"l2i"in N&&l(8,f=N.l2i),"l3i"in N&&l(9,p=N.l3i),"l1e"in N&&l(10,d=N.l1e),"l2e"in N&&l(11,v=N.l2e),"l3e"in N&&l(12,h=N.l3e),"maxImport"in N&&l(13,k=N.maxImport),"maxExport"in N&&l(14,g=N.maxExport),"importColorFn"in N&&l(15,T=N.importColorFn),"exportColorFn"in N&&l(16,O=N.exportColorFn)},t.$$.update=()=>{if(t.$$.dirty&32762){let N=[],B=[];o&&(N.push({label:"L1"}),B.push(I(u,d))),a&&(c?(N.push({label:"L2"}),B.push({label:"Not available",labelAngle:-90,title:"L2 current is not reported by your meter",value:0,color:"#7c3aedcc"})):(N.push({label:"L2"}),B.push(I(f,v)))),_&&(N.push({label:"L3"}),B.push(I(p,h)));let S=[];if(g){let U=g>k?4:g*4/k;S.push({value:-g,label:"-100%"}),U>=4&&S.push({value:-g/4*3,label:"-75%"}),U>=2&&S.push({value:-g/2,label:"-50%"}),U>=4&&S.push({value:-g/4,label:"-25%"})}if(S.push({value:0,label:"0%"}),k){let U=k>g?4:k*4/g;S.push({value:k/4,label:"25%"}),U>=4&&S.push({value:k/2,label:"50%"}),U>=2&&S.push({value:k/4*3,label:"75%"}),U>=4&&S.push({value:k,label:"100%"})}l(0,E={title:n,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:15,bottom:20,left:35},y:{min:-g,max:k,ticks:S},x:{ticks:N},points:B})}},[E,n,i,o,a,c,_,u,f,p,d,v,h,k,g,T,O]}class ls extends Dt{constructor(e){super(),qt(this,e,v0,d0,Nt,{title:1,unit:2,l1:3,l2:4,l2x:5,l3:6,l1i:7,l2i:8,l3i:9,l1e:10,l2e:11,l3e:12,maxImport:13,maxExport:14,importColorFn:15,exportColorFn:16})}}function So(t){var T,O;let e,l,n,i,o,a,c=(t[0].mt?_i(t[0].mt):"-")+"",_,u,f,p=t[7][0]+"",d,v,h=t[7][1]+"",k,g;return i=new Cu({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:(O=(T=t[6].common)==null?void 0:T.import)!=null?O:"Import",sub:t[0].p,subunit:t[0].pc,colorFn:Zi}}),{c(){e=m("div"),l=m("div"),n=m("div"),Re(i.$$.fragment),o=b(),a=m("div"),_=M(c),u=b(),f=m("div"),d=M(p),v=b(),k=M(h),r(n,"class","col-span-2"),r(f,"class","text-right"),r(l,"class","grid grid-cols-2"),r(e,"class","cnt")},m(E,I){q(E,e,I),s(e,l),s(l,n),De(i,n,null),s(l,o),s(l,a),s(a,_),s(l,u),s(l,f),s(f,d),s(f,v),s(f,k),g=!0},p(E,I){var B,S;const N={};I&1&&(N.val=E[0].i?E[0].i:0),I&1&&(N.max=E[0].im?E[0].im:15e3),I&64&&(N.label=(S=(B=E[6].common)==null?void 0:B.import)!=null?S:"Import"),I&1&&(N.sub=E[0].p),I&1&&(N.subunit=E[0].pc),i.$set(N),(!g||I&1)&&c!==(c=(E[0].mt?_i(E[0].mt):"-")+"")&&D(_,c),(!g||I&128)&&p!==(p=E[7][0]+"")&&D(d,p),(!g||I&128)&&h!==(h=E[7][1]+"")&&D(k,h)},i(E){g||($(i.$$.fragment,E),g=!0)},o(E){fe(i.$$.fragment,E),g=!1},d(E){E&&A(e),Le(i)}}}function Co(t){var k,g;let e,l,n,i,o,a,c,_,u=t[8][0]+"",f,p,d=t[8][1]+"",v,h;return i=new Cu({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:(g=(k=t[6].common)==null?void 0:k.export)!=null?g:"Export",sub:t[0].px,subunit:t[0].pc,colorFn:Qn}}),{c(){e=m("div"),l=m("div"),n=m("div"),Re(i.$$.fragment),o=b(),a=m("div"),c=b(),_=m("div"),f=M(u),p=b(),v=M(d),r(n,"class","col-span-2"),r(_,"class","text-right"),r(l,"class","grid grid-cols-2"),r(e,"class","cnt")},m(T,O){q(T,e,O),s(e,l),s(l,n),De(i,n,null),s(l,o),s(l,a),s(l,c),s(l,_),s(_,f),s(_,p),s(_,v),h=!0},p(T,O){var I,N;const E={};O&1&&(E.val=T[0].e?T[0].e:0),O&1&&(E.max=T[0].om?T[0].om*1e3:1e4),O&64&&(E.label=(N=(I=T[6].common)==null?void 0:I.export)!=null?N:"Export"),O&1&&(E.sub=T[0].px),O&1&&(E.subunit=T[0].pc),i.$set(E),(!h||O&256)&&u!==(u=T[8][0]+"")&&D(f,u),(!h||O&256)&&d!==(d=T[8][1]+"")&&D(v,d)},i(T){h||($(i.$$.fragment,T),h=!0)},o(T){fe(i.$$.fragment,T),h=!1},d(T){T&&A(e),Le(i)}}}function No(t){let e,l,n=t[0].l1&&To(t);return{c(){e=m("div"),n&&n.c(),r(e,"class","cnt")},m(i,o){q(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&$(n,1)):(n=To(i),n.c(),$(n,1),n.m(e,null)):n&&(gt(),fe(n,1,1,()=>{n=null}),kt())},i(i){l||($(n),l=!0)},o(i){fe(n),l=!1},d(i){i&&A(e),n&&n.d()}}}function To(t){var n,i;let e,l;return e=new j1({props:{title:(i=(n=t[6].common)==null?void 0:n.voltage)!=null?i:"Volt",u1:t[0].l1.u,u2:t[0].l2.u,u3:t[0].l3.u,ds:t[0].ds}}),{c(){Re(e.$$.fragment)},m(o,a){De(e,o,a),l=!0},p(o,a){var _,u;const c={};a&64&&(c.title=(u=(_=o[6].common)==null?void 0:_.voltage)!=null?u:"Volt"),a&1&&(c.u1=o[0].l1.u),a&1&&(c.u2=o[0].l2.u),a&1&&(c.u3=o[0].l3.u),a&1&&(c.ds=o[0].ds),e.$set(c)},i(o){l||($(e.$$.fragment,o),l=!0)},o(o){fe(e.$$.fragment,o),l=!1},d(o){Le(e,o)}}}function Eo(t){let e,l,n=t[0].l1&&Po(t);return{c(){e=m("div"),n&&n.c(),r(e,"class","cnt")},m(i,o){q(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&$(n,1)):(n=Po(i),n.c(),$(n,1),n.m(e,null)):n&&(gt(),fe(n,1,1,()=>{n=null}),kt())},i(i){l||($(n),l=!0)},o(i){fe(n),l=!1},d(i){i&&A(e),n&&n.d()}}}function Po(t){var n,i;let e,l;return e=new ls({props:{title:(i=(n=t[6].common)==null?void 0:n.amperage)!=null?i:"Amp",unit:"A",importColorFn:Zi,exportColorFn:Qn,maxImport:t[0].mf,maxExport:t[0].om?t[9]?t[0].om/.4/Math.sqrt(3):t[0].om/.23:0,l1:t[0].l1&&t[0].l1.u>100,l2:t[0].l2&&t[0].l2.u>100,l3:t[0].l3&&t[0].l3.u>100,l2x:t[0].l2.e,l1i:Math.max(t[0].l1.i,0),l2i:Math.max(t[0].l2.i,0),l3i:Math.max(t[0].l3.i,0),l1e:Math.max(t[0].l1.i*-1,0),l2e:Math.max(t[0].l2.i*-1,0),l3e:Math.max(t[0].l3.i*-1,0)}}),{c(){Re(e.$$.fragment)},m(o,a){De(e,o,a),l=!0},p(o,a){var _,u;const c={};a&64&&(c.title=(u=(_=o[6].common)==null?void 0:_.amperage)!=null?u:"Amp"),a&1&&(c.maxImport=o[0].mf),a&513&&(c.maxExport=o[0].om?o[9]?o[0].om/.4/Math.sqrt(3):o[0].om/.23:0),a&1&&(c.l1=o[0].l1&&o[0].l1.u>100),a&1&&(c.l2=o[0].l2&&o[0].l2.u>100),a&1&&(c.l3=o[0].l3&&o[0].l3.u>100),a&1&&(c.l2x=o[0].l2.e),a&1&&(c.l1i=Math.max(o[0].l1.i,0)),a&1&&(c.l2i=Math.max(o[0].l2.i,0)),a&1&&(c.l3i=Math.max(o[0].l3.i,0)),a&1&&(c.l1e=Math.max(o[0].l1.i*-1,0)),a&1&&(c.l2e=Math.max(o[0].l2.i*-1,0)),a&1&&(c.l3e=Math.max(o[0].l3.i*-1,0)),e.$set(c)},i(o){l||($(e.$$.fragment,o),l=!0)},o(o){fe(e.$$.fragment,o),l=!1},d(o){Le(e,o)}}}function Ao(t){let e,l,n=t[0].l1&&qo(t);return{c(){e=m("div"),n&&n.c(),r(e,"class","cnt")},m(i,o){q(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&$(n,1)):(n=qo(i),n.c(),$(n,1),n.m(e,null)):n&&(gt(),fe(n,1,1,()=>{n=null}),kt())},i(i){l||($(n),l=!0)},o(i){fe(n),l=!1},d(i){i&&A(e),n&&n.d()}}}function qo(t){var n,i;let e,l;return e=new ls({props:{title:(i=(n=t[6].dashboard)==null?void 0:n.phase)!=null?i:"Phase",unit:"W",importColorFn:Zi,exportColorFn:Qn,maxImport:(t[0].mf?t[0].mf:32)*230,maxExport:t[0].om?t[9]?t[0].om*1e3/Math.sqrt(3):t[0].om*1e3:0,l1:t[0].l1&&t[0].l1.u>100,l2:t[0].l2&&t[0].l2.u>100,l3:t[0].l3&&t[0].l3.u>100,l1i:t[0].l1.p,l2i:t[0].l2.p,l3i:t[0].l3.p,l1e:t[0].l1.q,l2e:t[0].l2.q,l3e:t[0].l3.q}}),{c(){Re(e.$$.fragment)},m(o,a){De(e,o,a),l=!0},p(o,a){var _,u;const c={};a&64&&(c.title=(u=(_=o[6].dashboard)==null?void 0:_.phase)!=null?u:"Phase"),a&1&&(c.maxImport=(o[0].mf?o[0].mf:32)*230),a&513&&(c.maxExport=o[0].om?o[9]?o[0].om*1e3/Math.sqrt(3):o[0].om*1e3:0),a&1&&(c.l1=o[0].l1&&o[0].l1.u>100),a&1&&(c.l2=o[0].l2&&o[0].l2.u>100),a&1&&(c.l3=o[0].l3&&o[0].l3.u>100),a&1&&(c.l1i=o[0].l1.p),a&1&&(c.l2i=o[0].l2.p),a&1&&(c.l3i=o[0].l3.p),a&1&&(c.l1e=o[0].l1.q),a&1&&(c.l2e=o[0].l2.q),a&1&&(c.l3e=o[0].l3.q),e.$set(c)},i(o){l||($(e.$$.fragment,o),l=!0)},o(o){fe(e.$$.fragment,o),l=!1},d(o){Le(e,o)}}}function Do(t){let e,l,n=t[0].l1&&Lo(t);return{c(){e=m("div"),n&&n.c(),r(e,"class","cnt")},m(i,o){q(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&$(n,1)):(n=Lo(i),n.c(),$(n,1),n.m(e,null)):n&&(gt(),fe(n,1,1,()=>{n=null}),kt())},i(i){l||($(n),l=!0)},o(i){fe(n),l=!1},d(i){i&&A(e),n&&n.d()}}}function Lo(t){var n,i;let e,l;return e=new ls({props:{title:(i=(n=t[6].dashboard)==null?void 0:n.pf)!=null?i:"Pf",importColorFn:Qn,exportColorFn:Qn,maxImport:1,l1:t[0].l1&&t[0].l1.u>100,l2:t[0].l2&&t[0].l2.u>100,l3:t[0].l3&&t[0].l3.u>100,l1i:t[0].l1.f,l2i:t[0].l2.f,l3i:t[0].l3.f}}),{c(){Re(e.$$.fragment)},m(o,a){De(e,o,a),l=!0},p(o,a){var _,u;const c={};a&64&&(c.title=(u=(_=o[6].dashboard)==null?void 0:_.pf)!=null?u:"Pf"),a&1&&(c.l1=o[0].l1&&o[0].l1.u>100),a&1&&(c.l2=o[0].l2&&o[0].l2.u>100),a&1&&(c.l3=o[0].l3&&o[0].l3.u>100),a&1&&(c.l1i=o[0].l1.f),a&1&&(c.l2i=o[0].l2.f),a&1&&(c.l3i=o[0].l3.f),e.$set(c)},i(o){l||($(e.$$.fragment,o),l=!0)},o(o){fe(e.$$.fragment,o),l=!1},d(o){Le(e,o)}}}function Oo(t){let e,l,n;return l=new z1({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","cnt")},m(i,o){q(i,e,o),De(l,e,null),n=!0},p(i,o){const a={};o&1&&(a.importInstant=i[0].ri),o&1&&(a.exportInstant=i[0].re),o&1&&(a.importTotal=i[0].ric),o&1&&(a.exportTotal=i[0].rec),l.$set(a)},i(i){n||($(l.$$.fragment,i),n=!0)},o(i){fe(l.$$.fragment,i),n=!1},d(i){i&&A(e),Le(l)}}}function Io(t){let e,l,n;return l=new Y1({props:{sysinfo:t[1],data:t[0].ea,currency:t[0].pc,hasExport:t[0].om>0||t[0].e>0}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","cnt")},m(i,o){q(i,e,o),De(l,e,null),n=!0},p(i,o){const a={};o&2&&(a.sysinfo=i[1]),o&1&&(a.data=i[0].ea),o&1&&(a.currency=i[0].pc),o&1&&(a.hasExport=i[0].om>0||i[0].e>0),l.$set(a)},i(i){n||($(l.$$.fragment,i),n=!0)},o(i){fe(l.$$.fragment,i),n=!1},d(i){i&&A(e),Le(l)}}}function Ro(t){var i,o;let e,l,n;return l=new u0({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.tariffpeak)!=null?o:"Tariff peaks"}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","cnt h-64")},m(a,c){q(a,e,c),De(l,e,null),n=!0},p(a,c){var u,f;const _={};c&64&&(_.title=(f=(u=a[6].dashboard)==null?void 0:u.tariffpeak)!=null?f:"Tariff peaks"),l.$set(_)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){fe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function Fo(t){var i,o;let e,l,n;return l=new p0({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.realtime)!=null?o:"Real time"}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","cnt gwf")},m(a,c){q(a,e,c),De(l,e,null),n=!0},p(a,c){var u,f;const _={};c&64&&(_.title=(f=(u=a[6].dashboard)==null?void 0:u.realtime)!=null?f:"Real time"),l.$set(_)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){fe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function Uo(t){var i,o;let e,l,n;return l=new Z1({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.price)!=null?o:"Price",json:t[2],sysinfo:t[1]}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","cnt gwf")},m(a,c){q(a,e,c),De(l,e,null),n=!0},p(a,c){var u,f;const _={};c&64&&(_.title=(f=(u=a[6].dashboard)==null?void 0:u.price)!=null?f:"Price"),c&4&&(_.json=a[2]),c&2&&(_.sysinfo=a[1]),l.$set(_)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){fe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function Bo(t){var i,o;let e,l,n;return l=new x1({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.day)!=null?o:"24 hours",json:t[3],sysinfo:t[1]}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","cnt gwf")},m(a,c){q(a,e,c),De(l,e,null),n=!0},p(a,c){var u,f;const _={};c&64&&(_.title=(f=(u=a[6].dashboard)==null?void 0:u.day)!=null?f:"24 hours"),c&8&&(_.json=a[3]),c&2&&(_.sysinfo=a[1]),l.$set(_)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){fe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function jo(t){var i,o;let e,l,n;return l=new l0({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.month)!=null?o:"{0} days",json:t[4],sysinfo:t[1]}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","cnt gwf")},m(a,c){q(a,e,c),De(l,e,null),n=!0},p(a,c){var u,f;const _={};c&64&&(_.title=(f=(u=a[6].dashboard)==null?void 0:u.month)!=null?f:"{0} days"),c&16&&(_.json=a[4]),c&2&&(_.sysinfo=a[1]),l.$set(_)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){fe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function Ho(t){var i,o;let e,l,n;return l=new s0({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.temperature)!=null?o:"Temperature",json:t[5]}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","cnt gwf")},m(a,c){q(a,e,c),De(l,e,null),n=!0},p(a,c){var u,f;const _={};c&64&&(_.title=(f=(u=a[6].dashboard)==null?void 0:u.temperature)!=null?f:"Temperature"),c&32&&(_.json=a[5]),l.$set(_)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){fe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function h0(t){let e,l=Vt(t[1].ui.i,t[0].i),n,i=Vt(t[1].ui.e,t[0].om||t[0].e>0),o,a=Vt(t[1].ui.v,t[0].l1&&(t[0].l1.u>100||t[0].l2.u>100||t[0].l3.u>100)),c,_=Vt(t[1].ui.a,t[0].l1&&(t[0].l1.i>.01||t[0].l2.i>.01||t[0].l3.i>.01)),u,f=Vt(t[1].ui.h,t[0].l1&&(t[0].l1.p>.01||t[0].l2.p>.01||t[0].l3.p>.01||t[0].l1.q>.01||t[0].l2.q>.01||t[0].l3.q>.01)),p,d=Vt(t[1].ui.f,t[0].l1&&(t[0].l1.f>.01||t[0].l2.f>.01||t[0].l3.f>.01)),v,h=Vt(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),k,g=Vt(t[1].ui.c,t[0].ea),T,O=Vt(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("NO")||t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),E,I=Vt(t[1].ui.l,t[0].hm==1),N,B=Vt(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),S,U=Vt(t[1].ui.d,t[3]),z,V=Vt(t[1].ui.m,t[4]),F,R=Vt(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),G,j=l&&So(t),H=i&&Co(t),W=a&&No(t),K=_&&Eo(t),Q=f&&Ao(t),J=d&&Do(t),ae=h&&Oo(t),Z=g&&Io(t),X=O&&Ro(t),oe=I&&Fo(t),ne=B&&Uo(t),ie=U&&Bo(t),re=V&&jo(t),me=R&&Ho(t);return{c(){e=m("div"),j&&j.c(),n=b(),H&&H.c(),o=b(),W&&W.c(),c=b(),K&&K.c(),u=b(),Q&&Q.c(),p=b(),J&&J.c(),v=b(),ae&&ae.c(),k=b(),Z&&Z.c(),T=b(),X&&X.c(),E=b(),oe&&oe.c(),N=b(),ne&&ne.c(),S=b(),ie&&ie.c(),z=b(),re&&re.c(),F=b(),me&&me.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(Y,x){q(Y,e,x),j&&j.m(e,null),s(e,n),H&&H.m(e,null),s(e,o),W&&W.m(e,null),s(e,c),K&&K.m(e,null),s(e,u),Q&&Q.m(e,null),s(e,p),J&&J.m(e,null),s(e,v),ae&&ae.m(e,null),s(e,k),Z&&Z.m(e,null),s(e,T),X&&X.m(e,null),s(e,E),oe&&oe.m(e,null),s(e,N),ne&&ne.m(e,null),s(e,S),ie&&ie.m(e,null),s(e,z),re&&re.m(e,null),s(e,F),me&&me.m(e,null),G=!0},p(Y,[x]){x&3&&(l=Vt(Y[1].ui.i,Y[0].i)),l?j?(j.p(Y,x),x&3&&$(j,1)):(j=So(Y),j.c(),$(j,1),j.m(e,n)):j&&(gt(),fe(j,1,1,()=>{j=null}),kt()),x&3&&(i=Vt(Y[1].ui.e,Y[0].om||Y[0].e>0)),i?H?(H.p(Y,x),x&3&&$(H,1)):(H=Co(Y),H.c(),$(H,1),H.m(e,o)):H&&(gt(),fe(H,1,1,()=>{H=null}),kt()),x&3&&(a=Vt(Y[1].ui.v,Y[0].l1&&(Y[0].l1.u>100||Y[0].l2.u>100||Y[0].l3.u>100))),a?W?(W.p(Y,x),x&3&&$(W,1)):(W=No(Y),W.c(),$(W,1),W.m(e,c)):W&&(gt(),fe(W,1,1,()=>{W=null}),kt()),x&3&&(_=Vt(Y[1].ui.a,Y[0].l1&&(Y[0].l1.i>.01||Y[0].l2.i>.01||Y[0].l3.i>.01))),_?K?(K.p(Y,x),x&3&&$(K,1)):(K=Eo(Y),K.c(),$(K,1),K.m(e,u)):K&&(gt(),fe(K,1,1,()=>{K=null}),kt()),x&3&&(f=Vt(Y[1].ui.h,Y[0].l1&&(Y[0].l1.p>.01||Y[0].l2.p>.01||Y[0].l3.p>.01||Y[0].l1.q>.01||Y[0].l2.q>.01||Y[0].l3.q>.01))),f?Q?(Q.p(Y,x),x&3&&$(Q,1)):(Q=Ao(Y),Q.c(),$(Q,1),Q.m(e,p)):Q&&(gt(),fe(Q,1,1,()=>{Q=null}),kt()),x&3&&(d=Vt(Y[1].ui.f,Y[0].l1&&(Y[0].l1.f>.01||Y[0].l2.f>.01||Y[0].l3.f>.01))),d?J?(J.p(Y,x),x&3&&$(J,1)):(J=Do(Y),J.c(),$(J,1),J.m(e,v)):J&&(gt(),fe(J,1,1,()=>{J=null}),kt()),x&3&&(h=Vt(Y[1].ui.r,Y[0].ri>0||Y[0].re>0||Y[0].ric>0||Y[0].rec>0)),h?ae?(ae.p(Y,x),x&3&&$(ae,1)):(ae=Oo(Y),ae.c(),$(ae,1),ae.m(e,k)):ae&&(gt(),fe(ae,1,1,()=>{ae=null}),kt()),x&3&&(g=Vt(Y[1].ui.c,Y[0].ea)),g?Z?(Z.p(Y,x),x&3&&$(Z,1)):(Z=Io(Y),Z.c(),$(Z,1),Z.m(e,T)):Z&&(gt(),fe(Z,1,1,()=>{Z=null}),kt()),x&3&&(O=Vt(Y[1].ui.t,Y[0].pr&&(Y[0].pr.startsWith("NO")||Y[0].pr.startsWith("10YNO")||Y[0].pr.startsWith("10Y1001A1001A4")))),O?X?(X.p(Y,x),x&3&&$(X,1)):(X=Ro(Y),X.c(),$(X,1),X.m(e,E)):X&&(gt(),fe(X,1,1,()=>{X=null}),kt()),x&3&&(I=Vt(Y[1].ui.l,Y[0].hm==1)),I?oe?(oe.p(Y,x),x&3&&$(oe,1)):(oe=Fo(Y),oe.c(),$(oe,1),oe.m(e,N)):oe&&(gt(),fe(oe,1,1,()=>{oe=null}),kt()),x&3&&(B=Vt(Y[1].ui.p,Y[0].pe&&!Number.isNaN(Y[0].p))),B?ne?(ne.p(Y,x),x&3&&$(ne,1)):(ne=Uo(Y),ne.c(),$(ne,1),ne.m(e,S)):ne&&(gt(),fe(ne,1,1,()=>{ne=null}),kt()),x&10&&(U=Vt(Y[1].ui.d,Y[3])),U?ie?(ie.p(Y,x),x&10&&$(ie,1)):(ie=Bo(Y),ie.c(),$(ie,1),ie.m(e,z)):ie&&(gt(),fe(ie,1,1,()=>{ie=null}),kt()),x&18&&(V=Vt(Y[1].ui.m,Y[4])),V?re?(re.p(Y,x),x&18&&$(re,1)):(re=jo(Y),re.c(),$(re,1),re.m(e,F)):re&&(gt(),fe(re,1,1,()=>{re=null}),kt()),x&35&&(R=Vt(Y[1].ui.s,Y[0].t&&Y[0].t!=-127&&Y[5].c>1)),R?me?(me.p(Y,x),x&35&&$(me,1)):(me=Ho(Y),me.c(),$(me,1),me.m(e,null)):me&&(gt(),fe(me,1,1,()=>{me=null}),kt())},i(Y){G||($(j),$(H),$(W),$(K),$(Q),$(J),$(ae),$(Z),$(X),$(oe),$(ne),$(ie),$(re),$(me),G=!0)},o(Y){fe(j),fe(H),fe(W),fe(K),fe(Q),fe(J),fe(ae),fe(Z),fe(X),fe(oe),fe(ne),fe(ie),fe(re),fe(me),G=!1},d(Y){Y&&A(e),j&&j.d(),H&&H.d(),W&&W.d(),K&&K.d(),Q&&Q.d(),J&&J.d(),ae&&ae.d(),Z&&Z.d(),X&&X.d(),oe&&oe.d(),ne&&ne.d(),ie&&ie.d(),re&&re.d(),me&&me.d()}}}function b0(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},a={},c={},_={};$i.subscribe(g=>{l(2,o=g)}),pu.subscribe(g=>{l(3,a=g)}),du.subscribe(g=>{l(4,c=g)}),hu.subscribe(g=>{l(5,_=g)});let u={};vl.subscribe(g=>{l(6,u=g)});let f,p,d,v,h,k;return t.$$set=g=>{"data"in g&&l(0,n=g.data),"sysinfo"in g&&l(1,i=g.sysinfo)},t.$$.update=()=>{var g,T,O,E,I,N,B,S,U,z,V,F;t.$$.dirty&7169&&(l(7,f=ml((n==null?void 0:n.ic)*1e3,"Wh")),l(8,p=ml((n==null?void 0:n.ec)*1e3,"Wh")),l(10,v=((g=n==null?void 0:n.l1)==null?void 0:g.u)>0||((T=n==null?void 0:n.l1)==null?void 0:T.i)>0||((O=n==null?void 0:n.l1)==null?void 0:O.p)>0||((E=n==null?void 0:n.l1)==null?void 0:E.q)>0),l(11,h=((I=n==null?void 0:n.l2)==null?void 0:I.u)>0||((N=n==null?void 0:n.l2)==null?void 0:N.i)>0||((B=n==null?void 0:n.l2)==null?void 0:B.p)>0||((S=n==null?void 0:n.l2)==null?void 0:S.q)>0),l(12,k=((U=n==null?void 0:n.l3)==null?void 0:U.u)>0||((z=n==null?void 0:n.l3)==null?void 0:z.i)>0||((V=n==null?void 0:n.l3)==null?void 0:V.p)>0||((F=n==null?void 0:n.l3)==null?void 0:F.q)>0),l(9,d=v&&h&&k))},[n,i,o,a,c,_,u,f,p,d,v,h,k]}class g0 extends Dt{constructor(e){super(),qt(this,e,b0,h0,Nt,{data:0,sysinfo:1})}}let Fi={};const Wn=xt(Fi);async function k0(){Fi=await(await fetch("configuration.json")).json(),Wn.set(Fi)}let Ui={};const Nu=xt(Ui);async function w0(){Ui=await(await fetch("priceconfig.json")).json(),Nu.set(Ui)}function yo(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function M0(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){q(l,e,n)},d(l){l&&A(e)}}}function S0(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){q(l,e,n)},d(l){l&&A(e)}}}function zo(t){let e;return{c(){e=m("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){q(l,e,n)},d(l){l&&A(e)}}}function Wo(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){q(i,e,o),q(i,l,o),q(i,n,o)},d(i){i&&A(e),i&&A(l),i&&A(n)}}}function Go(t){let e;return{c(){e=m("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){q(l,e,n)},d(l){l&&A(e)}}}function Vo(t){let e,l,n;return{c(){e=m("option"),l=M("GPIO"),n=M(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){q(i,e,o),s(e,l),s(e,n)},d(i){i&&A(e)}}}function Ko(t){let e,l=t[4]>1&&!(t[0]=="esp32"&&(t[4]==9||t[4]==16))&&!((t[0]=="esp32s2"||t[0]=="esp32s3")&&t[4]==18)&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Vo(t);return{c(){l&&l.c(),e=Qt()},m(n,i){l&&l.m(n,i),q(n,e,i)},p(n,i){n[4]>1&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!((n[0]=="esp32s2"||n[0]=="esp32s3")&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Vo(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&A(e)}}}function C0(t){let e,l,n,i,o;function a(h,k){return h[0]=="esp32c3"?S0:M0}let c=a(t),_=c(t),u=t[0]=="esp8266"&&zo(),f=(t[0]=="esp32"||t[0]=="esp32solo")&&Wo(),p=(t[0]=="esp32s2"||t[0]=="esp32s3")&&Go(),d={length:t[1]+1},v=[];for(let h=0;h{"chip"in o&&l(0,n=o.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32s3":l(1,i=46);break;case"esp32c3":l(1,i=19);break}},[n,i]}class Bi extends Dt{constructor(e){super(),qt(this,e,N0,C0,Nt,{chip:0})}}function Yo(t){let e,l,n=t[1]&&Qo(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 dark:bg-opacity-80 flex items-center justify-center"),r(e,"class","z-50"),r(e,"aria-modal","true")},m(i,o){q(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=Qo(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&A(e),n&&n.d()}}}function Qo(t){let e,l;return{c(){e=m("div"),l=M(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){q(n,e,i),s(e,l)},p(n,i){i&2&&D(l,n[1])},d(n){n&&A(e)}}}function T0(t){let e,l=t[0]&&Yo(t);return{c(){l&&l.c(),e=Qt()},m(n,i){l&&l.m(n,i),q(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Yo(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Xe,o:Xe,d(n){l&&l.d(n),n&&A(e)}}}function E0(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 pl extends Dt{constructor(e){super(),qt(this,e,E0,T0,Nt,{active:0,message:1})}}function Xo(t,e,l){const n=t.slice();return n[1]=e[l],n}function Zo(t){let e,l,n=t[1]+"",i;return{c(){e=m("option"),l=M("Europe/"),i=M(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,a){q(o,e,a),s(e,l),s(e,i)},p:Xe,d(o){o&&A(e)}}}function P0(t){let e,l,n,i=t[0],o=[];for(let a=0;a>1&1,L=0;L0;w--)L[w]=L[w]?L[w-1]^N.EXPONENT[U._modN(N.LOG[L[w]]+C)]:L[w-1];L[0]=N.EXPONENT[U._modN(N.LOG[L[0]]+C)]}for(C=0;C<=P;C++)L[C]=N.LOG[L[C]]},_checkBadness:function(){var C,w,P,L,y,ee=0,le=this._badness,se=this.buffer,_e=this.width;for(y=0;y<_e-1;y++)for(L=0;L<_e-1;L++)(se[L+_e*y]&&se[L+1+_e*y]&&se[L+_e*(y+1)]&&se[L+1+_e*(y+1)]||!(se[L+_e*y]||se[L+1+_e*y]||se[L+_e*(y+1)]||se[L+1+_e*(y+1)]))&&(ee+=U.N2);var Te=0;for(y=0;y<_e;y++){for(P=0,le[0]=0,C=0,L=0;L<_e;L++)w=se[L+_e*y],C===w?le[P]++:le[++P]=1,C=w,Te+=C?1:-1;ee+=this._getBadness(P)}Te<0&&(Te=-Te);var Se=0,de=Te;for(de+=de<<2,de<<=1;de>_e*_e;)de-=_e*_e,Se++;for(ee+=Se*U.N4,L=0;L<_e;L++){for(P=0,le[0]=0,C=0,y=0;y<_e;y++)w=se[L+_e*y],C===w?le[P]++:le[++P]=1,C=w;ee+=this._getBadness(P)}return ee},_convertBitStream:function(C){var w,P,L=this._ecc,y=this._version;for(P=0;P=le-2&&(C=le-2,y>9&&C--);var se=C;if(y>9){for(ee[se+2]=0,ee[se+3]=0;se--;)w=ee[se],ee[se+3]|=255&w<<4,ee[se+2]=w>>4;ee[2]|=255&C<<4,ee[1]=C>>4,ee[0]=64|C>>12}else{for(ee[se+1]=0,ee[se+2]=0;se--;)w=ee[se],ee[se+2]|=255&w<<4,ee[se+1]=w>>4;ee[1]|=255&C<<4,ee[0]=64|C>>4}for(se=C+3-(y<10);se=5&&(P+=U.N1+L[w]-5);for(w=3;wC||L[w-3]*3>=L[w]*4||L[w+3]*3>=L[w]*4)&&(P+=U.N3);return P},_finish:function(){this._stringBuffer=this.buffer.slice();var C,w,P=0,L=3e4;for(w=0;w<8&&(this._applyMask(w),C=this._checkBadness(),C>=1)L&1&&(y[ee-1-w+ee*8]=1,w<6?y[8+ee*w]=1:y[8+ee*(w+1)]=1);for(w=0;w<7;w++,L>>=1)L&1&&(y[8+ee*(ee-7+w)]=1,w?y[6-w+ee*8]=1:y[7+ee*8]=1)},_interleaveBlocks:function(){var C,w,P=this._dataBlock,L=this._ecc,y=this._eccBlock,ee=0,le=this._calculateMaxLength(),se=this._neccBlock1,_e=this._neccBlock2,Te=this._stringBuffer;for(C=0;C1)for(C=T.BLOCK[L],P=y-7;;){for(w=y-7;w>C-3&&(this._addAlignment(w,P),!(w6)for(C=S.BLOCK[ee-7],w=17,P=0;P<6;P++)for(L=0;L<3;L++,w--)1&(w>11?ee>>w-12:C>>w)?(y[5-P+le*(2-L+le-11)]=1,y[2-L+le-11+le*(5-P)]=1):(this._setMask(5-P,2-L+le-11),this._setMask(2-L+le-11,5-P))},_isMasked:function(C,w){var P=U._getMaskBit(C,w);return this._mask[P]===1},_pack:function(){var C,w,P,L=1,y=1,ee=this.width,le=ee-1,se=ee-1,_e=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(w=0;w<_e;w++)for(C=this._stringBuffer[w],P=0;P<8;P++,C<<=1){128&C&&(this.buffer[le+ee*se]=1);do y?le--:(le++,L?se!==0?se--:(le-=2,L=!L,le===6&&(le--,se=9)):se!==ee-1?se++:(le-=2,L=!L,le===6&&(le--,se-=8))),y=!y;while(this._isMasked(le,se))}},_reverseMask:function(){var C,w,P=this.width;for(C=0;C<9;C++)this._setMask(C,8);for(C=0;C<8;C++)this._setMask(C+P-8,8),this._setMask(8,C);for(w=0;w<7;w++)this._setMask(8,w+P-7)},_setMask:function(C,w){var P=U._getMaskBit(C,w);this._mask[P]=1},_syncMask:function(){var C,w,P=this.width;for(w=0;ww&&(P=C,C=w,w=P),P=w,P+=w*w,P>>=1,P+=C,P},_modN:function(C){for(;C>=255;)C-=255,C=(C>>8)+(C&255);return C},N1:3,N2:3,N3:40,N4:10}),z=U,V=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var C=this.element;C.width=C.height=this.qrious.size}}),F=V,R=p.extend(function(C,w,P,L){this.name=C,this.modifiable=Boolean(w),this.defaultValue=P,this._valueTransformer=L},{transform:function(C){var w=this._valueTransformer;return typeof w=="function"?w(C,this):C}}),G=R,j=p.extend(null,{abs:function(C){return C!=null?Math.abs(C):null},hasOwn:function(C,w){return Object.prototype.hasOwnProperty.call(C,w)},noop:function(){},toUpperCase:function(C){return C!=null?C.toUpperCase():null}}),H=j,W=p.extend(function(C){this.options={},C.forEach(function(w){this.options[w.name]=w},this)},{exists:function(C){return this.options[C]!=null},get:function(C,w){return W._get(this.options[C],w)},getAll:function(C){var w,P=this.options,L={};for(w in P)H.hasOwn(P,w)&&(L[w]=W._get(P[w],C));return L},init:function(C,w,P){typeof P!="function"&&(P=H.noop);var L,y;for(L in this.options)H.hasOwn(this.options,L)&&(y=this.options[L],W._set(y,y.defaultValue,w),W._createAccessor(y,w,P));this._setAll(C,w,!0)},set:function(C,w,P){return this._set(C,w,P)},setAll:function(C,w){return this._setAll(C,w)},_set:function(C,w,P,L){var y=this.options[C];if(!y)throw new Error("Invalid option: "+C);if(!y.modifiable&&!L)throw new Error("Option cannot be modified: "+C);return W._set(y,w,P)},_setAll:function(C,w,P){if(!C)return!1;var L,y=!1;for(L in C)H.hasOwn(C,L)&&this._set(L,C[L],w,P)&&(y=!0);return y}},{_createAccessor:function(C,w,P){var L={get:function(){return W._get(C,w)}};C.modifiable&&(L.set=function(y){W._set(C,y,w)&&P(y,C)}),Object.defineProperty(w,C.name,L)},_get:function(C,w){return w["_"+C.name]},_set:function(C,w,P){var L="_"+C.name,y=P[L],ee=C.transform(w!=null?w:C.defaultValue);return P[L]=ee,ee!==y}}),K=W,Q=p.extend(function(){this._services={}},{getService:function(C){var w=this._services[C];if(!w)throw new Error("Service is not being managed with name: "+C);return w},setService:function(C,w){if(this._services[C])throw new Error("Service is already managed with name: "+C);w&&(this._services[C]=w)}}),J=Q,ae=new K([new G("background",!0,"white"),new G("backgroundAlpha",!0,1,H.abs),new G("element"),new G("foreground",!0,"black"),new G("foregroundAlpha",!0,1,H.abs),new G("level",!0,"L",H.toUpperCase),new G("mime",!0,"image/png"),new G("padding",!0,null,H.abs),new G("size",!0,100,H.abs),new G("value",!0,"")]),Z=new J,X=p.extend(function(C){ae.init(C,this,this.update.bind(this));var w=ae.get("element",this),P=Z.getService("element"),L=w&&P.isCanvas(w)?w:P.createCanvas(),y=w&&P.isImage(w)?w:P.createImage();this._canvasRenderer=new k(this,L,!0),this._imageRenderer=new F(this,y,y===w),this.update()},{get:function(){return ae.getAll(this)},set:function(C){ae.setAll(C,this)&&this.update()},toDataURL:function(C){return this.canvas.toDataURL(C||this.mime)},update:function(){var C=new z({level:this.level,value:this.value});this._canvasRenderer.render(C),this._imageRenderer.render(C)}},{use:function(C){Z.setService(C.getName(),C)}});Object.defineProperties(X.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var oe=X,ne=oe,ie=p.extend({getName:function(){}}),re=ie,me=re.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(C){},isImage:function(C){}}),Y=me,x=Y.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(C){return C instanceof HTMLCanvasElement},isImage:function(C){return C instanceof HTMLImageElement}}),ke=x;ne.use(new ke);var pe=ne;return pe})})(Eu);const O0=Eu.exports;function I0(t){let e,l;return{c(){e=m("img"),ai(e.src,l=t[2])||r(e,"src",l),r(e,"alt",t[0]),r(e,"class",t[1])},m(n,i){q(n,e,i)},p(n,[i]){i&4&&!ai(e.src,l=n[2])&&r(e,"src",l),i&1&&r(e,"alt",n[0]),i&2&&r(e,"class",n[1])},i:Xe,o:Xe,d(n){n&&A(e)}}}function R0(t,e,l){const n=new O0;let{errorCorrection:i="L"}=e,{background:o="#fff"}=e,{color:a="#000"}=e,{size:c="200"}=e,{value:_=""}=e,{padding:u=0}=e,{className:f="qrcode"}=e,p="";function d(){n.set({background:o,foreground:a,level:i,padding:u,size:c,value:_}),l(2,p=n.toDataURL("image/jpeg"))}return If(()=>{d()}),t.$$set=v=>{"errorCorrection"in v&&l(3,i=v.errorCorrection),"background"in v&&l(4,o=v.background),"color"in v&&l(5,a=v.color),"size"in v&&l(6,c=v.size),"value"in v&&l(0,_=v.value),"padding"in v&&l(7,u=v.padding),"className"in v&&l(1,f=v.className)},t.$$.update=()=>{t.$$.dirty&1&&_&&d()},[_,f,p,i,o,a,c,u]}class F0 extends Dt{constructor(e){super(),qt(this,e,R0,I0,Nt,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function Jo(t,e,l){const n=t.slice();return n[108]=e[l],n}function $o(t,e,l){const n=t.slice();return n[111]=e[l],n[112]=e,n[113]=l,n}function xo(t,e,l){const n=t.slice();return n[114]=e[l],n[115]=e,n[116]=l,n}function U0(t,e,l){const n=t.slice();return n[117]=e[l],n}function B0(t,e,l){const n=t.slice();return n[120]=e[l],n}function ea(t){var At,Xt,Zt,el,tl,ll,nl,il,sl,ol,al,fl,ul,Ie,jt,rl,cl,hl,bl,gl,Fe,ct,Be,_t,Sl,Cl,Nl,Tl,Rl,Fl,Ul,Bl,jl,Hl,yl,zl,Wl;let e,l,n=((Zt=(Xt=(At=t[2].conf)==null?void 0:At.general)==null?void 0:Xt.title)!=null?Zt:"General")+"",i,o,a,c,_,u,f,p,d,v,h=((ll=(tl=(el=t[2].conf)==null?void 0:el.general)==null?void 0:tl.hostname)!=null?ll:"Hostname")+"",k,g,T,O,E,I,N=((sl=(il=(nl=t[2].conf)==null?void 0:nl.general)==null?void 0:il.timezone)!=null?sl:"Time zone")+"",B,S,U,z,V,F,R,G,j,H,W,K=((fl=(al=(ol=t[2].conf)==null?void 0:ol.price)==null?void 0:al.region)!=null?fl:"Price region")+"",Q,J,ae,Z,X,oe,ne,ie,re,me,Y,x,ke,pe,C,w,P,L,y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze=((jt=(Ie=(ul=t[2].conf)==null?void 0:ul.price)==null?void 0:Ie.currency)!=null?jt:"Currency")+"",Je,Ye,et,He,Oe,ce,Pe,$e,Qe,mt,ye,Ge,ze=((hl=(cl=(rl=t[2].conf)==null?void 0:rl.price)==null?void 0:cl.enabled)!=null?hl:"Enabled")+"",tt,vt,Mt,dt,te=((ct=(Fe=(gl=(bl=t[2].conf)==null?void 0:bl.general)==null?void 0:gl.security)==null?void 0:Fe.title)!=null?ct:"Security")+"",be,Tt,Ce,qe,pt,at=((Cl=(Sl=(_t=(Be=t[2].conf)==null?void 0:Be.general)==null?void 0:_t.security)==null?void 0:Sl.none)!=null?Cl:"None")+"",ft,ut,Et=((Fl=(Rl=(Tl=(Nl=t[2].conf)==null?void 0:Nl.general)==null?void 0:Tl.security)==null?void 0:Rl.conf)!=null?Fl:"Conf")+"",Ot,St,Pt=((Hl=(jl=(Bl=(Ul=t[2].conf)==null?void 0:Ul.general)==null?void 0:Bl.security)==null?void 0:jl.all)!=null?Hl:"All")+"",It,yt,Ct,ht,Lt=((Wl=(zl=(yl=t[2].conf)==null?void 0:yl.general)==null?void 0:zl.context)!=null?Wl:"Context")+"",Ut,Wt,Ve,Ke,Bt,nt,bt,wt;V=new q0({});let ue=!t[5].p.t&&ta(),Me=["NOK","SEK","DKK","EUR","CHF"],Ae=[];for(let lt=0;lt<5;lt+=1)Ae[lt]=j0(B0(t,Me,lt));Pe=new Ml({props:{to:"/priceconfig",class:"text-blue-600 hover:text-blue-800",$$slots:{default:[H0]},$$scope:{ctx:t}}});let it=t[5].p.e&&t[0].chip!="esp8266"&&la(t),rt=t[5].g.s>0&&na(t);return{c(){var lt,Ht,_l;e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("input"),f=b(),p=m("div"),d=m("div"),v=m("div"),k=M(h),g=m("br"),T=b(),O=m("input"),E=b(),I=m("div"),B=M(N),S=m("br"),U=b(),z=m("select"),Re(V.$$.fragment),F=b(),R=m("input"),G=b(),j=m("div"),H=m("div"),W=m("div"),Q=M(K),J=m("br"),ae=b(),Z=m("select"),X=m("optgroup"),ue&&ue.c(),oe=m("option"),oe.textContent="NO1",ne=m("option"),ne.textContent="NO2",ie=m("option"),ie.textContent="NO3",re=m("option"),re.textContent="NO4",me=m("option"),me.textContent="NO5",Y=m("optgroup"),x=m("option"),x.textContent="SE1",ke=m("option"),ke.textContent="SE2",pe=m("option"),pe.textContent="SE3",C=m("option"),C.textContent="SE4",w=m("optgroup"),P=m("option"),P.textContent="DK1",L=m("option"),L.textContent="DK2",y=m("option"),y.textContent="Austria",ee=m("option"),ee.textContent="Belgium",le=m("option"),le.textContent="Czech Republic",se=m("option"),se.textContent="Estonia",_e=m("option"),_e.textContent="Finland",Te=m("option"),Te.textContent="France",Se=m("option"),Se.textContent="Germany",de=m("option"),de.textContent="Great Britain",Ne=m("option"),Ne.textContent="Latvia",we=m("option"),we.textContent="Lithuania",ge=m("option"),ge.textContent="Netherland",he=m("option"),he.textContent="Poland",je=m("option"),je.textContent="Switzerland",Ue=b(),We=m("div"),Je=M(Ze),Ye=m("br"),et=b(),He=m("select");for(let wl=0;wl<5;wl+=1)Ae[wl].c();Oe=b(),ce=m("div"),Re(Pe.$$.fragment),$e=b(),Qe=m("div"),mt=m("label"),ye=m("input"),Ge=b(),tt=M(ze),vt=b(),it&&it.c(),Mt=b(),dt=m("div"),be=M(te),Tt=m("br"),Ce=b(),qe=m("select"),pt=m("option"),ft=M(at),ut=m("option"),Ot=M(Et),St=m("option"),It=M(Pt),yt=b(),rt&&rt.c(),Ct=b(),ht=m("div"),Ut=M(Lt),Wt=m("br"),Ve=b(),Ke=m("input"),r(l,"class","text-sm"),r(a,"href",kl("General-configuration")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","g"),u.value="true",r(O,"name","gh"),r(O,"type","text"),r(O,"class","in-f w-full"),r(O,"pattern","[A-Za-z0-9-]+"),r(z,"name","gt"),r(z,"class","in-l w-full"),t[5].g.t===void 0&&Gt(()=>t[21].call(z)),r(d,"class","flex"),r(p,"class","my-1"),r(R,"type","hidden"),r(R,"name","p"),R.value="true",oe.__value="10YNO-1--------2",oe.value=oe.__value,ne.__value="10YNO-2--------T",ne.value=ne.__value,ie.__value="10YNO-3--------J",ie.value=ie.__value,re.__value="10YNO-4--------9",re.value=re.__value,me.__value="10Y1001A1001A48H",me.value=me.__value,r(X,"label","Norway"),x.__value="10Y1001A1001A44P",x.value=x.__value,ke.__value="10Y1001A1001A45N",ke.value=ke.__value,pe.__value="10Y1001A1001A46L",pe.value=pe.__value,C.__value="10Y1001A1001A47J",C.value=C.__value,r(Y,"label","Sweden"),P.__value="10YDK-1--------W",P.value=P.__value,L.__value="10YDK-2--------M",L.value=L.__value,r(w,"label","Denmark"),y.__value="10YAT-APG------L",y.value=y.__value,ee.__value="10YBE----------2",ee.value=ee.__value,le.__value="10YCZ-CEPS-----N",le.value=le.__value,se.__value="10Y1001A1001A39I",se.value=se.__value,_e.__value="10YFI-1--------U",_e.value=_e.__value,Te.__value="10YFR-RTE------C",Te.value=Te.__value,Se.__value="10Y1001A1001A83F",Se.value=Se.__value,de.__value="10YGB----------A",de.value=de.__value,Ne.__value="10YLV-1001A00074",Ne.value=Ne.__value,we.__value="10YLT-1001A0008Q",we.value=we.__value,ge.__value="10YNL----------L",ge.value=ge.__value,he.__value="10YPL-AREA-----S",he.value=he.__value,je.__value="10YCH-SWISSGRIDZ",je.value=je.__value,r(Z,"name","pr"),r(Z,"class","in-f w-full"),t[5].p.r===void 0&&Gt(()=>t[22].call(Z)),r(W,"class","w-full"),r(He,"name","pc"),r(He,"class","in-l"),t[5].p.c===void 0&&Gt(()=>t[23].call(He)),r(H,"class","flex"),r(j,"class","my-1"),r(ce,"class","my-1"),r(ye,"type","checkbox"),r(ye,"name","pe"),ye.__value="true",ye.value=ye.__value,r(ye,"class","rounded mb-1"),r(Qe,"class","my-1"),pt.__value=0,pt.value=pt.__value,ut.__value=1,ut.value=ut.__value,St.__value=2,St.value=St.__value,r(qe,"name","gs"),r(qe,"class","in-s"),t[5].g.s===void 0&&Gt(()=>t[26].call(qe)),r(dt,"class","my-1"),r(Ke,"name","gc"),r(Ke,"type","text"),r(Ke,"pattern","[A-Za-z0-9]+"),r(Ke,"placeholder",Bt=(_l=(Ht=(lt=t[2].conf)==null?void 0:lt.general)==null?void 0:Ht.context_placeholder)!=null?_l:"/"),r(Ke,"class","in-s"),r(Ke,"maxlength","36"),r(ht,"class","my-1"),r(e,"class","cnt")},m(lt,Ht){q(lt,e,Ht),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(p,d),s(d,v),s(v,k),s(v,g),s(v,T),s(v,O),Ee(O,t[5].g.h),s(d,E),s(d,I),s(I,B),s(I,S),s(I,U),s(I,z),De(V,z,null),ot(z,t[5].g.t,!0),s(e,F),s(e,R),s(e,G),s(e,j),s(j,H),s(H,W),s(W,Q),s(W,J),s(W,ae),s(W,Z),s(Z,X),ue&&ue.m(X,null),s(X,oe),s(X,ne),s(X,ie),s(X,re),s(X,me),s(Z,Y),s(Y,x),s(Y,ke),s(Y,pe),s(Y,C),s(Z,w),s(w,P),s(w,L),s(Z,y),s(Z,ee),s(Z,le),s(Z,se),s(Z,_e),s(Z,Te),s(Z,Se),s(Z,de),s(Z,Ne),s(Z,we),s(Z,ge),s(Z,he),s(Z,je),ot(Z,t[5].p.r,!0),s(H,Ue),s(H,We),s(We,Je),s(We,Ye),s(We,et),s(We,He);for(let _l=0;_l<5;_l+=1)Ae[_l]&&Ae[_l].m(He,null);ot(He,t[5].p.c,!0),s(e,Oe),s(e,ce),De(Pe,ce,null),s(e,$e),s(e,Qe),s(Qe,mt),s(mt,ye),ye.checked=t[5].p.e,s(mt,Ge),s(mt,tt),s(Qe,vt),it&&it.m(Qe,null),s(e,Mt),s(e,dt),s(dt,be),s(dt,Tt),s(dt,Ce),s(dt,qe),s(qe,pt),s(pt,ft),s(qe,ut),s(ut,Ot),s(qe,St),s(St,It),ot(qe,t[5].g.s,!0),s(e,yt),rt&&rt.m(e,null),s(e,Ct),s(e,ht),s(ht,Ut),s(ht,Wt),s(ht,Ve),s(ht,Ke),Ee(Ke,t[5].g.c),nt=!0,bt||(wt=[ve(O,"input",t[20]),ve(z,"change",t[21]),ve(Z,"change",t[22]),ve(He,"change",t[23]),ve(ye,"change",t[24]),ve(qe,"change",t[26]),ve(Ke,"input",t[29])],bt=!0)},p(lt,Ht){var wl,Gl,mn,pn,dn,vn,hn,bn,gn,kn,wn,Mn,Sn,Cn,Nn,Tn,En,Pn,An,qn,Dn,Ln,On,In,Rn,Fn,Un,Bn,jn,Hn,is,ss,os,as,fs,us,rs,cs,_s,ms;(!nt||Ht[0]&4)&&n!==(n=((mn=(Gl=(wl=lt[2].conf)==null?void 0:wl.general)==null?void 0:Gl.title)!=null?mn:"General")+"")&&D(i,n),(!nt||Ht[0]&4)&&h!==(h=((vn=(dn=(pn=lt[2].conf)==null?void 0:pn.general)==null?void 0:dn.hostname)!=null?vn:"Hostname")+"")&&D(k,h),Ht[0]&32&&O.value!==lt[5].g.h&&Ee(O,lt[5].g.h),(!nt||Ht[0]&4)&&N!==(N=((gn=(bn=(hn=lt[2].conf)==null?void 0:hn.general)==null?void 0:bn.timezone)!=null?gn:"Time zone")+"")&&D(B,N),Ht[0]&32&&ot(z,lt[5].g.t),(!nt||Ht[0]&4)&&K!==(K=((Mn=(wn=(kn=lt[2].conf)==null?void 0:kn.price)==null?void 0:wn.region)!=null?Mn:"Price region")+"")&&D(Q,K),lt[5].p.t?ue&&(ue.d(1),ue=null):ue||(ue=ta(),ue.c(),ue.m(X,oe)),Ht[0]&32&&ot(Z,lt[5].p.r),(!nt||Ht[0]&4)&&Ze!==(Ze=((Nn=(Cn=(Sn=lt[2].conf)==null?void 0:Sn.price)==null?void 0:Cn.currency)!=null?Nn:"Currency")+"")&&D(Je,Ze),Ht[0]&32&&ot(He,lt[5].p.c);const _l={};Ht[0]&4|Ht[3]&1073741824&&(_l.$$scope={dirty:Ht,ctx:lt}),Pe.$set(_l),Ht[0]&32&&(ye.checked=lt[5].p.e),(!nt||Ht[0]&4)&&ze!==(ze=((Pn=(En=(Tn=lt[2].conf)==null?void 0:Tn.price)==null?void 0:En.enabled)!=null?Pn:"Enabled")+"")&&D(tt,ze),lt[5].p.e&<[0].chip!="esp8266"?it?it.p(lt,Ht):(it=la(lt),it.c(),it.m(Qe,null)):it&&(it.d(1),it=null),(!nt||Ht[0]&4)&&te!==(te=((Ln=(Dn=(qn=(An=lt[2].conf)==null?void 0:An.general)==null?void 0:qn.security)==null?void 0:Dn.title)!=null?Ln:"Security")+"")&&D(be,te),(!nt||Ht[0]&4)&&at!==(at=((Fn=(Rn=(In=(On=lt[2].conf)==null?void 0:On.general)==null?void 0:In.security)==null?void 0:Rn.none)!=null?Fn:"None")+"")&&D(ft,at),(!nt||Ht[0]&4)&&Et!==(Et=((Hn=(jn=(Bn=(Un=lt[2].conf)==null?void 0:Un.general)==null?void 0:Bn.security)==null?void 0:jn.conf)!=null?Hn:"Conf")+"")&&D(Ot,Et),(!nt||Ht[0]&4)&&Pt!==(Pt=((as=(os=(ss=(is=lt[2].conf)==null?void 0:is.general)==null?void 0:ss.security)==null?void 0:os.all)!=null?as:"All")+"")&&D(It,Pt),Ht[0]&32&&ot(qe,lt[5].g.s),lt[5].g.s>0?rt?rt.p(lt,Ht):(rt=na(lt),rt.c(),rt.m(e,Ct)):rt&&(rt.d(1),rt=null),(!nt||Ht[0]&4)&&Lt!==(Lt=((rs=(us=(fs=lt[2].conf)==null?void 0:fs.general)==null?void 0:us.context)!=null?rs:"Context")+"")&&D(Ut,Lt),(!nt||Ht[0]&4&&Bt!==(Bt=(ms=(_s=(cs=lt[2].conf)==null?void 0:cs.general)==null?void 0:_s.context_placeholder)!=null?ms:"/"))&&r(Ke,"placeholder",Bt),Ht[0]&32&&Ke.value!==lt[5].g.c&&Ee(Ke,lt[5].g.c)},i(lt){nt||($(V.$$.fragment,lt),$(Pe.$$.fragment,lt),nt=!0)},o(lt){fe(V.$$.fragment,lt),fe(Pe.$$.fragment,lt),nt=!1},d(lt){lt&&A(e),Le(V),ue&&ue.d(),$t(Ae,lt),Le(Pe),it&&it.d(),rt&&rt.d(),bt=!1,zt(wt)}}}function ta(t){let e,l,n,i,o;return{c(){e=m("option"),e.textContent="NO1 with support",l=m("option"),l.textContent="NO2 with support",n=m("option"),n.textContent="NO3 with support",i=m("option"),i.textContent="NO4 with support",o=m("option"),o.textContent="NO5 with support",e.__value="NO1S",e.value=e.__value,l.__value="NO2S",l.value=l.__value,n.__value="NO3S",n.value=n.__value,i.__value="NO4S",i.value=i.__value,o.__value="NO5S",o.value=o.__value},m(a,c){q(a,e,c),q(a,l,c),q(a,n,c),q(a,i,c),q(a,o,c)},d(a){a&&A(e),a&&A(l),a&&A(n),a&&A(i),a&&A(o)}}}function j0(t){let e,l;return{c(){e=m("option"),l=M(t[120]),e.__value=t[120],e.value=e.__value},m(n,i){q(n,e,i),s(e,l)},p:Xe,d(n){n&&A(e)}}}function H0(t){var n,i,o;let e=((o=(i=(n=t[2].conf)==null?void 0:n.price)==null?void 0:i.conf)!=null?o:"Configure")+"",l;return{c(){l=M(e)},m(a,c){q(a,l,c)},p(a,c){var _,u,f;c[0]&4&&e!==(e=((f=(u=(_=a[2].conf)==null?void 0:_.price)==null?void 0:u.conf)!=null?f:"Configure")+"")&&D(l,e)},d(a){a&&A(l)}}}function la(t){let e,l,n,i,o;return{c(){var a,c,_;e=m("br"),l=m("input"),r(l,"name","pt"),r(l,"type","text"),r(l,"class","in-s"),r(l,"placeholder",n=(_=(c=(a=t[2].conf)==null?void 0:a.price)==null?void 0:c.api_key_placeholder)!=null?_:"")},m(a,c){q(a,e,c),q(a,l,c),Ee(l,t[5].p.t),i||(o=ve(l,"input",t[25]),i=!0)},p(a,c){var _,u,f;c[0]&4&&n!==(n=(f=(u=(_=a[2].conf)==null?void 0:_.price)==null?void 0:u.api_key_placeholder)!=null?f:"")&&r(l,"placeholder",n),c[0]&32&&l.value!==a[5].p.t&&Ee(l,a[5].p.t)},d(a){a&&A(e),a&&A(l),i=!1,o()}}}function na(t){var g,T,O,E,I,N,B,S;let e,l=((E=(O=(T=(g=t[2].conf)==null?void 0:g.general)==null?void 0:T.security)==null?void 0:O.username)!=null?E:"Username")+"",n,i,o,a,c,_,u=((S=(B=(N=(I=t[2].conf)==null?void 0:I.general)==null?void 0:N.security)==null?void 0:B.password)!=null?S:"Password")+"",f,p,d,v,h,k;return{c(){e=m("div"),n=M(l),i=m("br"),o=b(),a=m("input"),c=b(),_=m("div"),f=M(u),p=m("br"),d=b(),v=m("input"),r(a,"name","gu"),r(a,"type","text"),r(a,"class","in-s"),r(a,"maxlength","36"),r(e,"class","my-1"),r(v,"name","gp"),r(v,"type","password"),r(v,"class","in-s"),r(v,"maxlength","36"),r(_,"class","my-1")},m(U,z){q(U,e,z),s(e,n),s(e,i),s(e,o),s(e,a),Ee(a,t[5].g.u),q(U,c,z),q(U,_,z),s(_,f),s(_,p),s(_,d),s(_,v),Ee(v,t[5].g.p),h||(k=[ve(a,"input",t[27]),ve(v,"input",t[28])],h=!0)},p(U,z){var V,F,R,G,j,H,W,K;z[0]&4&&l!==(l=((G=(R=(F=(V=U[2].conf)==null?void 0:V.general)==null?void 0:F.security)==null?void 0:R.username)!=null?G:"Username")+"")&&D(n,l),z[0]&32&&a.value!==U[5].g.u&&Ee(a,U[5].g.u),z[0]&4&&u!==(u=((K=(W=(H=(j=U[2].conf)==null?void 0:j.general)==null?void 0:H.security)==null?void 0:W.password)!=null?K:"Password")+"")&&D(f,u),z[0]&32&&v.value!==U[5].g.p&&Ee(v,U[5].g.p)},d(U){U&&A(e),U&&A(c),U&&A(_),h=!1,zt(k)}}}function ia(t){var vt,Mt,dt,te,be,Tt,Ce,qe,pt,at,ft,ut,Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt,Ve,Ke,Bt,nt,bt,wt,ue;let e,l,n=((dt=(Mt=(vt=t[2].conf)==null?void 0:vt.meter)==null?void 0:Mt.title)!=null?dt:"Meter")+"",i,o,a,c,_,u,f,p,d,v,h=((Ce=(Tt=(be=(te=t[2].conf)==null?void 0:te.meter)==null?void 0:be.comm)==null?void 0:Tt.title)!=null?Ce:"Communication")+"",k,g,T,O,E,I=((ft=(at=(pt=(qe=t[2].conf)==null?void 0:qe.meter)==null?void 0:pt.comm)==null?void 0:at.passive)!=null?ft:"Passive")+"",N,B,S=((St=(Ot=(Et=(ut=t[2].conf)==null?void 0:ut.meter)==null?void 0:Et.comm)==null?void 0:Ot.pulse)!=null?St:"Pulse")+"",U,z,V,F,R=((It=(Pt=t[2].common)==null?void 0:Pt.voltage)!=null?It:"Voltage")+"",G,j,H,W,K,Q,J,ae,Z,X=((ht=(Ct=(yt=t[2].conf)==null?void 0:yt.meter)==null?void 0:Ct.fuse)!=null?ht:"Main fuse")+"",oe,ne,ie,re,me,Y,x,ke,pe,C=((Wt=(Ut=(Lt=t[2].conf)==null?void 0:Lt.meter)==null?void 0:Ut.prod)!=null?Wt:"Production")+"",w,P,L,y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he=((Bt=(Ke=(Ve=t[2].conf)==null?void 0:Ve.meter)==null?void 0:Ke.encrypted)!=null?Bt:"Encrypted")+"",je,Ue,We,Ze,Je,Ye,et,He=((ue=(wt=(bt=(nt=t[2].conf)==null?void 0:nt.meter)==null?void 0:bt.multipliers)==null?void 0:wt.title)!=null?ue:"Multipliers")+"",Oe,ce,Pe,$e;function Qe(Me,Ae){return Me[5].m.a===2?z0:y0}let mt=Qe(t),ye=mt(t),Ge=t[5].m.e.e&&sa(t),ze=t[5].m.e.e&&oa(t),tt=t[5].m.m.e&&aa(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("input"),f=b(),p=m("input"),d=b(),v=m("div"),k=M(h),g=m("br"),T=b(),O=m("select"),E=m("option"),N=M(I),B=m("option"),U=M(S),z=b(),ye.c(),V=b(),F=m("div"),G=M(R),j=m("br"),H=b(),W=m("select"),K=m("option"),K.textContent="400V (TN)",Q=m("option"),Q.textContent="230V (IT/TT)",J=b(),ae=m("div"),Z=m("div"),oe=M(X),ne=m("br"),ie=b(),re=m("label"),me=m("input"),Y=b(),x=m("span"),x.textContent="A",ke=b(),pe=m("div"),w=M(C),P=m("br"),L=b(),y=m("label"),ee=m("input"),le=b(),se=m("span"),se.textContent="kWp",_e=b(),Te=m("div"),Se=b(),de=m("div"),Ne=m("label"),we=m("input"),ge=b(),je=M(he),Ue=b(),Ge&&Ge.c(),We=b(),ze&&ze.c(),Ze=b(),Je=m("label"),Ye=m("input"),et=b(),Oe=M(He),ce=b(),tt&&tt.c(),r(l,"class","text-sm"),r(a,"href",kl("Meter-configuration")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","m"),u.value="true",r(p,"type","hidden"),r(p,"name","mo"),p.value="1",E.__value=0,E.value=E.__value,B.__value=2,B.value=B.__value,r(O,"name","ma"),r(O,"class","in-s"),t[5].m.a===void 0&&Gt(()=>t[30].call(O)),r(v,"class","my-1"),K.__value=2,K.value=K.__value,Q.__value=1,Q.value=Q.__value,r(W,"name","md"),r(W,"class","in-s"),t[5].m.d===void 0&&Gt(()=>t[36].call(W)),r(F,"class","my-1"),r(me,"name","mf"),r(me,"type","number"),r(me,"min","5"),r(me,"max","65535"),r(me,"class","in-f tr w-full"),r(x,"class","in-post"),r(re,"class","flex"),r(Z,"class","mx-1"),r(ee,"name","mr"),r(ee,"type","number"),r(ee,"min","0"),r(ee,"max","65535"),r(ee,"class","in-f tr w-full"),r(se,"class","in-post"),r(y,"class","flex"),r(pe,"class","mx-1"),r(ae,"class","my-1 flex"),r(Te,"class","my-1"),r(we,"type","checkbox"),r(we,"name","me"),we.__value="true",we.value=we.__value,r(we,"class","rounded mb-1"),r(de,"class","my-1"),r(Ye,"type","checkbox"),r(Ye,"name","mm"),Ye.__value="true",Ye.value=Ye.__value,r(Ye,"class","rounded mb-1"),r(e,"class","cnt")},m(Me,Ae){q(Me,e,Ae),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(e,d),s(e,v),s(v,k),s(v,g),s(v,T),s(v,O),s(O,E),s(E,N),s(O,B),s(B,U),ot(O,t[5].m.a,!0),s(e,z),ye.m(e,null),s(e,V),s(e,F),s(F,G),s(F,j),s(F,H),s(F,W),s(W,K),s(W,Q),ot(W,t[5].m.d,!0),s(e,J),s(e,ae),s(ae,Z),s(Z,oe),s(Z,ne),s(Z,ie),s(Z,re),s(re,me),Ee(me,t[5].m.f),s(re,Y),s(re,x),s(ae,ke),s(ae,pe),s(pe,w),s(pe,P),s(pe,L),s(pe,y),s(y,ee),Ee(ee,t[5].m.r),s(y,le),s(y,se),s(e,_e),s(e,Te),s(e,Se),s(e,de),s(de,Ne),s(Ne,we),we.checked=t[5].m.e.e,s(Ne,ge),s(Ne,je),s(de,Ue),Ge&&Ge.m(de,null),s(e,We),ze&&ze.m(e,null),s(e,Ze),s(e,Je),s(Je,Ye),Ye.checked=t[5].m.m.e,s(Je,et),s(Je,Oe),s(e,ce),tt&&tt.m(e,null),Pe||($e=[ve(O,"change",t[30]),ve(W,"change",t[36]),ve(me,"input",t[37]),ve(ee,"input",t[38]),ve(we,"change",t[39]),ve(Ye,"change",t[42])],Pe=!0)},p(Me,Ae){var it,rt,At,Xt,Zt,el,tl,ll,nl,il,sl,ol,al,fl,ul,Ie,jt,rl,cl,hl,bl,gl,Fe,ct,Be,_t,Sl,Cl,Nl,Tl;Ae[0]&4&&n!==(n=((At=(rt=(it=Me[2].conf)==null?void 0:it.meter)==null?void 0:rt.title)!=null?At:"Meter")+"")&&D(i,n),Ae[0]&4&&h!==(h=((tl=(el=(Zt=(Xt=Me[2].conf)==null?void 0:Xt.meter)==null?void 0:Zt.comm)==null?void 0:el.title)!=null?tl:"Communication")+"")&&D(k,h),Ae[0]&4&&I!==(I=((sl=(il=(nl=(ll=Me[2].conf)==null?void 0:ll.meter)==null?void 0:nl.comm)==null?void 0:il.passive)!=null?sl:"Passive")+"")&&D(N,I),Ae[0]&4&&S!==(S=((ul=(fl=(al=(ol=Me[2].conf)==null?void 0:ol.meter)==null?void 0:al.comm)==null?void 0:fl.pulse)!=null?ul:"Pulse")+"")&&D(U,S),Ae[0]&32&&ot(O,Me[5].m.a),mt===(mt=Qe(Me))&&ye?ye.p(Me,Ae):(ye.d(1),ye=mt(Me),ye&&(ye.c(),ye.m(e,V))),Ae[0]&4&&R!==(R=((jt=(Ie=Me[2].common)==null?void 0:Ie.voltage)!=null?jt:"Voltage")+"")&&D(G,R),Ae[0]&32&&ot(W,Me[5].m.d),Ae[0]&4&&X!==(X=((hl=(cl=(rl=Me[2].conf)==null?void 0:rl.meter)==null?void 0:cl.fuse)!=null?hl:"Main fuse")+"")&&D(oe,X),Ae[0]&32&&st(me.value)!==Me[5].m.f&&Ee(me,Me[5].m.f),Ae[0]&4&&C!==(C=((Fe=(gl=(bl=Me[2].conf)==null?void 0:bl.meter)==null?void 0:gl.prod)!=null?Fe:"Production")+"")&&D(w,C),Ae[0]&32&&st(ee.value)!==Me[5].m.r&&Ee(ee,Me[5].m.r),Ae[0]&32&&(we.checked=Me[5].m.e.e),Ae[0]&4&&he!==(he=((_t=(Be=(ct=Me[2].conf)==null?void 0:ct.meter)==null?void 0:Be.encrypted)!=null?_t:"Encrypted")+"")&&D(je,he),Me[5].m.e.e?Ge?Ge.p(Me,Ae):(Ge=sa(Me),Ge.c(),Ge.m(de,null)):Ge&&(Ge.d(1),Ge=null),Me[5].m.e.e?ze?ze.p(Me,Ae):(ze=oa(Me),ze.c(),ze.m(e,Ze)):ze&&(ze.d(1),ze=null),Ae[0]&32&&(Ye.checked=Me[5].m.m.e),Ae[0]&4&&He!==(He=((Tl=(Nl=(Cl=(Sl=Me[2].conf)==null?void 0:Sl.meter)==null?void 0:Cl.multipliers)==null?void 0:Nl.title)!=null?Tl:"Multipliers")+"")&&D(Oe,He),Me[5].m.m.e?tt?tt.p(Me,Ae):(tt=aa(Me),tt.c(),tt.m(e,null)):tt&&(tt.d(1),tt=null)},d(Me){Me&&A(e),ye.d(),Ge&&Ge.d(),ze&&ze.d(),tt&&tt.d(),Pe=!1,zt($e)}}}function y0(t){var oe,ne,ie,re,me,Y,x,ke,pe;let e,l,n=((ie=(ne=(oe=t[2].conf)==null?void 0:oe.meter)==null?void 0:ne.buffer)!=null?ie:"Buffer size")+"",i,o,a,c=((Y=(me=(re=t[2].conf)==null?void 0:re.meter)==null?void 0:me.serial)!=null?Y:"Serial conf.")+"",_,u,f,p,d,v=((pe=(ke=(x=t[2].conf)==null?void 0:x.meter)==null?void 0:ke.inverted)!=null?pe:"inverted")+"",h,k,g,T,O,E,I,N,B,S,U,z,V,F,R,G,j,H,W,K,Q,J,ae,Z=[3,12,24,48,96,192,384,576,1152],X=[];for(let C=0;C<9;C+=1)X[C]=W0(U0(t,Z,C));return{c(){e=m("div"),l=m("span"),i=M(n),o=b(),a=m("span"),_=M(c),u=b(),f=m("label"),p=m("input"),d=b(),h=M(v),k=b(),g=m("div"),T=m("select"),O=m("option"),E=M("Autodetect");for(let C=0;C<9;C+=1)X[C].c();N=b(),B=m("select"),S=m("option"),U=M("-"),V=m("option"),V.textContent="7N1",F=m("option"),F.textContent="8N1",R=m("option"),R.textContent="8N2",G=m("option"),G.textContent="7E1",j=m("option"),j.textContent="8E1",W=b(),K=m("input"),r(l,"class","float-right"),r(p,"name","mi"),p.__value="true",p.value=p.__value,r(p,"type","checkbox"),r(p,"class","rounded mb-1"),r(f,"class","mt-2 ml-3 whitespace-nowrap"),O.__value=0,O.value=O.__value,O.disabled=I=t[5].m.b!=0,r(T,"name","mb"),r(T,"class","in-f tr w-1/2"),t[5].m.b===void 0&&Gt(()=>t[33].call(T)),S.__value=0,S.value=S.__value,S.disabled=z=t[5].m.b!=0,V.__value=2,V.value=V.__value,F.__value=3,F.value=F.__value,R.__value=7,R.value=R.__value,G.__value=10,G.value=G.__value,j.__value=11,j.value=j.__value,r(B,"name","mp"),r(B,"class","in-m"),B.disabled=H=t[5].m.b==0,t[5].m.p===void 0&&Gt(()=>t[34].call(B)),r(K,"name","ms"),r(K,"type","number"),r(K,"min",64),r(K,"max",Q=t[0].chip=="esp8266"?t[5].i.h.p==3||t[5].i.h.p==113?512:256:4096),r(K,"step",64),r(K,"class","in-l tr w-1/2"),r(g,"class","flex w-full"),r(e,"class","my-1")},m(C,w){q(C,e,w),s(e,l),s(l,i),s(e,o),s(e,a),s(a,_),s(e,u),s(e,f),s(f,p),p.checked=t[5].m.i,s(f,d),s(f,h),s(e,k),s(e,g),s(g,T),s(T,O),s(O,E);for(let P=0;P<9;P+=1)X[P]&&X[P].m(T,null);ot(T,t[5].m.b,!0),s(g,N),s(g,B),s(B,S),s(S,U),s(B,V),s(B,F),s(B,R),s(B,G),s(B,j),ot(B,t[5].m.p,!0),s(g,W),s(g,K),Ee(K,t[5].m.s),J||(ae=[ve(p,"change",t[32]),ve(T,"change",t[33]),ve(B,"change",t[34]),ve(K,"input",t[35])],J=!0)},p(C,w){var P,L,y,ee,le,se,_e,Te,Se;w[0]&4&&n!==(n=((y=(L=(P=C[2].conf)==null?void 0:P.meter)==null?void 0:L.buffer)!=null?y:"Buffer size")+"")&&D(i,n),w[0]&4&&c!==(c=((se=(le=(ee=C[2].conf)==null?void 0:ee.meter)==null?void 0:le.serial)!=null?se:"Serial conf.")+"")&&D(_,c),w[0]&32&&(p.checked=C[5].m.i),w[0]&4&&v!==(v=((Se=(Te=(_e=C[2].conf)==null?void 0:_e.meter)==null?void 0:Te.inverted)!=null?Se:"inverted")+"")&&D(h,v),w[0]&32&&I!==(I=C[5].m.b!=0)&&(O.disabled=I),w[0]&32&&ot(T,C[5].m.b),w[0]&32&&z!==(z=C[5].m.b!=0)&&(S.disabled=z),w[0]&32&&H!==(H=C[5].m.b==0)&&(B.disabled=H),w[0]&32&&ot(B,C[5].m.p),w[0]&33&&Q!==(Q=C[0].chip=="esp8266"?C[5].i.h.p==3||C[5].i.h.p==113?512:256:4096)&&r(K,"max",Q),w[0]&32&&st(K.value)!==C[5].m.s&&Ee(K,C[5].m.s)},d(C){C&&A(e),$t(X,C),J=!1,zt(ae)}}}function z0(t){var u,f,p;let e,l,n=((p=(f=(u=t[2].conf)==null?void 0:u.meter)==null?void 0:f.pulses)!=null?p:"Pulses per kWh")+"",i,o,a,c,_;return{c(){e=m("div"),l=m("span"),i=M(n),o=b(),a=m("input"),r(a,"name","mb"),r(a,"class","in-s tr"),r(a,"type","number"),r(a,"min",1),r(a,"max",3600),r(e,"class","my-1")},m(d,v){q(d,e,v),s(e,l),s(l,i),s(e,o),s(e,a),Ee(a,t[5].m.b),c||(_=ve(a,"input",t[31]),c=!0)},p(d,v){var h,k,g;v[0]&4&&n!==(n=((g=(k=(h=d[2].conf)==null?void 0:h.meter)==null?void 0:k.pulses)!=null?g:"Pulses per kWh")+"")&&D(i,n),v[0]&32&&st(a.value)!==d[5].m.b&&Ee(a,d[5].m.b)},d(d){d&&A(e),c=!1,_()}}}function W0(t){let e,l=t[117]*100+"",n;return{c(){e=m("option"),n=M(l),e.__value=t[117]*100,e.value=e.__value},m(i,o){q(i,e,o),s(e,n)},p:Xe,d(i){i&&A(e)}}}function sa(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,a){q(o,e,a),q(o,l,a),Ee(l,t[5].m.e.k),n||(i=ve(l,"input",t[40]),n=!0)},p(o,a){a[0]&32&&l.value!==o[5].m.e.k&&Ee(l,o[5].m.e.k)},d(o){o&&A(e),o&&A(l),n=!1,i()}}}function oa(t){var u,f,p;let e,l=((p=(f=(u=t[2].conf)==null?void 0:u.meter)==null?void 0:f.authkey)!=null?p:"Authentication key")+"",n,i,o,a,c,_;return{c(){e=m("div"),n=M(l),i=m("br"),o=b(),a=m("input"),r(a,"name","mea"),r(a,"type","text"),r(a,"class","in-s"),r(e,"class","my-1")},m(d,v){q(d,e,v),s(e,n),s(e,i),s(e,o),s(e,a),Ee(a,t[5].m.e.a),c||(_=ve(a,"input",t[41]),c=!0)},p(d,v){var h,k,g;v[0]&4&&l!==(l=((g=(k=(h=d[2].conf)==null?void 0:h.meter)==null?void 0:k.authkey)!=null?g:"Authentication key")+"")&&D(n,l),v[0]&32&&a.value!==d[5].m.e.a&&Ee(a,d[5].m.e.a)},d(d){d&&A(e),c=!1,_()}}}function aa(t){var H,W,K,Q,J,ae,Z,X,oe,ne,ie,re,me,Y,x,ke;let e,l,n=((Q=(K=(W=(H=t[2].conf)==null?void 0:H.meter)==null?void 0:W.multipliers)==null?void 0:K.watt)!=null?Q:"Watt")+"",i,o,a,c,_,u,f=((X=(Z=(ae=(J=t[2].conf)==null?void 0:J.meter)==null?void 0:ae.multipliers)==null?void 0:Z.volt)!=null?X:"Volt")+"",p,d,v,h,k,g,T=((re=(ie=(ne=(oe=t[2].conf)==null?void 0:oe.meter)==null?void 0:ne.multipliers)==null?void 0:ie.amp)!=null?re:"Amp")+"",O,E,I,N,B,S,U=((ke=(x=(Y=(me=t[2].conf)==null?void 0:me.meter)==null?void 0:Y.multipliers)==null?void 0:x.kwh)!=null?ke:"kWh")+"",z,V,F,R,G,j;return{c(){e=m("div"),l=m("div"),i=M(n),o=m("br"),a=b(),c=m("input"),_=b(),u=m("div"),p=M(f),d=m("br"),v=b(),h=m("input"),k=b(),g=m("div"),O=M(T),E=m("br"),I=b(),N=m("input"),B=b(),S=m("div"),z=M(U),V=m("br"),F=b(),R=m("input"),r(c,"name","mmw"),r(c,"type","number"),r(c,"min","0.00"),r(c,"max","1000"),r(c,"step","0.001"),r(c,"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(u,"class","w-1/4"),r(N,"name","mma"),r(N,"type","number"),r(N,"min","0.00"),r(N,"max","1000"),r(N,"step","0.001"),r(N,"class","in-m tr w-full"),r(g,"class","w-1/4"),r(R,"name","mmc"),r(R,"type","number"),r(R,"min","0.00"),r(R,"max","1000"),r(R,"step","0.001"),r(R,"class","in-l tr w-full"),r(S,"class","w-1/4"),r(e,"class","flex my-1")},m(pe,C){q(pe,e,C),s(e,l),s(l,i),s(l,o),s(l,a),s(l,c),Ee(c,t[5].m.m.w),s(e,_),s(e,u),s(u,p),s(u,d),s(u,v),s(u,h),Ee(h,t[5].m.m.v),s(e,k),s(e,g),s(g,O),s(g,E),s(g,I),s(g,N),Ee(N,t[5].m.m.a),s(e,B),s(e,S),s(S,z),s(S,V),s(S,F),s(S,R),Ee(R,t[5].m.m.c),G||(j=[ve(c,"input",t[43]),ve(h,"input",t[44]),ve(N,"input",t[45]),ve(R,"input",t[46])],G=!0)},p(pe,C){var w,P,L,y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je;C[0]&4&&n!==(n=((y=(L=(P=(w=pe[2].conf)==null?void 0:w.meter)==null?void 0:P.multipliers)==null?void 0:L.watt)!=null?y:"Watt")+"")&&D(i,n),C[0]&32&&st(c.value)!==pe[5].m.m.w&&Ee(c,pe[5].m.m.w),C[0]&4&&f!==(f=((_e=(se=(le=(ee=pe[2].conf)==null?void 0:ee.meter)==null?void 0:le.multipliers)==null?void 0:se.volt)!=null?_e:"Volt")+"")&&D(p,f),C[0]&32&&st(h.value)!==pe[5].m.m.v&&Ee(h,pe[5].m.m.v),C[0]&4&&T!==(T=((Ne=(de=(Se=(Te=pe[2].conf)==null?void 0:Te.meter)==null?void 0:Se.multipliers)==null?void 0:de.amp)!=null?Ne:"Amp")+"")&&D(O,T),C[0]&32&&st(N.value)!==pe[5].m.m.a&&Ee(N,pe[5].m.m.a),C[0]&4&&U!==(U=((je=(he=(ge=(we=pe[2].conf)==null?void 0:we.meter)==null?void 0:ge.multipliers)==null?void 0:he.kwh)!=null?je:"kWh")+"")&&D(z,U),C[0]&32&&st(R.value)!==pe[5].m.m.c&&Ee(R,pe[5].m.m.c)},d(pe){pe&&A(e),G=!1,zt(j)}}}function fa(t){var U,z,V,F,R,G,j,H,W;let e,l,n=((V=(z=(U=t[2].conf)==null?void 0:U.connection)==null?void 0:z.title)!=null?V:"Connection")+"",i,o,a,c,_,u,f,p,d,v,h=((G=(R=(F=t[2].conf)==null?void 0:F.connection)==null?void 0:R.wifi)!=null?G:"WiFi")+"",k,g,T=((W=(H=(j=t[2].conf)==null?void 0:j.connection)==null?void 0:H.ap)!=null?W:"AP")+"",O,E,I,N,B=t[0].if&&t[0].if.eth&&ua(t),S=(t[5].n.c==1||t[5].n.c==2)&&ra(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("input"),f=b(),p=m("div"),d=m("select"),v=m("option"),k=M(h),g=m("option"),O=M(T),B&&B.c(),E=b(),S&&S.c(),r(l,"class","text-sm"),r(a,"href",kl("WiFi-configuration")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","w"),u.value="true",v.__value=1,v.value=v.__value,g.__value=2,g.value=g.__value,r(d,"name","nc"),r(d,"class","in-s"),t[5].n.c===void 0&&Gt(()=>t[47].call(d)),r(p,"class","my-1"),r(e,"class","cnt")},m(K,Q){q(K,e,Q),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(p,d),s(d,v),s(v,k),s(d,g),s(g,O),B&&B.m(d,null),ot(d,t[5].n.c,!0),s(e,E),S&&S.m(e,null),I||(N=ve(d,"change",t[47]),I=!0)},p(K,Q){var J,ae,Z,X,oe,ne,ie,re,me;Q[0]&4&&n!==(n=((Z=(ae=(J=K[2].conf)==null?void 0:J.connection)==null?void 0:ae.title)!=null?Z:"Connection")+"")&&D(i,n),Q[0]&4&&h!==(h=((ne=(oe=(X=K[2].conf)==null?void 0:X.connection)==null?void 0:oe.wifi)!=null?ne:"WiFi")+"")&&D(k,h),Q[0]&4&&T!==(T=((me=(re=(ie=K[2].conf)==null?void 0:ie.connection)==null?void 0:re.ap)!=null?me:"AP")+"")&&D(O,T),K[0].if&&K[0].if.eth?B?B.p(K,Q):(B=ua(K),B.c(),B.m(d,null)):B&&(B.d(1),B=null),Q[0]&32&&ot(d,K[5].n.c),K[5].n.c==1||K[5].n.c==2?S?S.p(K,Q):(S=ra(K),S.c(),S.m(e,null)):S&&(S.d(1),S=null)},d(K){K&&A(e),B&&B.d(),S&&S.d(),I=!1,N()}}}function ua(t){var i,o,a;let e,l=((a=(o=(i=t[2].conf)==null?void 0:i.connection)==null?void 0:o.eth)!=null?a:"Ethernet")+"",n;return{c(){e=m("option"),n=M(l),e.__value=3,e.value=e.__value},m(c,_){q(c,e,_),s(e,n)},p(c,_){var u,f,p;_[0]&4&&l!==(l=((p=(f=(u=c[2].conf)==null?void 0:u.connection)==null?void 0:f.eth)!=null?p:"Ethernet")+"")&&D(n,l)},d(c){c&&A(e)}}}function ra(t){var ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye,et,He,Oe,ce,Pe,$e,Qe,mt,ye,Ge,ze,tt,vt,Mt,dt;let e,l=((se=(le=(ee=t[2].conf)==null?void 0:ee.connection)==null?void 0:le.ssid)!=null?se:"SSID")+"",n,i,o,a,c,_,u=((Se=(Te=(_e=t[2].conf)==null?void 0:_e.connection)==null?void 0:Te.psk)!=null?Se:"Password")+"",f,p,d,v,h,k,g,T=((ge=(we=(Ne=(de=t[2].conf)==null?void 0:de.connection)==null?void 0:Ne.ps)==null?void 0:we.title)!=null?ge:"Power saving")+"",O,E,I,N,B,S=((We=(Ue=(je=(he=t[2].conf)==null?void 0:he.connection)==null?void 0:je.ps)==null?void 0:Ue.default)!=null?We:"Default")+"",U,z,V=((et=(Ye=(Je=(Ze=t[2].conf)==null?void 0:Ze.connection)==null?void 0:Je.ps)==null?void 0:Ye.off)!=null?et:"Off")+"",F,R,G=((Pe=(ce=(Oe=(He=t[2].conf)==null?void 0:He.connection)==null?void 0:Oe.ps)==null?void 0:ce.min)!=null?Pe:"Min")+"",j,H,W=((ye=(mt=(Qe=($e=t[2].conf)==null?void 0:$e.connection)==null?void 0:Qe.ps)==null?void 0:mt.max)!=null?ye:"Max")+"",K,Q,J,ae=((tt=(ze=(Ge=t[2].conf)==null?void 0:Ge.connection)==null?void 0:ze.pwr)!=null?tt:"Power")+"",Z,X,oe,ne,ie,re,me,Y,x,ke,pe,C,w=((dt=(Mt=(vt=t[2].conf)==null?void 0:vt.connection)==null?void 0:Mt.tick_11b)!=null?dt:"802.11b")+"",P,L,y;return{c(){e=m("div"),n=M(l),i=m("br"),o=b(),a=m("input"),c=b(),_=m("div"),f=M(u),p=m("br"),d=b(),v=m("input"),h=b(),k=m("div"),g=m("div"),O=M(T),E=m("br"),I=b(),N=m("select"),B=m("option"),U=M(S),z=m("option"),F=M(V),R=m("option"),j=M(G),H=m("option"),K=M(W),Q=b(),J=m("div"),Z=M(ae),X=m("br"),oe=b(),ne=m("div"),ie=m("input"),re=b(),me=m("span"),me.textContent="dBm",Y=b(),x=m("div"),ke=m("label"),pe=m("input"),C=b(),P=M(w),r(a,"name","ws"),r(a,"type","text"),r(a,"class","in-s"),r(e,"class","my-1"),r(v,"name","wp"),r(v,"type","password"),r(v,"class","in-s"),r(_,"class","my-1"),B.__value=255,B.value=B.__value,z.__value=0,z.value=z.__value,R.__value=1,R.value=R.__value,H.__value=2,H.value=H.__value,r(N,"name","wz"),r(N,"class","in-s"),t[5].w.z===void 0&&Gt(()=>t[50].call(N)),r(g,"class","w-1/2"),r(ie,"name","ww"),r(ie,"type","number"),r(ie,"min","0"),r(ie,"max","20.5"),r(ie,"step","0.5"),r(ie,"class","in-f tr w-full"),r(me,"class","in-post"),r(ne,"class","flex"),r(J,"class","ml-2 w-1/2"),r(k,"class","my-1 flex"),r(pe,"type","checkbox"),r(pe,"name","wb"),pe.__value="true",pe.value=pe.__value,r(pe,"class","rounded mb-1"),r(x,"class","my-3")},m(te,be){q(te,e,be),s(e,n),s(e,i),s(e,o),s(e,a),Ee(a,t[5].w.s),q(te,c,be),q(te,_,be),s(_,f),s(_,p),s(_,d),s(_,v),Ee(v,t[5].w.p),q(te,h,be),q(te,k,be),s(k,g),s(g,O),s(g,E),s(g,I),s(g,N),s(N,B),s(B,U),s(N,z),s(z,F),s(N,R),s(R,j),s(N,H),s(H,K),ot(N,t[5].w.z,!0),s(k,Q),s(k,J),s(J,Z),s(J,X),s(J,oe),s(J,ne),s(ne,ie),Ee(ie,t[5].w.w),s(ne,re),s(ne,me),q(te,Y,be),q(te,x,be),s(x,ke),s(ke,pe),pe.checked=t[5].w.b,s(ke,C),s(ke,P),L||(y=[ve(a,"input",t[48]),ve(v,"input",t[49]),ve(N,"change",t[50]),ve(ie,"input",t[51]),ve(pe,"change",t[52])],L=!0)},p(te,be){var Tt,Ce,qe,pt,at,ft,ut,Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt,Ve,Ke,Bt,nt,bt,wt,ue,Me,Ae,it,rt,At,Xt,Zt;be[0]&4&&l!==(l=((qe=(Ce=(Tt=te[2].conf)==null?void 0:Tt.connection)==null?void 0:Ce.ssid)!=null?qe:"SSID")+"")&&D(n,l),be[0]&32&&a.value!==te[5].w.s&&Ee(a,te[5].w.s),be[0]&4&&u!==(u=((ft=(at=(pt=te[2].conf)==null?void 0:pt.connection)==null?void 0:at.psk)!=null?ft:"Password")+"")&&D(f,u),be[0]&32&&v.value!==te[5].w.p&&Ee(v,te[5].w.p),be[0]&4&&T!==(T=((St=(Ot=(Et=(ut=te[2].conf)==null?void 0:ut.connection)==null?void 0:Et.ps)==null?void 0:Ot.title)!=null?St:"Power saving")+"")&&D(O,T),be[0]&4&&S!==(S=((Ct=(yt=(It=(Pt=te[2].conf)==null?void 0:Pt.connection)==null?void 0:It.ps)==null?void 0:yt.default)!=null?Ct:"Default")+"")&&D(U,S),be[0]&4&&V!==(V=((Wt=(Ut=(Lt=(ht=te[2].conf)==null?void 0:ht.connection)==null?void 0:Lt.ps)==null?void 0:Ut.off)!=null?Wt:"Off")+"")&&D(F,V),be[0]&4&&G!==(G=((nt=(Bt=(Ke=(Ve=te[2].conf)==null?void 0:Ve.connection)==null?void 0:Ke.ps)==null?void 0:Bt.min)!=null?nt:"Min")+"")&&D(j,G),be[0]&4&&W!==(W=((Me=(ue=(wt=(bt=te[2].conf)==null?void 0:bt.connection)==null?void 0:wt.ps)==null?void 0:ue.max)!=null?Me:"Max")+"")&&D(K,W),be[0]&32&&ot(N,te[5].w.z),be[0]&4&&ae!==(ae=((rt=(it=(Ae=te[2].conf)==null?void 0:Ae.connection)==null?void 0:it.pwr)!=null?rt:"Power")+"")&&D(Z,ae),be[0]&32&&st(ie.value)!==te[5].w.w&&Ee(ie,te[5].w.w),be[0]&32&&(pe.checked=te[5].w.b),be[0]&4&&w!==(w=((Zt=(Xt=(At=te[2].conf)==null?void 0:At.connection)==null?void 0:Xt.tick_11b)!=null?Zt:"802.11b")+"")&&D(P,w)},d(te){te&&A(e),te&&A(c),te&&A(_),te&&A(h),te&&A(k),te&&A(Y),te&&A(x),L=!1,zt(y)}}}function ca(t){var je,Ue,We,Ze,Je,Ye,et,He,Oe,ce,Pe,$e,Qe,mt,ye,Ge,ze,tt,vt,Mt,dt;let e,l,n=((We=(Ue=(je=t[2].conf)==null?void 0:je.network)==null?void 0:Ue.title)!=null?We:"Network")+"",i,o,a,c,_,u,f=((Ye=(Je=(Ze=t[2].conf)==null?void 0:Ze.network)==null?void 0:Je.ip)!=null?Ye:"IP")+"",p,d,v,h,k,g,T=((Oe=(He=(et=t[2].conf)==null?void 0:et.network)==null?void 0:He.dhcp)!=null?Oe:"DHCP")+"",O,E,I=(($e=(Pe=(ce=t[2].conf)==null?void 0:ce.network)==null?void 0:Pe.static)!=null?$e:"Static")+"",N,B,S,U,z,V,F,R,G,j,H,W,K,Q,J,ae,Z,X,oe,ne,ie,re=((ye=(mt=(Qe=t[2].conf)==null?void 0:Qe.network)==null?void 0:mt.tick_mdns)!=null?ye:"mDNS")+"",me,Y,x,ke,pe,C=((tt=(ze=(Ge=t[2].conf)==null?void 0:Ge.network)==null?void 0:ze.ntp)!=null?tt:"NTP")+"",w,P,L,y,ee,le=((dt=(Mt=(vt=t[2].conf)==null?void 0:vt.network)==null?void 0:Mt.tick_ntp_dhcp)!=null?dt:"from DHCP")+"",se,_e,Te,Se,de,Ne,we,ge;R=new Tu({});let he=t[5].n.m=="static"&&_a(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("div"),p=M(f),d=m("br"),v=b(),h=m("div"),k=m("select"),g=m("option"),O=M(T),E=m("option"),N=M(I),B=b(),S=m("input"),V=b(),F=m("select"),Re(R.$$.fragment),H=b(),he&&he.c(),W=b(),K=m("div"),Q=m("label"),J=m("input"),ae=M(" IPv6"),Z=b(),X=m("div"),oe=m("label"),ne=m("input"),ie=b(),me=M(re),Y=b(),x=m("input"),ke=b(),pe=m("div"),w=M(C),P=b(),L=m("label"),y=m("input"),ee=b(),se=M(le),_e=m("br"),Te=b(),Se=m("div"),de=m("input"),r(l,"class","text-sm"),r(a,"href",kl("Network-configuration")),r(a,"target","_blank"),r(a,"class","float-right"),g.__value="dhcp",g.value=g.__value,E.__value="static",E.value=E.__value,r(k,"name","nm"),r(k,"class","in-f"),t[5].n.m===void 0&&Gt(()=>t[53].call(k)),r(S,"name","ni"),r(S,"type","text"),r(S,"class","in-m w-full"),S.disabled=U=t[5].n.m=="dhcp",S.required=z=t[5].n.m=="static",r(F,"name","ns"),r(F,"class","in-l"),F.disabled=G=t[5].n.m=="dhcp",F.required=j=t[5].n.m=="static",t[5].n.s===void 0&&Gt(()=>t[55].call(F)),r(h,"class","flex"),r(u,"class","my-1"),r(J,"name","nx"),J.__value="true",J.value=J.__value,r(J,"type","checkbox"),r(J,"class","rounded mb-1"),r(K,"class","my-1"),r(ne,"name","nd"),ne.__value="true",ne.value=ne.__value,r(ne,"type","checkbox"),r(ne,"class","rounded mb-1"),r(X,"class","my-1"),r(x,"type","hidden"),r(x,"name","ntp"),x.value="true",r(y,"name","ntpd"),y.__value="true",y.value=y.__value,r(y,"type","checkbox"),r(y,"class","rounded mb-1"),r(L,"class","ml-4"),r(de,"name","ntph"),r(de,"type","text"),r(de,"class","in-s"),r(Se,"class","flex"),r(pe,"class","my-1"),r(e,"class","cnt")},m(te,be){q(te,e,be),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(u,p),s(u,d),s(u,v),s(u,h),s(h,k),s(k,g),s(g,O),s(k,E),s(E,N),ot(k,t[5].n.m,!0),s(h,B),s(h,S),Ee(S,t[5].n.i),s(h,V),s(h,F),De(R,F,null),ot(F,t[5].n.s,!0),s(e,H),he&&he.m(e,null),s(e,W),s(e,K),s(K,Q),s(Q,J),J.checked=t[5].n.x,s(Q,ae),s(e,Z),s(e,X),s(X,oe),s(oe,ne),ne.checked=t[5].n.d,s(oe,ie),s(oe,me),s(e,Y),s(e,x),s(e,ke),s(e,pe),s(pe,w),s(pe,P),s(pe,L),s(L,y),y.checked=t[5].n.h,s(L,ee),s(L,se),s(pe,_e),s(pe,Te),s(pe,Se),s(Se,de),Ee(de,t[5].n.n1),Ne=!0,we||(ge=[ve(k,"change",t[53]),ve(S,"input",t[54]),ve(F,"change",t[55]),ve(J,"change",t[59]),ve(ne,"change",t[60]),ve(y,"change",t[61]),ve(de,"input",t[62])],we=!0)},p(te,be){var Tt,Ce,qe,pt,at,ft,ut,Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt,Ve,Ke,Bt;(!Ne||be[0]&4)&&n!==(n=((qe=(Ce=(Tt=te[2].conf)==null?void 0:Tt.network)==null?void 0:Ce.title)!=null?qe:"Network")+"")&&D(i,n),(!Ne||be[0]&4)&&f!==(f=((ft=(at=(pt=te[2].conf)==null?void 0:pt.network)==null?void 0:at.ip)!=null?ft:"IP")+"")&&D(p,f),(!Ne||be[0]&4)&&T!==(T=((Ot=(Et=(ut=te[2].conf)==null?void 0:ut.network)==null?void 0:Et.dhcp)!=null?Ot:"DHCP")+"")&&D(O,T),(!Ne||be[0]&4)&&I!==(I=((It=(Pt=(St=te[2].conf)==null?void 0:St.network)==null?void 0:Pt.static)!=null?It:"Static")+"")&&D(N,I),be[0]&32&&ot(k,te[5].n.m),(!Ne||be[0]&32&&U!==(U=te[5].n.m=="dhcp"))&&(S.disabled=U),(!Ne||be[0]&32&&z!==(z=te[5].n.m=="static"))&&(S.required=z),be[0]&32&&S.value!==te[5].n.i&&Ee(S,te[5].n.i),(!Ne||be[0]&32&&G!==(G=te[5].n.m=="dhcp"))&&(F.disabled=G),(!Ne||be[0]&32&&j!==(j=te[5].n.m=="static"))&&(F.required=j),be[0]&32&&ot(F,te[5].n.s),te[5].n.m=="static"?he?he.p(te,be):(he=_a(te),he.c(),he.m(e,W)):he&&(he.d(1),he=null),be[0]&32&&(J.checked=te[5].n.x),be[0]&32&&(ne.checked=te[5].n.d),(!Ne||be[0]&4)&&re!==(re=((ht=(Ct=(yt=te[2].conf)==null?void 0:yt.network)==null?void 0:Ct.tick_mdns)!=null?ht:"mDNS")+"")&&D(me,re),(!Ne||be[0]&4)&&C!==(C=((Wt=(Ut=(Lt=te[2].conf)==null?void 0:Lt.network)==null?void 0:Ut.ntp)!=null?Wt:"NTP")+"")&&D(w,C),be[0]&32&&(y.checked=te[5].n.h),(!Ne||be[0]&4)&&le!==(le=((Bt=(Ke=(Ve=te[2].conf)==null?void 0:Ve.network)==null?void 0:Ke.tick_ntp_dhcp)!=null?Bt:"from DHCP")+"")&&D(se,le),be[0]&32&&de.value!==te[5].n.n1&&Ee(de,te[5].n.n1)},i(te){Ne||($(R.$$.fragment,te),Ne=!0)},o(te){fe(R.$$.fragment,te),Ne=!1},d(te){te&&A(e),Le(R),he&&he.d(),we=!1,zt(ge)}}}function _a(t){var E,I,N,B,S,U;let e,l=((N=(I=(E=t[2].conf)==null?void 0:E.network)==null?void 0:I.gw)!=null?N:"Gateway")+"",n,i,o,a,c,_,u=((U=(S=(B=t[2].conf)==null?void 0:B.network)==null?void 0:S.dns)!=null?U:"DNS")+"",f,p,d,v,h,k,g,T,O;return{c(){e=m("div"),n=M(l),i=m("br"),o=b(),a=m("input"),c=b(),_=m("div"),f=M(u),p=m("br"),d=b(),v=m("div"),h=m("input"),k=b(),g=m("input"),r(a,"name","ng"),r(a,"type","text"),r(a,"class","in-s"),r(e,"class","my-1"),r(h,"name","nd1"),r(h,"type","text"),r(h,"class","in-f w-full"),r(g,"name","nd2"),r(g,"type","text"),r(g,"class","in-l w-full"),r(v,"class","flex"),r(_,"class","my-1")},m(z,V){q(z,e,V),s(e,n),s(e,i),s(e,o),s(e,a),Ee(a,t[5].n.g),q(z,c,V),q(z,_,V),s(_,f),s(_,p),s(_,d),s(_,v),s(v,h),Ee(h,t[5].n.d1),s(v,k),s(v,g),Ee(g,t[5].n.d2),T||(O=[ve(a,"input",t[56]),ve(h,"input",t[57]),ve(g,"input",t[58])],T=!0)},p(z,V){var F,R,G,j,H,W;V[0]&4&&l!==(l=((G=(R=(F=z[2].conf)==null?void 0:F.network)==null?void 0:R.gw)!=null?G:"Gateway")+"")&&D(n,l),V[0]&32&&a.value!==z[5].n.g&&Ee(a,z[5].n.g),V[0]&4&&u!==(u=((W=(H=(j=z[2].conf)==null?void 0:j.network)==null?void 0:H.dns)!=null?W:"DNS")+"")&&D(f,u),V[0]&32&&h.value!==z[5].n.d1&&Ee(h,z[5].n.d1),V[0]&32&&g.value!==z[5].n.d2&&Ee(g,z[5].n.d2)},d(z){z&&A(e),z&&A(c),z&&A(_),T=!1,zt(O)}}}function ma(t){var Qe,mt,ye,Ge,ze,tt,vt,Mt,dt,te,be,Tt,Ce,qe,pt,at,ft,ut,Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt;let e,l,n=((ye=(mt=(Qe=t[2].conf)==null?void 0:Qe.mqtt)==null?void 0:mt.title)!=null?ye:"MQTT")+"",i,o,a,c,_,u,f,p,d=((tt=(ze=(Ge=t[2].conf)==null?void 0:Ge.mqtt)==null?void 0:ze.server)!=null?tt:"Server")+"",v,h,k,g,T,O,E,I,N,B,S,U,z=((dt=(Mt=(vt=t[2].conf)==null?void 0:vt.mqtt)==null?void 0:Mt.user)!=null?dt:"Username")+"",V,F,R,G,j,H,W=((Tt=(be=(te=t[2].conf)==null?void 0:te.mqtt)==null?void 0:be.pass)!=null?Tt:"Password")+"",K,Q,J,ae,Z,X,oe,ne=((pt=(qe=(Ce=t[2].conf)==null?void 0:Ce.mqtt)==null?void 0:qe.id)!=null?pt:"Client ID")+"",ie,re,me,Y,x,ke,pe=((ut=(ft=(at=t[2].conf)==null?void 0:at.mqtt)==null?void 0:ft.payload)!=null?ut:"Payload")+"",C,w,P,L,y,ee,le,se=((Pt=(St=(Ot=(Et=t[2].conf)==null?void 0:Et.mqtt)==null?void 0:Ot.domoticz)==null?void 0:St.title)!=null?Pt:"Domoticz")+"",_e,Te,Se=((ht=(Ct=(yt=(It=t[2].conf)==null?void 0:It.mqtt)==null?void 0:yt.ha)==null?void 0:Ct.title)!=null?ht:"Home-Assistant")+"",de,Ne,we,ge,he,je,Ue,We=((Wt=(Ut=(Lt=t[2].conf)==null?void 0:Lt.mqtt)==null?void 0:Ut.publish)!=null?Wt:"Publish topic")+"",Ze,Je,Ye,et,He,Oe,ce,Pe=t[0].chip!="esp8266"&&pa(t),$e=t[5].q.s.e&&da(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("input"),f=b(),p=m("div"),v=M(d),h=b(),Pe&&Pe.c(),k=b(),g=m("br"),T=b(),O=m("div"),E=m("input"),I=b(),N=m("input"),B=b(),$e&&$e.c(),S=b(),U=m("div"),V=M(z),F=m("br"),R=b(),G=m("input"),j=b(),H=m("div"),K=M(W),Q=m("br"),J=b(),ae=m("input"),Z=b(),X=m("div"),oe=m("div"),ie=M(ne),re=m("br"),me=b(),Y=m("input"),x=b(),ke=m("div"),C=M(pe),w=m("br"),P=b(),L=m("select"),y=m("option"),y.textContent="Raw (minimal)",ee=m("option"),ee.textContent="Raw (full)",le=m("option"),_e=M(se),Te=m("option"),de=M(Se),Ne=m("option"),Ne.textContent="JSON (classic)",we=m("option"),we.textContent="JSON (multi topic)",ge=m("option"),ge.textContent="JSON (flat)",he=m("option"),he.textContent="HEX dump",je=b(),Ue=m("div"),Ze=M(We),Je=m("br"),Ye=b(),et=m("input"),r(l,"class","text-sm"),r(a,"href",kl("MQTT-configuration")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","q"),u.value="true",r(E,"name","qh"),r(E,"type","text"),r(E,"class","in-f w-2/3"),r(N,"name","qp"),r(N,"type","number"),r(N,"min","1024"),r(N,"max","65535"),r(N,"class","in-l tr w-1/3"),r(O,"class","flex"),r(p,"class","my-1"),r(G,"name","qu"),r(G,"type","text"),r(G,"class","in-s"),r(U,"class","my-1"),r(ae,"name","qa"),r(ae,"type","password"),r(ae,"class","in-s"),r(H,"class","my-1"),r(Y,"name","qc"),r(Y,"type","text"),r(Y,"class","in-f w-full"),y.__value=1,y.value=y.__value,ee.__value=2,ee.value=ee.__value,le.__value=3,le.value=le.__value,Te.__value=4,Te.value=Te.__value,Ne.__value=0,Ne.value=Ne.__value,we.__value=5,we.value=we.__value,ge.__value=6,ge.value=ge.__value,he.__value=255,he.value=he.__value,r(L,"name","qm"),r(L,"class","in-l"),t[5].q.m===void 0&&Gt(()=>t[69].call(L)),r(X,"class","my-1 flex"),r(et,"name","qb"),r(et,"type","text"),r(et,"class","in-s"),r(Ue,"class","my-1"),r(e,"class","cnt")},m(Ve,Ke){q(Ve,e,Ke),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(p,v),s(p,h),Pe&&Pe.m(p,null),s(p,k),s(p,g),s(p,T),s(p,O),s(O,E),Ee(E,t[5].q.h),s(O,I),s(O,N),Ee(N,t[5].q.p),s(e,B),$e&&$e.m(e,null),s(e,S),s(e,U),s(U,V),s(U,F),s(U,R),s(U,G),Ee(G,t[5].q.u),s(e,j),s(e,H),s(H,K),s(H,Q),s(H,J),s(H,ae),Ee(ae,t[5].q.a),s(e,Z),s(e,X),s(X,oe),s(oe,ie),s(oe,re),s(oe,me),s(oe,Y),Ee(Y,t[5].q.c),s(X,x),s(X,ke),s(ke,C),s(ke,w),s(ke,P),s(ke,L),s(L,y),s(L,ee),s(L,le),s(le,_e),s(L,Te),s(Te,de),s(L,Ne),s(L,we),s(L,ge),s(L,he),ot(L,t[5].q.m,!0),s(e,je),s(e,Ue),s(Ue,Ze),s(Ue,Je),s(Ue,Ye),s(Ue,et),Ee(et,t[5].q.b),He=!0,Oe||(ce=[ve(E,"input",t[64]),ve(N,"input",t[65]),ve(G,"input",t[66]),ve(ae,"input",t[67]),ve(Y,"input",t[68]),ve(L,"change",t[69]),ve(et,"input",t[70])],Oe=!0)},p(Ve,Ke){var Bt,nt,bt,wt,ue,Me,Ae,it,rt,At,Xt,Zt,el,tl,ll,nl,il,sl,ol,al,fl,ul,Ie,jt,rl,cl,hl,bl,gl;(!He||Ke[0]&4)&&n!==(n=((bt=(nt=(Bt=Ve[2].conf)==null?void 0:Bt.mqtt)==null?void 0:nt.title)!=null?bt:"MQTT")+"")&&D(i,n),(!He||Ke[0]&4)&&d!==(d=((Me=(ue=(wt=Ve[2].conf)==null?void 0:wt.mqtt)==null?void 0:ue.server)!=null?Me:"Server")+"")&&D(v,d),Ve[0].chip!="esp8266"?Pe?Pe.p(Ve,Ke):(Pe=pa(Ve),Pe.c(),Pe.m(p,k)):Pe&&(Pe.d(1),Pe=null),Ke[0]&32&&E.value!==Ve[5].q.h&&Ee(E,Ve[5].q.h),Ke[0]&32&&st(N.value)!==Ve[5].q.p&&Ee(N,Ve[5].q.p),Ve[5].q.s.e?$e?($e.p(Ve,Ke),Ke[0]&32&&$($e,1)):($e=da(Ve),$e.c(),$($e,1),$e.m(e,S)):$e&&(gt(),fe($e,1,1,()=>{$e=null}),kt()),(!He||Ke[0]&4)&&z!==(z=((rt=(it=(Ae=Ve[2].conf)==null?void 0:Ae.mqtt)==null?void 0:it.user)!=null?rt:"Username")+"")&&D(V,z),Ke[0]&32&&G.value!==Ve[5].q.u&&Ee(G,Ve[5].q.u),(!He||Ke[0]&4)&&W!==(W=((Zt=(Xt=(At=Ve[2].conf)==null?void 0:At.mqtt)==null?void 0:Xt.pass)!=null?Zt:"Password")+"")&&D(K,W),Ke[0]&32&&ae.value!==Ve[5].q.a&&Ee(ae,Ve[5].q.a),(!He||Ke[0]&4)&&ne!==(ne=((ll=(tl=(el=Ve[2].conf)==null?void 0:el.mqtt)==null?void 0:tl.id)!=null?ll:"Client ID")+"")&&D(ie,ne),Ke[0]&32&&Y.value!==Ve[5].q.c&&Ee(Y,Ve[5].q.c),(!He||Ke[0]&4)&&pe!==(pe=((sl=(il=(nl=Ve[2].conf)==null?void 0:nl.mqtt)==null?void 0:il.payload)!=null?sl:"Payload")+"")&&D(C,pe),(!He||Ke[0]&4)&&se!==(se=((ul=(fl=(al=(ol=Ve[2].conf)==null?void 0:ol.mqtt)==null?void 0:al.domoticz)==null?void 0:fl.title)!=null?ul:"Domoticz")+"")&&D(_e,se),(!He||Ke[0]&4)&&Se!==(Se=((cl=(rl=(jt=(Ie=Ve[2].conf)==null?void 0:Ie.mqtt)==null?void 0:jt.ha)==null?void 0:rl.title)!=null?cl:"Home-Assistant")+"")&&D(de,Se),Ke[0]&32&&ot(L,Ve[5].q.m),(!He||Ke[0]&4)&&We!==(We=((gl=(bl=(hl=Ve[2].conf)==null?void 0:hl.mqtt)==null?void 0:bl.publish)!=null?gl:"Publish topic")+"")&&D(Ze,We),Ke[0]&32&&et.value!==Ve[5].q.b&&Ee(et,Ve[5].q.b)},i(Ve){He||($($e),He=!0)},o(Ve){fe($e),He=!1},d(Ve){Ve&&A(e),Pe&&Pe.d(),$e&&$e.d(),Oe=!1,zt(ce)}}}function pa(t){let e,l,n,i,o;return{c(){e=m("label"),l=m("input"),n=M(" 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(a,c){q(a,e,c),s(e,l),l.checked=t[5].q.s.e,s(e,n),i||(o=[ve(l,"change",t[63]),ve(l,"change",t[17])],i=!0)},p(a,c){c[0]&32&&(l.checked=a[5].q.s.e)},d(a){a&&A(e),i=!1,zt(o)}}}function da(t){let e,l,n,i,o,a,c,_,u,f,p,d,v;const h=[V0,G0],k=[];function g(S,U){return S[5].q.s.c?0:1}n=g(t),i=k[n]=h[n](t);const T=[X0,Q0],O=[];function E(S,U){return S[5].q.s.r?0:1}c=E(t),_=O[c]=T[c](t);const I=[x0,$0],N=[];function B(S,U){return S[5].q.s.k?0:1}return p=B(t),d=N[p]=I[p](t),{c(){e=m("div"),l=m("span"),i.c(),o=b(),a=m("span"),_.c(),u=b(),f=m("span"),d.c(),r(l,"class","flex pr-2"),r(a,"class","flex pr-2"),r(f,"class","flex pr-2"),r(e,"class","my-1 flex")},m(S,U){q(S,e,U),s(e,l),k[n].m(l,null),s(e,o),s(e,a),O[c].m(a,null),s(e,u),s(e,f),N[p].m(f,null),v=!0},p(S,U){let z=n;n=g(S),n===z?k[n].p(S,U):(gt(),fe(k[z],1,1,()=>{k[z]=null}),kt(),i=k[n],i?i.p(S,U):(i=k[n]=h[n](S),i.c()),$(i,1),i.m(l,null));let V=c;c=E(S),c===V?O[c].p(S,U):(gt(),fe(O[V],1,1,()=>{O[V]=null}),kt(),_=O[c],_?_.p(S,U):(_=O[c]=T[c](S),_.c()),$(_,1),_.m(a,null));let F=p;p=B(S),p===F?N[p].p(S,U):(gt(),fe(N[F],1,1,()=>{N[F]=null}),kt(),d=N[p],d?d.p(S,U):(d=N[p]=I[p](S),d.c()),$(d,1),d.m(f,null))},i(S){v||($(i),$(_),$(d),v=!0)},o(S){fe(i),fe(_),fe(d),v=!1},d(S){S&&A(e),k[n].d(),O[c].d(),N[p].d()}}}function G0(t){let e,l;return e=new Ml({props:{to:"/mqtt-ca",$$slots:{default:[K0]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i[0]&4|i[3]&1073741824&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function V0(t){let e,l,n,i,o,a,c;return l=new Ml({props:{to:"/mqtt-ca",$$slots:{default:[Y0]},$$scope:{ctx:t}}}),{c(){e=m("span"),Re(l.$$.fragment),n=b(),i=m("span"),i.textContent="\u{1F5D1}",r(e,"class","bd-on"),r(i,"class","bd-off")},m(_,u){q(_,e,u),De(l,e,null),q(_,n,u),q(_,i,u),o=!0,a||(c=[ve(i,"click",t[14]),ve(i,"keypress",t[14])],a=!0)},p(_,u){const f={};u[0]&4|u[3]&1073741824&&(f.$$scope={dirty:u,ctx:_}),l.$set(f)},i(_){o||($(l.$$.fragment,_),o=!0)},o(_){fe(l.$$.fragment,_),o=!1},d(_){_&&A(e),Le(l),_&&A(n),_&&A(i),a=!1,zt(c)}}}function K0(t){var n,i,o,a,c,_;let e,l;return e=new $l({props:{color:"blue",text:(o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_ca_upload)!=null?o:"Upload CA",title:(_=(c=(a=t[2].conf)==null?void 0:a.mqtt)==null?void 0:c.title_ca)!=null?_:""}}),{c(){Re(e.$$.fragment)},m(u,f){De(e,u,f),l=!0},p(u,f){var d,v,h,k,g,T;const p={};f[0]&4&&(p.text=(h=(v=(d=u[2].conf)==null?void 0:d.mqtt)==null?void 0:v.btn_ca_upload)!=null?h:"Upload CA"),f[0]&4&&(p.title=(T=(g=(k=u[2].conf)==null?void 0:k.mqtt)==null?void 0:g.title_ca)!=null?T:""),e.$set(p)},i(u){l||($(e.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),l=!1},d(u){Le(e,u)}}}function Y0(t){var n,i,o;let e=((o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.ca_ok)!=null?o:"CA OK")+"",l;return{c(){l=M(e)},m(a,c){q(a,l,c)},p(a,c){var _,u,f;c[0]&4&&e!==(e=((f=(u=(_=a[2].conf)==null?void 0:_.mqtt)==null?void 0:u.ca_ok)!=null?f:"CA OK")+"")&&D(l,e)},d(a){a&&A(l)}}}function Q0(t){let e,l;return e=new Ml({props:{to:"/mqtt-cert",$$slots:{default:[Z0]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i[0]&4|i[3]&1073741824&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function X0(t){let e,l,n,i,o,a,c;return l=new Ml({props:{to:"/mqtt-cert",$$slots:{default:[J0]},$$scope:{ctx:t}}}),{c(){e=m("span"),Re(l.$$.fragment),n=b(),i=m("span"),i.textContent="\u{1F5D1}",r(e,"class","bd-on"),r(i,"class","bd-off")},m(_,u){q(_,e,u),De(l,e,null),q(_,n,u),q(_,i,u),o=!0,a||(c=[ve(i,"click",t[15]),ve(i,"keypress",t[15])],a=!0)},p(_,u){const f={};u[0]&4|u[3]&1073741824&&(f.$$scope={dirty:u,ctx:_}),l.$set(f)},i(_){o||($(l.$$.fragment,_),o=!0)},o(_){fe(l.$$.fragment,_),o=!1},d(_){_&&A(e),Le(l),_&&A(n),_&&A(i),a=!1,zt(c)}}}function Z0(t){var n,i,o,a,c,_;let e,l;return e=new $l({props:{color:"blue",text:(o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_crt_upload)!=null?o:"Upload cert",title:(_=(c=(a=t[2].conf)==null?void 0:a.mqtt)==null?void 0:c.title_crt)!=null?_:""}}),{c(){Re(e.$$.fragment)},m(u,f){De(e,u,f),l=!0},p(u,f){var d,v,h,k,g,T;const p={};f[0]&4&&(p.text=(h=(v=(d=u[2].conf)==null?void 0:d.mqtt)==null?void 0:v.btn_crt_upload)!=null?h:"Upload cert"),f[0]&4&&(p.title=(T=(g=(k=u[2].conf)==null?void 0:k.mqtt)==null?void 0:g.title_crt)!=null?T:""),e.$set(p)},i(u){l||($(e.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),l=!1},d(u){Le(e,u)}}}function J0(t){var n,i,o;let e=((o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.crt_ok)!=null?o:"Cert OK")+"",l;return{c(){l=M(e)},m(a,c){q(a,l,c)},p(a,c){var _,u,f;c[0]&4&&e!==(e=((f=(u=(_=a[2].conf)==null?void 0:_.mqtt)==null?void 0:u.crt_ok)!=null?f:"Cert OK")+"")&&D(l,e)},d(a){a&&A(l)}}}function $0(t){let e,l;return e=new Ml({props:{to:"/mqtt-key",$$slots:{default:[ec]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i[0]&4|i[3]&1073741824&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function x0(t){let e,l,n,i,o,a,c;return l=new Ml({props:{to:"/mqtt-key",$$slots:{default:[tc]},$$scope:{ctx:t}}}),{c(){e=m("span"),Re(l.$$.fragment),n=b(),i=m("span"),i.textContent="\u{1F5D1}",r(e,"class","bd-on"),r(i,"class","bd-off")},m(_,u){q(_,e,u),De(l,e,null),q(_,n,u),q(_,i,u),o=!0,a||(c=[ve(i,"click",t[16]),ve(i,"keypress",t[16])],a=!0)},p(_,u){const f={};u[0]&4|u[3]&1073741824&&(f.$$scope={dirty:u,ctx:_}),l.$set(f)},i(_){o||($(l.$$.fragment,_),o=!0)},o(_){fe(l.$$.fragment,_),o=!1},d(_){_&&A(e),Le(l),_&&A(n),_&&A(i),a=!1,zt(c)}}}function ec(t){var n,i,o,a,c,_;let e,l;return e=new $l({props:{color:"blue",text:(o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_key_upload)!=null?o:"Upload key",title:(_=(c=(a=t[2].conf)==null?void 0:a.mqtt)==null?void 0:c.title_key)!=null?_:""}}),{c(){Re(e.$$.fragment)},m(u,f){De(e,u,f),l=!0},p(u,f){var d,v,h,k,g,T;const p={};f[0]&4&&(p.text=(h=(v=(d=u[2].conf)==null?void 0:d.mqtt)==null?void 0:v.btn_key_upload)!=null?h:"Upload key"),f[0]&4&&(p.title=(T=(g=(k=u[2].conf)==null?void 0:k.mqtt)==null?void 0:g.title_key)!=null?T:""),e.$set(p)},i(u){l||($(e.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),l=!1},d(u){Le(e,u)}}}function tc(t){var n,i,o;let e=((o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.key_ok)!=null?o:"Key OK")+"",l;return{c(){l=M(e)},m(a,c){q(a,l,c)},p(a,c){var _,u,f;c[0]&4&&e!==(e=((f=(u=(_=a[2].conf)==null?void 0:_.mqtt)==null?void 0:u.key_ok)!=null?f:"Key OK")+"")&&D(l,e)},d(a){a&&A(l)}}}function va(t){var X,oe,ne,ie,re,me,Y,x,ke,pe,C,w,P,L,y,ee;let e,l,n=((ie=(ne=(oe=(X=t[2].conf)==null?void 0:X.mqtt)==null?void 0:oe.domoticz)==null?void 0:ne.title)!=null?ie:"Domoticz")+"",i,o,a,c,_,u,f,p,d,v=((x=(Y=(me=(re=t[2].conf)==null?void 0:re.mqtt)==null?void 0:me.domoticz)==null?void 0:Y.eidx)!=null?x:"Electricity IDX")+"",h,k,g,T,O,E,I=((w=(C=(pe=(ke=t[2].conf)==null?void 0:ke.mqtt)==null?void 0:pe.domoticz)==null?void 0:C.cidx)!=null?w:"Current IDX")+"",N,B,S,U,z,V,F=((ee=(y=(L=(P=t[2].conf)==null?void 0:P.mqtt)==null?void 0:L.domoticz)==null?void 0:y.vidx)!=null?ee:"Voltage IDX")+"",R,G,j,H,W,K,Q,J,ae,Z;return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("input"),f=b(),p=m("div"),d=m("div"),h=M(v),k=m("br"),g=b(),T=m("input"),O=b(),E=m("div"),N=M(I),B=m("br"),S=b(),U=m("input"),z=b(),V=m("div"),R=M(F),G=M(`: L1, L2 & L3 - `),j=m("div"),H=m("input"),W=b(),K=m("input"),Q=b(),J=m("input"),r(l,"class","text-sm"),r(a,"href",kl("MQTT-configuration#domoticz")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","o"),u.value="true",r(T,"name","oe"),r(T,"type","text"),r(T,"class","in-f tr w-full"),r(d,"class","w-1/2"),r(U,"name","oc"),r(U,"type","text"),r(U,"class","in-l tr w-full"),r(E,"class","w-1/2"),r(p,"class","my-1 flex"),r(H,"name","ou1"),r(H,"type","text"),r(H,"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(J,"name","ou3"),r(J,"type","text"),r(J,"class","in-l tr w-1/3"),r(j,"class","flex"),r(V,"class","my-1"),r(e,"class","cnt")},m(le,se){q(le,e,se),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(p,d),s(d,h),s(d,k),s(d,g),s(d,T),Ee(T,t[5].o.e),s(p,O),s(p,E),s(E,N),s(E,B),s(E,S),s(E,U),Ee(U,t[5].o.c),s(e,z),s(e,V),s(V,R),s(V,G),s(V,j),s(j,H),Ee(H,t[5].o.u1),s(j,W),s(j,K),Ee(K,t[5].o.u2),s(j,Q),s(j,J),Ee(J,t[5].o.u3),ae||(Z=[ve(T,"input",t[71]),ve(U,"input",t[72]),ve(H,"input",t[73]),ve(K,"input",t[74]),ve(J,"input",t[75])],ae=!0)},p(le,se){var _e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye,et,He;se[0]&4&&n!==(n=((de=(Se=(Te=(_e=le[2].conf)==null?void 0:_e.mqtt)==null?void 0:Te.domoticz)==null?void 0:Se.title)!=null?de:"Domoticz")+"")&&D(i,n),se[0]&4&&v!==(v=((he=(ge=(we=(Ne=le[2].conf)==null?void 0:Ne.mqtt)==null?void 0:we.domoticz)==null?void 0:ge.eidx)!=null?he:"Electricity IDX")+"")&&D(h,v),se[0]&32&&T.value!==le[5].o.e&&Ee(T,le[5].o.e),se[0]&4&&I!==(I=((Ze=(We=(Ue=(je=le[2].conf)==null?void 0:je.mqtt)==null?void 0:Ue.domoticz)==null?void 0:We.cidx)!=null?Ze:"Current IDX")+"")&&D(N,I),se[0]&32&&U.value!==le[5].o.c&&Ee(U,le[5].o.c),se[0]&4&&F!==(F=((He=(et=(Ye=(Je=le[2].conf)==null?void 0:Je.mqtt)==null?void 0:Ye.domoticz)==null?void 0:et.vidx)!=null?He:"Voltage IDX")+"")&&D(R,F),se[0]&32&&H.value!==le[5].o.u1&&Ee(H,le[5].o.u1),se[0]&32&&K.value!==le[5].o.u2&&Ee(K,le[5].o.u2),se[0]&32&&J.value!==le[5].o.u3&&Ee(J,le[5].o.u3)},d(le){le&&A(e),ae=!1,zt(Z)}}}function ha(t){var Q,J,ae,Z,X,oe,ne,ie,re,me,Y,x,ke,pe,C,w;let e,l,n=((Z=(ae=(J=(Q=t[2].conf)==null?void 0:Q.mqtt)==null?void 0:J.ha)==null?void 0:ae.title)!=null?Z:"Home-Assistant")+"",i,o,a,c,_,u,f,p,d=((ie=(ne=(oe=(X=t[2].conf)==null?void 0:X.mqtt)==null?void 0:oe.ha)==null?void 0:ne.discovery)!=null?ie:"Discovery topic prefix")+"",v,h,k,g,T,O,E=((x=(Y=(me=(re=t[2].conf)==null?void 0:re.mqtt)==null?void 0:me.ha)==null?void 0:Y.hostname)!=null?x:"Hostname for URL")+"",I,N,B,S,U,z,V,F=((w=(C=(pe=(ke=t[2].conf)==null?void 0:ke.mqtt)==null?void 0:pe.ha)==null?void 0:C.tag)!=null?w:"Name tag")+"",R,G,j,H,W,K;return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("input"),f=b(),p=m("div"),v=M(d),h=m("br"),k=b(),g=m("input"),T=b(),O=m("div"),I=M(E),N=m("br"),B=b(),S=m("input"),z=b(),V=m("div"),R=M(F),G=m("br"),j=b(),H=m("input"),r(l,"class","text-sm"),r(a,"href",kl("MQTT-configuration#home-assistant")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","h"),u.value="true",r(g,"name","ht"),r(g,"type","text"),r(g,"class","in-s"),r(g,"placeholder","homeassistant"),r(p,"class","my-1"),r(S,"name","hh"),r(S,"type","text"),r(S,"class","in-s"),r(S,"placeholder",U=t[5].g.h+".local"),r(O,"class","my-1"),r(H,"name","hn"),r(H,"type","text"),r(H,"class","in-s"),r(V,"class","my-1"),r(e,"class","cnt")},m(P,L){q(P,e,L),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(p,v),s(p,h),s(p,k),s(p,g),Ee(g,t[5].h.t),s(e,T),s(e,O),s(O,I),s(O,N),s(O,B),s(O,S),Ee(S,t[5].h.h),s(e,z),s(e,V),s(V,R),s(V,G),s(V,j),s(V,H),Ee(H,t[5].h.n),W||(K=[ve(g,"input",t[76]),ve(S,"input",t[77]),ve(H,"input",t[78])],W=!0)},p(P,L){var y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze;L[0]&4&&n!==(n=((se=(le=(ee=(y=P[2].conf)==null?void 0:y.mqtt)==null?void 0:ee.ha)==null?void 0:le.title)!=null?se:"Home-Assistant")+"")&&D(i,n),L[0]&4&&d!==(d=((de=(Se=(Te=(_e=P[2].conf)==null?void 0:_e.mqtt)==null?void 0:Te.ha)==null?void 0:Se.discovery)!=null?de:"Discovery topic prefix")+"")&&D(v,d),L[0]&32&&g.value!==P[5].h.t&&Ee(g,P[5].h.t),L[0]&4&&E!==(E=((he=(ge=(we=(Ne=P[2].conf)==null?void 0:Ne.mqtt)==null?void 0:we.ha)==null?void 0:ge.hostname)!=null?he:"Hostname for URL")+"")&&D(I,E),L[0]&32&&U!==(U=P[5].g.h+".local")&&r(S,"placeholder",U),L[0]&32&&S.value!==P[5].h.h&&Ee(S,P[5].h.h),L[0]&4&&F!==(F=((Ze=(We=(Ue=(je=P[2].conf)==null?void 0:je.mqtt)==null?void 0:Ue.ha)==null?void 0:We.tag)!=null?Ze:"Name tag")+"")&&D(R,F),L[0]&32&&H.value!==P[5].h.n&&Ee(H,P[5].h.n)},d(P){P&&A(e),W=!1,zt(K)}}}function ba(t){var G,j,H,W,K,Q,J,ae,Z;let e,l,n=((H=(j=(G=t[2].conf)==null?void 0:G.cloud)==null?void 0:j.title)!=null?H:"Cloud connections")+"",i,o,a,c,_,u,f,p,d,v,h,k=((Q=(K=(W=t[2].conf)==null?void 0:W.cloud)==null?void 0:K.ams)!=null?Q:"AMS reader cloud")+"",g,T,O,E,I,N,B=((Z=(ae=(J=t[2].conf)==null?void 0:J.cloud)==null?void 0:ae.es)!=null?Z:"Energy Speedometer")+"",S,U,z,V,F,R=t[5].c.es&&ga(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("input"),f=b(),p=m("div"),d=m("label"),v=m("input"),h=b(),g=M(k),T=b(),O=m("div"),E=m("label"),I=m("input"),N=b(),S=M(B),U=b(),R&&R.c(),r(l,"class","text-sm"),r(a,"href",kl("Cloud")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","c"),u.value="true",r(v,"type","checkbox"),r(v,"name","ce"),v.__value="true",v.value=v.__value,r(v,"class","rounded mb-1"),r(p,"class","my-1"),r(I,"type","checkbox"),r(I,"class","rounded mb-1"),r(I,"name","ces"),I.__value="true",I.value=I.__value,r(O,"class","my-1"),r(e,"class","cnt")},m(X,oe){q(X,e,oe),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(p,d),s(d,v),v.checked=t[5].c.e,s(d,h),s(d,g),s(e,T),s(e,O),s(O,E),s(E,I),I.checked=t[5].c.es,s(E,N),s(E,S),s(O,U),R&&R.m(O,null),z=!0,V||(F=[ve(v,"change",t[79]),ve(I,"change",t[80])],V=!0)},p(X,oe){var ne,ie,re,me,Y,x,ke,pe,C;(!z||oe[0]&4)&&n!==(n=((re=(ie=(ne=X[2].conf)==null?void 0:ne.cloud)==null?void 0:ie.title)!=null?re:"Cloud connections")+"")&&D(i,n),oe[0]&32&&(v.checked=X[5].c.e),(!z||oe[0]&4)&&k!==(k=((x=(Y=(me=X[2].conf)==null?void 0:me.cloud)==null?void 0:Y.ams)!=null?x:"AMS reader cloud")+"")&&D(g,k),oe[0]&32&&(I.checked=X[5].c.es),(!z||oe[0]&4)&&B!==(B=((C=(pe=(ke=X[2].conf)==null?void 0:ke.cloud)==null?void 0:pe.es)!=null?C:"Energy Speedometer")+"")&&D(S,B),X[5].c.es?R?(R.p(X,oe),oe[0]&32&&$(R,1)):(R=ga(X),R.c(),$(R,1),R.m(O,null)):R&&(gt(),fe(R,1,1,()=>{R=null}),kt())},i(X){z||($(R),z=!0)},o(X){fe(R),z=!1},d(X){X&&A(e),R&&R.d(),V=!1,zt(F)}}}function ga(t){let e,l,n=t[0].mac+"",i,o,a,c,_=(t[0].meter.id?t[0].meter.id:"missing, required")+"",u,f,p,d,v=t[0].mac&&t[0].meter.id&&ka(t);return{c(){e=m("div"),l=M("MAC: "),i=M(n),o=b(),a=m("div"),c=M("Meter ID: "),u=M(_),f=b(),v&&v.c(),p=Qt(),r(e,"class","pl-5"),r(a,"class","pl-5")},m(h,k){q(h,e,k),s(e,l),s(e,i),q(h,o,k),q(h,a,k),s(a,c),s(a,u),q(h,f,k),v&&v.m(h,k),q(h,p,k),d=!0},p(h,k){(!d||k[0]&1)&&n!==(n=h[0].mac+"")&&D(i,n),(!d||k[0]&1)&&_!==(_=(h[0].meter.id?h[0].meter.id:"missing, required")+"")&&D(u,_),h[0].mac&&h[0].meter.id?v?(v.p(h,k),k[0]&1&&$(v,1)):(v=ka(h),v.c(),$(v,1),v.m(p.parentNode,p)):v&&(gt(),fe(v,1,1,()=>{v=null}),kt())},i(h){d||($(v),d=!0)},o(h){fe(v),d=!1},d(h){h&&A(e),h&&A(o),h&&A(a),h&&A(f),v&&v.d(h),h&&A(p)}}}function ka(t){let e,l,n;return l=new F0({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){q(i,e,o),De(l,e,null),n=!0},p(i,o){const a={};o[0]&1&&(a.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(a)},i(i){n||($(l.$$.fragment,i),n=!0)},o(i){fe(l.$$.fragment,i),n=!1},d(i){i&&A(e),Le(l)}}}function wa(t){var F,R,G,j,H,W,K,Q;let e,l,n=((G=(R=(F=t[2].conf)==null?void 0:F.thresholds)==null?void 0:R.title)!=null?G:"Thresholds")+"",i,o,a,c,_,u,f,p,d,v,h,k=((W=(H=(j=t[2].conf)==null?void 0:j.thresholds)==null?void 0:H.avg)!=null?W:"Average of")+"",g,T,O,E,I,N=((Q=(K=t[2].common)==null?void 0:K.hours)!=null?Q:"hours")+"",B,S,U,z={length:9},V=[];for(let J=0;Jt[84].call(T)),r(v,"class","w-1/2"),r(p,"class","flex flex-wrap"),r(e,"class","cnt")},m(j,H){q(j,e,H),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p);for(let W=0;W20&&Ea(t),v=((I=(E=(O=t[5])==null?void 0:O.i)==null?void 0:E.d)==null?void 0:I.d)>0&&qa(t),h=t[0].chip=="esp8266"&&Da(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),d&&d.c(),u=b(),v&&v.c(),f=b(),h&&h.c(),r(l,"class","text-sm"),r(a,"href",kl("GPIO-configuration")),r(a,"target","_blank"),r(a,"class","float-right"),r(e,"class","cnt")},m(N,B){q(N,e,B),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),d&&d.m(e,null),s(e,u),v&&v.m(e,null),s(e,f),h&&h.m(e,null),p=!0},p(N,B){var S,U,z,V,F,R;(!p||B[0]&4)&&n!==(n=((z=(U=(S=N[2].conf)==null?void 0:S.hw)==null?void 0:U.title)!=null?z:"Hardware")+"")&&D(i,n),N[0].board>20?d?(d.p(N,B),B[0]&1&&$(d,1)):(d=Ea(N),d.c(),$(d,1),d.m(e,u)):d&&(gt(),fe(d,1,1,()=>{d=null}),kt()),((R=(F=(V=N[5])==null?void 0:V.i)==null?void 0:F.d)==null?void 0:R.d)>0?v?v.p(N,B):(v=qa(N),v.c(),v.m(e,f)):v&&(v.d(1),v=null),N[0].chip=="esp8266"?h?h.p(N,B):(h=Da(N),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i(N){p||($(d),p=!0)},o(N){fe(d),p=!1},d(N){N&&A(e),d&&d.d(),v&&v.d(),h&&h.d()}}}function Ea(t){var Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt,Ve,Ke,Bt,nt,bt,wt,ue,Me,Ae,it,rt,At,Xt,Zt,el,tl,ll,nl,il,sl,ol,al,fl,ul,Ie,jt,rl,cl,hl,bl,gl,Fe,ct;let e,l,n,i,o=((Pt=(St=(Ot=(Et=t[2].conf)==null?void 0:Et.hw)==null?void 0:Ot.han)==null?void 0:St.rx)!=null?Pt:"HAN RX")+"",a,c,_,u,f,p,d,v=((ht=(Ct=(yt=(It=t[2].conf)==null?void 0:It.hw)==null?void 0:yt.han)==null?void 0:Ct.tx)!=null?ht:"HAN TX")+"",h,k,g,T,O,E,I,N,B,S,U=((Ve=(Wt=(Ut=(Lt=t[2].conf)==null?void 0:Lt.hw)==null?void 0:Ut.han)==null?void 0:Wt.pullup)!=null?Ve:"pullup")+"",z,V,F,R,G=((nt=(Bt=(Ke=t[2].conf)==null?void 0:Ke.hw)==null?void 0:Bt.ap_btn)!=null?nt:"AP button")+"",j,H,W,K,Q,J,ae=((Me=(ue=(wt=(bt=t[2].conf)==null?void 0:bt.hw)==null?void 0:wt.led)==null?void 0:ue.title)!=null?Me:"LED")+"",Z,X,oe,ne,ie,re,me,Y,x,ke,pe=((At=(rt=(it=(Ae=t[2].conf)==null?void 0:Ae.hw)==null?void 0:it.led)==null?void 0:rt.inverted)!=null?At:"inverted")+"",C,w,P,L=((tl=(el=(Zt=(Xt=t[2].conf)==null?void 0:Xt.hw)==null?void 0:Zt.led)==null?void 0:el.rgb)!=null?tl:"RGB")+"",y,ee,le,se,_e=((sl=(il=(nl=(ll=t[2].conf)==null?void 0:ll.hw)==null?void 0:nl.led)==null?void 0:il.inverted)!=null?sl:"inverted")+"",Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye=((ul=(fl=(al=(ol=t[2].conf)==null?void 0:ol.hw)==null?void 0:al.led)==null?void 0:fl.disable)!=null?ul:"LED dis. GPIO")+"",et,He,Oe,ce,Pe,$e=((rl=(jt=(Ie=t[2].conf)==null?void 0:Ie.hw)==null?void 0:jt.temp)!=null?rl:"Temperature")+"",Qe,mt,ye,Ge,ze,tt,vt=((bl=(hl=(cl=t[2].conf)==null?void 0:cl.hw)==null?void 0:hl.temp_analog)!=null?bl:"Analog temp")+"",Mt,dt,te,be,Tt,Ce,qe,pt,at;f=new Bi({props:{chip:t[0].chip}}),O=new Bi({props:{chip:t[0].chip}});let ft=t[0].chip!="esp8266"&&Pa(t),ut=((ct=(Fe=(gl=t[5])==null?void 0:gl.i)==null?void 0:Fe.v)==null?void 0:ct.p)>0&&Aa(t);return{c(){e=m("input"),l=b(),n=m("div"),i=m("div"),a=M(o),c=m("br"),_=b(),u=m("select"),Re(f.$$.fragment),p=b(),d=m("div"),h=M(v),k=m("br"),g=b(),T=m("select"),Re(O.$$.fragment),E=b(),I=m("div"),N=m("label"),B=m("input"),S=b(),z=M(U),V=b(),F=m("div"),R=m("div"),j=M(G),H=m("br"),W=b(),K=m("input"),Q=b(),J=m("div"),Z=M(ae),X=m("br"),oe=b(),ne=m("div"),ie=m("input"),re=b(),me=m("div"),Y=m("label"),x=m("input"),ke=b(),C=M(pe),w=b(),P=m("div"),y=M(L),ee=m("label"),le=m("input"),se=b(),Te=M(_e),Se=m("br"),de=b(),Ne=m("div"),we=m("input"),ge=b(),he=m("input"),je=b(),Ue=m("input"),We=b(),Ze=m("div"),Je=m("div"),et=M(Ye),He=b(),Oe=m("input"),ce=b(),Pe=m("div"),Qe=M($e),mt=m("br"),ye=b(),Ge=m("input"),ze=b(),tt=m("div"),Mt=M(vt),dt=m("br"),te=b(),be=m("input"),Tt=b(),ft&&ft.c(),Ce=b(),ut&&ut.c(),r(e,"type","hidden"),r(e,"name","i"),e.value="true",r(u,"name","ihp"),r(u,"class","in-f w-full"),t[5].i.h.p===void 0&&Gt(()=>t[85].call(u)),r(i,"class","w-1/3"),r(T,"name","iht"),r(T,"class","in-l w-full"),t[5].i.h.t===void 0&&Gt(()=>t[86].call(T)),r(d,"class","w-1/3"),r(B,"name","ihu"),B.__value="true",B.value=B.__value,r(B,"type","checkbox"),r(B,"class","rounded mb-1"),r(N,"class","ml-2"),r(I,"class","w-1/3"),r(n,"class","flex flex-wrap"),r(K,"name","ia"),r(K,"type","number"),r(K,"min","0"),r(K,"max",t[9]),r(K,"class","in-f tr w-full"),r(R,"class","w-1/3"),r(ie,"name","ilp"),r(ie,"type","number"),r(ie,"min","0"),r(ie,"max",t[9]),r(ie,"class","in-l tr w-full"),r(ne,"class","flex"),r(J,"class","w-1/3"),r(x,"name","ili"),x.__value="true",x.value=x.__value,r(x,"type","checkbox"),r(x,"class","rounded mb-1"),r(Y,"class","ml-4"),r(me,"class","w-1/3"),r(le,"name","iri"),le.__value="true",le.value=le.__value,r(le,"type","checkbox"),r(le,"class","rounded mb-1"),r(ee,"class","ml-4"),r(we,"name","irr"),r(we,"type","number"),r(we,"min","0"),r(we,"max",t[9]),r(we,"class","in-f tr w-1/3"),r(he,"name","irg"),r(he,"type","number"),r(he,"min","0"),r(he,"max",t[9]),r(he,"class","in-m tr w-1/3"),r(Ue,"name","irb"),r(Ue,"type","number"),r(Ue,"min","0"),r(Ue,"max",t[9]),r(Ue,"class","in-l tr w-1/3"),r(Ne,"class","flex"),r(P,"class","w-full"),r(Oe,"name","idd"),r(Oe,"type","number"),r(Oe,"min","0"),r(Oe,"max",t[9]),r(Oe,"class","in-s tr"),r(Je,"class","my-1 pr-1 w-1/3"),r(Ze,"class","w-full"),r(Ge,"name","itd"),r(Ge,"type","number"),r(Ge,"min","0"),r(Ge,"max",t[9]),r(Ge,"class","in-f tr w-full"),r(Pe,"class","my-1 w-1/3"),r(be,"name","ita"),r(be,"type","number"),r(be,"min","0"),r(be,"max",t[9]),r(be,"class","in-l tr w-full"),r(tt,"class","my-1 pr-1 w-1/3"),r(F,"class","flex flex-wrap")},m(Be,_t){q(Be,e,_t),q(Be,l,_t),q(Be,n,_t),s(n,i),s(i,a),s(i,c),s(i,_),s(i,u),De(f,u,null),ot(u,t[5].i.h.p,!0),s(n,p),s(n,d),s(d,h),s(d,k),s(d,g),s(d,T),De(O,T,null),ot(T,t[5].i.h.t,!0),s(n,E),s(n,I),s(I,N),s(N,B),B.checked=t[5].i.h.u,s(N,S),s(N,z),q(Be,V,_t),q(Be,F,_t),s(F,R),s(R,j),s(R,H),s(R,W),s(R,K),Ee(K,t[5].i.a),s(F,Q),s(F,J),s(J,Z),s(J,X),s(J,oe),s(J,ne),s(ne,ie),Ee(ie,t[5].i.l.p),s(F,re),s(F,me),s(me,Y),s(Y,x),x.checked=t[5].i.l.i,s(Y,ke),s(Y,C),s(F,w),s(F,P),s(P,y),s(P,ee),s(ee,le),le.checked=t[5].i.r.i,s(ee,se),s(ee,Te),s(P,Se),s(P,de),s(P,Ne),s(Ne,we),Ee(we,t[5].i.r.r),s(Ne,ge),s(Ne,he),Ee(he,t[5].i.r.g),s(Ne,je),s(Ne,Ue),Ee(Ue,t[5].i.r.b),s(F,We),s(F,Ze),s(Ze,Je),s(Je,et),s(Je,He),s(Je,Oe),Ee(Oe,t[5].i.d.d),s(F,ce),s(F,Pe),s(Pe,Qe),s(Pe,mt),s(Pe,ye),s(Pe,Ge),Ee(Ge,t[5].i.t.d),s(F,ze),s(F,tt),s(tt,Mt),s(tt,dt),s(tt,te),s(tt,be),Ee(be,t[5].i.t.a),s(F,Tt),ft&&ft.m(F,null),s(F,Ce),ut&&ut.m(F,null),qe=!0,pt||(at=[ve(u,"change",t[85]),ve(T,"change",t[86]),ve(B,"change",t[87]),ve(K,"input",t[88]),ve(ie,"input",t[89]),ve(x,"change",t[90]),ve(le,"change",t[91]),ve(we,"input",t[92]),ve(he,"input",t[93]),ve(Ue,"input",t[94]),ve(Oe,"input",t[95]),ve(Ge,"input",t[96]),ve(be,"input",t[97])],pt=!0)},p(Be,_t){var Nl,Tl,Rl,Fl,Ul,Bl,jl,Hl,yl,zl,Wl,lt,Ht,_l,wl,Gl,mn,pn,dn,vn,hn,bn,gn,kn,wn,Mn,Sn,Cn,Nn,Tn,En,Pn,An,qn,Dn,Ln,On,In,Rn,Fn,Un,Bn,jn,Hn;(!qe||_t[0]&4)&&o!==(o=((Fl=(Rl=(Tl=(Nl=Be[2].conf)==null?void 0:Nl.hw)==null?void 0:Tl.han)==null?void 0:Rl.rx)!=null?Fl:"HAN RX")+"")&&D(a,o);const Sl={};_t[0]&1&&(Sl.chip=Be[0].chip),f.$set(Sl),_t[0]&32&&ot(u,Be[5].i.h.p),(!qe||_t[0]&4)&&v!==(v=((Hl=(jl=(Bl=(Ul=Be[2].conf)==null?void 0:Ul.hw)==null?void 0:Bl.han)==null?void 0:jl.tx)!=null?Hl:"HAN TX")+"")&&D(h,v);const Cl={};_t[0]&1&&(Cl.chip=Be[0].chip),O.$set(Cl),_t[0]&32&&ot(T,Be[5].i.h.t),_t[0]&32&&(B.checked=Be[5].i.h.u),(!qe||_t[0]&4)&&U!==(U=((lt=(Wl=(zl=(yl=Be[2].conf)==null?void 0:yl.hw)==null?void 0:zl.han)==null?void 0:Wl.pullup)!=null?lt:"pullup")+"")&&D(z,U),(!qe||_t[0]&4)&&G!==(G=((wl=(_l=(Ht=Be[2].conf)==null?void 0:Ht.hw)==null?void 0:_l.ap_btn)!=null?wl:"AP button")+"")&&D(j,G),(!qe||_t[0]&512)&&r(K,"max",Be[9]),_t[0]&32&&st(K.value)!==Be[5].i.a&&Ee(K,Be[5].i.a),(!qe||_t[0]&4)&&ae!==(ae=((dn=(pn=(mn=(Gl=Be[2].conf)==null?void 0:Gl.hw)==null?void 0:mn.led)==null?void 0:pn.title)!=null?dn:"LED")+"")&&D(Z,ae),(!qe||_t[0]&512)&&r(ie,"max",Be[9]),_t[0]&32&&st(ie.value)!==Be[5].i.l.p&&Ee(ie,Be[5].i.l.p),_t[0]&32&&(x.checked=Be[5].i.l.i),(!qe||_t[0]&4)&&pe!==(pe=((gn=(bn=(hn=(vn=Be[2].conf)==null?void 0:vn.hw)==null?void 0:hn.led)==null?void 0:bn.inverted)!=null?gn:"inverted")+"")&&D(C,pe),(!qe||_t[0]&4)&&L!==(L=((Sn=(Mn=(wn=(kn=Be[2].conf)==null?void 0:kn.hw)==null?void 0:wn.led)==null?void 0:Mn.rgb)!=null?Sn:"RGB")+"")&&D(y,L),_t[0]&32&&(le.checked=Be[5].i.r.i),(!qe||_t[0]&4)&&_e!==(_e=((En=(Tn=(Nn=(Cn=Be[2].conf)==null?void 0:Cn.hw)==null?void 0:Nn.led)==null?void 0:Tn.inverted)!=null?En:"inverted")+"")&&D(Te,_e),(!qe||_t[0]&512)&&r(we,"max",Be[9]),_t[0]&32&&st(we.value)!==Be[5].i.r.r&&Ee(we,Be[5].i.r.r),(!qe||_t[0]&512)&&r(he,"max",Be[9]),_t[0]&32&&st(he.value)!==Be[5].i.r.g&&Ee(he,Be[5].i.r.g),(!qe||_t[0]&512)&&r(Ue,"max",Be[9]),_t[0]&32&&st(Ue.value)!==Be[5].i.r.b&&Ee(Ue,Be[5].i.r.b),(!qe||_t[0]&4)&&Ye!==(Ye=((Dn=(qn=(An=(Pn=Be[2].conf)==null?void 0:Pn.hw)==null?void 0:An.led)==null?void 0:qn.disable)!=null?Dn:"LED dis. GPIO")+"")&&D(et,Ye),(!qe||_t[0]&512)&&r(Oe,"max",Be[9]),_t[0]&32&&st(Oe.value)!==Be[5].i.d.d&&Ee(Oe,Be[5].i.d.d),(!qe||_t[0]&4)&&$e!==($e=((In=(On=(Ln=Be[2].conf)==null?void 0:Ln.hw)==null?void 0:On.temp)!=null?In:"Temperature")+"")&&D(Qe,$e),(!qe||_t[0]&512)&&r(Ge,"max",Be[9]),_t[0]&32&&st(Ge.value)!==Be[5].i.t.d&&Ee(Ge,Be[5].i.t.d),(!qe||_t[0]&4)&&vt!==(vt=((Un=(Fn=(Rn=Be[2].conf)==null?void 0:Rn.hw)==null?void 0:Fn.temp_analog)!=null?Un:"Analog temp")+"")&&D(Mt,vt),(!qe||_t[0]&512)&&r(be,"max",Be[9]),_t[0]&32&&st(be.value)!==Be[5].i.t.a&&Ee(be,Be[5].i.t.a),Be[0].chip!="esp8266"?ft?ft.p(Be,_t):(ft=Pa(Be),ft.c(),ft.m(F,Ce)):ft&&(ft.d(1),ft=null),((Hn=(jn=(Bn=Be[5])==null?void 0:Bn.i)==null?void 0:jn.v)==null?void 0:Hn.p)>0?ut?ut.p(Be,_t):(ut=Aa(Be),ut.c(),ut.m(F,null)):ut&&(ut.d(1),ut=null)},i(Be){qe||($(f.$$.fragment,Be),$(O.$$.fragment,Be),qe=!0)},o(Be){fe(f.$$.fragment,Be),fe(O.$$.fragment,Be),qe=!1},d(Be){Be&&A(e),Be&&A(l),Be&&A(n),Le(f),Le(O),Be&&A(V),Be&&A(F),ft&&ft.d(),ut&&ut.d(),pt=!1,zt(at)}}}function Pa(t){var u,f,p,d;let e,l=((d=(p=(f=(u=t[2].conf)==null?void 0:u.hw)==null?void 0:f.vcc)==null?void 0:p.title)!=null?d:"Vcc")+"",n,i,o,a,c,_;return{c(){e=m("div"),n=M(l),i=m("br"),o=b(),a=m("input"),r(a,"name","ivp"),r(a,"type","number"),r(a,"min","0"),r(a,"max",t[9]),r(a,"class","in-s tr w-full"),r(e,"class","my-1 pl-1 w-1/3")},m(v,h){q(v,e,h),s(e,n),s(e,i),s(e,o),s(e,a),Ee(a,t[5].i.v.p),c||(_=ve(a,"input",t[98]),c=!0)},p(v,h){var k,g,T,O;h[0]&4&&l!==(l=((O=(T=(g=(k=v[2].conf)==null?void 0:k.hw)==null?void 0:g.vcc)==null?void 0:T.title)!=null?O:"Vcc")+"")&&D(n,l),h[0]&512&&r(a,"max",v[9]),h[0]&32&&st(a.value)!==v[5].i.v.p&&Ee(a,v[5].i.v.p)},d(v){v&&A(e),c=!1,_()}}}function Aa(t){var h,k,g,T;let e,l=((T=(g=(k=(h=t[2].conf)==null?void 0:h.hw)==null?void 0:k.vcc)==null?void 0:g.divider)!=null?T:"Voltage divider")+"",n,i,o,a,c,_,u,f,p,d,v;return{c(){var O,E,I,N,B,S,U,z;e=m("div"),n=M(l),i=m("br"),o=b(),a=m("div"),c=m("input"),u=b(),f=m("input"),r(c,"name","ivdv"),r(c,"type","number"),r(c,"min","0"),r(c,"max","65535"),r(c,"class","in-f tr w-full"),r(c,"placeholder",_=(N=(I=(E=(O=t[2].conf)==null?void 0:O.hw)==null?void 0:E.vcc)==null?void 0:I.div_vcc)!=null?N:"VCC"),r(f,"name","ivdg"),r(f,"type","number"),r(f,"min","0"),r(f,"max","65535"),r(f,"class","in-l tr w-full"),r(f,"placeholder",p=(z=(U=(S=(B=t[2].conf)==null?void 0:B.hw)==null?void 0:S.vcc)==null?void 0:U.div_gnd)!=null?z:"GND"),r(a,"class","flex"),r(e,"class","my-1")},m(O,E){q(O,e,E),s(e,n),s(e,i),s(e,o),s(e,a),s(a,c),Ee(c,t[5].i.v.d.v),s(a,u),s(a,f),Ee(f,t[5].i.v.d.g),d||(v=[ve(c,"input",t[99]),ve(f,"input",t[100])],d=!0)},p(O,E){var I,N,B,S,U,z,V,F,R,G,j,H;E[0]&4&&l!==(l=((S=(B=(N=(I=O[2].conf)==null?void 0:I.hw)==null?void 0:N.vcc)==null?void 0:B.divider)!=null?S:"Voltage divider")+"")&&D(n,l),E[0]&4&&_!==(_=(F=(V=(z=(U=O[2].conf)==null?void 0:U.hw)==null?void 0:z.vcc)==null?void 0:V.div_vcc)!=null?F:"VCC")&&r(c,"placeholder",_),E[0]&32&&st(c.value)!==O[5].i.v.d.v&&Ee(c,O[5].i.v.d.v),E[0]&4&&p!==(p=(H=(j=(G=(R=O[2].conf)==null?void 0:R.hw)==null?void 0:G.vcc)==null?void 0:j.div_gnd)!=null?H:"GND")&&r(f,"placeholder",p),E[0]&32&&st(f.value)!==O[5].i.v.d.g&&Ee(f,O[5].i.v.d.g)},d(O){O&&A(e),d=!1,zt(v)}}}function qa(t){var h,k,g,T,O,E,I,N,B,S,U,z,V,F,R;let e,l=((O=(T=(g=(k=(h=t[2].conf)==null?void 0:h.hw)==null?void 0:k.led)==null?void 0:g.behaviour)==null?void 0:T.title)!=null?O:"LED behaviour")+"",n,i,o,a,c=((S=(B=(N=(I=(E=t[2].conf)==null?void 0:E.hw)==null?void 0:I.led)==null?void 0:N.behaviour)==null?void 0:B.enabled)!=null?S:"Enabled")+"",_,u,f=((R=(F=(V=(z=(U=t[2].conf)==null?void 0:U.hw)==null?void 0:z.led)==null?void 0:V.behaviour)==null?void 0:F.disabled)!=null?R:"Disabled")+"",p,d,v;return{c(){e=m("div"),n=M(l),i=b(),o=m("select"),a=m("option"),_=M(c),u=m("option"),p=M(f),a.__value=0,a.value=a.__value,u.__value=1,u.value=u.__value,r(o,"name","idb"),r(o,"class","in-s"),t[5].i.d.b===void 0&&Gt(()=>t[101].call(o)),r(e,"class","my-1 w-full")},m(G,j){q(G,e,j),s(e,n),s(e,i),s(e,o),s(o,a),s(a,_),s(o,u),s(u,p),ot(o,t[5].i.d.b,!0),d||(v=ve(o,"change",t[101]),d=!0)},p(G,j){var H,W,K,Q,J,ae,Z,X,oe,ne,ie,re,me,Y,x;j[0]&4&&l!==(l=((J=(Q=(K=(W=(H=G[2].conf)==null?void 0:H.hw)==null?void 0:W.led)==null?void 0:K.behaviour)==null?void 0:Q.title)!=null?J:"LED behaviour")+"")&&D(n,l),j[0]&4&&c!==(c=((ne=(oe=(X=(Z=(ae=G[2].conf)==null?void 0:ae.hw)==null?void 0:Z.led)==null?void 0:X.behaviour)==null?void 0:oe.enabled)!=null?ne:"Enabled")+"")&&D(_,c),j[0]&4&&f!==(f=((x=(Y=(me=(re=(ie=G[2].conf)==null?void 0:ie.hw)==null?void 0:re.led)==null?void 0:me.behaviour)==null?void 0:Y.disabled)!=null?x:"Disabled")+"")&&D(p,f),j[0]&32&&ot(o,G[5].i.d.b)},d(G){G&&A(e),d=!1,v()}}}function Da(t){var N,B,S,U,z,V,F,R;let e,l,n,i,o=((U=(S=(B=(N=t[2].conf)==null?void 0:N.hw)==null?void 0:B.vcc)==null?void 0:S.offset)!=null?U:"Vcc offset")+"",a,c,_,u,f,p,d=((R=(F=(V=(z=t[2].conf)==null?void 0:z.hw)==null?void 0:V.vcc)==null?void 0:F.multiplier)!=null?R:"Multiplier")+"",v,h,k,g,T,O,E,I=(t[0].board==2||t[0].board==100)&&La(t);return{c(){e=m("input"),l=b(),n=m("div"),i=m("div"),a=M(o),c=m("br"),_=b(),u=m("input"),f=b(),p=m("div"),v=M(d),h=m("br"),k=b(),g=m("input"),T=b(),I&&I.c(),r(e,"type","hidden"),r(e,"name","iv"),e.value="true",r(u,"name","ivo"),r(u,"type","number"),r(u,"min","0.0"),r(u,"max","3.5"),r(u,"step","0.01"),r(u,"class","in-f tr w-full"),r(i,"class","w-1/3"),r(g,"name","ivm"),r(g,"type","number"),r(g,"min","0.1"),r(g,"max","10"),r(g,"step","0.01"),r(g,"class","in-l tr w-full"),r(p,"class","w-1/3 pr-1"),r(n,"class","my-1 flex flex-wrap")},m(G,j){q(G,e,j),q(G,l,j),q(G,n,j),s(n,i),s(i,a),s(i,c),s(i,_),s(i,u),Ee(u,t[5].i.v.o),s(n,f),s(n,p),s(p,v),s(p,h),s(p,k),s(p,g),Ee(g,t[5].i.v.m),s(n,T),I&&I.m(n,null),O||(E=[ve(u,"input",t[102]),ve(g,"input",t[103])],O=!0)},p(G,j){var H,W,K,Q,J,ae,Z,X;j[0]&4&&o!==(o=((Q=(K=(W=(H=G[2].conf)==null?void 0:H.hw)==null?void 0:W.vcc)==null?void 0:K.offset)!=null?Q:"Vcc offset")+"")&&D(a,o),j[0]&32&&st(u.value)!==G[5].i.v.o&&Ee(u,G[5].i.v.o),j[0]&4&&d!==(d=((X=(Z=(ae=(J=G[2].conf)==null?void 0:J.hw)==null?void 0:ae.vcc)==null?void 0:Z.multiplier)!=null?X:"Multiplier")+"")&&D(v,d),j[0]&32&&st(g.value)!==G[5].i.v.m&&Ee(g,G[5].i.v.m),G[0].board==2||G[0].board==100?I?I.p(G,j):(I=La(G),I.c(),I.m(n,null)):I&&(I.d(1),I=null)},d(G){G&&A(e),G&&A(l),G&&A(n),I&&I.d(),O=!1,zt(E)}}}function La(t){var u,f,p,d;let e,l=((d=(p=(f=(u=t[2].conf)==null?void 0:u.hw)==null?void 0:f.vcc)==null?void 0:p.boot)!=null?d:"Boot limit")+"",n,i,o,a,c,_;return{c(){e=m("div"),n=M(l),i=m("br"),o=b(),a=m("input"),r(a,"name","ivb"),r(a,"type","number"),r(a,"min","2.5"),r(a,"max","3.5"),r(a,"step","0.1"),r(a,"class","in-s tr w-full"),r(e,"class","w-1/3 pl-1")},m(v,h){q(v,e,h),s(e,n),s(e,i),s(e,o),s(e,a),Ee(a,t[5].i.v.b),c||(_=ve(a,"input",t[104]),c=!0)},p(v,h){var k,g,T,O;h[0]&4&&l!==(l=((O=(T=(g=(k=v[2].conf)==null?void 0:k.hw)==null?void 0:g.vcc)==null?void 0:T.boot)!=null?O:"Boot limit")+"")&&D(n,l),h[0]&32&&st(a.value)!==v[5].i.v.b&&Ee(a,v[5].i.v.b)},d(v){v&&A(e),c=!1,_()}}}function Oa(t){var I,N,B,S,U,z,V,F;let e,l,n=((B=(N=(I=t[2].conf)==null?void 0:I.debug)==null?void 0:N.title)!=null?B:"Debugging")+"",i,o,a,c,_,u,f,p,d,v,h=((z=(U=(S=t[2].conf)==null?void 0:S.debug)==null?void 0:U.enable)!=null?z:"Enable debugging")+"",k,g,T,O,E=((F=(V=t[5])==null?void 0:V.d)==null?void 0:F.s)&&Ia(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),a.textContent="\u24D8",c=b(),_=m("input"),u=b(),f=m("div"),p=m("label"),d=m("input"),v=b(),k=M(h),g=b(),E&&E.c(),r(l,"class","text-sm"),r(a,"href","https://amsleser.no/blog/post/24-telnet-debug"),r(a,"target","_blank"),r(a,"class","float-right"),r(_,"type","hidden"),r(_,"name","d"),_.value="true",r(d,"type","checkbox"),r(d,"name","ds"),d.__value="true",d.value=d.__value,r(d,"class","rounded mb-1"),r(f,"class","mt-3"),r(e,"class","cnt")},m(R,G){q(R,e,G),s(e,l),s(l,i),s(e,o),s(e,a),s(e,c),s(e,_),s(e,u),s(e,f),s(f,p),s(p,d),d.checked=t[5].d.s,s(p,v),s(p,k),s(e,g),E&&E.m(e,null),T||(O=ve(d,"change",t[105]),T=!0)},p(R,G){var j,H,W,K,Q,J,ae,Z;G[0]&4&&n!==(n=((W=(H=(j=R[2].conf)==null?void 0:j.debug)==null?void 0:H.title)!=null?W:"Debugging")+"")&&D(i,n),G[0]&32&&(d.checked=R[5].d.s),G[0]&4&&h!==(h=((J=(Q=(K=R[2].conf)==null?void 0:K.debug)==null?void 0:Q.enable)!=null?J:"Enable debugging")+"")&&D(k,h),(Z=(ae=R[5])==null?void 0:ae.d)!=null&&Z.s?E?E.p(R,G):(E=Ia(R),E.c(),E.m(e,null)):E&&(E.d(1),E=null)},d(R){R&&A(e),E&&E.d(),T=!1,O()}}}function Ia(t){var B,S,U,z,V,F;let e,l=((U=(S=(B=t[2].conf)==null?void 0:B.debug)==null?void 0:S.danger)!=null?U:"Disable when done")+"",n,i,o,a,c,_,u=((F=(V=(z=t[2].conf)==null?void 0:z.debug)==null?void 0:V.telnet)!=null?F:"Enable telnet")+"",f,p,d,v,h,k,g,T,O,E,I,N=t[5].d.t&&Ra(t);return{c(){e=m("div"),n=M(l),i=b(),o=m("div"),a=m("label"),c=m("input"),_=b(),f=M(u),p=b(),N&&N.c(),d=b(),v=m("div"),h=m("select"),k=m("option"),k.textContent="Verbose",g=m("option"),g.textContent="Debug",T=m("option"),T.textContent="Info",O=m("option"),O.textContent="Warning",r(e,"class","bd-red"),r(c,"type","checkbox"),r(c,"name","dt"),c.__value="true",c.value=c.__value,r(c,"class","rounded mb-1"),r(o,"class","my-1"),k.__value=1,k.value=k.__value,g.__value=2,g.value=g.__value,T.__value=3,T.value=T.__value,O.__value=4,O.value=O.__value,r(h,"name","dl"),r(h,"class","in-s"),t[5].d.l===void 0&&Gt(()=>t[107].call(h)),r(v,"class","my-1")},m(R,G){q(R,e,G),s(e,n),q(R,i,G),q(R,o,G),s(o,a),s(a,c),c.checked=t[5].d.t,s(a,_),s(a,f),q(R,p,G),N&&N.m(R,G),q(R,d,G),q(R,v,G),s(v,h),s(h,k),s(h,g),s(h,T),s(h,O),ot(h,t[5].d.l,!0),E||(I=[ve(c,"change",t[106]),ve(h,"change",t[107])],E=!0)},p(R,G){var j,H,W,K,Q,J;G[0]&4&&l!==(l=((W=(H=(j=R[2].conf)==null?void 0:j.debug)==null?void 0:H.danger)!=null?W:"Disable when done")+"")&&D(n,l),G[0]&32&&(c.checked=R[5].d.t),G[0]&4&&u!==(u=((J=(Q=(K=R[2].conf)==null?void 0:K.debug)==null?void 0:Q.telnet)!=null?J:"Enable telnet")+"")&&D(f,u),R[5].d.t?N?N.p(R,G):(N=Ra(R),N.c(),N.m(d.parentNode,d)):N&&(N.d(1),N=null),G[0]&32&&ot(h,R[5].d.l)},d(R){R&&A(e),R&&A(i),R&&A(o),R&&A(p),N&&N.d(R),R&&A(d),R&&A(v),E=!1,zt(I)}}}function Ra(t){var i,o,a;let e,l=((a=(o=(i=t[2].conf)==null?void 0:i.debug)==null?void 0:o.telnet_danger)!=null?a:"Disable when done")+"",n;return{c(){e=m("div"),n=M(l),r(e,"class","bd-red")},m(c,_){q(c,e,_),s(e,n)},p(c,_){var u,f,p;_[0]&4&&l!==(l=((p=(f=(u=c[2].conf)==null?void 0:u.debug)==null?void 0:f.telnet_danger)!=null?p:"Disable when done")+"")&&D(n,l)},d(c){c&&A(e)}}}function Fa(t){var d,v,h,k;let e,l,n=((v=(d=t[2].conf)==null?void 0:d.btn_reset)!=null?v:"Factory reset")+"",i,o,a,c,_=((k=(h=t[2].btn)==null?void 0:h.reboot)!=null?k:"Reboot")+"",u,f,p;return{c(){e=m("div"),l=m("button"),i=M(n),o=b(),a=m("div"),c=m("button"),u=M(_),r(l,"type","button"),r(l,"class","btn-red"),r(c,"type","button"),r(c,"class","btn-yellow"),r(a,"class","text-center")},m(g,T){q(g,e,T),s(e,l),s(l,i),q(g,o,T),q(g,a,T),s(a,c),s(c,u),f||(p=[ve(l,"click",t[11]),ve(c,"click",t[13])],f=!0)},p(g,T){var O,E,I,N;T[0]&4&&n!==(n=((E=(O=g[2].conf)==null?void 0:O.btn_reset)!=null?E:"Factory reset")+"")&&D(i,n),T[0]&4&&_!==(_=((N=(I=g[2].btn)==null?void 0:I.reboot)!=null?N:"Reboot")+"")&&D(u,_)},d(g){g&&A(e),g&&A(o),g&&A(a),f=!1,zt(p)}}}function Ua(t){var o,a;let e,l,n=((a=(o=t[2].btn)==null?void 0:o.save)!=null?a:"Save")+"",i;return{c(){e=m("div"),l=m("button"),i=M(n),r(l,"type","submit"),r(l,"class","btn-pri"),r(e,"class","text-right")},m(c,_){q(c,e,_),s(e,l),s(l,i)},p(c,_){var u,f;_[0]&4&&n!==(n=((f=(u=c[2].btn)==null?void 0:u.save)!=null?f:"Save")+"")&&D(i,n)},d(c){c&&A(e)}}}function lc(t){var me,Y,x,ke,pe,C,w,P,L,y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye,et,He,Oe,ce,Pe,$e,Qe,mt,ye,Ge,ze,tt,vt,Mt,dt;let e,l,n,i,o,a,c,_,u,f,p=((x=(Y=(me=t[5])==null?void 0:me.p)==null?void 0:Y.r)==null?void 0:x.startsWith("NO"))||((C=(pe=(ke=t[5])==null?void 0:ke.p)==null?void 0:pe.r)==null?void 0:C.startsWith("10YNO"))||((L=(P=(w=t[5])==null?void 0:w.p)==null?void 0:P.r)==null?void 0:L.startsWith("10Y1001A1001A4")),d,v,h,k,g,T,O,E,I,N,B,S,U,z,V,F,R,G=((y=t[5])==null?void 0:y.g)&&ea(t),j=((ee=t[5])==null?void 0:ee.m)&&ia(t),H=((le=t[5])==null?void 0:le.w)&&fa(t),W=((se=t[5])==null?void 0:se.n)&&ca(t),K=((_e=t[5])==null?void 0:_e.q)&&ma(t),Q=((Se=(Te=t[5])==null?void 0:Te.q)==null?void 0:Se.m)==3&&va(t),J=((Ne=(de=t[5])==null?void 0:de.q)==null?void 0:Ne.m)==4&&ha(t),ae=((ge=(we=t[5])==null?void 0:we.c)==null?void 0:ge.es)!=null&&ba(t),Z=p&&wa(t),X=((he=t[5])==null?void 0:he.u)&&Sa(t),oe=((Ue=(je=t[5])==null?void 0:je.i)==null?void 0:Ue.h)&&(((We=t[0])==null?void 0:We.board)>20||((Ze=t[0])==null?void 0:Ze.chip)=="esp8266"||((et=(Ye=(Je=t[5])==null?void 0:Je.i)==null?void 0:Ye.d)==null?void 0:et.d)>0)&&Ta(t),ne=((He=t[5])==null?void 0:He.d)&&Oa(t),ie=((Oe=t[1])==null?void 0:Oe.a)&&Fa(t),re=t[5]&&Ua(t);return E=new pl({props:{active:t[3],message:($e=(Pe=(ce=t[2].conf)==null?void 0:ce.mask)==null?void 0:Pe.loading)!=null?$e:"Loading"}}),N=new pl({props:{active:t[4],message:(ye=(mt=(Qe=t[2].conf)==null?void 0:Qe.mask)==null?void 0:mt.saving)!=null?ye:"Saving"}}),S=new pl({props:{active:t[7],message:(tt=(ze=(Ge=t[2].conf)==null?void 0:Ge.mask)==null?void 0:ze.reset)!=null?tt:"Factory reset"}}),z=new pl({props:{active:t[8],message:(dt=(Mt=(vt=t[2].conf)==null?void 0:vt.mask)==null?void 0:Mt.reset_done)!=null?dt:"Done"}}),{c(){e=m("form"),l=m("div"),G&&G.c(),n=b(),j&&j.c(),i=b(),H&&H.c(),o=b(),W&&W.c(),a=b(),K&&K.c(),c=b(),Q&&Q.c(),_=b(),J&&J.c(),u=b(),ae&&ae.c(),f=b(),Z&&Z.c(),d=b(),X&&X.c(),v=b(),oe&&oe.c(),h=b(),ne&&ne.c(),k=b(),g=m("div"),ie&&ie.c(),T=b(),re&&re.c(),O=b(),Re(E.$$.fragment),I=b(),Re(N.$$.fragment),B=b(),Re(S.$$.fragment),U=b(),Re(z.$$.fragment),r(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),r(g,"class","grid grid-cols-3 mt-3"),r(e,"autocomplete","off")},m(te,be){q(te,e,be),s(e,l),G&&G.m(l,null),s(l,n),j&&j.m(l,null),s(l,i),H&&H.m(l,null),s(l,o),W&&W.m(l,null),s(l,a),K&&K.m(l,null),s(l,c),Q&&Q.m(l,null),s(l,_),J&&J.m(l,null),s(l,u),ae&&ae.m(l,null),s(l,f),Z&&Z.m(l,null),s(l,d),X&&X.m(l,null),s(l,v),oe&&oe.m(l,null),s(l,h),ne&&ne.m(l,null),s(e,k),s(e,g),ie&&ie.m(g,null),s(g,T),re&&re.m(g,null),q(te,O,be),De(E,te,be),q(te,I,be),De(N,te,be),q(te,B,be),De(S,te,be),q(te,U,be),De(z,te,be),V=!0,F||(R=ve(e,"submit",_n(t[12])),F=!0)},p(te,be){var at,ft,ut,Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt,Ve,Ke,Bt,nt,bt,wt,ue,Me,Ae,it,rt,At,Xt,Zt,el,tl,ll,nl,il,sl,ol,al,fl,ul,Ie,jt,rl,cl;(at=te[5])!=null&&at.g?G?(G.p(te,be),be[0]&32&&$(G,1)):(G=ea(te),G.c(),$(G,1),G.m(l,n)):G&&(gt(),fe(G,1,1,()=>{G=null}),kt()),(ft=te[5])!=null&&ft.m?j?j.p(te,be):(j=ia(te),j.c(),j.m(l,i)):j&&(j.d(1),j=null),(ut=te[5])!=null&&ut.w?H?H.p(te,be):(H=fa(te),H.c(),H.m(l,o)):H&&(H.d(1),H=null),(Et=te[5])!=null&&Et.n?W?(W.p(te,be),be[0]&32&&$(W,1)):(W=ca(te),W.c(),$(W,1),W.m(l,a)):W&&(gt(),fe(W,1,1,()=>{W=null}),kt()),(Ot=te[5])!=null&&Ot.q?K?(K.p(te,be),be[0]&32&&$(K,1)):(K=ma(te),K.c(),$(K,1),K.m(l,c)):K&&(gt(),fe(K,1,1,()=>{K=null}),kt()),((Pt=(St=te[5])==null?void 0:St.q)==null?void 0:Pt.m)==3?Q?Q.p(te,be):(Q=va(te),Q.c(),Q.m(l,_)):Q&&(Q.d(1),Q=null),((yt=(It=te[5])==null?void 0:It.q)==null?void 0:yt.m)==4?J?J.p(te,be):(J=ha(te),J.c(),J.m(l,u)):J&&(J.d(1),J=null),((ht=(Ct=te[5])==null?void 0:Ct.c)==null?void 0:ht.es)!=null?ae?(ae.p(te,be),be[0]&32&&$(ae,1)):(ae=ba(te),ae.c(),$(ae,1),ae.m(l,f)):ae&&(gt(),fe(ae,1,1,()=>{ae=null}),kt()),be[0]&32&&(p=((Wt=(Ut=(Lt=te[5])==null?void 0:Lt.p)==null?void 0:Ut.r)==null?void 0:Wt.startsWith("NO"))||((Bt=(Ke=(Ve=te[5])==null?void 0:Ve.p)==null?void 0:Ke.r)==null?void 0:Bt.startsWith("10YNO"))||((wt=(bt=(nt=te[5])==null?void 0:nt.p)==null?void 0:bt.r)==null?void 0:wt.startsWith("10Y1001A1001A4"))),p?Z?Z.p(te,be):(Z=wa(te),Z.c(),Z.m(l,d)):Z&&(Z.d(1),Z=null),(ue=te[5])!=null&&ue.u?X?X.p(te,be):(X=Sa(te),X.c(),X.m(l,v)):X&&(X.d(1),X=null),((Ae=(Me=te[5])==null?void 0:Me.i)==null?void 0:Ae.h)&&(((it=te[0])==null?void 0:it.board)>20||((rt=te[0])==null?void 0:rt.chip)=="esp8266"||((Zt=(Xt=(At=te[5])==null?void 0:At.i)==null?void 0:Xt.d)==null?void 0:Zt.d)>0)?oe?(oe.p(te,be),be[0]&33&&$(oe,1)):(oe=Ta(te),oe.c(),$(oe,1),oe.m(l,h)):oe&&(gt(),fe(oe,1,1,()=>{oe=null}),kt()),(el=te[5])!=null&&el.d?ne?ne.p(te,be):(ne=Oa(te),ne.c(),ne.m(l,null)):ne&&(ne.d(1),ne=null),(tl=te[1])!=null&&tl.a?ie?ie.p(te,be):(ie=Fa(te),ie.c(),ie.m(g,T)):ie&&(ie.d(1),ie=null),te[5]?re?re.p(te,be):(re=Ua(te),re.c(),re.m(g,null)):re&&(re.d(1),re=null);const Tt={};be[0]&8&&(Tt.active=te[3]),be[0]&4&&(Tt.message=(il=(nl=(ll=te[2].conf)==null?void 0:ll.mask)==null?void 0:nl.loading)!=null?il:"Loading"),E.$set(Tt);const Ce={};be[0]&16&&(Ce.active=te[4]),be[0]&4&&(Ce.message=(al=(ol=(sl=te[2].conf)==null?void 0:sl.mask)==null?void 0:ol.saving)!=null?al:"Saving"),N.$set(Ce);const qe={};be[0]&128&&(qe.active=te[7]),be[0]&4&&(qe.message=(Ie=(ul=(fl=te[2].conf)==null?void 0:fl.mask)==null?void 0:ul.reset)!=null?Ie:"Factory reset"),S.$set(qe);const pt={};be[0]&256&&(pt.active=te[8]),be[0]&4&&(pt.message=(cl=(rl=(jt=te[2].conf)==null?void 0:jt.mask)==null?void 0:rl.reset_done)!=null?cl:"Done"),z.$set(pt)},i(te){V||($(G),$(W),$(K),$(ae),$(oe),$(E.$$.fragment,te),$(N.$$.fragment,te),$(S.$$.fragment,te),$(z.$$.fragment,te),V=!0)},o(te){fe(G),fe(W),fe(K),fe(ae),fe(oe),fe(E.$$.fragment,te),fe(N.$$.fragment,te),fe(S.$$.fragment,te),fe(z.$$.fragment,te),V=!1},d(te){te&&A(e),G&&G.d(),j&&j.d(),H&&H.d(),W&&W.d(),K&&K.d(),Q&&Q.d(),J&&J.d(),ae&&ae.d(),Z&&Z.d(),X&&X.d(),oe&&oe.d(),ne&&ne.d(),ie&&ie.d(),re&&re.d(),te&&A(O),Le(E,te),te&&A(I),Le(N,te),te&&A(B),Le(S,te),te&&A(U),Le(z,te),F=!1,R()}}}async function nc(){await(await fetch("reboot",{method:"POST"})).json()}function ic(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,{data:o}=e,a={};vl.subscribe(ue=>{l(2,a=ue)});let c=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{name:"Per phase",key:"h"},{name:"Power factor",key:"f"},{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"}],_=!0,u=!1,f,p=[];Wn.subscribe(ue=>{var Me,Ae,it;ue.version&&(l(5,f=ue),l(3,_=!1),l(6,p=[{code:"en",name:"English"}]),((Me=f==null?void 0:f.u)==null?void 0:Me.lang)&&f.u.lang!="en"&&p.push({code:f.u.lang,name:(it=(Ae=a.language)==null?void 0:Ae.name)!=null?it:"Unknown"}),p.push({code:"hub",name:"Load from server"}))}),k0();let d=!1,v=!1;async function h(){if(confirm("Factory reset?")){l(7,d=!0);const ue=new URLSearchParams;ue.append("perform","true");let Ae=await(await fetch("reset",{method:"POST",body:ue})).json();l(7,d=!1),l(8,v=Ae.success)}}async function k(ue){l(4,u=!0);const Me=new FormData(ue.target),Ae=new URLSearchParams;for(let At of Me){const[Xt,Zt]=At;Ae.append(Xt,Zt)}let rt=await(await fetch("save",{method:"POST",body:Ae})).json();dl.update(At=>(At.hostname=Me.get("gh"),At.usrcfg=rt.success,At.booting=rt.reboot,Me.get("nm")=="static"&&(At.net.ip=Me.get("ni"),At.net.mask=Me.get("nu"),At.net.gw=Me.get("ng"),At.net.dns1=Me.get("nd")),At.ui=f.u,At)),l(4,u=!1),en(n)}const g=function(){confirm("Reboot?")&&(dl.update(ue=>(ue.booting=!0,ue)),nc())};async function T(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("mqtt-ca",{method:"POST"})).text(),Wn.update(Me=>(Me.q.s.c=!1,Me)))}async function O(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("mqtt-cert",{method:"POST"})).text(),Wn.update(Me=>(Me.q.s.r=!1,Me)))}async function E(){confirm("Are you sure you want to delete key?")&&(await(await fetch("mqtt-key",{method:"POST"})).text(),Wn.update(Me=>(Me.q.s.k=!1,Me)))}const I=function(){f.q.s.e?f.q.p==1883&&l(5,f.q.p=8883,f):f.q.p==8883&&l(5,f.q.p=1883,f)};async function N(){if(f.u.lang=="hub"){const ue=await Al("http://hub.amsleser.no/hub/language/list.json");l(6,p=await ue.json()),l(5,f.u.lang=a.language.code,f)}}let B=44;function S(){f.g.h=this.value,l(5,f)}function U(){f.g.t=Kt(this),l(5,f)}function z(){f.p.r=Kt(this),l(5,f)}function V(){f.p.c=Kt(this),l(5,f)}function F(){f.p.e=this.checked,l(5,f)}function R(){f.p.t=this.value,l(5,f)}function G(){f.g.s=Kt(this),l(5,f)}function j(){f.g.u=this.value,l(5,f)}function H(){f.g.p=this.value,l(5,f)}function W(){f.g.c=this.value,l(5,f)}function K(){f.m.a=Kt(this),l(5,f)}function Q(){f.m.b=st(this.value),l(5,f)}function J(){f.m.i=this.checked,l(5,f)}function ae(){f.m.b=Kt(this),l(5,f)}function Z(){f.m.p=Kt(this),l(5,f)}function X(){f.m.s=st(this.value),l(5,f)}function oe(){f.m.d=Kt(this),l(5,f)}function ne(){f.m.f=st(this.value),l(5,f)}function ie(){f.m.r=st(this.value),l(5,f)}function re(){f.m.e.e=this.checked,l(5,f)}function me(){f.m.e.k=this.value,l(5,f)}function Y(){f.m.e.a=this.value,l(5,f)}function x(){f.m.m.e=this.checked,l(5,f)}function ke(){f.m.m.w=st(this.value),l(5,f)}function pe(){f.m.m.v=st(this.value),l(5,f)}function C(){f.m.m.a=st(this.value),l(5,f)}function w(){f.m.m.c=st(this.value),l(5,f)}function P(){f.n.c=Kt(this),l(5,f)}function L(){f.w.s=this.value,l(5,f)}function y(){f.w.p=this.value,l(5,f)}function ee(){f.w.z=Kt(this),l(5,f)}function le(){f.w.w=st(this.value),l(5,f)}function se(){f.w.b=this.checked,l(5,f)}function _e(){f.n.m=Kt(this),l(5,f)}function Te(){f.n.i=this.value,l(5,f)}function Se(){f.n.s=Kt(this),l(5,f)}function de(){f.n.g=this.value,l(5,f)}function Ne(){f.n.d1=this.value,l(5,f)}function we(){f.n.d2=this.value,l(5,f)}function ge(){f.n.x=this.checked,l(5,f)}function he(){f.n.d=this.checked,l(5,f)}function je(){f.n.h=this.checked,l(5,f)}function Ue(){f.n.n1=this.value,l(5,f)}function We(){f.q.s.e=this.checked,l(5,f)}function Ze(){f.q.h=this.value,l(5,f)}function Je(){f.q.p=st(this.value),l(5,f)}function Ye(){f.q.u=this.value,l(5,f)}function et(){f.q.a=this.value,l(5,f)}function He(){f.q.c=this.value,l(5,f)}function Oe(){f.q.m=Kt(this),l(5,f)}function ce(){f.q.b=this.value,l(5,f)}function Pe(){f.o.e=this.value,l(5,f)}function $e(){f.o.c=this.value,l(5,f)}function Qe(){f.o.u1=this.value,l(5,f)}function mt(){f.o.u2=this.value,l(5,f)}function ye(){f.o.u3=this.value,l(5,f)}function Ge(){f.h.t=this.value,l(5,f)}function ze(){f.h.h=this.value,l(5,f)}function tt(){f.h.n=this.value,l(5,f)}function vt(){f.c.e=this.checked,l(5,f)}function Mt(){f.c.es=this.checked,l(5,f)}function dt(ue){f.t.t[ue]=st(this.value),l(5,f)}function te(){f.t.h=st(this.value),l(5,f)}function be(ue){f.u[ue.key]=Kt(this),l(5,f)}function Tt(){f.u.lang=Kt(this),l(5,f)}function Ce(){f.i.h.p=Kt(this),l(5,f)}function qe(){f.i.h.t=Kt(this),l(5,f)}function pt(){f.i.h.u=this.checked,l(5,f)}function at(){f.i.a=st(this.value),l(5,f)}function ft(){f.i.l.p=st(this.value),l(5,f)}function ut(){f.i.l.i=this.checked,l(5,f)}function Et(){f.i.r.i=this.checked,l(5,f)}function Ot(){f.i.r.r=st(this.value),l(5,f)}function St(){f.i.r.g=st(this.value),l(5,f)}function Pt(){f.i.r.b=st(this.value),l(5,f)}function It(){f.i.d.d=st(this.value),l(5,f)}function yt(){f.i.t.d=st(this.value),l(5,f)}function Ct(){f.i.t.a=st(this.value),l(5,f)}function ht(){f.i.v.p=st(this.value),l(5,f)}function Lt(){f.i.v.d.v=st(this.value),l(5,f)}function Ut(){f.i.v.d.g=st(this.value),l(5,f)}function Wt(){f.i.d.b=Kt(this),l(5,f)}function Ve(){f.i.v.o=st(this.value),l(5,f)}function Ke(){f.i.v.m=st(this.value),l(5,f)}function Bt(){f.i.v.b=st(this.value),l(5,f)}function nt(){f.d.s=this.checked,l(5,f)}function bt(){f.d.t=this.checked,l(5,f)}function wt(){f.d.l=Kt(this),l(5,f)}return t.$$set=ue=>{"basepath"in ue&&l(19,n=ue.basepath),"sysinfo"in ue&&l(0,i=ue.sysinfo),"data"in ue&&l(1,o=ue.data)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(9,B=i.chip=="esp8266"?16:i.chip=="esp32s2"?44:39)},[i,o,a,_,u,f,p,d,v,B,c,h,k,g,T,O,E,I,N,n,S,U,z,V,F,R,G,j,H,W,K,Q,J,ae,Z,X,oe,ne,ie,re,me,Y,x,ke,pe,C,w,P,L,y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye,et,He,Oe,ce,Pe,$e,Qe,mt,ye,Ge,ze,tt,vt,Mt,dt,te,be,Tt,Ce,qe,pt,at,ft,ut,Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt,Ve,Ke,Bt,nt,bt,wt]}class sc extends Dt{constructor(e){super(),qt(this,e,ic,lc,Nt,{basepath:19,sysinfo:0,data:1},null,[-1,-1,-1,-1])}}function Ba(t,e,l){const n=t.slice();return n[22]=e[l],n}function ja(t){let e,l=t[1].cpu+"",n,i;return{c(){e=M("("),n=M(l),i=M("MHz)")},m(o,a){q(o,e,a),q(o,n,a),q(o,i,a)},p(o,a){a&2&&l!==(l=o[1].cpu+"")&&D(n,l)},d(o){o&&A(e),o&&A(n),o&&A(i)}}}function oc(t){let e=xe(t[1].chip,t[1].board)+"",l;return{c(){l=M(e)},m(n,i){q(n,l,i)},p(n,i){i&2&&e!==(e=xe(n[1].chip,n[1].board)+"")&&D(l,e)},d(n){n&&A(l)}}}function Ha(t){var W,K,Q,J,ae,Z,X,oe,ne,ie,re,me;let e,l=((Q=(K=(W=t[3].status)==null?void 0:W.device)==null?void 0:K.apmac)!=null?Q:"AP MAC")+"",n,i,o=t[1].apmac+"",a,c,_,u=((Z=(ae=(J=t[3].status)==null?void 0:J.device)==null?void 0:ae.last_boot)!=null?Z:"Last boot")+"",f,p,d,v,h,k,g=((ne=(oe=(X=t[3].status)==null?void 0:X.device)==null?void 0:oe.reason)!=null?ne:"Reason")+"",T,O,E=((me=(re=(ie=t[3][As(t[1].chip)])==null?void 0:ie.reason)==null?void 0:re[t[1].boot_reason])!=null?me:t[1].boot_reason)+"",I,N,B=t[1].boot_reason+"",S,U,z=t[1].ex_cause+"",V,F,R;const G=[fc,ac],j=[];function H(Y,x){return Y[0].u>0?0:1}return d=H(t),v=j[d]=G[d](t),{c(){e=m("div"),n=M(l),i=M(": "),a=M(o),c=b(),_=m("div"),f=M(u),p=M(`: - `),v.c(),h=b(),k=m("div"),T=M(g),O=M(": "),I=M(E),N=M(" ("),S=M(B),U=M("/"),V=M(z),F=M(")"),r(e,"class","my-2"),r(_,"class","my-2"),r(k,"class","my-2")},m(Y,x){q(Y,e,x),s(e,n),s(e,i),s(e,a),q(Y,c,x),q(Y,_,x),s(_,f),s(_,p),j[d].m(_,null),q(Y,h,x),q(Y,k,x),s(k,T),s(k,O),s(k,I),s(k,N),s(k,S),s(k,U),s(k,V),s(k,F),R=!0},p(Y,x){var pe,C,w,P,L,y,ee,le,se,_e,Te,Se;(!R||x&8)&&l!==(l=((w=(C=(pe=Y[3].status)==null?void 0:pe.device)==null?void 0:C.apmac)!=null?w:"AP MAC")+"")&&D(n,l),(!R||x&2)&&o!==(o=Y[1].apmac+"")&&D(a,o),(!R||x&8)&&u!==(u=((y=(L=(P=Y[3].status)==null?void 0:P.device)==null?void 0:L.last_boot)!=null?y:"Last boot")+"")&&D(f,u);let ke=d;d=H(Y),d===ke?j[d].p(Y,x):(gt(),fe(j[ke],1,1,()=>{j[ke]=null}),kt(),v=j[d],v?v.p(Y,x):(v=j[d]=G[d](Y),v.c()),$(v,1),v.m(_,null)),(!R||x&8)&&g!==(g=((se=(le=(ee=Y[3].status)==null?void 0:ee.device)==null?void 0:le.reason)!=null?se:"Reason")+"")&&D(T,g),(!R||x&10)&&E!==(E=((Se=(Te=(_e=Y[3][As(Y[1].chip)])==null?void 0:_e.reason)==null?void 0:Te[Y[1].boot_reason])!=null?Se:Y[1].boot_reason)+"")&&D(I,E),(!R||x&2)&&B!==(B=Y[1].boot_reason+"")&&D(S,B),(!R||x&2)&&z!==(z=Y[1].ex_cause+"")&&D(V,z)},i(Y){R||($(v),R=!0)},o(Y){fe(v),R=!1},d(Y){Y&&A(e),Y&&A(c),Y&&A(_),j[d].d(),Y&&A(h),Y&&A(k)}}}function ac(t){let e;return{c(){e=M("-")},m(l,n){q(l,e,n)},p:Xe,i:Xe,o:Xe,d(l){l&&A(e)}}}function fc(t){let e,l;return e=new Su({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:""}}),{c(){Re(e.$$.fragment)},m(n,i){De(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||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function ya(t){var f,p;let e,l,n,i,o=((p=(f=t[3].btn)==null?void 0:f.reboot)!=null?p:"Reboot")+"",a,c,_,u;return l=new Ml({props:{to:"/consent",$$slots:{default:[uc]},$$scope:{ctx:t}}}),{c(){e=m("div"),Re(l.$$.fragment),n=b(),i=m("button"),a=M(o),r(i,"class","btn-yellow-sm float-right"),r(e,"class","my-2")},m(d,v){q(d,e,v),De(l,e,null),s(e,n),s(e,i),s(i,a),c=!0,_||(u=ve(i,"click",t[12]),_=!0)},p(d,v){var k,g;const h={};v&33554440&&(h.$$scope={dirty:v,ctx:d}),l.$set(h),(!c||v&8)&&o!==(o=((g=(k=d[3].btn)==null?void 0:k.reboot)!=null?g:"Reboot")+"")&&D(a,o)},i(d){c||($(l.$$.fragment,d),c=!0)},o(d){fe(l.$$.fragment,d),c=!1},d(d){d&&A(e),Le(l),_=!1,u()}}}function uc(t){var i,o,a;let e,l=((a=(o=(i=t[3].status)==null?void 0:i.device)==null?void 0:o.btn_consents)!=null?a:"Consents")+"",n;return{c(){e=m("span"),n=M(l),r(e,"class","btn-pri-sm")},m(c,_){q(c,e,_),s(e,n)},p(c,_){var u,f,p;_&8&&l!==(l=((p=(f=(u=c[3].status)==null?void 0:u.device)==null?void 0:f.btn_consents)!=null?p:"Consents")+"")&&D(n,l)},d(c){c&&A(e)}}}function za(t){var V,F,R,G,j,H,W,K,Q,J,ae,Z;let e,l,n=((R=(F=(V=t[3].status)==null?void 0:V.meter)==null?void 0:F.title)!=null?R:"Meter")+"",i,o,a,c=((H=(j=(G=t[3].status)==null?void 0:G.meter)==null?void 0:j.manufacturer)!=null?H:"Manufacturer")+"",_,u,f=_i(t[1].meter.mfg)+"",p,d,v,h=((Q=(K=(W=t[3].status)==null?void 0:W.meter)==null?void 0:K.model)!=null?Q:"Model")+"",k,g,T=(t[1].meter.model?t[1].meter.model:"unknown")+"",O,E,I,N=((Z=(ae=(J=t[3].status)==null?void 0:J.meter)==null?void 0:ae.id)!=null?Z:"ID")+"",B,S,U=(t[1].meter.id?t[1].meter.id:"unknown")+"",z;return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("div"),_=M(c),u=M(": "),p=M(f),d=b(),v=m("div"),k=M(h),g=M(": "),O=M(T),E=b(),I=m("div"),B=M(N),S=M(": "),z=M(U),r(l,"class","text-sm"),r(a,"class","my-2"),r(v,"class","my-2"),r(I,"class","my-2"),r(e,"class","cnt")},m(X,oe){q(X,e,oe),s(e,l),s(l,i),s(e,o),s(e,a),s(a,_),s(a,u),s(a,p),s(e,d),s(e,v),s(v,k),s(v,g),s(v,O),s(e,E),s(e,I),s(I,B),s(I,S),s(I,z)},p(X,oe){var ne,ie,re,me,Y,x,ke,pe,C,w,P,L;oe&8&&n!==(n=((re=(ie=(ne=X[3].status)==null?void 0:ne.meter)==null?void 0:ie.title)!=null?re:"Meter")+"")&&D(i,n),oe&8&&c!==(c=((x=(Y=(me=X[3].status)==null?void 0:me.meter)==null?void 0:Y.manufacturer)!=null?x:"Manufacturer")+"")&&D(_,c),oe&2&&f!==(f=_i(X[1].meter.mfg)+"")&&D(p,f),oe&8&&h!==(h=((C=(pe=(ke=X[3].status)==null?void 0:ke.meter)==null?void 0:pe.model)!=null?C:"Model")+"")&&D(k,h),oe&2&&T!==(T=(X[1].meter.model?X[1].meter.model:"unknown")+"")&&D(O,T),oe&8&&N!==(N=((L=(P=(w=X[3].status)==null?void 0:w.meter)==null?void 0:P.id)!=null?L:"ID")+"")&&D(B,N),oe&2&&U!==(U=(X[1].meter.id?X[1].meter.id:"unknown")+"")&&D(z,U)},d(X){X&&A(e)}}}function Wa(t){var K,Q,J,ae,Z,X,oe,ne,ie,re,me,Y;let e,l,n=((J=(Q=(K=t[3].status)==null?void 0:K.network)==null?void 0:Q.title)!=null?J:"Network")+"",i,o,a,c=((X=(Z=(ae=t[3].conf)==null?void 0:ae.network)==null?void 0:Z.ip)!=null?X:"IP")+"",_,u,f=t[1].net.ip+"",p,d,v,h=((ie=(ne=(oe=t[3].conf)==null?void 0:oe.network)==null?void 0:ne.mask)!=null?ie:"Mask")+"",k,g,T=t[1].net.mask+"",O,E,I,N=((Y=(me=(re=t[3].conf)==null?void 0:re.network)==null?void 0:me.gw)!=null?Y:"Gateway")+"",B,S,U=t[1].net.gw+"",z,V,F,R,G,j=t[1].net.dns1&&Ga(t),H=t[1].net.dns2&&Va(t),W=t[1].net.ipv6&&Ka(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("div"),_=M(c),u=M(": "),p=M(f),d=b(),v=m("div"),k=M(h),g=M(": "),O=M(T),E=b(),I=m("div"),B=M(N),S=M(": "),z=M(U),V=b(),F=m("div"),j&&j.c(),R=b(),H&&H.c(),G=b(),W&&W.c(),r(l,"class","text-sm"),r(a,"class","my-2"),r(v,"class","my-2"),r(I,"class","my-2"),r(F,"class","my-2"),r(e,"class","cnt")},m(x,ke){q(x,e,ke),s(e,l),s(l,i),s(e,o),s(e,a),s(a,_),s(a,u),s(a,p),s(e,d),s(e,v),s(v,k),s(v,g),s(v,O),s(e,E),s(e,I),s(I,B),s(I,S),s(I,z),s(e,V),s(e,F),j&&j.m(F,null),s(F,R),H&&H.m(F,null),s(e,G),W&&W.m(e,null)},p(x,ke){var pe,C,w,P,L,y,ee,le,se,_e,Te,Se;ke&8&&n!==(n=((w=(C=(pe=x[3].status)==null?void 0:pe.network)==null?void 0:C.title)!=null?w:"Network")+"")&&D(i,n),ke&8&&c!==(c=((y=(L=(P=x[3].conf)==null?void 0:P.network)==null?void 0:L.ip)!=null?y:"IP")+"")&&D(_,c),ke&2&&f!==(f=x[1].net.ip+"")&&D(p,f),ke&8&&h!==(h=((se=(le=(ee=x[3].conf)==null?void 0:ee.network)==null?void 0:le.mask)!=null?se:"Mask")+"")&&D(k,h),ke&2&&T!==(T=x[1].net.mask+"")&&D(O,T),ke&8&&N!==(N=((Se=(Te=(_e=x[3].conf)==null?void 0:_e.network)==null?void 0:Te.gw)!=null?Se:"Gateway")+"")&&D(B,N),ke&2&&U!==(U=x[1].net.gw+"")&&D(z,U),x[1].net.dns1?j?j.p(x,ke):(j=Ga(x),j.c(),j.m(F,R)):j&&(j.d(1),j=null),x[1].net.dns2?H?H.p(x,ke):(H=Va(x),H.c(),H.m(F,null)):H&&(H.d(1),H=null),x[1].net.ipv6?W?W.p(x,ke):(W=Ka(x),W.c(),W.m(e,null)):W&&(W.d(1),W=null)},d(x){x&&A(e),j&&j.d(),H&&H.d(),W&&W.d()}}}function Ga(t){var a,c,_;let e=((_=(c=(a=t[3].conf)==null?void 0:a.network)==null?void 0:c.dns)!=null?_:"DNS")+"",l,n,i=t[1].net.dns1+"",o;return{c(){l=M(e),n=M(": "),o=M(i)},m(u,f){q(u,l,f),q(u,n,f),q(u,o,f)},p(u,f){var p,d,v;f&8&&e!==(e=((v=(d=(p=u[3].conf)==null?void 0:p.network)==null?void 0:d.dns)!=null?v:"DNS")+"")&&D(l,e),f&2&&i!==(i=u[1].net.dns1+"")&&D(o,i)},d(u){u&&A(l),u&&A(n),u&&A(o)}}}function Va(t){var a,c,_;let e=((_=(c=(a=t[3].conf)==null?void 0:a.network)==null?void 0:c.dns)!=null?_:"DNS")+"",l,n,i=t[1].net.dns2+"",o;return{c(){l=M(e),n=M(": "),o=M(i)},m(u,f){q(u,l,f),q(u,n,f),q(u,o,f)},p(u,f){var p,d,v;f&8&&e!==(e=((v=(d=(p=u[3].conf)==null?void 0:p.network)==null?void 0:d.dns)!=null?v:"DNS")+"")&&D(l,e),f&2&&i!==(i=u[1].net.dns2+"")&&D(o,i)},d(u){u&&A(l),u&&A(n),u&&A(o)}}}function Ka(t){let e,l,n=t[1].net.ipv6+"",i,o,a,c,_=t[1].net.dns1v6&&Ya(t),u=t[1].net.dns2v6&&Qa(t);return{c(){e=m("div"),l=M("IPv6: "),i=M(n),o=b(),a=m("div"),_&&_.c(),c=b(),u&&u.c(),r(e,"class","my-2"),r(a,"class","my-2")},m(f,p){q(f,e,p),s(e,l),s(e,i),q(f,o,p),q(f,a,p),_&&_.m(a,null),s(a,c),u&&u.m(a,null)},p(f,p){p&2&&n!==(n=f[1].net.ipv6+"")&&D(i,n),f[1].net.dns1v6?_?_.p(f,p):(_=Ya(f),_.c(),_.m(a,c)):_&&(_.d(1),_=null),f[1].net.dns2v6?u?u.p(f,p):(u=Qa(f),u.c(),u.m(a,null)):u&&(u.d(1),u=null)},d(f){f&&A(e),f&&A(o),f&&A(a),_&&_.d(),u&&u.d()}}}function Ya(t){let e,l=t[1].net.dns1v6+"",n;return{c(){e=M("DNSv6: "),n=M(l)},m(i,o){q(i,e,o),q(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns1v6+"")&&D(n,l)},d(i){i&&A(e),i&&A(n)}}}function Qa(t){let e,l=t[1].net.dns2v6+"",n;return{c(){e=M("DNSv6: "),n=M(l)},m(i,o){q(i,e,o),q(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns2v6+"")&&D(n,l)},d(i){i&&A(e),i&&A(n)}}}function Xa(t){var _,u,f,p,d,v;let e,l,n=((f=(u=(_=t[3].status)==null?void 0:_.firmware)==null?void 0:u.failed)!=null?f:"Upgrade from {0} to {1} failed").replace("{0}",t[1].upgrade.f).replace("{1}",t[1].upgrade.t)+"",i,o,a=((v=(d=(p=t[3].errors)==null?void 0:p.http)==null?void 0:d[t[1].upgrade.e])!=null?v:t[1].upgrade.e)+"",c;return{c(){e=m("div"),l=m("div"),i=M(n),o=b(),c=M(a),r(l,"class","bd-yellow"),r(e,"class","my-2")},m(h,k){q(h,e,k),s(e,l),s(l,i),s(l,o),s(l,c)},p(h,k){var g,T,O,E,I,N;k&10&&n!==(n=((O=(T=(g=h[3].status)==null?void 0:g.firmware)==null?void 0:T.failed)!=null?O:"Upgrade from {0} to {1} failed").replace("{0}",h[1].upgrade.f).replace("{1}",h[1].upgrade.t)+"")&&D(i,n),k&10&&a!==(a=((N=(I=(E=h[3].errors)==null?void 0:E.http)==null?void 0:I[h[1].upgrade.e])!=null?N:h[1].upgrade.e)+"")&&D(c,a)},d(h){h&&A(e)}}}function Za(t){var h,k,g;let e,l=((g=(k=(h=t[3].status)==null?void 0:h.firmware)==null?void 0:k.latest)!=null?g:"Latest")+"",n,i,o,a=t[4].tag_name+"",c,_,u,f,p,d=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[4]&&t[4].tag_name!=t[1].version&&Ja(t),v=t[1].fwconsent===2&&$a(t);return{c(){e=m("div"),n=M(l),i=M(`: - `),o=m("a"),c=M(a),u=b(),d&&d.c(),f=b(),v&&v.c(),p=Qt(),r(o,"href",_=t[4].html_url),r(o,"class","ml-2 text-blue-600 hover:text-blue-800"),r(o,"target","_blank"),r(o,"rel","noreferrer"),r(e,"class","my-2 flex")},m(T,O){q(T,e,O),s(e,n),s(e,i),s(e,o),s(o,c),s(e,u),d&&d.m(e,null),q(T,f,O),v&&v.m(T,O),q(T,p,O)},p(T,O){var E,I,N;O&8&&l!==(l=((N=(I=(E=T[3].status)==null?void 0:E.firmware)==null?void 0:I.latest)!=null?N:"Latest")+"")&&D(n,l),O&16&&a!==(a=T[4].tag_name+"")&&D(c,a),O&16&&_!==(_=T[4].html_url)&&r(o,"href",_),(T[1].security==0||T[0].a)&&T[1].fwconsent===1&&T[4]&&T[4].tag_name!=T[1].version?d?d.p(T,O):(d=Ja(T),d.c(),d.m(e,null)):d&&(d.d(1),d=null),T[1].fwconsent===2?v?v.p(T,O):(v=$a(T),v.c(),v.m(p.parentNode,p)):v&&(v.d(1),v=null)},d(T){T&&A(e),d&&d.d(),T&&A(f),v&&v.d(T),T&&A(p)}}}function Ja(t){let e,l,n,i,o;return{c(){var a,c,_;e=m("div"),l=m("button"),l.textContent="\u21D3",r(e,"class","flex-none ml-2 text-green-500"),r(e,"title",n=(_=(c=(a=t[3].status)==null?void 0:a.firmware)==null?void 0:c.install)!=null?_:"Install")},m(a,c){q(a,e,c),s(e,l),i||(o=ve(l,"click",t[11]),i=!0)},p(a,c){var _,u,f;c&8&&n!==(n=(f=(u=(_=a[3].status)==null?void 0:_.firmware)==null?void 0:u.install)!=null?f:"Install")&&r(e,"title",n)},d(a){a&&A(e),i=!1,o()}}}function $a(t){var o,a,c;let e,l,n=((c=(a=(o=t[3].status)==null?void 0:o.firmware)==null?void 0:a.no_one_click)!=null?c:"One-click upgrade disabled")+"",i;return{c(){e=m("div"),l=m("div"),i=M(n),r(l,"class","bd-yellow"),r(e,"class","my-2")},m(_,u){q(_,e,u),s(e,l),s(l,i)},p(_,u){var f,p,d;u&8&&n!==(n=((d=(p=(f=_[3].status)==null?void 0:f.firmware)==null?void 0:p.no_one_click)!=null?d:"One-click upgrade disabled")+"")&&D(i,n)},d(_){_&&A(e)}}}function xa(t){let e,l=mi(xe(t[1].chip,t[1].board))+"",n;return{c(){e=m("div"),n=M(l),r(e,"class","bd-red")},m(i,o){q(i,e,o),s(e,n)},p(i,o){o&2&&l!==(l=mi(xe(i[1].chip,i[1].board))+"")&&D(n,l)},d(i){i&&A(e)}}}function ef(t){let e,l,n,i,o,a;function c(f,p){return f[6].length==0?cc:rc}let _=c(t),u=_(t);return{c(){e=m("div"),l=m("form"),n=m("input"),i=b(),u.c(),Gn(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(f,p){q(f,e,p),s(e,l),s(l,n),t[14](n),s(l,i),u.m(l,null),o||(a=[ve(n,"change",t[15]),ve(l,"submit",t[17])],o=!0)},p(f,p){_===(_=c(f))&&u?u.p(f,p):(u.d(1),u=_(f),u&&(u.c(),u.m(l,null)))},d(f){f&&A(e),t[14](null),u.d(),o=!1,zt(a)}}}function rc(t){var c,_;let e=t[6][0].name+"",l,n,i,o=((_=(c=t[3].btn)==null?void 0:c.upload)!=null?_:"Upload")+"",a;return{c(){l=M(e),n=b(),i=m("button"),a=M(o),r(i,"type","submit"),r(i,"class","btn-pri-sm float-right ml-2")},m(u,f){q(u,l,f),q(u,n,f),q(u,i,f),s(i,a)},p(u,f){var p,d;f&64&&e!==(e=u[6][0].name+"")&&D(l,e),f&8&&o!==(o=((d=(p=u[3].btn)==null?void 0:p.upload)!=null?d:"Upload")+"")&&D(a,o)},d(u){u&&A(l),u&&A(n),u&&A(i)}}}function cc(t){var a,c,_;let e,l=((_=(c=(a=t[3].status)==null?void 0:a.firmware)==null?void 0:c.btn_select_file)!=null?_:"Select file")+"",n,i,o;return{c(){e=m("button"),n=M(l),r(e,"type","button"),r(e,"class","btn-pri-sm float-right")},m(u,f){q(u,e,f),s(e,n),i||(o=ve(e,"click",t[16]),i=!0)},p(u,f){var p,d,v;f&8&&l!==(l=((v=(d=(p=u[3].status)==null?void 0:p.firmware)==null?void 0:d.btn_select_file)!=null?v:"Select file")+"")&&D(n,l)},d(u){u&&A(e),i=!1,o()}}}function tf(t){var H,W,K,Q,J,ae,Z,X,oe;let e,l,n=((K=(W=(H=t[3].status)==null?void 0:H.backup)==null?void 0:W.title)!=null?K:"Backup")+"",i,o,a,c,_,u,f,p,d=((ae=(J=(Q=t[3].status)==null?void 0:Q.backup)==null?void 0:J.secrets)!=null?ae:"Include secrets")+"",v,h,k,g=((oe=(X=(Z=t[3].status)==null?void 0:Z.backup)==null?void 0:X.secrets_desc)!=null?oe:"")+"",T,O,E,I,N,B,S,U,z=t[10],V=[];for(let ne=0;ne{se=null}),kt()),(Wt=Ce[0])!=null&&Wt.a?_e?(_e.p(Ce,qe),qe&1&&$(_e,1)):(_e=ya(Ce),_e.c(),$(_e,1),_e.m(l,null)):_e&&(gt(),fe(_e,1,1,()=>{_e=null}),kt()),Ce[1].meter?Te?Te.p(Ce,qe):(Te=za(Ce),Te.c(),Te.m(e,j)):Te&&(Te.d(1),Te=null),Ce[1].net?Se?Se.p(Ce,qe):(Se=Wa(Ce),Se.c(),Se.m(e,H)):Se&&(Se.d(1),Se=null),(!ee||qe&8)&&Q!==(Q=((Bt=(Ke=(Ve=Ce[3].status)==null?void 0:Ve.firmware)==null?void 0:Ke.title)!=null?Bt:"Firmware")+"")&&D(J,Q),(!ee||qe&8)&&X!==(X=((wt=(bt=(nt=Ce[3].status)==null?void 0:nt.firmware)==null?void 0:bt.installed)!=null?wt:"Installed")+"")&&D(oe,X),(!ee||qe&2)&&ie!==(ie=Ce[1].version+"")&&D(re,ie),Ce[1].upgrade.t&&Ce[1].upgrade.t!=Ce[1].version?de?de.p(Ce,qe):(de=Xa(Ce),de.c(),de.m(W,Y)):de&&(de.d(1),de=null),Ce[4]?Ne?Ne.p(Ce,qe):(Ne=Za(Ce),Ne.c(),Ne.m(W,x)):Ne&&(Ne.d(1),Ne=null),qe&3&&(ke=(Ce[1].security==0||Ce[0].a)&&fn(Ce[1].board)),ke?we?we.p(Ce,qe):(we=xa(Ce),we.c(),we.m(W,pe)):we&&(we.d(1),we=null),Ce[1].security==0||Ce[0].a?ge?ge.p(Ce,qe):(ge=ef(Ce),ge.c(),ge.m(W,null)):ge&&(ge.d(1),ge=null),Ce[1].security==0||Ce[0].a?he?he.p(Ce,qe):(he=tf(Ce),he.c(),he.m(e,null)):he&&(he.d(1),he=null);const at={};qe&128&&(at.active=Ce[7]),qe&8&&(at.message=(Ae=(Me=(ue=Ce[3].status)==null?void 0:ue.mask)==null?void 0:Me.firmware)!=null?Ae:"Uploading"),P.$set(at);const ft={};qe&512&&(ft.active=Ce[9]),qe&8&&(ft.message=(At=(rt=(it=Ce[3].status)==null?void 0:it.mask)==null?void 0:rt.config)!=null?At:"Uploading"),y.$set(ft)},i(Ce){ee||($(E.$$.fragment,Ce),$(se),$(_e),$(P.$$.fragment,Ce),$(y.$$.fragment,Ce),ee=!0)},o(Ce){fe(E.$$.fragment,Ce),fe(se),fe(_e),fe(P.$$.fragment,Ce),fe(y.$$.fragment,Ce),ee=!1},d(Ce){Ce&&A(e),le&&le.d(),Le(E),se&&se.d(),_e&&_e.d(),Te&&Te.d(),Se&&Se.d(),de&&de.d(),Ne&&Ne.d(),we&&we.d(),ge&&ge.d(),he&&he.d(),Ce&&A(w),Le(P,Ce),Ce&&A(L),Le(y,Ce)}}}async function dc(){await(await fetch("reboot",{method:"POST"})).json()}function vc(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",key:"is"}],a={};vl.subscribe(z=>{l(3,a=z)});let c={};ts.subscribe(z=>{l(4,c=Mu(i.version,z)),c||l(4,c=z[0])});function _(){var z,V;confirm(((V=(z=a.header)==null?void 0:z.upgrade)!=null?V:"Upgrade to {0}?").replace("{0}",c.tag_name))&&(i.board!=2&&i.board!=4&&i.board!=7||confirm(mi(xe(i.chip,i.board))))&&(dl.update(F=>(F.upgrading=!0,F)),wu(c.tag_name))}const u=function(){var z,V;confirm((V=(z=a.device)==null?void 0:z.reboot_confirm)!=null?V:"Reboot?")&&(dl.update(F=>(F.booting=!0,F)),dc())};let f,p=[],d=!1,v,h=[],k=!1;Ji();let g={hostname:"",ip:""};function T(z){l(9,k=!0);const V=new FormData;V.append("file",h[0]),fetch("/configfile",{method:"POST",body:V}).then(F=>F.json()).then(F=>{dl.update(R=>(g&&g.hostname&&(R.hostname=g.hostname),R.booting=F.reboot,g&&g.ip&&(R.net.ip=g.ip),setTimeout(Xn,5e3,i),R))}).catch(F=>{console.error("Error:",F),setTimeout(Xn,5e3,i)})}function O(z){ri[z?"unshift":"push"](()=>{f=z,l(5,f)})}function E(){p=this.files,l(6,p)}const I=()=>{f.click()},N=()=>l(7,d=!0);function B(z){ri[z?"unshift":"push"](()=>{v=z,l(8,v)})}function S(){h=this.files,l(2,h)}const U=()=>{v.click()};return t.$$set=z=>{"data"in z&&l(0,n=z.data),"sysinfo"in z&&l(1,i=z.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&4&&h.length==1){let z=h[0],V=new FileReader,F=R=>{let G=R.target.result.split(` -`);for(let j in G){let H=G[j];H.startsWith("hostname ")?g.hostname=H.split(" ")[1]:H.startsWith("ip ")&&(g.ip=H.split(" ")[1])}};V.onload=F,V.readAsText(z)}},[n,i,h,a,c,f,p,d,v,k,o,_,u,T,O,E,I,N,B,S,U]}class hc extends Dt{constructor(e){super(),qt(this,e,vc,pc,Nt,{data:0,sysinfo:1})}}function sf(t){let e,l,n=xe(t[0],7)+"",i,o,a=xe(t[0],5)+"",c,_,u=xe(t[0],4)+"",f,p,d=xe(t[0],3)+"",v,h,k,g,T=xe(t[0],2)+"",O,E,I=xe(t[0],1)+"",N,B,S=xe(t[0],0)+"",U,z,V,F,R=xe(t[0],101)+"",G,j,H=xe(t[0],100)+"",W;return{c(){e=m("optgroup"),l=m("option"),i=M(n),o=m("option"),c=M(a),_=m("option"),f=M(u),p=m("option"),v=M(d),h=b(),k=m("optgroup"),g=m("option"),O=M(T),E=m("option"),N=M(I),B=m("option"),U=M(S),z=b(),V=m("optgroup"),F=m("option"),G=M(R),j=m("option"),W=M(H),l.__value=7,l.value=l.__value,o.__value=5,o.value=o.__value,_.__value=4,_.value=_.__value,p.__value=3,p.value=p.__value,r(e,"label","amsleser.no"),g.__value=2,g.value=g.__value,E.__value=1,E.value=E.__value,B.__value=0,B.value=B.__value,r(k,"label","Custom hardware"),F.__value=101,F.value=F.__value,j.__value=100,j.value=j.__value,r(V,"label","Generic hardware")},m(K,Q){q(K,e,Q),s(e,l),s(l,i),s(e,o),s(o,c),s(e,_),s(_,f),s(e,p),s(p,v),q(K,h,Q),q(K,k,Q),s(k,g),s(g,O),s(k,E),s(E,N),s(k,B),s(B,U),q(K,z,Q),q(K,V,Q),s(V,F),s(F,G),s(V,j),s(j,W)},p(K,Q){Q&1&&n!==(n=xe(K[0],7)+"")&&D(i,n),Q&1&&a!==(a=xe(K[0],5)+"")&&D(c,a),Q&1&&u!==(u=xe(K[0],4)+"")&&D(f,u),Q&1&&d!==(d=xe(K[0],3)+"")&&D(v,d),Q&1&&T!==(T=xe(K[0],2)+"")&&D(O,T),Q&1&&I!==(I=xe(K[0],1)+"")&&D(N,I),Q&1&&S!==(S=xe(K[0],0)+"")&&D(U,S),Q&1&&R!==(R=xe(K[0],101)+"")&&D(G,R),Q&1&&H!==(H=xe(K[0],100)+"")&&D(W,H)},d(K){K&&A(e),K&&A(h),K&&A(k),K&&A(z),K&&A(V)}}}function of(t){let e,l,n=xe(t[0],201)+"",i,o,a=xe(t[0],202)+"",c,_,u=xe(t[0],203)+"",f,p,d=xe(t[0],241)+"",v,h,k=xe(t[0],242)+"",g,T,O=xe(t[0],243)+"",E,I,N=xe(t[0],200)+"",B;return{c(){e=m("optgroup"),l=m("option"),i=M(n),o=m("option"),c=M(a),_=m("option"),f=M(u),p=m("option"),v=M(d),h=m("option"),g=M(k),T=m("option"),E=M(O),I=m("option"),B=M(N),l.__value=201,l.value=l.__value,o.__value=202,o.value=o.__value,_.__value=203,_.value=_.__value,p.__value=241,p.value=p.__value,h.__value=242,h.value=h.__value,T.__value=243,T.value=T.__value,I.__value=200,I.value=I.__value,r(e,"label","Generic hardware")},m(S,U){q(S,e,U),s(e,l),s(l,i),s(e,o),s(o,c),s(e,_),s(_,f),s(e,p),s(p,v),s(e,h),s(h,g),s(e,T),s(T,E),s(e,I),s(I,B)},p(S,U){U&1&&n!==(n=xe(S[0],201)+"")&&D(i,n),U&1&&a!==(a=xe(S[0],202)+"")&&D(c,a),U&1&&u!==(u=xe(S[0],203)+"")&&D(f,u),U&1&&d!==(d=xe(S[0],241)+"")&&D(v,d),U&1&&k!==(k=xe(S[0],242)+"")&&D(g,k),U&1&&O!==(O=xe(S[0],243)+"")&&D(E,O),U&1&&N!==(N=xe(S[0],200)+"")&&D(B,N)},d(S){S&&A(e)}}}function af(t){let e,l,n=xe(t[0],7)+"",i,o,a=xe(t[0],6)+"",c,_,u=xe(t[0],5)+"",f,p,d,v,h=xe(t[0],51)+"",k,g,T=xe(t[0],50)+"",O;return{c(){e=m("optgroup"),l=m("option"),i=M(n),o=m("option"),c=M(a),_=m("option"),f=M(u),p=b(),d=m("optgroup"),v=m("option"),k=M(h),g=m("option"),O=M(T),l.__value=7,l.value=l.__value,o.__value=6,o.value=o.__value,_.__value=5,_.value=_.__value,r(e,"label","amsleser.no"),v.__value=51,v.value=v.__value,g.__value=50,g.value=g.__value,r(d,"label","Generic hardware")},m(E,I){q(E,e,I),s(e,l),s(l,i),s(e,o),s(o,c),s(e,_),s(_,f),q(E,p,I),q(E,d,I),s(d,v),s(v,k),s(d,g),s(g,O)},p(E,I){I&1&&n!==(n=xe(E[0],7)+"")&&D(i,n),I&1&&a!==(a=xe(E[0],6)+"")&&D(c,a),I&1&&u!==(u=xe(E[0],5)+"")&&D(f,u),I&1&&h!==(h=xe(E[0],51)+"")&&D(k,h),I&1&&T!==(T=xe(E[0],50)+"")&&D(O,T)},d(E){E&&A(e),E&&A(p),E&&A(d)}}}function ff(t){let e,l,n=xe(t[0],8)+"",i,o,a,c,_=xe(t[0],71)+"",u,f,p=xe(t[0],70)+"",d;return{c(){e=m("optgroup"),l=m("option"),i=M(n),o=b(),a=m("optgroup"),c=m("option"),u=M(_),f=m("option"),d=M(p),l.__value=8,l.value=l.__value,r(e,"label","Custom hardware"),c.__value=71,c.value=c.__value,f.__value=70,f.value=f.__value,r(a,"label","Generic hardware")},m(v,h){q(v,e,h),s(e,l),s(l,i),q(v,o,h),q(v,a,h),s(a,c),s(c,u),s(a,f),s(f,d)},p(v,h){h&1&&n!==(n=xe(v[0],8)+"")&&D(i,n),h&1&&_!==(_=xe(v[0],71)+"")&&D(u,_),h&1&&p!==(p=xe(v[0],70)+"")&&D(d,p)},d(v){v&&A(e),v&&A(o),v&&A(a)}}}function uf(t){let e,l,n=xe(t[0],200)+"",i;return{c(){e=m("optgroup"),l=m("option"),i=M(n),l.__value=200,l.value=l.__value,r(e,"label","Generic hardware")},m(o,a){q(o,e,a),s(e,l),s(l,i)},p(o,a){a&1&&n!==(n=xe(o[0],200)+"")&&D(i,n)},d(o){o&&A(e)}}}function rf(t){let e,l,n=xe(t[0],80)+"",i;return{c(){e=m("optgroup"),l=m("option"),i=M(n),l.__value=80,l.value=l.__value,r(e,"label","Generic hardware")},m(o,a){q(o,e,a),s(e,l),s(l,i)},p(o,a){a&1&&n!==(n=xe(o[0],80)+"")&&D(i,n)},d(o){o&&A(e)}}}function bc(t){let e,l,n,i,o,a,c,_,u=t[0]=="esp8266"&&sf(t),f=t[0]=="esp32"&&of(t),p=t[0]=="esp32s2"&&af(t),d=t[0]=="esp32c3"&&ff(t),v=t[0]=="esp32solo"&&uf(t),h=t[0]=="esp32s3"&&rf(t);return{c(){e=m("option"),l=b(),u&&u.c(),n=b(),f&&f.c(),i=b(),p&&p.c(),o=b(),d&&d.c(),a=b(),v&&v.c(),c=b(),h&&h.c(),_=Qt(),e.__value=-1,e.value=e.__value},m(k,g){q(k,e,g),q(k,l,g),u&&u.m(k,g),q(k,n,g),f&&f.m(k,g),q(k,i,g),p&&p.m(k,g),q(k,o,g),d&&d.m(k,g),q(k,a,g),v&&v.m(k,g),q(k,c,g),h&&h.m(k,g),q(k,_,g)},p(k,[g]){k[0]=="esp8266"?u?u.p(k,g):(u=sf(k),u.c(),u.m(n.parentNode,n)):u&&(u.d(1),u=null),k[0]=="esp32"?f?f.p(k,g):(f=of(k),f.c(),f.m(i.parentNode,i)):f&&(f.d(1),f=null),k[0]=="esp32s2"?p?p.p(k,g):(p=af(k),p.c(),p.m(o.parentNode,o)):p&&(p.d(1),p=null),k[0]=="esp32c3"?d?d.p(k,g):(d=ff(k),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null),k[0]=="esp32solo"?v?v.p(k,g):(v=uf(k),v.c(),v.m(c.parentNode,c)):v&&(v.d(1),v=null),k[0]=="esp32s3"?h?h.p(k,g):(h=rf(k),h.c(),h.m(_.parentNode,_)):h&&(h.d(1),h=null)},i:Xe,o:Xe,d(k){k&&A(e),k&&A(l),u&&u.d(k),k&&A(n),f&&f.d(k),k&&A(i),p&&p.d(k),k&&A(o),d&&d.d(k),k&&A(a),v&&v.d(k),k&&A(c),h&&h.d(k),k&&A(_)}}}function gc(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class kc extends Dt{constructor(e){super(),qt(this,e,gc,bc,Nt,{chip:0})}}function cf(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){q(l,e,n)},d(l){l&&A(e)}}}function _f(t){let e,l,n,i,o,a,c;return a=new Bi({props:{chip:t[0].chip}}),{c(){e=m("div"),l=M("HAN GPIO"),n=m("br"),i=b(),o=m("select"),Re(a.$$.fragment),r(o,"name","vh"),r(o,"class","in-s"),r(e,"class","my-3")},m(_,u){q(_,e,u),s(e,l),s(e,n),s(e,i),s(e,o),De(a,o,null),c=!0},p(_,u){const f={};u&1&&(f.chip=_[0].chip),a.$set(f)},i(_){c||($(a.$$.fragment,_),c=!0)},o(_){fe(a.$$.fragment,_),c=!1},d(_){_&&A(e),Le(a)}}}function wc(t){let e,l,n,i,o,a,c,_,u,f,p,d,v,h,k,g,T,O,E,I,N,B,S,U,z,V,F,R,G,j=t[0].usrcfg&&cf();h=new kc({props:{chip:t[0].chip}});let H=t[0].board&&t[0].board>20&&_f(t);return V=new pl({props:{active:t[1],message:"Saving"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=b(),a=m("strong"),a.textContent="Initial configuration",c=b(),j&&j.c(),_=b(),u=m("div"),f=M("Board type"),p=m("br"),d=b(),v=m("select"),Re(h.$$.fragment),k=b(),H&&H.c(),g=b(),T=m("div"),O=m("label"),E=m("input"),I=M(" Clear all other configuration"),N=b(),B=m("div"),B.innerHTML='',S=b(),U=m("span"),U.textContent="\xA0",z=b(),Re(V.$$.fragment),r(i,"type","hidden"),r(i,"name","v"),i.value="true",r(a,"class","text-sm"),r(v,"name","vb"),r(v,"class","in-s"),t[0].board===void 0&&Gt(()=>t[5].call(v)),r(u,"class","my-3"),r(E,"type","checkbox"),r(E,"name","vr"),E.__value="true",E.value=E.__value,r(E,"class","rounded mb-1"),r(T,"class","my-3"),r(B,"class","my-3"),r(U,"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(W,K){q(W,e,K),s(e,l),s(l,n),s(n,i),s(n,o),s(n,a),s(n,c),j&&j.m(n,null),s(n,_),s(n,u),s(u,f),s(u,p),s(u,d),s(u,v),De(h,v,null),ot(v,t[0].board,!0),s(n,k),H&&H.m(n,null),s(n,g),s(n,T),s(T,O),s(O,E),E.checked=t[2],s(O,I),s(n,N),s(n,B),s(n,S),s(n,U),q(W,z,K),De(V,W,K),F=!0,R||(G=[ve(v,"change",t[5]),ve(E,"change",t[6]),ve(n,"submit",_n(t[3]))],R=!0)},p(W,[K]){W[0].usrcfg?j||(j=cf(),j.c(),j.m(n,_)):j&&(j.d(1),j=null);const Q={};K&1&&(Q.chip=W[0].chip),h.$set(Q),K&1&&ot(v,W[0].board),W[0].board&&W[0].board>20?H?(H.p(W,K),K&1&&$(H,1)):(H=_f(W),H.c(),$(H,1),H.m(n,g)):H&&(gt(),fe(H,1,1,()=>{H=null}),kt()),K&4&&(E.checked=W[2]);const J={};K&2&&(J.active=W[1]),V.$set(J)},i(W){F||($(h.$$.fragment,W),$(H),$(V.$$.fragment,W),F=!0)},o(W){fe(h.$$.fragment,W),fe(H),fe(V.$$.fragment,W),F=!1},d(W){W&&A(e),j&&j.d(),Le(h),H&&H.d(),W&&A(z),Le(V,W),R=!1,zt(G)}}}function Mc(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,o=!1;async function a(f){l(1,o=!0);const p=new FormData(f.target),d=new URLSearchParams;for(let k of p){const[g,T]=k;d.append(g,T)}let h=await(await fetch("save",{method:"POST",body:d})).json();l(1,o=!1),dl.update(k=>(k.vndcfg=h.success,k.booting=h.reboot,k.if.eth=k.boardType>240&&k.boardType<250,k)),en(n+(i.usrcfg?"/":"/setup"))}let c=!1;dl.subscribe(f=>{l(0,i=f),f.fwconsent===1&&l(2,c=!i.usrcfg)});function _(){i.board=Kt(this),l(0,i)}function u(){c=this.checked,l(2,c)}return t.$$set=f=>{"basepath"in f&&l(4,n=f.basepath),"sysinfo"in f&&l(0,i=f.sysinfo)},[i,o,c,a,n,_,u]}class Sc extends Dt{constructor(e){super(),qt(this,e,Mc,wc,Nt,{basepath:4,sysinfo:0})}}function mf(t){var i,o,a;let e,l=((a=(o=(i=t[1].conf)==null?void 0:i.connection)==null?void 0:o.eth)!=null?a:"Ethernet")+"",n;return{c(){e=m("option"),n=M(l),e.__value=3,e.value=e.__value},m(c,_){q(c,e,_),s(e,n)},p(c,_){var u,f,p;_&2&&l!==(l=((p=(f=(u=c[1].conf)==null?void 0:u.connection)==null?void 0:f.eth)!=null?p:"Ethernet")+"")&&D(n,l)},d(c){c&&A(e)}}}function pf(t){var g,T,O,E,I,N;let e,l=((O=(T=(g=t[1].conf)==null?void 0:g.connection)==null?void 0:T.ssid)!=null?O:"SSID")+"",n,i,o,a,c,_,u,f=((N=(I=(E=t[1].conf)==null?void 0:E.connection)==null?void 0:I.psk)!=null?N:"Password")+"",p,d,v,h,k;return{c(){e=m("div"),n=M(l),i=m("br"),o=b(),a=m("input"),_=b(),u=m("div"),p=M(f),d=m("br"),v=b(),h=m("input"),r(a,"name","ss"),r(a,"type","text"),r(a,"class","in-s"),a.required=c=t[3]==1||t[3]==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=k=t[3]==2,r(u,"class","my-3")},m(B,S){q(B,e,S),s(e,n),s(e,i),s(e,o),s(e,a),q(B,_,S),q(B,u,S),s(u,p),s(u,d),s(u,v),s(u,h)},p(B,S){var U,z,V,F,R,G;S&2&&l!==(l=((V=(z=(U=B[1].conf)==null?void 0:U.connection)==null?void 0:z.ssid)!=null?V:"SSID")+"")&&D(n,l),S&8&&c!==(c=B[3]==1||B[3]==2)&&(a.required=c),S&2&&f!==(f=((G=(R=(F=B[1].conf)==null?void 0:F.connection)==null?void 0:R.psk)!=null?G:"Password")+"")&&D(p,f),S&8&&k!==(k=B[3]==2)&&(h.required=k)},d(B){B&&A(e),B&&A(_),B&&A(u)}}}function df(t){let e,l,n,i,o,a,c,_;return c=new Tu({}),{c(){e=m("br"),l=b(),n=m("div"),i=m("input"),o=b(),a=m("select"),Re(c.$$.fragment),r(i,"name","si"),r(i,"type","text"),r(i,"class","in-f w-full"),i.required=t[2],r(a,"name","su"),r(a,"class","in-l"),a.required=t[2],r(n,"class","flex")},m(u,f){q(u,e,f),q(u,l,f),q(u,n,f),s(n,i),s(n,o),s(n,a),De(c,a,null),_=!0},p(u,f){(!_||f&4)&&(i.required=u[2]),(!_||f&4)&&(a.required=u[2])},i(u){_||($(c.$$.fragment,u),_=!0)},o(u){fe(c.$$.fragment,u),_=!1},d(u){u&&A(e),u&&A(l),u&&A(n),Le(c)}}}function vf(t){var k,g,T,O,E,I;let e,l,n=((T=(g=(k=t[1].conf)==null?void 0:k.network)==null?void 0:g.gw)!=null?T:"Gateway")+"",i,o,a,c,_,u,f=((I=(E=(O=t[1].conf)==null?void 0:O.network)==null?void 0:E.dns)!=null?I:"DNS")+"",p,d,v,h;return{c(){e=m("div"),l=m("div"),i=M(n),o=m("br"),a=b(),c=m("input"),_=b(),u=m("div"),p=M(f),d=m("br"),v=b(),h=m("input"),r(c,"name","sg"),r(c,"type","text"),r(c,"class","in-f w-full"),r(h,"name","sd"),r(h,"type","text"),r(h,"class","in-l w-full"),r(e,"class","my-3 flex")},m(N,B){q(N,e,B),s(e,l),s(l,i),s(l,o),s(l,a),s(l,c),s(e,_),s(e,u),s(u,p),s(u,d),s(u,v),s(u,h)},p(N,B){var S,U,z,V,F,R;B&2&&n!==(n=((z=(U=(S=N[1].conf)==null?void 0:S.network)==null?void 0:U.gw)!=null?z:"Gateway")+"")&&D(i,n),B&2&&f!==(f=((R=(F=(V=N[1].conf)==null?void 0:V.network)==null?void 0:F.dns)!=null?R:"DNS")+"")&&D(p,f)},d(N){N&&A(e)}}}function Cc(t){var y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye,et,He;let e,l,n,i,o,a,c=((ee=(y=t[1].setup)==null?void 0:y.title)!=null?ee:"Setup")+"",_,u,f,p=((_e=(se=(le=t[1].conf)==null?void 0:le.connection)==null?void 0:se.title)!=null?_e:"Connection")+"",d,v,h,k,g,T=((de=(Se=(Te=t[1].conf)==null?void 0:Te.connection)==null?void 0:Se.wifi)!=null?de:"Connect to WiFi")+"",O,E,I=((ge=(we=(Ne=t[1].conf)==null?void 0:Ne.connection)==null?void 0:we.ap)!=null?ge:"Standalone access point")+"",N,B,S,U,z=((Ue=(je=(he=t[1].conf)==null?void 0:he.general)==null?void 0:je.hostname)!=null?Ue:"Hostname")+"",V,F,R,G,j,H,W,K,Q=((Ze=(We=t[1].setup)==null?void 0:We.static)!=null?Ze:"Static IP")+"",J,ae,Z,X,oe,ne,ie=((Ye=(Je=t[1].btn)==null?void 0:Je.save)!=null?Ye:"Save")+"",re,me,Y,x,ke,pe,C=t[0].if&&t[0].if.eth&&mf(t),w=(t[3]==1||t[3]==2)&&pf(t),P=t[2]&&df(t),L=t[2]&&vf(t);return Y=new pl({props:{active:t[4],message:(He=(et=t[1].setup)==null?void 0:et.mask)!=null?He:"Saving"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=b(),a=m("strong"),_=M(c),u=b(),f=m("div"),d=M(p),v=m("br"),h=b(),k=m("select"),g=m("option"),O=M(T),E=m("option"),N=M(I),C&&C.c(),B=b(),w&&w.c(),S=b(),U=m("div"),V=M(z),F=b(),R=m("input"),G=b(),j=m("div"),H=m("label"),W=m("input"),K=b(),J=M(Q),ae=b(),P&&P.c(),Z=b(),L&&L.c(),X=b(),oe=m("div"),ne=m("button"),re=M(ie),me=b(),Re(Y.$$.fragment),r(i,"type","hidden"),r(i,"name","s"),i.value="true",r(a,"class","text-sm"),g.__value=1,g.value=g.__value,E.__value=2,E.value=E.__value,r(k,"name","sc"),r(k,"class","in-s"),t[3]===void 0&&Gt(()=>t[6].call(k)),r(f,"class","my-3"),r(R,"name","sh"),r(R,"type","text"),r(R,"class","in-s"),r(R,"maxlength","32"),r(R,"pattern","[a-z0-9_-]+"),r(R,"placeholder","Optional, ex.: ams-reader"),r(R,"autocomplete","off"),r(W,"type","checkbox"),r(W,"name","sm"),W.__value="static",W.value=W.__value,r(W,"class","rounded mb-1"),r(j,"class","my-3"),r(ne,"type","submit"),r(ne,"class","btn-pri"),r(oe,"class","my-3"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(Oe,ce){q(Oe,e,ce),s(e,l),s(l,n),s(n,i),s(n,o),s(n,a),s(a,_),s(n,u),s(n,f),s(f,d),s(f,v),s(f,h),s(f,k),s(k,g),s(g,O),s(k,E),s(E,N),C&&C.m(k,null),ot(k,t[3],!0),s(n,B),w&&w.m(n,null),s(n,S),s(n,U),s(U,V),s(U,F),s(U,R),Ee(R,t[0].hostname),s(n,G),s(n,j),s(j,H),s(H,W),W.checked=t[2],s(H,K),s(H,J),s(j,ae),P&&P.m(j,null),s(n,Z),L&&L.m(n,null),s(n,X),s(n,oe),s(oe,ne),s(ne,re),q(Oe,me,ce),De(Y,Oe,ce),x=!0,ke||(pe=[ve(k,"change",t[6]),ve(R,"input",t[7]),ve(W,"change",t[8]),ve(n,"submit",_n(t[5]))],ke=!0)},p(Oe,[ce]){var $e,Qe,mt,ye,Ge,ze,tt,vt,Mt,dt,te,be,Tt,Ce,qe,pt,at,ft,ut,Et;(!x||ce&2)&&c!==(c=((Qe=($e=Oe[1].setup)==null?void 0:$e.title)!=null?Qe:"Setup")+"")&&D(_,c),(!x||ce&2)&&p!==(p=((Ge=(ye=(mt=Oe[1].conf)==null?void 0:mt.connection)==null?void 0:ye.title)!=null?Ge:"Connection")+"")&&D(d,p),(!x||ce&2)&&T!==(T=((vt=(tt=(ze=Oe[1].conf)==null?void 0:ze.connection)==null?void 0:tt.wifi)!=null?vt:"Connect to WiFi")+"")&&D(O,T),(!x||ce&2)&&I!==(I=((te=(dt=(Mt=Oe[1].conf)==null?void 0:Mt.connection)==null?void 0:dt.ap)!=null?te:"Standalone access point")+"")&&D(N,I),Oe[0].if&&Oe[0].if.eth?C?C.p(Oe,ce):(C=mf(Oe),C.c(),C.m(k,null)):C&&(C.d(1),C=null),ce&8&&ot(k,Oe[3]),Oe[3]==1||Oe[3]==2?w?w.p(Oe,ce):(w=pf(Oe),w.c(),w.m(n,S)):w&&(w.d(1),w=null),(!x||ce&2)&&z!==(z=((Ce=(Tt=(be=Oe[1].conf)==null?void 0:be.general)==null?void 0:Tt.hostname)!=null?Ce:"Hostname")+"")&&D(V,z),ce&1&&R.value!==Oe[0].hostname&&Ee(R,Oe[0].hostname),ce&4&&(W.checked=Oe[2]),(!x||ce&2)&&Q!==(Q=((pt=(qe=Oe[1].setup)==null?void 0:qe.static)!=null?pt:"Static IP")+"")&&D(J,Q),Oe[2]?P?(P.p(Oe,ce),ce&4&&$(P,1)):(P=df(Oe),P.c(),$(P,1),P.m(j,null)):P&&(gt(),fe(P,1,1,()=>{P=null}),kt()),Oe[2]?L?L.p(Oe,ce):(L=vf(Oe),L.c(),L.m(n,X)):L&&(L.d(1),L=null),(!x||ce&2)&&ie!==(ie=((ft=(at=Oe[1].btn)==null?void 0:at.save)!=null?ft:"Save")+"")&&D(re,ie);const Pe={};ce&16&&(Pe.active=Oe[4]),ce&2&&(Pe.message=(Et=(ut=Oe[1].setup)==null?void 0:ut.mask)!=null?Et:"Saving"),Y.$set(Pe)},i(Oe){x||($(P),$(Y.$$.fragment,Oe),x=!0)},o(Oe){fe(P),fe(Y.$$.fragment,Oe),x=!1},d(Oe){Oe&&A(e),C&&C.d(),w&&w.d(),P&&P.d(),L&&L.d(),Oe&&A(me),Le(Y,Oe),ke=!1,zt(pe)}}}function Nc(t,e,l){let n={};vl.subscribe(v=>{l(1,n=v)});let{sysinfo:i={}}=e,o=!1,a=1,c=!1;function _(v){dl.update(h=>(h.trying=v,h))}async function u(v){l(4,c=!0);const h=new FormData(v.target),k=new URLSearchParams;for(let O of h){const[E,I]=O;k.append(E,I)}let T=await(await fetch("save",{method:"POST",body:k})).json();l(4,c=!1),dl.update(O=>(O.hostname=h.get("sh"),O.usrcfg=T.success,O.booting=T.reboot,o&&(O.net.ip=h.get("si"),O.net.mask=h.get("su"),O.net.gw=h.get("sg"),O.net.dns1=h.get("sd")),T.reboot&&setTimeout(Xn,5e3,i,_),O))}function f(){a=Kt(this),l(3,a)}function p(){i.hostname=this.value,l(0,i)}function d(){o=this.checked,l(2,o)}return t.$$set=v=>{"sysinfo"in v&&l(0,i=v.sysinfo)},[i,n,o,a,c,u,f,p,d]}class Tc extends Dt{constructor(e){super(),qt(this,e,Nc,Cc,Nt,{sysinfo:0})}}function Ec(t){var V,F,R,G,j,H,W,K;let e,l,n,i=((F=(V=t[2].upload)==null?void 0:V.title)!=null?F:"Upload")+"",o,a,c,_,u,f=((G=(R=t[2].upload)==null?void 0:R.desc)!=null?G:"")+"",p,d,v,h,k,g,T,O,E=((H=(j=t[2].btn)==null?void 0:j.upload)!=null?H:"Upload")+"",I,N,B,S,U,z;return B=new pl({props:{active:t[3],message:(K=(W=t[2].upload)==null?void 0:W.mask)!=null?K:"Uploading"}}),{c(){e=m("div"),l=m("div"),n=m("strong"),o=M(i),a=b(),c=M(t[1]),_=b(),u=m("p"),p=M(f),d=b(),v=m("form"),h=m("input"),k=b(),g=m("div"),T=m("button"),O=m("p"),I=M(E),N=b(),Re(B.$$.fragment),r(u,"class","mb-4"),r(h,"name","file"),r(h,"type","file"),r(O,"class","mb-4"),r(T,"type","submit"),r(T,"class","btn-pri"),r(g,"class","w-full text-right mt-4"),r(v,"action",t[0]),r(v,"enctype","multipart/form-data"),r(v,"method","post"),r(v,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2")},m(Q,J){q(Q,e,J),s(e,l),s(l,n),s(n,o),s(n,a),s(n,c),s(l,_),s(l,u),s(u,p),s(l,d),s(l,v),s(v,h),s(v,k),s(v,g),s(g,T),s(T,O),s(O,I),q(Q,N,J),De(B,Q,J),S=!0,U||(z=ve(v,"submit",t[4]),U=!0)},p(Q,[J]){var Z,X,oe,ne,ie,re,me,Y;(!S||J&4)&&i!==(i=((X=(Z=Q[2].upload)==null?void 0:Z.title)!=null?X:"Upload")+"")&&D(o,i),(!S||J&2)&&D(c,Q[1]),(!S||J&4)&&f!==(f=((ne=(oe=Q[2].upload)==null?void 0:oe.desc)!=null?ne:"")+"")&&D(p,f),(!S||J&4)&&E!==(E=((re=(ie=Q[2].btn)==null?void 0:ie.upload)!=null?re:"Upload")+"")&&D(I,E),(!S||J&1)&&r(v,"action",Q[0]);const ae={};J&8&&(ae.active=Q[3]),J&4&&(ae.message=(Y=(me=Q[2].upload)==null?void 0:me.mask)!=null?Y:"Uploading"),B.$set(ae)},i(Q){S||($(B.$$.fragment,Q),S=!0)},o(Q){fe(B.$$.fragment,Q),S=!1},d(Q){Q&&A(e),Q&&A(N),Le(B,Q),U=!1,z()}}}function Pc(t,e,l){let{action:n}=e,{title:i}=e,o={};vl.subscribe(_=>{l(2,o=_)});let a=!1;const c=()=>l(3,a=!0);return t.$$set=_=>{"action"in _&&l(0,n=_.action),"title"in _&&l(1,i=_.title)},[n,i,o,a,c]}class ns extends Dt{constructor(e){super(),qt(this,e,Pc,Ec,Nt,{action:0,title:1})}}function Ac(t){var Y,x,ke,pe,C,w,P,L,y,ee,le,se,_e,Te;let e,l,n,i,o=((x=(Y=t[1].consent)==null?void 0:Y.title)!=null?x:"Consents")+"",a,c,_,u,f,p=((pe=(ke=t[1].consent)==null?void 0:ke.one_click)!=null?pe:"One-click")+"",d,v,h,k,g=((w=(C=t[1].consent)==null?void 0:C.read_more)!=null?w:"Read more")+"",T,O,E,I,N,B,S,U=((L=(P=t[1].consent)==null?void 0:P.yes)!=null?L:"Yes")+"",z,V,F,R,G,j,H=((ee=(y=t[1].consent)==null?void 0:y.no)!=null?ee:"No")+"",W,K,Q,J,ae,Z=((se=(le=t[1].btn)==null?void 0:le.save)!=null?se:"Save")+"",X,oe,ne,ie,re,me;return ne=new pl({props:{active:t[2],message:(Te=(_e=t[1].consent)==null?void 0:_e.mask_saving)!=null?Te:"Saving"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("div"),a=M(o),c=b(),_=m("hr"),u=b(),f=m("div"),d=M(p),v=m("br"),h=b(),k=m("a"),T=M(g),O=m("br"),E=b(),I=m("label"),N=m("input"),S=b(),z=M(U),V=b(),F=m("label"),R=m("input"),j=b(),W=M(H),K=m("br"),Q=b(),J=m("div"),ae=m("button"),X=M(Z),oe=b(),Re(ne.$$.fragment),r(k,"href",kl("Data-collection-on-one-click-firmware-upgrade")),r(k,"target","_blank"),r(k,"class","text-blue-600 hover:text-blue-800"),r(N,"type","radio"),r(N,"name","sf"),N.value=1,N.checked=B=t[0].fwconsent===1,r(N,"class","rounded m-2"),N.required=!0,r(R,"type","radio"),r(R,"name","sf"),R.value=2,R.checked=G=t[0].fwconsent===2,r(R,"class","rounded m-2"),R.required=!0,r(f,"class","my-3"),r(ae,"type","submit"),r(ae,"class","btn-pri"),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(Se,de){q(Se,e,de),s(e,l),s(l,n),s(n,i),s(i,a),s(n,c),s(n,_),s(n,u),s(n,f),s(f,d),s(f,v),s(f,h),s(f,k),s(k,T),s(f,O),s(f,E),s(f,I),s(I,N),s(I,S),s(I,z),s(f,V),s(f,F),s(F,R),s(F,j),s(F,W),s(f,K),s(n,Q),s(n,J),s(J,ae),s(ae,X),q(Se,oe,de),De(ne,Se,de),ie=!0,re||(me=ve(n,"submit",_n(t[3])),re=!0)},p(Se,[de]){var we,ge,he,je,Ue,We,Ze,Je,Ye,et,He,Oe,ce,Pe;(!ie||de&2)&&o!==(o=((ge=(we=Se[1].consent)==null?void 0:we.title)!=null?ge:"Consents")+"")&&D(a,o),(!ie||de&2)&&p!==(p=((je=(he=Se[1].consent)==null?void 0:he.one_click)!=null?je:"One-click")+"")&&D(d,p),(!ie||de&2)&&g!==(g=((We=(Ue=Se[1].consent)==null?void 0:Ue.read_more)!=null?We:"Read more")+"")&&D(T,g),(!ie||de&1&&B!==(B=Se[0].fwconsent===1))&&(N.checked=B),(!ie||de&2)&&U!==(U=((Je=(Ze=Se[1].consent)==null?void 0:Ze.yes)!=null?Je:"Yes")+"")&&D(z,U),(!ie||de&1&&G!==(G=Se[0].fwconsent===2))&&(R.checked=G),(!ie||de&2)&&H!==(H=((et=(Ye=Se[1].consent)==null?void 0:Ye.no)!=null?et:"No")+"")&&D(W,H),(!ie||de&2)&&Z!==(Z=((Oe=(He=Se[1].btn)==null?void 0:He.save)!=null?Oe:"Save")+"")&&D(X,Z);const Ne={};de&4&&(Ne.active=Se[2]),de&2&&(Ne.message=(Pe=(ce=Se[1].consent)==null?void 0:ce.mask_saving)!=null?Pe:"Saving"),ne.$set(Ne)},i(Se){ie||($(ne.$$.fragment,Se),ie=!0)},o(Se){fe(ne.$$.fragment,Se),ie=!1},d(Se){Se&&A(e),Se&&A(oe),Le(ne,Se),re=!1,me()}}}function qc(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,o={};vl.subscribe(_=>{l(1,o=_)});let a=!1;async function c(_){l(2,a=!0);const u=new FormData(_.target),f=new URLSearchParams;for(let v of u){const[h,k]=v;f.append(h,k)}let d=await(await fetch("save",{method:"POST",body:f})).json();l(2,a=!1),dl.update(v=>(v.fwconsent=u.sf===!0?1:u.sf===!1?2:0,v.booting=d.reboot,v)),en(n)}return t.$$set=_=>{"basepath"in _&&l(4,n=_.basepath),"sysinfo"in _&&l(0,i=_.sysinfo)},[i,o,a,c,n]}class Dc extends Dt{constructor(e){super(),qt(this,e,qc,Ac,Nt,{basepath:4,sysinfo:0})}}function hf(t,e,l){const n=t.slice();return n[24]=e[l],n[25]=e,n[26]=l,n}function bf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function Lc(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function gf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function Oc(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function kf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function wf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function Mf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function Sf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function Cf(t){let e,l=t[1].o,n=[];for(let i=0;i{l(0,i=F)});let o=["mo","tu","we","th","fr","sa","su"],a={},c=!0,_=!1;Nu.subscribe(F=>{F.o&&(l(1,a=F),l(2,c=!1))}),w0();async function u(F){l(3,_=!0);const R=new URLSearchParams;R.append("r","true"),R.append("rc",a.o.length),a.o.forEach(function(j,H){R.append("rt"+H,j.t),R.append("rn"+H,j.n),R.append("rd"+H,j.d),R.append("ra"+H,j.a),R.append("rh"+H,j.h),R.append("rv"+H,j.v),R.append("rsm"+H,j.s.m),R.append("rsd"+H,j.s.d),R.append("rem"+H,j.e.m),R.append("red"+H,j.e.d)}),await(await fetch("save",{method:"POST",body:R})).json(),l(3,_=!1),en(n+"configuration")}let f=function(F,R){return F.includes(R)?F=F.filter(function(G){return G!==R}):F.push(R),F},p=function(){let F=a.o;F.push({t:1,n:"",d:3,a:[0,1,2,3,4,5,6,7],h:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],v:.001,s:{m:0,d:0},e:{m:0,d:0}}),l(1,a.o=F,a)},d=function(F){let R=a.o;R.splice(F,1),l(1,a.o=R,a)};function v(F,R){F[R].n=this.value,l(1,a)}function h(F,R){F[R].d=Kt(this),l(1,a)}function k(F,R){F[R].t=Kt(this),l(1,a)}function g(F,R){F[R].v=st(this.value),l(1,a)}const T=(F,R,G,j)=>l(1,G[j].a=f(F.a,R),a),O=(F,R,G,j)=>l(1,G[j].h=f(F.h,R),a),E=(F,R,G,j)=>l(1,G[j].h=f(F.h,R+8),a),I=(F,R,G,j)=>l(1,G[j].h=f(F.h,R+16),a);function N(F,R){F[R].s.d=Kt(this),l(1,a)}function B(F,R){F[R].s.m=Kt(this),l(1,a)}function S(F,R){F[R].e.d=Kt(this),l(1,a)}function U(F,R){F[R].e.m=Kt(this),l(1,a)}const z=F=>d(F),V=F=>d(F);return t.$$set=F=>{"basepath"in F&&l(9,n=F.basepath)},[i,a,c,_,o,u,f,p,d,n,v,h,k,g,T,O,E,I,N,B,S,U,z,V]}class Bc extends Dt{constructor(e){super(),qt(this,e,Uc,Fc,Nt,{basepath:9},null,[-1,-1])}}function jc(t){let e,l;return e=new g0({props:{data:t[2],sysinfo:t[1]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&4&&(o.data=n[2]),i&2&&(o.sysinfo=n[1]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Hc(t){let e,l;return e=new sc({props:{sysinfo:t[1],basepath:t[0],data:t[2]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&1&&(o.basepath=n[0]),i&4&&(o.data=n[2]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function yc(t){let e,l;return e=new Bc({props:{basepath:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function zc(t){let e,l;return e=new hc({props:{sysinfo:t[1],data:t[2]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&4&&(o.data=n[2]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Wc(t){let e,l;return e=new ns({props:{title:"CA",action:"/mqtt-ca"}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p:Xe,i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Gc(t){let e,l;return e=new ns({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p:Xe,i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Vc(t){let e,l;return e=new ns({props:{title:"private key",action:"/mqtt-key"}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p:Xe,i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Kc(t){let e,l;return e=new Dc({props:{sysinfo:t[1],basepath:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Yc(t){let e,l;return e=new Tc({props:{sysinfo:t[1]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Qc(t){let e,l;return e=new Sc({props:{sysinfo:t[1],basepath:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Xc(t){let e,l,n,i,o,a,c,_,u,f,p,d,v,h,k,g,T,O,E,I,N,B;return e=new A1({props:{data:t[2],basepath:t[0]}}),n=new ql({props:{path:"/",$$slots:{default:[jc]},$$scope:{ctx:t}}}),o=new ql({props:{path:"/configuration",$$slots:{default:[Hc]},$$scope:{ctx:t}}}),c=new ql({props:{path:"/priceconfig",$$slots:{default:[yc]},$$scope:{ctx:t}}}),u=new ql({props:{path:"/status",$$slots:{default:[zc]},$$scope:{ctx:t}}}),p=new ql({props:{path:"/mqtt-ca",$$slots:{default:[Wc]},$$scope:{ctx:t}}}),v=new ql({props:{path:"/mqtt-cert",$$slots:{default:[Gc]},$$scope:{ctx:t}}}),k=new ql({props:{path:"/mqtt-key",$$slots:{default:[Vc]},$$scope:{ctx:t}}}),T=new ql({props:{path:"/consent",$$slots:{default:[Kc]},$$scope:{ctx:t}}}),E=new ql({props:{path:"/setup",$$slots:{default:[Yc]},$$scope:{ctx:t}}}),N=new ql({props:{path:"/vendor",$$slots:{default:[Qc]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment),l=b(),Re(n.$$.fragment),i=b(),Re(o.$$.fragment),a=b(),Re(c.$$.fragment),_=b(),Re(u.$$.fragment),f=b(),Re(p.$$.fragment),d=b(),Re(v.$$.fragment),h=b(),Re(k.$$.fragment),g=b(),Re(T.$$.fragment),O=b(),Re(E.$$.fragment),I=b(),Re(N.$$.fragment)},m(S,U){De(e,S,U),q(S,l,U),De(n,S,U),q(S,i,U),De(o,S,U),q(S,a,U),De(c,S,U),q(S,_,U),De(u,S,U),q(S,f,U),De(p,S,U),q(S,d,U),De(v,S,U),q(S,h,U),De(k,S,U),q(S,g,U),De(T,S,U),q(S,O,U),De(E,S,U),q(S,I,U),De(N,S,U),B=!0},p(S,U){const z={};U&4&&(z.data=S[2]),U&1&&(z.basepath=S[0]),e.$set(z);const V={};U&22&&(V.$$scope={dirty:U,ctx:S}),n.$set(V);const F={};U&23&&(F.$$scope={dirty:U,ctx:S}),o.$set(F);const R={};U&17&&(R.$$scope={dirty:U,ctx:S}),c.$set(R);const G={};U&22&&(G.$$scope={dirty:U,ctx:S}),u.$set(G);const j={};U&16&&(j.$$scope={dirty:U,ctx:S}),p.$set(j);const H={};U&16&&(H.$$scope={dirty:U,ctx:S}),v.$set(H);const W={};U&16&&(W.$$scope={dirty:U,ctx:S}),k.$set(W);const K={};U&19&&(K.$$scope={dirty:U,ctx:S}),T.$set(K);const Q={};U&18&&(Q.$$scope={dirty:U,ctx:S}),E.$set(Q);const J={};U&19&&(J.$$scope={dirty:U,ctx:S}),N.$set(J)},i(S){B||($(e.$$.fragment,S),$(n.$$.fragment,S),$(o.$$.fragment,S),$(c.$$.fragment,S),$(u.$$.fragment,S),$(p.$$.fragment,S),$(v.$$.fragment,S),$(k.$$.fragment,S),$(T.$$.fragment,S),$(E.$$.fragment,S),$(N.$$.fragment,S),B=!0)},o(S){fe(e.$$.fragment,S),fe(n.$$.fragment,S),fe(o.$$.fragment,S),fe(c.$$.fragment,S),fe(u.$$.fragment,S),fe(p.$$.fragment,S),fe(v.$$.fragment,S),fe(k.$$.fragment,S),fe(T.$$.fragment,S),fe(E.$$.fragment,S),fe(N.$$.fragment,S),B=!1},d(S){Le(e,S),S&&A(l),Le(n,S),S&&A(i),Le(o,S),S&&A(a),Le(c,S),S&&A(_),Le(u,S),S&&A(f),Le(p,S),S&&A(d),Le(v,S),S&&A(h),Le(k,S),S&&A(g),Le(T,S),S&&A(O),Le(E,S),S&&A(I),Le(N,S)}}}function Zc(t){let e,l,n,i;const o=[xc,$c],a=[];function c(_,u){return _[1].trying?0:1}return e=c(t),l=a[e]=o[e](t),{c(){l.c(),n=Qt()},m(_,u){a[e].m(_,u),q(_,n,u),i=!0},p(_,u){let f=e;e=c(_),e===f?a[e].p(_,u):(gt(),fe(a[f],1,1,()=>{a[f]=null}),kt(),l=a[e],l?l.p(_,u):(l=a[e]=o[e](_),l.c()),$(l,1),l.m(n.parentNode,n))},i(_){i||($(l),i=!0)},o(_){fe(l),i=!1},d(_){a[e].d(_),_&&A(n)}}}function Jc(t){let e,l;return e=new pl({props:{active:"true",message:"Device is upgrading, please wait"}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p:Xe,i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function $c(t){let e,l;return e=new pl({props:{active:"true",message:"Device is booting, please wait"}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p:Xe,i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function xc(t){let e,l;return e=new pl({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[1].trying}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.message="Device is booting, please wait. Trying to reach it on "+n[1].trying),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function e_(t){let e,l,n,i,o,a;l=new su({props:{basepath:t[0],$$slots:{default:[Xc]},$$scope:{ctx:t}}});const c=[Jc,Zc],_=[];function u(f,p){return f[1].upgrading?0:f[1].booting?1:-1}return~(i=u(t))&&(o=_[i]=c[i](t)),{c(){e=m("div"),Re(l.$$.fragment),n=b(),o&&o.c(),r(e,"class","container mx-auto m-3")},m(f,p){q(f,e,p),De(l,e,null),s(e,n),~i&&_[i].m(e,null),a=!0},p(f,[p]){const d={};p&1&&(d.basepath=f[0]),p&23&&(d.$$scope={dirty:p,ctx:f}),l.$set(d);let v=i;i=u(f),i===v?~i&&_[i].p(f,p):(o&&(gt(),fe(_[v],1,1,()=>{_[v]=null}),kt()),~i?(o=_[i],o?o.p(f,p):(o=_[i]=c[i](f),o.c()),$(o,1),o.m(e,null)):o=null)},i(f){a||($(l.$$.fragment,f),$(o),a=!0)},o(f){fe(l.$$.fragment,f),fe(o),a=!1},d(f){f&&A(e),Le(l),~i&&_[i].d()}}}function t_(t,e,l){let n=document.getElementsByTagName("base")[0].getAttribute("href");n||(n="/");let i={};vl.subscribe(c=>{i=c});let o={};dl.subscribe(c=>{var _;l(1,o=c),o.vndcfg===!1?en(n+"vendor"):o.usrcfg===!1?en(n+"setup"):o.fwconsent===0&&en(n+"consent"),o.ui.k===1?document.documentElement.classList.add("dark"):o.ui.k===0?document.documentElement.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),o.ui.lang&&o.ui.lang!=((_=i==null?void 0:i.language)==null?void 0:_.code)&&ku(o.ui.lang)}),Ji();let a={};return cu.subscribe(c=>{l(2,a=c)}),[n,o,a]}class l_ extends Dt{constructor(e){super(),qt(this,e,t_,e_,Nt,{})}}new l_({target:document.getElementById("app")}); +Occurred in: ${i}`:"",a=Qi(t),r=Hf(e)?e(a):e;return`<${a}> ${r}${o}`}const eu=t=>(...e)=>t(nr(...e)),tu=eu(t=>{throw new Error(t)}),ci=eu(console.warn),gs=4,ir=3,sr=2,or=1,ar=1;function fr(t,e){const l=t.default?0:Ol(t.fullPath).reduce((n,i)=>{let o=n;return o+=gs,Qu(i)?o+=ar:Xu(i)?o+=sr:Qf(i)?o-=gs+or:o+=ir,o},0);return{route:t,score:l,index:e}}function ur(t){return t.map(fr).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function lu(t,e){let l,n;const[i]=e.split("?"),o=Ol(i),a=o[0]==="",r=ur(t);for(let c=0,f=r.length;c({..._,params:d,uri:T});if(_.default){n=v(e);continue}const h=Ol(_.fullPath),k=Math.max(o.length,h.length);let g=0;for(;g{f===".."?c.pop():f!=="."&&c.push(f)}),vi(`/${c.join("/")}`,n)}function ks(t,e){const{pathname:l,hash:n="",search:i="",state:o}=t,a=Ol(e,!0),r=Ol(l,!0);for(;a.length;)a[0]!==r[0]&&tu(tn,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),a.shift(),r.shift();return{pathname:$n(...r),hash:n,search:i,state:o}}const ws=t=>t.length===1?"":t,Xi=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,o=i?ws(yn(t,l)):"",a=i?yn(t,0,l):t,r=n?ws(yn(a,e)):"";return{pathname:(n?yn(a,0,e):a)||"/",search:r,hash:o}},cr=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function _r(t,e,l){return $n(l,rr(t,e))}function mr(t,e){const l=Ki(Zu(t)),n=Ol(l,!0),i=Ol(e,!0).slice(0,n.length),o=nu({fullPath:l},$n(...i));return o&&o.uri}const hi="POP",pr="PUSH",dr="REPLACE";function bi(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function vr(t){let e=[],l=bi(t),n=hi;const i=(o=e)=>o.forEach(a=>a({location:l,action:n}));return{get location(){return l},listen(o){e.push(o);const a=()=>{l=bi(t),n=hi,i([o])};i([o]);const r=Wf(t,"popstate",a);return()=>{r(),e=e.filter(c=>c!==o)}},navigate(o,a){const{state:r={},replace:c=!1}=a||{};if(n=c?dr:pr,yf(o))a&&ci(xf,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=hi,t.history.go(o);else{const f={...r,_key:Gu()};try{t.history[c?"replaceState":"pushState"](f,"",o)}catch{t.location[c?"replace":"assign"](o)}}l=bi(t),i()}}}function gi(t,e){return{...Xi(e),state:t}}function hr(t="/"){let e=0,l=[gi(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(gi(n,o))},replaceState(n,i,o){l[e]=gi(n,o)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const br=!!(!Yl&&window.document&&window.document.createElement),gr=!Yl&&window.location.origin==="null",iu=vr(br&&!gr?window:hr()),{navigate:en}=iu;let Il=null,su=!0;function kr(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nIl.level||t.level===Il.level&&kr(t.routerId,Il.routerId))&&(Il=t)}function Mr(){Il=null}function Sr(){su=!1}function Ms(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=Wf(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function Cr(t,e){return Number(t.dataset.svnavRouteEnd)===e}function Nr(t){return/^H[1-6]$/i.test(t.tagName)}function Ss(t,e=document){return e.querySelector(t)}function Tr(t){let l=Ss(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!Cr(l,t);){if(Nr(l))return l;const n=Ss("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function Er(t){Promise.resolve(un(t.focusElement)).then(e=>{const l=e||Tr(t.id);l||ci(tn,`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,pi),!Ms(l)&&Ms(document.documentElement)})}const Pr=(t,e,l)=>(n,i)=>ju().then(()=>{if(!Il||su){Sr();return}if(n&&Er(Il.route),t.announcements&&i){const{path:o,fullPath:a,meta:r,params:c,uri:f}=Il.route,_=t.createAnnouncement({path:o,fullPath:a,meta:r,params:c,uri:f},un(l));Promise.resolve(_).then(m=>{e.set(m)})}Mr()}),Ar="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 qr(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},Gf(t[6],Ar)],i={};for(let o=0;o`Navigated to ${X.uri}`,announcements:!0,...h},T=_,O=Ki(_),E=Kl(Ci),I=Kl(cn),C=!E,j=Lr(),S=v&&!(I&&!I.manageFocus),U=ll("");Dl(t,U,X=>l(0,r=X));const G=I?I.disableInlineStyles:k,V=ll([]);Dl(t,V,X=>l(20,a=X));const F=ll(null);Dl(t,F,X=>l(18,i=X));let R=!1;const z=C?0:I.level+1,H=C?ll((()=>ks(Yl?Xi(m):d.location,O))()):E;Dl(t,H,X=>l(17,n=X));const W=ll(n);Dl(t,W,X=>l(19,o=X));const K=Pr(g,U,H),Q=X=>J=>J.filter(ae=>ae.id!==X);function Z(X){if(Yl){if(R)return;const J=nu(X,n.pathname);if(J)return R=!0,J}else V.update(J=>{const ae=Q(X.id)(J);return ae.push(X),ae})}function se(X){V.update(Q(X))}return!C&&_!==Cs&&ci(tn,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:_}),C&&(Rf(()=>d.listen(J=>{const ae=ks(J.location,O);W.set(n),H.set(ae)})),Kn(Ci,H)),Kn(cn,{activeRoute:F,registerRoute:Z,unregisterRoute:se,manageFocus:S,level:z,id:j,history:C?d:I.history,basepath:C?O:I.basepath,disableInlineStyles:G}),t.$$set=X=>{"basepath"in X&&l(11,_=X.basepath),"url"in X&&l(12,m=X.url),"history"in X&&l(13,d=X.history),"primary"in X&&l(14,v=X.primary),"a11y"in X&&l(15,h=X.a11y),"disableInlineStyles"in X&&l(16,k=X.disableInlineStyles),"$$scope"in X&&l(21,f=X.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&_!==T&&ci(tn,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const X=lu(a,n.pathname);F.set(X)}if(t.$$.dirty[0]&655360&&C){const X=!!n.hash,J=!X&&S,ae=!X||n.pathname!==o.pathname;K(J,ae)}t.$$.dirty[0]&262144&&S&&i&&i.primary&&wr({level:z,routerId:j,route:i})},[r,g,C,j,S,U,G,V,F,H,W,_,m,d,v,h,k,n,i,o,a,f,c]}class Ir extends qt{constructor(e){super(),At(this,e,Or,Dr,Nt,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const ou=Ir;function xn(t,e,l=cn,n=tn){Kl(l)||tu(t,o=>`You cannot use ${o} outside of a ${Qi(n)}.`,e)}const Rr=t=>{const{subscribe:e}=Kl(t);return{subscribe:e}};function au(){return xn(Zf),Rr(Ci)}function fu(){const{history:t}=Kl(cn);return t}function uu(){const t=Kl(Kf);return t?Vu(t,e=>e.base):ll("/")}function ru(){xn($f);const t=uu(),{basepath:e}=Kl(cn);return n=>_r(n,un(t),e)}function Fr(){xn(Jf);const t=ru(),{navigate:e}=fu();return(n,i)=>{const o=yf(n)?n:t(n);return e(o,i)}}const Br=t=>({params:t&16,location:t&8}),Ns=t=>({params:Yl?un(t[10]):t[4],location:t[3],navigate:t[11]});function Ts(t){let e,l;return e=new ou({props:{primary:t[1],$$slots:{default:[Hr]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(n,i){De(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||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Ur(t){let e;const l=t[18].default,n=yi(l,t,t[19],Ns);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&524312)&&Wi(n,l,i,i[19],e?zi(l,i[19],o,Br):Gi(i[19]),Ns)},i(i){e||($(n,i),e=!0)},o(i){oe(n,i),e=!1},d(i){n&&n.d(i)}}}function jr(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},Yl?un(t[10]):t[4],t[12]];var o=t[0];function a(r){let c={};for(let f=0;f{Le(_,1)}),kt()}o?(e=ds(o,a()),Re(e.$$.fragment),$(e.$$.fragment,1),De(e,l.parentNode,l)):e=null}else o&&e.$set(f)},i(r){n||(e&&$(e.$$.fragment,r),n=!0)},o(r){e&&oe(e.$$.fragment,r),n=!1},d(r){r&&A(l),e&&Le(e,r)}}}function Hr(t){let e,l,n,i;const o=[jr,Ur],a=[];function r(c,f){return c[0]!==null?0:1}return e=r(t),l=a[e]=o[e](t),{c(){l.c(),n=Jt()},m(c,f){a[e].m(c,f),q(c,n,f),i=!0},p(c,f){let _=e;e=r(c),e===_?a[e].p(c,f):(gt(),oe(a[_],1,1,()=>{a[_]=null}),kt(),l=a[e],l?l.p(c,f):(l=a[e]=o[e](c),l.c()),$(l,1),l.m(n.parentNode,n))},i(c){i||($(l),i=!0)},o(c){oe(l),i=!1},d(c){a[e].d(c),c&&A(n)}}}function yr(t){let e,l,n,i,o,a=[Si(t[7]),{"data-svnav-route-start":t[5]}],r={};for(let m=0;m{c=null}),kt())},i(m){o||($(c),o=!0)},o(m){oe(c),o=!1},d(m){m&&A(e),m&&A(l),c&&c.d(m),m&&A(n),m&&A(i)}}}const zr=zf();function Wr(t,e,l){let n;const i=["path","component","meta","primary"];let o=ui(e,i),a,r,c,f,{$$slots:_={},$$scope:m}=e,{path:d=""}=e,{component:v=null}=e,{meta:h={}}=e,{primary:k=!0}=e;xn(pi,e);const g=zr(),{registerRoute:T,unregisterRoute:O,activeRoute:E,disableInlineStyles:I}=Kl(cn);Dl(t,E,R=>l(16,a=R));const C=uu();Dl(t,C,R=>l(17,c=R));const j=au();Dl(t,j,R=>l(3,r=R));const S=ll(null);let U;const G=ll(),V=ll({});Dl(t,V,R=>l(4,f=R)),Kn(Kf,G),Kn(Ku,V),Kn(Yu,S);const F=Fr();return Yl||Bu(()=>O(g)),t.$$set=R=>{l(24,e=Al(Al({},e),fi(R))),l(12,o=ui(e,i)),"path"in R&&l(13,d=R.path),"component"in R&&l(0,v=R.component),"meta"in R&&l(14,h=R.meta),"primary"in R&&l(1,k=R.primary),"$$scope"in R&&l(19,m=R.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const R=d==="",z=$n(c,d),B={id:g,path:d,meta:h,default:R,fullPath:R?"":z,base:R?c:mr(z,r.pathname),primary:k,focusElement:S};G.set(B),l(15,U=T(B))}if(t.$$.dirty&98304&&l(2,n=!!(U||a&&a.id===g)),t.$$.dirty&98308&&n){const{params:R}=U||a;V.set(R)}},e=fi(e),[v,k,n,r,f,g,E,I,C,j,V,F,o,d,h,U,a,c,_,m]}class Gr extends qt{constructor(e){super(),At(this,e,Wr,yr,Nt,{path:13,component:0,meta:14,primary:1})}}const ql=Gr;function Vr(t){let e,l,n,i;const o=t[13].default,a=yi(o,t,t[12],null);let r=[{href:t[0]},t[2],t[1]],c={};for(let f=0;fl(11,m=S));const E=Uu(),I=ru(),{navigate:C}=fu();function j(S){E("click",S),Wu(S)&&(S.preventDefault(),C(n,{state:g,replace:a||k}))}return t.$$set=S=>{l(19,e=Al(Al({},e),fi(S))),l(18,_=ui(e,f)),"to"in S&&l(5,h=S.to),"replace"in S&&l(6,k=S.replace),"state"in S&&l(7,g=S.state),"getProps"in S&&l(8,T=S.getProps),"$$scope"in S&&l(12,v=S.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=I(h,m)),t.$$.dirty&2049&&l(10,i=Ni(m.pathname,n)),t.$$.dirty&2049&&l(9,o=n===m.pathname),t.$$.dirty&2049&&(a=Xi(n)===cr(m)),t.$$.dirty&512&&l(2,r=o?{"aria-current":"page"}:{}),l(1,c=(()=>{if(Hf(T)){const S=T({location:m,href:n,isPartiallyCurrent:i,isCurrent:o});return{..._,...S}}return _})())},e=fi(e),[n,c,r,O,j,h,k,g,T,o,i,m,v,d]}class Yr extends qt{constructor(e){super(),At(this,e,Kr,Vr,Nt,{to:5,replace:6,state:7,getProps:8})}}const Ml=Yr;function Vl(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function Qr(t,e){return t>218&&t<242?"#23ac05":t>212&&t<248?"#b1d900":t>208&&t<252?"#a3b200":"#b20000"}function Zi(t,e){let l;return t>90?l="#b20000":t>85?l="#b19601":t>80?l="#a3b200":t>75?l="#569f12":l="#23ac05",l}function Qn(t){return t>75?"#23ac05":t>50?"#77d900":t>25?"#94d900":"#569f12"}function _i(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 It(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function lt(t,e){switch(e){case 5:switch(t){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(t){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 241:return"LilyGO T-ETH-POE";case 242:return"M5 PoESP32";case 243:return"WT32-ETH01";case 200:return"Generic ESP32";case 2:return"HAN Reader 2.0 by Max Spencer";case 0:return"Custom hardware by Roar Fredriksen";case 1:return"Kamstrup module by Egil Opsahl";case 8:return"\xB5HAN mosquito by dbeinder";case 3:return"Pow-K (UART0)";case 4:return"Pow-U (UART0)";case 101:return"Wemos D1 mini";case 100:return"Generic ESP8266";case 70:return"Generic ESP32-C3";case 71:return"ESP32-C3-DevKitM-1";case 80:return"Generic ESP32-S3"}return"Unknown"}function fn(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Yt(t,e){return t==1||t==2&&e}function kl(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function Zt(t,e){return isNaN(t)?"-":(isNaN(e)&&(e=t<1?2:t<10?1:0),t.toFixed(e))}function Ll(t,e){return t.setTime(t.getTime()+e*36e5),t}function Es(t){return t=="EOE"?"ENTSO-E":t=="HKS"?"hvakosterstrommen.no":t=="EDS"?"Energi Data Service":t=="MIX"?"Mixed sources":"Unknown ("+t+")"}function Ps(t){return t=="EOE"?"https://transparency.entsoe.eu/-E":t=="HKS"?"https://www.hvakosterstrommen.no/":t=="EDS"?"https://www.energidataservice.dk/":"#"}let li=0;function Xn(t,e){var l="";li++;var n=function(){setTimeout(Xn,1e3,t,e)};if(t.net.ip&&li%3==0){if(!t.net.ip){n();return}l="http://"+t.net.ip}else t.hostname&&li%3==1?l="http://"+t.hostname:t.hostname&&li%3==2?l="http://"+t.hostname+".local":l="";console&&console.log("Trying url "+l),e&&e(l);var i=new XMLHttpRequest;i.timeout=5e3,i.addEventListener("abort",n),i.addEventListener("error",n),i.addEventListener("timeout",n),i.addEventListener("load",function(o){window.location.href=l||"/"}),i.open("GET",l+"/is-alive",!0),i.send()}function $t(t){return t.charAt(0).toUpperCase()+t.slice(1)}function As(t){return t.startsWith("esp32")?"esp32":t}function cl(t,e){let l=[t,e];return typeof t>"u"?(l[0]="-",l[1]=e):t>=1e9?(l[0]=(t/1e6).toFixed(t>1e10?0:1),l[1]="M"+e):t>1e4?(l[0]=(t/1e3).toFixed(t>1e6?0:t>1e5?1:2),l[1]="k"+e):(l[0]=t.toFixed(0),l[1]=e),l}let oi={},Ti=[];async function Xr(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 ki;async function cu(){if(Ti.length){let t=Ti.shift();delete oi[t.resource];try{let e=await Xr(t.resource,t.options);for(let l in t.callbacks)t.callbacks[l](e.clone())}catch(e){console.error("Error calling "+t.resource,e);for(let l in t.callbacks)t.callbacks[l]()}}ki&&clearTimeout(ki),ki=setTimeout(cu,100)}cu();async function Sl(t,e={}){let l;return oi[t]?l=oi[t]:(l={resource:t,options:e,callbacks:[]},oi[t]=l,Ti.push(l)),new Promise(i=>l.callbacks.push(i))}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,if:{eth:!1}};const ml=ll(Pl);async function Ji(){Pl=await(await Sl("sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),ml.set(Pl)}function Zr(t){ml.update(e=>(e.trying=t,e))}let ni=0,qs=-127,Ds=null,Jr={};const _u=Vf(Jr,t=>{let e,l;async function n(){Sl("data.json").then(i=>i.json()).then(i=>{t(i),qs!=i.t&&(qs=i.t,setTimeout(hu,2e3)),Ds==null&&i.pe&&i.p!=null&&(Ds=i.p,pu()),Pl.upgrading?window.location.reload():(!Pl||!Pl.chip||Pl.booting||ni>1&&!fn(Pl.board))&&(Ji(),Zl&&clearTimeout(Zl),Zl=setTimeout(xi,2e3),Jl&&clearTimeout(Jl),Jl=setTimeout(es,3e3));let o=5e3;if(fn(Pl.board)&&i.v>2.5){let a=3.3-Math.min(3.3,i.v);a>0&&(o=Math.max(a,.1)*10*5e3)}o>5e3&&console.log("Next in "+o+"ms"),e&&clearTimeout(e),e=setTimeout(n,o),ni=0}).catch(i=>{ni++,ni>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(n,15e3),l||(l=setTimeout(Xn,5e3,Pl,Zr))):e=setTimeout(n,fn(Pl.board)?1e4:5e3)})}return n(),function(){clearTimeout(e)}});let Ei={},zn;const $i=ll(Ei);async function mu(){let t=!1;if($i.update(e=>{for(var l=0;l<36;l++){if(e[It(l)]==null){t=l<12;break}e[It(l)]=e[It(l+1)]}return e}),t)pu();else{let e=new Date;zn=setTimeout(mu,(60-e.getMinutes())*6e4)}}async function pu(){zn&&(clearTimeout(zn),zn=0),Ei=await(await Sl("energyprice.json")).json(),$i.set(Ei);let e=new Date;zn=setTimeout(mu,(60-e.getMinutes())*6e4)}let Pi={},Zl;async function xi(){Zl&&(clearTimeout(Zl),Zl=0),Pi=await(await Sl("dayplot.json")).json(),du.set(Pi);let e=new Date;Zl=setTimeout(xi,(60-e.getMinutes())*6e4+20)}const du=ll(Pi,t=>(xi(),function(){}));let Ai={},Jl;async function es(){Jl&&(clearTimeout(Jl),Jl=0),Ai=await(await Sl("monthplot.json")).json(),vu.set(Ai);let e=new Date;Jl=setTimeout(es,(24-e.getHours())*36e5+40)}const vu=ll(Ai,t=>(es(),function(){}));let qi={};async function hu(){qi=await(await Sl("temperature.json")).json(),bu.set(qi)}const bu=ll(qi,t=>(hu(),function(){}));let Di={},ii;async function gu(){ii&&(clearTimeout(ii),ii=0),Di=await(await Sl("tariff.json")).json(),ku.set(Di);let e=new Date;ii=setTimeout(gu,(60-e.getMinutes())*6e4+30)}const ku=ll(Di,t=>function(){});let Li=[];const ts=ll(Li);async function $r(){Li=await(await Sl("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),ts.set(Li)}let Ql=0,xr={data:[]};async function Oi(){let e=await(await Sl(Ql<0?"realtime.json":"realtime.json?offset="+Ql)).json();Ii.update(l=>{for(let n=0;n=0&&(Ql+=e.size,Qlo&&(r=m):k==i+1&&(c=m);else if(h==n+1)if(f){let T=f.tag_name.substring(1).split(".");parseInt(T[0]);let O=parseInt(T[1]);parseInt(T[2]),k==O&&(f=m)}else f=m}return c||f||r||!1}else return e[0]}function Ls(t){var c,f;let e=((f=(c=t[1].header)==null?void 0:c.uptime)!=null?f:"Up")+"",l,n,i;function o(_,m){return _[2]>1?a1:_[2]>0?o1:_[3]>1?s1:_[3]>0?i1:_[4]>1?n1:_[4]>0?l1:t1}let a=o(t),r=a(t);return{c(){l=M(e),n=b(),r.c(),i=Jt()},m(_,m){q(_,l,m),q(_,n,m),r.m(_,m),q(_,i,m)},p(_,m){var d,v;m&2&&e!==(e=((v=(d=_[1].header)==null?void 0:d.uptime)!=null?v:"Up")+"")&&L(l,e),a===(a=o(_))&&r?r.p(_,m):(r.d(1),r=a(_),r&&(r.c(),r.m(i.parentNode,i)))},d(_){_&&A(l),_&&A(n),r.d(_),_&&A(i)}}}function t1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.seconds)!=null?a:"s")+"",i;return{c(){e=M(t[0]),l=b(),i=M(n)},m(r,c){q(r,e,c),q(r,l,c),q(r,i,c)},p(r,c){var f,_;c&1&&L(e,r[0]),c&2&&n!==(n=((_=(f=r[1].common)==null?void 0:f.seconds)!=null?_:"s")+"")&&L(i,n)},d(r){r&&A(e),r&&A(l),r&&A(i)}}}function l1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.minute)!=null?a:"m")+"",i;return{c(){e=M(t[4]),l=b(),i=M(n)},m(r,c){q(r,e,c),q(r,l,c),q(r,i,c)},p(r,c){var f,_;c&16&&L(e,r[4]),c&2&&n!==(n=((_=(f=r[1].common)==null?void 0:f.minute)!=null?_:"m")+"")&&L(i,n)},d(r){r&&A(e),r&&A(l),r&&A(i)}}}function n1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.minutes)!=null?a:"m")+"",i;return{c(){e=M(t[4]),l=b(),i=M(n)},m(r,c){q(r,e,c),q(r,l,c),q(r,i,c)},p(r,c){var f,_;c&16&&L(e,r[4]),c&2&&n!==(n=((_=(f=r[1].common)==null?void 0:f.minutes)!=null?_:"m")+"")&&L(i,n)},d(r){r&&A(e),r&&A(l),r&&A(i)}}}function i1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.hour)!=null?a:"h")+"",i;return{c(){e=M(t[3]),l=b(),i=M(n)},m(r,c){q(r,e,c),q(r,l,c),q(r,i,c)},p(r,c){var f,_;c&8&&L(e,r[3]),c&2&&n!==(n=((_=(f=r[1].common)==null?void 0:f.hour)!=null?_:"h")+"")&&L(i,n)},d(r){r&&A(e),r&&A(l),r&&A(i)}}}function s1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.hours)!=null?a:"h")+"",i;return{c(){e=M(t[3]),l=b(),i=M(n)},m(r,c){q(r,e,c),q(r,l,c),q(r,i,c)},p(r,c){var f,_;c&8&&L(e,r[3]),c&2&&n!==(n=((_=(f=r[1].common)==null?void 0:f.hours)!=null?_:"h")+"")&&L(i,n)},d(r){r&&A(e),r&&A(l),r&&A(i)}}}function o1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.day)!=null?a:"d")+"",i;return{c(){e=M(t[2]),l=b(),i=M(n)},m(r,c){q(r,e,c),q(r,l,c),q(r,i,c)},p(r,c){var f,_;c&4&&L(e,r[2]),c&2&&n!==(n=((_=(f=r[1].common)==null?void 0:f.day)!=null?_:"d")+"")&&L(i,n)},d(r){r&&A(e),r&&A(l),r&&A(i)}}}function a1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.days)!=null?a:"d")+"",i;return{c(){e=M(t[2]),l=b(),i=M(n)},m(r,c){q(r,e,c),q(r,l,c),q(r,i,c)},p(r,c){var f,_;c&4&&L(e,r[2]),c&2&&n!==(n=((_=(f=r[1].common)==null?void 0:f.days)!=null?_:"d")+"")&&L(i,n)},d(r){r&&A(e),r&&A(l),r&&A(i)}}}function f1(t){let e,l=t[0]&&Ls(t);return{c(){l&&l.c(),e=Jt()},m(n,i){l&&l.m(n,i),q(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Ls(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Ze,o:Ze,d(n){l&&l.d(n),n&&A(e)}}}function u1(t,e,l){let{epoch:n}=e,i={};pl.subscribe(c=>{l(1,i=c)});let o=0,a=0,r=0;return t.$$set=c=>{"epoch"in c&&l(0,n=c.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(2,o=Math.floor(n/86400)),l(3,a=Math.floor(n/3600)),l(4,r=Math.floor(n/60)))},[n,i,o,a,r]}class r1 extends qt{constructor(e){super(),At(this,e,u1,f1,Nt,{epoch:0})}}function c1(t){let e,l,n;return{c(){e=p("span"),l=M(t[2]),u(e,"title",t[1]),u(e,"class",n="bd-"+t[0])},m(i,o){q(i,e,o),s(e,l)},p(i,[o]){o&4&&L(l,i[2]),o&2&&u(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&u(e,"class",n)},i:Ze,o:Ze,d(i){i&&A(e)}}}function _1(t,e,l){let{color:n}=e,{title:i}=e,{text:o}=e;return t.$$set=a=>{"color"in a&&l(0,n=a.color),"title"in a&&l(1,i=a.title),"text"in a&&l(2,o=a.text)},[n,i,o]}class $l extends qt{constructor(e){super(),At(this,e,_1,c1,Nt,{color:0,title:1,text:2})}}function m1(t){let e,l=`${It(t[0].getDate())}.${It(t[0].getMonth()+1)}.${t[0].getFullYear()} ${It(t[0].getHours())}:${It(t[0].getMinutes())}`,n;return{c(){e=p("span"),n=M(l),u(e,"class",t[1])},m(i,o){q(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${It(i[0].getDate())}.${It(i[0].getMonth()+1)}.${i[0].getFullYear()} ${It(i[0].getHours())}:${It(i[0].getMinutes())}`)&&L(n,l),o&2&&u(e,"class",i[1])},d(i){i&&A(e)}}}function p1(t){var n;let e=`${It(t[0].getDate())}. ${t[2].months?(n=t[2].months)==null?void 0:n[t[0].getMonth()]:It(t[0].getMonth())} ${It(t[0].getHours())}:${It(t[0].getMinutes())}`,l;return{c(){l=M(e)},m(i,o){q(i,l,o)},p(i,o){var a;o&5&&e!==(e=`${It(i[0].getDate())}. ${i[2].months?(a=i[2].months)==null?void 0:a[i[0].getMonth()]:It(i[0].getMonth())} ${It(i[0].getHours())}:${It(i[0].getMinutes())}`)&&L(l,e)},d(i){i&&A(l)}}}function d1(t){let e;function l(o,a){return o[3]?p1:m1}let n=l(t),i=n(t);return{c(){i.c(),e=Jt()},m(o,a){i.m(o,a),q(o,e,a)},p(o,[a]){n===(n=l(o))&&i?i.p(o,a):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:Ze,o:Ze,d(o){i.d(o),o&&A(e)}}}function v1(t,e,l){let n={};pl.subscribe(c=>{l(2,n=c)});let{timestamp:i}=e,{fullTimeColor:o}=e,{offset:a}=e,r;return t.$$set=c=>{"timestamp"in c&&l(0,i=c.timestamp),"fullTimeColor"in c&&l(1,o=c.fullTimeColor),"offset"in c&&l(4,a=c.offset)},t.$$.update=()=>{t.$$.dirty&17&&(l(3,r=Math.abs(new Date().getTime()-i.getTime())<3e5),isNaN(a)||Ll(i,a-(24+i.getHours()-i.getUTCHours())%24))},[i,o,n,r,a]}class Cu extends qt{constructor(e){super(),At(this,e,v1,d1,Nt,{timestamp:0,fullTimeColor:1,offset:4})}}function h1(t){let e,l,n;return{c(){e=Rt("svg"),l=Rt("path"),n=Rt("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(l,"d","M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z"),u(n,"stroke-linecap","round"),u(n,"stroke-linejoin","round"),u(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(i,o){q(i,e,o),s(e,l),s(e,n)},p:Ze,i:Ze,o:Ze,d(i){i&&A(e)}}}class b1 extends qt{constructor(e){super(),At(this,e,null,h1,Nt,{})}}function g1(t){let e,l;return{c(){e=Rt("svg"),l=Rt("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(l,"d","M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(n,i){q(n,e,i),s(e,l)},p:Ze,i:Ze,o:Ze,d(n){n&&A(e)}}}class k1 extends qt{constructor(e){super(),At(this,e,null,g1,Nt,{})}}function w1(t){let e,l;return{c(){e=Rt("svg"),l=Rt("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(l,"d","M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(n,i){q(n,e,i),s(e,l)},p:Ze,i:Ze,o:Ze,d(n){n&&A(e)}}}class M1 extends qt{constructor(e){super(),At(this,e,null,w1,Nt,{})}}function S1(t){let e,l,n=t[2].version+"",i;return{c(){e=M("AMS reader "),l=p("span"),i=M(n)},m(o,a){q(o,e,a),q(o,l,a),s(l,i)},p(o,a){a&4&&n!==(n=o[2].version+"")&&L(i,n)},d(o){o&&A(e),o&&A(l)}}}function Os(t){let e,l=(t[1].t>-50?t[1].t.toFixed(1):"-")+"",n,i;return{c(){e=p("div"),n=M(l),i=M("\xB0C"),u(e,"class","flex-none my-auto")},m(o,a){q(o,e,a),s(e,n),s(e,i)},p(o,a){a&2&&l!==(l=(o[1].t>-50?o[1].t.toFixed(1):"-")+"")&&L(n,l)},d(o){o&&A(e)}}}function Is(t){var i,o,a,r,c;let e,l=((o=(i=t[4].header)==null?void 0:i.han)!=null?o:"HAN")+": "+((c=(r=(a=t[4].errors)==null?void 0:a.han)==null?void 0:r[t[1].he])!=null?c:t[1].he),n;return{c(){e=p("div"),n=M(l),u(e,"class","bd-red")},m(f,_){q(f,e,_),s(e,n)},p(f,_){var m,d,v,h,k;_&18&&l!==(l=((d=(m=f[4].header)==null?void 0:m.han)!=null?d:"HAN")+": "+((k=(h=(v=f[4].errors)==null?void 0:v.han)==null?void 0:h[f[1].he])!=null?k:f[1].he))&&L(n,l)},d(f){f&&A(e)}}}function Rs(t){var i,o,a,r,c;let e,l=((o=(i=t[4].header)==null?void 0:i.mqtt)!=null?o:"MQTT")+": "+((c=(r=(a=t[4].errors)==null?void 0:a.mqtt)==null?void 0:r[t[1].me])!=null?c:t[1].me),n;return{c(){e=p("div"),n=M(l),u(e,"class","bd-red")},m(f,_){q(f,e,_),s(e,n)},p(f,_){var m,d,v,h,k;_&18&&l!==(l=((d=(m=f[4].header)==null?void 0:m.mqtt)!=null?d:"MQTT")+": "+((k=(h=(v=f[4].errors)==null?void 0:v.mqtt)==null?void 0:h[f[1].me])!=null?k:f[1].me))&&L(n,l)},d(f){f&&A(e)}}}function Fs(t){var i,o,a,r,c;let e,l=((o=(i=t[4].header)==null?void 0:i.price)!=null?o:"PS")+": "+((c=(r=(a=t[4].errors)==null?void 0:a.price)==null?void 0:r[t[1].ee])!=null?c:t[1].ee),n;return{c(){e=p("div"),n=M(l),u(e,"class","bd-red")},m(f,_){q(f,e,_),s(e,n)},p(f,_){var m,d,v,h,k;_&18&&l!==(l=((d=(m=f[4].header)==null?void 0:m.price)!=null?d:"PS")+": "+((k=(h=(v=f[4].errors)==null?void 0:v.price)==null?void 0:h[f[1].ee])!=null?k:f[1].ee))&&L(n,l)},d(f){f&&A(e)}}}function Bs(t){let e,l,n,i,o,a,r,c;return l=new Ml({props:{to:"/configuration",$$slots:{default:[C1]},$$scope:{ctx:t}}}),a=new Ml({props:{to:"/status",$$slots:{default:[N1]},$$scope:{ctx:t}}}),{c(){var f,_,m,d;e=p("div"),Re(l.$$.fragment),i=b(),o=p("div"),Re(a.$$.fragment),u(e,"class","flex-none px-1 mt-1"),u(e,"title",n=(_=(f=t[4].header)==null?void 0:f.config)!=null?_:""),u(o,"class","flex-none px-1 mt-1"),u(o,"title",r=(d=(m=t[4].header)==null?void 0:m.status)!=null?d:"")},m(f,_){q(f,e,_),De(l,e,null),q(f,i,_),q(f,o,_),De(a,o,null),c=!0},p(f,_){var v,h,k,g;const m={};_&64&&(m.$$scope={dirty:_,ctx:f}),l.$set(m),(!c||_&16&&n!==(n=(h=(v=f[4].header)==null?void 0:v.config)!=null?h:""))&&u(e,"title",n);const d={};_&64&&(d.$$scope={dirty:_,ctx:f}),a.$set(d),(!c||_&16&&r!==(r=(g=(k=f[4].header)==null?void 0:k.status)!=null?g:""))&&u(o,"title",r)},i(f){c||($(l.$$.fragment,f),$(a.$$.fragment,f),c=!0)},o(f){oe(l.$$.fragment,f),oe(a.$$.fragment,f),c=!1},d(f){f&&A(e),Le(l),f&&A(i),f&&A(o),Le(a)}}}function C1(t){let e,l;return e=new b1({}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function N1(t){let e,l;return e=new k1({}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Us(t){let e,l;function n(a,r){return a[2].security==0||a[1].a?E1:T1}let i=n(t),o=i(t);return{c(){var a,r;e=p("div"),o.c(),u(e,"class","flex-none mr-3 text-yellow-500"),u(e,"title",l=((r=(a=t[4].header)==null?void 0:a.new_version)!=null?r:"New version")+": "+t[3].tag_name)},m(a,r){q(a,e,r),o.m(e,null)},p(a,r){var c,f;i===(i=n(a))&&o?o.p(a,r):(o.d(1),o=i(a),o&&(o.c(),o.m(e,null))),r&24&&l!==(l=((f=(c=a[4].header)==null?void 0:c.new_version)!=null?f:"New version")+": "+a[3].tag_name)&&u(e,"title",l)},d(a){a&&A(e),o.d()}}}function T1(t){var r,c;let e,l=((c=(r=t[4].header)==null?void 0:r.new_version)!=null?c:"New version")+"",n,i,o=t[3].tag_name+"",a;return{c(){e=p("span"),n=M(l),i=M(": "),a=M(o)},m(f,_){q(f,e,_),s(e,n),s(e,i),s(e,a)},p(f,_){var m,d;_&16&&l!==(l=((d=(m=f[4].header)==null?void 0:m.new_version)!=null?d:"New version")+"")&&L(n,l),_&8&&o!==(o=f[3].tag_name+"")&&L(a,o)},d(f){f&&A(e)}}}function E1(t){var _,m;let e,l,n=((m=(_=t[4].header)==null?void 0:_.new_version)!=null?m:"New version")+"",i,o,a=t[3].tag_name+"",r,c,f;return{c(){e=p("button"),l=p("span"),i=M(n),o=M(": "),r=M(a),u(l,"class","mt-1"),u(e,"class","flex")},m(d,v){q(d,e,v),s(e,l),s(l,i),s(l,o),s(l,r),c||(f=ve(e,"click",t[5]),c=!0)},p(d,v){var h,k;v&16&&n!==(n=((k=(h=d[4].header)==null?void 0:h.new_version)!=null?k:"New version")+"")&&L(i,n),v&8&&a!==(a=d[3].tag_name+"")&&L(r,a)},d(d){d&&A(e),c=!1,f()}}}function P1(t){var ee,te,ie,_e,Ne,Me,pe,Ce,we,ge,be,ye,je,Ke,xe,et,Je,nt,We,Oe;let e,l,n,i,o,a,r,c,f,_,m,d=((te=(ee=t[4].header)==null?void 0:ee.mem)!=null?te:"Free")+"",v,h,k=(t[1].m?(t[1].m/1e3).toFixed(1):"-")+"",g,T,O,E,I,C,j,S,U,G,V,F,R,z,B,H,W,K,Q,Z,se,X,J,ae,le,ne,fe,ue,Y,x,ke;i=new Ml({props:{to:"/",$$slots:{default:[S1]},$$scope:{ctx:t}}}),c=new r1({props:{epoch:t[1].u}});let me=t[1].t>-50&&Os(t);I=new $l({props:{title:(_e=(ie=t[4].header)==null?void 0:ie.esp)!=null?_e:"ESP",text:t[2].booting?(Me=(Ne=t[4].header)==null?void 0:Ne.booting)!=null?Me:"Booting":t[1].v>2?t[1].v.toFixed(2)+"V":(Ce=(pe=t[4].header)==null?void 0:pe.esp)!=null?Ce:"ESP",color:Vl(t[2].booting?2:t[1].em)}}),j=new $l({props:{title:(ge=(we=t[4].header)==null?void 0:we.han)!=null?ge:"HAN",text:(ye=(be=t[4].header)==null?void 0:be.han)!=null?ye:"HAN",color:Vl(t[2].booting?9:t[1].hm)}}),U=new $l({props:{title:(Ke=(je=t[4].header)==null?void 0:je.wifi)!=null?Ke:"WiFi",text:t[1].r?t[1].r.toFixed(0)+"dBm":(et=(xe=t[4].header)==null?void 0:xe.wifi)!=null?et:"WiFi",color:Vl(t[2].booting?9:t[1].wm)}}),V=new $l({props:{title:(nt=(Je=t[4].header)==null?void 0:Je.mqtt)!=null?nt:"MQTT",text:(Oe=(We=t[4].header)==null?void 0:We.mqtt)!=null?Oe:"MQTT",color:Vl(t[2].booting?9:t[1].mm)}});let N=(t[1].he<0||t[1].he>0)&&Is(t),w=t[1].me<0&&Rs(t),P=(t[1].ee>0||t[1].ee<0)&&Fs(t);J=new Cu({props:{timestamp:t[1].c?new Date(t[1].c*1e3):new Date(0),offset:t[2].clock_offset,fullTimeColor:"text-red-500"}});let D=t[2].vndcfg&&t[2].usrcfg&&Bs(t);ue=new M1({});let y=t[2].fwconsent===1&&t[3]&&Us(t);return{c(){var ce,Ee;e=p("nav"),l=p("div"),n=p("div"),Re(i.$$.fragment),o=b(),a=p("div"),r=p("div"),Re(c.$$.fragment),f=b(),me&&me.c(),_=b(),m=p("div"),v=M(d),h=M(": "),g=M(k),T=M("kb"),O=b(),E=p("div"),Re(I.$$.fragment),C=b(),Re(j.$$.fragment),S=b(),Re(U.$$.fragment),G=b(),Re(V.$$.fragment),F=b(),N&&N.c(),R=b(),w&&w.c(),z=b(),P&&P.c(),B=b(),H=p("div"),W=p("div"),K=p("a"),Q=p("img"),se=b(),X=p("div"),Re(J.$$.fragment),ae=b(),D&&D.c(),le=b(),ne=p("div"),fe=p("a"),Re(ue.$$.fragment),x=b(),y&&y.c(),u(n,"class","flex text-lg text-gray-100 p-2"),u(r,"class","flex-none my-auto"),u(m,"class","flex-none my-auto"),u(a,"class","flex-none my-auto p-2 flex space-x-4"),u(E,"class","flex-auto flex-wrap my-auto justify-center p-2"),u(Q,"class","logo"),ai(Q.src,Z=(t[0]+"/logo.svg").replace("//","/"))||u(Q,"src",Z),u(Q,"alt","GitHub repo"),u(K,"class","float-right"),u(K,"href","https://github.com/UtilitechAS/amsreader-firmware"),u(K,"target","_blank"),u(K,"rel","noreferrer"),u(K,"aria-label","GitHub"),u(W,"class","flex-none"),u(X,"class","flex-none my-auto px-2"),u(fe,"href",kl("")),u(fe,"target","_blank"),u(fe,"rel","noreferrer"),u(ne,"class","flex-none px-1 mt-1"),u(ne,"title",Y=(Ee=(ce=t[4].header)==null?void 0:ce.doc)!=null?Ee:""),u(H,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),u(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),u(e,"class","hdr")},m(ce,Ee){q(ce,e,Ee),s(e,l),s(l,n),De(i,n,null),s(l,o),s(l,a),s(a,r),De(c,r,null),s(a,f),me&&me.m(a,null),s(a,_),s(a,m),s(m,v),s(m,h),s(m,g),s(m,T),s(l,O),s(l,E),De(I,E,null),s(E,C),De(j,E,null),s(E,S),De(U,E,null),s(E,G),De(V,E,null),s(l,F),N&&N.m(l,null),s(l,R),w&&w.m(l,null),s(l,z),P&&P.m(l,null),s(l,B),s(l,H),s(H,W),s(W,K),s(K,Q),s(H,se),s(H,X),De(J,X,null),s(H,ae),D&&D.m(H,null),s(H,le),s(H,ne),s(ne,fe),De(ue,fe,null),s(H,x),y&&y.m(H,null),ke=!0},p(ce,[Ee]){var vt,Mt,he,re,Fe,Tt,Se,Ae,dt,ut,rt,ct,Et,Lt,St,Pt,Ot,Ht,Ct,ht,Dt,Ft;const tt={};Ee&68&&(tt.$$scope={dirty:Ee,ctx:ce}),i.$set(tt);const $e={};Ee&2&&($e.epoch=ce[1].u),c.$set($e),ce[1].t>-50?me?me.p(ce,Ee):(me=Os(ce),me.c(),me.m(a,_)):me&&(me.d(1),me=null),(!ke||Ee&16)&&d!==(d=((Mt=(vt=ce[4].header)==null?void 0:vt.mem)!=null?Mt:"Free")+"")&&L(v,d),(!ke||Ee&2)&&k!==(k=(ce[1].m?(ce[1].m/1e3).toFixed(1):"-")+"")&&L(g,k);const pt={};Ee&16&&(pt.title=(re=(he=ce[4].header)==null?void 0:he.esp)!=null?re:"ESP"),Ee&22&&(pt.text=ce[2].booting?(Tt=(Fe=ce[4].header)==null?void 0:Fe.booting)!=null?Tt:"Booting":ce[1].v>2?ce[1].v.toFixed(2)+"V":(Ae=(Se=ce[4].header)==null?void 0:Se.esp)!=null?Ae:"ESP"),Ee&6&&(pt.color=Vl(ce[2].booting?2:ce[1].em)),I.$set(pt);const Ge={};Ee&16&&(Ge.title=(ut=(dt=ce[4].header)==null?void 0:dt.han)!=null?ut:"HAN"),Ee&16&&(Ge.text=(ct=(rt=ce[4].header)==null?void 0:rt.han)!=null?ct:"HAN"),Ee&6&&(Ge.color=Vl(ce[2].booting?9:ce[1].hm)),j.$set(Ge);const Ye={};Ee&16&&(Ye.title=(Lt=(Et=ce[4].header)==null?void 0:Et.wifi)!=null?Lt:"WiFi"),Ee&18&&(Ye.text=ce[1].r?ce[1].r.toFixed(0)+"dBm":(Pt=(St=ce[4].header)==null?void 0:St.wifi)!=null?Pt:"WiFi"),Ee&6&&(Ye.color=Vl(ce[2].booting?9:ce[1].wm)),U.$set(Ye);const Ve={};Ee&16&&(Ve.title=(Ht=(Ot=ce[4].header)==null?void 0:Ot.mqtt)!=null?Ht:"MQTT"),Ee&16&&(Ve.text=(ht=(Ct=ce[4].header)==null?void 0:Ct.mqtt)!=null?ht:"MQTT"),Ee&6&&(Ve.color=Vl(ce[2].booting?9:ce[1].mm)),V.$set(Ve),ce[1].he<0||ce[1].he>0?N?N.p(ce,Ee):(N=Is(ce),N.c(),N.m(l,R)):N&&(N.d(1),N=null),ce[1].me<0?w?w.p(ce,Ee):(w=Rs(ce),w.c(),w.m(l,z)):w&&(w.d(1),w=null),ce[1].ee>0||ce[1].ee<0?P?P.p(ce,Ee):(P=Fs(ce),P.c(),P.m(l,B)):P&&(P.d(1),P=null),(!ke||Ee&1&&!ai(Q.src,Z=(ce[0]+"/logo.svg").replace("//","/")))&&u(Q,"src",Z);const it={};Ee&2&&(it.timestamp=ce[1].c?new Date(ce[1].c*1e3):new Date(0)),Ee&4&&(it.offset=ce[2].clock_offset),J.$set(it),ce[2].vndcfg&&ce[2].usrcfg?D?(D.p(ce,Ee),Ee&4&&$(D,1)):(D=Bs(ce),D.c(),$(D,1),D.m(H,le)):D&&(gt(),oe(D,1,1,()=>{D=null}),kt()),(!ke||Ee&16&&Y!==(Y=(Ft=(Dt=ce[4].header)==null?void 0:Dt.doc)!=null?Ft:""))&&u(ne,"title",Y),ce[2].fwconsent===1&&ce[3]?y?y.p(ce,Ee):(y=Us(ce),y.c(),y.m(H,null)):y&&(y.d(1),y=null)},i(ce){ke||($(i.$$.fragment,ce),$(c.$$.fragment,ce),$(I.$$.fragment,ce),$(j.$$.fragment,ce),$(U.$$.fragment,ce),$(V.$$.fragment,ce),$(J.$$.fragment,ce),$(D),$(ue.$$.fragment,ce),ke=!0)},o(ce){oe(i.$$.fragment,ce),oe(c.$$.fragment,ce),oe(I.$$.fragment,ce),oe(j.$$.fragment,ce),oe(U.$$.fragment,ce),oe(V.$$.fragment,ce),oe(J.$$.fragment,ce),oe(D),oe(ue.$$.fragment,ce),ke=!1},d(ce){ce&&A(e),Le(i),Le(c),me&&me.d(),Le(I),Le(j),Le(U),Le(V),N&&N.d(),w&&w.d(),P&&P.d(),Le(J),D&&D.d(),Le(ue),y&&y.d()}}}function A1(t,e,l){let{basepath:n="/"}=e,{data:i={}}=e,o={},a={};function r(){var f,_;confirm(((_=(f=c.header)==null?void 0:f.upgrade)!=null?_:"Upgrade to {0}?").replace("{0}",a.tag_name))&&(!fn(o.board)||confirm(mi(lt(o.chip,o.board))))&&(ml.update(m=>(m.upgrading=!0,m)),Mu(a.tag_name))}ml.subscribe(f=>{l(2,o=f),f.fwconsent===1&&$r()}),ts.subscribe(f=>{l(3,a=Su(o.version,f))});let c={};return pl.subscribe(f=>{l(4,c=f)}),t.$$set=f=>{"basepath"in f&&l(0,n=f.basepath),"data"in f&&l(1,i=f.data)},[n,i,o,a,c,r]}class q1 extends qt{constructor(e){super(),At(this,e,A1,P1,Nt,{basepath:0,data:1})}}function D1(t){let e,l,n,i;return{c(){e=Rt("svg"),l=Rt("path"),n=Rt("path"),u(l,"d",wi(150,150,115,210,510)),u(l,"stroke","rgba(128, 128, 128, 0.15)"),u(l,"fill","none"),u(l,"stroke-width","55"),u(n,"d",i=wi(150,150,115,210,210+300*t[0]/100)),u(n,"stroke",t[1]),u(n,"fill","none"),u(n,"stroke-width","55"),u(e,"viewBox","0 0 300 300"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"height","100%")},m(o,a){q(o,e,a),s(e,l),s(e,n)},p(o,[a]){a&1&&i!==(i=wi(150,150,115,210,210+300*o[0]/100))&&u(n,"d",i),a&2&&u(n,"stroke",o[1])},i:Ze,o:Ze,d(o){o&&A(e)}}}function js(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 wi(t,e,l,n,i){var o=js(t,e,l,i),a=js(t,e,l,n),r=i-n<=180?"0":"1",c=["M",o.x,o.y,"A",l,l,0,r,0,a.x,a.y].join(" ");return c}function L1(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 O1 extends qt{constructor(e){super(),At(this,e,L1,D1,Nt,{pct:0,color:1})}}function Hs(t){let e,l,n,i,o,a,r,c;return{c(){e=p("br"),l=b(),n=p("span"),i=M(t[1]),o=b(),a=p("span"),r=M(t[2]),c=M("/kWh"),u(n,"class","pl-sub"),u(a,"class","pl-snt")},m(f,_){q(f,e,_),q(f,l,_),q(f,n,_),s(n,i),q(f,o,_),q(f,a,_),s(a,r),s(a,c)},p(f,_){_&2&&L(i,f[1]),_&4&&L(r,f[2])},d(f){f&&A(e),f&&A(l),f&&A(n),f&&A(o),f&&A(a)}}}function I1(t){let e,l,n,i,o,a,r,c,f,_,m=t[4][0]+"",d,v,h,k=t[4][1]+"",g,T,O;l=new O1({props:{pct:t[5],color:t[3](t[5],document.documentElement.classList.contains("dark"))}});let E=t[1]&&Hs(t);return{c(){e=p("div"),Re(l.$$.fragment),n=b(),i=p("span"),o=p("span"),a=M(t[0]),r=b(),c=p("br"),f=b(),_=p("span"),d=M(m),v=b(),h=p("span"),g=M(k),T=b(),E&&E.c(),u(o,"class","pl-lab"),u(_,"class","pl-val"),u(h,"class","pl-unt"),u(i,"class","pl-ov"),u(e,"class","pl-root")},m(I,C){q(I,e,C),De(l,e,null),s(e,n),s(e,i),s(i,o),s(o,a),s(i,r),s(i,c),s(i,f),s(i,_),s(_,d),s(i,v),s(i,h),s(h,g),s(i,T),E&&E.m(i,null),O=!0},p(I,[C]){const j={};C&32&&(j.pct=I[5]),C&40&&(j.color=I[3](I[5],document.documentElement.classList.contains("dark"))),l.$set(j),(!O||C&1)&&L(a,I[0]),(!O||C&16)&&m!==(m=I[4][0]+"")&&L(d,m),(!O||C&16)&&k!==(k=I[4][1]+"")&&L(g,k),I[1]?E?E.p(I,C):(E=Hs(I),E.c(),E.m(i,null)):E&&(E.d(1),E=null)},i(I){O||($(l.$$.fragment,I),O=!0)},o(I){oe(l.$$.fragment,I),O=!1},d(I){I&&A(e),Le(l),E&&E.d()}}}function R1(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:a}=e,{sub:r=""}=e,{subunit:c=""}=e,{colorFn:f}=e,_,m=0;return t.$$set=d=>{"val"in d&&l(6,n=d.val),"max"in d&&l(7,i=d.max),"unit"in d&&l(8,o=d.unit),"label"in d&&l(0,a=d.label),"sub"in d&&l(1,r=d.sub),"subunit"in d&&l(2,c=d.subunit),"colorFn"in d&&l(3,f=d.colorFn)},t.$$.update=()=>{t.$$.dirty&448&&(l(4,_=cl(n,o)),l(5,m=Math.min(n,i)/i*100))},[a,r,c,f,_,m,n,i,o]}class Nu extends qt{constructor(e){super(),At(this,e,R1,I1,Nt,{val:6,max:7,unit:8,label:0,sub:1,subunit:2,colorFn:3})}}function ys(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function zs(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Ws(t,e,l){const n=t.slice();return n[15]=e[l],n}function Gs(t){let e,l,n,i,o,a,r=t[0].title&&Vs(t),c=t[0].y.ticks,f=[];for(let h=0;ht[9].call(e))},m(o,a){q(o,e,a),s(e,n),i=Vi(e,t[9].bind(e))},p(o,a){a&1&&l!==(l=o[0].title+"")&&L(n,l)},d(o){o&&A(e),i()}}}function Ks(t){let e,l,n,i=t[15].label+"",o,a,r,c;return{c(){e=Rt("g"),l=Rt("line"),n=Rt("text"),o=M(i),u(l,"x2","100%"),u(n,"y","-4"),u(n,"x",a=t[15].align=="right"?"85%":""),u(e,"class",r="tick tick-"+t[15].value+" tick-"+t[15].color),u(e,"transform",c="translate(0, "+t[7](t[15].value)+")")},m(f,_){q(f,e,_),s(e,l),s(e,n),s(n,o)},p(f,_){_&1&&i!==(i=f[15].label+"")&&L(o,i),_&1&&a!==(a=f[15].align=="right"?"85%":"")&&u(n,"x",a),_&1&&r!==(r="tick tick-"+f[15].value+" tick-"+f[15].color)&&u(e,"class",r),_&129&&c!==(c="translate(0, "+f[7](f[15].value)+")")&&u(e,"transform",c)},d(f){f&&A(e)}}}function Ys(t){let e=!isNaN(t[7](t[15].value)),l,n=e&&Ks(t);return{c(){n&&n.c(),l=Jt()},m(i,o){n&&n.m(i,o),q(i,l,o)},p(i,o){o&129&&(e=!isNaN(i[7](i[15].value))),e?n?n.p(i,o):(n=Ks(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&A(l)}}}function Qs(t){let e,l,n=(t[3]>20||t[13]%2==0)&&Xs(t);return{c(){e=Rt("g"),n&&n.c(),u(e,"class","tick"),u(e,"transform",l="translate("+t[6](t[13])+","+t[4]+")")},m(i,o){q(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[13]%2==0?n?n.p(i,o):(n=Xs(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&80&&l!==(l="translate("+i[6](i[13])+","+i[4]+")")&&u(e,"transform",l)},d(i){i&&A(e),n&&n.d()}}}function Xs(t){let e,l=t[11].label+"",n,i;return{c(){e=Rt("text"),n=M(l),u(e,"x",i=t[3]/2),u(e,"y","-4")},m(o,a){q(o,e,a),s(e,n)},p(o,a){a&1&&l!==(l=o[11].label+"")&&L(n,l),a&8&&i!==(i=o[3]/2)&&u(e,"x",i)},d(o){o&&A(e)}}}function Zs(t){let e=!isNaN(t[6](t[13])),l,n=e&&Qs(t);return{c(){n&&n.c(),l=Jt()},m(i,o){n&&n.m(i,o),q(i,l,o)},p(i,o){o&64&&(e=!isNaN(i[6](i[13]))),e?n?n.p(i,o):(n=Qs(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&A(l)}}}function Js(t){let e,l,n=t[11].value!==void 0&&$s(t),i=t[11].value2>1e-4&&to(t);return{c(){e=Rt("g"),n&&n.c(),l=Rt("g"),i&&i.c()},m(o,a){q(o,e,a),n&&n.m(e,null),q(o,l,a),i&&i.m(l,null)},p(o,a){o[11].value!==void 0?n?n.p(o,a):(n=$s(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[11].value2>1e-4?i?i.p(o,a):(i=to(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&A(e),n&&n.d(),o&&A(l),i&&i.d()}}}function $s(t){let e,l,n,i,o,a,r,c=t[3]>15&&xs(t);return{c(){e=Rt("rect"),c&&c.c(),r=Jt(),u(e,"x",l=t[6](t[13])+2),u(e,"y",n=t[7](t[11].value)),u(e,"width",i=t[3]-4),u(e,"height",o=t[7](t[0].y.min)-t[7](Math.min(t[0].y.min,0)+t[11].value)),u(e,"fill",a=t[11].color)},m(f,_){q(f,e,_),c&&c.m(f,_),q(f,r,_)},p(f,_){_&64&&l!==(l=f[6](f[13])+2)&&u(e,"x",l),_&129&&n!==(n=f[7](f[11].value))&&u(e,"y",n),_&8&&i!==(i=f[3]-4)&&u(e,"width",i),_&129&&o!==(o=f[7](f[0].y.min)-f[7](Math.min(f[0].y.min,0)+f[11].value))&&u(e,"height",o),_&1&&a!==(a=f[11].color)&&u(e,"fill",a),f[3]>15?c?c.p(f,_):(c=xs(f),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},d(f){f&&A(e),c&&c.d(f),f&&A(r)}}}function xs(t){let e,l=t[11].label+"",n,i,o,a,r,c,f=t[11].title&&eo(t);return{c(){e=Rt("text"),n=M(l),f&&f.c(),c=Jt(),u(e,"width",i=t[3]-4),u(e,"dominant-baseline","middle"),u(e,"text-anchor",o=t[3]t[7](0)-t[8]&&!t[0].dark?t[11].color:"white"),u(e,"transform",r="translate("+(t[6](t[13])+t[3]/2)+" "+(t[7](t[11].value)>t[7](0)-t[8]?t[7](t[11].value)-t[8]:t[7](t[11].value)+10)+") rotate("+(t[11].labelAngle?t[11].labelAngle:t[3]_[7](0)-_[8]&&!_[0].dark?_[11].color:"white")&&u(e,"fill",a),m&457&&r!==(r="translate("+(_[6](_[13])+_[3]/2)+" "+(_[7](_[11].value)>_[7](0)-_[8]?_[7](_[11].value)-_[8]:_[7](_[11].value)+10)+") rotate("+(_[11].labelAngle?_[11].labelAngle:_[3]15&&lo(t);return{c(){e=Rt("rect"),c&&c.c(),r=Jt(),u(e,"x",l=t[6](t[13])+2),u(e,"y",n=t[7](0)),u(e,"width",i=t[3]-4),u(e,"height",o=t[7](t[0].y.min)-t[7](t[0].y.min+t[11].value2)),u(e,"fill",a=t[11].color2?t[11].color2:t[11].color)},m(f,_){q(f,e,_),c&&c.m(f,_),q(f,r,_)},p(f,_){_&64&&l!==(l=f[6](f[13])+2)&&u(e,"x",l),_&128&&n!==(n=f[7](0))&&u(e,"y",n),_&8&&i!==(i=f[3]-4)&&u(e,"width",i),_&129&&o!==(o=f[7](f[0].y.min)-f[7](f[0].y.min+f[11].value2))&&u(e,"height",o),_&1&&a!==(a=f[11].color2?f[11].color2:f[11].color)&&u(e,"fill",a),f[3]>15?c?c.p(f,_):(c=lo(f),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},d(f){f&&A(e),c&&c.d(f),f&&A(r)}}}function lo(t){let e,l=t[11].label2+"",n,i,o,a,r,c=t[11].title2&&no(t);return{c(){e=Rt("text"),n=M(l),c&&c.c(),r=Jt(),u(e,"width",i=t[3]-4),u(e,"dominant-baseline","middle"),u(e,"text-anchor","middle"),u(e,"fill",o=t[7](-t[11].value2)t[10].call(e))},m(i,o){q(i,e,o),n&&n.m(e,null),l=Vi(e,t[10].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=Gs(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:Ze,o:Ze,d(i){i&&A(e),n&&n.d(),l()}}}let xl=30;function B1(t,e,l){let{config:n}=e,i,o,a,r,c,f,_,m=0;function d(){m=this.clientHeight,l(5,m)}function v(){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&63){l(4,f=o-m);let h=i-(n.padding.left+n.padding.right);l(3,a=h/n.points.length),l(8,_=an.y.max?T=n.padding.bottom:gf||T<0?0:T})}},[n,i,o,a,f,m,r,c,_,d,v]}class ln extends qt{constructor(e){super(),At(this,e,B1,F1,Nt,{config:0})}}function U1(t){let e,l;return e=new ln({props:{config:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function j1(t,e,l){let{title:n}=e,{u1:i}=e,{u2:o}=e,{u3:a}=e,{ds:r}=e,c={};function f(_){return{label:Zt(_)+"V",title:_.toFixed(1)+" V",value:isNaN(_)?0:_,color:Qr(_||0,document.documentElement.classList.contains("dark"))}}return t.$$set=_=>{"title"in _&&l(1,n=_.title),"u1"in _&&l(2,i=_.u1),"u2"in _&&l(3,o=_.u2),"u3"in _&&l(4,a=_.u3),"ds"in _&&l(5,r=_.ds)},t.$$.update=()=>{if(t.$$.dirty&62){let _=[],m=[];i>0&&(_.push({label:r===1?"L1-L2":"L1"}),m.push(f(i))),o>0&&(_.push({label:r===1?"L1-L3":"L2"}),m.push(f(o))),a>0&&(_.push({label:r===1?"L2-L3":"L3"}),m.push(f(a))),l(0,c={title:n,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:_},points:m})}},[c,n,i,o,a,r]}class H1 extends qt{constructor(e){super(),At(this,e,j1,U1,Nt,{title:1,u1:2,u2:3,u3:4,ds:5})}}function y1(t){var D,y,ee,te,ie,_e,Ne,Me,pe,Ce;let e,l,n=((y=(D=t[0].reactive)==null?void 0:D.title)!=null?y:"Reactive")+"",i,o,a,r,c=((te=(ee=t[0].reactive)==null?void 0:ee.instant_in)!=null?te:"Instant in")+"",f,_,m,d=t[1][0]+"",v,h,k=t[1][1]+"",g,T,O,E=((_e=(ie=t[0].reactive)==null?void 0:ie.instant_out)!=null?_e:"Instant out")+"",I,C,j,S=t[2][0]+"",U,G,V=t[2][1]+"",F,R,z,B,H=((Me=(Ne=t[0].reactive)==null?void 0:Ne.total_in)!=null?Me:"Total in")+"",W,K,Q,Z=t[3][0]+"",se,X,J=t[3][1]+"",ae,le,ne,fe=((Ce=(pe=t[0].reactive)==null?void 0:pe.total_out)!=null?Ce:"Total out")+"",ue,Y,x,ke=t[4][0]+"",me,N,w=t[4][1]+"",P;return{c(){e=p("div"),l=p("strong"),i=M(n),o=b(),a=p("div"),r=p("div"),f=M(c),_=b(),m=p("div"),v=M(d),h=b(),g=M(k),T=b(),O=p("div"),I=M(E),C=b(),j=p("div"),U=M(S),G=b(),F=M(V),R=b(),z=p("div"),B=p("div"),W=M(H),K=b(),Q=p("div"),se=M(Z),X=b(),ae=M(J),le=b(),ne=p("div"),ue=M(fe),Y=b(),x=p("div"),me=M(ke),N=b(),P=M(w),u(m,"class","text-right"),u(j,"class","text-right"),u(a,"class","grid grid-cols-2 mt-4"),u(Q,"class","text-right"),u(x,"class","text-right"),u(z,"class","grid grid-cols-2 mt-4"),u(e,"class","mx-2 text-sm")},m(we,ge){q(we,e,ge),s(e,l),s(l,i),s(e,o),s(e,a),s(a,r),s(r,f),s(a,_),s(a,m),s(m,v),s(m,h),s(m,g),s(a,T),s(a,O),s(O,I),s(a,C),s(a,j),s(j,U),s(j,G),s(j,F),s(e,R),s(e,z),s(z,B),s(B,W),s(z,K),s(z,Q),s(Q,se),s(Q,X),s(Q,ae),s(z,le),s(z,ne),s(ne,ue),s(z,Y),s(z,x),s(x,me),s(x,N),s(x,P)},p(we,[ge]){var be,ye,je,Ke,xe,et,Je,nt,We,Oe;ge&1&&n!==(n=((ye=(be=we[0].reactive)==null?void 0:be.title)!=null?ye:"Reactive")+"")&&L(i,n),ge&1&&c!==(c=((Ke=(je=we[0].reactive)==null?void 0:je.instant_in)!=null?Ke:"Instant in")+"")&&L(f,c),ge&2&&d!==(d=we[1][0]+"")&&L(v,d),ge&2&&k!==(k=we[1][1]+"")&&L(g,k),ge&1&&E!==(E=((et=(xe=we[0].reactive)==null?void 0:xe.instant_out)!=null?et:"Instant out")+"")&&L(I,E),ge&4&&S!==(S=we[2][0]+"")&&L(U,S),ge&4&&V!==(V=we[2][1]+"")&&L(F,V),ge&1&&H!==(H=((nt=(Je=we[0].reactive)==null?void 0:Je.total_in)!=null?nt:"Total in")+"")&&L(W,H),ge&8&&Z!==(Z=we[3][0]+"")&&L(se,Z),ge&8&&J!==(J=we[3][1]+"")&&L(ae,J),ge&1&&fe!==(fe=((Oe=(We=we[0].reactive)==null?void 0:We.total_out)!=null?Oe:"Total out")+"")&&L(ue,fe),ge&16&&ke!==(ke=we[4][0]+"")&&L(me,ke),ge&16&&w!==(w=we[4][1]+"")&&L(P,w)},i:Ze,o:Ze,d(we){we&&A(e)}}}function z1(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:o}=e,{exportTotal:a}=e,r={};pl.subscribe(d=>{l(0,r=d)});let c,f,_,m;return t.$$set=d=>{"importInstant"in d&&l(5,n=d.importInstant),"exportInstant"in d&&l(6,i=d.exportInstant),"importTotal"in d&&l(7,o=d.importTotal),"exportTotal"in d&&l(8,a=d.exportTotal)},t.$$.update=()=>{t.$$.dirty&480&&(l(1,c=cl(n,"VAr")),l(2,f=cl(i,"VAr")),l(3,_=cl(o*1e3,"VArh")),l(4,m=cl(a*1e3,"VArh")))},[r,c,f,_,m,n,i,o,a]}class W1 extends qt{constructor(e){super(),At(this,e,z1,y1,Nt,{importInstant:5,exportInstant:6,importTotal:7,exportTotal:8})}}function so(t){let e;function l(o,a){return o[3]?V1:G1}let n=l(t),i=n(t);return{c(){i.c(),e=Jt()},m(o,a){i.m(o,a),q(o,e,a)},p(o,a){n===(n=l(o))&&i?i.p(o,a):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&A(e)}}}function G1(t){var y,ee,te,ie,_e,Ne,Me,pe,Ce,we;let e,l=((ee=(y=t[5].realtime)==null?void 0:y.consumption)!=null?ee:"Consumption")+"",n,i,o,a,r=$t((ie=(te=t[5].common)==null?void 0:te.hour)!=null?ie:"Hour")+"",c,f,_,m=t[6][0]+"",d,v,h=t[6][1]+"",k,g,T,O=$t((Ne=(_e=t[5].common)==null?void 0:_e.day)!=null?Ne:"Day")+"",E,I,C,j=t[7][0]+"",S,U,G=t[7][1]+"",V,F,R,z=$t((pe=(Me=t[5].common)==null?void 0:Me.month)!=null?pe:"Month")+"",B,H,W,K=t[8][0]+"",Q,Z,se=t[8][1]+"",X,J,ae,le=((we=(Ce=t[5].realtime)==null?void 0:Ce.last_month)!=null?we:"Last month")+"",ne,fe,ue,Y=t[9][0]+"",x,ke,me=t[9][1]+"",N,w,P,D=t[4]&&oo(t);return{c(){e=p("strong"),n=M(l),i=b(),o=p("div"),a=p("div"),c=M(r),f=b(),_=p("div"),d=M(m),v=b(),k=M(h),g=b(),T=p("div"),E=M(O),I=b(),C=p("div"),S=M(j),U=b(),V=M(G),F=b(),R=p("div"),B=M(z),H=b(),W=p("div"),Q=M(K),Z=b(),X=M(se),J=b(),ae=p("div"),ne=M(le),fe=b(),ue=p("div"),x=M(Y),ke=b(),N=M(me),w=b(),D&&D.c(),P=Jt(),u(_,"class","text-right"),u(C,"class","text-right"),u(W,"class","text-right"),u(ue,"class","text-right"),u(o,"class","grid grid-cols-2 mb-3")},m(ge,be){q(ge,e,be),s(e,n),q(ge,i,be),q(ge,o,be),s(o,a),s(a,c),s(o,f),s(o,_),s(_,d),s(_,v),s(_,k),s(o,g),s(o,T),s(T,E),s(o,I),s(o,C),s(C,S),s(C,U),s(C,V),s(o,F),s(o,R),s(R,B),s(o,H),s(o,W),s(W,Q),s(W,Z),s(W,X),s(o,J),s(o,ae),s(ae,ne),s(o,fe),s(o,ue),s(ue,x),s(ue,ke),s(ue,N),q(ge,w,be),D&&D.m(ge,be),q(ge,P,be)},p(ge,be){var ye,je,Ke,xe,et,Je,nt,We,Oe,ce;be&32&&l!==(l=((je=(ye=ge[5].realtime)==null?void 0:ye.consumption)!=null?je:"Consumption")+"")&&L(n,l),be&32&&r!==(r=$t((xe=(Ke=ge[5].common)==null?void 0:Ke.hour)!=null?xe:"Hour")+"")&&L(c,r),be&64&&m!==(m=ge[6][0]+"")&&L(d,m),be&64&&h!==(h=ge[6][1]+"")&&L(k,h),be&32&&O!==(O=$t((Je=(et=ge[5].common)==null?void 0:et.day)!=null?Je:"Day")+"")&&L(E,O),be&128&&j!==(j=ge[7][0]+"")&&L(S,j),be&128&&G!==(G=ge[7][1]+"")&&L(V,G),be&32&&z!==(z=$t((We=(nt=ge[5].common)==null?void 0:nt.month)!=null?We:"Month")+"")&&L(B,z),be&256&&K!==(K=ge[8][0]+"")&&L(Q,K),be&256&&se!==(se=ge[8][1]+"")&&L(X,se),be&32&&le!==(le=((ce=(Oe=ge[5].realtime)==null?void 0:Oe.last_month)!=null?ce:"Last month")+"")&&L(ne,le),be&512&&Y!==(Y=ge[9][0]+"")&&L(x,Y),be&512&&me!==(me=ge[9][1]+"")&&L(N,me),ge[4]?D?D.p(ge,be):(D=oo(ge),D.c(),D.m(P.parentNode,P)):D&&(D.d(1),D=null)},d(ge){ge&&A(e),ge&&A(i),ge&&A(o),ge&&A(w),D&&D.d(ge),ge&&A(P)}}}function V1(t){var yt,Qt,Kt,Vt,xt,el,nl,il,sl,ol,al,fl,ul,Ie,Ut,dl,vl,hl,bl,gl;let e,l=((Qt=(yt=t[5].common)==null?void 0:yt.import)!=null?Qt:"Import")+"",n,i,o,a,r=$t((Vt=(Kt=t[5].common)==null?void 0:Kt.hour)!=null?Vt:"Hour")+"",c,f,_,m=t[6][0]+"",d,v,h=t[6][1]+"",k,g,T,O,E=$t((el=(xt=t[5].common)==null?void 0:xt.day)!=null?el:"Day")+"",I,C,j,S=t[7][0]+"",U,G,V=t[7][1]+"",F,R,z,B,H=$t((il=(nl=t[5].common)==null?void 0:nl.month)!=null?il:"Month")+"",W,K,Q,Z=t[8][0]+"",se,X,J=t[8][1]+"",ae,le,ne,fe,ue=((ol=(sl=t[5].realtime)==null?void 0:sl.last_mo)!=null?ol:"Last mo.")+"",Y,x,ke,me=t[9][0]+"",N,w,P=t[9][1]+"",D,y,ee,te,ie,_e=((fl=(al=t[5].common)==null?void 0:al.export)!=null?fl:"Export")+"",Ne,Me,pe,Ce,we=$t((Ie=(ul=t[5].common)==null?void 0:ul.hour)!=null?Ie:"Hour")+"",ge,be,ye,je=t[10][0]+"",Ke,xe,et=t[10][1]+"",Je,nt,We,Oe,ce=$t((dl=(Ut=t[5].common)==null?void 0:Ut.day)!=null?dl:"Day")+"",Ee,tt,$e,pt=t[11][0]+"",Ge,Ye,Ve=t[11][1]+"",it,vt,Mt,he,re=$t((hl=(vl=t[5].common)==null?void 0:vl.month)!=null?hl:"Month")+"",Fe,Tt,Se,Ae=t[12][0]+"",dt,ut,rt=t[12][1]+"",ct,Et,Lt,St,Pt=((gl=(bl=t[5].realtime)==null?void 0:bl.last_mo)!=null?gl:"Last mo.")+"",Ot,Ht,Ct,ht=t[13][0]+"",Dt,Ft,Wt=t[13][1]+"",Qe,Xe,Bt,ot=t[4]&&ao(t),bt=t[4]&&fo(t),wt=t[4]&&uo(t),de=t[4]&&ro(t),qe=t[4]&&co(t),Pe=t[4]&&_o(t),Be=t[4]&&mo(t),ze=t[4]&&po(t);return{c(){e=p("strong"),n=M(l),i=b(),o=p("div"),a=p("div"),c=M(r),f=b(),_=p("div"),d=M(m),v=b(),k=M(h),g=b(),ot&&ot.c(),T=b(),O=p("div"),I=M(E),C=b(),j=p("div"),U=M(S),G=b(),F=M(V),R=b(),bt&&bt.c(),z=b(),B=p("div"),W=M(H),K=b(),Q=p("div"),se=M(Z),X=b(),ae=M(J),le=b(),wt&&wt.c(),ne=b(),fe=p("div"),Y=M(ue),x=b(),ke=p("div"),N=M(me),w=b(),D=M(P),y=b(),de&&de.c(),te=b(),ie=p("strong"),Ne=M(_e),Me=b(),pe=p("div"),Ce=p("div"),ge=M(we),be=b(),ye=p("div"),Ke=M(je),xe=b(),Je=M(et),nt=b(),qe&&qe.c(),We=b(),Oe=p("div"),Ee=M(ce),tt=b(),$e=p("div"),Ge=M(pt),Ye=b(),it=M(Ve),vt=b(),Pe&&Pe.c(),Mt=b(),he=p("div"),Fe=M(re),Tt=b(),Se=p("div"),dt=M(Ae),ut=b(),ct=M(rt),Et=b(),Be&&Be.c(),Lt=b(),St=p("div"),Ot=M(Pt),Ht=b(),Ct=p("div"),Dt=M(ht),Ft=b(),Qe=M(Wt),Xe=b(),ze&&ze.c(),u(_,"class","text-right"),u(j,"class","text-right"),u(Q,"class","text-right"),u(ke,"class","text-right"),u(o,"class",ee="grid grid-cols-"+t[14]+" mb-3"),u(ye,"class","text-right"),u($e,"class","text-right"),u(Se,"class","text-right"),u(Ct,"class","text-right"),u(pe,"class",Bt="grid grid-cols-"+t[14])},m(Ue,_t){q(Ue,e,_t),s(e,n),q(Ue,i,_t),q(Ue,o,_t),s(o,a),s(a,c),s(o,f),s(o,_),s(_,d),s(_,v),s(_,k),s(o,g),ot&&ot.m(o,null),s(o,T),s(o,O),s(O,I),s(o,C),s(o,j),s(j,U),s(j,G),s(j,F),s(o,R),bt&&bt.m(o,null),s(o,z),s(o,B),s(B,W),s(o,K),s(o,Q),s(Q,se),s(Q,X),s(Q,ae),s(o,le),wt&&wt.m(o,null),s(o,ne),s(o,fe),s(fe,Y),s(o,x),s(o,ke),s(ke,N),s(ke,w),s(ke,D),s(o,y),de&&de.m(o,null),q(Ue,te,_t),q(Ue,ie,_t),s(ie,Ne),q(Ue,Me,_t),q(Ue,pe,_t),s(pe,Ce),s(Ce,ge),s(pe,be),s(pe,ye),s(ye,Ke),s(ye,xe),s(ye,Je),s(pe,nt),qe&&qe.m(pe,null),s(pe,We),s(pe,Oe),s(Oe,Ee),s(pe,tt),s(pe,$e),s($e,Ge),s($e,Ye),s($e,it),s(pe,vt),Pe&&Pe.m(pe,null),s(pe,Mt),s(pe,he),s(he,Fe),s(pe,Tt),s(pe,Se),s(Se,dt),s(Se,ut),s(Se,ct),s(pe,Et),Be&&Be.m(pe,null),s(pe,Lt),s(pe,St),s(St,Ot),s(pe,Ht),s(pe,Ct),s(Ct,Dt),s(Ct,Ft),s(Ct,Qe),s(pe,Xe),ze&&ze.m(pe,null)},p(Ue,_t){var He,mt,Cl,Nl,Tl,El,Rl,Fl,Bl,Ul,jl,Hl,yl,zl,Wl,st,jt,rl,wl,Gl;_t&32&&l!==(l=((mt=(He=Ue[5].common)==null?void 0:He.import)!=null?mt:"Import")+"")&&L(n,l),_t&32&&r!==(r=$t((Nl=(Cl=Ue[5].common)==null?void 0:Cl.hour)!=null?Nl:"Hour")+"")&&L(c,r),_t&64&&m!==(m=Ue[6][0]+"")&&L(d,m),_t&64&&h!==(h=Ue[6][1]+"")&&L(k,h),Ue[4]?ot?ot.p(Ue,_t):(ot=ao(Ue),ot.c(),ot.m(o,T)):ot&&(ot.d(1),ot=null),_t&32&&E!==(E=$t((El=(Tl=Ue[5].common)==null?void 0:Tl.day)!=null?El:"Day")+"")&&L(I,E),_t&128&&S!==(S=Ue[7][0]+"")&&L(U,S),_t&128&&V!==(V=Ue[7][1]+"")&&L(F,V),Ue[4]?bt?bt.p(Ue,_t):(bt=fo(Ue),bt.c(),bt.m(o,z)):bt&&(bt.d(1),bt=null),_t&32&&H!==(H=$t((Fl=(Rl=Ue[5].common)==null?void 0:Rl.month)!=null?Fl:"Month")+"")&&L(W,H),_t&256&&Z!==(Z=Ue[8][0]+"")&&L(se,Z),_t&256&&J!==(J=Ue[8][1]+"")&&L(ae,J),Ue[4]?wt?wt.p(Ue,_t):(wt=uo(Ue),wt.c(),wt.m(o,ne)):wt&&(wt.d(1),wt=null),_t&32&&ue!==(ue=((Ul=(Bl=Ue[5].realtime)==null?void 0:Bl.last_mo)!=null?Ul:"Last mo.")+"")&&L(Y,ue),_t&512&&me!==(me=Ue[9][0]+"")&&L(N,me),_t&512&&P!==(P=Ue[9][1]+"")&&L(D,P),Ue[4]?de?de.p(Ue,_t):(de=ro(Ue),de.c(),de.m(o,null)):de&&(de.d(1),de=null),_t&16384&&ee!==(ee="grid grid-cols-"+Ue[14]+" mb-3")&&u(o,"class",ee),_t&32&&_e!==(_e=((Hl=(jl=Ue[5].common)==null?void 0:jl.export)!=null?Hl:"Export")+"")&&L(Ne,_e),_t&32&&we!==(we=$t((zl=(yl=Ue[5].common)==null?void 0:yl.hour)!=null?zl:"Hour")+"")&&L(ge,we),_t&1024&&je!==(je=Ue[10][0]+"")&&L(Ke,je),_t&1024&&et!==(et=Ue[10][1]+"")&&L(Je,et),Ue[4]?qe?qe.p(Ue,_t):(qe=co(Ue),qe.c(),qe.m(pe,We)):qe&&(qe.d(1),qe=null),_t&32&&ce!==(ce=$t((st=(Wl=Ue[5].common)==null?void 0:Wl.day)!=null?st:"Day")+"")&&L(Ee,ce),_t&2048&&pt!==(pt=Ue[11][0]+"")&&L(Ge,pt),_t&2048&&Ve!==(Ve=Ue[11][1]+"")&&L(it,Ve),Ue[4]?Pe?Pe.p(Ue,_t):(Pe=_o(Ue),Pe.c(),Pe.m(pe,Mt)):Pe&&(Pe.d(1),Pe=null),_t&32&&re!==(re=$t((rl=(jt=Ue[5].common)==null?void 0:jt.month)!=null?rl:"Month")+"")&&L(Fe,re),_t&4096&&Ae!==(Ae=Ue[12][0]+"")&&L(dt,Ae),_t&4096&&rt!==(rt=Ue[12][1]+"")&&L(ct,rt),Ue[4]?Be?Be.p(Ue,_t):(Be=mo(Ue),Be.c(),Be.m(pe,Lt)):Be&&(Be.d(1),Be=null),_t&32&&Pt!==(Pt=((Gl=(wl=Ue[5].realtime)==null?void 0:wl.last_mo)!=null?Gl:"Last mo.")+"")&&L(Ot,Pt),_t&8192&&ht!==(ht=Ue[13][0]+"")&&L(Dt,ht),_t&8192&&Wt!==(Wt=Ue[13][1]+"")&&L(Qe,Wt),Ue[4]?ze?ze.p(Ue,_t):(ze=po(Ue),ze.c(),ze.m(pe,null)):ze&&(ze.d(1),ze=null),_t&16384&&Bt!==(Bt="grid grid-cols-"+Ue[14])&&u(pe,"class",Bt)},d(Ue){Ue&&A(e),Ue&&A(i),Ue&&A(o),ot&&ot.d(),bt&&bt.d(),wt&&wt.d(),de&&de.d(),Ue&&A(te),Ue&&A(ie),Ue&&A(Me),Ue&&A(pe),qe&&qe.d(),Pe&&Pe.d(),Be&&Be.d(),ze&&ze.d()}}}function oo(t){var x,ke,me,N,w,P,D,y,ee,te;let e,l=((ke=(x=t[5].realtime)==null?void 0:x.cost)!=null?ke:"Cost")+"",n,i,o,a,r=$t((N=(me=t[5].common)==null?void 0:me.hour)!=null?N:"Hour")+"",c,f,_,m=Zt(t[1].h.c,2)+"",d,v,h,k,g,T=$t((P=(w=t[5].common)==null?void 0:w.day)!=null?P:"Day")+"",O,E,I,C=Zt(t[1].d.c,1)+"",j,S,U,G,V,F=$t((y=(D=t[5].common)==null?void 0:D.month)!=null?y:"Month")+"",R,z,B,H=Zt(t[1].m.c)+"",W,K,Q,Z,se,X=((te=(ee=t[5].realtime)==null?void 0:ee.last_month)!=null?te:"Last month")+"",J,ae,le,ne=Zt(t[0].last_month.c)+"",fe,ue,Y;return{c(){e=p("strong"),n=M(l),i=b(),o=p("div"),a=p("div"),c=M(r),f=b(),_=p("div"),d=M(m),v=b(),h=M(t[2]),k=b(),g=p("div"),O=M(T),E=b(),I=p("div"),j=M(C),S=b(),U=M(t[2]),G=b(),V=p("div"),R=M(F),z=b(),B=p("div"),W=M(H),K=b(),Q=M(t[2]),Z=b(),se=p("div"),J=M(X),ae=b(),le=p("div"),fe=M(ne),ue=b(),Y=M(t[2]),u(_,"class","text-right"),u(I,"class","text-right"),u(B,"class","text-right"),u(le,"class","text-right"),u(o,"class","grid grid-cols-2")},m(ie,_e){q(ie,e,_e),s(e,n),q(ie,i,_e),q(ie,o,_e),s(o,a),s(a,c),s(o,f),s(o,_),s(_,d),s(_,v),s(_,h),s(o,k),s(o,g),s(g,O),s(o,E),s(o,I),s(I,j),s(I,S),s(I,U),s(o,G),s(o,V),s(V,R),s(o,z),s(o,B),s(B,W),s(B,K),s(B,Q),s(o,Z),s(o,se),s(se,J),s(o,ae),s(o,le),s(le,fe),s(le,ue),s(le,Y)},p(ie,_e){var Ne,Me,pe,Ce,we,ge,be,ye,je,Ke;_e&32&&l!==(l=((Me=(Ne=ie[5].realtime)==null?void 0:Ne.cost)!=null?Me:"Cost")+"")&&L(n,l),_e&32&&r!==(r=$t((Ce=(pe=ie[5].common)==null?void 0:pe.hour)!=null?Ce:"Hour")+"")&&L(c,r),_e&2&&m!==(m=Zt(ie[1].h.c,2)+"")&&L(d,m),_e&4&&L(h,ie[2]),_e&32&&T!==(T=$t((ge=(we=ie[5].common)==null?void 0:we.day)!=null?ge:"Day")+"")&&L(O,T),_e&2&&C!==(C=Zt(ie[1].d.c,1)+"")&&L(j,C),_e&4&&L(U,ie[2]),_e&32&&F!==(F=$t((ye=(be=ie[5].common)==null?void 0:be.month)!=null?ye:"Month")+"")&&L(R,F),_e&2&&H!==(H=Zt(ie[1].m.c)+"")&&L(W,H),_e&4&&L(Q,ie[2]),_e&32&&X!==(X=((Ke=(je=ie[5].realtime)==null?void 0:je.last_month)!=null?Ke:"Last month")+"")&&L(J,X),_e&1&&ne!==(ne=Zt(ie[0].last_month.c)+"")&&L(fe,ne),_e&4&&L(Y,ie[2])},d(ie){ie&&A(e),ie&&A(i),ie&&A(o)}}}function ao(t){let e,l=Zt(t[1].h.c,2)+"",n,i,o;return{c(){e=p("div"),n=M(l),i=b(),o=M(t[2]),u(e,"class","text-right")},m(a,r){q(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].h.c,2)+"")&&L(n,l),r&4&&L(o,a[2])},d(a){a&&A(e)}}}function fo(t){let e,l=Zt(t[1].d.c,1)+"",n,i,o;return{c(){e=p("div"),n=M(l),i=b(),o=M(t[2]),u(e,"class","text-right")},m(a,r){q(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].d.c,1)+"")&&L(n,l),r&4&&L(o,a[2])},d(a){a&&A(e)}}}function uo(t){let e,l=Zt(t[1].m.c)+"",n,i,o;return{c(){e=p("div"),n=M(l),i=b(),o=M(t[2]),u(e,"class","text-right")},m(a,r){q(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].m.c)+"")&&L(n,l),r&4&&L(o,a[2])},d(a){a&&A(e)}}}function ro(t){let e,l=Zt(t[0].last_month.c)+"",n,i,o;return{c(){e=p("div"),n=M(l),i=b(),o=M(t[2]),u(e,"class","text-right")},m(a,r){q(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&1&&l!==(l=Zt(a[0].last_month.c)+"")&&L(n,l),r&4&&L(o,a[2])},d(a){a&&A(e)}}}function co(t){let e,l=Zt(t[1].h.i,2)+"",n,i,o;return{c(){e=p("div"),n=M(l),i=b(),o=M(t[2]),u(e,"class","text-right")},m(a,r){q(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].h.i,2)+"")&&L(n,l),r&4&&L(o,a[2])},d(a){a&&A(e)}}}function _o(t){let e,l=Zt(t[1].d.i,1)+"",n,i,o;return{c(){e=p("div"),n=M(l),i=b(),o=M(t[2]),u(e,"class","text-right")},m(a,r){q(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].d.i,1)+"")&&L(n,l),r&4&&L(o,a[2])},d(a){a&&A(e)}}}function mo(t){let e,l=Zt(t[1].m.i)+"",n,i,o;return{c(){e=p("div"),n=M(l),i=b(),o=M(t[2]),u(e,"class","text-right")},m(a,r){q(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].m.i)+"")&&L(n,l),r&4&&L(o,a[2])},d(a){a&&A(e)}}}function po(t){let e,l=Zt(t[0].last_month.i)+"",n,i,o;return{c(){e=p("div"),n=M(l),i=b(),o=M(t[2]),u(e,"class","text-right")},m(a,r){q(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&1&&l!==(l=Zt(a[0].last_month.i)+"")&&L(n,l),r&4&&L(o,a[2])},d(a){a&&A(e)}}}function K1(t){var _,m;let e,l,n=((m=(_=t[5].realtime)==null?void 0:_.title)!=null?m:"Real time calculations")+"",i,o,a,r,c,f=t[1]&&so(t);return{c(){e=p("div"),l=p("strong"),i=M(n),o=b(),a=p("br"),r=p("br"),c=b(),f&&f.c(),u(e,"class","mx-2 text-sm")},m(d,v){q(d,e,v),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,c),f&&f.m(e,null)},p(d,[v]){var h,k;v&32&&n!==(n=((k=(h=d[5].realtime)==null?void 0:h.title)!=null?k:"Real time calculations")+"")&&L(i,n),d[1]?f?f.p(d,v):(f=so(d),f.c(),f.m(e,null)):f&&(f.d(1),f=null)},i:Ze,o:Ze,d(d){d&&A(e),f&&f.d()}}}function Y1(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:a}=e,r={};pl.subscribe(O=>{l(5,r=O)});let c,f,_,m,d,v,h,k,g=!1,T=3;return t.$$set=O=>{"sysinfo"in O&&l(0,n=O.sysinfo),"data"in O&&l(1,i=O.data),"currency"in O&&l(2,o=O.currency),"hasExport"in O&&l(3,a=O.hasExport)},t.$$.update=()=>{var O,E,I,C,j,S,U,G;t.$$.dirty&19&&(l(4,g=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(14,T=g?3:2),l(6,c=cl(((O=i==null?void 0:i.h)==null?void 0:O.u)*1e3,"Wh")),l(7,f=cl(((E=i==null?void 0:i.d)==null?void 0:E.u)*1e3,"Wh")),l(8,_=cl(((I=i==null?void 0:i.m)==null?void 0:I.u)*1e3,"Wh")),l(9,m=cl(((C=n==null?void 0:n.last_month)==null?void 0:C.u)*1e3,"Wh")),l(10,d=cl(((j=i==null?void 0:i.h)==null?void 0:j.p)*1e3,"Wh")),l(11,v=cl(((S=i==null?void 0:i.d)==null?void 0:S.p)*1e3,"Wh")),l(12,h=cl(((U=i==null?void 0:i.m)==null?void 0:U.p)*1e3,"Wh")),l(13,k=cl(((G=n==null?void 0:n.last_month)==null?void 0:G.p)*1e3,"Wh")))},[n,i,o,a,g,r,c,f,_,m,d,v,h,k,T]}class Q1 extends qt{constructor(e){super(),At(this,e,Y1,K1,Nt,{sysinfo:0,data:1,currency:2,hasExport:3})}}function X1(t){let e,l,n=Es(t[0].source)+"",i,o,a,r,c;return r=new ln({props:{config:t[1]}}),{c(){e=p("a"),l=M("Provided by: "),i=M(n),a=b(),Re(r.$$.fragment),u(e,"href",o=Ps(t[0].source)),u(e,"target","_blank"),u(e,"class","text-xs float-right z-40")},m(f,_){q(f,e,_),s(e,l),s(e,i),q(f,a,_),De(r,f,_),c=!0},p(f,[_]){(!c||_&1)&&n!==(n=Es(f[0].source)+"")&&L(i,n),(!c||_&1&&o!==(o=Ps(f[0].source)))&&u(e,"href",o);const m={};_&2&&(m.config=f[1]),r.$set(m)},i(f){c||($(r.$$.fragment,f),c=!0)},o(f){oe(r.$$.fragment,f),c=!1},d(f){f&&A(e),f&&A(a),Le(r,f)}}}function Z1(t,e,l){let{title:n}=e,{json:i}=e,{sysinfo:o}=e,a={},r,c,f=document.documentElement.classList.contains("dark");return t.$$set=_=>{"title"in _&&l(2,n=_.title),"json"in _&&l(0,i=_.json),"sysinfo"in _&&l(3,o=_.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&61){let _=i.currency,m=new Date().getUTCHours(),d=0,v=0,h=0,k=[],g=[],T=[];l(5,c=l(4,r=0));let O=new Date;for(Ll(O,o.clock_offset-(24+O.getHours()-O.getUTCHours())%24),d=m;d<24&&(v=i[It(h++)],v!=null);d++)g.push({label:It(O.getHours())}),T.push(v*100),l(5,c=Math.min(c,v*100)),l(4,r=Math.max(r,v*100)),Ll(O,1);for(d=0;d<24&&(v=i[It(h++)],v!=null);d++)g.push({label:It(O.getHours())}),T.push(v*100),l(5,c=Math.min(c,v*100)),l(4,r=Math.max(r,v*100)),Ll(O,1);if(c>-100&&r<100){switch(_){case"NOK":case"DKK":_="\xF8re";break;case"SEK":_="\xF6re";break;case"EUR":_="cent";break;case"CHF":_="rp.";break;default:_=_+"/100"}for(l(5,c*=100),l(4,r*=100),d=0;d=0?S.toFixed(U):"",title:S>=0?S.toFixed(2)+" "+_:"",value:v>=0?Math.abs(v):0,label2:S<0?S.toFixed(U):"",title2:S<0?S.toFixed(2)+" "+_:"",value2:v<0?Math.abs(v):0,color:f?"#5c2da5":"#7c3aed"})}let I=Math.max(r,Math.abs(c));if(c<0){l(5,c=Math.min(I/4*-1,c));let S=Math.ceil(Math.abs(c)/I*4),U=c/S;for(d=1;d{"title"in _&&l(1,n=_.title),"json"in _&&l(2,i=_.json),"sysinfo"in _&&l(3,o=_.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let _=0,m=[],d=[],v=[];l(5,c=l(4,r=0));let h=Ll(new Date,-24),k=new Date().getUTCHours();for(Ll(h,o.clock_offset-(24+h.getHours()-h.getUTCHours())%24),_=k;_<24;_++){let E=i["i"+It(_)],I=i["e"+It(_)];E===void 0&&(E=0),I===void 0&&(I=0),d.push({label:It(h.getHours())}),v.push({label:E.toFixed(1),title:E.toFixed(2)+" kWh",value:E*10,label2:I.toFixed(1),title2:I.toFixed(2)+" kWh",value2:I*10,color:f?"#5c2da5":"#7c3aed",color2:f?"#27728e":"#37829e"}),l(5,c=Math.max(c,I*10)),l(4,r=Math.max(r,E*10)),Ll(h,1)}for(_=0;_{"title"in _&&l(1,n=_.title),"json"in _&&l(2,i=_.json),"sysinfo"in _&&l(3,o=_.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let _=0,m=[],d=[],v=[];l(5,c=l(4,r=0));let h=new Date,k=new Date;for(Ll(h,o.clock_offset-(24+h.getHours()-h.getUTCHours())%24),Ll(k,o.clock_offset-(24+k.getHours()-k.getUTCHours())%24),k.setDate(0),_=h.getDate();_<=k.getDate();_++){let E=i["i"+It(_)],I=i["e"+It(_)];E===void 0&&(E=0),I===void 0&&(I=0),d.push({label:It(_)}),v.push({label:E.toFixed(E<10?1:0),title:E.toFixed(2)+" kWh",value:E,label2:I.toFixed(I<10?1:0),title2:I.toFixed(2)+" kWh",value2:I,color:f?"#5c2da5":"#7c3aed",color2:f?"#27728e":"#37829e"}),l(5,c=Math.max(c,I)),l(4,r=Math.max(r,E))}for(_=1;_{"title"in f&&l(1,n=f.title),"json"in f&&l(2,i=f.json)},t.$$.update=()=>{if(t.$$.dirty&30){let f=0,_=0,m=[],d=[],v=[];i.s&&i.s.forEach((g,T)=>{var O=g.n?g.n:g.a;_=g.v,_==-127&&(_=0),d.push({label:O.slice(-4)}),v.push({label:_.toFixed(1),value:_,color:o?"#5c2da5":"#7c3aed"}),l(4,c=Math.min(c,_)),l(3,r=Math.max(r,_))}),l(3,r=Math.ceil(r)),l(4,c=Math.floor(c));let h=r;c<0&&(h+=Math.abs(c));let k=h/4;for(f=0;f<5;f++)_=c+k*f,m.push({value:_,label:_.toFixed(1)});l(0,a={title:n+" (\xB0C)",dark:document.documentElement.classList.contains("dark"),height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:c,max:r,ticks:m},x:{ticks:d},points:v})}},[a,n,i,r,c]}class o0 extends qt{constructor(e){super(),At(this,e,s0,i0,Nt,{title:1,json:2})}}function a0(t){let e,l;return e=new ln({props:{config:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}let f0=0;function u0(t,e,l){let n={};pl.subscribe(f=>{l(2,n=f)});let{title:i}=e,o=document.documentElement.classList.contains("dark"),a={},r=0,c;return ku.subscribe(f=>{l(4,c=f)}),gu(),t.$$set=f=>{"title"in f&&l(1,i=f.title)},t.$$.update=()=>{var f;if(t.$$.dirty&30){let _=0,m=[],d=[],v=[];if(m.push({value:0,label:0}),c&&c.p)for(_=0;_0?It(h.d)+"."+((f=n.months)==null?void 0:f[new Date().getMonth()]):"-"}),l(3,r=Math.max(r,h.v))}if(c&&c.t){for(_=0;_=r)break;m.push({value:h,label:h})}m.push({label:c.m.toFixed(1),align:"right",color:"green",value:c.m})}c&&c.c&&(m.push({label:c.c.toFixed(0),color:"orange",value:c.c}),l(3,r=Math.max(r,c.c))),l(3,r=Math.ceil(r)),l(0,a={title:i,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:35,bottom:20,left:35},y:{min:f0,max:r,ticks:m},x:{ticks:d},points:v})}},[a,i,n,r,c]}class r0 extends qt{constructor(e){super(),At(this,e,u0,a0,Nt,{title:1})}}function vo(t,e,l){const n=t.slice();return n[24]=e[l],n[26]=l,n}function ho(t,e,l){const n=t.slice();return n[27]=e[l],n}function c0(t){let e,l,n;return{c(){e=p("strong"),l=M(t[0]),n=M(" not available"),u(e,"class","text-sm")},m(i,o){q(i,e,o),s(e,l),s(e,n)},p(i,o){o&1&&L(l,i[0])},d(i){i&&A(e)}}}function _0(t){let e,l,n,i,o,a,r,c=t[8]&&bo(t);return{c(){e=p("strong"),l=M(t[0]),n=M(" ("),i=M(t[12]),o=M(")"),a=b(),c&&c.c(),r=Jt(),u(e,"class","text-sm")},m(f,_){q(f,e,_),s(e,l),s(e,n),s(e,i),s(e,o),q(f,a,_),c&&c.m(f,_),q(f,r,_)},p(f,_){_&1&&L(l,f[0]),_&4096&&L(i,f[12]),f[8]?c?c.p(f,_):(c=bo(f),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},d(f){f&&A(e),f&&A(a),c&&c.d(f),f&&A(r)}}}function bo(t){let e,l,n,i,o,a=t[8],r=[];for(let _=0;_t[17].call(e))},m(a,r){q(a,e,r),o.m(e,null),l=Vi(e,t[17].bind(e))},p(a,[r]){i===(i=n(a))&&o?o.p(a,r):(o.d(1),o=i(a),o&&(o.c(),o.m(e,null)))},i:Ze,o:Ze,d(a){a&&A(e),o.d(),l()}}}function p0(t,e,l){let{title:n}=e,i=document.documentElement.classList.contains("dark"),o=0,a=0,r=0,c=0,f=!1,_=null;Ii.subscribe(F=>{l(16,_=F)});let m=!1;function d(){c==60||r>o||r-o>300?(Oi(),c=0):Ii.update(F=>{if(F.lastUpdate)for(;o>F.lastUpdate;)F.data.unshift(a),F.data=F.data.slice(0,F.size),F.lastUpdate+=10,c++;else F.lastUpdate=o;return F})}_u.subscribe(F=>{if(a=F.i-F.e,o=F.u,!f){Oi(),f=!0,r=o;return}!e1()||d()});let v,h,k,g,T,O,E,I=function(F,R,z){return Math.ceil(T-(F-R)/(z-R)*T)-25},C=function(F){return 30+Math.ceil(F/_.size*(O-35))},j,S,U,G;function V(){k=this.clientWidth,g=this.clientHeight,l(3,k),l(4,g)}return t.$$set=F=>{"title"in F&&l(0,n=F.title)},t.$$.update=()=>{if(t.$$.dirty&67582)if(l(5,T=parseInt(g)-50),l(6,O=k-35),l(10,U=O/_.size),l(2,h=0),l(1,v=0),_.data&&T>10&&O>100&&U>.1){l(11,m=!0);for(let z in _.data){let B=_.data[z];isNaN(B)&&(B=0),l(1,v=Math.max(Math.ceil(B/1e3)*1e3,v)),l(2,h=Math.min(Math.floor(B/1e3)*1e3,h))}let F=v-h;l(12,G=v>2500?"kW":"W"),l(8,j=[]);for(let z=h;z2500?(z/1e3).toFixed(1):z}),!(j.length>6));z+=F/5);l(9,S=[]);for(let z=0;z<_.size&&(S.push({value:z,label:"-"+Math.round((_.size-z)/6)+" min"}),!(S.length>12));z+=Math.round(_.size/Math.round(O/120)));let R=_.size;l(7,E=C(_.size)+","+I(0,h,v)+" "+C(1)+","+I(0,h,v));for(let z in _.data){if(R<0)break;let B=_.data[z];isNaN(B)&&(B=0),l(7,E=C(R--)+","+I(B,h,v)+" "+E)}}else l(11,m=!1)},[n,v,h,k,g,T,O,E,j,S,U,m,G,i,I,C,_,V]}class d0 extends qt{constructor(e){super(),At(this,e,p0,m0,Nt,{title:0})}}function v0(t){let e,l;return e=new ln({props:{config:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function h0(t,e,l){let{title:n}=e,{unit:i=""}=e,{l1:o=!1}=e,{l2:a=!1}=e,{l2x:r=!1}=e,{l3:c=!1}=e,{l1i:f=0}=e,{l2i:_=0}=e,{l3i:m=0}=e,{l1e:d=0}=e,{l2e:v=0}=e,{l3e:h=0}=e,{maxImport:k=0}=e,{maxExport:g=0}=e,{importColorFn:T}=e,{exportColorFn:O}=e,E={};function I(C,j){return{label:Zt(C>900?C/1e3:C)+(C>900?"k":"")+i,title:C.toFixed(2)+" "+i,value:isNaN(C)?0:C,color:T(C?C/k*100:0,document.documentElement.classList.contains("dark")),label2:Zt(j>900?j/1e3:j)+(j>900?"k":"")+i,title2:j.toFixed(2)+" "+i,value2:isNaN(j)?0:j,color2:O(j?j/g*100:0)}}return t.$$set=C=>{"title"in C&&l(1,n=C.title),"unit"in C&&l(2,i=C.unit),"l1"in C&&l(3,o=C.l1),"l2"in C&&l(4,a=C.l2),"l2x"in C&&l(5,r=C.l2x),"l3"in C&&l(6,c=C.l3),"l1i"in C&&l(7,f=C.l1i),"l2i"in C&&l(8,_=C.l2i),"l3i"in C&&l(9,m=C.l3i),"l1e"in C&&l(10,d=C.l1e),"l2e"in C&&l(11,v=C.l2e),"l3e"in C&&l(12,h=C.l3e),"maxImport"in C&&l(13,k=C.maxImport),"maxExport"in C&&l(14,g=C.maxExport),"importColorFn"in C&&l(15,T=C.importColorFn),"exportColorFn"in C&&l(16,O=C.exportColorFn)},t.$$.update=()=>{if(t.$$.dirty&32762){let C=[],j=[];o&&(C.push({label:"L1"}),j.push(I(f,d))),a&&(r?(C.push({label:"L2"}),j.push({label:"Not available",labelAngle:-90,title:"L2 current is not reported by your meter",value:0,color:"#7c3aedcc"})):(C.push({label:"L2"}),j.push(I(_,v)))),c&&(C.push({label:"L3"}),j.push(I(m,h)));let S=[];if(g){let U=g>k?4:g*4/k;S.push({value:-g,label:"-100%"}),U>=4&&S.push({value:-g/4*3,label:"-75%"}),U>=2&&S.push({value:-g/2,label:"-50%"}),U>=4&&S.push({value:-g/4,label:"-25%"})}if(S.push({value:0,label:"0%"}),k){let U=k>g?4:k*4/g;S.push({value:k/4,label:"25%"}),U>=4&&S.push({value:k/2,label:"50%"}),U>=2&&S.push({value:k/4*3,label:"75%"}),U>=4&&S.push({value:k,label:"100%"})}l(0,E={title:n,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:15,bottom:20,left:35},y:{min:-g,max:k,ticks:S},x:{ticks:C},points:j})}},[E,n,i,o,a,r,c,f,_,m,d,v,h,k,g,T,O]}class ls extends qt{constructor(e){super(),At(this,e,h0,v0,Nt,{title:1,unit:2,l1:3,l2:4,l2x:5,l3:6,l1i:7,l2i:8,l3i:9,l1e:10,l2e:11,l3e:12,maxImport:13,maxExport:14,importColorFn:15,exportColorFn:16})}}function So(t){var T,O;let e,l,n,i,o,a,r=(t[0].mt?_i(t[0].mt):"-")+"",c,f,_,m=t[7][0]+"",d,v,h=t[7][1]+"",k,g;return i=new Nu({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:(O=(T=t[6].common)==null?void 0:T.import)!=null?O:"Import",sub:t[0].p,subunit:t[0].pc,colorFn:Zi}}),{c(){e=p("div"),l=p("div"),n=p("div"),Re(i.$$.fragment),o=b(),a=p("div"),c=M(r),f=b(),_=p("div"),d=M(m),v=b(),k=M(h),u(n,"class","col-span-2"),u(_,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(E,I){q(E,e,I),s(e,l),s(l,n),De(i,n,null),s(l,o),s(l,a),s(a,c),s(l,f),s(l,_),s(_,d),s(_,v),s(_,k),g=!0},p(E,I){var j,S;const C={};I&1&&(C.val=E[0].i?E[0].i:0),I&1&&(C.max=E[0].im?E[0].im:15e3),I&64&&(C.label=(S=(j=E[6].common)==null?void 0:j.import)!=null?S:"Import"),I&1&&(C.sub=E[0].p),I&1&&(C.subunit=E[0].pc),i.$set(C),(!g||I&1)&&r!==(r=(E[0].mt?_i(E[0].mt):"-")+"")&&L(c,r),(!g||I&128)&&m!==(m=E[7][0]+"")&&L(d,m),(!g||I&128)&&h!==(h=E[7][1]+"")&&L(k,h)},i(E){g||($(i.$$.fragment,E),g=!0)},o(E){oe(i.$$.fragment,E),g=!1},d(E){E&&A(e),Le(i)}}}function Co(t){var k,g;let e,l,n,i,o,a,r,c,f=t[8][0]+"",_,m,d=t[8][1]+"",v,h;return i=new Nu({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:(g=(k=t[6].common)==null?void 0:k.export)!=null?g:"Export",sub:t[0].px,subunit:t[0].pc,colorFn:Qn}}),{c(){e=p("div"),l=p("div"),n=p("div"),Re(i.$$.fragment),o=b(),a=p("div"),r=b(),c=p("div"),_=M(f),m=b(),v=M(d),u(n,"class","col-span-2"),u(c,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(T,O){q(T,e,O),s(e,l),s(l,n),De(i,n,null),s(l,o),s(l,a),s(l,r),s(l,c),s(c,_),s(c,m),s(c,v),h=!0},p(T,O){var I,C;const E={};O&1&&(E.val=T[0].e?T[0].e:0),O&1&&(E.max=T[0].om?T[0].om*1e3:1e4),O&64&&(E.label=(C=(I=T[6].common)==null?void 0:I.export)!=null?C:"Export"),O&1&&(E.sub=T[0].px),O&1&&(E.subunit=T[0].pc),i.$set(E),(!h||O&256)&&f!==(f=T[8][0]+"")&&L(_,f),(!h||O&256)&&d!==(d=T[8][1]+"")&&L(v,d)},i(T){h||($(i.$$.fragment,T),h=!0)},o(T){oe(i.$$.fragment,T),h=!1},d(T){T&&A(e),Le(i)}}}function No(t){let e,l,n=t[0].l1&&To(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,o){q(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&$(n,1)):(n=To(i),n.c(),$(n,1),n.m(e,null)):n&&(gt(),oe(n,1,1,()=>{n=null}),kt())},i(i){l||($(n),l=!0)},o(i){oe(n),l=!1},d(i){i&&A(e),n&&n.d()}}}function To(t){var n,i;let e,l;return e=new H1({props:{title:(i=(n=t[6].common)==null?void 0:n.voltage)!=null?i:"Volt",u1:t[0].l1.u,u2:t[0].l2.u,u3:t[0].l3.u,ds:t[0].ds}}),{c(){Re(e.$$.fragment)},m(o,a){De(e,o,a),l=!0},p(o,a){var c,f;const r={};a&64&&(r.title=(f=(c=o[6].common)==null?void 0:c.voltage)!=null?f:"Volt"),a&1&&(r.u1=o[0].l1.u),a&1&&(r.u2=o[0].l2.u),a&1&&(r.u3=o[0].l3.u),a&1&&(r.ds=o[0].ds),e.$set(r)},i(o){l||($(e.$$.fragment,o),l=!0)},o(o){oe(e.$$.fragment,o),l=!1},d(o){Le(e,o)}}}function Eo(t){let e,l,n=t[0].l1&&Po(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,o){q(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&$(n,1)):(n=Po(i),n.c(),$(n,1),n.m(e,null)):n&&(gt(),oe(n,1,1,()=>{n=null}),kt())},i(i){l||($(n),l=!0)},o(i){oe(n),l=!1},d(i){i&&A(e),n&&n.d()}}}function Po(t){var n,i;let e,l;return e=new ls({props:{title:(i=(n=t[6].common)==null?void 0:n.amperage)!=null?i:"Amp",unit:"A",importColorFn:Zi,exportColorFn:Qn,maxImport:t[0].mf,maxExport:t[0].om?t[9]?t[0].om/.4/Math.sqrt(3):t[0].om/.23:0,l1:t[0].l1&&t[0].l1.u>100,l2:t[0].l2&&t[0].l2.u>100,l3:t[0].l3&&t[0].l3.u>100,l2x:t[0].l2.e,l1i:Math.max(t[0].l1.i,0),l2i:Math.max(t[0].l2.i,0),l3i:Math.max(t[0].l3.i,0),l1e:Math.max(t[0].l1.i*-1,0),l2e:Math.max(t[0].l2.i*-1,0),l3e:Math.max(t[0].l3.i*-1,0)}}),{c(){Re(e.$$.fragment)},m(o,a){De(e,o,a),l=!0},p(o,a){var c,f;const r={};a&64&&(r.title=(f=(c=o[6].common)==null?void 0:c.amperage)!=null?f:"Amp"),a&1&&(r.maxImport=o[0].mf),a&513&&(r.maxExport=o[0].om?o[9]?o[0].om/.4/Math.sqrt(3):o[0].om/.23:0),a&1&&(r.l1=o[0].l1&&o[0].l1.u>100),a&1&&(r.l2=o[0].l2&&o[0].l2.u>100),a&1&&(r.l3=o[0].l3&&o[0].l3.u>100),a&1&&(r.l2x=o[0].l2.e),a&1&&(r.l1i=Math.max(o[0].l1.i,0)),a&1&&(r.l2i=Math.max(o[0].l2.i,0)),a&1&&(r.l3i=Math.max(o[0].l3.i,0)),a&1&&(r.l1e=Math.max(o[0].l1.i*-1,0)),a&1&&(r.l2e=Math.max(o[0].l2.i*-1,0)),a&1&&(r.l3e=Math.max(o[0].l3.i*-1,0)),e.$set(r)},i(o){l||($(e.$$.fragment,o),l=!0)},o(o){oe(e.$$.fragment,o),l=!1},d(o){Le(e,o)}}}function Ao(t){let e,l,n=t[0].l1&&qo(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,o){q(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&$(n,1)):(n=qo(i),n.c(),$(n,1),n.m(e,null)):n&&(gt(),oe(n,1,1,()=>{n=null}),kt())},i(i){l||($(n),l=!0)},o(i){oe(n),l=!1},d(i){i&&A(e),n&&n.d()}}}function qo(t){var n,i;let e,l;return e=new ls({props:{title:(i=(n=t[6].dashboard)==null?void 0:n.phase)!=null?i:"Phase",unit:"W",importColorFn:Zi,exportColorFn:Qn,maxImport:(t[0].mf?t[0].mf:32)*230,maxExport:t[0].om?t[9]?t[0].om*1e3/Math.sqrt(3):t[0].om*1e3:0,l1:t[0].l1&&t[0].l1.u>100,l2:t[0].l2&&t[0].l2.u>100,l3:t[0].l3&&t[0].l3.u>100,l1i:t[0].l1.p,l2i:t[0].l2.p,l3i:t[0].l3.p,l1e:t[0].l1.q,l2e:t[0].l2.q,l3e:t[0].l3.q}}),{c(){Re(e.$$.fragment)},m(o,a){De(e,o,a),l=!0},p(o,a){var c,f;const r={};a&64&&(r.title=(f=(c=o[6].dashboard)==null?void 0:c.phase)!=null?f:"Phase"),a&1&&(r.maxImport=(o[0].mf?o[0].mf:32)*230),a&513&&(r.maxExport=o[0].om?o[9]?o[0].om*1e3/Math.sqrt(3):o[0].om*1e3:0),a&1&&(r.l1=o[0].l1&&o[0].l1.u>100),a&1&&(r.l2=o[0].l2&&o[0].l2.u>100),a&1&&(r.l3=o[0].l3&&o[0].l3.u>100),a&1&&(r.l1i=o[0].l1.p),a&1&&(r.l2i=o[0].l2.p),a&1&&(r.l3i=o[0].l3.p),a&1&&(r.l1e=o[0].l1.q),a&1&&(r.l2e=o[0].l2.q),a&1&&(r.l3e=o[0].l3.q),e.$set(r)},i(o){l||($(e.$$.fragment,o),l=!0)},o(o){oe(e.$$.fragment,o),l=!1},d(o){Le(e,o)}}}function Do(t){let e,l,n=t[0].l1&&Lo(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,o){q(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&$(n,1)):(n=Lo(i),n.c(),$(n,1),n.m(e,null)):n&&(gt(),oe(n,1,1,()=>{n=null}),kt())},i(i){l||($(n),l=!0)},o(i){oe(n),l=!1},d(i){i&&A(e),n&&n.d()}}}function Lo(t){var n,i;let e,l;return e=new ls({props:{title:(i=(n=t[6].dashboard)==null?void 0:n.pf)!=null?i:"Pf",importColorFn:Qn,exportColorFn:Qn,maxImport:1,l1:t[0].l1&&t[0].l1.u>100,l2:t[0].l2&&t[0].l2.u>100,l3:t[0].l3&&t[0].l3.u>100,l1i:t[0].l1.f,l2i:t[0].l2.f,l3i:t[0].l3.f}}),{c(){Re(e.$$.fragment)},m(o,a){De(e,o,a),l=!0},p(o,a){var c,f;const r={};a&64&&(r.title=(f=(c=o[6].dashboard)==null?void 0:c.pf)!=null?f:"Pf"),a&1&&(r.l1=o[0].l1&&o[0].l1.u>100),a&1&&(r.l2=o[0].l2&&o[0].l2.u>100),a&1&&(r.l3=o[0].l3&&o[0].l3.u>100),a&1&&(r.l1i=o[0].l1.f),a&1&&(r.l2i=o[0].l2.f),a&1&&(r.l3i=o[0].l3.f),e.$set(r)},i(o){l||($(e.$$.fragment,o),l=!0)},o(o){oe(e.$$.fragment,o),l=!1},d(o){Le(e,o)}}}function Oo(t){let e,l,n;return l=new W1({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec}}),{c(){e=p("div"),Re(l.$$.fragment),u(e,"class","cnt")},m(i,o){q(i,e,o),De(l,e,null),n=!0},p(i,o){const a={};o&1&&(a.importInstant=i[0].ri),o&1&&(a.exportInstant=i[0].re),o&1&&(a.importTotal=i[0].ric),o&1&&(a.exportTotal=i[0].rec),l.$set(a)},i(i){n||($(l.$$.fragment,i),n=!0)},o(i){oe(l.$$.fragment,i),n=!1},d(i){i&&A(e),Le(l)}}}function Io(t){let e,l,n;return l=new Q1({props:{sysinfo:t[1],data:t[0].ea,currency:t[0].pc,hasExport:t[0].om>0||t[0].e>0}}),{c(){e=p("div"),Re(l.$$.fragment),u(e,"class","cnt")},m(i,o){q(i,e,o),De(l,e,null),n=!0},p(i,o){const a={};o&2&&(a.sysinfo=i[1]),o&1&&(a.data=i[0].ea),o&1&&(a.currency=i[0].pc),o&1&&(a.hasExport=i[0].om>0||i[0].e>0),l.$set(a)},i(i){n||($(l.$$.fragment,i),n=!0)},o(i){oe(l.$$.fragment,i),n=!1},d(i){i&&A(e),Le(l)}}}function Ro(t){var i,o;let e,l,n;return l=new r0({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.tariffpeak)!=null?o:"Tariff peaks"}}),{c(){e=p("div"),Re(l.$$.fragment),u(e,"class","cnt h-64")},m(a,r){q(a,e,r),De(l,e,null),n=!0},p(a,r){var f,_;const c={};r&64&&(c.title=(_=(f=a[6].dashboard)==null?void 0:f.tariffpeak)!=null?_:"Tariff peaks"),l.$set(c)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){oe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function Fo(t){var i,o;let e,l,n;return l=new d0({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.realtime)!=null?o:"Real time"}}),{c(){e=p("div"),Re(l.$$.fragment),u(e,"class","cnt gwf")},m(a,r){q(a,e,r),De(l,e,null),n=!0},p(a,r){var f,_;const c={};r&64&&(c.title=(_=(f=a[6].dashboard)==null?void 0:f.realtime)!=null?_:"Real time"),l.$set(c)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){oe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function Bo(t){var i,o;let e,l,n;return l=new J1({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.price)!=null?o:"Price",json:t[2],sysinfo:t[1]}}),{c(){e=p("div"),Re(l.$$.fragment),u(e,"class","cnt gwf")},m(a,r){q(a,e,r),De(l,e,null),n=!0},p(a,r){var f,_;const c={};r&64&&(c.title=(_=(f=a[6].dashboard)==null?void 0:f.price)!=null?_:"Price"),r&4&&(c.json=a[2]),r&2&&(c.sysinfo=a[1]),l.$set(c)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){oe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function Uo(t){var i,o;let e,l,n;return l=new e0({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.day)!=null?o:"24 hours",json:t[3],sysinfo:t[1]}}),{c(){e=p("div"),Re(l.$$.fragment),u(e,"class","cnt gwf")},m(a,r){q(a,e,r),De(l,e,null),n=!0},p(a,r){var f,_;const c={};r&64&&(c.title=(_=(f=a[6].dashboard)==null?void 0:f.day)!=null?_:"24 hours"),r&8&&(c.json=a[3]),r&2&&(c.sysinfo=a[1]),l.$set(c)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){oe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function jo(t){var i,o;let e,l,n;return l=new n0({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.month)!=null?o:"{0} days",json:t[4],sysinfo:t[1]}}),{c(){e=p("div"),Re(l.$$.fragment),u(e,"class","cnt gwf")},m(a,r){q(a,e,r),De(l,e,null),n=!0},p(a,r){var f,_;const c={};r&64&&(c.title=(_=(f=a[6].dashboard)==null?void 0:f.month)!=null?_:"{0} days"),r&16&&(c.json=a[4]),r&2&&(c.sysinfo=a[1]),l.$set(c)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){oe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function Ho(t){var i,o;let e,l,n;return l=new o0({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.temperature)!=null?o:"Temperature",json:t[5]}}),{c(){e=p("div"),Re(l.$$.fragment),u(e,"class","cnt gwf")},m(a,r){q(a,e,r),De(l,e,null),n=!0},p(a,r){var f,_;const c={};r&64&&(c.title=(_=(f=a[6].dashboard)==null?void 0:f.temperature)!=null?_:"Temperature"),r&32&&(c.json=a[5]),l.$set(c)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){oe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function b0(t){let e,l=Yt(t[1].ui.i,t[0].i),n,i=Yt(t[1].ui.e,t[0].om||t[0].e>0),o,a=Yt(t[1].ui.v,t[0].l1&&(t[0].l1.u>100||t[0].l2.u>100||t[0].l3.u>100)),r,c=Yt(t[1].ui.a,t[0].l1&&(t[0].l1.i>.01||t[0].l2.i>.01||t[0].l3.i>.01)),f,_=Yt(t[1].ui.h,t[0].l1&&(t[0].l1.p>.01||t[0].l2.p>.01||t[0].l3.p>.01||t[0].l1.q>.01||t[0].l2.q>.01||t[0].l3.q>.01)),m,d=Yt(t[1].ui.f,t[0].l1&&(t[0].l1.f>.01||t[0].l2.f>.01||t[0].l3.f>.01)),v,h=Yt(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),k,g=Yt(t[1].ui.c,t[0].ea),T,O=Yt(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("NO")||t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),E,I=Yt(t[1].ui.l,t[0].hm==1),C,j=Yt(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),S,U=Yt(t[1].ui.d,t[3]),G,V=Yt(t[1].ui.m,t[4]),F,R=Yt(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),z,B=l&&So(t),H=i&&Co(t),W=a&&No(t),K=c&&Eo(t),Q=_&&Ao(t),Z=d&&Do(t),se=h&&Oo(t),X=g&&Io(t),J=O&&Ro(t),ae=I&&Fo(t),le=j&&Bo(t),ne=U&&Uo(t),fe=V&&jo(t),ue=R&&Ho(t);return{c(){e=p("div"),B&&B.c(),n=b(),H&&H.c(),o=b(),W&&W.c(),r=b(),K&&K.c(),f=b(),Q&&Q.c(),m=b(),Z&&Z.c(),v=b(),se&&se.c(),k=b(),X&&X.c(),T=b(),J&&J.c(),E=b(),ae&&ae.c(),C=b(),le&&le.c(),S=b(),ne&&ne.c(),G=b(),fe&&fe.c(),F=b(),ue&&ue.c(),u(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(Y,x){q(Y,e,x),B&&B.m(e,null),s(e,n),H&&H.m(e,null),s(e,o),W&&W.m(e,null),s(e,r),K&&K.m(e,null),s(e,f),Q&&Q.m(e,null),s(e,m),Z&&Z.m(e,null),s(e,v),se&&se.m(e,null),s(e,k),X&&X.m(e,null),s(e,T),J&&J.m(e,null),s(e,E),ae&&ae.m(e,null),s(e,C),le&&le.m(e,null),s(e,S),ne&&ne.m(e,null),s(e,G),fe&&fe.m(e,null),s(e,F),ue&&ue.m(e,null),z=!0},p(Y,[x]){x&3&&(l=Yt(Y[1].ui.i,Y[0].i)),l?B?(B.p(Y,x),x&3&&$(B,1)):(B=So(Y),B.c(),$(B,1),B.m(e,n)):B&&(gt(),oe(B,1,1,()=>{B=null}),kt()),x&3&&(i=Yt(Y[1].ui.e,Y[0].om||Y[0].e>0)),i?H?(H.p(Y,x),x&3&&$(H,1)):(H=Co(Y),H.c(),$(H,1),H.m(e,o)):H&&(gt(),oe(H,1,1,()=>{H=null}),kt()),x&3&&(a=Yt(Y[1].ui.v,Y[0].l1&&(Y[0].l1.u>100||Y[0].l2.u>100||Y[0].l3.u>100))),a?W?(W.p(Y,x),x&3&&$(W,1)):(W=No(Y),W.c(),$(W,1),W.m(e,r)):W&&(gt(),oe(W,1,1,()=>{W=null}),kt()),x&3&&(c=Yt(Y[1].ui.a,Y[0].l1&&(Y[0].l1.i>.01||Y[0].l2.i>.01||Y[0].l3.i>.01))),c?K?(K.p(Y,x),x&3&&$(K,1)):(K=Eo(Y),K.c(),$(K,1),K.m(e,f)):K&&(gt(),oe(K,1,1,()=>{K=null}),kt()),x&3&&(_=Yt(Y[1].ui.h,Y[0].l1&&(Y[0].l1.p>.01||Y[0].l2.p>.01||Y[0].l3.p>.01||Y[0].l1.q>.01||Y[0].l2.q>.01||Y[0].l3.q>.01))),_?Q?(Q.p(Y,x),x&3&&$(Q,1)):(Q=Ao(Y),Q.c(),$(Q,1),Q.m(e,m)):Q&&(gt(),oe(Q,1,1,()=>{Q=null}),kt()),x&3&&(d=Yt(Y[1].ui.f,Y[0].l1&&(Y[0].l1.f>.01||Y[0].l2.f>.01||Y[0].l3.f>.01))),d?Z?(Z.p(Y,x),x&3&&$(Z,1)):(Z=Do(Y),Z.c(),$(Z,1),Z.m(e,v)):Z&&(gt(),oe(Z,1,1,()=>{Z=null}),kt()),x&3&&(h=Yt(Y[1].ui.r,Y[0].ri>0||Y[0].re>0||Y[0].ric>0||Y[0].rec>0)),h?se?(se.p(Y,x),x&3&&$(se,1)):(se=Oo(Y),se.c(),$(se,1),se.m(e,k)):se&&(gt(),oe(se,1,1,()=>{se=null}),kt()),x&3&&(g=Yt(Y[1].ui.c,Y[0].ea)),g?X?(X.p(Y,x),x&3&&$(X,1)):(X=Io(Y),X.c(),$(X,1),X.m(e,T)):X&&(gt(),oe(X,1,1,()=>{X=null}),kt()),x&3&&(O=Yt(Y[1].ui.t,Y[0].pr&&(Y[0].pr.startsWith("NO")||Y[0].pr.startsWith("10YNO")||Y[0].pr.startsWith("10Y1001A1001A4")))),O?J?(J.p(Y,x),x&3&&$(J,1)):(J=Ro(Y),J.c(),$(J,1),J.m(e,E)):J&&(gt(),oe(J,1,1,()=>{J=null}),kt()),x&3&&(I=Yt(Y[1].ui.l,Y[0].hm==1)),I?ae?(ae.p(Y,x),x&3&&$(ae,1)):(ae=Fo(Y),ae.c(),$(ae,1),ae.m(e,C)):ae&&(gt(),oe(ae,1,1,()=>{ae=null}),kt()),x&3&&(j=Yt(Y[1].ui.p,Y[0].pe&&!Number.isNaN(Y[0].p))),j?le?(le.p(Y,x),x&3&&$(le,1)):(le=Bo(Y),le.c(),$(le,1),le.m(e,S)):le&&(gt(),oe(le,1,1,()=>{le=null}),kt()),x&10&&(U=Yt(Y[1].ui.d,Y[3])),U?ne?(ne.p(Y,x),x&10&&$(ne,1)):(ne=Uo(Y),ne.c(),$(ne,1),ne.m(e,G)):ne&&(gt(),oe(ne,1,1,()=>{ne=null}),kt()),x&18&&(V=Yt(Y[1].ui.m,Y[4])),V?fe?(fe.p(Y,x),x&18&&$(fe,1)):(fe=jo(Y),fe.c(),$(fe,1),fe.m(e,F)):fe&&(gt(),oe(fe,1,1,()=>{fe=null}),kt()),x&35&&(R=Yt(Y[1].ui.s,Y[0].t&&Y[0].t!=-127&&Y[5].c>1)),R?ue?(ue.p(Y,x),x&35&&$(ue,1)):(ue=Ho(Y),ue.c(),$(ue,1),ue.m(e,null)):ue&&(gt(),oe(ue,1,1,()=>{ue=null}),kt())},i(Y){z||($(B),$(H),$(W),$(K),$(Q),$(Z),$(se),$(X),$(J),$(ae),$(le),$(ne),$(fe),$(ue),z=!0)},o(Y){oe(B),oe(H),oe(W),oe(K),oe(Q),oe(Z),oe(se),oe(X),oe(J),oe(ae),oe(le),oe(ne),oe(fe),oe(ue),z=!1},d(Y){Y&&A(e),B&&B.d(),H&&H.d(),W&&W.d(),K&&K.d(),Q&&Q.d(),Z&&Z.d(),se&&se.d(),X&&X.d(),J&&J.d(),ae&&ae.d(),le&&le.d(),ne&&ne.d(),fe&&fe.d(),ue&&ue.d()}}}function g0(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},a={},r={},c={};$i.subscribe(g=>{l(2,o=g)}),du.subscribe(g=>{l(3,a=g)}),vu.subscribe(g=>{l(4,r=g)}),bu.subscribe(g=>{l(5,c=g)});let f={};pl.subscribe(g=>{l(6,f=g)});let _,m,d,v,h,k;return t.$$set=g=>{"data"in g&&l(0,n=g.data),"sysinfo"in g&&l(1,i=g.sysinfo)},t.$$.update=()=>{var g,T,O,E,I,C,j,S,U,G,V,F;t.$$.dirty&7169&&(l(7,_=cl((n==null?void 0:n.ic)*1e3,"Wh")),l(8,m=cl((n==null?void 0:n.ec)*1e3,"Wh")),l(10,v=((g=n==null?void 0:n.l1)==null?void 0:g.u)>0||((T=n==null?void 0:n.l1)==null?void 0:T.i)>0||((O=n==null?void 0:n.l1)==null?void 0:O.p)>0||((E=n==null?void 0:n.l1)==null?void 0:E.q)>0),l(11,h=((I=n==null?void 0:n.l2)==null?void 0:I.u)>0||((C=n==null?void 0:n.l2)==null?void 0:C.i)>0||((j=n==null?void 0:n.l2)==null?void 0:j.p)>0||((S=n==null?void 0:n.l2)==null?void 0:S.q)>0),l(12,k=((U=n==null?void 0:n.l3)==null?void 0:U.u)>0||((G=n==null?void 0:n.l3)==null?void 0:G.i)>0||((V=n==null?void 0:n.l3)==null?void 0:V.p)>0||((F=n==null?void 0:n.l3)==null?void 0:F.q)>0),l(9,d=v&&h&&k))},[n,i,o,a,r,c,f,_,m,d,v,h,k]}class k0 extends qt{constructor(e){super(),At(this,e,g0,b0,Nt,{data:0,sysinfo:1})}}let Fi={};const Wn=ll(Fi);async function w0(){Fi=await(await fetch("configuration.json")).json(),Wn.set(Fi)}let Bi={};const Tu=ll(Bi);async function M0(){Bi=await(await fetch("priceconfig.json")).json(),Tu.set(Bi)}function yo(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function S0(t){let e;return{c(){e=p("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){q(l,e,n)},d(l){l&&A(e)}}}function C0(t){let e;return{c(){e=p("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){q(l,e,n)},d(l){l&&A(e)}}}function zo(t){let e;return{c(){e=p("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){q(l,e,n)},d(l){l&&A(e)}}}function Wo(t){let e,l,n;return{c(){e=p("option"),e.textContent="UART1",l=b(),n=p("option"),n.textContent="UART2",e.__value=9,e.value=e.__value,n.__value=16,n.value=n.__value},m(i,o){q(i,e,o),q(i,l,o),q(i,n,o)},d(i){i&&A(e),i&&A(l),i&&A(n)}}}function Go(t){let e;return{c(){e=p("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){q(l,e,n)},d(l){l&&A(e)}}}function Vo(t){let e,l,n;return{c(){e=p("option"),l=M("GPIO"),n=M(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){q(i,e,o),s(e,l),s(e,n)},d(i){i&&A(e)}}}function Ko(t){let e,l=t[4]>1&&!(t[0]=="esp32"&&(t[4]==9||t[4]==16))&&!((t[0]=="esp32s2"||t[0]=="esp32s3")&&t[4]==18)&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Vo(t);return{c(){l&&l.c(),e=Jt()},m(n,i){l&&l.m(n,i),q(n,e,i)},p(n,i){n[4]>1&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!((n[0]=="esp32s2"||n[0]=="esp32s3")&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Vo(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&A(e)}}}function N0(t){let e,l,n,i,o;function a(h,k){return h[0]=="esp32c3"?C0:S0}let r=a(t),c=r(t),f=t[0]=="esp8266"&&zo(),_=(t[0]=="esp32"||t[0]=="esp32solo")&&Wo(),m=(t[0]=="esp32s2"||t[0]=="esp32s3")&&Go(),d={length:t[1]+1},v=[];for(let h=0;h{"chip"in o&&l(0,n=o.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32s3":l(1,i=46);break;case"esp32c3":l(1,i=19);break}},[n,i]}class Ui extends qt{constructor(e){super(),At(this,e,T0,N0,Nt,{chip:0})}}function Yo(t){let e,l,n=t[1]&&Qo(t);return{c(){e=p("div"),l=p("div"),n&&n.c(),u(l,"class","fixed inset-0 bg-gray-500 dark:bg-gray-900 bg-opacity-50 dark:bg-opacity-80 flex items-center justify-center"),u(e,"class","z-50"),u(e,"aria-modal","true")},m(i,o){q(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=Qo(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&A(e),n&&n.d()}}}function Qo(t){let e,l;return{c(){e=p("div"),l=M(t[1]),u(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){q(n,e,i),s(e,l)},p(n,i){i&2&&L(l,n[1])},d(n){n&&A(e)}}}function E0(t){let e,l=t[0]&&Yo(t);return{c(){l&&l.c(),e=Jt()},m(n,i){l&&l.m(n,i),q(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Yo(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Ze,o:Ze,d(n){l&&l.d(n),n&&A(e)}}}function P0(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 _l extends qt{constructor(e){super(),At(this,e,P0,E0,Nt,{active:0,message:1})}}function Xo(t,e,l){const n=t.slice();return n[1]=e[l],n}function Zo(t){let e,l,n=t[1]+"",i;return{c(){e=p("option"),l=M("Europe/"),i=M(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,a){q(o,e,a),s(e,l),s(e,i)},p:Ze,d(o){o&&A(e)}}}function A0(t){let e,l,n,i=t[0],o=[];for(let a=0;a>1&1,D=0;D0;w--)D[w]=D[w]?D[w-1]^C.EXPONENT[U._modN(C.LOG[D[w]]+N)]:D[w-1];D[0]=C.EXPONENT[U._modN(C.LOG[D[0]]+N)]}for(N=0;N<=P;N++)D[N]=C.LOG[D[N]]},_checkBadness:function(){var N,w,P,D,y,ee=0,te=this._badness,ie=this.buffer,_e=this.width;for(y=0;y<_e-1;y++)for(D=0;D<_e-1;D++)(ie[D+_e*y]&&ie[D+1+_e*y]&&ie[D+_e*(y+1)]&&ie[D+1+_e*(y+1)]||!(ie[D+_e*y]||ie[D+1+_e*y]||ie[D+_e*(y+1)]||ie[D+1+_e*(y+1)]))&&(ee+=U.N2);var Ne=0;for(y=0;y<_e;y++){for(P=0,te[0]=0,N=0,D=0;D<_e;D++)w=ie[D+_e*y],N===w?te[P]++:te[++P]=1,N=w,Ne+=N?1:-1;ee+=this._getBadness(P)}Ne<0&&(Ne=-Ne);var Me=0,pe=Ne;for(pe+=pe<<2,pe<<=1;pe>_e*_e;)pe-=_e*_e,Me++;for(ee+=Me*U.N4,D=0;D<_e;D++){for(P=0,te[0]=0,N=0,y=0;y<_e;y++)w=ie[D+_e*y],N===w?te[P]++:te[++P]=1,N=w;ee+=this._getBadness(P)}return ee},_convertBitStream:function(N){var w,P,D=this._ecc,y=this._version;for(P=0;P=te-2&&(N=te-2,y>9&&N--);var ie=N;if(y>9){for(ee[ie+2]=0,ee[ie+3]=0;ie--;)w=ee[ie],ee[ie+3]|=255&w<<4,ee[ie+2]=w>>4;ee[2]|=255&N<<4,ee[1]=N>>4,ee[0]=64|N>>12}else{for(ee[ie+1]=0,ee[ie+2]=0;ie--;)w=ee[ie],ee[ie+2]|=255&w<<4,ee[ie+1]=w>>4;ee[1]|=255&N<<4,ee[0]=64|N>>4}for(ie=N+3-(y<10);ie=5&&(P+=U.N1+D[w]-5);for(w=3;wN||D[w-3]*3>=D[w]*4||D[w+3]*3>=D[w]*4)&&(P+=U.N3);return P},_finish:function(){this._stringBuffer=this.buffer.slice();var N,w,P=0,D=3e4;for(w=0;w<8&&(this._applyMask(w),N=this._checkBadness(),N>=1)D&1&&(y[ee-1-w+ee*8]=1,w<6?y[8+ee*w]=1:y[8+ee*(w+1)]=1);for(w=0;w<7;w++,D>>=1)D&1&&(y[8+ee*(ee-7+w)]=1,w?y[6-w+ee*8]=1:y[7+ee*8]=1)},_interleaveBlocks:function(){var N,w,P=this._dataBlock,D=this._ecc,y=this._eccBlock,ee=0,te=this._calculateMaxLength(),ie=this._neccBlock1,_e=this._neccBlock2,Ne=this._stringBuffer;for(N=0;N1)for(N=T.BLOCK[D],P=y-7;;){for(w=y-7;w>N-3&&(this._addAlignment(w,P),!(w6)for(N=S.BLOCK[ee-7],w=17,P=0;P<6;P++)for(D=0;D<3;D++,w--)1&(w>11?ee>>w-12:N>>w)?(y[5-P+te*(2-D+te-11)]=1,y[2-D+te-11+te*(5-P)]=1):(this._setMask(5-P,2-D+te-11),this._setMask(2-D+te-11,5-P))},_isMasked:function(N,w){var P=U._getMaskBit(N,w);return this._mask[P]===1},_pack:function(){var N,w,P,D=1,y=1,ee=this.width,te=ee-1,ie=ee-1,_e=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(w=0;w<_e;w++)for(N=this._stringBuffer[w],P=0;P<8;P++,N<<=1){128&N&&(this.buffer[te+ee*ie]=1);do y?te--:(te++,D?ie!==0?ie--:(te-=2,D=!D,te===6&&(te--,ie=9)):ie!==ee-1?ie++:(te-=2,D=!D,te===6&&(te--,ie-=8))),y=!y;while(this._isMasked(te,ie))}},_reverseMask:function(){var N,w,P=this.width;for(N=0;N<9;N++)this._setMask(N,8);for(N=0;N<8;N++)this._setMask(N+P-8,8),this._setMask(8,N);for(w=0;w<7;w++)this._setMask(8,w+P-7)},_setMask:function(N,w){var P=U._getMaskBit(N,w);this._mask[P]=1},_syncMask:function(){var N,w,P=this.width;for(w=0;ww&&(P=N,N=w,w=P),P=w,P+=w*w,P>>=1,P+=N,P},_modN:function(N){for(;N>=255;)N-=255,N=(N>>8)+(N&255);return N},N1:3,N2:3,N3:40,N4:10}),G=U,V=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var N=this.element;N.width=N.height=this.qrious.size}}),F=V,R=m.extend(function(N,w,P,D){this.name=N,this.modifiable=Boolean(w),this.defaultValue=P,this._valueTransformer=D},{transform:function(N){var w=this._valueTransformer;return typeof w=="function"?w(N,this):N}}),z=R,B=m.extend(null,{abs:function(N){return N!=null?Math.abs(N):null},hasOwn:function(N,w){return Object.prototype.hasOwnProperty.call(N,w)},noop:function(){},toUpperCase:function(N){return N!=null?N.toUpperCase():null}}),H=B,W=m.extend(function(N){this.options={},N.forEach(function(w){this.options[w.name]=w},this)},{exists:function(N){return this.options[N]!=null},get:function(N,w){return W._get(this.options[N],w)},getAll:function(N){var w,P=this.options,D={};for(w in P)H.hasOwn(P,w)&&(D[w]=W._get(P[w],N));return D},init:function(N,w,P){typeof P!="function"&&(P=H.noop);var D,y;for(D in this.options)H.hasOwn(this.options,D)&&(y=this.options[D],W._set(y,y.defaultValue,w),W._createAccessor(y,w,P));this._setAll(N,w,!0)},set:function(N,w,P){return this._set(N,w,P)},setAll:function(N,w){return this._setAll(N,w)},_set:function(N,w,P,D){var y=this.options[N];if(!y)throw new Error("Invalid option: "+N);if(!y.modifiable&&!D)throw new Error("Option cannot be modified: "+N);return W._set(y,w,P)},_setAll:function(N,w,P){if(!N)return!1;var D,y=!1;for(D in N)H.hasOwn(N,D)&&this._set(D,N[D],w,P)&&(y=!0);return y}},{_createAccessor:function(N,w,P){var D={get:function(){return W._get(N,w)}};N.modifiable&&(D.set=function(y){W._set(N,y,w)&&P(y,N)}),Object.defineProperty(w,N.name,D)},_get:function(N,w){return w["_"+N.name]},_set:function(N,w,P){var D="_"+N.name,y=P[D],ee=N.transform(w!=null?w:N.defaultValue);return P[D]=ee,ee!==y}}),K=W,Q=m.extend(function(){this._services={}},{getService:function(N){var w=this._services[N];if(!w)throw new Error("Service is not being managed with name: "+N);return w},setService:function(N,w){if(this._services[N])throw new Error("Service is already managed with name: "+N);w&&(this._services[N]=w)}}),Z=Q,se=new K([new z("background",!0,"white"),new z("backgroundAlpha",!0,1,H.abs),new z("element"),new z("foreground",!0,"black"),new z("foregroundAlpha",!0,1,H.abs),new z("level",!0,"L",H.toUpperCase),new z("mime",!0,"image/png"),new z("padding",!0,null,H.abs),new z("size",!0,100,H.abs),new z("value",!0,"")]),X=new Z,J=m.extend(function(N){se.init(N,this,this.update.bind(this));var w=se.get("element",this),P=X.getService("element"),D=w&&P.isCanvas(w)?w:P.createCanvas(),y=w&&P.isImage(w)?w:P.createImage();this._canvasRenderer=new k(this,D,!0),this._imageRenderer=new F(this,y,y===w),this.update()},{get:function(){return se.getAll(this)},set:function(N){se.setAll(N,this)&&this.update()},toDataURL:function(N){return this.canvas.toDataURL(N||this.mime)},update:function(){var N=new G({level:this.level,value:this.value});this._canvasRenderer.render(N),this._imageRenderer.render(N)}},{use:function(N){X.setService(N.getName(),N)}});Object.defineProperties(J.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var ae=J,le=ae,ne=m.extend({getName:function(){}}),fe=ne,ue=fe.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(N){},isImage:function(N){}}),Y=ue,x=Y.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(N){return N instanceof HTMLCanvasElement},isImage:function(N){return N instanceof HTMLImageElement}}),ke=x;le.use(new ke);var me=le;return me})})(Pu);const I0=Pu.exports;function R0(t){let e,l;return{c(){e=p("img"),ai(e.src,l=t[2])||u(e,"src",l),u(e,"alt",t[0]),u(e,"class",t[1])},m(n,i){q(n,e,i)},p(n,[i]){i&4&&!ai(e.src,l=n[2])&&u(e,"src",l),i&1&&u(e,"alt",n[0]),i&2&&u(e,"class",n[1])},i:Ze,o:Ze,d(n){n&&A(e)}}}function F0(t,e,l){const n=new I0;let{errorCorrection:i="L"}=e,{background:o="#fff"}=e,{color:a="#000"}=e,{size:r="200"}=e,{value:c=""}=e,{padding:f=0}=e,{className:_="qrcode"}=e,m="";function d(){n.set({background:o,foreground:a,level:i,padding:f,size:r,value:c}),l(2,m=n.toDataURL("image/jpeg"))}return Rf(()=>{d()}),t.$$set=v=>{"errorCorrection"in v&&l(3,i=v.errorCorrection),"background"in v&&l(4,o=v.background),"color"in v&&l(5,a=v.color),"size"in v&&l(6,r=v.size),"value"in v&&l(0,c=v.value),"padding"in v&&l(7,f=v.padding),"className"in v&&l(1,_=v.className)},t.$$.update=()=>{t.$$.dirty&1&&c&&d()},[c,_,m,i,o,a,r,f]}class B0 extends qt{constructor(e){super(),At(this,e,F0,R0,Nt,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function Jo(t,e,l){const n=t.slice();return n[111]=e[l],n}function $o(t,e,l){const n=t.slice();return n[114]=e[l],n[115]=e,n[116]=l,n}function xo(t,e,l){const n=t.slice();return n[117]=e[l],n[118]=e,n[119]=l,n}function U0(t,e,l){const n=t.slice();return n[120]=e[l],n}function j0(t,e,l){const n=t.slice();return n[123]=e[l],n}function ea(t){var yt,Qt,Kt,Vt,xt,el,nl,il,sl,ol,al,fl,ul,Ie,Ut,dl,vl,hl,bl,gl,Ue,_t,He,mt,Cl,Nl,Tl,El,Rl,Fl,Bl,Ul,jl,Hl,yl,zl,Wl;let e,l,n=((Kt=(Qt=(yt=t[2].conf)==null?void 0:yt.general)==null?void 0:Qt.title)!=null?Kt:"General")+"",i,o,a,r,c,f,_,m,d,v,h=((el=(xt=(Vt=t[2].conf)==null?void 0:Vt.general)==null?void 0:xt.hostname)!=null?el:"Hostname")+"",k,g,T,O,E,I,C=((sl=(il=(nl=t[2].conf)==null?void 0:nl.general)==null?void 0:il.timezone)!=null?sl:"Time zone")+"",j,S,U,G,V,F,R,z,B,H,W,K=((fl=(al=(ol=t[2].conf)==null?void 0:ol.price)==null?void 0:al.region)!=null?fl:"Price region")+"",Q,Z,se,X,J,ae,le,ne,fe,ue,Y,x,ke,me,N,w,P,D,y,ee,te,ie,_e,Ne,Me,pe,Ce,we,ge,be,ye,je,Ke,xe=((Ut=(Ie=(ul=t[2].conf)==null?void 0:ul.price)==null?void 0:Ie.currency)!=null?Ut:"Currency")+"",et,Je,nt,We,Oe,ce,Ee,tt,$e,pt,Ge,Ye,Ve=((hl=(vl=(dl=t[2].conf)==null?void 0:dl.price)==null?void 0:vl.enabled)!=null?hl:"Enabled")+"",it,vt,Mt,he,re=((_t=(Ue=(gl=(bl=t[2].conf)==null?void 0:bl.general)==null?void 0:gl.security)==null?void 0:Ue.title)!=null?_t:"Security")+"",Fe,Tt,Se,Ae,dt,ut=((Nl=(Cl=(mt=(He=t[2].conf)==null?void 0:He.general)==null?void 0:mt.security)==null?void 0:Cl.none)!=null?Nl:"None")+"",rt,ct,Et=((Fl=(Rl=(El=(Tl=t[2].conf)==null?void 0:Tl.general)==null?void 0:El.security)==null?void 0:Rl.conf)!=null?Fl:"Conf")+"",Lt,St,Pt=((Hl=(jl=(Ul=(Bl=t[2].conf)==null?void 0:Bl.general)==null?void 0:Ul.security)==null?void 0:jl.all)!=null?Hl:"All")+"",Ot,Ht,Ct,ht,Dt=((Wl=(zl=(yl=t[2].conf)==null?void 0:yl.general)==null?void 0:zl.context)!=null?Wl:"Context")+"",Ft,Wt,Qe,Xe,Bt,ot,bt,wt;V=new D0({});let de=!t[6].p.t&&ta(),qe=["NOK","SEK","DKK","EUR","CHF"],Pe=[];for(let st=0;st<5;st+=1)Pe[st]=H0(j0(t,qe,st));Ee=new Ml({props:{to:"/priceconfig",class:"text-blue-600 hover:text-blue-800",$$slots:{default:[y0]},$$scope:{ctx:t}}});let Be=t[6].p.e&&t[0].chip!="esp8266"&&la(t),ze=t[6].g.s>0&&na(t);return{c(){var st,jt,rl;e=p("div"),l=p("strong"),i=M(n),o=b(),a=p("a"),r=M("\u24D8"),c=b(),f=p("input"),_=b(),m=p("div"),d=p("div"),v=p("div"),k=M(h),g=p("br"),T=b(),O=p("input"),E=b(),I=p("div"),j=M(C),S=p("br"),U=b(),G=p("select"),Re(V.$$.fragment),F=b(),R=p("input"),z=b(),B=p("div"),H=p("div"),W=p("div"),Q=M(K),Z=p("br"),se=b(),X=p("select"),J=p("optgroup"),de&&de.c(),ae=p("option"),ae.textContent="NO1",le=p("option"),le.textContent="NO2",ne=p("option"),ne.textContent="NO3",fe=p("option"),fe.textContent="NO4",ue=p("option"),ue.textContent="NO5",Y=p("optgroup"),x=p("option"),x.textContent="SE1",ke=p("option"),ke.textContent="SE2",me=p("option"),me.textContent="SE3",N=p("option"),N.textContent="SE4",w=p("optgroup"),P=p("option"),P.textContent="DK1",D=p("option"),D.textContent="DK2",y=p("option"),y.textContent="Austria",ee=p("option"),ee.textContent="Belgium",te=p("option"),te.textContent="Czech Republic",ie=p("option"),ie.textContent="Estonia",_e=p("option"),_e.textContent="Finland",Ne=p("option"),Ne.textContent="France",Me=p("option"),Me.textContent="Germany",pe=p("option"),pe.textContent="Great Britain",Ce=p("option"),Ce.textContent="Latvia",we=p("option"),we.textContent="Lithuania",ge=p("option"),ge.textContent="Netherland",be=p("option"),be.textContent="Poland",ye=p("option"),ye.textContent="Switzerland",je=b(),Ke=p("div"),et=M(xe),Je=p("br"),nt=b(),We=p("select");for(let wl=0;wl<5;wl+=1)Pe[wl].c();Oe=b(),ce=p("div"),Re(Ee.$$.fragment),tt=b(),$e=p("div"),pt=p("label"),Ge=p("input"),Ye=b(),it=M(Ve),vt=b(),Be&&Be.c(),Mt=b(),he=p("div"),Fe=M(re),Tt=p("br"),Se=b(),Ae=p("select"),dt=p("option"),rt=M(ut),ct=p("option"),Lt=M(Et),St=p("option"),Ot=M(Pt),Ht=b(),ze&&ze.c(),Ct=b(),ht=p("div"),Ft=M(Dt),Wt=p("br"),Qe=b(),Xe=p("input"),u(l,"class","text-sm"),u(a,"href",kl("General-configuration")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","g"),f.value="true",u(O,"name","gh"),u(O,"type","text"),u(O,"class","in-f w-full"),u(O,"pattern","[A-Za-z0-9-]+"),u(G,"name","gt"),u(G,"class","in-l w-full"),t[6].g.t===void 0&&Gt(()=>t[23].call(G)),u(d,"class","flex"),u(m,"class","my-1"),u(R,"type","hidden"),u(R,"name","p"),R.value="true",ae.__value="10YNO-1--------2",ae.value=ae.__value,le.__value="10YNO-2--------T",le.value=le.__value,ne.__value="10YNO-3--------J",ne.value=ne.__value,fe.__value="10YNO-4--------9",fe.value=fe.__value,ue.__value="10Y1001A1001A48H",ue.value=ue.__value,u(J,"label","Norway"),x.__value="10Y1001A1001A44P",x.value=x.__value,ke.__value="10Y1001A1001A45N",ke.value=ke.__value,me.__value="10Y1001A1001A46L",me.value=me.__value,N.__value="10Y1001A1001A47J",N.value=N.__value,u(Y,"label","Sweden"),P.__value="10YDK-1--------W",P.value=P.__value,D.__value="10YDK-2--------M",D.value=D.__value,u(w,"label","Denmark"),y.__value="10YAT-APG------L",y.value=y.__value,ee.__value="10YBE----------2",ee.value=ee.__value,te.__value="10YCZ-CEPS-----N",te.value=te.__value,ie.__value="10Y1001A1001A39I",ie.value=ie.__value,_e.__value="10YFI-1--------U",_e.value=_e.__value,Ne.__value="10YFR-RTE------C",Ne.value=Ne.__value,Me.__value="10Y1001A1001A83F",Me.value=Me.__value,pe.__value="10YGB----------A",pe.value=pe.__value,Ce.__value="10YLV-1001A00074",Ce.value=Ce.__value,we.__value="10YLT-1001A0008Q",we.value=we.__value,ge.__value="10YNL----------L",ge.value=ge.__value,be.__value="10YPL-AREA-----S",be.value=be.__value,ye.__value="10YCH-SWISSGRIDZ",ye.value=ye.__value,u(X,"name","pr"),u(X,"class","in-f w-full"),t[6].p.r===void 0&&Gt(()=>t[24].call(X)),u(W,"class","w-full"),u(We,"name","pc"),u(We,"class","in-l"),t[6].p.c===void 0&&Gt(()=>t[25].call(We)),u(H,"class","flex"),u(B,"class","my-1"),u(ce,"class","my-1"),u(Ge,"type","checkbox"),u(Ge,"name","pe"),Ge.__value="true",Ge.value=Ge.__value,u(Ge,"class","rounded mb-1"),u($e,"class","my-1"),dt.__value=0,dt.value=dt.__value,ct.__value=1,ct.value=ct.__value,St.__value=2,St.value=St.__value,u(Ae,"name","gs"),u(Ae,"class","in-s"),t[6].g.s===void 0&&Gt(()=>t[28].call(Ae)),u(he,"class","my-1"),u(Xe,"name","gc"),u(Xe,"type","text"),u(Xe,"pattern","[A-Za-z0-9]+"),u(Xe,"placeholder",Bt=(rl=(jt=(st=t[2].conf)==null?void 0:st.general)==null?void 0:jt.context_placeholder)!=null?rl:"/"),u(Xe,"class","in-s"),u(Xe,"maxlength","36"),u(ht,"class","my-1"),u(e,"class","cnt")},m(st,jt){q(st,e,jt),s(e,l),s(l,i),s(e,o),s(e,a),s(a,r),s(e,c),s(e,f),s(e,_),s(e,m),s(m,d),s(d,v),s(v,k),s(v,g),s(v,T),s(v,O),Te(O,t[6].g.h),s(d,E),s(d,I),s(I,j),s(I,S),s(I,U),s(I,G),De(V,G,null),ft(G,t[6].g.t,!0),s(e,F),s(e,R),s(e,z),s(e,B),s(B,H),s(H,W),s(W,Q),s(W,Z),s(W,se),s(W,X),s(X,J),de&&de.m(J,null),s(J,ae),s(J,le),s(J,ne),s(J,fe),s(J,ue),s(X,Y),s(Y,x),s(Y,ke),s(Y,me),s(Y,N),s(X,w),s(w,P),s(w,D),s(X,y),s(X,ee),s(X,te),s(X,ie),s(X,_e),s(X,Ne),s(X,Me),s(X,pe),s(X,Ce),s(X,we),s(X,ge),s(X,be),s(X,ye),ft(X,t[6].p.r,!0),s(H,je),s(H,Ke),s(Ke,et),s(Ke,Je),s(Ke,nt),s(Ke,We);for(let rl=0;rl<5;rl+=1)Pe[rl]&&Pe[rl].m(We,null);ft(We,t[6].p.c,!0),s(e,Oe),s(e,ce),De(Ee,ce,null),s(e,tt),s(e,$e),s($e,pt),s(pt,Ge),Ge.checked=t[6].p.e,s(pt,Ye),s(pt,it),s($e,vt),Be&&Be.m($e,null),s(e,Mt),s(e,he),s(he,Fe),s(he,Tt),s(he,Se),s(he,Ae),s(Ae,dt),s(dt,rt),s(Ae,ct),s(ct,Lt),s(Ae,St),s(St,Ot),ft(Ae,t[6].g.s,!0),s(e,Ht),ze&&ze.m(e,null),s(e,Ct),s(e,ht),s(ht,Ft),s(ht,Wt),s(ht,Qe),s(ht,Xe),Te(Xe,t[6].g.c),ot=!0,bt||(wt=[ve(O,"input",t[22]),ve(G,"change",t[23]),ve(X,"change",t[24]),ve(We,"change",t[25]),ve(Ge,"change",t[26]),ve(Ae,"change",t[28]),ve(Xe,"input",t[31])],bt=!0)},p(st,jt){var wl,Gl,mn,pn,dn,vn,hn,bn,gn,kn,wn,Mn,Sn,Cn,Nn,Tn,En,Pn,An,qn,Dn,Ln,On,In,Rn,Fn,Bn,Un,jn,Hn,is,ss,os,as,fs,us,rs,cs,_s,ms;(!ot||jt[0]&4)&&n!==(n=((mn=(Gl=(wl=st[2].conf)==null?void 0:wl.general)==null?void 0:Gl.title)!=null?mn:"General")+"")&&L(i,n),(!ot||jt[0]&4)&&h!==(h=((vn=(dn=(pn=st[2].conf)==null?void 0:pn.general)==null?void 0:dn.hostname)!=null?vn:"Hostname")+"")&&L(k,h),jt[0]&64&&O.value!==st[6].g.h&&Te(O,st[6].g.h),(!ot||jt[0]&4)&&C!==(C=((gn=(bn=(hn=st[2].conf)==null?void 0:hn.general)==null?void 0:bn.timezone)!=null?gn:"Time zone")+"")&&L(j,C),jt[0]&64&&ft(G,st[6].g.t),(!ot||jt[0]&4)&&K!==(K=((Mn=(wn=(kn=st[2].conf)==null?void 0:kn.price)==null?void 0:wn.region)!=null?Mn:"Price region")+"")&&L(Q,K),st[6].p.t?de&&(de.d(1),de=null):de||(de=ta(),de.c(),de.m(J,ae)),jt[0]&64&&ft(X,st[6].p.r),(!ot||jt[0]&4)&&xe!==(xe=((Nn=(Cn=(Sn=st[2].conf)==null?void 0:Sn.price)==null?void 0:Cn.currency)!=null?Nn:"Currency")+"")&&L(et,xe),jt[0]&64&&ft(We,st[6].p.c);const rl={};jt[0]&4|jt[4]&4&&(rl.$$scope={dirty:jt,ctx:st}),Ee.$set(rl),jt[0]&64&&(Ge.checked=st[6].p.e),(!ot||jt[0]&4)&&Ve!==(Ve=((Pn=(En=(Tn=st[2].conf)==null?void 0:Tn.price)==null?void 0:En.enabled)!=null?Pn:"Enabled")+"")&&L(it,Ve),st[6].p.e&&st[0].chip!="esp8266"?Be?Be.p(st,jt):(Be=la(st),Be.c(),Be.m($e,null)):Be&&(Be.d(1),Be=null),(!ot||jt[0]&4)&&re!==(re=((Ln=(Dn=(qn=(An=st[2].conf)==null?void 0:An.general)==null?void 0:qn.security)==null?void 0:Dn.title)!=null?Ln:"Security")+"")&&L(Fe,re),(!ot||jt[0]&4)&&ut!==(ut=((Fn=(Rn=(In=(On=st[2].conf)==null?void 0:On.general)==null?void 0:In.security)==null?void 0:Rn.none)!=null?Fn:"None")+"")&&L(rt,ut),(!ot||jt[0]&4)&&Et!==(Et=((Hn=(jn=(Un=(Bn=st[2].conf)==null?void 0:Bn.general)==null?void 0:Un.security)==null?void 0:jn.conf)!=null?Hn:"Conf")+"")&&L(Lt,Et),(!ot||jt[0]&4)&&Pt!==(Pt=((as=(os=(ss=(is=st[2].conf)==null?void 0:is.general)==null?void 0:ss.security)==null?void 0:os.all)!=null?as:"All")+"")&&L(Ot,Pt),jt[0]&64&&ft(Ae,st[6].g.s),st[6].g.s>0?ze?ze.p(st,jt):(ze=na(st),ze.c(),ze.m(e,Ct)):ze&&(ze.d(1),ze=null),(!ot||jt[0]&4)&&Dt!==(Dt=((rs=(us=(fs=st[2].conf)==null?void 0:fs.general)==null?void 0:us.context)!=null?rs:"Context")+"")&&L(Ft,Dt),(!ot||jt[0]&4&&Bt!==(Bt=(ms=(_s=(cs=st[2].conf)==null?void 0:cs.general)==null?void 0:_s.context_placeholder)!=null?ms:"/"))&&u(Xe,"placeholder",Bt),jt[0]&64&&Xe.value!==st[6].g.c&&Te(Xe,st[6].g.c)},i(st){ot||($(V.$$.fragment,st),$(Ee.$$.fragment,st),ot=!0)},o(st){oe(V.$$.fragment,st),oe(Ee.$$.fragment,st),ot=!1},d(st){st&&A(e),Le(V),de&&de.d(),tl(Pe,st),Le(Ee),Be&&Be.d(),ze&&ze.d(),bt=!1,zt(wt)}}}function ta(t){let e,l,n,i,o;return{c(){e=p("option"),e.textContent="NO1 with support",l=p("option"),l.textContent="NO2 with support",n=p("option"),n.textContent="NO3 with support",i=p("option"),i.textContent="NO4 with support",o=p("option"),o.textContent="NO5 with support",e.__value="NO1S",e.value=e.__value,l.__value="NO2S",l.value=l.__value,n.__value="NO3S",n.value=n.__value,i.__value="NO4S",i.value=i.__value,o.__value="NO5S",o.value=o.__value},m(a,r){q(a,e,r),q(a,l,r),q(a,n,r),q(a,i,r),q(a,o,r)},d(a){a&&A(e),a&&A(l),a&&A(n),a&&A(i),a&&A(o)}}}function H0(t){let e,l;return{c(){e=p("option"),l=M(t[123]),e.__value=t[123],e.value=e.__value},m(n,i){q(n,e,i),s(e,l)},p:Ze,d(n){n&&A(e)}}}function y0(t){var n,i,o;let e=((o=(i=(n=t[2].conf)==null?void 0:n.price)==null?void 0:i.conf)!=null?o:"Configure")+"",l;return{c(){l=M(e)},m(a,r){q(a,l,r)},p(a,r){var c,f,_;r[0]&4&&e!==(e=((_=(f=(c=a[2].conf)==null?void 0:c.price)==null?void 0:f.conf)!=null?_:"Configure")+"")&&L(l,e)},d(a){a&&A(l)}}}function la(t){let e,l,n,i,o;return{c(){var a,r,c;e=p("br"),l=p("input"),u(l,"name","pt"),u(l,"type","text"),u(l,"class","in-s"),u(l,"placeholder",n=(c=(r=(a=t[2].conf)==null?void 0:a.price)==null?void 0:r.api_key_placeholder)!=null?c:"")},m(a,r){q(a,e,r),q(a,l,r),Te(l,t[6].p.t),i||(o=ve(l,"input",t[27]),i=!0)},p(a,r){var c,f,_;r[0]&4&&n!==(n=(_=(f=(c=a[2].conf)==null?void 0:c.price)==null?void 0:f.api_key_placeholder)!=null?_:"")&&u(l,"placeholder",n),r[0]&64&&l.value!==a[6].p.t&&Te(l,a[6].p.t)},d(a){a&&A(e),a&&A(l),i=!1,o()}}}function na(t){var g,T,O,E,I,C,j,S;let e,l=((E=(O=(T=(g=t[2].conf)==null?void 0:g.general)==null?void 0:T.security)==null?void 0:O.username)!=null?E:"Username")+"",n,i,o,a,r,c,f=((S=(j=(C=(I=t[2].conf)==null?void 0:I.general)==null?void 0:C.security)==null?void 0:j.password)!=null?S:"Password")+"",_,m,d,v,h,k;return{c(){e=p("div"),n=M(l),i=p("br"),o=b(),a=p("input"),r=b(),c=p("div"),_=M(f),m=p("br"),d=b(),v=p("input"),u(a,"name","gu"),u(a,"type","text"),u(a,"class","in-s"),u(a,"maxlength","36"),u(e,"class","my-1"),u(v,"name","gp"),u(v,"type","password"),u(v,"class","in-s"),u(v,"maxlength","36"),u(c,"class","my-1")},m(U,G){q(U,e,G),s(e,n),s(e,i),s(e,o),s(e,a),Te(a,t[6].g.u),q(U,r,G),q(U,c,G),s(c,_),s(c,m),s(c,d),s(c,v),Te(v,t[6].g.p),h||(k=[ve(a,"input",t[29]),ve(v,"input",t[30])],h=!0)},p(U,G){var V,F,R,z,B,H,W,K;G[0]&4&&l!==(l=((z=(R=(F=(V=U[2].conf)==null?void 0:V.general)==null?void 0:F.security)==null?void 0:R.username)!=null?z:"Username")+"")&&L(n,l),G[0]&64&&a.value!==U[6].g.u&&Te(a,U[6].g.u),G[0]&4&&f!==(f=((K=(W=(H=(B=U[2].conf)==null?void 0:B.general)==null?void 0:H.security)==null?void 0:W.password)!=null?K:"Password")+"")&&L(_,f),G[0]&64&&v.value!==U[6].g.p&&Te(v,U[6].g.p)},d(U){U&&A(e),U&&A(r),U&&A(c),h=!1,zt(k)}}}function ia(t){var vt,Mt,he,re,Fe,Tt,Se,Ae,dt,ut,rt,ct,Et,Lt,St,Pt,Ot,Ht,Ct,ht,Dt,Ft,Wt,Qe,Xe,Bt,ot,bt,wt,de;let e,l,n=((he=(Mt=(vt=t[2].conf)==null?void 0:vt.meter)==null?void 0:Mt.title)!=null?he:"Meter")+"",i,o,a,r,c,f,_,m,d,v,h=((Se=(Tt=(Fe=(re=t[2].conf)==null?void 0:re.meter)==null?void 0:Fe.comm)==null?void 0:Tt.title)!=null?Se:"Communication")+"",k,g,T,O,E,I=((rt=(ut=(dt=(Ae=t[2].conf)==null?void 0:Ae.meter)==null?void 0:dt.comm)==null?void 0:ut.passive)!=null?rt:"Passive")+"",C,j,S=((St=(Lt=(Et=(ct=t[2].conf)==null?void 0:ct.meter)==null?void 0:Et.comm)==null?void 0:Lt.pulse)!=null?St:"Pulse")+"",U,G,V,F,R=((Ot=(Pt=t[2].common)==null?void 0:Pt.voltage)!=null?Ot:"Voltage")+"",z,B,H,W,K,Q,Z,se,X,J=((ht=(Ct=(Ht=t[2].conf)==null?void 0:Ht.meter)==null?void 0:Ct.fuse)!=null?ht:"Main fuse")+"",ae,le,ne,fe,ue,Y,x,ke,me,N=((Wt=(Ft=(Dt=t[2].conf)==null?void 0:Dt.meter)==null?void 0:Ft.prod)!=null?Wt:"Production")+"",w,P,D,y,ee,te,ie,_e,Ne,Me,pe,Ce,we,ge,be=((Bt=(Xe=(Qe=t[2].conf)==null?void 0:Qe.meter)==null?void 0:Xe.encrypted)!=null?Bt:"Encrypted")+"",ye,je,Ke,xe,et,Je,nt,We=((de=(wt=(bt=(ot=t[2].conf)==null?void 0:ot.meter)==null?void 0:bt.multipliers)==null?void 0:wt.title)!=null?de:"Multipliers")+"",Oe,ce,Ee,tt;function $e(qe,Pe){return qe[6].m.a===2?W0:z0}let pt=$e(t),Ge=pt(t),Ye=t[6].m.e.e&&sa(t),Ve=t[6].m.e.e&&oa(t),it=t[6].m.m.e&&aa(t);return{c(){e=p("div"),l=p("strong"),i=M(n),o=b(),a=p("a"),r=M("\u24D8"),c=b(),f=p("input"),_=b(),m=p("input"),d=b(),v=p("div"),k=M(h),g=p("br"),T=b(),O=p("select"),E=p("option"),C=M(I),j=p("option"),U=M(S),G=b(),Ge.c(),V=b(),F=p("div"),z=M(R),B=p("br"),H=b(),W=p("select"),K=p("option"),K.textContent="400V (TN)",Q=p("option"),Q.textContent="230V (IT/TT)",Z=b(),se=p("div"),X=p("div"),ae=M(J),le=p("br"),ne=b(),fe=p("label"),ue=p("input"),Y=b(),x=p("span"),x.textContent="A",ke=b(),me=p("div"),w=M(N),P=p("br"),D=b(),y=p("label"),ee=p("input"),te=b(),ie=p("span"),ie.textContent="kWp",_e=b(),Ne=p("div"),Me=b(),pe=p("div"),Ce=p("label"),we=p("input"),ge=b(),ye=M(be),je=b(),Ye&&Ye.c(),Ke=b(),Ve&&Ve.c(),xe=b(),et=p("label"),Je=p("input"),nt=b(),Oe=M(We),ce=b(),it&&it.c(),u(l,"class","text-sm"),u(a,"href",kl("Meter-configuration")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","m"),f.value="true",u(m,"type","hidden"),u(m,"name","mo"),m.value="1",E.__value=0,E.value=E.__value,j.__value=2,j.value=j.__value,u(O,"name","ma"),u(O,"class","in-s"),t[6].m.a===void 0&&Gt(()=>t[32].call(O)),u(v,"class","my-1"),K.__value=2,K.value=K.__value,Q.__value=1,Q.value=Q.__value,u(W,"name","md"),u(W,"class","in-s"),t[6].m.d===void 0&&Gt(()=>t[38].call(W)),u(F,"class","my-1"),u(ue,"name","mf"),u(ue,"type","number"),u(ue,"min","5"),u(ue,"max","65535"),u(ue,"class","in-f tr w-full"),u(x,"class","in-post"),u(fe,"class","flex"),u(X,"class","mx-1"),u(ee,"name","mr"),u(ee,"type","number"),u(ee,"min","0"),u(ee,"max","65535"),u(ee,"class","in-f tr w-full"),u(ie,"class","in-post"),u(y,"class","flex"),u(me,"class","mx-1"),u(se,"class","my-1 flex"),u(Ne,"class","my-1"),u(we,"type","checkbox"),u(we,"name","me"),we.__value="true",we.value=we.__value,u(we,"class","rounded mb-1"),u(pe,"class","my-1"),u(Je,"type","checkbox"),u(Je,"name","mm"),Je.__value="true",Je.value=Je.__value,u(Je,"class","rounded mb-1"),u(e,"class","cnt")},m(qe,Pe){q(qe,e,Pe),s(e,l),s(l,i),s(e,o),s(e,a),s(a,r),s(e,c),s(e,f),s(e,_),s(e,m),s(e,d),s(e,v),s(v,k),s(v,g),s(v,T),s(v,O),s(O,E),s(E,C),s(O,j),s(j,U),ft(O,t[6].m.a,!0),s(e,G),Ge.m(e,null),s(e,V),s(e,F),s(F,z),s(F,B),s(F,H),s(F,W),s(W,K),s(W,Q),ft(W,t[6].m.d,!0),s(e,Z),s(e,se),s(se,X),s(X,ae),s(X,le),s(X,ne),s(X,fe),s(fe,ue),Te(ue,t[6].m.f),s(fe,Y),s(fe,x),s(se,ke),s(se,me),s(me,w),s(me,P),s(me,D),s(me,y),s(y,ee),Te(ee,t[6].m.r),s(y,te),s(y,ie),s(e,_e),s(e,Ne),s(e,Me),s(e,pe),s(pe,Ce),s(Ce,we),we.checked=t[6].m.e.e,s(Ce,ge),s(Ce,ye),s(pe,je),Ye&&Ye.m(pe,null),s(e,Ke),Ve&&Ve.m(e,null),s(e,xe),s(e,et),s(et,Je),Je.checked=t[6].m.m.e,s(et,nt),s(et,Oe),s(e,ce),it&&it.m(e,null),Ee||(tt=[ve(O,"change",t[32]),ve(W,"change",t[38]),ve(ue,"input",t[39]),ve(ee,"input",t[40]),ve(we,"change",t[41]),ve(Je,"change",t[44])],Ee=!0)},p(qe,Pe){var Be,ze,yt,Qt,Kt,Vt,xt,el,nl,il,sl,ol,al,fl,ul,Ie,Ut,dl,vl,hl,bl,gl,Ue,_t,He,mt,Cl,Nl,Tl,El;Pe[0]&4&&n!==(n=((yt=(ze=(Be=qe[2].conf)==null?void 0:Be.meter)==null?void 0:ze.title)!=null?yt:"Meter")+"")&&L(i,n),Pe[0]&4&&h!==(h=((xt=(Vt=(Kt=(Qt=qe[2].conf)==null?void 0:Qt.meter)==null?void 0:Kt.comm)==null?void 0:Vt.title)!=null?xt:"Communication")+"")&&L(k,h),Pe[0]&4&&I!==(I=((sl=(il=(nl=(el=qe[2].conf)==null?void 0:el.meter)==null?void 0:nl.comm)==null?void 0:il.passive)!=null?sl:"Passive")+"")&&L(C,I),Pe[0]&4&&S!==(S=((ul=(fl=(al=(ol=qe[2].conf)==null?void 0:ol.meter)==null?void 0:al.comm)==null?void 0:fl.pulse)!=null?ul:"Pulse")+"")&&L(U,S),Pe[0]&64&&ft(O,qe[6].m.a),pt===(pt=$e(qe))&&Ge?Ge.p(qe,Pe):(Ge.d(1),Ge=pt(qe),Ge&&(Ge.c(),Ge.m(e,V))),Pe[0]&4&&R!==(R=((Ut=(Ie=qe[2].common)==null?void 0:Ie.voltage)!=null?Ut:"Voltage")+"")&&L(z,R),Pe[0]&64&&ft(W,qe[6].m.d),Pe[0]&4&&J!==(J=((hl=(vl=(dl=qe[2].conf)==null?void 0:dl.meter)==null?void 0:vl.fuse)!=null?hl:"Main fuse")+"")&&L(ae,J),Pe[0]&64&&at(ue.value)!==qe[6].m.f&&Te(ue,qe[6].m.f),Pe[0]&4&&N!==(N=((Ue=(gl=(bl=qe[2].conf)==null?void 0:bl.meter)==null?void 0:gl.prod)!=null?Ue:"Production")+"")&&L(w,N),Pe[0]&64&&at(ee.value)!==qe[6].m.r&&Te(ee,qe[6].m.r),Pe[0]&64&&(we.checked=qe[6].m.e.e),Pe[0]&4&&be!==(be=((mt=(He=(_t=qe[2].conf)==null?void 0:_t.meter)==null?void 0:He.encrypted)!=null?mt:"Encrypted")+"")&&L(ye,be),qe[6].m.e.e?Ye?Ye.p(qe,Pe):(Ye=sa(qe),Ye.c(),Ye.m(pe,null)):Ye&&(Ye.d(1),Ye=null),qe[6].m.e.e?Ve?Ve.p(qe,Pe):(Ve=oa(qe),Ve.c(),Ve.m(e,xe)):Ve&&(Ve.d(1),Ve=null),Pe[0]&64&&(Je.checked=qe[6].m.m.e),Pe[0]&4&&We!==(We=((El=(Tl=(Nl=(Cl=qe[2].conf)==null?void 0:Cl.meter)==null?void 0:Nl.multipliers)==null?void 0:Tl.title)!=null?El:"Multipliers")+"")&&L(Oe,We),qe[6].m.m.e?it?it.p(qe,Pe):(it=aa(qe),it.c(),it.m(e,null)):it&&(it.d(1),it=null)},d(qe){qe&&A(e),Ge.d(),Ye&&Ye.d(),Ve&&Ve.d(),it&&it.d(),Ee=!1,zt(tt)}}}function z0(t){var ae,le,ne,fe,ue,Y,x,ke,me;let e,l,n=((ne=(le=(ae=t[2].conf)==null?void 0:ae.meter)==null?void 0:le.buffer)!=null?ne:"Buffer size")+"",i,o,a,r=((Y=(ue=(fe=t[2].conf)==null?void 0:fe.meter)==null?void 0:ue.serial)!=null?Y:"Serial conf.")+"",c,f,_,m,d,v=((me=(ke=(x=t[2].conf)==null?void 0:x.meter)==null?void 0:ke.inverted)!=null?me:"inverted")+"",h,k,g,T,O,E,I,C,j,S,U,G,V,F,R,z,B,H,W,K,Q,Z,se,X=[3,12,24,48,96,192,384,576,1152],J=[];for(let N=0;N<9;N+=1)J[N]=G0(U0(t,X,N));return{c(){e=p("div"),l=p("span"),i=M(n),o=b(),a=p("span"),c=M(r),f=b(),_=p("label"),m=p("input"),d=b(),h=M(v),k=b(),g=p("div"),T=p("select"),O=p("option"),E=M("Autodetect");for(let N=0;N<9;N+=1)J[N].c();C=b(),j=p("select"),S=p("option"),U=M("-"),V=p("option"),V.textContent="7N1",F=p("option"),F.textContent="8N1",R=p("option"),R.textContent="8N2",z=p("option"),z.textContent="7E1",B=p("option"),B.textContent="8E1",W=b(),K=p("input"),u(l,"class","float-right"),u(m,"name","mi"),m.__value="true",m.value=m.__value,u(m,"type","checkbox"),u(m,"class","rounded mb-1"),u(_,"class","mt-2 ml-3 whitespace-nowrap"),O.__value=0,O.value=O.__value,O.disabled=I=t[6].m.b!=0,u(T,"name","mb"),u(T,"class","in-f tr w-1/2"),t[6].m.b===void 0&&Gt(()=>t[35].call(T)),S.__value=0,S.value=S.__value,S.disabled=G=t[6].m.b!=0,V.__value=2,V.value=V.__value,F.__value=3,F.value=F.__value,R.__value=7,R.value=R.__value,z.__value=10,z.value=z.__value,B.__value=11,B.value=B.__value,u(j,"name","mp"),u(j,"class","in-m"),j.disabled=H=t[6].m.b==0,t[6].m.p===void 0&&Gt(()=>t[36].call(j)),u(K,"name","ms"),u(K,"type","number"),u(K,"min",64),u(K,"max",Q=t[0].chip=="esp8266"?t[6].i.h.p==3||t[6].i.h.p==113?512:256:4096),u(K,"step",64),u(K,"class","in-l tr w-1/2"),u(g,"class","flex w-full"),u(e,"class","my-1")},m(N,w){q(N,e,w),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,f),s(e,_),s(_,m),m.checked=t[6].m.i,s(_,d),s(_,h),s(e,k),s(e,g),s(g,T),s(T,O),s(O,E);for(let P=0;P<9;P+=1)J[P]&&J[P].m(T,null);ft(T,t[6].m.b,!0),s(g,C),s(g,j),s(j,S),s(S,U),s(j,V),s(j,F),s(j,R),s(j,z),s(j,B),ft(j,t[6].m.p,!0),s(g,W),s(g,K),Te(K,t[6].m.s),Z||(se=[ve(m,"change",t[34]),ve(T,"change",t[35]),ve(j,"change",t[36]),ve(K,"input",t[37])],Z=!0)},p(N,w){var P,D,y,ee,te,ie,_e,Ne,Me;w[0]&4&&n!==(n=((y=(D=(P=N[2].conf)==null?void 0:P.meter)==null?void 0:D.buffer)!=null?y:"Buffer size")+"")&&L(i,n),w[0]&4&&r!==(r=((ie=(te=(ee=N[2].conf)==null?void 0:ee.meter)==null?void 0:te.serial)!=null?ie:"Serial conf.")+"")&&L(c,r),w[0]&64&&(m.checked=N[6].m.i),w[0]&4&&v!==(v=((Me=(Ne=(_e=N[2].conf)==null?void 0:_e.meter)==null?void 0:Ne.inverted)!=null?Me:"inverted")+"")&&L(h,v),w[0]&64&&I!==(I=N[6].m.b!=0)&&(O.disabled=I),w[0]&64&&ft(T,N[6].m.b),w[0]&64&&G!==(G=N[6].m.b!=0)&&(S.disabled=G),w[0]&64&&H!==(H=N[6].m.b==0)&&(j.disabled=H),w[0]&64&&ft(j,N[6].m.p),w[0]&65&&Q!==(Q=N[0].chip=="esp8266"?N[6].i.h.p==3||N[6].i.h.p==113?512:256:4096)&&u(K,"max",Q),w[0]&64&&at(K.value)!==N[6].m.s&&Te(K,N[6].m.s)},d(N){N&&A(e),tl(J,N),Z=!1,zt(se)}}}function W0(t){var f,_,m;let e,l,n=((m=(_=(f=t[2].conf)==null?void 0:f.meter)==null?void 0:_.pulses)!=null?m:"Pulses per kWh")+"",i,o,a,r,c;return{c(){e=p("div"),l=p("span"),i=M(n),o=b(),a=p("input"),u(a,"name","mb"),u(a,"class","in-s tr"),u(a,"type","number"),u(a,"min",1),u(a,"max",3600),u(e,"class","my-1")},m(d,v){q(d,e,v),s(e,l),s(l,i),s(e,o),s(e,a),Te(a,t[6].m.b),r||(c=ve(a,"input",t[33]),r=!0)},p(d,v){var h,k,g;v[0]&4&&n!==(n=((g=(k=(h=d[2].conf)==null?void 0:h.meter)==null?void 0:k.pulses)!=null?g:"Pulses per kWh")+"")&&L(i,n),v[0]&64&&at(a.value)!==d[6].m.b&&Te(a,d[6].m.b)},d(d){d&&A(e),r=!1,c()}}}function G0(t){let e,l=t[120]*100+"",n;return{c(){e=p("option"),n=M(l),e.__value=t[120]*100,e.value=e.__value},m(i,o){q(i,e,o),s(e,n)},p:Ze,d(i){i&&A(e)}}}function sa(t){let e,l,n,i;return{c(){e=p("br"),l=p("input"),u(l,"name","mek"),u(l,"type","text"),u(l,"class","in-s")},m(o,a){q(o,e,a),q(o,l,a),Te(l,t[6].m.e.k),n||(i=ve(l,"input",t[42]),n=!0)},p(o,a){a[0]&64&&l.value!==o[6].m.e.k&&Te(l,o[6].m.e.k)},d(o){o&&A(e),o&&A(l),n=!1,i()}}}function oa(t){var f,_,m;let e,l=((m=(_=(f=t[2].conf)==null?void 0:f.meter)==null?void 0:_.authkey)!=null?m:"Authentication key")+"",n,i,o,a,r,c;return{c(){e=p("div"),n=M(l),i=p("br"),o=b(),a=p("input"),u(a,"name","mea"),u(a,"type","text"),u(a,"class","in-s"),u(e,"class","my-1")},m(d,v){q(d,e,v),s(e,n),s(e,i),s(e,o),s(e,a),Te(a,t[6].m.e.a),r||(c=ve(a,"input",t[43]),r=!0)},p(d,v){var h,k,g;v[0]&4&&l!==(l=((g=(k=(h=d[2].conf)==null?void 0:h.meter)==null?void 0:k.authkey)!=null?g:"Authentication key")+"")&&L(n,l),v[0]&64&&a.value!==d[6].m.e.a&&Te(a,d[6].m.e.a)},d(d){d&&A(e),r=!1,c()}}}function aa(t){var H,W,K,Q,Z,se,X,J,ae,le,ne,fe,ue,Y,x,ke;let e,l,n=((Q=(K=(W=(H=t[2].conf)==null?void 0:H.meter)==null?void 0:W.multipliers)==null?void 0:K.watt)!=null?Q:"Watt")+"",i,o,a,r,c,f,_=((J=(X=(se=(Z=t[2].conf)==null?void 0:Z.meter)==null?void 0:se.multipliers)==null?void 0:X.volt)!=null?J:"Volt")+"",m,d,v,h,k,g,T=((fe=(ne=(le=(ae=t[2].conf)==null?void 0:ae.meter)==null?void 0:le.multipliers)==null?void 0:ne.amp)!=null?fe:"Amp")+"",O,E,I,C,j,S,U=((ke=(x=(Y=(ue=t[2].conf)==null?void 0:ue.meter)==null?void 0:Y.multipliers)==null?void 0:x.kwh)!=null?ke:"kWh")+"",G,V,F,R,z,B;return{c(){e=p("div"),l=p("div"),i=M(n),o=p("br"),a=b(),r=p("input"),c=b(),f=p("div"),m=M(_),d=p("br"),v=b(),h=p("input"),k=b(),g=p("div"),O=M(T),E=p("br"),I=b(),C=p("input"),j=b(),S=p("div"),G=M(U),V=p("br"),F=b(),R=p("input"),u(r,"name","mmw"),u(r,"type","number"),u(r,"min","0.00"),u(r,"max","1000"),u(r,"step","0.001"),u(r,"class","in-f tr w-full"),u(l,"class","w-1/4"),u(h,"name","mmv"),u(h,"type","number"),u(h,"min","0.00"),u(h,"max","1000"),u(h,"step","0.001"),u(h,"class","in-m tr w-full"),u(f,"class","w-1/4"),u(C,"name","mma"),u(C,"type","number"),u(C,"min","0.00"),u(C,"max","1000"),u(C,"step","0.001"),u(C,"class","in-m tr w-full"),u(g,"class","w-1/4"),u(R,"name","mmc"),u(R,"type","number"),u(R,"min","0.00"),u(R,"max","1000"),u(R,"step","0.001"),u(R,"class","in-l tr w-full"),u(S,"class","w-1/4"),u(e,"class","flex my-1")},m(me,N){q(me,e,N),s(e,l),s(l,i),s(l,o),s(l,a),s(l,r),Te(r,t[6].m.m.w),s(e,c),s(e,f),s(f,m),s(f,d),s(f,v),s(f,h),Te(h,t[6].m.m.v),s(e,k),s(e,g),s(g,O),s(g,E),s(g,I),s(g,C),Te(C,t[6].m.m.a),s(e,j),s(e,S),s(S,G),s(S,V),s(S,F),s(S,R),Te(R,t[6].m.m.c),z||(B=[ve(r,"input",t[45]),ve(h,"input",t[46]),ve(C,"input",t[47]),ve(R,"input",t[48])],z=!0)},p(me,N){var w,P,D,y,ee,te,ie,_e,Ne,Me,pe,Ce,we,ge,be,ye;N[0]&4&&n!==(n=((y=(D=(P=(w=me[2].conf)==null?void 0:w.meter)==null?void 0:P.multipliers)==null?void 0:D.watt)!=null?y:"Watt")+"")&&L(i,n),N[0]&64&&at(r.value)!==me[6].m.m.w&&Te(r,me[6].m.m.w),N[0]&4&&_!==(_=((_e=(ie=(te=(ee=me[2].conf)==null?void 0:ee.meter)==null?void 0:te.multipliers)==null?void 0:ie.volt)!=null?_e:"Volt")+"")&&L(m,_),N[0]&64&&at(h.value)!==me[6].m.m.v&&Te(h,me[6].m.m.v),N[0]&4&&T!==(T=((Ce=(pe=(Me=(Ne=me[2].conf)==null?void 0:Ne.meter)==null?void 0:Me.multipliers)==null?void 0:pe.amp)!=null?Ce:"Amp")+"")&&L(O,T),N[0]&64&&at(C.value)!==me[6].m.m.a&&Te(C,me[6].m.m.a),N[0]&4&&U!==(U=((ye=(be=(ge=(we=me[2].conf)==null?void 0:we.meter)==null?void 0:ge.multipliers)==null?void 0:be.kwh)!=null?ye:"kWh")+"")&&L(G,U),N[0]&64&&at(R.value)!==me[6].m.m.c&&Te(R,me[6].m.m.c)},d(me){me&&A(e),z=!1,zt(B)}}}function fa(t){var U,G,V,F,R,z,B,H,W;let e,l,n=((V=(G=(U=t[2].conf)==null?void 0:U.connection)==null?void 0:G.title)!=null?V:"Connection")+"",i,o,a,r,c,f,_,m,d,v,h=((z=(R=(F=t[2].conf)==null?void 0:F.connection)==null?void 0:R.wifi)!=null?z:"WiFi")+"",k,g,T=((W=(H=(B=t[2].conf)==null?void 0:B.connection)==null?void 0:H.ap)!=null?W:"AP")+"",O,E,I,C,j=t[0].if&&t[0].if.eth&&ua(t),S=(t[6].n.c==1||t[6].n.c==2)&&ra(t);return{c(){e=p("div"),l=p("strong"),i=M(n),o=b(),a=p("a"),r=M("\u24D8"),c=b(),f=p("input"),_=b(),m=p("div"),d=p("select"),v=p("option"),k=M(h),g=p("option"),O=M(T),j&&j.c(),E=b(),S&&S.c(),u(l,"class","text-sm"),u(a,"href",kl("WiFi-configuration")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","w"),f.value="true",v.__value=1,v.value=v.__value,g.__value=2,g.value=g.__value,u(d,"name","nc"),u(d,"class","in-s"),t[6].n.c===void 0&&Gt(()=>t[49].call(d)),u(m,"class","my-1"),u(e,"class","cnt")},m(K,Q){q(K,e,Q),s(e,l),s(l,i),s(e,o),s(e,a),s(a,r),s(e,c),s(e,f),s(e,_),s(e,m),s(m,d),s(d,v),s(v,k),s(d,g),s(g,O),j&&j.m(d,null),ft(d,t[6].n.c,!0),s(e,E),S&&S.m(e,null),I||(C=ve(d,"change",t[49]),I=!0)},p(K,Q){var Z,se,X,J,ae,le,ne,fe,ue;Q[0]&4&&n!==(n=((X=(se=(Z=K[2].conf)==null?void 0:Z.connection)==null?void 0:se.title)!=null?X:"Connection")+"")&&L(i,n),Q[0]&4&&h!==(h=((le=(ae=(J=K[2].conf)==null?void 0:J.connection)==null?void 0:ae.wifi)!=null?le:"WiFi")+"")&&L(k,h),Q[0]&4&&T!==(T=((ue=(fe=(ne=K[2].conf)==null?void 0:ne.connection)==null?void 0:fe.ap)!=null?ue:"AP")+"")&&L(O,T),K[0].if&&K[0].if.eth?j?j.p(K,Q):(j=ua(K),j.c(),j.m(d,null)):j&&(j.d(1),j=null),Q[0]&64&&ft(d,K[6].n.c),K[6].n.c==1||K[6].n.c==2?S?S.p(K,Q):(S=ra(K),S.c(),S.m(e,null)):S&&(S.d(1),S=null)},d(K){K&&A(e),j&&j.d(),S&&S.d(),I=!1,C()}}}function ua(t){var i,o,a;let e,l=((a=(o=(i=t[2].conf)==null?void 0:i.connection)==null?void 0:o.eth)!=null?a:"Ethernet")+"",n;return{c(){e=p("option"),n=M(l),e.__value=3,e.value=e.__value},m(r,c){q(r,e,c),s(e,n)},p(r,c){var f,_,m;c[0]&4&&l!==(l=((m=(_=(f=r[2].conf)==null?void 0:f.connection)==null?void 0:_.eth)!=null?m:"Ethernet")+"")&&L(n,l)},d(r){r&&A(e)}}}function ra(t){var ee,te,ie,_e,Ne,Me,pe,Ce,we,ge,be,ye,je,Ke,xe,et,Je,nt,We,Oe,ce,Ee,tt,$e,pt,Ge,Ye,Ve,it,vt,Mt,he;let e,l=((ie=(te=(ee=t[2].conf)==null?void 0:ee.connection)==null?void 0:te.ssid)!=null?ie:"SSID")+"",n,i,o,a,r,c,f=((Me=(Ne=(_e=t[2].conf)==null?void 0:_e.connection)==null?void 0:Ne.psk)!=null?Me:"Password")+"",_,m,d,v,h,k,g,T=((ge=(we=(Ce=(pe=t[2].conf)==null?void 0:pe.connection)==null?void 0:Ce.ps)==null?void 0:we.title)!=null?ge:"Power saving")+"",O,E,I,C,j,S=((Ke=(je=(ye=(be=t[2].conf)==null?void 0:be.connection)==null?void 0:ye.ps)==null?void 0:je.default)!=null?Ke:"Default")+"",U,G,V=((nt=(Je=(et=(xe=t[2].conf)==null?void 0:xe.connection)==null?void 0:et.ps)==null?void 0:Je.off)!=null?nt:"Off")+"",F,R,z=((Ee=(ce=(Oe=(We=t[2].conf)==null?void 0:We.connection)==null?void 0:Oe.ps)==null?void 0:ce.min)!=null?Ee:"Min")+"",B,H,W=((Ge=(pt=($e=(tt=t[2].conf)==null?void 0:tt.connection)==null?void 0:$e.ps)==null?void 0:pt.max)!=null?Ge:"Max")+"",K,Q,Z,se=((it=(Ve=(Ye=t[2].conf)==null?void 0:Ye.connection)==null?void 0:Ve.pwr)!=null?it:"Power")+"",X,J,ae,le,ne,fe,ue,Y,x,ke,me,N,w=((he=(Mt=(vt=t[2].conf)==null?void 0:vt.connection)==null?void 0:Mt.tick_11b)!=null?he:"802.11b")+"",P,D,y;return{c(){e=p("div"),n=M(l),i=p("br"),o=b(),a=p("input"),r=b(),c=p("div"),_=M(f),m=p("br"),d=b(),v=p("input"),h=b(),k=p("div"),g=p("div"),O=M(T),E=p("br"),I=b(),C=p("select"),j=p("option"),U=M(S),G=p("option"),F=M(V),R=p("option"),B=M(z),H=p("option"),K=M(W),Q=b(),Z=p("div"),X=M(se),J=p("br"),ae=b(),le=p("div"),ne=p("input"),fe=b(),ue=p("span"),ue.textContent="dBm",Y=b(),x=p("div"),ke=p("label"),me=p("input"),N=b(),P=M(w),u(a,"name","ws"),u(a,"type","text"),u(a,"class","in-s"),u(e,"class","my-1"),u(v,"name","wp"),u(v,"type","password"),u(v,"class","in-s"),u(c,"class","my-1"),j.__value=255,j.value=j.__value,G.__value=0,G.value=G.__value,R.__value=1,R.value=R.__value,H.__value=2,H.value=H.__value,u(C,"name","wz"),u(C,"class","in-s"),t[6].w.z===void 0&&Gt(()=>t[52].call(C)),u(g,"class","w-1/2"),u(ne,"name","ww"),u(ne,"type","number"),u(ne,"min","0"),u(ne,"max","20.5"),u(ne,"step","0.5"),u(ne,"class","in-f tr w-full"),u(ue,"class","in-post"),u(le,"class","flex"),u(Z,"class","ml-2 w-1/2"),u(k,"class","my-1 flex"),u(me,"type","checkbox"),u(me,"name","wb"),me.__value="true",me.value=me.__value,u(me,"class","rounded mb-1"),u(x,"class","my-3")},m(re,Fe){q(re,e,Fe),s(e,n),s(e,i),s(e,o),s(e,a),Te(a,t[6].w.s),q(re,r,Fe),q(re,c,Fe),s(c,_),s(c,m),s(c,d),s(c,v),Te(v,t[6].w.p),q(re,h,Fe),q(re,k,Fe),s(k,g),s(g,O),s(g,E),s(g,I),s(g,C),s(C,j),s(j,U),s(C,G),s(G,F),s(C,R),s(R,B),s(C,H),s(H,K),ft(C,t[6].w.z,!0),s(k,Q),s(k,Z),s(Z,X),s(Z,J),s(Z,ae),s(Z,le),s(le,ne),Te(ne,t[6].w.w),s(le,fe),s(le,ue),q(re,Y,Fe),q(re,x,Fe),s(x,ke),s(ke,me),me.checked=t[6].w.b,s(ke,N),s(ke,P),D||(y=[ve(a,"input",t[50]),ve(v,"input",t[51]),ve(C,"change",t[52]),ve(ne,"input",t[53]),ve(me,"change",t[54])],D=!0)},p(re,Fe){var Tt,Se,Ae,dt,ut,rt,ct,Et,Lt,St,Pt,Ot,Ht,Ct,ht,Dt,Ft,Wt,Qe,Xe,Bt,ot,bt,wt,de,qe,Pe,Be,ze,yt,Qt,Kt;Fe[0]&4&&l!==(l=((Ae=(Se=(Tt=re[2].conf)==null?void 0:Tt.connection)==null?void 0:Se.ssid)!=null?Ae:"SSID")+"")&&L(n,l),Fe[0]&64&&a.value!==re[6].w.s&&Te(a,re[6].w.s),Fe[0]&4&&f!==(f=((rt=(ut=(dt=re[2].conf)==null?void 0:dt.connection)==null?void 0:ut.psk)!=null?rt:"Password")+"")&&L(_,f),Fe[0]&64&&v.value!==re[6].w.p&&Te(v,re[6].w.p),Fe[0]&4&&T!==(T=((St=(Lt=(Et=(ct=re[2].conf)==null?void 0:ct.connection)==null?void 0:Et.ps)==null?void 0:Lt.title)!=null?St:"Power saving")+"")&&L(O,T),Fe[0]&4&&S!==(S=((Ct=(Ht=(Ot=(Pt=re[2].conf)==null?void 0:Pt.connection)==null?void 0:Ot.ps)==null?void 0:Ht.default)!=null?Ct:"Default")+"")&&L(U,S),Fe[0]&4&&V!==(V=((Wt=(Ft=(Dt=(ht=re[2].conf)==null?void 0:ht.connection)==null?void 0:Dt.ps)==null?void 0:Ft.off)!=null?Wt:"Off")+"")&&L(F,V),Fe[0]&4&&z!==(z=((ot=(Bt=(Xe=(Qe=re[2].conf)==null?void 0:Qe.connection)==null?void 0:Xe.ps)==null?void 0:Bt.min)!=null?ot:"Min")+"")&&L(B,z),Fe[0]&4&&W!==(W=((qe=(de=(wt=(bt=re[2].conf)==null?void 0:bt.connection)==null?void 0:wt.ps)==null?void 0:de.max)!=null?qe:"Max")+"")&&L(K,W),Fe[0]&64&&ft(C,re[6].w.z),Fe[0]&4&&se!==(se=((ze=(Be=(Pe=re[2].conf)==null?void 0:Pe.connection)==null?void 0:Be.pwr)!=null?ze:"Power")+"")&&L(X,se),Fe[0]&64&&at(ne.value)!==re[6].w.w&&Te(ne,re[6].w.w),Fe[0]&64&&(me.checked=re[6].w.b),Fe[0]&4&&w!==(w=((Kt=(Qt=(yt=re[2].conf)==null?void 0:yt.connection)==null?void 0:Qt.tick_11b)!=null?Kt:"802.11b")+"")&&L(P,w)},d(re){re&&A(e),re&&A(r),re&&A(c),re&&A(h),re&&A(k),re&&A(Y),re&&A(x),D=!1,zt(y)}}}function ca(t){var ye,je,Ke,xe,et,Je,nt,We,Oe,ce,Ee,tt,$e,pt,Ge,Ye,Ve,it,vt,Mt,he;let e,l,n=((Ke=(je=(ye=t[2].conf)==null?void 0:ye.network)==null?void 0:je.title)!=null?Ke:"Network")+"",i,o,a,r,c,f,_=((Je=(et=(xe=t[2].conf)==null?void 0:xe.network)==null?void 0:et.ip)!=null?Je:"IP")+"",m,d,v,h,k,g,T=((Oe=(We=(nt=t[2].conf)==null?void 0:nt.network)==null?void 0:We.dhcp)!=null?Oe:"DHCP")+"",O,E,I=((tt=(Ee=(ce=t[2].conf)==null?void 0:ce.network)==null?void 0:Ee.static)!=null?tt:"Static")+"",C,j,S,U,G,V,F,R,z,B,H,W,K,Q,Z,se,X,J,ae,le,ne,fe=((Ge=(pt=($e=t[2].conf)==null?void 0:$e.network)==null?void 0:pt.tick_mdns)!=null?Ge:"mDNS")+"",ue,Y,x,ke,me,N=((it=(Ve=(Ye=t[2].conf)==null?void 0:Ye.network)==null?void 0:Ve.ntp)!=null?it:"NTP")+"",w,P,D,y,ee,te=((he=(Mt=(vt=t[2].conf)==null?void 0:vt.network)==null?void 0:Mt.tick_ntp_dhcp)!=null?he:"from DHCP")+"",ie,_e,Ne,Me,pe,Ce,we,ge;R=new Eu({});let be=t[6].n.m=="static"&&_a(t);return{c(){e=p("div"),l=p("strong"),i=M(n),o=b(),a=p("a"),r=M("\u24D8"),c=b(),f=p("div"),m=M(_),d=p("br"),v=b(),h=p("div"),k=p("select"),g=p("option"),O=M(T),E=p("option"),C=M(I),j=b(),S=p("input"),V=b(),F=p("select"),Re(R.$$.fragment),H=b(),be&&be.c(),W=b(),K=p("div"),Q=p("label"),Z=p("input"),se=M(" IPv6"),X=b(),J=p("div"),ae=p("label"),le=p("input"),ne=b(),ue=M(fe),Y=b(),x=p("input"),ke=b(),me=p("div"),w=M(N),P=b(),D=p("label"),y=p("input"),ee=b(),ie=M(te),_e=p("br"),Ne=b(),Me=p("div"),pe=p("input"),u(l,"class","text-sm"),u(a,"href",kl("Network-configuration")),u(a,"target","_blank"),u(a,"class","float-right"),g.__value="dhcp",g.value=g.__value,E.__value="static",E.value=E.__value,u(k,"name","nm"),u(k,"class","in-f"),t[6].n.m===void 0&&Gt(()=>t[55].call(k)),u(S,"name","ni"),u(S,"type","text"),u(S,"class","in-m w-full"),S.disabled=U=t[6].n.m=="dhcp",S.required=G=t[6].n.m=="static",u(F,"name","ns"),u(F,"class","in-l"),F.disabled=z=t[6].n.m=="dhcp",F.required=B=t[6].n.m=="static",t[6].n.s===void 0&&Gt(()=>t[57].call(F)),u(h,"class","flex"),u(f,"class","my-1"),u(Z,"name","nx"),Z.__value="true",Z.value=Z.__value,u(Z,"type","checkbox"),u(Z,"class","rounded mb-1"),u(K,"class","my-1"),u(le,"name","nd"),le.__value="true",le.value=le.__value,u(le,"type","checkbox"),u(le,"class","rounded mb-1"),u(J,"class","my-1"),u(x,"type","hidden"),u(x,"name","ntp"),x.value="true",u(y,"name","ntpd"),y.__value="true",y.value=y.__value,u(y,"type","checkbox"),u(y,"class","rounded mb-1"),u(D,"class","ml-4"),u(pe,"name","ntph"),u(pe,"type","text"),u(pe,"class","in-s"),u(Me,"class","flex"),u(me,"class","my-1"),u(e,"class","cnt")},m(re,Fe){q(re,e,Fe),s(e,l),s(l,i),s(e,o),s(e,a),s(a,r),s(e,c),s(e,f),s(f,m),s(f,d),s(f,v),s(f,h),s(h,k),s(k,g),s(g,O),s(k,E),s(E,C),ft(k,t[6].n.m,!0),s(h,j),s(h,S),Te(S,t[6].n.i),s(h,V),s(h,F),De(R,F,null),ft(F,t[6].n.s,!0),s(e,H),be&&be.m(e,null),s(e,W),s(e,K),s(K,Q),s(Q,Z),Z.checked=t[6].n.x,s(Q,se),s(e,X),s(e,J),s(J,ae),s(ae,le),le.checked=t[6].n.d,s(ae,ne),s(ae,ue),s(e,Y),s(e,x),s(e,ke),s(e,me),s(me,w),s(me,P),s(me,D),s(D,y),y.checked=t[6].n.h,s(D,ee),s(D,ie),s(me,_e),s(me,Ne),s(me,Me),s(Me,pe),Te(pe,t[6].n.n1),Ce=!0,we||(ge=[ve(k,"change",t[55]),ve(S,"input",t[56]),ve(F,"change",t[57]),ve(Z,"change",t[61]),ve(le,"change",t[62]),ve(y,"change",t[63]),ve(pe,"input",t[64])],we=!0)},p(re,Fe){var Tt,Se,Ae,dt,ut,rt,ct,Et,Lt,St,Pt,Ot,Ht,Ct,ht,Dt,Ft,Wt,Qe,Xe,Bt;(!Ce||Fe[0]&4)&&n!==(n=((Ae=(Se=(Tt=re[2].conf)==null?void 0:Tt.network)==null?void 0:Se.title)!=null?Ae:"Network")+"")&&L(i,n),(!Ce||Fe[0]&4)&&_!==(_=((rt=(ut=(dt=re[2].conf)==null?void 0:dt.network)==null?void 0:ut.ip)!=null?rt:"IP")+"")&&L(m,_),(!Ce||Fe[0]&4)&&T!==(T=((Lt=(Et=(ct=re[2].conf)==null?void 0:ct.network)==null?void 0:Et.dhcp)!=null?Lt:"DHCP")+"")&&L(O,T),(!Ce||Fe[0]&4)&&I!==(I=((Ot=(Pt=(St=re[2].conf)==null?void 0:St.network)==null?void 0:Pt.static)!=null?Ot:"Static")+"")&&L(C,I),Fe[0]&64&&ft(k,re[6].n.m),(!Ce||Fe[0]&64&&U!==(U=re[6].n.m=="dhcp"))&&(S.disabled=U),(!Ce||Fe[0]&64&&G!==(G=re[6].n.m=="static"))&&(S.required=G),Fe[0]&64&&S.value!==re[6].n.i&&Te(S,re[6].n.i),(!Ce||Fe[0]&64&&z!==(z=re[6].n.m=="dhcp"))&&(F.disabled=z),(!Ce||Fe[0]&64&&B!==(B=re[6].n.m=="static"))&&(F.required=B),Fe[0]&64&&ft(F,re[6].n.s),re[6].n.m=="static"?be?be.p(re,Fe):(be=_a(re),be.c(),be.m(e,W)):be&&(be.d(1),be=null),Fe[0]&64&&(Z.checked=re[6].n.x),Fe[0]&64&&(le.checked=re[6].n.d),(!Ce||Fe[0]&4)&&fe!==(fe=((ht=(Ct=(Ht=re[2].conf)==null?void 0:Ht.network)==null?void 0:Ct.tick_mdns)!=null?ht:"mDNS")+"")&&L(ue,fe),(!Ce||Fe[0]&4)&&N!==(N=((Wt=(Ft=(Dt=re[2].conf)==null?void 0:Dt.network)==null?void 0:Ft.ntp)!=null?Wt:"NTP")+"")&&L(w,N),Fe[0]&64&&(y.checked=re[6].n.h),(!Ce||Fe[0]&4)&&te!==(te=((Bt=(Xe=(Qe=re[2].conf)==null?void 0:Qe.network)==null?void 0:Xe.tick_ntp_dhcp)!=null?Bt:"from DHCP")+"")&&L(ie,te),Fe[0]&64&&pe.value!==re[6].n.n1&&Te(pe,re[6].n.n1)},i(re){Ce||($(R.$$.fragment,re),Ce=!0)},o(re){oe(R.$$.fragment,re),Ce=!1},d(re){re&&A(e),Le(R),be&&be.d(),we=!1,zt(ge)}}}function _a(t){var E,I,C,j,S,U;let e,l=((C=(I=(E=t[2].conf)==null?void 0:E.network)==null?void 0:I.gw)!=null?C:"Gateway")+"",n,i,o,a,r,c,f=((U=(S=(j=t[2].conf)==null?void 0:j.network)==null?void 0:S.dns)!=null?U:"DNS")+"",_,m,d,v,h,k,g,T,O;return{c(){e=p("div"),n=M(l),i=p("br"),o=b(),a=p("input"),r=b(),c=p("div"),_=M(f),m=p("br"),d=b(),v=p("div"),h=p("input"),k=b(),g=p("input"),u(a,"name","ng"),u(a,"type","text"),u(a,"class","in-s"),u(e,"class","my-1"),u(h,"name","nd1"),u(h,"type","text"),u(h,"class","in-f w-full"),u(g,"name","nd2"),u(g,"type","text"),u(g,"class","in-l w-full"),u(v,"class","flex"),u(c,"class","my-1")},m(G,V){q(G,e,V),s(e,n),s(e,i),s(e,o),s(e,a),Te(a,t[6].n.g),q(G,r,V),q(G,c,V),s(c,_),s(c,m),s(c,d),s(c,v),s(v,h),Te(h,t[6].n.d1),s(v,k),s(v,g),Te(g,t[6].n.d2),T||(O=[ve(a,"input",t[58]),ve(h,"input",t[59]),ve(g,"input",t[60])],T=!0)},p(G,V){var F,R,z,B,H,W;V[0]&4&&l!==(l=((z=(R=(F=G[2].conf)==null?void 0:F.network)==null?void 0:R.gw)!=null?z:"Gateway")+"")&&L(n,l),V[0]&64&&a.value!==G[6].n.g&&Te(a,G[6].n.g),V[0]&4&&f!==(f=((W=(H=(B=G[2].conf)==null?void 0:B.network)==null?void 0:H.dns)!=null?W:"DNS")+"")&&L(_,f),V[0]&64&&h.value!==G[6].n.d1&&Te(h,G[6].n.d1),V[0]&64&&g.value!==G[6].n.d2&&Te(g,G[6].n.d2)},d(G){G&&A(e),G&&A(r),G&&A(c),T=!1,zt(O)}}}function ma(t){var $e,pt,Ge,Ye,Ve,it,vt,Mt,he,re,Fe,Tt,Se,Ae,dt,ut,rt,ct,Et,Lt,St,Pt,Ot,Ht,Ct,ht,Dt,Ft,Wt;let e,l,n=((Ge=(pt=($e=t[2].conf)==null?void 0:$e.mqtt)==null?void 0:pt.title)!=null?Ge:"MQTT")+"",i,o,a,r,c,f,_,m,d=((it=(Ve=(Ye=t[2].conf)==null?void 0:Ye.mqtt)==null?void 0:Ve.server)!=null?it:"Server")+"",v,h,k,g,T,O,E,I,C,j,S,U,G=((he=(Mt=(vt=t[2].conf)==null?void 0:vt.mqtt)==null?void 0:Mt.user)!=null?he:"Username")+"",V,F,R,z,B,H,W=((Tt=(Fe=(re=t[2].conf)==null?void 0:re.mqtt)==null?void 0:Fe.pass)!=null?Tt:"Password")+"",K,Q,Z,se,X,J,ae,le=((dt=(Ae=(Se=t[2].conf)==null?void 0:Se.mqtt)==null?void 0:Ae.id)!=null?dt:"Client ID")+"",ne,fe,ue,Y,x,ke,me=((ct=(rt=(ut=t[2].conf)==null?void 0:ut.mqtt)==null?void 0:rt.payload)!=null?ct:"Payload")+"",N,w,P,D,y,ee,te,ie=((Pt=(St=(Lt=(Et=t[2].conf)==null?void 0:Et.mqtt)==null?void 0:Lt.domoticz)==null?void 0:St.title)!=null?Pt:"Domoticz")+"",_e,Ne,Me=((ht=(Ct=(Ht=(Ot=t[2].conf)==null?void 0:Ot.mqtt)==null?void 0:Ht.ha)==null?void 0:Ct.title)!=null?ht:"Home-Assistant")+"",pe,Ce,we,ge,be,ye,je,Ke=((Wt=(Ft=(Dt=t[2].conf)==null?void 0:Dt.mqtt)==null?void 0:Ft.publish)!=null?Wt:"Publish topic")+"",xe,et,Je,nt,We,Oe,ce,Ee=t[0].chip!="esp8266"&&pa(t),tt=t[6].q.s.e&&da(t);return{c(){e=p("div"),l=p("strong"),i=M(n),o=b(),a=p("a"),r=M("\u24D8"),c=b(),f=p("input"),_=b(),m=p("div"),v=M(d),h=b(),Ee&&Ee.c(),k=b(),g=p("br"),T=b(),O=p("div"),E=p("input"),I=b(),C=p("input"),j=b(),tt&&tt.c(),S=b(),U=p("div"),V=M(G),F=p("br"),R=b(),z=p("input"),B=b(),H=p("div"),K=M(W),Q=p("br"),Z=b(),se=p("input"),X=b(),J=p("div"),ae=p("div"),ne=M(le),fe=p("br"),ue=b(),Y=p("input"),x=b(),ke=p("div"),N=M(me),w=p("br"),P=b(),D=p("select"),y=p("option"),y.textContent="Raw (minimal)",ee=p("option"),ee.textContent="Raw (full)",te=p("option"),_e=M(ie),Ne=p("option"),pe=M(Me),Ce=p("option"),Ce.textContent="JSON (classic)",we=p("option"),we.textContent="JSON (multi topic)",ge=p("option"),ge.textContent="JSON (flat)",be=p("option"),be.textContent="HEX dump",ye=b(),je=p("div"),xe=M(Ke),et=p("br"),Je=b(),nt=p("input"),u(l,"class","text-sm"),u(a,"href",kl("MQTT-configuration")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","q"),f.value="true",u(E,"name","qh"),u(E,"type","text"),u(E,"class","in-f w-2/3"),u(C,"name","qp"),u(C,"type","number"),u(C,"min","1024"),u(C,"max","65535"),u(C,"class","in-l tr w-1/3"),u(O,"class","flex"),u(m,"class","my-1"),u(z,"name","qu"),u(z,"type","text"),u(z,"class","in-s"),u(U,"class","my-1"),u(se,"name","qa"),u(se,"type","password"),u(se,"class","in-s"),u(H,"class","my-1"),u(Y,"name","qc"),u(Y,"type","text"),u(Y,"class","in-f w-full"),y.__value=1,y.value=y.__value,ee.__value=2,ee.value=ee.__value,te.__value=3,te.value=te.__value,Ne.__value=4,Ne.value=Ne.__value,Ce.__value=0,Ce.value=Ce.__value,we.__value=5,we.value=we.__value,ge.__value=6,ge.value=ge.__value,be.__value=255,be.value=be.__value,u(D,"name","qm"),u(D,"class","in-l"),t[6].q.m===void 0&&Gt(()=>t[71].call(D)),u(J,"class","my-1 flex"),u(nt,"name","qb"),u(nt,"type","text"),u(nt,"class","in-s"),u(je,"class","my-1"),u(e,"class","cnt")},m(Qe,Xe){q(Qe,e,Xe),s(e,l),s(l,i),s(e,o),s(e,a),s(a,r),s(e,c),s(e,f),s(e,_),s(e,m),s(m,v),s(m,h),Ee&&Ee.m(m,null),s(m,k),s(m,g),s(m,T),s(m,O),s(O,E),Te(E,t[6].q.h),s(O,I),s(O,C),Te(C,t[6].q.p),s(e,j),tt&&tt.m(e,null),s(e,S),s(e,U),s(U,V),s(U,F),s(U,R),s(U,z),Te(z,t[6].q.u),s(e,B),s(e,H),s(H,K),s(H,Q),s(H,Z),s(H,se),Te(se,t[6].q.a),s(e,X),s(e,J),s(J,ae),s(ae,ne),s(ae,fe),s(ae,ue),s(ae,Y),Te(Y,t[6].q.c),s(J,x),s(J,ke),s(ke,N),s(ke,w),s(ke,P),s(ke,D),s(D,y),s(D,ee),s(D,te),s(te,_e),s(D,Ne),s(Ne,pe),s(D,Ce),s(D,we),s(D,ge),s(D,be),ft(D,t[6].q.m,!0),s(e,ye),s(e,je),s(je,xe),s(je,et),s(je,Je),s(je,nt),Te(nt,t[6].q.b),We=!0,Oe||(ce=[ve(E,"input",t[66]),ve(C,"input",t[67]),ve(z,"input",t[68]),ve(se,"input",t[69]),ve(Y,"input",t[70]),ve(D,"change",t[71]),ve(nt,"input",t[72])],Oe=!0)},p(Qe,Xe){var Bt,ot,bt,wt,de,qe,Pe,Be,ze,yt,Qt,Kt,Vt,xt,el,nl,il,sl,ol,al,fl,ul,Ie,Ut,dl,vl,hl,bl,gl;(!We||Xe[0]&4)&&n!==(n=((bt=(ot=(Bt=Qe[2].conf)==null?void 0:Bt.mqtt)==null?void 0:ot.title)!=null?bt:"MQTT")+"")&&L(i,n),(!We||Xe[0]&4)&&d!==(d=((qe=(de=(wt=Qe[2].conf)==null?void 0:wt.mqtt)==null?void 0:de.server)!=null?qe:"Server")+"")&&L(v,d),Qe[0].chip!="esp8266"?Ee?Ee.p(Qe,Xe):(Ee=pa(Qe),Ee.c(),Ee.m(m,k)):Ee&&(Ee.d(1),Ee=null),Xe[0]&64&&E.value!==Qe[6].q.h&&Te(E,Qe[6].q.h),Xe[0]&64&&at(C.value)!==Qe[6].q.p&&Te(C,Qe[6].q.p),Qe[6].q.s.e?tt?(tt.p(Qe,Xe),Xe[0]&64&&$(tt,1)):(tt=da(Qe),tt.c(),$(tt,1),tt.m(e,S)):tt&&(gt(),oe(tt,1,1,()=>{tt=null}),kt()),(!We||Xe[0]&4)&&G!==(G=((ze=(Be=(Pe=Qe[2].conf)==null?void 0:Pe.mqtt)==null?void 0:Be.user)!=null?ze:"Username")+"")&&L(V,G),Xe[0]&64&&z.value!==Qe[6].q.u&&Te(z,Qe[6].q.u),(!We||Xe[0]&4)&&W!==(W=((Kt=(Qt=(yt=Qe[2].conf)==null?void 0:yt.mqtt)==null?void 0:Qt.pass)!=null?Kt:"Password")+"")&&L(K,W),Xe[0]&64&&se.value!==Qe[6].q.a&&Te(se,Qe[6].q.a),(!We||Xe[0]&4)&&le!==(le=((el=(xt=(Vt=Qe[2].conf)==null?void 0:Vt.mqtt)==null?void 0:xt.id)!=null?el:"Client ID")+"")&&L(ne,le),Xe[0]&64&&Y.value!==Qe[6].q.c&&Te(Y,Qe[6].q.c),(!We||Xe[0]&4)&&me!==(me=((sl=(il=(nl=Qe[2].conf)==null?void 0:nl.mqtt)==null?void 0:il.payload)!=null?sl:"Payload")+"")&&L(N,me),(!We||Xe[0]&4)&&ie!==(ie=((ul=(fl=(al=(ol=Qe[2].conf)==null?void 0:ol.mqtt)==null?void 0:al.domoticz)==null?void 0:fl.title)!=null?ul:"Domoticz")+"")&&L(_e,ie),(!We||Xe[0]&4)&&Me!==(Me=((vl=(dl=(Ut=(Ie=Qe[2].conf)==null?void 0:Ie.mqtt)==null?void 0:Ut.ha)==null?void 0:dl.title)!=null?vl:"Home-Assistant")+"")&&L(pe,Me),Xe[0]&64&&ft(D,Qe[6].q.m),(!We||Xe[0]&4)&&Ke!==(Ke=((gl=(bl=(hl=Qe[2].conf)==null?void 0:hl.mqtt)==null?void 0:bl.publish)!=null?gl:"Publish topic")+"")&&L(xe,Ke),Xe[0]&64&&nt.value!==Qe[6].q.b&&Te(nt,Qe[6].q.b)},i(Qe){We||($(tt),We=!0)},o(Qe){oe(tt),We=!1},d(Qe){Qe&&A(e),Ee&&Ee.d(),tt&&tt.d(),Oe=!1,zt(ce)}}}function pa(t){let e,l,n,i,o;return{c(){e=p("label"),l=p("input"),n=M(" SSL"),u(l,"type","checkbox"),u(l,"name","qs"),l.__value="true",l.value=l.__value,u(l,"class","rounded mb-1"),u(e,"class","float-right mr-3")},m(a,r){q(a,e,r),s(e,l),l.checked=t[6].q.s.e,s(e,n),i||(o=[ve(l,"change",t[65]),ve(l,"change",t[18])],i=!0)},p(a,r){r[0]&64&&(l.checked=a[6].q.s.e)},d(a){a&&A(e),i=!1,zt(o)}}}function da(t){let e,l,n,i,o,a,r,c,f,_,m,d,v;const h=[K0,V0],k=[];function g(S,U){return S[6].q.s.c?0:1}n=g(t),i=k[n]=h[n](t);const T=[Z0,X0],O=[];function E(S,U){return S[6].q.s.r?0:1}r=E(t),c=O[r]=T[r](t);const I=[ec,x0],C=[];function j(S,U){return S[6].q.s.k?0:1}return m=j(t),d=C[m]=I[m](t),{c(){e=p("div"),l=p("span"),i.c(),o=b(),a=p("span"),c.c(),f=b(),_=p("span"),d.c(),u(l,"class","flex pr-2"),u(a,"class","flex pr-2"),u(_,"class","flex pr-2"),u(e,"class","my-1 flex")},m(S,U){q(S,e,U),s(e,l),k[n].m(l,null),s(e,o),s(e,a),O[r].m(a,null),s(e,f),s(e,_),C[m].m(_,null),v=!0},p(S,U){let G=n;n=g(S),n===G?k[n].p(S,U):(gt(),oe(k[G],1,1,()=>{k[G]=null}),kt(),i=k[n],i?i.p(S,U):(i=k[n]=h[n](S),i.c()),$(i,1),i.m(l,null));let V=r;r=E(S),r===V?O[r].p(S,U):(gt(),oe(O[V],1,1,()=>{O[V]=null}),kt(),c=O[r],c?c.p(S,U):(c=O[r]=T[r](S),c.c()),$(c,1),c.m(a,null));let F=m;m=j(S),m===F?C[m].p(S,U):(gt(),oe(C[F],1,1,()=>{C[F]=null}),kt(),d=C[m],d?d.p(S,U):(d=C[m]=I[m](S),d.c()),$(d,1),d.m(_,null))},i(S){v||($(i),$(c),$(d),v=!0)},o(S){oe(i),oe(c),oe(d),v=!1},d(S){S&&A(e),k[n].d(),O[r].d(),C[m].d()}}}function V0(t){let e,l;return e=new Ml({props:{to:"/mqtt-ca",$$slots:{default:[Y0]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i[0]&4|i[4]&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function K0(t){let e,l,n,i,o,a,r;return l=new Ml({props:{to:"/mqtt-ca",$$slots:{default:[Q0]},$$scope:{ctx:t}}}),{c(){e=p("span"),Re(l.$$.fragment),n=b(),i=p("span"),i.textContent="\u{1F5D1}",u(e,"class","bd-on"),u(i,"class","bd-off")},m(c,f){q(c,e,f),De(l,e,null),q(c,n,f),q(c,i,f),o=!0,a||(r=[ve(i,"click",t[15]),ve(i,"keypress",t[15])],a=!0)},p(c,f){const _={};f[0]&4|f[4]&4&&(_.$$scope={dirty:f,ctx:c}),l.$set(_)},i(c){o||($(l.$$.fragment,c),o=!0)},o(c){oe(l.$$.fragment,c),o=!1},d(c){c&&A(e),Le(l),c&&A(n),c&&A(i),a=!1,zt(r)}}}function Y0(t){var n,i,o,a,r,c;let e,l;return e=new $l({props:{color:"blue",text:(o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_ca_upload)!=null?o:"Upload CA",title:(c=(r=(a=t[2].conf)==null?void 0:a.mqtt)==null?void 0:r.title_ca)!=null?c:""}}),{c(){Re(e.$$.fragment)},m(f,_){De(e,f,_),l=!0},p(f,_){var d,v,h,k,g,T;const m={};_[0]&4&&(m.text=(h=(v=(d=f[2].conf)==null?void 0:d.mqtt)==null?void 0:v.btn_ca_upload)!=null?h:"Upload CA"),_[0]&4&&(m.title=(T=(g=(k=f[2].conf)==null?void 0:k.mqtt)==null?void 0:g.title_ca)!=null?T:""),e.$set(m)},i(f){l||($(e.$$.fragment,f),l=!0)},o(f){oe(e.$$.fragment,f),l=!1},d(f){Le(e,f)}}}function Q0(t){var n,i,o;let e=((o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.ca_ok)!=null?o:"CA OK")+"",l;return{c(){l=M(e)},m(a,r){q(a,l,r)},p(a,r){var c,f,_;r[0]&4&&e!==(e=((_=(f=(c=a[2].conf)==null?void 0:c.mqtt)==null?void 0:f.ca_ok)!=null?_:"CA OK")+"")&&L(l,e)},d(a){a&&A(l)}}}function X0(t){let e,l;return e=new Ml({props:{to:"/mqtt-cert",$$slots:{default:[J0]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i[0]&4|i[4]&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Z0(t){let e,l,n,i,o,a,r;return l=new Ml({props:{to:"/mqtt-cert",$$slots:{default:[$0]},$$scope:{ctx:t}}}),{c(){e=p("span"),Re(l.$$.fragment),n=b(),i=p("span"),i.textContent="\u{1F5D1}",u(e,"class","bd-on"),u(i,"class","bd-off")},m(c,f){q(c,e,f),De(l,e,null),q(c,n,f),q(c,i,f),o=!0,a||(r=[ve(i,"click",t[16]),ve(i,"keypress",t[16])],a=!0)},p(c,f){const _={};f[0]&4|f[4]&4&&(_.$$scope={dirty:f,ctx:c}),l.$set(_)},i(c){o||($(l.$$.fragment,c),o=!0)},o(c){oe(l.$$.fragment,c),o=!1},d(c){c&&A(e),Le(l),c&&A(n),c&&A(i),a=!1,zt(r)}}}function J0(t){var n,i,o,a,r,c;let e,l;return e=new $l({props:{color:"blue",text:(o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_crt_upload)!=null?o:"Upload cert",title:(c=(r=(a=t[2].conf)==null?void 0:a.mqtt)==null?void 0:r.title_crt)!=null?c:""}}),{c(){Re(e.$$.fragment)},m(f,_){De(e,f,_),l=!0},p(f,_){var d,v,h,k,g,T;const m={};_[0]&4&&(m.text=(h=(v=(d=f[2].conf)==null?void 0:d.mqtt)==null?void 0:v.btn_crt_upload)!=null?h:"Upload cert"),_[0]&4&&(m.title=(T=(g=(k=f[2].conf)==null?void 0:k.mqtt)==null?void 0:g.title_crt)!=null?T:""),e.$set(m)},i(f){l||($(e.$$.fragment,f),l=!0)},o(f){oe(e.$$.fragment,f),l=!1},d(f){Le(e,f)}}}function $0(t){var n,i,o;let e=((o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.crt_ok)!=null?o:"Cert OK")+"",l;return{c(){l=M(e)},m(a,r){q(a,l,r)},p(a,r){var c,f,_;r[0]&4&&e!==(e=((_=(f=(c=a[2].conf)==null?void 0:c.mqtt)==null?void 0:f.crt_ok)!=null?_:"Cert OK")+"")&&L(l,e)},d(a){a&&A(l)}}}function x0(t){let e,l;return e=new Ml({props:{to:"/mqtt-key",$$slots:{default:[tc]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i[0]&4|i[4]&4&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function ec(t){let e,l,n,i,o,a,r;return l=new Ml({props:{to:"/mqtt-key",$$slots:{default:[lc]},$$scope:{ctx:t}}}),{c(){e=p("span"),Re(l.$$.fragment),n=b(),i=p("span"),i.textContent="\u{1F5D1}",u(e,"class","bd-on"),u(i,"class","bd-off")},m(c,f){q(c,e,f),De(l,e,null),q(c,n,f),q(c,i,f),o=!0,a||(r=[ve(i,"click",t[17]),ve(i,"keypress",t[17])],a=!0)},p(c,f){const _={};f[0]&4|f[4]&4&&(_.$$scope={dirty:f,ctx:c}),l.$set(_)},i(c){o||($(l.$$.fragment,c),o=!0)},o(c){oe(l.$$.fragment,c),o=!1},d(c){c&&A(e),Le(l),c&&A(n),c&&A(i),a=!1,zt(r)}}}function tc(t){var n,i,o,a,r,c;let e,l;return e=new $l({props:{color:"blue",text:(o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_key_upload)!=null?o:"Upload key",title:(c=(r=(a=t[2].conf)==null?void 0:a.mqtt)==null?void 0:r.title_key)!=null?c:""}}),{c(){Re(e.$$.fragment)},m(f,_){De(e,f,_),l=!0},p(f,_){var d,v,h,k,g,T;const m={};_[0]&4&&(m.text=(h=(v=(d=f[2].conf)==null?void 0:d.mqtt)==null?void 0:v.btn_key_upload)!=null?h:"Upload key"),_[0]&4&&(m.title=(T=(g=(k=f[2].conf)==null?void 0:k.mqtt)==null?void 0:g.title_key)!=null?T:""),e.$set(m)},i(f){l||($(e.$$.fragment,f),l=!0)},o(f){oe(e.$$.fragment,f),l=!1},d(f){Le(e,f)}}}function lc(t){var n,i,o;let e=((o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.key_ok)!=null?o:"Key OK")+"",l;return{c(){l=M(e)},m(a,r){q(a,l,r)},p(a,r){var c,f,_;r[0]&4&&e!==(e=((_=(f=(c=a[2].conf)==null?void 0:c.mqtt)==null?void 0:f.key_ok)!=null?_:"Key OK")+"")&&L(l,e)},d(a){a&&A(l)}}}function va(t){var J,ae,le,ne,fe,ue,Y,x,ke,me,N,w,P,D,y,ee;let e,l,n=((ne=(le=(ae=(J=t[2].conf)==null?void 0:J.mqtt)==null?void 0:ae.domoticz)==null?void 0:le.title)!=null?ne:"Domoticz")+"",i,o,a,r,c,f,_,m,d,v=((x=(Y=(ue=(fe=t[2].conf)==null?void 0:fe.mqtt)==null?void 0:ue.domoticz)==null?void 0:Y.eidx)!=null?x:"Electricity IDX")+"",h,k,g,T,O,E,I=((w=(N=(me=(ke=t[2].conf)==null?void 0:ke.mqtt)==null?void 0:me.domoticz)==null?void 0:N.cidx)!=null?w:"Current IDX")+"",C,j,S,U,G,V,F=((ee=(y=(D=(P=t[2].conf)==null?void 0:P.mqtt)==null?void 0:D.domoticz)==null?void 0:y.vidx)!=null?ee:"Voltage IDX")+"",R,z,B,H,W,K,Q,Z,se,X;return{c(){e=p("div"),l=p("strong"),i=M(n),o=b(),a=p("a"),r=M("\u24D8"),c=b(),f=p("input"),_=b(),m=p("div"),d=p("div"),h=M(v),k=p("br"),g=b(),T=p("input"),O=b(),E=p("div"),C=M(I),j=p("br"),S=b(),U=p("input"),G=b(),V=p("div"),R=M(F),z=M(`: L1, L2 & L3 + `),B=p("div"),H=p("input"),W=b(),K=p("input"),Q=b(),Z=p("input"),u(l,"class","text-sm"),u(a,"href",kl("MQTT-configuration#domoticz")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","o"),f.value="true",u(T,"name","oe"),u(T,"type","text"),u(T,"class","in-f tr w-full"),u(d,"class","w-1/2"),u(U,"name","oc"),u(U,"type","text"),u(U,"class","in-l tr w-full"),u(E,"class","w-1/2"),u(m,"class","my-1 flex"),u(H,"name","ou1"),u(H,"type","text"),u(H,"class","in-f tr w-1/3"),u(K,"name","ou2"),u(K,"type","text"),u(K,"class","in-m tr w-1/3"),u(Z,"name","ou3"),u(Z,"type","text"),u(Z,"class","in-l tr w-1/3"),u(B,"class","flex"),u(V,"class","my-1"),u(e,"class","cnt")},m(te,ie){q(te,e,ie),s(e,l),s(l,i),s(e,o),s(e,a),s(a,r),s(e,c),s(e,f),s(e,_),s(e,m),s(m,d),s(d,h),s(d,k),s(d,g),s(d,T),Te(T,t[6].o.e),s(m,O),s(m,E),s(E,C),s(E,j),s(E,S),s(E,U),Te(U,t[6].o.c),s(e,G),s(e,V),s(V,R),s(V,z),s(V,B),s(B,H),Te(H,t[6].o.u1),s(B,W),s(B,K),Te(K,t[6].o.u2),s(B,Q),s(B,Z),Te(Z,t[6].o.u3),se||(X=[ve(T,"input",t[73]),ve(U,"input",t[74]),ve(H,"input",t[75]),ve(K,"input",t[76]),ve(Z,"input",t[77])],se=!0)},p(te,ie){var _e,Ne,Me,pe,Ce,we,ge,be,ye,je,Ke,xe,et,Je,nt,We;ie[0]&4&&n!==(n=((pe=(Me=(Ne=(_e=te[2].conf)==null?void 0:_e.mqtt)==null?void 0:Ne.domoticz)==null?void 0:Me.title)!=null?pe:"Domoticz")+"")&&L(i,n),ie[0]&4&&v!==(v=((be=(ge=(we=(Ce=te[2].conf)==null?void 0:Ce.mqtt)==null?void 0:we.domoticz)==null?void 0:ge.eidx)!=null?be:"Electricity IDX")+"")&&L(h,v),ie[0]&64&&T.value!==te[6].o.e&&Te(T,te[6].o.e),ie[0]&4&&I!==(I=((xe=(Ke=(je=(ye=te[2].conf)==null?void 0:ye.mqtt)==null?void 0:je.domoticz)==null?void 0:Ke.cidx)!=null?xe:"Current IDX")+"")&&L(C,I),ie[0]&64&&U.value!==te[6].o.c&&Te(U,te[6].o.c),ie[0]&4&&F!==(F=((We=(nt=(Je=(et=te[2].conf)==null?void 0:et.mqtt)==null?void 0:Je.domoticz)==null?void 0:nt.vidx)!=null?We:"Voltage IDX")+"")&&L(R,F),ie[0]&64&&H.value!==te[6].o.u1&&Te(H,te[6].o.u1),ie[0]&64&&K.value!==te[6].o.u2&&Te(K,te[6].o.u2),ie[0]&64&&Z.value!==te[6].o.u3&&Te(Z,te[6].o.u3)},d(te){te&&A(e),se=!1,zt(X)}}}function ha(t){var Q,Z,se,X,J,ae,le,ne,fe,ue,Y,x,ke,me,N,w;let e,l,n=((X=(se=(Z=(Q=t[2].conf)==null?void 0:Q.mqtt)==null?void 0:Z.ha)==null?void 0:se.title)!=null?X:"Home-Assistant")+"",i,o,a,r,c,f,_,m,d=((ne=(le=(ae=(J=t[2].conf)==null?void 0:J.mqtt)==null?void 0:ae.ha)==null?void 0:le.discovery)!=null?ne:"Discovery topic prefix")+"",v,h,k,g,T,O,E=((x=(Y=(ue=(fe=t[2].conf)==null?void 0:fe.mqtt)==null?void 0:ue.ha)==null?void 0:Y.hostname)!=null?x:"Hostname for URL")+"",I,C,j,S,U,G,V,F=((w=(N=(me=(ke=t[2].conf)==null?void 0:ke.mqtt)==null?void 0:me.ha)==null?void 0:N.tag)!=null?w:"Name tag")+"",R,z,B,H,W,K;return{c(){e=p("div"),l=p("strong"),i=M(n),o=b(),a=p("a"),r=M("\u24D8"),c=b(),f=p("input"),_=b(),m=p("div"),v=M(d),h=p("br"),k=b(),g=p("input"),T=b(),O=p("div"),I=M(E),C=p("br"),j=b(),S=p("input"),G=b(),V=p("div"),R=M(F),z=p("br"),B=b(),H=p("input"),u(l,"class","text-sm"),u(a,"href",kl("MQTT-configuration#home-assistant")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","h"),f.value="true",u(g,"name","ht"),u(g,"type","text"),u(g,"class","in-s"),u(g,"placeholder","homeassistant"),u(m,"class","my-1"),u(S,"name","hh"),u(S,"type","text"),u(S,"class","in-s"),u(S,"placeholder",U=t[6].g.h+".local"),u(O,"class","my-1"),u(H,"name","hn"),u(H,"type","text"),u(H,"class","in-s"),u(V,"class","my-1"),u(e,"class","cnt")},m(P,D){q(P,e,D),s(e,l),s(l,i),s(e,o),s(e,a),s(a,r),s(e,c),s(e,f),s(e,_),s(e,m),s(m,v),s(m,h),s(m,k),s(m,g),Te(g,t[6].h.t),s(e,T),s(e,O),s(O,I),s(O,C),s(O,j),s(O,S),Te(S,t[6].h.h),s(e,G),s(e,V),s(V,R),s(V,z),s(V,B),s(V,H),Te(H,t[6].h.n),W||(K=[ve(g,"input",t[78]),ve(S,"input",t[79]),ve(H,"input",t[80])],W=!0)},p(P,D){var y,ee,te,ie,_e,Ne,Me,pe,Ce,we,ge,be,ye,je,Ke,xe;D[0]&4&&n!==(n=((ie=(te=(ee=(y=P[2].conf)==null?void 0:y.mqtt)==null?void 0:ee.ha)==null?void 0:te.title)!=null?ie:"Home-Assistant")+"")&&L(i,n),D[0]&4&&d!==(d=((pe=(Me=(Ne=(_e=P[2].conf)==null?void 0:_e.mqtt)==null?void 0:Ne.ha)==null?void 0:Me.discovery)!=null?pe:"Discovery topic prefix")+"")&&L(v,d),D[0]&64&&g.value!==P[6].h.t&&Te(g,P[6].h.t),D[0]&4&&E!==(E=((be=(ge=(we=(Ce=P[2].conf)==null?void 0:Ce.mqtt)==null?void 0:we.ha)==null?void 0:ge.hostname)!=null?be:"Hostname for URL")+"")&&L(I,E),D[0]&64&&U!==(U=P[6].g.h+".local")&&u(S,"placeholder",U),D[0]&64&&S.value!==P[6].h.h&&Te(S,P[6].h.h),D[0]&4&&F!==(F=((xe=(Ke=(je=(ye=P[2].conf)==null?void 0:ye.mqtt)==null?void 0:je.ha)==null?void 0:Ke.tag)!=null?xe:"Name tag")+"")&&L(R,F),D[0]&64&&H.value!==P[6].h.n&&Te(H,P[6].h.n)},d(P){P&&A(e),W=!1,zt(K)}}}function ba(t){var H,W,K,Q,Z,se,X,J,ae,le,ne;let e,l,n=((K=(W=(H=t[2].conf)==null?void 0:H.cloud)==null?void 0:W.title)!=null?K:"Cloud connections")+"",i,o,a,r,c,f,_,m,d,v,h,k=((se=(Z=(Q=t[2].conf)==null?void 0:Q.cloud)==null?void 0:Z.ams)!=null?se:"AMS reader cloud")+"",g,T,O,E,I,C,j,S=((ae=(J=(X=t[2].conf)==null?void 0:X.cloud)==null?void 0:J.es)!=null?ae:"Energy Speedometer")+"",U,G,V,F,R,z=t[5]&&ga(t),B=((ne=(le=t[6])==null?void 0:le.c)==null?void 0:ne.es)&&ka(t);return{c(){e=p("div"),l=p("strong"),i=M(n),o=b(),a=p("a"),r=M("\u24D8"),c=b(),f=p("input"),_=b(),m=p("div"),d=p("label"),v=p("input"),h=b(),g=M(k),T=b(),z&&z.c(),O=b(),E=p("div"),I=p("label"),C=p("input"),j=b(),U=M(S),G=b(),B&&B.c(),u(l,"class","text-sm"),u(a,"href",kl("Cloud")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","c"),f.value="true",u(v,"type","checkbox"),u(v,"name","ce"),v.__value="true",v.value=v.__value,u(v,"class","rounded mb-1"),u(m,"class","my-1"),u(C,"type","checkbox"),u(C,"class","rounded mb-1"),u(C,"name","ces"),C.__value="true",C.value=C.__value,u(E,"class","my-1"),u(e,"class","cnt")},m(fe,ue){q(fe,e,ue),s(e,l),s(l,i),s(e,o),s(e,a),s(a,r),s(e,c),s(e,f),s(e,_),s(e,m),s(m,d),s(d,v),v.checked=t[6].c.e,s(d,h),s(d,g),s(m,T),z&&z.m(m,null),s(e,O),s(e,E),s(E,I),s(I,C),C.checked=t[6].c.es,s(I,j),s(I,U),s(E,G),B&&B.m(E,null),V=!0,F||(R=[ve(v,"change",t[81]),ve(C,"change",t[82])],F=!0)},p(fe,ue){var Y,x,ke,me,N,w,P,D,y,ee,te;(!V||ue[0]&4)&&n!==(n=((ke=(x=(Y=fe[2].conf)==null?void 0:Y.cloud)==null?void 0:x.title)!=null?ke:"Cloud connections")+"")&&L(i,n),ue[0]&64&&(v.checked=fe[6].c.e),(!V||ue[0]&4)&&k!==(k=((w=(N=(me=fe[2].conf)==null?void 0:me.cloud)==null?void 0:N.ams)!=null?w:"AMS reader cloud")+"")&&L(g,k),fe[5]?z?z.p(fe,ue):(z=ga(fe),z.c(),z.m(m,null)):z&&(z.d(1),z=null),ue[0]&64&&(C.checked=fe[6].c.es),(!V||ue[0]&4)&&S!==(S=((y=(D=(P=fe[2].conf)==null?void 0:P.cloud)==null?void 0:D.es)!=null?y:"Energy Speedometer")+"")&&L(U,S),(te=(ee=fe[6])==null?void 0:ee.c)!=null&&te.es?B?(B.p(fe,ue),ue[0]&64&&$(B,1)):(B=ka(fe),B.c(),$(B,1),B.m(E,null)):B&&(gt(),oe(B,1,1,()=>{B=null}),kt())},i(fe){V||($(B),V=!0)},o(fe){oe(B),V=!1},d(fe){fe&&A(e),z&&z.d(),B&&B.d(),F=!1,zt(R)}}}function ga(t){let e,l,n;return{c(){e=p("button"),e.textContent="Connect to my cloud account",u(e,"type","button"),u(e,"class","text-blue-500 ml-6")},m(i,o){q(i,e,o),l||(n=ve(e,"click",t[20]),l=!0)},p:Ze,d(i){i&&A(e),l=!1,n()}}}function ka(t){let e,l,n=t[0].mac+"",i,o,a,r,c=(t[0].meter.id?t[0].meter.id:"missing, required")+"",f,_,m,d,v=t[0].mac&&t[0].meter.id&&wa(t);return{c(){e=p("div"),l=M("MAC: "),i=M(n),o=b(),a=p("div"),r=M("Meter ID: "),f=M(c),_=b(),v&&v.c(),m=Jt(),u(e,"class","pl-5"),u(a,"class","pl-5")},m(h,k){q(h,e,k),s(e,l),s(e,i),q(h,o,k),q(h,a,k),s(a,r),s(a,f),q(h,_,k),v&&v.m(h,k),q(h,m,k),d=!0},p(h,k){(!d||k[0]&1)&&n!==(n=h[0].mac+"")&&L(i,n),(!d||k[0]&1)&&c!==(c=(h[0].meter.id?h[0].meter.id:"missing, required")+"")&&L(f,c),h[0].mac&&h[0].meter.id?v?(v.p(h,k),k[0]&1&&$(v,1)):(v=wa(h),v.c(),$(v,1),v.m(m.parentNode,m)):v&&(gt(),oe(v,1,1,()=>{v=null}),kt())},i(h){d||($(v),d=!0)},o(h){oe(v),d=!1},d(h){h&&A(e),h&&A(o),h&&A(a),h&&A(_),v&&v.d(h),h&&A(m)}}}function wa(t){let e,l,n;return l=new B0({props:{value:'{"mac":"'+t[0].mac+'","meter":"'+t[0].meter.id+'"}'}}),{c(){e=p("div"),Re(l.$$.fragment),u(e,"class","pl-2")},m(i,o){q(i,e,o),De(l,e,null),n=!0},p(i,o){const a={};o[0]&1&&(a.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(a)},i(i){n||($(l.$$.fragment,i),n=!0)},o(i){oe(l.$$.fragment,i),n=!1},d(i){i&&A(e),Le(l)}}}function Ma(t){var F,R,z,B,H,W,K,Q;let e,l,n=((z=(R=(F=t[2].conf)==null?void 0:F.thresholds)==null?void 0:R.title)!=null?z:"Thresholds")+"",i,o,a,r,c,f,_,m,d,v,h,k=((W=(H=(B=t[2].conf)==null?void 0:B.thresholds)==null?void 0:H.avg)!=null?W:"Average of")+"",g,T,O,E,I,C=((Q=(K=t[2].common)==null?void 0:K.hours)!=null?Q:"hours")+"",j,S,U,G={length:9},V=[];for(let Z=0;Zt[86].call(T)),u(v,"class","w-1/2"),u(m,"class","flex flex-wrap"),u(e,"class","cnt")},m(B,H){q(B,e,H),s(e,l),s(l,i),s(e,o),s(e,a),s(a,r),s(e,c),s(e,f),s(e,_),s(e,m);for(let W=0;W20&&Pa(t),v=((I=(E=(O=t[6])==null?void 0:O.i)==null?void 0:E.d)==null?void 0:I.d)>0&&Da(t),h=t[0].chip=="esp8266"&&La(t);return{c(){e=p("div"),l=p("strong"),i=M(n),o=b(),a=p("a"),r=M("\u24D8"),c=b(),d&&d.c(),f=b(),v&&v.c(),_=b(),h&&h.c(),u(l,"class","text-sm"),u(a,"href",kl("GPIO-configuration")),u(a,"target","_blank"),u(a,"class","float-right"),u(e,"class","cnt")},m(C,j){q(C,e,j),s(e,l),s(l,i),s(e,o),s(e,a),s(a,r),s(e,c),d&&d.m(e,null),s(e,f),v&&v.m(e,null),s(e,_),h&&h.m(e,null),m=!0},p(C,j){var S,U,G,V,F,R;(!m||j[0]&4)&&n!==(n=((G=(U=(S=C[2].conf)==null?void 0:S.hw)==null?void 0:U.title)!=null?G:"Hardware")+"")&&L(i,n),C[0].board>20?d?(d.p(C,j),j[0]&1&&$(d,1)):(d=Pa(C),d.c(),$(d,1),d.m(e,f)):d&&(gt(),oe(d,1,1,()=>{d=null}),kt()),((R=(F=(V=C[6])==null?void 0:V.i)==null?void 0:F.d)==null?void 0:R.d)>0?v?v.p(C,j):(v=Da(C),v.c(),v.m(e,_)):v&&(v.d(1),v=null),C[0].chip=="esp8266"?h?h.p(C,j):(h=La(C),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i(C){m||($(d),m=!0)},o(C){oe(d),m=!1},d(C){C&&A(e),d&&d.d(),v&&v.d(),h&&h.d()}}}function Pa(t){var Et,Lt,St,Pt,Ot,Ht,Ct,ht,Dt,Ft,Wt,Qe,Xe,Bt,ot,bt,wt,de,qe,Pe,Be,ze,yt,Qt,Kt,Vt,xt,el,nl,il,sl,ol,al,fl,ul,Ie,Ut,dl,vl,hl,bl,gl,Ue,_t;let e,l,n,i,o=((Pt=(St=(Lt=(Et=t[2].conf)==null?void 0:Et.hw)==null?void 0:Lt.han)==null?void 0:St.rx)!=null?Pt:"HAN RX")+"",a,r,c,f,_,m,d,v=((ht=(Ct=(Ht=(Ot=t[2].conf)==null?void 0:Ot.hw)==null?void 0:Ht.han)==null?void 0:Ct.tx)!=null?ht:"HAN TX")+"",h,k,g,T,O,E,I,C,j,S,U=((Qe=(Wt=(Ft=(Dt=t[2].conf)==null?void 0:Dt.hw)==null?void 0:Ft.han)==null?void 0:Wt.pullup)!=null?Qe:"pullup")+"",G,V,F,R,z=((ot=(Bt=(Xe=t[2].conf)==null?void 0:Xe.hw)==null?void 0:Bt.ap_btn)!=null?ot:"AP button")+"",B,H,W,K,Q,Z,se=((qe=(de=(wt=(bt=t[2].conf)==null?void 0:bt.hw)==null?void 0:wt.led)==null?void 0:de.title)!=null?qe:"LED")+"",X,J,ae,le,ne,fe,ue,Y,x,ke,me=((yt=(ze=(Be=(Pe=t[2].conf)==null?void 0:Pe.hw)==null?void 0:Be.led)==null?void 0:ze.inverted)!=null?yt:"inverted")+"",N,w,P,D=((xt=(Vt=(Kt=(Qt=t[2].conf)==null?void 0:Qt.hw)==null?void 0:Kt.led)==null?void 0:Vt.rgb)!=null?xt:"RGB")+"",y,ee,te,ie,_e=((sl=(il=(nl=(el=t[2].conf)==null?void 0:el.hw)==null?void 0:nl.led)==null?void 0:il.inverted)!=null?sl:"inverted")+"",Ne,Me,pe,Ce,we,ge,be,ye,je,Ke,xe,et,Je=((ul=(fl=(al=(ol=t[2].conf)==null?void 0:ol.hw)==null?void 0:al.led)==null?void 0:fl.disable)!=null?ul:"LED dis. GPIO")+"",nt,We,Oe,ce,Ee,tt=((dl=(Ut=(Ie=t[2].conf)==null?void 0:Ie.hw)==null?void 0:Ut.temp)!=null?dl:"Temperature")+"",$e,pt,Ge,Ye,Ve,it,vt=((bl=(hl=(vl=t[2].conf)==null?void 0:vl.hw)==null?void 0:hl.temp_analog)!=null?bl:"Analog temp")+"",Mt,he,re,Fe,Tt,Se,Ae,dt,ut;_=new Ui({props:{chip:t[0].chip}}),O=new Ui({props:{chip:t[0].chip}});let rt=t[0].chip!="esp8266"&&Aa(t),ct=((_t=(Ue=(gl=t[6])==null?void 0:gl.i)==null?void 0:Ue.v)==null?void 0:_t.p)>0&&qa(t);return{c(){e=p("input"),l=b(),n=p("div"),i=p("div"),a=M(o),r=p("br"),c=b(),f=p("select"),Re(_.$$.fragment),m=b(),d=p("div"),h=M(v),k=p("br"),g=b(),T=p("select"),Re(O.$$.fragment),E=b(),I=p("div"),C=p("label"),j=p("input"),S=b(),G=M(U),V=b(),F=p("div"),R=p("div"),B=M(z),H=p("br"),W=b(),K=p("input"),Q=b(),Z=p("div"),X=M(se),J=p("br"),ae=b(),le=p("div"),ne=p("input"),fe=b(),ue=p("div"),Y=p("label"),x=p("input"),ke=b(),N=M(me),w=b(),P=p("div"),y=M(D),ee=p("label"),te=p("input"),ie=b(),Ne=M(_e),Me=p("br"),pe=b(),Ce=p("div"),we=p("input"),ge=b(),be=p("input"),ye=b(),je=p("input"),Ke=b(),xe=p("div"),et=p("div"),nt=M(Je),We=b(),Oe=p("input"),ce=b(),Ee=p("div"),$e=M(tt),pt=p("br"),Ge=b(),Ye=p("input"),Ve=b(),it=p("div"),Mt=M(vt),he=p("br"),re=b(),Fe=p("input"),Tt=b(),rt&&rt.c(),Se=b(),ct&&ct.c(),u(e,"type","hidden"),u(e,"name","i"),e.value="true",u(f,"name","ihp"),u(f,"class","in-f w-full"),t[6].i.h.p===void 0&&Gt(()=>t[87].call(f)),u(i,"class","w-1/3"),u(T,"name","iht"),u(T,"class","in-l w-full"),t[6].i.h.t===void 0&&Gt(()=>t[88].call(T)),u(d,"class","w-1/3"),u(j,"name","ihu"),j.__value="true",j.value=j.__value,u(j,"type","checkbox"),u(j,"class","rounded mb-1"),u(C,"class","ml-2"),u(I,"class","w-1/3"),u(n,"class","flex flex-wrap"),u(K,"name","ia"),u(K,"type","number"),u(K,"min","0"),u(K,"max",t[10]),u(K,"class","in-f tr w-full"),u(R,"class","w-1/3"),u(ne,"name","ilp"),u(ne,"type","number"),u(ne,"min","0"),u(ne,"max",t[10]),u(ne,"class","in-l tr w-full"),u(le,"class","flex"),u(Z,"class","w-1/3"),u(x,"name","ili"),x.__value="true",x.value=x.__value,u(x,"type","checkbox"),u(x,"class","rounded mb-1"),u(Y,"class","ml-4"),u(ue,"class","w-1/3"),u(te,"name","iri"),te.__value="true",te.value=te.__value,u(te,"type","checkbox"),u(te,"class","rounded mb-1"),u(ee,"class","ml-4"),u(we,"name","irr"),u(we,"type","number"),u(we,"min","0"),u(we,"max",t[10]),u(we,"class","in-f tr w-1/3"),u(be,"name","irg"),u(be,"type","number"),u(be,"min","0"),u(be,"max",t[10]),u(be,"class","in-m tr w-1/3"),u(je,"name","irb"),u(je,"type","number"),u(je,"min","0"),u(je,"max",t[10]),u(je,"class","in-l tr w-1/3"),u(Ce,"class","flex"),u(P,"class","w-full"),u(Oe,"name","idd"),u(Oe,"type","number"),u(Oe,"min","0"),u(Oe,"max",t[10]),u(Oe,"class","in-s tr"),u(et,"class","my-1 pr-1 w-1/3"),u(xe,"class","w-full"),u(Ye,"name","itd"),u(Ye,"type","number"),u(Ye,"min","0"),u(Ye,"max",t[10]),u(Ye,"class","in-f tr w-full"),u(Ee,"class","my-1 w-1/3"),u(Fe,"name","ita"),u(Fe,"type","number"),u(Fe,"min","0"),u(Fe,"max",t[10]),u(Fe,"class","in-l tr w-full"),u(it,"class","my-1 pr-1 w-1/3"),u(F,"class","flex flex-wrap")},m(He,mt){q(He,e,mt),q(He,l,mt),q(He,n,mt),s(n,i),s(i,a),s(i,r),s(i,c),s(i,f),De(_,f,null),ft(f,t[6].i.h.p,!0),s(n,m),s(n,d),s(d,h),s(d,k),s(d,g),s(d,T),De(O,T,null),ft(T,t[6].i.h.t,!0),s(n,E),s(n,I),s(I,C),s(C,j),j.checked=t[6].i.h.u,s(C,S),s(C,G),q(He,V,mt),q(He,F,mt),s(F,R),s(R,B),s(R,H),s(R,W),s(R,K),Te(K,t[6].i.a),s(F,Q),s(F,Z),s(Z,X),s(Z,J),s(Z,ae),s(Z,le),s(le,ne),Te(ne,t[6].i.l.p),s(F,fe),s(F,ue),s(ue,Y),s(Y,x),x.checked=t[6].i.l.i,s(Y,ke),s(Y,N),s(F,w),s(F,P),s(P,y),s(P,ee),s(ee,te),te.checked=t[6].i.r.i,s(ee,ie),s(ee,Ne),s(P,Me),s(P,pe),s(P,Ce),s(Ce,we),Te(we,t[6].i.r.r),s(Ce,ge),s(Ce,be),Te(be,t[6].i.r.g),s(Ce,ye),s(Ce,je),Te(je,t[6].i.r.b),s(F,Ke),s(F,xe),s(xe,et),s(et,nt),s(et,We),s(et,Oe),Te(Oe,t[6].i.d.d),s(F,ce),s(F,Ee),s(Ee,$e),s(Ee,pt),s(Ee,Ge),s(Ee,Ye),Te(Ye,t[6].i.t.d),s(F,Ve),s(F,it),s(it,Mt),s(it,he),s(it,re),s(it,Fe),Te(Fe,t[6].i.t.a),s(F,Tt),rt&&rt.m(F,null),s(F,Se),ct&&ct.m(F,null),Ae=!0,dt||(ut=[ve(f,"change",t[87]),ve(T,"change",t[88]),ve(j,"change",t[89]),ve(K,"input",t[90]),ve(ne,"input",t[91]),ve(x,"change",t[92]),ve(te,"change",t[93]),ve(we,"input",t[94]),ve(be,"input",t[95]),ve(je,"input",t[96]),ve(Oe,"input",t[97]),ve(Ye,"input",t[98]),ve(Fe,"input",t[99])],dt=!0)},p(He,mt){var Tl,El,Rl,Fl,Bl,Ul,jl,Hl,yl,zl,Wl,st,jt,rl,wl,Gl,mn,pn,dn,vn,hn,bn,gn,kn,wn,Mn,Sn,Cn,Nn,Tn,En,Pn,An,qn,Dn,Ln,On,In,Rn,Fn,Bn,Un,jn,Hn;(!Ae||mt[0]&4)&&o!==(o=((Fl=(Rl=(El=(Tl=He[2].conf)==null?void 0:Tl.hw)==null?void 0:El.han)==null?void 0:Rl.rx)!=null?Fl:"HAN RX")+"")&&L(a,o);const Cl={};mt[0]&1&&(Cl.chip=He[0].chip),_.$set(Cl),mt[0]&64&&ft(f,He[6].i.h.p),(!Ae||mt[0]&4)&&v!==(v=((Hl=(jl=(Ul=(Bl=He[2].conf)==null?void 0:Bl.hw)==null?void 0:Ul.han)==null?void 0:jl.tx)!=null?Hl:"HAN TX")+"")&&L(h,v);const Nl={};mt[0]&1&&(Nl.chip=He[0].chip),O.$set(Nl),mt[0]&64&&ft(T,He[6].i.h.t),mt[0]&64&&(j.checked=He[6].i.h.u),(!Ae||mt[0]&4)&&U!==(U=((st=(Wl=(zl=(yl=He[2].conf)==null?void 0:yl.hw)==null?void 0:zl.han)==null?void 0:Wl.pullup)!=null?st:"pullup")+"")&&L(G,U),(!Ae||mt[0]&4)&&z!==(z=((wl=(rl=(jt=He[2].conf)==null?void 0:jt.hw)==null?void 0:rl.ap_btn)!=null?wl:"AP button")+"")&&L(B,z),(!Ae||mt[0]&1024)&&u(K,"max",He[10]),mt[0]&64&&at(K.value)!==He[6].i.a&&Te(K,He[6].i.a),(!Ae||mt[0]&4)&&se!==(se=((dn=(pn=(mn=(Gl=He[2].conf)==null?void 0:Gl.hw)==null?void 0:mn.led)==null?void 0:pn.title)!=null?dn:"LED")+"")&&L(X,se),(!Ae||mt[0]&1024)&&u(ne,"max",He[10]),mt[0]&64&&at(ne.value)!==He[6].i.l.p&&Te(ne,He[6].i.l.p),mt[0]&64&&(x.checked=He[6].i.l.i),(!Ae||mt[0]&4)&&me!==(me=((gn=(bn=(hn=(vn=He[2].conf)==null?void 0:vn.hw)==null?void 0:hn.led)==null?void 0:bn.inverted)!=null?gn:"inverted")+"")&&L(N,me),(!Ae||mt[0]&4)&&D!==(D=((Sn=(Mn=(wn=(kn=He[2].conf)==null?void 0:kn.hw)==null?void 0:wn.led)==null?void 0:Mn.rgb)!=null?Sn:"RGB")+"")&&L(y,D),mt[0]&64&&(te.checked=He[6].i.r.i),(!Ae||mt[0]&4)&&_e!==(_e=((En=(Tn=(Nn=(Cn=He[2].conf)==null?void 0:Cn.hw)==null?void 0:Nn.led)==null?void 0:Tn.inverted)!=null?En:"inverted")+"")&&L(Ne,_e),(!Ae||mt[0]&1024)&&u(we,"max",He[10]),mt[0]&64&&at(we.value)!==He[6].i.r.r&&Te(we,He[6].i.r.r),(!Ae||mt[0]&1024)&&u(be,"max",He[10]),mt[0]&64&&at(be.value)!==He[6].i.r.g&&Te(be,He[6].i.r.g),(!Ae||mt[0]&1024)&&u(je,"max",He[10]),mt[0]&64&&at(je.value)!==He[6].i.r.b&&Te(je,He[6].i.r.b),(!Ae||mt[0]&4)&&Je!==(Je=((Dn=(qn=(An=(Pn=He[2].conf)==null?void 0:Pn.hw)==null?void 0:An.led)==null?void 0:qn.disable)!=null?Dn:"LED dis. GPIO")+"")&&L(nt,Je),(!Ae||mt[0]&1024)&&u(Oe,"max",He[10]),mt[0]&64&&at(Oe.value)!==He[6].i.d.d&&Te(Oe,He[6].i.d.d),(!Ae||mt[0]&4)&&tt!==(tt=((In=(On=(Ln=He[2].conf)==null?void 0:Ln.hw)==null?void 0:On.temp)!=null?In:"Temperature")+"")&&L($e,tt),(!Ae||mt[0]&1024)&&u(Ye,"max",He[10]),mt[0]&64&&at(Ye.value)!==He[6].i.t.d&&Te(Ye,He[6].i.t.d),(!Ae||mt[0]&4)&&vt!==(vt=((Bn=(Fn=(Rn=He[2].conf)==null?void 0:Rn.hw)==null?void 0:Fn.temp_analog)!=null?Bn:"Analog temp")+"")&&L(Mt,vt),(!Ae||mt[0]&1024)&&u(Fe,"max",He[10]),mt[0]&64&&at(Fe.value)!==He[6].i.t.a&&Te(Fe,He[6].i.t.a),He[0].chip!="esp8266"?rt?rt.p(He,mt):(rt=Aa(He),rt.c(),rt.m(F,Se)):rt&&(rt.d(1),rt=null),((Hn=(jn=(Un=He[6])==null?void 0:Un.i)==null?void 0:jn.v)==null?void 0:Hn.p)>0?ct?ct.p(He,mt):(ct=qa(He),ct.c(),ct.m(F,null)):ct&&(ct.d(1),ct=null)},i(He){Ae||($(_.$$.fragment,He),$(O.$$.fragment,He),Ae=!0)},o(He){oe(_.$$.fragment,He),oe(O.$$.fragment,He),Ae=!1},d(He){He&&A(e),He&&A(l),He&&A(n),Le(_),Le(O),He&&A(V),He&&A(F),rt&&rt.d(),ct&&ct.d(),dt=!1,zt(ut)}}}function Aa(t){var f,_,m,d;let e,l=((d=(m=(_=(f=t[2].conf)==null?void 0:f.hw)==null?void 0:_.vcc)==null?void 0:m.title)!=null?d:"Vcc")+"",n,i,o,a,r,c;return{c(){e=p("div"),n=M(l),i=p("br"),o=b(),a=p("input"),u(a,"name","ivp"),u(a,"type","number"),u(a,"min","0"),u(a,"max",t[10]),u(a,"class","in-s tr w-full"),u(e,"class","my-1 pl-1 w-1/3")},m(v,h){q(v,e,h),s(e,n),s(e,i),s(e,o),s(e,a),Te(a,t[6].i.v.p),r||(c=ve(a,"input",t[100]),r=!0)},p(v,h){var k,g,T,O;h[0]&4&&l!==(l=((O=(T=(g=(k=v[2].conf)==null?void 0:k.hw)==null?void 0:g.vcc)==null?void 0:T.title)!=null?O:"Vcc")+"")&&L(n,l),h[0]&1024&&u(a,"max",v[10]),h[0]&64&&at(a.value)!==v[6].i.v.p&&Te(a,v[6].i.v.p)},d(v){v&&A(e),r=!1,c()}}}function qa(t){var h,k,g,T;let e,l=((T=(g=(k=(h=t[2].conf)==null?void 0:h.hw)==null?void 0:k.vcc)==null?void 0:g.divider)!=null?T:"Voltage divider")+"",n,i,o,a,r,c,f,_,m,d,v;return{c(){var O,E,I,C,j,S,U,G;e=p("div"),n=M(l),i=p("br"),o=b(),a=p("div"),r=p("input"),f=b(),_=p("input"),u(r,"name","ivdv"),u(r,"type","number"),u(r,"min","0"),u(r,"max","65535"),u(r,"class","in-f tr w-full"),u(r,"placeholder",c=(C=(I=(E=(O=t[2].conf)==null?void 0:O.hw)==null?void 0:E.vcc)==null?void 0:I.div_vcc)!=null?C:"VCC"),u(_,"name","ivdg"),u(_,"type","number"),u(_,"min","0"),u(_,"max","65535"),u(_,"class","in-l tr w-full"),u(_,"placeholder",m=(G=(U=(S=(j=t[2].conf)==null?void 0:j.hw)==null?void 0:S.vcc)==null?void 0:U.div_gnd)!=null?G:"GND"),u(a,"class","flex"),u(e,"class","my-1")},m(O,E){q(O,e,E),s(e,n),s(e,i),s(e,o),s(e,a),s(a,r),Te(r,t[6].i.v.d.v),s(a,f),s(a,_),Te(_,t[6].i.v.d.g),d||(v=[ve(r,"input",t[101]),ve(_,"input",t[102])],d=!0)},p(O,E){var I,C,j,S,U,G,V,F,R,z,B,H;E[0]&4&&l!==(l=((S=(j=(C=(I=O[2].conf)==null?void 0:I.hw)==null?void 0:C.vcc)==null?void 0:j.divider)!=null?S:"Voltage divider")+"")&&L(n,l),E[0]&4&&c!==(c=(F=(V=(G=(U=O[2].conf)==null?void 0:U.hw)==null?void 0:G.vcc)==null?void 0:V.div_vcc)!=null?F:"VCC")&&u(r,"placeholder",c),E[0]&64&&at(r.value)!==O[6].i.v.d.v&&Te(r,O[6].i.v.d.v),E[0]&4&&m!==(m=(H=(B=(z=(R=O[2].conf)==null?void 0:R.hw)==null?void 0:z.vcc)==null?void 0:B.div_gnd)!=null?H:"GND")&&u(_,"placeholder",m),E[0]&64&&at(_.value)!==O[6].i.v.d.g&&Te(_,O[6].i.v.d.g)},d(O){O&&A(e),d=!1,zt(v)}}}function Da(t){var h,k,g,T,O,E,I,C,j,S,U,G,V,F,R;let e,l=((O=(T=(g=(k=(h=t[2].conf)==null?void 0:h.hw)==null?void 0:k.led)==null?void 0:g.behaviour)==null?void 0:T.title)!=null?O:"LED behaviour")+"",n,i,o,a,r=((S=(j=(C=(I=(E=t[2].conf)==null?void 0:E.hw)==null?void 0:I.led)==null?void 0:C.behaviour)==null?void 0:j.enabled)!=null?S:"Enabled")+"",c,f,_=((R=(F=(V=(G=(U=t[2].conf)==null?void 0:U.hw)==null?void 0:G.led)==null?void 0:V.behaviour)==null?void 0:F.disabled)!=null?R:"Disabled")+"",m,d,v;return{c(){e=p("div"),n=M(l),i=b(),o=p("select"),a=p("option"),c=M(r),f=p("option"),m=M(_),a.__value=0,a.value=a.__value,f.__value=1,f.value=f.__value,u(o,"name","idb"),u(o,"class","in-s"),t[6].i.d.b===void 0&&Gt(()=>t[103].call(o)),u(e,"class","my-1 w-full")},m(z,B){q(z,e,B),s(e,n),s(e,i),s(e,o),s(o,a),s(a,c),s(o,f),s(f,m),ft(o,t[6].i.d.b,!0),d||(v=ve(o,"change",t[103]),d=!0)},p(z,B){var H,W,K,Q,Z,se,X,J,ae,le,ne,fe,ue,Y,x;B[0]&4&&l!==(l=((Z=(Q=(K=(W=(H=z[2].conf)==null?void 0:H.hw)==null?void 0:W.led)==null?void 0:K.behaviour)==null?void 0:Q.title)!=null?Z:"LED behaviour")+"")&&L(n,l),B[0]&4&&r!==(r=((le=(ae=(J=(X=(se=z[2].conf)==null?void 0:se.hw)==null?void 0:X.led)==null?void 0:J.behaviour)==null?void 0:ae.enabled)!=null?le:"Enabled")+"")&&L(c,r),B[0]&4&&_!==(_=((x=(Y=(ue=(fe=(ne=z[2].conf)==null?void 0:ne.hw)==null?void 0:fe.led)==null?void 0:ue.behaviour)==null?void 0:Y.disabled)!=null?x:"Disabled")+"")&&L(m,_),B[0]&64&&ft(o,z[6].i.d.b)},d(z){z&&A(e),d=!1,v()}}}function La(t){var C,j,S,U,G,V,F,R;let e,l,n,i,o=((U=(S=(j=(C=t[2].conf)==null?void 0:C.hw)==null?void 0:j.vcc)==null?void 0:S.offset)!=null?U:"Vcc offset")+"",a,r,c,f,_,m,d=((R=(F=(V=(G=t[2].conf)==null?void 0:G.hw)==null?void 0:V.vcc)==null?void 0:F.multiplier)!=null?R:"Multiplier")+"",v,h,k,g,T,O,E,I=(t[0].board==2||t[0].board==100)&&Oa(t);return{c(){e=p("input"),l=b(),n=p("div"),i=p("div"),a=M(o),r=p("br"),c=b(),f=p("input"),_=b(),m=p("div"),v=M(d),h=p("br"),k=b(),g=p("input"),T=b(),I&&I.c(),u(e,"type","hidden"),u(e,"name","iv"),e.value="true",u(f,"name","ivo"),u(f,"type","number"),u(f,"min","0.0"),u(f,"max","3.5"),u(f,"step","0.01"),u(f,"class","in-f tr w-full"),u(i,"class","w-1/3"),u(g,"name","ivm"),u(g,"type","number"),u(g,"min","0.1"),u(g,"max","10"),u(g,"step","0.01"),u(g,"class","in-l tr w-full"),u(m,"class","w-1/3 pr-1"),u(n,"class","my-1 flex flex-wrap")},m(z,B){q(z,e,B),q(z,l,B),q(z,n,B),s(n,i),s(i,a),s(i,r),s(i,c),s(i,f),Te(f,t[6].i.v.o),s(n,_),s(n,m),s(m,v),s(m,h),s(m,k),s(m,g),Te(g,t[6].i.v.m),s(n,T),I&&I.m(n,null),O||(E=[ve(f,"input",t[104]),ve(g,"input",t[105])],O=!0)},p(z,B){var H,W,K,Q,Z,se,X,J;B[0]&4&&o!==(o=((Q=(K=(W=(H=z[2].conf)==null?void 0:H.hw)==null?void 0:W.vcc)==null?void 0:K.offset)!=null?Q:"Vcc offset")+"")&&L(a,o),B[0]&64&&at(f.value)!==z[6].i.v.o&&Te(f,z[6].i.v.o),B[0]&4&&d!==(d=((J=(X=(se=(Z=z[2].conf)==null?void 0:Z.hw)==null?void 0:se.vcc)==null?void 0:X.multiplier)!=null?J:"Multiplier")+"")&&L(v,d),B[0]&64&&at(g.value)!==z[6].i.v.m&&Te(g,z[6].i.v.m),z[0].board==2||z[0].board==100?I?I.p(z,B):(I=Oa(z),I.c(),I.m(n,null)):I&&(I.d(1),I=null)},d(z){z&&A(e),z&&A(l),z&&A(n),I&&I.d(),O=!1,zt(E)}}}function Oa(t){var f,_,m,d;let e,l=((d=(m=(_=(f=t[2].conf)==null?void 0:f.hw)==null?void 0:_.vcc)==null?void 0:m.boot)!=null?d:"Boot limit")+"",n,i,o,a,r,c;return{c(){e=p("div"),n=M(l),i=p("br"),o=b(),a=p("input"),u(a,"name","ivb"),u(a,"type","number"),u(a,"min","2.5"),u(a,"max","3.5"),u(a,"step","0.1"),u(a,"class","in-s tr w-full"),u(e,"class","w-1/3 pl-1")},m(v,h){q(v,e,h),s(e,n),s(e,i),s(e,o),s(e,a),Te(a,t[6].i.v.b),r||(c=ve(a,"input",t[106]),r=!0)},p(v,h){var k,g,T,O;h[0]&4&&l!==(l=((O=(T=(g=(k=v[2].conf)==null?void 0:k.hw)==null?void 0:g.vcc)==null?void 0:T.boot)!=null?O:"Boot limit")+"")&&L(n,l),h[0]&64&&at(a.value)!==v[6].i.v.b&&Te(a,v[6].i.v.b)},d(v){v&&A(e),r=!1,c()}}}function Ia(t){var I,C,j,S,U,G,V,F;let e,l,n=((j=(C=(I=t[2].conf)==null?void 0:I.debug)==null?void 0:C.title)!=null?j:"Debugging")+"",i,o,a,r,c,f,_,m,d,v,h=((G=(U=(S=t[2].conf)==null?void 0:S.debug)==null?void 0:U.enable)!=null?G:"Enable debugging")+"",k,g,T,O,E=((F=(V=t[6])==null?void 0:V.d)==null?void 0:F.s)&&Ra(t);return{c(){e=p("div"),l=p("strong"),i=M(n),o=b(),a=p("a"),a.textContent="\u24D8",r=b(),c=p("input"),f=b(),_=p("div"),m=p("label"),d=p("input"),v=b(),k=M(h),g=b(),E&&E.c(),u(l,"class","text-sm"),u(a,"href","https://amsleser.no/blog/post/24-telnet-debug"),u(a,"target","_blank"),u(a,"class","float-right"),u(c,"type","hidden"),u(c,"name","d"),c.value="true",u(d,"type","checkbox"),u(d,"name","ds"),d.__value="true",d.value=d.__value,u(d,"class","rounded mb-1"),u(_,"class","mt-3"),u(e,"class","cnt")},m(R,z){q(R,e,z),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,c),s(e,f),s(e,_),s(_,m),s(m,d),d.checked=t[6].d.s,s(m,v),s(m,k),s(e,g),E&&E.m(e,null),T||(O=ve(d,"change",t[107]),T=!0)},p(R,z){var B,H,W,K,Q,Z,se,X;z[0]&4&&n!==(n=((W=(H=(B=R[2].conf)==null?void 0:B.debug)==null?void 0:H.title)!=null?W:"Debugging")+"")&&L(i,n),z[0]&64&&(d.checked=R[6].d.s),z[0]&4&&h!==(h=((Z=(Q=(K=R[2].conf)==null?void 0:K.debug)==null?void 0:Q.enable)!=null?Z:"Enable debugging")+"")&&L(k,h),(X=(se=R[6])==null?void 0:se.d)!=null&&X.s?E?E.p(R,z):(E=Ra(R),E.c(),E.m(e,null)):E&&(E.d(1),E=null)},d(R){R&&A(e),E&&E.d(),T=!1,O()}}}function Ra(t){var j,S,U,G,V,F;let e,l=((U=(S=(j=t[2].conf)==null?void 0:j.debug)==null?void 0:S.danger)!=null?U:"Disable when done")+"",n,i,o,a,r,c,f=((F=(V=(G=t[2].conf)==null?void 0:G.debug)==null?void 0:V.telnet)!=null?F:"Enable telnet")+"",_,m,d,v,h,k,g,T,O,E,I,C=t[6].d.t&&Fa(t);return{c(){e=p("div"),n=M(l),i=b(),o=p("div"),a=p("label"),r=p("input"),c=b(),_=M(f),m=b(),C&&C.c(),d=b(),v=p("div"),h=p("select"),k=p("option"),k.textContent="Verbose",g=p("option"),g.textContent="Debug",T=p("option"),T.textContent="Info",O=p("option"),O.textContent="Warning",u(e,"class","bd-red"),u(r,"type","checkbox"),u(r,"name","dt"),r.__value="true",r.value=r.__value,u(r,"class","rounded mb-1"),u(o,"class","my-1"),k.__value=1,k.value=k.__value,g.__value=2,g.value=g.__value,T.__value=3,T.value=T.__value,O.__value=4,O.value=O.__value,u(h,"name","dl"),u(h,"class","in-s"),t[6].d.l===void 0&&Gt(()=>t[109].call(h)),u(v,"class","my-1")},m(R,z){q(R,e,z),s(e,n),q(R,i,z),q(R,o,z),s(o,a),s(a,r),r.checked=t[6].d.t,s(a,c),s(a,_),q(R,m,z),C&&C.m(R,z),q(R,d,z),q(R,v,z),s(v,h),s(h,k),s(h,g),s(h,T),s(h,O),ft(h,t[6].d.l,!0),E||(I=[ve(r,"change",t[108]),ve(h,"change",t[109])],E=!0)},p(R,z){var B,H,W,K,Q,Z;z[0]&4&&l!==(l=((W=(H=(B=R[2].conf)==null?void 0:B.debug)==null?void 0:H.danger)!=null?W:"Disable when done")+"")&&L(n,l),z[0]&64&&(r.checked=R[6].d.t),z[0]&4&&f!==(f=((Z=(Q=(K=R[2].conf)==null?void 0:K.debug)==null?void 0:Q.telnet)!=null?Z:"Enable telnet")+"")&&L(_,f),R[6].d.t?C?C.p(R,z):(C=Fa(R),C.c(),C.m(d.parentNode,d)):C&&(C.d(1),C=null),z[0]&64&&ft(h,R[6].d.l)},d(R){R&&A(e),R&&A(i),R&&A(o),R&&A(m),C&&C.d(R),R&&A(d),R&&A(v),E=!1,zt(I)}}}function Fa(t){var i,o,a;let e,l=((a=(o=(i=t[2].conf)==null?void 0:i.debug)==null?void 0:o.telnet_danger)!=null?a:"Disable when done")+"",n;return{c(){e=p("div"),n=M(l),u(e,"class","bd-red")},m(r,c){q(r,e,c),s(e,n)},p(r,c){var f,_,m;c[0]&4&&l!==(l=((m=(_=(f=r[2].conf)==null?void 0:f.debug)==null?void 0:_.telnet_danger)!=null?m:"Disable when done")+"")&&L(n,l)},d(r){r&&A(e)}}}function Ba(t){var d,v,h,k;let e,l,n=((v=(d=t[2].conf)==null?void 0:d.btn_reset)!=null?v:"Factory reset")+"",i,o,a,r,c=((k=(h=t[2].btn)==null?void 0:h.reboot)!=null?k:"Reboot")+"",f,_,m;return{c(){e=p("div"),l=p("button"),i=M(n),o=b(),a=p("div"),r=p("button"),f=M(c),u(l,"type","button"),u(l,"class","btn-red"),u(r,"type","button"),u(r,"class","btn-yellow"),u(a,"class","text-center")},m(g,T){q(g,e,T),s(e,l),s(l,i),q(g,o,T),q(g,a,T),s(a,r),s(r,f),_||(m=[ve(l,"click",t[12]),ve(r,"click",t[14])],_=!0)},p(g,T){var O,E,I,C;T[0]&4&&n!==(n=((E=(O=g[2].conf)==null?void 0:O.btn_reset)!=null?E:"Factory reset")+"")&&L(i,n),T[0]&4&&c!==(c=((C=(I=g[2].btn)==null?void 0:I.reboot)!=null?C:"Reboot")+"")&&L(f,c)},d(g){g&&A(e),g&&A(o),g&&A(a),_=!1,zt(m)}}}function Ua(t){var o,a;let e,l,n=((a=(o=t[2].btn)==null?void 0:o.save)!=null?a:"Save")+"",i;return{c(){e=p("div"),l=p("button"),i=M(n),u(l,"type","submit"),u(l,"class","btn-pri"),u(e,"class","text-right")},m(r,c){q(r,e,c),s(e,l),s(l,i)},p(r,c){var f,_;c[0]&4&&n!==(n=((_=(f=r[2].btn)==null?void 0:f.save)!=null?_:"Save")+"")&&L(i,n)},d(r){r&&A(e)}}}function nc(t){var ue,Y,x,ke,me,N,w,P,D,y,ee,te,ie,_e,Ne,Me,pe,Ce,we,ge,be,ye,je,Ke,xe,et,Je,nt,We,Oe,ce,Ee,tt,$e,pt,Ge,Ye,Ve,it,vt,Mt;let e,l,n,i,o,a,r,c,f,_,m=((x=(Y=(ue=t[6])==null?void 0:ue.p)==null?void 0:Y.r)==null?void 0:x.startsWith("NO"))||((N=(me=(ke=t[6])==null?void 0:ke.p)==null?void 0:me.r)==null?void 0:N.startsWith("10YNO"))||((D=(P=(w=t[6])==null?void 0:w.p)==null?void 0:P.r)==null?void 0:D.startsWith("10Y1001A1001A4")),d,v,h,k,g,T,O,E,I,C,j,S,U,G,V,F,R,z=((y=t[6])==null?void 0:y.g)&&ea(t),B=((ee=t[6])==null?void 0:ee.m)&&ia(t),H=((te=t[6])==null?void 0:te.w)&&fa(t),W=((ie=t[6])==null?void 0:ie.n)&&ca(t),K=((_e=t[6])==null?void 0:_e.q)&&ma(t),Q=((Me=(Ne=t[6])==null?void 0:Ne.q)==null?void 0:Me.m)==3&&va(t),Z=((Ce=(pe=t[6])==null?void 0:pe.q)==null?void 0:Ce.m)==4&&ha(t),se=((we=t[6])==null?void 0:we.c)&&ba(t),X=m&&Ma(t),J=((ge=t[6])==null?void 0:ge.u)&&Ca(t),ae=((ye=(be=t[6])==null?void 0:be.i)==null?void 0:ye.h)&&(((je=t[0])==null?void 0:je.board)>20||((Ke=t[0])==null?void 0:Ke.chip)=="esp8266"||((Je=(et=(xe=t[6])==null?void 0:xe.i)==null?void 0:et.d)==null?void 0:Je.d)>0)&&Ea(t),le=((nt=t[6])==null?void 0:nt.d)&&Ia(t),ne=((We=t[1])==null?void 0:We.a)&&Ba(t),fe=t[6]&&Ua(t);return E=new _l({props:{active:t[3],message:(Ee=(ce=(Oe=t[2].conf)==null?void 0:Oe.mask)==null?void 0:ce.loading)!=null?Ee:"Loading"}}),C=new _l({props:{active:t[4],message:(pt=($e=(tt=t[2].conf)==null?void 0:tt.mask)==null?void 0:$e.saving)!=null?pt:"Saving"}}),S=new _l({props:{active:t[8],message:(Ve=(Ye=(Ge=t[2].conf)==null?void 0:Ge.mask)==null?void 0:Ye.reset)!=null?Ve:"Factory reset"}}),G=new _l({props:{active:t[9],message:(Mt=(vt=(it=t[2].conf)==null?void 0:it.mask)==null?void 0:vt.reset_done)!=null?Mt:"Done"}}),{c(){e=p("form"),l=p("div"),z&&z.c(),n=b(),B&&B.c(),i=b(),H&&H.c(),o=b(),W&&W.c(),a=b(),K&&K.c(),r=b(),Q&&Q.c(),c=b(),Z&&Z.c(),f=b(),se&&se.c(),_=b(),X&&X.c(),d=b(),J&&J.c(),v=b(),ae&&ae.c(),h=b(),le&&le.c(),k=b(),g=p("div"),ne&&ne.c(),T=b(),fe&&fe.c(),O=b(),Re(E.$$.fragment),I=b(),Re(C.$$.fragment),j=b(),Re(S.$$.fragment),U=b(),Re(G.$$.fragment),u(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),u(g,"class","grid grid-cols-3 mt-3"),u(e,"autocomplete","off")},m(he,re){q(he,e,re),s(e,l),z&&z.m(l,null),s(l,n),B&&B.m(l,null),s(l,i),H&&H.m(l,null),s(l,o),W&&W.m(l,null),s(l,a),K&&K.m(l,null),s(l,r),Q&&Q.m(l,null),s(l,c),Z&&Z.m(l,null),s(l,f),se&&se.m(l,null),s(l,_),X&&X.m(l,null),s(l,d),J&&J.m(l,null),s(l,v),ae&&ae.m(l,null),s(l,h),le&&le.m(l,null),s(e,k),s(e,g),ne&&ne.m(g,null),s(g,T),fe&&fe.m(g,null),q(he,O,re),De(E,he,re),q(he,I,re),De(C,he,re),q(he,j,re),De(S,he,re),q(he,U,re),De(G,he,re),V=!0,F||(R=ve(e,"submit",_n(t[13])),F=!0)},p(he,re){var dt,ut,rt,ct,Et,Lt,St,Pt,Ot,Ht,Ct,ht,Dt,Ft,Wt,Qe,Xe,Bt,ot,bt,wt,de,qe,Pe,Be,ze,yt,Qt,Kt,Vt,xt,el,nl,il,sl,ol,al,fl,ul,Ie,Ut;(dt=he[6])!=null&&dt.g?z?(z.p(he,re),re[0]&64&&$(z,1)):(z=ea(he),z.c(),$(z,1),z.m(l,n)):z&&(gt(),oe(z,1,1,()=>{z=null}),kt()),(ut=he[6])!=null&&ut.m?B?B.p(he,re):(B=ia(he),B.c(),B.m(l,i)):B&&(B.d(1),B=null),(rt=he[6])!=null&&rt.w?H?H.p(he,re):(H=fa(he),H.c(),H.m(l,o)):H&&(H.d(1),H=null),(ct=he[6])!=null&&ct.n?W?(W.p(he,re),re[0]&64&&$(W,1)):(W=ca(he),W.c(),$(W,1),W.m(l,a)):W&&(gt(),oe(W,1,1,()=>{W=null}),kt()),(Et=he[6])!=null&&Et.q?K?(K.p(he,re),re[0]&64&&$(K,1)):(K=ma(he),K.c(),$(K,1),K.m(l,r)):K&&(gt(),oe(K,1,1,()=>{K=null}),kt()),((St=(Lt=he[6])==null?void 0:Lt.q)==null?void 0:St.m)==3?Q?Q.p(he,re):(Q=va(he),Q.c(),Q.m(l,c)):Q&&(Q.d(1),Q=null),((Ot=(Pt=he[6])==null?void 0:Pt.q)==null?void 0:Ot.m)==4?Z?Z.p(he,re):(Z=ha(he),Z.c(),Z.m(l,f)):Z&&(Z.d(1),Z=null),(Ht=he[6])!=null&&Ht.c?se?(se.p(he,re),re[0]&64&&$(se,1)):(se=ba(he),se.c(),$(se,1),se.m(l,_)):se&&(gt(),oe(se,1,1,()=>{se=null}),kt()),re[0]&64&&(m=((Dt=(ht=(Ct=he[6])==null?void 0:Ct.p)==null?void 0:ht.r)==null?void 0:Dt.startsWith("NO"))||((Qe=(Wt=(Ft=he[6])==null?void 0:Ft.p)==null?void 0:Wt.r)==null?void 0:Qe.startsWith("10YNO"))||((ot=(Bt=(Xe=he[6])==null?void 0:Xe.p)==null?void 0:Bt.r)==null?void 0:ot.startsWith("10Y1001A1001A4"))),m?X?X.p(he,re):(X=Ma(he),X.c(),X.m(l,d)):X&&(X.d(1),X=null),(bt=he[6])!=null&&bt.u?J?J.p(he,re):(J=Ca(he),J.c(),J.m(l,v)):J&&(J.d(1),J=null),((de=(wt=he[6])==null?void 0:wt.i)==null?void 0:de.h)&&(((qe=he[0])==null?void 0:qe.board)>20||((Pe=he[0])==null?void 0:Pe.chip)=="esp8266"||((yt=(ze=(Be=he[6])==null?void 0:Be.i)==null?void 0:ze.d)==null?void 0:yt.d)>0)?ae?(ae.p(he,re),re[0]&65&&$(ae,1)):(ae=Ea(he),ae.c(),$(ae,1),ae.m(l,h)):ae&&(gt(),oe(ae,1,1,()=>{ae=null}),kt()),(Qt=he[6])!=null&&Qt.d?le?le.p(he,re):(le=Ia(he),le.c(),le.m(l,null)):le&&(le.d(1),le=null),(Kt=he[1])!=null&&Kt.a?ne?ne.p(he,re):(ne=Ba(he),ne.c(),ne.m(g,T)):ne&&(ne.d(1),ne=null),he[6]?fe?fe.p(he,re):(fe=Ua(he),fe.c(),fe.m(g,null)):fe&&(fe.d(1),fe=null);const Fe={};re[0]&8&&(Fe.active=he[3]),re[0]&4&&(Fe.message=(el=(xt=(Vt=he[2].conf)==null?void 0:Vt.mask)==null?void 0:xt.loading)!=null?el:"Loading"),E.$set(Fe);const Tt={};re[0]&16&&(Tt.active=he[4]),re[0]&4&&(Tt.message=(sl=(il=(nl=he[2].conf)==null?void 0:nl.mask)==null?void 0:il.saving)!=null?sl:"Saving"),C.$set(Tt);const Se={};re[0]&256&&(Se.active=he[8]),re[0]&4&&(Se.message=(fl=(al=(ol=he[2].conf)==null?void 0:ol.mask)==null?void 0:al.reset)!=null?fl:"Factory reset"),S.$set(Se);const Ae={};re[0]&512&&(Ae.active=he[9]),re[0]&4&&(Ae.message=(Ut=(Ie=(ul=he[2].conf)==null?void 0:ul.mask)==null?void 0:Ie.reset_done)!=null?Ut:"Done"),G.$set(Ae)},i(he){V||($(z),$(W),$(K),$(se),$(ae),$(E.$$.fragment,he),$(C.$$.fragment,he),$(S.$$.fragment,he),$(G.$$.fragment,he),V=!0)},o(he){oe(z),oe(W),oe(K),oe(se),oe(ae),oe(E.$$.fragment,he),oe(C.$$.fragment,he),oe(S.$$.fragment,he),oe(G.$$.fragment,he),V=!1},d(he){he&&A(e),z&&z.d(),B&&B.d(),H&&H.d(),W&&W.d(),K&&K.d(),Q&&Q.d(),Z&&Z.d(),se&&se.d(),X&&X.d(),J&&J.d(),ae&&ae.d(),le&&le.d(),ne&&ne.d(),fe&&fe.d(),he&&A(O),Le(E,he),he&&A(I),Le(C,he),he&&A(j),Le(S,he),he&&A(U),Le(G,he),F=!1,R()}}}async function ic(){await(await fetch("reboot",{method:"POST"})).json()}function sc(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,{data:o}=e,a={};pl.subscribe(Be=>{l(2,a=Be)});let r=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{name:"Per phase",key:"h"},{name:"Power factor",key:"f"},{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"}],c=!0,f=!1,_=!1,m,d=[];Wn.subscribe(Be=>{var ze,yt,Qt,Kt;Be.version&&(l(5,_=(ze=Be==null?void 0:Be.c)==null?void 0:ze.e),l(6,m=Be),l(3,c=!1),l(7,d=[{code:"en",name:"English"}]),((yt=m==null?void 0:m.u)==null?void 0:yt.lang)&&m.u.lang!="en"&&d.push({code:m.u.lang,name:(Kt=(Qt=a.language)==null?void 0:Qt.name)!=null?Kt:"Unknown"}),d.push({code:"hub",name:"Load from server"}))}),w0();let v=!1,h=!1;async function k(){if(confirm("Factory reset?")){l(8,v=!0);const Be=new URLSearchParams;Be.append("perform","true");let yt=await(await fetch("reset",{method:"POST",body:Be})).json();l(8,v=!1),l(9,h=yt.success)}}async function g(Be){l(4,f=!0);const ze=new FormData(Be.target),yt=new URLSearchParams;for(let Vt of ze){const[xt,el]=Vt;yt.append(xt,el)}let Kt=await(await fetch("save",{method:"POST",body:yt})).json();ml.update(Vt=>(Vt.hostname=ze.get("gh"),Vt.usrcfg=Kt.success,Vt.booting=Kt.reboot,ze.get("nm")=="static"&&(Vt.net.ip=ze.get("ni"),Vt.net.mask=ze.get("nu"),Vt.net.gw=ze.get("ng"),Vt.net.dns1=ze.get("nd")),Vt.ui=m.u,Vt)),l(4,f=!1),en(n)}const T=function(){confirm("Reboot?")&&(ml.update(Be=>(Be.booting=!0,Be)),ic())};async function O(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("mqtt-ca",{method:"POST"})).text(),Wn.update(ze=>(ze.q.s.c=!1,ze)))}async function E(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("mqtt-cert",{method:"POST"})).text(),Wn.update(ze=>(ze.q.s.r=!1,ze)))}async function I(){confirm("Are you sure you want to delete key?")&&(await(await fetch("mqtt-key",{method:"POST"})).text(),Wn.update(ze=>(ze.q.s.k=!1,ze)))}const C=function(){m.q.s.e?m.q.p==1883&&l(6,m.q.p=8883,m):m.q.p==8883&&l(6,m.q.p=1883,m)};async function j(){if(m.u.lang=="hub"){const Be=await Sl("http://hub.amsleser.no/hub/language/list.json");l(7,d=await Be.json()),l(6,m.u.lang=a.language.code,m)}}let S=44;async function U(){const Be=await Sl("cloudkey.json");if(Be.status==200){let ze=await Be.json();window.open("https://www.amsleser.cloud/device/"+ze.seed)}else alert("Not able to bind to cloud")}const G=window||global;G.bindToCloud=function(){console.log("BIND CALLED")};function V(){m.g.h=this.value,l(6,m)}function F(){m.g.t=Xt(this),l(6,m)}function R(){m.p.r=Xt(this),l(6,m)}function z(){m.p.c=Xt(this),l(6,m)}function B(){m.p.e=this.checked,l(6,m)}function H(){m.p.t=this.value,l(6,m)}function W(){m.g.s=Xt(this),l(6,m)}function K(){m.g.u=this.value,l(6,m)}function Q(){m.g.p=this.value,l(6,m)}function Z(){m.g.c=this.value,l(6,m)}function se(){m.m.a=Xt(this),l(6,m)}function X(){m.m.b=at(this.value),l(6,m)}function J(){m.m.i=this.checked,l(6,m)}function ae(){m.m.b=Xt(this),l(6,m)}function le(){m.m.p=Xt(this),l(6,m)}function ne(){m.m.s=at(this.value),l(6,m)}function fe(){m.m.d=Xt(this),l(6,m)}function ue(){m.m.f=at(this.value),l(6,m)}function Y(){m.m.r=at(this.value),l(6,m)}function x(){m.m.e.e=this.checked,l(6,m)}function ke(){m.m.e.k=this.value,l(6,m)}function me(){m.m.e.a=this.value,l(6,m)}function N(){m.m.m.e=this.checked,l(6,m)}function w(){m.m.m.w=at(this.value),l(6,m)}function P(){m.m.m.v=at(this.value),l(6,m)}function D(){m.m.m.a=at(this.value),l(6,m)}function y(){m.m.m.c=at(this.value),l(6,m)}function ee(){m.n.c=Xt(this),l(6,m)}function te(){m.w.s=this.value,l(6,m)}function ie(){m.w.p=this.value,l(6,m)}function _e(){m.w.z=Xt(this),l(6,m)}function Ne(){m.w.w=at(this.value),l(6,m)}function Me(){m.w.b=this.checked,l(6,m)}function pe(){m.n.m=Xt(this),l(6,m)}function Ce(){m.n.i=this.value,l(6,m)}function we(){m.n.s=Xt(this),l(6,m)}function ge(){m.n.g=this.value,l(6,m)}function be(){m.n.d1=this.value,l(6,m)}function ye(){m.n.d2=this.value,l(6,m)}function je(){m.n.x=this.checked,l(6,m)}function Ke(){m.n.d=this.checked,l(6,m)}function xe(){m.n.h=this.checked,l(6,m)}function et(){m.n.n1=this.value,l(6,m)}function Je(){m.q.s.e=this.checked,l(6,m)}function nt(){m.q.h=this.value,l(6,m)}function We(){m.q.p=at(this.value),l(6,m)}function Oe(){m.q.u=this.value,l(6,m)}function ce(){m.q.a=this.value,l(6,m)}function Ee(){m.q.c=this.value,l(6,m)}function tt(){m.q.m=Xt(this),l(6,m)}function $e(){m.q.b=this.value,l(6,m)}function pt(){m.o.e=this.value,l(6,m)}function Ge(){m.o.c=this.value,l(6,m)}function Ye(){m.o.u1=this.value,l(6,m)}function Ve(){m.o.u2=this.value,l(6,m)}function it(){m.o.u3=this.value,l(6,m)}function vt(){m.h.t=this.value,l(6,m)}function Mt(){m.h.h=this.value,l(6,m)}function he(){m.h.n=this.value,l(6,m)}function re(){m.c.e=this.checked,l(6,m)}function Fe(){m.c.es=this.checked,l(6,m)}function Tt(Be){m.t.t[Be]=at(this.value),l(6,m)}function Se(){m.t.h=at(this.value),l(6,m)}function Ae(Be){m.u[Be.key]=Xt(this),l(6,m)}function dt(){m.u.lang=Xt(this),l(6,m)}function ut(){m.i.h.p=Xt(this),l(6,m)}function rt(){m.i.h.t=Xt(this),l(6,m)}function ct(){m.i.h.u=this.checked,l(6,m)}function Et(){m.i.a=at(this.value),l(6,m)}function Lt(){m.i.l.p=at(this.value),l(6,m)}function St(){m.i.l.i=this.checked,l(6,m)}function Pt(){m.i.r.i=this.checked,l(6,m)}function Ot(){m.i.r.r=at(this.value),l(6,m)}function Ht(){m.i.r.g=at(this.value),l(6,m)}function Ct(){m.i.r.b=at(this.value),l(6,m)}function ht(){m.i.d.d=at(this.value),l(6,m)}function Dt(){m.i.t.d=at(this.value),l(6,m)}function Ft(){m.i.t.a=at(this.value),l(6,m)}function Wt(){m.i.v.p=at(this.value),l(6,m)}function Qe(){m.i.v.d.v=at(this.value),l(6,m)}function Xe(){m.i.v.d.g=at(this.value),l(6,m)}function Bt(){m.i.d.b=Xt(this),l(6,m)}function ot(){m.i.v.o=at(this.value),l(6,m)}function bt(){m.i.v.m=at(this.value),l(6,m)}function wt(){m.i.v.b=at(this.value),l(6,m)}function de(){m.d.s=this.checked,l(6,m)}function qe(){m.d.t=this.checked,l(6,m)}function Pe(){m.d.l=Xt(this),l(6,m)}return t.$$set=Be=>{"basepath"in Be&&l(21,n=Be.basepath),"sysinfo"in Be&&l(0,i=Be.sysinfo),"data"in Be&&l(1,o=Be.data)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(10,S=i.chip=="esp8266"?16:i.chip=="esp32s2"?44:39)},[i,o,a,c,f,_,m,d,v,h,S,r,k,g,T,O,E,I,C,j,U,n,V,F,R,z,B,H,W,K,Q,Z,se,X,J,ae,le,ne,fe,ue,Y,x,ke,me,N,w,P,D,y,ee,te,ie,_e,Ne,Me,pe,Ce,we,ge,be,ye,je,Ke,xe,et,Je,nt,We,Oe,ce,Ee,tt,$e,pt,Ge,Ye,Ve,it,vt,Mt,he,re,Fe,Tt,Se,Ae,dt,ut,rt,ct,Et,Lt,St,Pt,Ot,Ht,Ct,ht,Dt,Ft,Wt,Qe,Xe,Bt,ot,bt,wt,de,qe,Pe]}class oc extends qt{constructor(e){super(),At(this,e,sc,nc,Nt,{basepath:21,sysinfo:0,data:1},null,[-1,-1,-1,-1,-1])}}function ja(t,e,l){const n=t.slice();return n[22]=e[l],n}function Ha(t){let e,l=t[1].cpu+"",n,i;return{c(){e=M("("),n=M(l),i=M("MHz)")},m(o,a){q(o,e,a),q(o,n,a),q(o,i,a)},p(o,a){a&2&&l!==(l=o[1].cpu+"")&&L(n,l)},d(o){o&&A(e),o&&A(n),o&&A(i)}}}function ac(t){let e=lt(t[1].chip,t[1].board)+"",l;return{c(){l=M(e)},m(n,i){q(n,l,i)},p(n,i){i&2&&e!==(e=lt(n[1].chip,n[1].board)+"")&&L(l,e)},d(n){n&&A(l)}}}function ya(t){var W,K,Q,Z,se,X,J,ae,le,ne,fe,ue;let e,l=((Q=(K=(W=t[3].status)==null?void 0:W.device)==null?void 0:K.apmac)!=null?Q:"AP MAC")+"",n,i,o=t[1].apmac+"",a,r,c,f=((X=(se=(Z=t[3].status)==null?void 0:Z.device)==null?void 0:se.last_boot)!=null?X:"Last boot")+"",_,m,d,v,h,k,g=((le=(ae=(J=t[3].status)==null?void 0:J.device)==null?void 0:ae.reason)!=null?le:"Reason")+"",T,O,E=((ue=(fe=(ne=t[3][As(t[1].chip)])==null?void 0:ne.reason)==null?void 0:fe[t[1].boot_reason])!=null?ue:t[1].boot_reason)+"",I,C,j=t[1].boot_reason+"",S,U,G=t[1].ex_cause+"",V,F,R;const z=[uc,fc],B=[];function H(Y,x){return Y[0].u>0?0:1}return d=H(t),v=B[d]=z[d](t),{c(){e=p("div"),n=M(l),i=M(": "),a=M(o),r=b(),c=p("div"),_=M(f),m=M(`: + `),v.c(),h=b(),k=p("div"),T=M(g),O=M(": "),I=M(E),C=M(" ("),S=M(j),U=M("/"),V=M(G),F=M(")"),u(e,"class","my-2"),u(c,"class","my-2"),u(k,"class","my-2")},m(Y,x){q(Y,e,x),s(e,n),s(e,i),s(e,a),q(Y,r,x),q(Y,c,x),s(c,_),s(c,m),B[d].m(c,null),q(Y,h,x),q(Y,k,x),s(k,T),s(k,O),s(k,I),s(k,C),s(k,S),s(k,U),s(k,V),s(k,F),R=!0},p(Y,x){var me,N,w,P,D,y,ee,te,ie,_e,Ne,Me;(!R||x&8)&&l!==(l=((w=(N=(me=Y[3].status)==null?void 0:me.device)==null?void 0:N.apmac)!=null?w:"AP MAC")+"")&&L(n,l),(!R||x&2)&&o!==(o=Y[1].apmac+"")&&L(a,o),(!R||x&8)&&f!==(f=((y=(D=(P=Y[3].status)==null?void 0:P.device)==null?void 0:D.last_boot)!=null?y:"Last boot")+"")&&L(_,f);let ke=d;d=H(Y),d===ke?B[d].p(Y,x):(gt(),oe(B[ke],1,1,()=>{B[ke]=null}),kt(),v=B[d],v?v.p(Y,x):(v=B[d]=z[d](Y),v.c()),$(v,1),v.m(c,null)),(!R||x&8)&&g!==(g=((ie=(te=(ee=Y[3].status)==null?void 0:ee.device)==null?void 0:te.reason)!=null?ie:"Reason")+"")&&L(T,g),(!R||x&10)&&E!==(E=((Me=(Ne=(_e=Y[3][As(Y[1].chip)])==null?void 0:_e.reason)==null?void 0:Ne[Y[1].boot_reason])!=null?Me:Y[1].boot_reason)+"")&&L(I,E),(!R||x&2)&&j!==(j=Y[1].boot_reason+"")&&L(S,j),(!R||x&2)&&G!==(G=Y[1].ex_cause+"")&&L(V,G)},i(Y){R||($(v),R=!0)},o(Y){oe(v),R=!1},d(Y){Y&&A(e),Y&&A(r),Y&&A(c),B[d].d(),Y&&A(h),Y&&A(k)}}}function fc(t){let e;return{c(){e=M("-")},m(l,n){q(l,e,n)},p:Ze,i:Ze,o:Ze,d(l){l&&A(e)}}}function uc(t){let e,l;return e=new Cu({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:""}}),{c(){Re(e.$$.fragment)},m(n,i){De(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||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function za(t){var _,m;let e,l,n,i,o=((m=(_=t[3].btn)==null?void 0:_.reboot)!=null?m:"Reboot")+"",a,r,c,f;return l=new Ml({props:{to:"/consent",$$slots:{default:[rc]},$$scope:{ctx:t}}}),{c(){e=p("div"),Re(l.$$.fragment),n=b(),i=p("button"),a=M(o),u(i,"class","btn-yellow-sm float-right"),u(e,"class","my-2")},m(d,v){q(d,e,v),De(l,e,null),s(e,n),s(e,i),s(i,a),r=!0,c||(f=ve(i,"click",t[12]),c=!0)},p(d,v){var k,g;const h={};v&33554440&&(h.$$scope={dirty:v,ctx:d}),l.$set(h),(!r||v&8)&&o!==(o=((g=(k=d[3].btn)==null?void 0:k.reboot)!=null?g:"Reboot")+"")&&L(a,o)},i(d){r||($(l.$$.fragment,d),r=!0)},o(d){oe(l.$$.fragment,d),r=!1},d(d){d&&A(e),Le(l),c=!1,f()}}}function rc(t){var i,o,a;let e,l=((a=(o=(i=t[3].status)==null?void 0:i.device)==null?void 0:o.btn_consents)!=null?a:"Consents")+"",n;return{c(){e=p("span"),n=M(l),u(e,"class","btn-pri-sm")},m(r,c){q(r,e,c),s(e,n)},p(r,c){var f,_,m;c&8&&l!==(l=((m=(_=(f=r[3].status)==null?void 0:f.device)==null?void 0:_.btn_consents)!=null?m:"Consents")+"")&&L(n,l)},d(r){r&&A(e)}}}function Wa(t){var V,F,R,z,B,H,W,K,Q,Z,se,X;let e,l,n=((R=(F=(V=t[3].status)==null?void 0:V.meter)==null?void 0:F.title)!=null?R:"Meter")+"",i,o,a,r=((H=(B=(z=t[3].status)==null?void 0:z.meter)==null?void 0:B.manufacturer)!=null?H:"Manufacturer")+"",c,f,_=_i(t[1].meter.mfg)+"",m,d,v,h=((Q=(K=(W=t[3].status)==null?void 0:W.meter)==null?void 0:K.model)!=null?Q:"Model")+"",k,g,T=(t[1].meter.model?t[1].meter.model:"unknown")+"",O,E,I,C=((X=(se=(Z=t[3].status)==null?void 0:Z.meter)==null?void 0:se.id)!=null?X:"ID")+"",j,S,U=(t[1].meter.id?t[1].meter.id:"unknown")+"",G;return{c(){e=p("div"),l=p("strong"),i=M(n),o=b(),a=p("div"),c=M(r),f=M(": "),m=M(_),d=b(),v=p("div"),k=M(h),g=M(": "),O=M(T),E=b(),I=p("div"),j=M(C),S=M(": "),G=M(U),u(l,"class","text-sm"),u(a,"class","my-2"),u(v,"class","my-2"),u(I,"class","my-2"),u(e,"class","cnt")},m(J,ae){q(J,e,ae),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(a,f),s(a,m),s(e,d),s(e,v),s(v,k),s(v,g),s(v,O),s(e,E),s(e,I),s(I,j),s(I,S),s(I,G)},p(J,ae){var le,ne,fe,ue,Y,x,ke,me,N,w,P,D;ae&8&&n!==(n=((fe=(ne=(le=J[3].status)==null?void 0:le.meter)==null?void 0:ne.title)!=null?fe:"Meter")+"")&&L(i,n),ae&8&&r!==(r=((x=(Y=(ue=J[3].status)==null?void 0:ue.meter)==null?void 0:Y.manufacturer)!=null?x:"Manufacturer")+"")&&L(c,r),ae&2&&_!==(_=_i(J[1].meter.mfg)+"")&&L(m,_),ae&8&&h!==(h=((N=(me=(ke=J[3].status)==null?void 0:ke.meter)==null?void 0:me.model)!=null?N:"Model")+"")&&L(k,h),ae&2&&T!==(T=(J[1].meter.model?J[1].meter.model:"unknown")+"")&&L(O,T),ae&8&&C!==(C=((D=(P=(w=J[3].status)==null?void 0:w.meter)==null?void 0:P.id)!=null?D:"ID")+"")&&L(j,C),ae&2&&U!==(U=(J[1].meter.id?J[1].meter.id:"unknown")+"")&&L(G,U)},d(J){J&&A(e)}}}function Ga(t){var K,Q,Z,se,X,J,ae,le,ne,fe,ue,Y;let e,l,n=((Z=(Q=(K=t[3].status)==null?void 0:K.network)==null?void 0:Q.title)!=null?Z:"Network")+"",i,o,a,r=((J=(X=(se=t[3].conf)==null?void 0:se.network)==null?void 0:X.ip)!=null?J:"IP")+"",c,f,_=t[1].net.ip+"",m,d,v,h=((ne=(le=(ae=t[3].conf)==null?void 0:ae.network)==null?void 0:le.mask)!=null?ne:"Mask")+"",k,g,T=t[1].net.mask+"",O,E,I,C=((Y=(ue=(fe=t[3].conf)==null?void 0:fe.network)==null?void 0:ue.gw)!=null?Y:"Gateway")+"",j,S,U=t[1].net.gw+"",G,V,F,R,z,B=t[1].net.dns1&&Va(t),H=t[1].net.dns2&&Ka(t),W=t[1].net.ipv6&&Ya(t);return{c(){e=p("div"),l=p("strong"),i=M(n),o=b(),a=p("div"),c=M(r),f=M(": "),m=M(_),d=b(),v=p("div"),k=M(h),g=M(": "),O=M(T),E=b(),I=p("div"),j=M(C),S=M(": "),G=M(U),V=b(),F=p("div"),B&&B.c(),R=b(),H&&H.c(),z=b(),W&&W.c(),u(l,"class","text-sm"),u(a,"class","my-2"),u(v,"class","my-2"),u(I,"class","my-2"),u(F,"class","my-2"),u(e,"class","cnt")},m(x,ke){q(x,e,ke),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(a,f),s(a,m),s(e,d),s(e,v),s(v,k),s(v,g),s(v,O),s(e,E),s(e,I),s(I,j),s(I,S),s(I,G),s(e,V),s(e,F),B&&B.m(F,null),s(F,R),H&&H.m(F,null),s(e,z),W&&W.m(e,null)},p(x,ke){var me,N,w,P,D,y,ee,te,ie,_e,Ne,Me;ke&8&&n!==(n=((w=(N=(me=x[3].status)==null?void 0:me.network)==null?void 0:N.title)!=null?w:"Network")+"")&&L(i,n),ke&8&&r!==(r=((y=(D=(P=x[3].conf)==null?void 0:P.network)==null?void 0:D.ip)!=null?y:"IP")+"")&&L(c,r),ke&2&&_!==(_=x[1].net.ip+"")&&L(m,_),ke&8&&h!==(h=((ie=(te=(ee=x[3].conf)==null?void 0:ee.network)==null?void 0:te.mask)!=null?ie:"Mask")+"")&&L(k,h),ke&2&&T!==(T=x[1].net.mask+"")&&L(O,T),ke&8&&C!==(C=((Me=(Ne=(_e=x[3].conf)==null?void 0:_e.network)==null?void 0:Ne.gw)!=null?Me:"Gateway")+"")&&L(j,C),ke&2&&U!==(U=x[1].net.gw+"")&&L(G,U),x[1].net.dns1?B?B.p(x,ke):(B=Va(x),B.c(),B.m(F,R)):B&&(B.d(1),B=null),x[1].net.dns2?H?H.p(x,ke):(H=Ka(x),H.c(),H.m(F,null)):H&&(H.d(1),H=null),x[1].net.ipv6?W?W.p(x,ke):(W=Ya(x),W.c(),W.m(e,null)):W&&(W.d(1),W=null)},d(x){x&&A(e),B&&B.d(),H&&H.d(),W&&W.d()}}}function Va(t){var a,r,c;let e=((c=(r=(a=t[3].conf)==null?void 0:a.network)==null?void 0:r.dns)!=null?c:"DNS")+"",l,n,i=t[1].net.dns1+"",o;return{c(){l=M(e),n=M(": "),o=M(i)},m(f,_){q(f,l,_),q(f,n,_),q(f,o,_)},p(f,_){var m,d,v;_&8&&e!==(e=((v=(d=(m=f[3].conf)==null?void 0:m.network)==null?void 0:d.dns)!=null?v:"DNS")+"")&&L(l,e),_&2&&i!==(i=f[1].net.dns1+"")&&L(o,i)},d(f){f&&A(l),f&&A(n),f&&A(o)}}}function Ka(t){var a,r,c;let e=((c=(r=(a=t[3].conf)==null?void 0:a.network)==null?void 0:r.dns)!=null?c:"DNS")+"",l,n,i=t[1].net.dns2+"",o;return{c(){l=M(e),n=M(": "),o=M(i)},m(f,_){q(f,l,_),q(f,n,_),q(f,o,_)},p(f,_){var m,d,v;_&8&&e!==(e=((v=(d=(m=f[3].conf)==null?void 0:m.network)==null?void 0:d.dns)!=null?v:"DNS")+"")&&L(l,e),_&2&&i!==(i=f[1].net.dns2+"")&&L(o,i)},d(f){f&&A(l),f&&A(n),f&&A(o)}}}function Ya(t){let e,l,n=t[1].net.ipv6+"",i,o,a,r,c=t[1].net.dns1v6&&Qa(t),f=t[1].net.dns2v6&&Xa(t);return{c(){e=p("div"),l=M("IPv6: "),i=M(n),o=b(),a=p("div"),c&&c.c(),r=b(),f&&f.c(),u(e,"class","my-2"),u(a,"class","my-2")},m(_,m){q(_,e,m),s(e,l),s(e,i),q(_,o,m),q(_,a,m),c&&c.m(a,null),s(a,r),f&&f.m(a,null)},p(_,m){m&2&&n!==(n=_[1].net.ipv6+"")&&L(i,n),_[1].net.dns1v6?c?c.p(_,m):(c=Qa(_),c.c(),c.m(a,r)):c&&(c.d(1),c=null),_[1].net.dns2v6?f?f.p(_,m):(f=Xa(_),f.c(),f.m(a,null)):f&&(f.d(1),f=null)},d(_){_&&A(e),_&&A(o),_&&A(a),c&&c.d(),f&&f.d()}}}function Qa(t){let e,l=t[1].net.dns1v6+"",n;return{c(){e=M("DNSv6: "),n=M(l)},m(i,o){q(i,e,o),q(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns1v6+"")&&L(n,l)},d(i){i&&A(e),i&&A(n)}}}function Xa(t){let e,l=t[1].net.dns2v6+"",n;return{c(){e=M("DNSv6: "),n=M(l)},m(i,o){q(i,e,o),q(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns2v6+"")&&L(n,l)},d(i){i&&A(e),i&&A(n)}}}function Za(t){var c,f,_,m,d,v;let e,l,n=((_=(f=(c=t[3].status)==null?void 0:c.firmware)==null?void 0:f.failed)!=null?_:"Upgrade from {0} to {1} failed").replace("{0}",t[1].upgrade.f).replace("{1}",t[1].upgrade.t)+"",i,o,a=((v=(d=(m=t[3].errors)==null?void 0:m.http)==null?void 0:d[t[1].upgrade.e])!=null?v:t[1].upgrade.e)+"",r;return{c(){e=p("div"),l=p("div"),i=M(n),o=b(),r=M(a),u(l,"class","bd-yellow"),u(e,"class","my-2")},m(h,k){q(h,e,k),s(e,l),s(l,i),s(l,o),s(l,r)},p(h,k){var g,T,O,E,I,C;k&10&&n!==(n=((O=(T=(g=h[3].status)==null?void 0:g.firmware)==null?void 0:T.failed)!=null?O:"Upgrade from {0} to {1} failed").replace("{0}",h[1].upgrade.f).replace("{1}",h[1].upgrade.t)+"")&&L(i,n),k&10&&a!==(a=((C=(I=(E=h[3].errors)==null?void 0:E.http)==null?void 0:I[h[1].upgrade.e])!=null?C:h[1].upgrade.e)+"")&&L(r,a)},d(h){h&&A(e)}}}function Ja(t){var h,k,g;let e,l=((g=(k=(h=t[3].status)==null?void 0:h.firmware)==null?void 0:k.latest)!=null?g:"Latest")+"",n,i,o,a=t[4].tag_name+"",r,c,f,_,m,d=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[4]&&t[4].tag_name!=t[1].version&&$a(t),v=t[1].fwconsent===2&&xa(t);return{c(){e=p("div"),n=M(l),i=M(`: + `),o=p("a"),r=M(a),f=b(),d&&d.c(),_=b(),v&&v.c(),m=Jt(),u(o,"href",c=t[4].html_url),u(o,"class","ml-2 text-blue-600 hover:text-blue-800"),u(o,"target","_blank"),u(o,"rel","noreferrer"),u(e,"class","my-2 flex")},m(T,O){q(T,e,O),s(e,n),s(e,i),s(e,o),s(o,r),s(e,f),d&&d.m(e,null),q(T,_,O),v&&v.m(T,O),q(T,m,O)},p(T,O){var E,I,C;O&8&&l!==(l=((C=(I=(E=T[3].status)==null?void 0:E.firmware)==null?void 0:I.latest)!=null?C:"Latest")+"")&&L(n,l),O&16&&a!==(a=T[4].tag_name+"")&&L(r,a),O&16&&c!==(c=T[4].html_url)&&u(o,"href",c),(T[1].security==0||T[0].a)&&T[1].fwconsent===1&&T[4]&&T[4].tag_name!=T[1].version?d?d.p(T,O):(d=$a(T),d.c(),d.m(e,null)):d&&(d.d(1),d=null),T[1].fwconsent===2?v?v.p(T,O):(v=xa(T),v.c(),v.m(m.parentNode,m)):v&&(v.d(1),v=null)},d(T){T&&A(e),d&&d.d(),T&&A(_),v&&v.d(T),T&&A(m)}}}function $a(t){let e,l,n,i,o;return{c(){var a,r,c;e=p("div"),l=p("button"),l.textContent="\u21D3",u(e,"class","flex-none ml-2 text-green-500"),u(e,"title",n=(c=(r=(a=t[3].status)==null?void 0:a.firmware)==null?void 0:r.install)!=null?c:"Install")},m(a,r){q(a,e,r),s(e,l),i||(o=ve(l,"click",t[11]),i=!0)},p(a,r){var c,f,_;r&8&&n!==(n=(_=(f=(c=a[3].status)==null?void 0:c.firmware)==null?void 0:f.install)!=null?_:"Install")&&u(e,"title",n)},d(a){a&&A(e),i=!1,o()}}}function xa(t){var o,a,r;let e,l,n=((r=(a=(o=t[3].status)==null?void 0:o.firmware)==null?void 0:a.no_one_click)!=null?r:"One-click upgrade disabled")+"",i;return{c(){e=p("div"),l=p("div"),i=M(n),u(l,"class","bd-yellow"),u(e,"class","my-2")},m(c,f){q(c,e,f),s(e,l),s(l,i)},p(c,f){var _,m,d;f&8&&n!==(n=((d=(m=(_=c[3].status)==null?void 0:_.firmware)==null?void 0:m.no_one_click)!=null?d:"One-click upgrade disabled")+"")&&L(i,n)},d(c){c&&A(e)}}}function ef(t){let e,l=mi(lt(t[1].chip,t[1].board))+"",n;return{c(){e=p("div"),n=M(l),u(e,"class","bd-red")},m(i,o){q(i,e,o),s(e,n)},p(i,o){o&2&&l!==(l=mi(lt(i[1].chip,i[1].board))+"")&&L(n,l)},d(i){i&&A(e)}}}function tf(t){let e,l,n,i,o,a;function r(_,m){return _[6].length==0?_c:cc}let c=r(t),f=c(t);return{c(){e=p("div"),l=p("form"),n=p("input"),i=b(),f.c(),Gn(n,"display","none"),u(n,"name","file"),u(n,"type","file"),u(n,"accept",".bin"),u(l,"action","/firmware"),u(l,"enctype","multipart/form-data"),u(l,"method","post"),u(l,"autocomplete","off"),u(e,"class","my-2 flex")},m(_,m){q(_,e,m),s(e,l),s(l,n),t[14](n),s(l,i),f.m(l,null),o||(a=[ve(n,"change",t[15]),ve(l,"submit",t[17])],o=!0)},p(_,m){c===(c=r(_))&&f?f.p(_,m):(f.d(1),f=c(_),f&&(f.c(),f.m(l,null)))},d(_){_&&A(e),t[14](null),f.d(),o=!1,zt(a)}}}function cc(t){var r,c;let e=t[6][0].name+"",l,n,i,o=((c=(r=t[3].btn)==null?void 0:r.upload)!=null?c:"Upload")+"",a;return{c(){l=M(e),n=b(),i=p("button"),a=M(o),u(i,"type","submit"),u(i,"class","btn-pri-sm float-right ml-2")},m(f,_){q(f,l,_),q(f,n,_),q(f,i,_),s(i,a)},p(f,_){var m,d;_&64&&e!==(e=f[6][0].name+"")&&L(l,e),_&8&&o!==(o=((d=(m=f[3].btn)==null?void 0:m.upload)!=null?d:"Upload")+"")&&L(a,o)},d(f){f&&A(l),f&&A(n),f&&A(i)}}}function _c(t){var a,r,c;let e,l=((c=(r=(a=t[3].status)==null?void 0:a.firmware)==null?void 0:r.btn_select_file)!=null?c:"Select file")+"",n,i,o;return{c(){e=p("button"),n=M(l),u(e,"type","button"),u(e,"class","btn-pri-sm float-right")},m(f,_){q(f,e,_),s(e,n),i||(o=ve(e,"click",t[16]),i=!0)},p(f,_){var m,d,v;_&8&&l!==(l=((v=(d=(m=f[3].status)==null?void 0:m.firmware)==null?void 0:d.btn_select_file)!=null?v:"Select file")+"")&&L(n,l)},d(f){f&&A(e),i=!1,o()}}}function lf(t){var H,W,K,Q,Z,se,X,J,ae;let e,l,n=((K=(W=(H=t[3].status)==null?void 0:H.backup)==null?void 0:W.title)!=null?K:"Backup")+"",i,o,a,r,c,f,_,m,d=((se=(Z=(Q=t[3].status)==null?void 0:Q.backup)==null?void 0:Z.secrets)!=null?se:"Include secrets")+"",v,h,k,g=((ae=(J=(X=t[3].status)==null?void 0:X.backup)==null?void 0:J.secrets_desc)!=null?ae:"")+"",T,O,E,I,C,j,S,U,G=t[10],V=[];for(let le=0;le{ie=null}),kt()),(Wt=Se[0])!=null&&Wt.a?_e?(_e.p(Se,Ae),Ae&1&&$(_e,1)):(_e=za(Se),_e.c(),$(_e,1),_e.m(l,null)):_e&&(gt(),oe(_e,1,1,()=>{_e=null}),kt()),Se[1].meter?Ne?Ne.p(Se,Ae):(Ne=Wa(Se),Ne.c(),Ne.m(e,B)):Ne&&(Ne.d(1),Ne=null),Se[1].net?Me?Me.p(Se,Ae):(Me=Ga(Se),Me.c(),Me.m(e,H)):Me&&(Me.d(1),Me=null),(!ee||Ae&8)&&Q!==(Q=((Bt=(Xe=(Qe=Se[3].status)==null?void 0:Qe.firmware)==null?void 0:Xe.title)!=null?Bt:"Firmware")+"")&&L(Z,Q),(!ee||Ae&8)&&J!==(J=((wt=(bt=(ot=Se[3].status)==null?void 0:ot.firmware)==null?void 0:bt.installed)!=null?wt:"Installed")+"")&&L(ae,J),(!ee||Ae&2)&&ne!==(ne=Se[1].version+"")&&L(fe,ne),Se[1].upgrade.t&&Se[1].upgrade.t!=Se[1].version?pe?pe.p(Se,Ae):(pe=Za(Se),pe.c(),pe.m(W,Y)):pe&&(pe.d(1),pe=null),Se[4]?Ce?Ce.p(Se,Ae):(Ce=Ja(Se),Ce.c(),Ce.m(W,x)):Ce&&(Ce.d(1),Ce=null),Ae&3&&(ke=(Se[1].security==0||Se[0].a)&&fn(Se[1].board)),ke?we?we.p(Se,Ae):(we=ef(Se),we.c(),we.m(W,me)):we&&(we.d(1),we=null),Se[1].security==0||Se[0].a?ge?ge.p(Se,Ae):(ge=tf(Se),ge.c(),ge.m(W,null)):ge&&(ge.d(1),ge=null),Se[1].security==0||Se[0].a?be?be.p(Se,Ae):(be=lf(Se),be.c(),be.m(e,null)):be&&(be.d(1),be=null);const ut={};Ae&128&&(ut.active=Se[7]),Ae&8&&(ut.message=(Pe=(qe=(de=Se[3].status)==null?void 0:de.mask)==null?void 0:qe.firmware)!=null?Pe:"Uploading"),P.$set(ut);const rt={};Ae&512&&(rt.active=Se[9]),Ae&8&&(rt.message=(yt=(ze=(Be=Se[3].status)==null?void 0:Be.mask)==null?void 0:ze.config)!=null?yt:"Uploading"),y.$set(rt)},i(Se){ee||($(E.$$.fragment,Se),$(ie),$(_e),$(P.$$.fragment,Se),$(y.$$.fragment,Se),ee=!0)},o(Se){oe(E.$$.fragment,Se),oe(ie),oe(_e),oe(P.$$.fragment,Se),oe(y.$$.fragment,Se),ee=!1},d(Se){Se&&A(e),te&&te.d(),Le(E),ie&&ie.d(),_e&&_e.d(),Ne&&Ne.d(),Me&&Me.d(),pe&&pe.d(),Ce&&Ce.d(),we&&we.d(),ge&&ge.d(),be&&be.d(),Se&&A(w),Le(P,Se),Se&&A(D),Le(y,Se)}}}async function vc(){await(await fetch("reboot",{method:"POST"})).json()}function hc(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",key:"is"}],a={};pl.subscribe(G=>{l(3,a=G)});let r={};ts.subscribe(G=>{l(4,r=Su(i.version,G)),r||l(4,r=G[0])});function c(){var G,V;confirm(((V=(G=a.header)==null?void 0:G.upgrade)!=null?V:"Upgrade to {0}?").replace("{0}",r.tag_name))&&(i.board!=2&&i.board!=4&&i.board!=7||confirm(mi(lt(i.chip,i.board))))&&(ml.update(F=>(F.upgrading=!0,F)),Mu(r.tag_name))}const f=function(){var G,V;confirm((V=(G=a.device)==null?void 0:G.reboot_confirm)!=null?V:"Reboot?")&&(ml.update(F=>(F.booting=!0,F)),vc())};let _,m=[],d=!1,v,h=[],k=!1;Ji();let g={hostname:"",ip:""};function T(G){l(9,k=!0);const V=new FormData;V.append("file",h[0]),fetch("/configfile",{method:"POST",body:V}).then(F=>F.json()).then(F=>{ml.update(R=>(g&&g.hostname&&(R.hostname=g.hostname),R.booting=F.reboot,g&&g.ip&&(R.net.ip=g.ip),setTimeout(Xn,5e3,i),R))}).catch(F=>{console.error("Error:",F),setTimeout(Xn,5e3,i)})}function O(G){ri[G?"unshift":"push"](()=>{_=G,l(5,_)})}function E(){m=this.files,l(6,m)}const I=()=>{_.click()},C=()=>l(7,d=!0);function j(G){ri[G?"unshift":"push"](()=>{v=G,l(8,v)})}function S(){h=this.files,l(2,h)}const U=()=>{v.click()};return t.$$set=G=>{"data"in G&&l(0,n=G.data),"sysinfo"in G&&l(1,i=G.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&4&&h.length==1){let G=h[0],V=new FileReader,F=R=>{let z=R.target.result.split(` +`);for(let B in z){let H=z[B];H.startsWith("hostname ")?g.hostname=H.split(" ")[1]:H.startsWith("ip ")&&(g.ip=H.split(" ")[1])}};V.onload=F,V.readAsText(G)}},[n,i,h,a,r,_,m,d,v,k,o,c,f,T,O,E,I,C,j,S,U]}class bc extends qt{constructor(e){super(),At(this,e,hc,dc,Nt,{data:0,sysinfo:1})}}function of(t){let e,l,n=lt(t[0],7)+"",i,o,a=lt(t[0],5)+"",r,c,f=lt(t[0],4)+"",_,m,d=lt(t[0],3)+"",v,h,k,g,T=lt(t[0],2)+"",O,E,I=lt(t[0],1)+"",C,j,S=lt(t[0],0)+"",U,G,V,F,R=lt(t[0],101)+"",z,B,H=lt(t[0],100)+"",W;return{c(){e=p("optgroup"),l=p("option"),i=M(n),o=p("option"),r=M(a),c=p("option"),_=M(f),m=p("option"),v=M(d),h=b(),k=p("optgroup"),g=p("option"),O=M(T),E=p("option"),C=M(I),j=p("option"),U=M(S),G=b(),V=p("optgroup"),F=p("option"),z=M(R),B=p("option"),W=M(H),l.__value=7,l.value=l.__value,o.__value=5,o.value=o.__value,c.__value=4,c.value=c.__value,m.__value=3,m.value=m.__value,u(e,"label","amsleser.no"),g.__value=2,g.value=g.__value,E.__value=1,E.value=E.__value,j.__value=0,j.value=j.__value,u(k,"label","Custom hardware"),F.__value=101,F.value=F.__value,B.__value=100,B.value=B.__value,u(V,"label","Generic hardware")},m(K,Q){q(K,e,Q),s(e,l),s(l,i),s(e,o),s(o,r),s(e,c),s(c,_),s(e,m),s(m,v),q(K,h,Q),q(K,k,Q),s(k,g),s(g,O),s(k,E),s(E,C),s(k,j),s(j,U),q(K,G,Q),q(K,V,Q),s(V,F),s(F,z),s(V,B),s(B,W)},p(K,Q){Q&1&&n!==(n=lt(K[0],7)+"")&&L(i,n),Q&1&&a!==(a=lt(K[0],5)+"")&&L(r,a),Q&1&&f!==(f=lt(K[0],4)+"")&&L(_,f),Q&1&&d!==(d=lt(K[0],3)+"")&&L(v,d),Q&1&&T!==(T=lt(K[0],2)+"")&&L(O,T),Q&1&&I!==(I=lt(K[0],1)+"")&&L(C,I),Q&1&&S!==(S=lt(K[0],0)+"")&&L(U,S),Q&1&&R!==(R=lt(K[0],101)+"")&&L(z,R),Q&1&&H!==(H=lt(K[0],100)+"")&&L(W,H)},d(K){K&&A(e),K&&A(h),K&&A(k),K&&A(G),K&&A(V)}}}function af(t){let e,l,n=lt(t[0],201)+"",i,o,a=lt(t[0],202)+"",r,c,f=lt(t[0],203)+"",_,m,d=lt(t[0],241)+"",v,h,k=lt(t[0],242)+"",g,T,O=lt(t[0],243)+"",E,I,C=lt(t[0],200)+"",j;return{c(){e=p("optgroup"),l=p("option"),i=M(n),o=p("option"),r=M(a),c=p("option"),_=M(f),m=p("option"),v=M(d),h=p("option"),g=M(k),T=p("option"),E=M(O),I=p("option"),j=M(C),l.__value=201,l.value=l.__value,o.__value=202,o.value=o.__value,c.__value=203,c.value=c.__value,m.__value=241,m.value=m.__value,h.__value=242,h.value=h.__value,T.__value=243,T.value=T.__value,I.__value=200,I.value=I.__value,u(e,"label","Generic hardware")},m(S,U){q(S,e,U),s(e,l),s(l,i),s(e,o),s(o,r),s(e,c),s(c,_),s(e,m),s(m,v),s(e,h),s(h,g),s(e,T),s(T,E),s(e,I),s(I,j)},p(S,U){U&1&&n!==(n=lt(S[0],201)+"")&&L(i,n),U&1&&a!==(a=lt(S[0],202)+"")&&L(r,a),U&1&&f!==(f=lt(S[0],203)+"")&&L(_,f),U&1&&d!==(d=lt(S[0],241)+"")&&L(v,d),U&1&&k!==(k=lt(S[0],242)+"")&&L(g,k),U&1&&O!==(O=lt(S[0],243)+"")&&L(E,O),U&1&&C!==(C=lt(S[0],200)+"")&&L(j,C)},d(S){S&&A(e)}}}function ff(t){let e,l,n=lt(t[0],7)+"",i,o,a=lt(t[0],6)+"",r,c,f=lt(t[0],5)+"",_,m,d,v,h=lt(t[0],51)+"",k,g,T=lt(t[0],50)+"",O;return{c(){e=p("optgroup"),l=p("option"),i=M(n),o=p("option"),r=M(a),c=p("option"),_=M(f),m=b(),d=p("optgroup"),v=p("option"),k=M(h),g=p("option"),O=M(T),l.__value=7,l.value=l.__value,o.__value=6,o.value=o.__value,c.__value=5,c.value=c.__value,u(e,"label","amsleser.no"),v.__value=51,v.value=v.__value,g.__value=50,g.value=g.__value,u(d,"label","Generic hardware")},m(E,I){q(E,e,I),s(e,l),s(l,i),s(e,o),s(o,r),s(e,c),s(c,_),q(E,m,I),q(E,d,I),s(d,v),s(v,k),s(d,g),s(g,O)},p(E,I){I&1&&n!==(n=lt(E[0],7)+"")&&L(i,n),I&1&&a!==(a=lt(E[0],6)+"")&&L(r,a),I&1&&f!==(f=lt(E[0],5)+"")&&L(_,f),I&1&&h!==(h=lt(E[0],51)+"")&&L(k,h),I&1&&T!==(T=lt(E[0],50)+"")&&L(O,T)},d(E){E&&A(e),E&&A(m),E&&A(d)}}}function uf(t){let e,l,n=lt(t[0],8)+"",i,o,a,r,c=lt(t[0],71)+"",f,_,m=lt(t[0],70)+"",d;return{c(){e=p("optgroup"),l=p("option"),i=M(n),o=b(),a=p("optgroup"),r=p("option"),f=M(c),_=p("option"),d=M(m),l.__value=8,l.value=l.__value,u(e,"label","Custom hardware"),r.__value=71,r.value=r.__value,_.__value=70,_.value=_.__value,u(a,"label","Generic hardware")},m(v,h){q(v,e,h),s(e,l),s(l,i),q(v,o,h),q(v,a,h),s(a,r),s(r,f),s(a,_),s(_,d)},p(v,h){h&1&&n!==(n=lt(v[0],8)+"")&&L(i,n),h&1&&c!==(c=lt(v[0],71)+"")&&L(f,c),h&1&&m!==(m=lt(v[0],70)+"")&&L(d,m)},d(v){v&&A(e),v&&A(o),v&&A(a)}}}function rf(t){let e,l,n=lt(t[0],200)+"",i;return{c(){e=p("optgroup"),l=p("option"),i=M(n),l.__value=200,l.value=l.__value,u(e,"label","Generic hardware")},m(o,a){q(o,e,a),s(e,l),s(l,i)},p(o,a){a&1&&n!==(n=lt(o[0],200)+"")&&L(i,n)},d(o){o&&A(e)}}}function cf(t){let e,l,n=lt(t[0],80)+"",i;return{c(){e=p("optgroup"),l=p("option"),i=M(n),l.__value=80,l.value=l.__value,u(e,"label","Generic hardware")},m(o,a){q(o,e,a),s(e,l),s(l,i)},p(o,a){a&1&&n!==(n=lt(o[0],80)+"")&&L(i,n)},d(o){o&&A(e)}}}function gc(t){let e,l,n,i,o,a,r,c,f=t[0]=="esp8266"&&of(t),_=t[0]=="esp32"&&af(t),m=t[0]=="esp32s2"&&ff(t),d=t[0]=="esp32c3"&&uf(t),v=t[0]=="esp32solo"&&rf(t),h=t[0]=="esp32s3"&&cf(t);return{c(){e=p("option"),l=b(),f&&f.c(),n=b(),_&&_.c(),i=b(),m&&m.c(),o=b(),d&&d.c(),a=b(),v&&v.c(),r=b(),h&&h.c(),c=Jt(),e.__value=-1,e.value=e.__value},m(k,g){q(k,e,g),q(k,l,g),f&&f.m(k,g),q(k,n,g),_&&_.m(k,g),q(k,i,g),m&&m.m(k,g),q(k,o,g),d&&d.m(k,g),q(k,a,g),v&&v.m(k,g),q(k,r,g),h&&h.m(k,g),q(k,c,g)},p(k,[g]){k[0]=="esp8266"?f?f.p(k,g):(f=of(k),f.c(),f.m(n.parentNode,n)):f&&(f.d(1),f=null),k[0]=="esp32"?_?_.p(k,g):(_=af(k),_.c(),_.m(i.parentNode,i)):_&&(_.d(1),_=null),k[0]=="esp32s2"?m?m.p(k,g):(m=ff(k),m.c(),m.m(o.parentNode,o)):m&&(m.d(1),m=null),k[0]=="esp32c3"?d?d.p(k,g):(d=uf(k),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null),k[0]=="esp32solo"?v?v.p(k,g):(v=rf(k),v.c(),v.m(r.parentNode,r)):v&&(v.d(1),v=null),k[0]=="esp32s3"?h?h.p(k,g):(h=cf(k),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},i:Ze,o:Ze,d(k){k&&A(e),k&&A(l),f&&f.d(k),k&&A(n),_&&_.d(k),k&&A(i),m&&m.d(k),k&&A(o),d&&d.d(k),k&&A(a),v&&v.d(k),k&&A(r),h&&h.d(k),k&&A(c)}}}function kc(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class wc extends qt{constructor(e){super(),At(this,e,kc,gc,Nt,{chip:0})}}function _f(t){let e;return{c(){e=p("div"),e.textContent="WARNING: Changing this configuration will affect basic configuration of your device. Only make changes here if instructed by vendor",u(e,"class","bd-red")},m(l,n){q(l,e,n)},d(l){l&&A(e)}}}function mf(t){let e,l,n,i,o,a,r;return a=new Ui({props:{chip:t[0].chip}}),{c(){e=p("div"),l=M("HAN GPIO"),n=p("br"),i=b(),o=p("select"),Re(a.$$.fragment),u(o,"name","vh"),u(o,"class","in-s"),u(e,"class","my-3")},m(c,f){q(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),De(a,o,null),r=!0},p(c,f){const _={};f&1&&(_.chip=c[0].chip),a.$set(_)},i(c){r||($(a.$$.fragment,c),r=!0)},o(c){oe(a.$$.fragment,c),r=!1},d(c){c&&A(e),Le(a)}}}function Mc(t){let e,l,n,i,o,a,r,c,f,_,m,d,v,h,k,g,T,O,E,I,C,j,S,U,G,V,F,R,z,B=t[0].usrcfg&&_f();h=new wc({props:{chip:t[0].chip}});let H=t[0].board&&t[0].board>20&&mf(t);return V=new _l({props:{active:t[1],message:"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("input"),o=b(),a=p("strong"),a.textContent="Initial configuration",r=b(),B&&B.c(),c=b(),f=p("div"),_=M("Board type"),m=p("br"),d=b(),v=p("select"),Re(h.$$.fragment),k=b(),H&&H.c(),g=b(),T=p("div"),O=p("label"),E=p("input"),I=M(" Clear all other configuration"),C=b(),j=p("div"),j.innerHTML='',S=b(),U=p("span"),U.textContent="\xA0",G=b(),Re(V.$$.fragment),u(i,"type","hidden"),u(i,"name","v"),i.value="true",u(a,"class","text-sm"),u(v,"name","vb"),u(v,"class","in-s"),t[0].board===void 0&&Gt(()=>t[5].call(v)),u(f,"class","my-3"),u(E,"type","checkbox"),u(E,"name","vr"),E.__value="true",E.value=E.__value,u(E,"class","rounded mb-1"),u(T,"class","my-3"),u(j,"class","my-3"),u(U,"class","clear-both"),u(n,"autocomplete","off"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(W,K){q(W,e,K),s(e,l),s(l,n),s(n,i),s(n,o),s(n,a),s(n,r),B&&B.m(n,null),s(n,c),s(n,f),s(f,_),s(f,m),s(f,d),s(f,v),De(h,v,null),ft(v,t[0].board,!0),s(n,k),H&&H.m(n,null),s(n,g),s(n,T),s(T,O),s(O,E),E.checked=t[2],s(O,I),s(n,C),s(n,j),s(n,S),s(n,U),q(W,G,K),De(V,W,K),F=!0,R||(z=[ve(v,"change",t[5]),ve(E,"change",t[6]),ve(n,"submit",_n(t[3]))],R=!0)},p(W,[K]){W[0].usrcfg?B||(B=_f(),B.c(),B.m(n,c)):B&&(B.d(1),B=null);const Q={};K&1&&(Q.chip=W[0].chip),h.$set(Q),K&1&&ft(v,W[0].board),W[0].board&&W[0].board>20?H?(H.p(W,K),K&1&&$(H,1)):(H=mf(W),H.c(),$(H,1),H.m(n,g)):H&&(gt(),oe(H,1,1,()=>{H=null}),kt()),K&4&&(E.checked=W[2]);const Z={};K&2&&(Z.active=W[1]),V.$set(Z)},i(W){F||($(h.$$.fragment,W),$(H),$(V.$$.fragment,W),F=!0)},o(W){oe(h.$$.fragment,W),oe(H),oe(V.$$.fragment,W),F=!1},d(W){W&&A(e),B&&B.d(),Le(h),H&&H.d(),W&&A(G),Le(V,W),R=!1,zt(z)}}}function Sc(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,o=!1;async function a(_){l(1,o=!0);const m=new FormData(_.target),d=new URLSearchParams;for(let k of m){const[g,T]=k;d.append(g,T)}let h=await(await fetch("save",{method:"POST",body:d})).json();l(1,o=!1),ml.update(k=>(k.vndcfg=h.success,k.booting=h.reboot,k.if.eth=k.boardType>240&&k.boardType<250,k)),en(n+(i.usrcfg?"/":"/setup"))}let r=!1;ml.subscribe(_=>{l(0,i=_),_.fwconsent===1&&l(2,r=!i.usrcfg)});function c(){i.board=Xt(this),l(0,i)}function f(){r=this.checked,l(2,r)}return t.$$set=_=>{"basepath"in _&&l(4,n=_.basepath),"sysinfo"in _&&l(0,i=_.sysinfo)},[i,o,r,a,n,c,f]}class Cc extends qt{constructor(e){super(),At(this,e,Sc,Mc,Nt,{basepath:4,sysinfo:0})}}function pf(t){var i,o,a;let e,l=((a=(o=(i=t[1].conf)==null?void 0:i.connection)==null?void 0:o.eth)!=null?a:"Ethernet")+"",n;return{c(){e=p("option"),n=M(l),e.__value=3,e.value=e.__value},m(r,c){q(r,e,c),s(e,n)},p(r,c){var f,_,m;c&2&&l!==(l=((m=(_=(f=r[1].conf)==null?void 0:f.connection)==null?void 0:_.eth)!=null?m:"Ethernet")+"")&&L(n,l)},d(r){r&&A(e)}}}function df(t){var g,T,O,E,I,C;let e,l=((O=(T=(g=t[1].conf)==null?void 0:g.connection)==null?void 0:T.ssid)!=null?O:"SSID")+"",n,i,o,a,r,c,f,_=((C=(I=(E=t[1].conf)==null?void 0:E.connection)==null?void 0:I.psk)!=null?C:"Password")+"",m,d,v,h,k;return{c(){e=p("div"),n=M(l),i=p("br"),o=b(),a=p("input"),c=b(),f=p("div"),m=M(_),d=p("br"),v=b(),h=p("input"),u(a,"name","ss"),u(a,"type","text"),u(a,"class","in-s"),a.required=r=t[3]==1||t[3]==2,u(e,"class","my-3"),u(h,"name","sp"),u(h,"type","password"),u(h,"class","in-s"),u(h,"autocomplete","off"),h.required=k=t[3]==2,u(f,"class","my-3")},m(j,S){q(j,e,S),s(e,n),s(e,i),s(e,o),s(e,a),q(j,c,S),q(j,f,S),s(f,m),s(f,d),s(f,v),s(f,h)},p(j,S){var U,G,V,F,R,z;S&2&&l!==(l=((V=(G=(U=j[1].conf)==null?void 0:U.connection)==null?void 0:G.ssid)!=null?V:"SSID")+"")&&L(n,l),S&8&&r!==(r=j[3]==1||j[3]==2)&&(a.required=r),S&2&&_!==(_=((z=(R=(F=j[1].conf)==null?void 0:F.connection)==null?void 0:R.psk)!=null?z:"Password")+"")&&L(m,_),S&8&&k!==(k=j[3]==2)&&(h.required=k)},d(j){j&&A(e),j&&A(c),j&&A(f)}}}function vf(t){let e,l,n,i,o,a,r,c;return r=new Eu({}),{c(){e=p("br"),l=b(),n=p("div"),i=p("input"),o=b(),a=p("select"),Re(r.$$.fragment),u(i,"name","si"),u(i,"type","text"),u(i,"class","in-f w-full"),i.required=t[2],u(a,"name","su"),u(a,"class","in-l"),a.required=t[2],u(n,"class","flex")},m(f,_){q(f,e,_),q(f,l,_),q(f,n,_),s(n,i),s(n,o),s(n,a),De(r,a,null),c=!0},p(f,_){(!c||_&4)&&(i.required=f[2]),(!c||_&4)&&(a.required=f[2])},i(f){c||($(r.$$.fragment,f),c=!0)},o(f){oe(r.$$.fragment,f),c=!1},d(f){f&&A(e),f&&A(l),f&&A(n),Le(r)}}}function hf(t){var k,g,T,O,E,I;let e,l,n=((T=(g=(k=t[1].conf)==null?void 0:k.network)==null?void 0:g.gw)!=null?T:"Gateway")+"",i,o,a,r,c,f,_=((I=(E=(O=t[1].conf)==null?void 0:O.network)==null?void 0:E.dns)!=null?I:"DNS")+"",m,d,v,h;return{c(){e=p("div"),l=p("div"),i=M(n),o=p("br"),a=b(),r=p("input"),c=b(),f=p("div"),m=M(_),d=p("br"),v=b(),h=p("input"),u(r,"name","sg"),u(r,"type","text"),u(r,"class","in-f w-full"),u(h,"name","sd"),u(h,"type","text"),u(h,"class","in-l w-full"),u(e,"class","my-3 flex")},m(C,j){q(C,e,j),s(e,l),s(l,i),s(l,o),s(l,a),s(l,r),s(e,c),s(e,f),s(f,m),s(f,d),s(f,v),s(f,h)},p(C,j){var S,U,G,V,F,R;j&2&&n!==(n=((G=(U=(S=C[1].conf)==null?void 0:S.network)==null?void 0:U.gw)!=null?G:"Gateway")+"")&&L(i,n),j&2&&_!==(_=((R=(F=(V=C[1].conf)==null?void 0:V.network)==null?void 0:F.dns)!=null?R:"DNS")+"")&&L(m,_)},d(C){C&&A(e)}}}function Nc(t){var y,ee,te,ie,_e,Ne,Me,pe,Ce,we,ge,be,ye,je,Ke,xe,et,Je,nt,We;let e,l,n,i,o,a,r=((ee=(y=t[1].setup)==null?void 0:y.title)!=null?ee:"Setup")+"",c,f,_,m=((_e=(ie=(te=t[1].conf)==null?void 0:te.connection)==null?void 0:ie.title)!=null?_e:"Connection")+"",d,v,h,k,g,T=((pe=(Me=(Ne=t[1].conf)==null?void 0:Ne.connection)==null?void 0:Me.wifi)!=null?pe:"Connect to WiFi")+"",O,E,I=((ge=(we=(Ce=t[1].conf)==null?void 0:Ce.connection)==null?void 0:we.ap)!=null?ge:"Standalone access point")+"",C,j,S,U,G=((je=(ye=(be=t[1].conf)==null?void 0:be.general)==null?void 0:ye.hostname)!=null?je:"Hostname")+"",V,F,R,z,B,H,W,K,Q=((xe=(Ke=t[1].setup)==null?void 0:Ke.static)!=null?xe:"Static IP")+"",Z,se,X,J,ae,le,ne=((Je=(et=t[1].btn)==null?void 0:et.save)!=null?Je:"Save")+"",fe,ue,Y,x,ke,me,N=t[0].if&&t[0].if.eth&&pf(t),w=(t[3]==1||t[3]==2)&&df(t),P=t[2]&&vf(t),D=t[2]&&hf(t);return Y=new _l({props:{active:t[4],message:(We=(nt=t[1].setup)==null?void 0:nt.mask)!=null?We:"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("input"),o=b(),a=p("strong"),c=M(r),f=b(),_=p("div"),d=M(m),v=p("br"),h=b(),k=p("select"),g=p("option"),O=M(T),E=p("option"),C=M(I),N&&N.c(),j=b(),w&&w.c(),S=b(),U=p("div"),V=M(G),F=b(),R=p("input"),z=b(),B=p("div"),H=p("label"),W=p("input"),K=b(),Z=M(Q),se=b(),P&&P.c(),X=b(),D&&D.c(),J=b(),ae=p("div"),le=p("button"),fe=M(ne),ue=b(),Re(Y.$$.fragment),u(i,"type","hidden"),u(i,"name","s"),i.value="true",u(a,"class","text-sm"),g.__value=1,g.value=g.__value,E.__value=2,E.value=E.__value,u(k,"name","sc"),u(k,"class","in-s"),t[3]===void 0&&Gt(()=>t[6].call(k)),u(_,"class","my-3"),u(R,"name","sh"),u(R,"type","text"),u(R,"class","in-s"),u(R,"maxlength","32"),u(R,"pattern","[a-z0-9_-]+"),u(R,"placeholder","Optional, ex.: ams-reader"),u(R,"autocomplete","off"),u(W,"type","checkbox"),u(W,"name","sm"),W.__value="static",W.value=W.__value,u(W,"class","rounded mb-1"),u(B,"class","my-3"),u(le,"type","submit"),u(le,"class","btn-pri"),u(ae,"class","my-3"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(Oe,ce){q(Oe,e,ce),s(e,l),s(l,n),s(n,i),s(n,o),s(n,a),s(a,c),s(n,f),s(n,_),s(_,d),s(_,v),s(_,h),s(_,k),s(k,g),s(g,O),s(k,E),s(E,C),N&&N.m(k,null),ft(k,t[3],!0),s(n,j),w&&w.m(n,null),s(n,S),s(n,U),s(U,V),s(U,F),s(U,R),Te(R,t[0].hostname),s(n,z),s(n,B),s(B,H),s(H,W),W.checked=t[2],s(H,K),s(H,Z),s(B,se),P&&P.m(B,null),s(n,X),D&&D.m(n,null),s(n,J),s(n,ae),s(ae,le),s(le,fe),q(Oe,ue,ce),De(Y,Oe,ce),x=!0,ke||(me=[ve(k,"change",t[6]),ve(R,"input",t[7]),ve(W,"change",t[8]),ve(n,"submit",_n(t[5]))],ke=!0)},p(Oe,[ce]){var tt,$e,pt,Ge,Ye,Ve,it,vt,Mt,he,re,Fe,Tt,Se,Ae,dt,ut,rt,ct,Et;(!x||ce&2)&&r!==(r=(($e=(tt=Oe[1].setup)==null?void 0:tt.title)!=null?$e:"Setup")+"")&&L(c,r),(!x||ce&2)&&m!==(m=((Ye=(Ge=(pt=Oe[1].conf)==null?void 0:pt.connection)==null?void 0:Ge.title)!=null?Ye:"Connection")+"")&&L(d,m),(!x||ce&2)&&T!==(T=((vt=(it=(Ve=Oe[1].conf)==null?void 0:Ve.connection)==null?void 0:it.wifi)!=null?vt:"Connect to WiFi")+"")&&L(O,T),(!x||ce&2)&&I!==(I=((re=(he=(Mt=Oe[1].conf)==null?void 0:Mt.connection)==null?void 0:he.ap)!=null?re:"Standalone access point")+"")&&L(C,I),Oe[0].if&&Oe[0].if.eth?N?N.p(Oe,ce):(N=pf(Oe),N.c(),N.m(k,null)):N&&(N.d(1),N=null),ce&8&&ft(k,Oe[3]),Oe[3]==1||Oe[3]==2?w?w.p(Oe,ce):(w=df(Oe),w.c(),w.m(n,S)):w&&(w.d(1),w=null),(!x||ce&2)&&G!==(G=((Se=(Tt=(Fe=Oe[1].conf)==null?void 0:Fe.general)==null?void 0:Tt.hostname)!=null?Se:"Hostname")+"")&&L(V,G),ce&1&&R.value!==Oe[0].hostname&&Te(R,Oe[0].hostname),ce&4&&(W.checked=Oe[2]),(!x||ce&2)&&Q!==(Q=((dt=(Ae=Oe[1].setup)==null?void 0:Ae.static)!=null?dt:"Static IP")+"")&&L(Z,Q),Oe[2]?P?(P.p(Oe,ce),ce&4&&$(P,1)):(P=vf(Oe),P.c(),$(P,1),P.m(B,null)):P&&(gt(),oe(P,1,1,()=>{P=null}),kt()),Oe[2]?D?D.p(Oe,ce):(D=hf(Oe),D.c(),D.m(n,J)):D&&(D.d(1),D=null),(!x||ce&2)&&ne!==(ne=((rt=(ut=Oe[1].btn)==null?void 0:ut.save)!=null?rt:"Save")+"")&&L(fe,ne);const Ee={};ce&16&&(Ee.active=Oe[4]),ce&2&&(Ee.message=(Et=(ct=Oe[1].setup)==null?void 0:ct.mask)!=null?Et:"Saving"),Y.$set(Ee)},i(Oe){x||($(P),$(Y.$$.fragment,Oe),x=!0)},o(Oe){oe(P),oe(Y.$$.fragment,Oe),x=!1},d(Oe){Oe&&A(e),N&&N.d(),w&&w.d(),P&&P.d(),D&&D.d(),Oe&&A(ue),Le(Y,Oe),ke=!1,zt(me)}}}function Tc(t,e,l){let n={};pl.subscribe(v=>{l(1,n=v)});let{sysinfo:i={}}=e,o=!1,a=1,r=!1;function c(v){ml.update(h=>(h.trying=v,h))}async function f(v){l(4,r=!0);const h=new FormData(v.target),k=new URLSearchParams;for(let O of h){const[E,I]=O;k.append(E,I)}let T=await(await fetch("save",{method:"POST",body:k})).json();l(4,r=!1),ml.update(O=>(O.hostname=h.get("sh"),O.usrcfg=T.success,O.booting=T.reboot,o&&(O.net.ip=h.get("si"),O.net.mask=h.get("su"),O.net.gw=h.get("sg"),O.net.dns1=h.get("sd")),T.reboot&&setTimeout(Xn,5e3,i,c),O))}function _(){a=Xt(this),l(3,a)}function m(){i.hostname=this.value,l(0,i)}function d(){o=this.checked,l(2,o)}return t.$$set=v=>{"sysinfo"in v&&l(0,i=v.sysinfo)},[i,n,o,a,r,f,_,m,d]}class Ec extends qt{constructor(e){super(),At(this,e,Tc,Nc,Nt,{sysinfo:0})}}function Pc(t){var V,F,R,z,B,H,W,K;let e,l,n,i=((F=(V=t[2].upload)==null?void 0:V.title)!=null?F:"Upload")+"",o,a,r,c,f,_=((z=(R=t[2].upload)==null?void 0:R.desc)!=null?z:"")+"",m,d,v,h,k,g,T,O,E=((H=(B=t[2].btn)==null?void 0:B.upload)!=null?H:"Upload")+"",I,C,j,S,U,G;return j=new _l({props:{active:t[3],message:(K=(W=t[2].upload)==null?void 0:W.mask)!=null?K:"Uploading"}}),{c(){e=p("div"),l=p("div"),n=p("strong"),o=M(i),a=b(),r=M(t[1]),c=b(),f=p("p"),m=M(_),d=b(),v=p("form"),h=p("input"),k=b(),g=p("div"),T=p("button"),O=p("p"),I=M(E),C=b(),Re(j.$$.fragment),u(f,"class","mb-4"),u(h,"name","file"),u(h,"type","file"),u(O,"class","mb-4"),u(T,"type","submit"),u(T,"class","btn-pri"),u(g,"class","w-full text-right mt-4"),u(v,"action",t[0]),u(v,"enctype","multipart/form-data"),u(v,"method","post"),u(v,"autocomplete","off"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2")},m(Q,Z){q(Q,e,Z),s(e,l),s(l,n),s(n,o),s(n,a),s(n,r),s(l,c),s(l,f),s(f,m),s(l,d),s(l,v),s(v,h),s(v,k),s(v,g),s(g,T),s(T,O),s(O,I),q(Q,C,Z),De(j,Q,Z),S=!0,U||(G=ve(v,"submit",t[4]),U=!0)},p(Q,[Z]){var X,J,ae,le,ne,fe,ue,Y;(!S||Z&4)&&i!==(i=((J=(X=Q[2].upload)==null?void 0:X.title)!=null?J:"Upload")+"")&&L(o,i),(!S||Z&2)&&L(r,Q[1]),(!S||Z&4)&&_!==(_=((le=(ae=Q[2].upload)==null?void 0:ae.desc)!=null?le:"")+"")&&L(m,_),(!S||Z&4)&&E!==(E=((fe=(ne=Q[2].btn)==null?void 0:ne.upload)!=null?fe:"Upload")+"")&&L(I,E),(!S||Z&1)&&u(v,"action",Q[0]);const se={};Z&8&&(se.active=Q[3]),Z&4&&(se.message=(Y=(ue=Q[2].upload)==null?void 0:ue.mask)!=null?Y:"Uploading"),j.$set(se)},i(Q){S||($(j.$$.fragment,Q),S=!0)},o(Q){oe(j.$$.fragment,Q),S=!1},d(Q){Q&&A(e),Q&&A(C),Le(j,Q),U=!1,G()}}}function Ac(t,e,l){let{action:n}=e,{title:i}=e,o={};pl.subscribe(c=>{l(2,o=c)});let a=!1;const r=()=>l(3,a=!0);return t.$$set=c=>{"action"in c&&l(0,n=c.action),"title"in c&&l(1,i=c.title)},[n,i,o,a,r]}class ns extends qt{constructor(e){super(),At(this,e,Ac,Pc,Nt,{action:0,title:1})}}function qc(t){var Y,x,ke,me,N,w,P,D,y,ee,te,ie,_e,Ne;let e,l,n,i,o=((x=(Y=t[1].consent)==null?void 0:Y.title)!=null?x:"Consents")+"",a,r,c,f,_,m=((me=(ke=t[1].consent)==null?void 0:ke.one_click)!=null?me:"One-click")+"",d,v,h,k,g=((w=(N=t[1].consent)==null?void 0:N.read_more)!=null?w:"Read more")+"",T,O,E,I,C,j,S,U=((D=(P=t[1].consent)==null?void 0:P.yes)!=null?D:"Yes")+"",G,V,F,R,z,B,H=((ee=(y=t[1].consent)==null?void 0:y.no)!=null?ee:"No")+"",W,K,Q,Z,se,X=((ie=(te=t[1].btn)==null?void 0:te.save)!=null?ie:"Save")+"",J,ae,le,ne,fe,ue;return le=new _l({props:{active:t[2],message:(Ne=(_e=t[1].consent)==null?void 0:_e.mask_saving)!=null?Ne:"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("div"),a=M(o),r=b(),c=p("hr"),f=b(),_=p("div"),d=M(m),v=p("br"),h=b(),k=p("a"),T=M(g),O=p("br"),E=b(),I=p("label"),C=p("input"),S=b(),G=M(U),V=b(),F=p("label"),R=p("input"),B=b(),W=M(H),K=p("br"),Q=b(),Z=p("div"),se=p("button"),J=M(X),ae=b(),Re(le.$$.fragment),u(k,"href",kl("Data-collection-on-one-click-firmware-upgrade")),u(k,"target","_blank"),u(k,"class","text-blue-600 hover:text-blue-800"),u(C,"type","radio"),u(C,"name","sf"),C.value=1,C.checked=j=t[0].fwconsent===1,u(C,"class","rounded m-2"),C.required=!0,u(R,"type","radio"),u(R,"name","sf"),R.value=2,R.checked=z=t[0].fwconsent===2,u(R,"class","rounded m-2"),R.required=!0,u(_,"class","my-3"),u(se,"type","submit"),u(se,"class","btn-pri"),u(Z,"class","my-3"),u(n,"autocomplete","off"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-3 lg:grid-cols-2")},m(Me,pe){q(Me,e,pe),s(e,l),s(l,n),s(n,i),s(i,a),s(n,r),s(n,c),s(n,f),s(n,_),s(_,d),s(_,v),s(_,h),s(_,k),s(k,T),s(_,O),s(_,E),s(_,I),s(I,C),s(I,S),s(I,G),s(_,V),s(_,F),s(F,R),s(F,B),s(F,W),s(_,K),s(n,Q),s(n,Z),s(Z,se),s(se,J),q(Me,ae,pe),De(le,Me,pe),ne=!0,fe||(ue=ve(n,"submit",_n(t[3])),fe=!0)},p(Me,[pe]){var we,ge,be,ye,je,Ke,xe,et,Je,nt,We,Oe,ce,Ee;(!ne||pe&2)&&o!==(o=((ge=(we=Me[1].consent)==null?void 0:we.title)!=null?ge:"Consents")+"")&&L(a,o),(!ne||pe&2)&&m!==(m=((ye=(be=Me[1].consent)==null?void 0:be.one_click)!=null?ye:"One-click")+"")&&L(d,m),(!ne||pe&2)&&g!==(g=((Ke=(je=Me[1].consent)==null?void 0:je.read_more)!=null?Ke:"Read more")+"")&&L(T,g),(!ne||pe&1&&j!==(j=Me[0].fwconsent===1))&&(C.checked=j),(!ne||pe&2)&&U!==(U=((et=(xe=Me[1].consent)==null?void 0:xe.yes)!=null?et:"Yes")+"")&&L(G,U),(!ne||pe&1&&z!==(z=Me[0].fwconsent===2))&&(R.checked=z),(!ne||pe&2)&&H!==(H=((nt=(Je=Me[1].consent)==null?void 0:Je.no)!=null?nt:"No")+"")&&L(W,H),(!ne||pe&2)&&X!==(X=((Oe=(We=Me[1].btn)==null?void 0:We.save)!=null?Oe:"Save")+"")&&L(J,X);const Ce={};pe&4&&(Ce.active=Me[2]),pe&2&&(Ce.message=(Ee=(ce=Me[1].consent)==null?void 0:ce.mask_saving)!=null?Ee:"Saving"),le.$set(Ce)},i(Me){ne||($(le.$$.fragment,Me),ne=!0)},o(Me){oe(le.$$.fragment,Me),ne=!1},d(Me){Me&&A(e),Me&&A(ae),Le(le,Me),fe=!1,ue()}}}function Dc(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,o={};pl.subscribe(c=>{l(1,o=c)});let a=!1;async function r(c){l(2,a=!0);const f=new FormData(c.target),_=new URLSearchParams;for(let v of f){const[h,k]=v;_.append(h,k)}let d=await(await fetch("save",{method:"POST",body:_})).json();l(2,a=!1),ml.update(v=>(v.fwconsent=f.sf===!0?1:f.sf===!1?2:0,v.booting=d.reboot,v)),en(n)}return t.$$set=c=>{"basepath"in c&&l(4,n=c.basepath),"sysinfo"in c&&l(0,i=c.sysinfo)},[i,o,a,r,n]}class Lc extends qt{constructor(e){super(),At(this,e,Dc,qc,Nt,{basepath:4,sysinfo:0})}}function bf(t,e,l){const n=t.slice();return n[24]=e[l],n[25]=e,n[26]=l,n}function gf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function Oc(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function kf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function Ic(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function wf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function Mf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function Sf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function Cf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function Nf(t){let e,l=t[1].o,n=[];for(let i=0;i{l(0,i=F)});let o=["mo","tu","we","th","fr","sa","su"],a={},r=!0,c=!1;Tu.subscribe(F=>{F.o&&(l(1,a=F),l(2,r=!1))}),M0();async function f(F){l(3,c=!0);const R=new URLSearchParams;R.append("r","true"),R.append("rc",a.o.length),a.o.forEach(function(B,H){R.append("rt"+H,B.t),R.append("rn"+H,B.n),R.append("rd"+H,B.d),R.append("ra"+H,B.a),R.append("rh"+H,B.h),R.append("rv"+H,B.v),R.append("rsm"+H,B.s.m),R.append("rsd"+H,B.s.d),R.append("rem"+H,B.e.m),R.append("red"+H,B.e.d)}),await(await fetch("save",{method:"POST",body:R})).json(),l(3,c=!1),en(n+"configuration")}let _=function(F,R){return F.includes(R)?F=F.filter(function(z){return z!==R}):F.push(R),F},m=function(){let F=a.o;F.push({t:1,n:"",d:3,a:[0,1,2,3,4,5,6,7],h:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],v:.001,s:{m:0,d:0},e:{m:0,d:0}}),l(1,a.o=F,a)},d=function(F){let R=a.o;R.splice(F,1),l(1,a.o=R,a)};function v(F,R){F[R].n=this.value,l(1,a)}function h(F,R){F[R].d=Xt(this),l(1,a)}function k(F,R){F[R].t=Xt(this),l(1,a)}function g(F,R){F[R].v=at(this.value),l(1,a)}const T=(F,R,z,B)=>l(1,z[B].a=_(F.a,R),a),O=(F,R,z,B)=>l(1,z[B].h=_(F.h,R),a),E=(F,R,z,B)=>l(1,z[B].h=_(F.h,R+8),a),I=(F,R,z,B)=>l(1,z[B].h=_(F.h,R+16),a);function C(F,R){F[R].s.d=Xt(this),l(1,a)}function j(F,R){F[R].s.m=Xt(this),l(1,a)}function S(F,R){F[R].e.d=Xt(this),l(1,a)}function U(F,R){F[R].e.m=Xt(this),l(1,a)}const G=F=>d(F),V=F=>d(F);return t.$$set=F=>{"basepath"in F&&l(9,n=F.basepath)},[i,a,r,c,o,f,_,m,d,n,v,h,k,g,T,O,E,I,C,j,S,U,G,V]}class jc extends qt{constructor(e){super(),At(this,e,Uc,Bc,Nt,{basepath:9},null,[-1,-1])}}function Hc(t){let e,l;return e=new k0({props:{data:t[2],sysinfo:t[1]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&4&&(o.data=n[2]),i&2&&(o.sysinfo=n[1]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function yc(t){let e,l;return e=new oc({props:{sysinfo:t[1],basepath:t[0],data:t[2]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&1&&(o.basepath=n[0]),i&4&&(o.data=n[2]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function zc(t){let e,l;return e=new jc({props:{basepath:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Wc(t){let e,l;return e=new bc({props:{sysinfo:t[1],data:t[2]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&4&&(o.data=n[2]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Gc(t){let e,l;return e=new ns({props:{title:"CA",action:"/mqtt-ca"}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p:Ze,i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Vc(t){let e,l;return e=new ns({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p:Ze,i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Kc(t){let e,l;return e=new ns({props:{title:"private key",action:"/mqtt-key"}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p:Ze,i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Yc(t){let e,l;return e=new Lc({props:{sysinfo:t[1],basepath:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Qc(t){let e,l;return e=new Ec({props:{sysinfo:t[1]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Xc(t){let e,l;return e=new Cc({props:{sysinfo:t[1],basepath:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Zc(t){let e,l,n,i,o,a,r,c,f,_,m,d,v,h,k,g,T,O,E,I,C,j;return e=new q1({props:{data:t[2],basepath:t[0]}}),n=new ql({props:{path:"/",$$slots:{default:[Hc]},$$scope:{ctx:t}}}),o=new ql({props:{path:"/configuration",$$slots:{default:[yc]},$$scope:{ctx:t}}}),r=new ql({props:{path:"/priceconfig",$$slots:{default:[zc]},$$scope:{ctx:t}}}),f=new ql({props:{path:"/status",$$slots:{default:[Wc]},$$scope:{ctx:t}}}),m=new ql({props:{path:"/mqtt-ca",$$slots:{default:[Gc]},$$scope:{ctx:t}}}),v=new ql({props:{path:"/mqtt-cert",$$slots:{default:[Vc]},$$scope:{ctx:t}}}),k=new ql({props:{path:"/mqtt-key",$$slots:{default:[Kc]},$$scope:{ctx:t}}}),T=new ql({props:{path:"/consent",$$slots:{default:[Yc]},$$scope:{ctx:t}}}),E=new ql({props:{path:"/setup",$$slots:{default:[Qc]},$$scope:{ctx:t}}}),C=new ql({props:{path:"/vendor",$$slots:{default:[Xc]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment),l=b(),Re(n.$$.fragment),i=b(),Re(o.$$.fragment),a=b(),Re(r.$$.fragment),c=b(),Re(f.$$.fragment),_=b(),Re(m.$$.fragment),d=b(),Re(v.$$.fragment),h=b(),Re(k.$$.fragment),g=b(),Re(T.$$.fragment),O=b(),Re(E.$$.fragment),I=b(),Re(C.$$.fragment)},m(S,U){De(e,S,U),q(S,l,U),De(n,S,U),q(S,i,U),De(o,S,U),q(S,a,U),De(r,S,U),q(S,c,U),De(f,S,U),q(S,_,U),De(m,S,U),q(S,d,U),De(v,S,U),q(S,h,U),De(k,S,U),q(S,g,U),De(T,S,U),q(S,O,U),De(E,S,U),q(S,I,U),De(C,S,U),j=!0},p(S,U){const G={};U&4&&(G.data=S[2]),U&1&&(G.basepath=S[0]),e.$set(G);const V={};U&22&&(V.$$scope={dirty:U,ctx:S}),n.$set(V);const F={};U&23&&(F.$$scope={dirty:U,ctx:S}),o.$set(F);const R={};U&17&&(R.$$scope={dirty:U,ctx:S}),r.$set(R);const z={};U&22&&(z.$$scope={dirty:U,ctx:S}),f.$set(z);const B={};U&16&&(B.$$scope={dirty:U,ctx:S}),m.$set(B);const H={};U&16&&(H.$$scope={dirty:U,ctx:S}),v.$set(H);const W={};U&16&&(W.$$scope={dirty:U,ctx:S}),k.$set(W);const K={};U&19&&(K.$$scope={dirty:U,ctx:S}),T.$set(K);const Q={};U&18&&(Q.$$scope={dirty:U,ctx:S}),E.$set(Q);const Z={};U&19&&(Z.$$scope={dirty:U,ctx:S}),C.$set(Z)},i(S){j||($(e.$$.fragment,S),$(n.$$.fragment,S),$(o.$$.fragment,S),$(r.$$.fragment,S),$(f.$$.fragment,S),$(m.$$.fragment,S),$(v.$$.fragment,S),$(k.$$.fragment,S),$(T.$$.fragment,S),$(E.$$.fragment,S),$(C.$$.fragment,S),j=!0)},o(S){oe(e.$$.fragment,S),oe(n.$$.fragment,S),oe(o.$$.fragment,S),oe(r.$$.fragment,S),oe(f.$$.fragment,S),oe(m.$$.fragment,S),oe(v.$$.fragment,S),oe(k.$$.fragment,S),oe(T.$$.fragment,S),oe(E.$$.fragment,S),oe(C.$$.fragment,S),j=!1},d(S){Le(e,S),S&&A(l),Le(n,S),S&&A(i),Le(o,S),S&&A(a),Le(r,S),S&&A(c),Le(f,S),S&&A(_),Le(m,S),S&&A(d),Le(v,S),S&&A(h),Le(k,S),S&&A(g),Le(T,S),S&&A(O),Le(E,S),S&&A(I),Le(C,S)}}}function Jc(t){let e,l,n,i;const o=[e_,xc],a=[];function r(c,f){return c[1].trying?0:1}return e=r(t),l=a[e]=o[e](t),{c(){l.c(),n=Jt()},m(c,f){a[e].m(c,f),q(c,n,f),i=!0},p(c,f){let _=e;e=r(c),e===_?a[e].p(c,f):(gt(),oe(a[_],1,1,()=>{a[_]=null}),kt(),l=a[e],l?l.p(c,f):(l=a[e]=o[e](c),l.c()),$(l,1),l.m(n.parentNode,n))},i(c){i||($(l),i=!0)},o(c){oe(l),i=!1},d(c){a[e].d(c),c&&A(n)}}}function $c(t){let e,l;return e=new _l({props:{active:"true",message:"Device is upgrading, please wait"}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p:Ze,i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function xc(t){let e,l;return e=new _l({props:{active:"true",message:"Device is booting, please wait"}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p:Ze,i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function e_(t){let e,l;return e=new _l({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[1].trying}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.message="Device is booting, please wait. Trying to reach it on "+n[1].trying),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function t_(t){let e,l,n,i,o,a;l=new ou({props:{basepath:t[0],$$slots:{default:[Zc]},$$scope:{ctx:t}}});const r=[$c,Jc],c=[];function f(_,m){return _[1].upgrading?0:_[1].booting?1:-1}return~(i=f(t))&&(o=c[i]=r[i](t)),{c(){e=p("div"),Re(l.$$.fragment),n=b(),o&&o.c(),u(e,"class","container mx-auto m-3")},m(_,m){q(_,e,m),De(l,e,null),s(e,n),~i&&c[i].m(e,null),a=!0},p(_,[m]){const d={};m&1&&(d.basepath=_[0]),m&23&&(d.$$scope={dirty:m,ctx:_}),l.$set(d);let v=i;i=f(_),i===v?~i&&c[i].p(_,m):(o&&(gt(),oe(c[v],1,1,()=>{c[v]=null}),kt()),~i?(o=c[i],o?o.p(_,m):(o=c[i]=r[i](_),o.c()),$(o,1),o.m(e,null)):o=null)},i(_){a||($(l.$$.fragment,_),$(o),a=!0)},o(_){oe(l.$$.fragment,_),oe(o),a=!1},d(_){_&&A(e),Le(l),~i&&c[i].d()}}}function l_(t,e,l){let n=document.getElementsByTagName("base")[0].getAttribute("href");n||(n="/");let i={};pl.subscribe(r=>{i=r});let o={};ml.subscribe(r=>{var c;l(1,o=r),o.vndcfg===!1?en(n+"vendor"):o.usrcfg===!1?en(n+"setup"):o.fwconsent===0&&en(n+"consent"),o.ui.k===1?document.documentElement.classList.add("dark"):o.ui.k===0?document.documentElement.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),o.ui.lang&&o.ui.lang!=((c=i==null?void 0:i.language)==null?void 0:c.code)&&wu(o.ui.lang)}),Ji();let a={};return _u.subscribe(r=>{l(2,a=r)}),[n,o,a]}class n_ extends qt{constructor(e){super(),At(this,e,l_,t_,Nt,{})}}new n_({target:document.getElementById("app")}); diff --git a/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte b/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte index 5c70d7ff..57f08b92 100644 --- a/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte +++ b/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte @@ -70,10 +70,13 @@ let loading = true; let saving = false; + let cloudenabled = false; + let configuration; let languages = []; configurationStore.subscribe(update => { if(update.version) { + cloudenabled = update?.c?.e; configuration = update; loading = false; languages = [{ code: 'en', name: 'English'}]; @@ -211,6 +214,21 @@ $: { gpioMax = sysinfo.chip == 'esp8266' ? 16 : sysinfo.chip == 'esp32s2' ? 44 : 39; } + + async function cloudBind() { + const response = await fetchWithTimeout("cloudkey.json"); + if(response.status == 200) { + let data = await response.json(); + window.open("https://www.amsleser.cloud/device/" + data.seed); + } else { + alert("Not able to bind to cloud"); + } + } + + const _global = (window || global); + _global.bindToCloud = function() { + console.log("BIND CALLED"); + }
@@ -641,17 +659,20 @@ {/if} - {#if configuration?.c?.es != null} + {#if configuration?.c}
{translations.conf?.cloud?.title ?? "Cloud connections"}
+ {#if cloudenabled} + + {/if}
- {#if configuration.c.es} + {#if configuration?.c?.es}
MAC: {sysinfo.mac}
Meter ID: {sysinfo.meter.id ? sysinfo.meter.id : "missing, required"}
{#if sysinfo.mac && sysinfo.meter.id} diff --git a/lib/SvelteUi/app/vite.config.js b/lib/SvelteUi/app/vite.config.js index 781cb060..fb9387ee 100644 --- a/lib/SvelteUi/app/vite.config.js +++ b/lib/SvelteUi/app/vite.config.js @@ -17,24 +17,25 @@ export default defineConfig({ plugins: [svelte()], server: { proxy: { - "/data.json": "http://192.168.233.184", - "/energyprice.json": "http://192.168.233.184", - "/dayplot.json": "http://192.168.233.184", - "/monthplot.json": "http://192.168.233.184", - "/temperature.json": "http://192.168.233.184", - "/sysinfo.json": "http://192.168.233.184", - "/configuration.json": "http://192.168.233.184", - "/tariff.json": "http://192.168.233.184", - "/realtime.json": "http://192.168.233.184", - "/priceconfig.json": "http://192.168.233.184", - "/save": "http://192.168.233.184", - "/reboot": "http://192.168.233.184", - "/configfile": "http://192.168.233.184", - "/upgrade": "http://192.168.233.184", - "/mqtt-ca": "http://192.168.233.184", - "/mqtt-cert": "http://192.168.233.184", - "/mqtt-key": "http://192.168.233.184", - "/logo.svg": "http://192.168.233.184", + "/data.json": "http://192.168.233.69", + "/energyprice.json": "http://192.168.233.69", + "/dayplot.json": "http://192.168.233.69", + "/monthplot.json": "http://192.168.233.69", + "/temperature.json": "http://192.168.233.69", + "/sysinfo.json": "http://192.168.233.69", + "/configuration.json": "http://192.168.233.69", + "/tariff.json": "http://192.168.233.69", + "/realtime.json": "http://192.168.233.69", + "/priceconfig.json": "http://192.168.233.69", + "/cloudkey.json": "http://192.168.233.69", + "/save": "http://192.168.233.69", + "/reboot": "http://192.168.233.69", + "/configfile": "http://192.168.233.69", + "/upgrade": "http://192.168.233.69", + "/mqtt-ca": "http://192.168.233.69", + "/mqtt-cert": "http://192.168.233.69", + "/mqtt-key": "http://192.168.233.69", + "/logo.svg": "http://192.168.233.69", } } }) diff --git a/lib/SvelteUi/include/AmsWebServer.h b/lib/SvelteUi/include/AmsWebServer.h index c5a0dfab..9acf026f 100644 --- a/lib/SvelteUi/include/AmsWebServer.h +++ b/lib/SvelteUi/include/AmsWebServer.h @@ -20,6 +20,7 @@ #include "PriceService.h" #include "RealtimePlot.h" #include "ConnectionHandler.h" +#include "CloudConnector.h" #if defined(ESP8266) #include @@ -44,7 +45,7 @@ public: AmsWebServer(uint8_t* buf, RemoteDebug* Debug, HwTools* hw, ResetDataContainer* rdc); void setup(AmsConfiguration*, GpioConfig*, AmsData*, AmsDataStorage*, EnergyAccounting*, RealtimePlot*); void loop(); - void setMqtt(MQTTClient* mqtt); + void setCloud(CloudConnector* cloud); void setTimezone(Timezone* tz); void setMqttEnabled(bool); void setPriceService(PriceService* ps); @@ -73,6 +74,7 @@ private: RealtimePlot* rtp = NULL; AmsMqttHandler* mqttHandler = NULL; ConnectionHandler* ch = NULL; + CloudConnector* cloud = NULL; bool uploading = false; File file; bool performRestart = false; @@ -113,6 +115,7 @@ private: void realtimeJson(); void priceConfigJson(); void translationsJson(); + void cloudkeyJson(); void configurationJson(); void handleSave(); diff --git a/lib/SvelteUi/src/AmsWebServer.cpp b/lib/SvelteUi/src/AmsWebServer.cpp index bd6d5342..2451564f 100644 --- a/lib/SvelteUi/src/AmsWebServer.cpp +++ b/lib/SvelteUi/src/AmsWebServer.cpp @@ -123,6 +123,7 @@ void AmsWebServer::setup(AmsConfiguration* config, GpioConfig* gpioConfig, AmsDa server.on(context + F("/realtime.json"), HTTP_GET, std::bind(&AmsWebServer::realtimeJson, this)); server.on(context + F("/priceconfig.json"), HTTP_GET, std::bind(&AmsWebServer::priceConfigJson, this)); server.on(context + F("/translations.json"), HTTP_GET, std::bind(&AmsWebServer::translationsJson, this)); + server.on(context + F("/cloudkey.json"), HTTP_GET, std::bind(&AmsWebServer::cloudkeyJson, this)); server.on(context + F("/configuration.json"), HTTP_GET, std::bind(&AmsWebServer::configurationJson, this)); server.on(context + F("/save"), HTTP_POST, std::bind(&AmsWebServer::handleSave, this)); @@ -161,6 +162,10 @@ void AmsWebServer::setup(AmsConfiguration* config, GpioConfig* gpioConfig, AmsDa mqttEnabled = strlen(mqttConfig.host) > 0; } +void AmsWebServer::setCloud(CloudConnector* cloud) { + this->cloud = cloud; +} + void AmsWebServer::setTimezone(Timezone* tz) { this->tz = tz; } @@ -1083,6 +1088,23 @@ void AmsWebServer::translationsJson() { file.close(); } +void AmsWebServer::cloudkeyJson() { + if(!checkSecurity(1)) + return; + if(cloud == NULL) + notFound(); + + String seed = cloud->generateSeed(); + + snprintf_P(buf, BufferSize, PSTR("{\"seed\":\"%s\"}"), seed.c_str()); + + server.setContentLength(strlen(buf)); + server.sendHeader(HEADER_CACHE_CONTROL, CACHE_CONTROL_NO_CACHE); + server.sendHeader(HEADER_PRAGMA, PRAGMA_NO_CACHE); + server.sendHeader(HEADER_EXPIRES, EXPIRES_OFF); + server.send(200, MIME_JSON, buf); +} + void AmsWebServer::handleSave() { if(debugger->isActive(RemoteDebug::DEBUG)) debugger->printf_P(PSTR("Handling save method from http\n")); if(!checkSecurity(1)) diff --git a/platformio.ini b/platformio.ini index 385f7d53..ed19f7d0 100755 --- a/platformio.ini +++ b/platformio.ini @@ -2,7 +2,7 @@ extra_configs = platformio-user.ini [common] -lib_deps = EEPROM, LittleFS, DNSServer, 256dpi/MQTT@2.5.2, OneWireNg@0.10.0, DallasTemperature@3.9.1, https://github.com/gskjold/RemoteDebug.git, Time@1.6.1, Timezone@1.2.4, FirmwareVersion, AmsConfiguration, AmsData, AmsDataStorage, HwTools, Uptime, AmsDecoder, PriceService, EnergyAccounting, AmsMqttHandler, RawMqttHandler, JsonMqttHandler, DomoticzMqttHandler, HomeAssistantMqttHandler, RealtimePlot, ConnectionHandler, SvelteUi +lib_deps = EEPROM, LittleFS, DNSServer, 256dpi/MQTT@2.5.2, OneWireNg@0.10.0, DallasTemperature@3.9.1, https://github.com/gskjold/RemoteDebug.git, Time@1.6.1, Timezone@1.2.4, FirmwareVersion, AmsConfiguration, AmsData, AmsDataStorage, HwTools, Uptime, AmsDecoder, PriceService, EnergyAccounting, AmsMqttHandler, RawMqttHandler, JsonMqttHandler, DomoticzMqttHandler, HomeAssistantMqttHandler, RealtimePlot, ConnectionHandler lib_ignore = OneWire extra_scripts = pre:scripts/addversion.py @@ -19,7 +19,7 @@ build_flags = -fexceptions [esp32] -lib_deps = WiFi, Ethernet, ESPmDNS, WiFiClientSecure, HTTPClient, FS, Update, HTTPUpdate, WebServer, ESP32 Async UDP, ESP32SSDP, mulmer89/ESPRandom@1.5.0, ${common.lib_deps}, CloudConnector +lib_deps = WiFi, Ethernet, ESPmDNS, WiFiClientSecure, HTTPClient, FS, Update, HTTPUpdate, WebServer, ESP32 Async UDP, ESP32SSDP, mulmer89/ESPRandom@1.5.0, ${common.lib_deps}, CloudConnector, SvelteUi [env:esp8266] platform = espressif8266@4.2.0 @@ -29,7 +29,7 @@ board_build.ldscript = eagle.flash.4m2m.ld build_flags = ${common.build_flags} lib_ldf_mode = off lib_compat_mode = off -lib_deps = ESP8266WiFi, ESP8266mDNS, ESP8266WebServer, ESP8266HTTPClient, ESP8266httpUpdate, ESP8266SSDP, EspSoftwareSerial@6.14.1, ${common.lib_deps} +lib_deps = ESP8266WiFi, ESP8266mDNS, ESP8266WebServer, ESP8266HTTPClient, ESP8266httpUpdate, ESP8266SSDP, EspSoftwareSerial@6.14.1, ${common.lib_deps}, SvelteUi lib_ignore = ${common.lib_ignore} extra_scripts = ${common.extra_scripts} diff --git a/src/AmsToMqttBridge.cpp b/src/AmsToMqttBridge.cpp index 060172a8..61cea352 100644 --- a/src/AmsToMqttBridge.cpp +++ b/src/AmsToMqttBridge.cpp @@ -687,6 +687,11 @@ void loop() { EnergyAccountingConfig *eac = ea.getConfig(); cloud->setEnergyAccountingConfig(*eac); + + ws.setCloud(cloud); + } else if(cloud != NULL) { + delete cloud; + cloud = NULL; } config.ackCloudConfig(); }