diff --git a/lib/SvelteUi/app/dist/index.css b/lib/SvelteUi/app/dist/index.css index b9318ec8..dd0f8089 100644 --- a/lib/SvelteUi/app/dist/index.css +++ b/lib/SvelteUi/app/dist/index.css @@ -1 +1 @@ -/*! tailwindcss v3.1.8 | 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-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;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%}[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-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-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.static{position:static}.fixed{position:fixed}.inset-0{bottom:0;left:0;right:0;top:0}.z-50{z-index:50}.z-40{z-index:40}.col-span-2{grid-column:span 2/span 2}.float-right{float:right}.clear-both{clear:both}.m-3{margin:.75rem}.m-1{margin:.25rem}.m-2{margin:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.mx-2{margin-left:.5rem;margin-right:.5rem}.my-1{margin-bottom:.25rem;margin-top:.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.my-auto{margin-bottom:auto;margin-top:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mb-3{margin-bottom:.75rem}.mb-1{margin-bottom:.25rem}.mt-2{margin-top:.5rem}.ml-3{margin-left:.75rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.mr-3{margin-right:.75rem}.mt-3{margin-top:.75rem}.mb-4{margin-bottom:1rem}.mt-4{margin-top:1rem}.mt-1{margin-top:.25rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-64{height:16rem}.h-6{height:1.5rem}.w-full{width:100%}.w-1\/2{width:50%}.w-1\/4{width:25%}.w-3\/4{width:75%}.w-1\/3{width:33.333333%}.w-40{width:10rem}.w-6{width:1.5rem}.w-96{width:24rem}.flex-none{flex:none}.flex-auto{flex:1 1 auto}.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-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.bg-yellow-500{--tw-bg-opacity:1;background-color:rgb(234 179 8/var(--tw-bg-opacity))}.bg-violet-600{--tw-bg-opacity:1;background-color:rgb(124 58 237/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-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.pr-1{padding-right:.25rem}.pl-1{padding-left:.25rem}.pb-4{padding-bottom:1rem}.text-center{text-align:center}.text-right{text-align:right}.text-sm{font-size:.875rem;line-height:1.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/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))}.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))}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.gh-logo{height:2rem;width:2rem}.cnt{--tw-bg-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-radius:.25rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);margin:.5rem;min-height:268px;padding:.5rem}.gwf{height:16rem}@media (min-width:640px){.gwf{grid-column:span 2/span 2}}@media (min-width:768px){.gwf{grid-column:span 3/span 3}}@media (min-width:1024px){.gwf{grid-column:span 4/span 4}}@media (min-width:1280px){.gwf{grid-column:span 5/span 5}}@media (min-width:1536px){.gwf{grid-column:span 6/span 6}}.in-pre{border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;border-width:1px 0 1px 1px}.in-post,.in-pre{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}.in-post{border-bottom-right-radius:.375rem;border-top-right-radius:.375rem;border-width:1px 1px 1px 0}.in-post,.in-txt{border-color:rgb(209 213 219/var(--tw-border-opacity))}.in-txt{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-txt:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-f{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-f:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-m{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-m:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-l{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;border-top-right-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-l:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-s{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem;width:100%}.in-s:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.tr{text-align:right}.bd-green{background-color:rgb(34 197 94/var(--tw-bg-opacity));color:rgb(220 252 231/var(--tw-text-opacity))}.bd-green,.bd-yellow{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-yellow{background-color:rgb(234 179 8/var(--tw-bg-opacity));color:rgb(254 249 195/var(--tw-text-opacity))}.bd-red{background-color:rgb(239 68 68/var(--tw-bg-opacity));color:rgb(254 226 226/var(--tw-text-opacity))}.bd-blue,.bd-red{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-blue{background-color:rgb(59 130 246/var(--tw-bg-opacity));color:rgb(219 234 254/var(--tw-text-opacity))}.bd-gray{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(243 244 246/var(--tw-text-opacity));font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.btn-pri{padding:.5rem 1rem}.btn-pri,.btn-pri-sm{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));margin-right:.75rem}.btn-pri-sm{font-size:.75rem;line-height:1rem;padding:.25rem .5rem}.pl-root{position:relative}.pl-ov{left:25%;position:absolute;text-align:center;top:27%;width:50%}.pl-val{font-size:1.7rem}.pl-unt{color:gray;font-size:1rem}.pl-sub{font-size:1rem;padding-top:10px}.pl-snt{color:gray;font-size:.7rem}.pl-lab{font-size:1rem}.chart{height:100%;margin:0 auto;width:100%}svg{position:relative;width:100%}.tick{font-family:Helvetica,Arial;font-size:.85em;font-weight:200}.tick line{stroke:#e2e2e2;stroke-dasharray:2}.tick text{fill:#999;text-anchor:start}.tick.tick-0 line{stroke-dasharray:0}.tick.tick-green line{stroke:#32d900!important}.tick.tick-green text{fill:#32d900!important}.tick.tick-orange line{stroke:#d95600!important}.tick.tick-orange text{fill:#d95600!important}.x-axis .tick text{text-anchor:middle}.bars rect{stroke:#000;stroke-opacity:.25;opacity:.9}.bars text{display:block;font-family:Helvetica,Arial;font-size:.85em;text-align:center}.hover\:text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity))}@media (min-width:640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width:1280px){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-3{grid-template-columns:repeat(3,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.3 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}[multiple],[type=date],[type=datetime-local],[type=email],[type=month],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=time],[type=url],[type=week],input:where(:not([type])),select,textarea{--tw-shadow:0 0 #0000;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-radius:0;border-width:1px;font-size:1rem;line-height:1.5rem;padding:.5rem .75rem}[multiple]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=email]:focus,[type=month]:focus,[type=number]:focus,[type=password]:focus,[type=search]:focus,[type=tel]:focus,[type=text]:focus,[type=time]:focus,[type=url]:focus,[type=week]:focus,input:where(:not([type])):focus,select:focus,textarea:focus{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);border-color:#2563eb;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-bottom:0;padding-top:0}select{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple],[size]:where(select:not([size="1"])){background-image:none;background-position:0 0;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{--tw-shadow:0 0 #0000;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-origin:border-box;border-color:#6b7280;border-width:1px;color:#2563eb;display:inline-block;flex-shrink:0;height:1rem;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1rem}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}[type=checkbox]:checked,[type=radio]:checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}[type=checkbox]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E")}[type=radio]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")}[type=checkbox]:checked:focus,[type=checkbox]:checked:hover,[type=radio]:checked:focus,[type=radio]:checked:hover{background-color:currentColor;border-color:transparent}[type=checkbox]:indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}[type=checkbox]:indeterminate:focus,[type=checkbox]:indeterminate:hover{background-color:currentColor;border-color:transparent}[type=file]{background:unset;border-color:inherit;border-radius:0;border-width:0;font-size:unset;line-height:inherit;padding:0}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.static{position:static}.fixed{position:fixed}.inset-0{top:0;right:0;bottom:0;left:0}.z-40{z-index:40}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.float-right{float:right}.clear-both{clear:both}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-3{margin:.75rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-bottom:.25rem;margin-top:.25rem}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.my-auto{margin-bottom:auto;margin-top:auto}.mb-1{margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mr-3{margin-right:.75rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-6{height:1.5rem}.h-64{height:16rem}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-1\/4{width:25%}.w-3\/4{width:75%}.w-40{width:10rem}.w-6{width:1.5rem}.w-96{width:24rem}.w-full{width:100%}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-md{border-radius:.375rem}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.bg-violet-600{--tw-bg-opacity:1;background-color:rgb(124 58 237/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-yellow-500{--tw-bg-opacity:1;background-color:rgb(234 179 8/var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity:.5}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.pb-4{padding-bottom:1rem}.pl-1{padding-left:.25rem}.pr-1{padding-right:.25rem}.text-center{text-align:center}.text-right{text-align:right}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity))}.text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity))}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.gh-logo{height:2rem;width:2rem}.cnt{--tw-bg-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-radius:.25rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);margin:.5rem;min-height:268px;padding:.5rem}.gwf{height:16rem}@media (min-width:640px){.gwf{grid-column:span 2/span 2}}@media (min-width:768px){.gwf{grid-column:span 3/span 3}}@media (min-width:1024px){.gwf{grid-column:span 4/span 4}}@media (min-width:1280px){.gwf{grid-column:span 5/span 5}}@media (min-width:1536px){.gwf{grid-column:span 6/span 6}}.in-pre{border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;border-width:1px 0 1px 1px}.in-post,.in-pre{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}.in-post{border-bottom-right-radius:.375rem;border-top-right-radius:.375rem;border-width:1px 1px 1px 0}.in-post,.in-txt{border-color:rgb(209 213 219/var(--tw-border-opacity))}.in-txt{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-txt:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-f{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-f:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-m{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-m:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-l{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;border-top-right-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-l:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-s{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem;width:100%}.in-s:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.tr{text-align:right}.bd-green{background-color:rgb(34 197 94/var(--tw-bg-opacity));color:rgb(220 252 231/var(--tw-text-opacity))}.bd-green,.bd-yellow{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-yellow{background-color:rgb(234 179 8/var(--tw-bg-opacity));color:rgb(254 249 195/var(--tw-text-opacity))}.bd-red{background-color:rgb(239 68 68/var(--tw-bg-opacity));color:rgb(254 226 226/var(--tw-text-opacity))}.bd-blue,.bd-red{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-blue{background-color:rgb(59 130 246/var(--tw-bg-opacity));color:rgb(219 234 254/var(--tw-text-opacity))}.bd-gray{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(243 244 246/var(--tw-text-opacity));font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.btn-pri{padding:.5rem 1rem}.btn-pri,.btn-pri-sm{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));margin-right:.75rem}.btn-pri-sm{font-size:.75rem;line-height:1rem;padding:.25rem .5rem}.pl-root{position:relative}.pl-ov{left:25%;position:absolute;text-align:center;top:27%;width:50%}.pl-val{font-size:1.7rem}.pl-unt{color:gray;font-size:1rem}.pl-sub{font-size:1rem;padding-top:10px}.pl-snt{color:gray;font-size:.7rem}.pl-lab{font-size:1rem}.chart{height:100%;margin:0 auto;width:100%}svg{position:relative;width:100%}.tick{font-family:Helvetica,Arial;font-size:.85em;font-weight:200}.tick line{stroke:#e2e2e2;stroke-dasharray:2}.tick text{fill:#999;text-anchor:start}.tick.tick-0 line{stroke-dasharray:0}.tick.tick-green line{stroke:#32d900!important}.tick.tick-green text{fill:#32d900!important}.tick.tick-orange line{stroke:#d95600!important}.tick.tick-orange text{fill:#d95600!important}.x-axis .tick text{text-anchor:middle}.bars rect{stroke:#000;stroke-opacity:.25;opacity:.9}.bars text{display:block;font-family:Helvetica,Arial;font-size:.85em;text-align:center}.hover\:text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity))}@media (min-width:640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width:1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width:1536px){.\32xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}} diff --git a/lib/SvelteUi/app/dist/index.js b/lib/SvelteUi/app/dist/index.js index e1b7daa3..e074e6f2 100644 --- a/lib/SvelteUi/app/dist/index.js +++ b/lib/SvelteUi/app/dist/index.js @@ -1,14 +1,14 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function l(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=l(i);fetch(i.href,o)}})();function ne(){}function Jt(t,e){for(const l in e)t[l]=e[l];return t}function Qf(t){return t()}function Er(){return Object.create(null)}function Ve(t){t.forEach(Qf)}function Xf(t){return typeof t=="function"}function ke(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ms;function Bc(t,e){return ms||(ms=document.createElement("a")),ms.href=e,t===ms.href}function zc(t){return Object.keys(t).length===0}function ao(t,...e){if(t==null)return ne;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function oi(t){let e;return ao(t,l=>e=l)(),e}function rl(t,e,l){t.$$.on_destroy.push(ao(e,l))}function fo(t,e,l,n){if(t){const i=Zf(t,e,l,n);return t[0](i)}}function Zf(t,e,l,n){return t[1]&&n?Jt(l.ctx.slice(),t[1](n(e))):l.ctx}function co(t,e,l,n){if(t[2]&&n){const i=t[2](n(l));if(e.dirty===void 0)return i;if(typeof i=="object"){const o=[],r=Math.max(e.dirty.length,i.length);for(let a=0;a32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function Ts(t){return function(e){return e.preventDefault(),t.call(this,e)}}function u(t,e,l){l==null?t.removeAttribute(e):t.getAttribute(e)!==l&&t.setAttribute(e,l)}function al(t,e){const l=Object.getOwnPropertyDescriptors(t.__proto__);for(const n in e)e[n]==null?t.removeAttribute(n):n==="style"?t.style.cssText=e[n]:n==="__value"?t.value=t[n]=e[n]:l[n]&&l[n].set?t[n]=e[n]:u(t,n,e[n])}function ae(t){return t===""?null:+t}function Yc(t){return Array.from(t.childNodes)}function B(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function V(t,e){t.value=e==null?"":e}function Jf(t,e,l,n){l===null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function Re(t,e){for(let l=0;l{r.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=K(n.contentWindow,"resize",e)}),s(t,n),()=>{(i||o&&n.contentWindow)&&o(),w(n)}}function Qc(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,l,n,e),i}let yi;function ki(t){yi=t}function Ci(){if(!yi)throw new Error("Function called outside component initialization");return yi}function Xc(t){Ci().$$.on_mount.push(t)}function Zc(t){Ci().$$.on_destroy.push(t)}function Jc(){const t=Ci();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=Qc(e,l,{cancelable:n});return i.slice().forEach(r=>{r.call(t,o)}),!o.defaultPrevented}return!0}}function wi(t,e){return Ci().$$.context.set(t,e),e}function ql(t){return Ci().$$.context.get(t)}const bi=[],ws=[],hs=[],Fr=[],xf=Promise.resolve();let Zs=!1;function ec(){Zs||(Zs=!0,xf.then(tc))}function xc(){return ec(),xf}function tt(t){hs.push(t)}const zs=new Set;let _s=0;function tc(){const t=yi;do{for(;_s{bs.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function ui(t,e){const l={},n={},i={$$scope:1};let o=t.length;for(;o--;){const r=t[o],a=e[o];if(a){for(const f in r)f in a||(n[f]=1);for(const f in a)i[f]||(l[f]=a[f],i[f]=1);t[o]=a}else for(const f in r)i[f]=1}for(const r in n)r in l||(l[r]=void 0);return l}function Rr(t){return typeof t=="object"&&t!==null?t:{}}function J(t){t&&t.c()}function X(t,e,l,n){const{fragment:i,on_mount:o,on_destroy:r,after_update:a}=t.$$;i&&i.m(e,l),n||tt(()=>{const f=o.map(Qf).filter(Xf);r?r.push(...f):Ve(f),t.$$.on_mount=[]}),a.forEach(tt)}function Z(t,e){const l=t.$$;l.fragment!==null&&(Ve(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function t1(t,e){t.$$.dirty[0]===-1&&(bi.push(t),ec(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const v=d.length?d[0]:b;return c.ctx&&i(c.ctx[_],c.ctx[_]=v)&&(!c.skip_bound&&c.bound[_]&&c.bound[_](v),p&&t1(t,_)),b}):[],c.update(),p=!0,Ve(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const _=Yc(e.target);c.fragment&&c.fragment.l(_),_.forEach(w)}else c.fragment&&c.fragment.c();e.intro&&N(t.$$.fragment),X(t,e.target,e.anchor,e.customElement),tc()}ki(f)}class Ce{$destroy(){Z(this,1),this.$destroy=ne}$on(e,l){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&&!zc(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Lr=t=>typeof t>"u",lc=t=>typeof t=="function",nc=t=>typeof t=="number";function l1(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function ic(){let t=0;return()=>t++}function n1(){return Math.random().toString(36).substring(2)}const Hl=typeof window>"u";function sc(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const Js=(t,e)=>t?{}:{style:e},ni=t=>({"aria-hidden":"true",...Js(t,"display:none;")}),li=[];function oc(t,e){return{subscribe:rt(t,e).subscribe}}function rt(t,e=ne){let l;const n=new Set;function i(a){if(ke(t,a)&&(t=a,l)){const f=!li.length;for(const c of n)c[1](),li.push(c,t);if(f){for(let c=0;c{n.delete(c),n.size===0&&(l(),l=null)}}return{set:i,update:o,subscribe:r}}function i1(t,e,l){const n=!Array.isArray(t),i=n?[t]:t,o=e.length<2;return oc(l,r=>{let a=!1;const f=[];let c=0,p=ne;const _=()=>{if(c)return;p();const d=e(n?f[0]:f,r);o?r(d):p=Xf(d)?d:ne},b=i.map((d,v)=>ao(d,g=>{f[v]=g,c&=~(1<{c|=1<`@@svnav-ctx__${t}`,xs=$i("LOCATION"),ri=$i("ROUTER"),uc=$i("ROUTE"),s1=$i("ROUTE_PARAMS"),o1=$i("FOCUS_ELEM"),rc=/^:(.+)/,gi=(t,e,l)=>t.substr(e,l),eo=(t,e)=>gi(t,0,e.length)===e,u1=t=>t==="",r1=t=>rc.test(t),ac=t=>t[0]==="*",a1=t=>t.replace(/\*.*$/,""),fc=t=>t.replace(/(^\/+|\/+$)/g,"");function pl(t,e=!1){const l=fc(t).split("/");return e?l.filter(Boolean):l}const Ys=(t,e)=>t+(e?`?${e}`:""),_o=t=>`/${fc(t)}`;function Ti(...t){const e=n=>pl(n,!0).join("/"),l=t.map(e).join("/");return _o(l)}const vo=1,Ss=2,cn=3,f1=4,cc=5,c1=6,mc=7,m1=8,p1=9,pc=10,_c=11,_1={[vo]:"Link",[Ss]:"Route",[cn]:"Router",[f1]:"useFocus",[cc]:"useLocation",[c1]:"useMatch",[mc]:"useNavigate",[m1]:"useParams",[p1]:"useResolvable",[pc]:"useResolve",[_c]:"navigate"},ho=t=>_1[t];function d1(t,e){let l;return t===Ss?l=e.path?`path="${e.path}"`:"default":t===vo?l=`to="${e.to}"`:t===cn&&(l=`basepath="${e.basepath||""}"`),`<${ho(t)} ${l||""} />`}function v1(t,e,l,n){const i=l&&d1(n||t,l),o=i?` +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function l(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=l(i);fetch(i.href,o)}})();function ne(){}function Jt(t,e){for(const l in e)t[l]=e[l];return t}function Kf(t){return t()}function Er(){return Object.create(null)}function Ke(t){t.forEach(Kf)}function uo(t){return typeof t=="function"}function $e(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ms;function Bc(t,e){return ms||(ms=document.createElement("a")),ms.href=e,t===ms.href}function zc(t){return Object.keys(t).length===0}function ro(t,...e){if(t==null)return ne;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function ui(t){let e;return ro(t,l=>e=l)(),e}function rl(t,e,l){t.$$.on_destroy.push(ro(e,l))}function ao(t,e,l,n){if(t){const i=Qf(t,e,l,n);return t[0](i)}}function Qf(t,e,l,n){return t[1]&&n?Jt(l.ctx.slice(),t[1](n(e))):l.ctx}function fo(t,e,l,n){if(t[2]&&n){const i=t[2](n(l));if(e.dirty===void 0)return i;if(typeof i=="object"){const o=[],r=Math.max(e.dirty.length,i.length);for(let a=0;a32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function Cs(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 Vc=["width","height"];function ri(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&&Vc.indexOf(n)===-1?t[n]=e[n]:u(t,n,e[n])}function fe(t){return t===""?null:+t}function Kc(t){return Array.from(t.childNodes)}function G(t,e){e=""+e,t.data!==e&&(t.data=e)}function Qc(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Xc(t,e,l){~Yc.indexOf(l)?Qc(t,e):G(t,e)}function V(t,e){t.value=e??""}function Xf(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function Le(t,e,l){for(let n=0;n{r.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=K(n.contentWindow,"resize",e),e()}),s(t,n),()=>{(i||o&&n.contentWindow)&&o(),k(n)}}function xc(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,l,n,e),i}function Ir(t,e){return new t(e)}let $i;function yi(t){$i=t}function Ti(){if(!$i)throw new Error("Function called outside component initialization");return $i}function e1(t){Ti().$$.on_mount.push(t)}function t1(t){Ti().$$.on_destroy.push(t)}function l1(){const t=Ti();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=xc(e,l,{cancelable:n});return i.slice().forEach(r=>{r.call(t,o)}),!o.defaultPrevented}return!0}}function Ci(t,e){return Ti().$$.context.set(t,e),e}function Ul(t){return Ti().$$.context.get(t)}const ni=[],gs=[];let ii=[];const Fr=[],Zf=Promise.resolve();let Qs=!1;function Jf(){Qs||(Qs=!0,Zf.then(xf))}function n1(){return Jf(),Zf}function tt(t){ii.push(t)}const Gs=new Set;let ti=0;function xf(){if(ti!==0)return;const t=$i;do{try{for(;tit.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),ii=e}const vs=new Set;let on;function Ae(){on={r:0,c:[],p:on}}function De(){on.r||Ke(on.c),on=on.p}function N(t,e){t&&t.i&&(vs.delete(t),t.i(e))}function D(t,e,l,n){if(t&&t.o){if(vs.has(t))return;vs.add(t),on.c.push(()=>{vs.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function ec(t,e){const l={},n={},i={$$scope:1};let o=t.length;for(;o--;){const r=t[o],a=e[o];if(a){for(const f in r)f in a||(n[f]=1);for(const f in a)i[f]||(l[f]=a[f],i[f]=1);t[o]=a}else for(const f in r)i[f]=1}for(const r in n)r in l||(l[r]=void 0);return l}function Rr(t){return typeof t=="object"&&t!==null?t:{}}function Z(t){t&&t.c()}function Q(t,e,l,n){const{fragment:i,after_update:o}=t.$$;i&&i.m(e,l),n||tt(()=>{const r=t.$$.on_mount.map(Kf).filter(uo);t.$$.on_destroy?t.$$.on_destroy.push(...r):Ke(r),t.$$.on_mount=[]}),o.forEach(tt)}function X(t,e){const l=t.$$;l.fragment!==null&&(s1(l.after_update),Ke(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function o1(t,e){t.$$.dirty[0]===-1&&(ni.push(t),Jf(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const v=d.length?d[0]:b;return c.ctx&&i(c.ctx[_],c.ctx[_]=v)&&(!c.skip_bound&&c.bound[_]&&c.bound[_](v),p&&o1(t,_)),b}):[],c.update(),p=!0,Ke(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const _=Kc(e.target);c.fragment&&c.fragment.l(_),_.forEach(k)}else c.fragment&&c.fragment.c();e.intro&&N(t.$$.fragment),Q(t,e.target,e.anchor,e.customElement),xf()}yi(f)}class Me{$destroy(){X(this,1),this.$destroy=ne}$on(e,l){if(!uo(l))return ne;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(l),()=>{const i=n.indexOf(l);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!zc(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Lr=t=>typeof t>"u",tc=t=>typeof t=="function",lc=t=>typeof t=="number";function u1(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function nc(){let t=0;return()=>t++}function r1(){return Math.random().toString(36).substring(2)}const ql=typeof window>"u";function ic(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const sc=(t,e)=>t?{}:{style:e},Xs=t=>({"aria-hidden":"true",...sc(t,"display:none;")}),li=[];function oc(t,e){return{subscribe:rt(t,e).subscribe}}function rt(t,e=ne){let l;const n=new Set;function i(a){if($e(t,a)&&(t=a,l)){const f=!li.length;for(const c of n)c[1](),li.push(c,t);if(f){for(let c=0;c{n.delete(c),n.size===0&&l&&(l(),l=null)}}return{set:i,update:o,subscribe:r}}function a1(t,e,l){const n=!Array.isArray(t),i=n?[t]:t,o=e.length<2;return oc(l,r=>{let a=!1;const f=[];let c=0,p=ne;const _=()=>{if(c)return;p();const d=e(n?f[0]:f,r);o?r(d):p=uo(d)?d:ne},b=i.map((d,v)=>ro(d,g=>{f[v]=g,c&=~(1<{c|=1<`@@svnav-ctx__${t}`,Zs=Si("LOCATION"),ai=Si("ROUTER"),uc=Si("ROUTE"),f1=Si("ROUTE_PARAMS"),c1=Si("FOCUS_ELEM"),rc=/^:(.+)/,wi=(t,e,l)=>t.substr(e,l),Js=(t,e)=>wi(t,0,e.length)===e,m1=t=>t==="",p1=t=>rc.test(t),ac=t=>t[0]==="*",_1=t=>t.replace(/\*.*$/,""),fc=t=>t.replace(/(^\/+|\/+$)/g,"");function ml(t,e=!1){const l=fc(t).split("/");return e?l.filter(Boolean):l}const Bs=(t,e)=>t+(e?`?${e}`:""),po=t=>`/${fc(t)}`;function Mi(...t){const e=n=>ml(n,!0).join("/"),l=t.map(e).join("/");return po(l)}const _o=1,$s=2,fn=3,d1=4,cc=5,v1=6,mc=7,h1=8,b1=9,pc=10,_c=11,g1={[_o]:"Link",[$s]:"Route",[fn]:"Router",[d1]:"useFocus",[cc]:"useLocation",[v1]:"useMatch",[mc]:"useNavigate",[h1]:"useParams",[b1]:"useResolvable",[pc]:"useResolve",[_c]:"navigate"},vo=t=>g1[t];function k1(t,e){let l;return t===$s?l=e.path?`path="${e.path}"`:"default":t===_o?l=`to="${e.to}"`:t===fn&&(l=`basepath="${e.basepath||""}"`),`<${vo(t)} ${l||""} />`}function w1(t,e,l,n){const i=l&&k1(n||t,l),o=i?` -Occurred in: ${i}`:"",r=ho(t),a=lc(e)?e(r):e;return`<${r}> ${a}${o}`}const dc=t=>(...e)=>t(v1(...e)),vc=dc(t=>{throw new Error(t)}),ys=dc(console.warn),Ur=4,h1=3,b1=2,g1=1,k1=1;function w1(t,e){const l=t.default?0:pl(t.fullPath).reduce((n,i)=>{let o=n;return o+=Ur,u1(i)?o+=k1:r1(i)?o+=b1:ac(i)?o-=Ur+g1:o+=h1,o},0);return{route:t,score:l,index:e}}function y1(t){return t.map(w1).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function hc(t,e){let l,n;const[i]=e.split("?"),o=pl(i),r=o[0]==="",a=y1(t);for(let f=0,c=a.length;f({...p,params:b,uri:$});if(p.default){n=d(e);continue}const v=pl(p.fullPath),g=Math.max(o.length,v.length);let k=0;for(;k{c===".."?f.pop():c!=="."&&f.push(c)}),Ys(`/${f.join("/")}`,n)}function Or(t,e){const{pathname:l,hash:n="",search:i="",state:o}=t,r=pl(e,!0),a=pl(l,!0);for(;r.length;)r[0]!==a[0]&&vc(cn,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),r.shift(),a.shift();return{pathname:Ti(...a),hash:n,search:i,state:o}}const qr=t=>t.length===1?"":t,bo=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,o=i?qr(gi(t,l)):"",r=i?gi(t,0,l):t,a=n?qr(gi(r,e)):"";return{pathname:(n?gi(r,0,e):r)||"/",search:a,hash:o}},$1=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function T1(t,e,l){return Ti(l,C1(t,e))}function S1(t,e){const l=_o(a1(t)),n=pl(l,!0),i=pl(e,!0).slice(0,n.length),o=bc({fullPath:l},Ti(...i));return o&&o.uri}const Vs="POP",P1="PUSH",N1="REPLACE";function Ks(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function M1(t){let e=[],l=Ks(t),n=Vs;const i=(o=e)=>o.forEach(r=>r({location:l,action:n}));return{get location(){return l},listen(o){e.push(o);const r=()=>{l=Ks(t),n=Vs,i([o])};i([o]);const a=sc(t,"popstate",r);return()=>{a(),e=e.filter(f=>f!==o)}},navigate(o,r){const{state:a={},replace:f=!1}=r||{};if(n=f?N1:P1,nc(o))r&&ys(_c,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=Vs,t.history.go(o);else{const c={...a,_key:n1()};try{t.history[f?"replaceState":"pushState"](c,"",o)}catch{t.location[f?"replace":"assign"](o)}}l=Ks(t),i()}}}function Qs(t,e){return{...bo(e),state:t}}function A1(t="/"){let e=0,l=[Qs(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(Qs(n,o))},replaceState(n,i,o){l[e]=Qs(n,o)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const D1=!!(!Hl&&window.document&&window.document.createElement),I1=!Hl&&window.location.origin==="null",gc=M1(D1&&!I1?window:A1()),{navigate:ii}=gc;let Pl=null,kc=!0;function E1(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nPl.level||t.level===Pl.level&&E1(t.routerId,Pl.routerId))&&(Pl=t)}function R1(){Pl=null}function L1(){kc=!1}function Hr(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=sc(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function U1(t,e){return Number(t.dataset.svnavRouteEnd)===e}function O1(t){return/^H[1-6]$/i.test(t.tagName)}function jr(t,e=document){return e.querySelector(t)}function q1(t){let l=jr(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!U1(l,t);){if(O1(l))return l;const n=jr("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function H1(t){Promise.resolve(oi(t.focusElement)).then(e=>{const l=e||q1(t.id);l||ys(cn,`Could not find an element to focus. You should always render a header for accessibility reasons, or set a custom focus element via the "useFocus" hook. If you don't want this Route or Router to manage focus, pass "primary={false}" to it.`,t,Ss),!Hr(l)&&Hr(document.documentElement)})}const j1=(t,e,l)=>(n,i)=>xc().then(()=>{if(!Pl||kc){L1();return}if(n&&H1(Pl.route),t.announcements&&i){const{path:o,fullPath:r,meta:a,params:f,uri:c}=Pl.route,p=t.createAnnouncement({path:o,fullPath:r,meta:a,params:f,uri:c},oi(l));Promise.resolve(p).then(_=>{e.set(_)})}R1()}),Wr="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 W1(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},Js(t[6],Wr)],i={};for(let o=0;o`Navigated to ${le.uri}`,announcements:!0,...v},$=p,T=_o(p),P=ql(xs),I=ql(ri),S=!P,A=B1(),E=d&&!(I&&!I.manageFocus),F=rt("");rl(t,F,le=>l(0,a=le));const Y=I?I.disableInlineStyles:g,U=rt([]);rl(t,U,le=>l(20,r=le));const R=rt(null);rl(t,R,le=>l(18,i=le));let q=!1;const z=S?0:I.level+1,H=S?rt((()=>Or(Hl?bo(_):b.location,T))()):P;rl(t,H,le=>l(17,n=le));const G=rt(n);rl(t,G,le=>l(19,o=le));const L=j1(k,F,H),W=le=>de=>de.filter(ie=>ie.id!==le);function j(le){if(Hl){if(q)return;const de=bc(le,n.pathname);if(de)return q=!0,de}else U.update(de=>{const ie=W(le.id)(de);return ie.push(le),ie})}function te(le){U.update(W(le))}return!S&&p!==Gr&&ys(cn,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:p}),S&&(Xc(()=>b.listen(de=>{const ie=Or(de.location,T);G.set(n),H.set(ie)})),wi(xs,H)),wi(ri,{activeRoute:R,registerRoute:j,unregisterRoute:te,manageFocus:E,level:z,id:A,history:S?b:I.history,basepath:S?T:I.basepath,disableInlineStyles:Y}),t.$$set=le=>{"basepath"in le&&l(11,p=le.basepath),"url"in le&&l(12,_=le.url),"history"in le&&l(13,b=le.history),"primary"in le&&l(14,d=le.primary),"a11y"in le&&l(15,v=le.a11y),"disableInlineStyles"in le&&l(16,g=le.disableInlineStyles),"$$scope"in le&&l(21,c=le.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&p!==$&&ys(cn,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const le=hc(r,n.pathname);R.set(le)}if(t.$$.dirty[0]&655360&&S){const le=!!n.hash,de=!le&&E,ie=!le||n.pathname!==o.pathname;L(de,ie)}t.$$.dirty[0]&262144&&E&&i&&i.primary&&F1({level:z,routerId:A,route:i})},[a,k,S,A,E,F,Y,U,R,H,G,p,_,b,d,v,g,n,i,o,r,c,f]}class wc extends Ce{constructor(e){super(),ye(this,e,z1,G1,ke,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}function Si(t,e,l=ri,n=cn){ql(l)||vc(t,o=>`You cannot use ${o} outside of a ${ho(n)}.`,e)}const Y1=t=>{const{subscribe:e}=ql(t);return{subscribe:e}};function yc(){return Si(cc),Y1(xs)}function Cc(){const{history:t}=ql(ri);return t}function $c(){const t=ql(uc);return t?i1(t,e=>e.base):rt("/")}function Tc(){Si(pc);const t=$c(),{basepath:e}=ql(ri);return n=>T1(n,oi(t),e)}function V1(){Si(mc);const t=Tc(),{navigate:e}=Cc();return(n,i)=>{const o=nc(n)?n:t(n);return e(o,i)}}const K1=t=>({params:t&16,location:t&8}),Br=t=>({params:Hl?oi(t[10]):t[4],location:t[3],navigate:t[11]});function zr(t){let e,l;return e=new wc({props:{primary:t[1],$$slots:{default:[Z1]},$$scope:{ctx:t}}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.primary=n[1]),i&528409&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Q1(t){let e;const l=t[18].default,n=fo(l,t,t[19],Br);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&524312)&&mo(n,l,i,i[19],e?co(l,i[19],o,K1):po(i[19]),Br)},i(i){e||(N(n,i),e=!0)},o(i){D(n,i),e=!1},d(i){n&&n.d(i)}}}function X1(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},Hl?oi(t[10]):t[4],t[12]];var o=t[0];function r(a){let f={};for(let c=0;c{Z(p,1)}),Se()}o?(e=new o(r()),J(e.$$.fragment),N(e.$$.fragment,1),X(e,l.parentNode,l)):e=null}else o&&e.$set(c)},i(a){n||(e&&N(e.$$.fragment,a),n=!0)},o(a){e&&D(e.$$.fragment,a),n=!1},d(a){a&&w(l),e&&Z(e,a)}}}function Z1(t){let e,l,n,i;const o=[X1,Q1],r=[];function a(f,c){return f[0]!==null?0:1}return e=a(t),l=r[e]=o[e](t),{c(){l.c(),n=We()},m(f,c){r[e].m(f,c),y(f,n,c),i=!0},p(f,c){let p=e;e=a(f),e===p?r[e].p(f,c):(Te(),D(r[p],1,1,()=>{r[p]=null}),Se(),l=r[e],l?l.p(f,c):(l=r[e]=o[e](f),l.c()),N(l,1),l.m(n.parentNode,n))},i(f){i||(N(l),i=!0)},o(f){D(l),i=!1},d(f){r[e].d(f),f&&w(n)}}}function J1(t){let e,l,n,i,o,r=[ni(t[7]),{"data-svnav-route-start":t[5]}],a={};for(let _=0;_{f=null}),Se()),al(i,p=ui(c,[ni(_[7]),{"data-svnav-route-end":_[5]}]))},i(_){o||(N(f),o=!0)},o(_){D(f),o=!1},d(_){_&&w(e),_&&w(l),f&&f.d(_),_&&w(n),_&&w(i)}}}const x1=ic();function em(t,e,l){let n;const i=["path","component","meta","primary"];let o=ks(e,i),r,a,f,c,{$$slots:p={},$$scope:_}=e,{path:b=""}=e,{component:d=null}=e,{meta:v={}}=e,{primary:g=!0}=e;Si(Ss,e);const k=x1(),{registerRoute:$,unregisterRoute:T,activeRoute:P,disableInlineStyles:I}=ql(ri);rl(t,P,q=>l(16,r=q));const S=$c();rl(t,S,q=>l(17,f=q));const A=yc();rl(t,A,q=>l(3,a=q));const E=rt(null);let F;const Y=rt(),U=rt({});rl(t,U,q=>l(4,c=q)),wi(uc,Y),wi(s1,U),wi(o1,E);const R=V1();return Hl||Zc(()=>T(k)),t.$$set=q=>{l(24,e=Jt(Jt({},e),gs(q))),l(12,o=ks(e,i)),"path"in q&&l(13,b=q.path),"component"in q&&l(0,d=q.component),"meta"in q&&l(14,v=q.meta),"primary"in q&&l(1,g=q.primary),"$$scope"in q&&l(19,_=q.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const q=b==="",z=Ti(f,b),O={id:k,path:b,meta:v,default:q,fullPath:q?"":z,base:q?f:S1(z,a.pathname),primary:g,focusElement:E};Y.set(O),l(15,F=$(O))}if(t.$$.dirty&98304&&l(2,n=!!(F||r&&r.id===k)),t.$$.dirty&98308&&n){const{params:q}=F||r;U.set(q)}},e=gs(e),[d,g,n,a,c,k,P,I,S,A,U,R,o,b,v,F,r,f,p,_]}class Sl extends Ce{constructor(e){super(),ye(this,e,em,J1,ke,{path:13,component:0,meta:14,primary:1})}}function tm(t){let e,l,n,i;const o=t[13].default,r=fo(o,t,t[12],null);let a=[{href:t[0]},t[2],t[1]],f={};for(let c=0;cl(11,_=E));const P=Jc(),I=Tc(),{navigate:S}=Cc();function A(E){P("click",E),l1(E)&&(E.preventDefault(),S(n,{state:k,replace:r||g}))}return t.$$set=E=>{l(19,e=Jt(Jt({},e),gs(E))),l(18,p=ks(e,c)),"to"in E&&l(5,v=E.to),"replace"in E&&l(6,g=E.replace),"state"in E&&l(7,k=E.state),"getProps"in E&&l(8,$=E.getProps),"$$scope"in E&&l(12,d=E.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=I(v,_)),t.$$.dirty&2049&&l(10,i=eo(_.pathname,n)),t.$$.dirty&2049&&l(9,o=n===_.pathname),t.$$.dirty&2049&&(r=bo(n)===$1(_)),t.$$.dirty&512&&l(2,a=o?{"aria-current":"page"}:{}),l(1,f=(()=>{if(lc($)){const E=$({location:_,href:n,isPartiallyCurrent:i,isCurrent:o});return{...p,...E}}return p})())},e=gs(e),[n,f,a,T,A,v,g,k,$,o,i,_,d,b]}class Ol extends Ce{constructor(e){super(),ye(this,e,lm,tm,ke,{to:5,replace:6,state:7,getProps:8})}}let to=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ul(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function nm(t){return t>218&&t<242?"#32d900":t>212&&t<248?"#b1d900":t>208&&t<252?"#ffb800":"#d90000"}function Sc(t){return t>90?"#d90000":t>85?"#e32100":t>80?"#ffb800":t>75?"#dcd800":"#32d900"}function im(t){return t>75?"#32d900":t>50?"#77d900":t>25?"#94d900":"#dcd800"}function Cs(t){switch(t){case 1:return"Aidon";case 2:return"Kaifa";case 3:return"Kamstrup";case 8:return"Iskra";case 9:return"Landis+Gyr";case 10:return"Sagemcom";default:return""}}function De(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function fe(t,e){switch(e){case 5:switch(t){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(t){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 200:return"Generic ESP32";case 2:return"HAN Reader 2.0 by Max Spencer";case 0:return"Custom hardware by Roar Fredriksen";case 1:return"Kamstrup module by Egil Opsahl";case 8:return"\xB5HAN mosquito by dbeinder";case 3:return"Pow-K (UART0)";case 4:return"Pow-U (UART0)";case 101:return"Wemos D1 mini";case 100:return"Generic ESP8266";case 70:return"Generic ESP32-C3";case 71:return"ESP32-C3-DevKitM-1"}}function Yr(t){switch(t){case-1:return"Parse error";case-2:return"Incomplete data received";case-3:return"Payload boundry flag missing";case-4:return"Header checksum error";case-5:return"Footer checksum error";case-9:return"Unknown data received, check meter config";case-41:return"Frame length not equal";case-51:return"Authentication failed";case-52:return"Decryption failed";case-53:return"Encryption key invalid";case 90:return"No HAN data received for at least 30s";case 91:return"Serial break";case 92:return"Serial buffer full";case 93:return"Serial FIFO overflow";case 94:return"Serial frame error";case 95:return"Serial parity error";case 96:return"RX error";case 98:return"Exception in code, debugging necessary";case 99:return"Autodetection failed"}return t<0?"Unspecified error "+t:""}function Vr(t){switch(t){case-3:return"Connection failed";case-4:return"Network timeout";case-10:return"Connection denied";case-11:return"Failed to subscribe";case-13:return"Connection lost"}return t<0?"Unspecified error "+t:""}function Kr(t){switch(t){case 401:case 403:return"Unauthorized, check API key";case 404:return"Price unavailable, not found";case 425:return"Server says its too early";case 429:return"Exceeded API rate limit";case 500:return"Internal server error";case-2:return"Incomplete data received";case-3:return"Invalid data, tag missing";case-51:return"Authentication failed";case-52:return"Decryption failed";case-53:return"Encryption key invalid"}return t<0?"Unspecified error "+t:""}function si(t){switch(t){case 2:case 4:case 7:return!0}return!1}function ze(t,e){return t==1||t==2&&e}function Lt(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function ce(t,e){return isNaN(t)?"-":(isNaN(e)&&(e=t<10?1:0),t.toFixed(e))}function fl(t,e){return t.setTime(t.getTime()+e*36e5),t}function Qr(t){if(t.chip=="esp8266")switch(t.boot_reason){case 0:return"Normal";case 1:return"WDT reset";case 2:return"Exception reset";case 3:return"Soft WDT reset";case 4:return"Software restart";case 5:return"Deep sleep";case 6:return"External reset";default:return"Unknown (8266)"}else switch(t.boot_reason){case 1:return"Vbat power on reset";case 3:return"Software reset";case 4:return"WDT reset";case 5:return"Deep sleep";case 6:return"SLC reset";case 7:return"Timer Group0 WDT reset";case 8:return"Timer Group1 WDT reset";case 9:return"RTC WDT reset";case 10:return"Instrusion test reset CPU";case 11:return"Time Group reset CPU";case 12:return"Software reset CPU";case 13:return"RTC WTD reset CPU";case 14:return"PRO CPU";case 15:return"Brownout";case 16:return"RTC reset";default:return"Unknown"}}async function jl(t,e={}){const{timeout:l=8e3}=e,n=new AbortController,i=setTimeout(()=>n.abort(),l),o=await fetch(t,{...e,signal:n.signal});return clearTimeout(i),o}let ul={version:"",chip:"",mac:null,apmac:null,vndcfg:null,usrcfg:null,fwconsent:null,booting:!1,upgrading:!1,ui:{},security:0,boot_reason:0,upgrade:{x:-1,e:0,f:null,t:null},trying:null};const Ut=rt(ul);async function go(){ul=await(await jl("/sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),Ut.set(ul)}let ds=0,Xr=-127,Zr=null,sm={};const om=oc(sm,t=>{let e;async function l(){jl("/data.json").then(n=>n.json()).then(n=>{t(n),Xr!=n.t&&(Xr=n.t,setTimeout(Ac,2e3)),Zr!=n.p&&n.pe&&(Zr=n.p,setTimeout(um,1e3)),ul.upgrading?window.location.reload():(!ul||!ul.chip||ul.booting||ds>1&&!si(ul.board))&&(go(),rn&&clearTimeout(rn),rn=setTimeout(ko,2e3),an&&clearTimeout(an),an=setTimeout(wo,3e3));let i=5e3;if(si(ul.board)&&n.v>2.5){let o=3.3-Math.min(3.3,n.v);o>0&&(i=Math.max(o,.1)*10*5e3)}i>5e3&&console.log("Scheduling next data fetch in "+i+"ms"),e&&clearTimeout(e),e=setTimeout(l,i),ds=0}).catch(n=>{ds++,ds>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(l,15e3)):e=setTimeout(l,si(ul.board)?1e4:5e3)})}return l(),function(){clearTimeout(e)}});let lo={};const Pc=rt(lo);async function um(){lo=await(await jl("/energyprice.json")).json(),Pc.set(lo)}let no={},rn;async function ko(){rn&&(clearTimeout(rn),rn=0),no=await(await jl("/dayplot.json")).json(),Nc.set(no);let e=new Date;rn=setTimeout(ko,(60-e.getMinutes())*6e4+20)}const Nc=rt(no,t=>(ko(),function(){}));let io={},an;async function wo(){an&&(clearTimeout(an),an=0),io=await(await jl("/monthplot.json")).json(),Mc.set(io);let e=new Date;an=setTimeout(wo,(24-e.getHours())*36e5+40)}const Mc=rt(io,t=>(wo(),function(){}));let so={};async function Ac(){so=await(await jl("/temperature.json")).json(),Dc.set(so)}const Dc=rt(so,t=>(Ac(),function(){}));let oo={},vs;async function Ic(){vs&&(clearTimeout(vs),vs=0),oo=await(await jl("/tariff.json")).json(),Ec.set(oo);let e=new Date;vs=setTimeout(Ic,(60-e.getMinutes())*6e4+30)}const Ec=rt(oo,t=>function(){});let uo=[];const yo=rt(uo);async function rm(){uo=await(await jl("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),yo.set(uo)}function $s(t){return"WARNING: "+t+" must be connected to an external power supply during firmware upgrade. Failure to do so may cause power-down during upload resulting in non-functioning unit."}async function Fc(t){await(await fetch("/upgrade?expected_version="+t,{method:"POST"})).json()}function Rc(t,e){if(/^v\d{1,2}\.\d{1,2}\.\d{1,2}$/.test(t)){let l=t.substring(1).split("."),n=parseInt(l[0]),i=parseInt(l[1]),o=parseInt(l[2]),r=[...e];r.reverse();let a,f,c;for(let p=0;po&&(a=_):g==i+1&&(f=_);else if(v==n+1)if(c){let $=c.tag_name.substring(1).split(".");parseInt($[0]);let T=parseInt($[1]);parseInt($[2]),g==T&&(c=_)}else c=_}return f||c||a||!1}else return e[0]}const am="/github.svg";function Jr(t){let e,l;function n(r,a){return r[1]>1?vm:r[1]>0?dm:r[2]>1?_m:r[2]>0?pm:r[3]>1?mm:r[3]>0?cm:fm}let i=n(t),o=i(t);return{c(){e=C(`Up - `),o.c(),l=We()},m(r,a){y(r,e,a),o.m(r,a),y(r,l,a)},p(r,a){i===(i=n(r))&&o?o.p(r,a):(o.d(1),o=i(r),o&&(o.c(),o.m(l.parentNode,l)))},d(r){r&&w(e),o.d(r),r&&w(l)}}}function fm(t){let e,l;return{c(){e=C(t[0]),l=C(" seconds")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&1&&B(e,n[0])},d(n){n&&w(e),n&&w(l)}}}function cm(t){let e,l;return{c(){e=C(t[3]),l=C(" minute")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&8&&B(e,n[3])},d(n){n&&w(e),n&&w(l)}}}function mm(t){let e,l;return{c(){e=C(t[3]),l=C(" minutes")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&8&&B(e,n[3])},d(n){n&&w(e),n&&w(l)}}}function pm(t){let e,l;return{c(){e=C(t[2]),l=C(" hour")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&4&&B(e,n[2])},d(n){n&&w(e),n&&w(l)}}}function _m(t){let e,l;return{c(){e=C(t[2]),l=C(" hours")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&4&&B(e,n[2])},d(n){n&&w(e),n&&w(l)}}}function dm(t){let e,l;return{c(){e=C(t[1]),l=C(" day")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&2&&B(e,n[1])},d(n){n&&w(e),n&&w(l)}}}function vm(t){let e,l;return{c(){e=C(t[1]),l=C(" days")},m(n,i){y(n,e,i),y(n,l,i)},p(n,i){i&2&&B(e,n[1])},d(n){n&&w(e),n&&w(l)}}}function hm(t){let e,l=t[0]&&Jr(t);return{c(){l&&l.c(),e=We()},m(n,i){l&&l.m(n,i),y(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Jr(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:ne,o:ne,d(n){l&&l.d(n),n&&w(e)}}}function bm(t,e,l){let{epoch:n}=e,i=0,o=0,r=0;return t.$$set=a=>{"epoch"in a&&l(0,n=a.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(1,i=Math.floor(n/86400)),l(2,o=Math.floor(n/3600)),l(3,r=Math.floor(n/60)))},[n,i,o,r]}class gm extends Ce{constructor(e){super(),ye(this,e,bm,hm,ke,{epoch:0})}}function km(t){let e,l,n;return{c(){e=m("span"),l=C(t[2]),u(e,"title",t[1]),u(e,"class",n="bd-"+t[0])},m(i,o){y(i,e,o),s(e,l)},p(i,[o]){o&4&&B(l,i[2]),o&2&&u(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&u(e,"class",n)},i:ne,o:ne,d(i){i&&w(e)}}}function wm(t,e,l){let{color:n}=e,{title:i}=e,{text:o}=e;return t.$$set=r=>{"color"in r&&l(0,n=r.color),"title"in r&&l(1,i=r.title),"text"in r&&l(2,o=r.text)},[n,i,o]}class cl extends Ce{constructor(e){super(),ye(this,e,wm,km,ke,{color:0,title:1,text:2})}}function ym(t){let e,l=`${De(t[0].getDate())}.${De(t[0].getMonth()+1)}.${t[0].getFullYear()} ${De(t[0].getHours())}:${De(t[0].getMinutes())}`,n;return{c(){e=m("span"),n=C(l),u(e,"class",t[1])},m(i,o){y(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${De(i[0].getDate())}.${De(i[0].getMonth()+1)}.${i[0].getFullYear()} ${De(i[0].getHours())}:${De(i[0].getMinutes())}`)&&B(n,l),o&2&&u(e,"class",i[1])},d(i){i&&w(e)}}}function Cm(t){let e=`${De(t[0].getDate())}. ${to[t[0].getMonth()]} ${De(t[0].getHours())}:${De(t[0].getMinutes())}`,l;return{c(){l=C(e)},m(n,i){y(n,l,i)},p(n,i){i&1&&e!==(e=`${De(n[0].getDate())}. ${to[n[0].getMonth()]} ${De(n[0].getHours())}:${De(n[0].getMinutes())}`)&&B(l,e)},d(n){n&&w(l)}}}function $m(t){let e;function l(o,r){return o[2]?Cm:ym}let n=l(t),i=n(t);return{c(){i.c(),e=We()},m(o,r){i.m(o,r),y(o,e,r)},p(o,[r]){n===(n=l(o))&&i?i.p(o,r):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:ne,o:ne,d(o){i.d(o),o&&w(e)}}}function Tm(t,e,l){let{timestamp:n}=e,{fullTimeColor:i}=e,{offset:o}=e,r;return t.$$set=a=>{"timestamp"in a&&l(0,n=a.timestamp),"fullTimeColor"in a&&l(1,i=a.fullTimeColor),"offset"in a&&l(3,o=a.offset)},t.$$.update=()=>{t.$$.dirty&9&&(l(2,r=Math.abs(new Date().getTime()-n.getTime())<3e5),isNaN(o)||fl(n,o-(n.getHours()-n.getUTCHours())%24))},[n,i,r,o]}class Lc extends Ce{constructor(e){super(),ye(this,e,Tm,$m,ke,{timestamp:0,fullTimeColor:1,offset:3})}}function Sm(t){let e,l,n;return{c(){e=Oe("svg"),l=Oe("path"),n=Oe("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){y(i,e,o),s(e,l),s(e,n)},p:ne,i:ne,o:ne,d(i){i&&w(e)}}}class Pm extends Ce{constructor(e){super(),ye(this,e,null,Sm,ke,{})}}function Nm(t){let e,l;return{c(){e=Oe("svg"),l=Oe("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){y(n,e,i),s(e,l)},p:ne,i:ne,o:ne,d(n){n&&w(e)}}}class Mm extends Ce{constructor(e){super(),ye(this,e,null,Nm,ke,{})}}function Am(t){let e,l;return{c(){e=Oe("svg"),l=Oe("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){y(n,e,i),s(e,l)},p:ne,i:ne,o:ne,d(n){n&&w(e)}}}class Rt extends Ce{constructor(e){super(),ye(this,e,null,Am,ke,{})}}function Dm(t){let e,l;return{c(){e=Oe("svg"),l=Oe("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(l,"d","M9 8.25H7.5a2.25 2.25 0 00-2.25 2.25v9a2.25 2.25 0 002.25 2.25h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25H15M9 12l3 3m0 0l3-3m-3 3V2.25"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(n,i){y(n,e,i),s(e,l)},p:ne,i:ne,o:ne,d(n){n&&w(e)}}}class Uc extends Ce{constructor(e){super(),ye(this,e,null,Dm,ke,{})}}function Im(t){let e,l,n=t[1].version+"",i;return{c(){e=C("AMS reader "),l=m("span"),i=C(n)},m(o,r){y(o,e,r),y(o,l,r),s(l,i)},p(o,r){r&2&&n!==(n=o[1].version+"")&&B(i,n)},d(o){o&&w(e),o&&w(l)}}}function xr(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=m("div"),n=C(l),i=C("\xB0C"),u(e,"class","flex-none my-auto")},m(o,r){y(o,e,r),s(e,n),s(e,i)},p(o,r){r&1&&l!==(l=(o[0].t>-50?o[0].t.toFixed(1):"-")+"")&&B(n,l)},d(o){o&&w(e)}}}function ea(t){let e,l="HAN: "+Yr(t[0].he),n;return{c(){e=m("div"),n=C(l),u(e,"class","bd-red")},m(i,o){y(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="HAN: "+Yr(i[0].he))&&B(n,l)},d(i){i&&w(e)}}}function ta(t){let e,l="MQTT: "+Vr(t[0].me),n;return{c(){e=m("div"),n=C(l),u(e,"class","bd-red")},m(i,o){y(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="MQTT: "+Vr(i[0].me))&&B(n,l)},d(i){i&&w(e)}}}function la(t){let e,l="PriceAPI: "+Kr(t[0].ee),n;return{c(){e=m("div"),n=C(l),u(e,"class","bd-red")},m(i,o){y(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="PriceAPI: "+Kr(i[0].ee))&&B(n,l)},d(i){i&&w(e)}}}function na(t){let e,l,n,i,o,r;return l=new Ol({props:{to:"/configuration",$$slots:{default:[Em]},$$scope:{ctx:t}}}),o=new Ol({props:{to:"/status",$$slots:{default:[Fm]},$$scope:{ctx:t}}}),{c(){e=m("div"),J(l.$$.fragment),n=h(),i=m("div"),J(o.$$.fragment),u(e,"class","flex-none px-1 mt-1"),u(e,"title","Configuration"),u(i,"class","flex-none px-1 mt-1"),u(i,"title","Device information")},m(a,f){y(a,e,f),X(l,e,null),y(a,n,f),y(a,i,f),X(o,i,null),r=!0},i(a){r||(N(l.$$.fragment,a),N(o.$$.fragment,a),r=!0)},o(a){D(l.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&w(e),Z(l),a&&w(n),a&&w(i),Z(o)}}}function Em(t){let e,l;return e=new Pm({}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Fm(t){let e,l;return e=new Mm({}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function ia(t){let e,l,n,i,o;const r=[Lm,Rm],a=[];function f(c,p){return c[1].security==0||c[0].a?0:1}return l=f(t),n=a[l]=r[l](t),{c(){e=m("div"),n.c(),u(e,"class","flex-none mr-3 text-yellow-500"),u(e,"title",i="New version: "+t[2].tag_name)},m(c,p){y(c,e,p),a[l].m(e,null),o=!0},p(c,p){let _=l;l=f(c),l===_?a[l].p(c,p):(Te(),D(a[_],1,1,()=>{a[_]=null}),Se(),n=a[l],n?n.p(c,p):(n=a[l]=r[l](c),n.c()),N(n,1),n.m(e,null)),(!o||p&4&&i!==(i="New version: "+c[2].tag_name))&&u(e,"title",i)},i(c){o||(N(n),o=!0)},o(c){D(n),o=!1},d(c){c&&w(e),a[l].d()}}}function Rm(t){let e,l,n=t[2].tag_name+"",i;return{c(){e=m("span"),l=C("New version: "),i=C(n)},m(o,r){y(o,e,r),s(e,l),s(e,i)},p(o,r){r&4&&n!==(n=o[2].tag_name+"")&&B(i,n)},i:ne,o:ne,d(o){o&&w(e)}}}function Lm(t){let e,l,n,i=t[2].tag_name+"",o,r,a,f,c,p;return a=new Uc({}),{c(){e=m("button"),l=m("span"),n=C("New version: "),o=C(i),r=h(),J(a.$$.fragment),u(l,"class","mt-1"),u(e,"class","flex")},m(_,b){y(_,e,b),s(e,l),s(l,n),s(l,o),s(e,r),X(a,e,null),f=!0,c||(p=K(e,"click",t[3]),c=!0)},p(_,b){(!f||b&4)&&i!==(i=_[2].tag_name+"")&&B(o,i)},i(_){f||(N(a.$$.fragment,_),f=!0)},o(_){D(a.$$.fragment,_),f=!1},d(_){_&&w(e),Z(a),c=!1,p()}}}function Um(t){let e,l,n,i,o,r,a,f,c,p,_,b,d=(t[0].m?(t[0].m/1e3).toFixed(1):"-")+"",v,g,k,$,T,P,I,S,A,E,F,Y,U,R,q,z,O,H,G,L,W,j,te,le,de,ie,we,Ie,$e,Ee;i=new Ol({props:{to:"/",$$slots:{default:[Im]},$$scope:{ctx:t}}}),f=new gm({props:{epoch:t[0].u}});let ve=t[0].t>-50&&xr(t);T=new cl({props:{title:"ESP",text:t[1].booting?"Booting":t[0].v>2?t[0].v.toFixed(2)+"V":"ESP",color:Ul(t[1].booting?2:t[0].em)}}),I=new cl({props:{title:"HAN",text:"HAN",color:Ul(t[1].booting?9:t[0].hm)}}),A=new cl({props:{title:"WiFi",text:t[0].r?t[0].r.toFixed(0)+"dBm":"WiFi",color:Ul(t[1].booting?9:t[0].wm)}}),F=new cl({props:{title:"MQTT",text:"MQTT",color:Ul(t[1].booting?9:t[0].mm)}});let Pe=(t[0].he<0||t[0].he>0)&&ea(t),Ae=t[0].me<0&&ta(t),me=(t[0].ee>0||t[0].ee<0)&&la(t);te=new Lc({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),offset:t[1].clock_offset,fullTimeColor:"text-red-500"}});let se=t[1].vndcfg&&t[1].usrcfg&&na(t);Ie=new Rt({});let pe=t[1].fwconsent===1&&t[2]&&ia(t);return{c(){e=m("nav"),l=m("div"),n=m("div"),J(i.$$.fragment),o=h(),r=m("div"),a=m("div"),J(f.$$.fragment),c=h(),ve&&ve.c(),p=h(),_=m("div"),b=C("Free mem: "),v=C(d),g=C("kb"),k=h(),$=m("div"),J(T.$$.fragment),P=h(),J(I.$$.fragment),S=h(),J(A.$$.fragment),E=h(),J(F.$$.fragment),Y=h(),Pe&&Pe.c(),U=h(),Ae&&Ae.c(),R=h(),me&&me.c(),q=h(),z=m("div"),O=m("div"),H=m("a"),G=m("img"),W=h(),j=m("div"),J(te.$$.fragment),le=h(),se&&se.c(),de=h(),ie=m("div"),we=m("a"),J(Ie.$$.fragment),$e=h(),pe&&pe.c(),u(n,"class","flex text-lg text-gray-100 p-2"),u(a,"class","flex-none my-auto"),u(_,"class","flex-none my-auto"),u(r,"class","flex-none my-auto p-2 flex space-x-4"),u($,"class","flex-auto flex-wrap my-auto justify-center p-2"),u(G,"class","gh-logo"),Bc(G.src,L=am)||u(G,"src",L),u(G,"alt","GitHub repo"),u(H,"class","float-right"),u(H,"href","https://github.com/UtilitechAS/amsreader-firmware"),u(H,"target","_blank"),u(H,"rel","noreferrer"),u(H,"aria-label","GitHub"),u(O,"class","flex-none"),u(j,"class","flex-none my-auto px-2"),u(we,"href",Lt("")),u(we,"target","_blank"),u(we,"rel","noreferrer"),u(ie,"class","flex-none px-1 mt-1"),u(ie,"title","Documentation"),u(z,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),u(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),u(e,"class","bg-violet-600 p-1 rounded-md mx-2")},m(Q,oe){y(Q,e,oe),s(e,l),s(l,n),X(i,n,null),s(l,o),s(l,r),s(r,a),X(f,a,null),s(r,c),ve&&ve.m(r,null),s(r,p),s(r,_),s(_,b),s(_,v),s(_,g),s(l,k),s(l,$),X(T,$,null),s($,P),X(I,$,null),s($,S),X(A,$,null),s($,E),X(F,$,null),s(l,Y),Pe&&Pe.m(l,null),s(l,U),Ae&&Ae.m(l,null),s(l,R),me&&me.m(l,null),s(l,q),s(l,z),s(z,O),s(O,H),s(H,G),s(z,W),s(z,j),X(te,j,null),s(z,le),se&&se.m(z,null),s(z,de),s(z,ie),s(ie,we),X(Ie,we,null),s(z,$e),pe&&pe.m(z,null),Ee=!0},p(Q,[oe]){const Ne={};oe&18&&(Ne.$$scope={dirty:oe,ctx:Q}),i.$set(Ne);const Me={};oe&1&&(Me.epoch=Q[0].u),f.$set(Me),Q[0].t>-50?ve?ve.p(Q,oe):(ve=xr(Q),ve.c(),ve.m(r,p)):ve&&(ve.d(1),ve=null),(!Ee||oe&1)&&d!==(d=(Q[0].m?(Q[0].m/1e3).toFixed(1):"-")+"")&&B(v,d);const he={};oe&3&&(he.text=Q[1].booting?"Booting":Q[0].v>2?Q[0].v.toFixed(2)+"V":"ESP"),oe&3&&(he.color=Ul(Q[1].booting?2:Q[0].em)),T.$set(he);const x={};oe&3&&(x.color=Ul(Q[1].booting?9:Q[0].hm)),I.$set(x);const _e={};oe&1&&(_e.text=Q[0].r?Q[0].r.toFixed(0)+"dBm":"WiFi"),oe&3&&(_e.color=Ul(Q[1].booting?9:Q[0].wm)),A.$set(_e);const Le={};oe&3&&(Le.color=Ul(Q[1].booting?9:Q[0].mm)),F.$set(Le),Q[0].he<0||Q[0].he>0?Pe?Pe.p(Q,oe):(Pe=ea(Q),Pe.c(),Pe.m(l,U)):Pe&&(Pe.d(1),Pe=null),Q[0].me<0?Ae?Ae.p(Q,oe):(Ae=ta(Q),Ae.c(),Ae.m(l,R)):Ae&&(Ae.d(1),Ae=null),Q[0].ee>0||Q[0].ee<0?me?me.p(Q,oe):(me=la(Q),me.c(),me.m(l,q)):me&&(me.d(1),me=null);const je={};oe&1&&(je.timestamp=Q[0].c?new Date(Q[0].c*1e3):new Date(0)),oe&2&&(je.offset=Q[1].clock_offset),te.$set(je),Q[1].vndcfg&&Q[1].usrcfg?se?oe&2&&N(se,1):(se=na(Q),se.c(),N(se,1),se.m(z,de)):se&&(Te(),D(se,1,1,()=>{se=null}),Se()),Q[1].fwconsent===1&&Q[2]?pe?(pe.p(Q,oe),oe&6&&N(pe,1)):(pe=ia(Q),pe.c(),N(pe,1),pe.m(z,null)):pe&&(Te(),D(pe,1,1,()=>{pe=null}),Se())},i(Q){Ee||(N(i.$$.fragment,Q),N(f.$$.fragment,Q),N(T.$$.fragment,Q),N(I.$$.fragment,Q),N(A.$$.fragment,Q),N(F.$$.fragment,Q),N(te.$$.fragment,Q),N(se),N(Ie.$$.fragment,Q),N(pe),Ee=!0)},o(Q){D(i.$$.fragment,Q),D(f.$$.fragment,Q),D(T.$$.fragment,Q),D(I.$$.fragment,Q),D(A.$$.fragment,Q),D(F.$$.fragment,Q),D(te.$$.fragment,Q),D(se),D(Ie.$$.fragment,Q),D(pe),Ee=!1},d(Q){Q&&w(e),Z(i),Z(f),ve&&ve.d(),Z(T),Z(I),Z(A),Z(F),Pe&&Pe.d(),Ae&&Ae.d(),me&&me.d(),Z(te),se&&se.d(),Z(Ie),pe&&pe.d()}}}function Om(t,e,l){let{data:n={}}=e,i={},o={};function r(){confirm("Do you want to upgrade this device to "+o.tag_name+"?")&&(!si(i.board)||confirm($s(fe(i.chip,i.board))))&&(Ut.update(a=>(a.upgrading=!0,a)),Fc(o.tag_name))}return Ut.subscribe(a=>{l(1,i=a),a.fwconsent===1&&rm()}),yo.subscribe(a=>{l(2,o=Rc(i.version,a))}),t.$$set=a=>{"data"in a&&l(0,n=a.data)},[n,i,o,r]}class qm extends Ce{constructor(e){super(),ye(this,e,Om,Um,ke,{data:0})}}function Hm(t){let e,l,n,i;return{c(){e=Oe("svg"),l=Oe("path"),n=Oe("path"),u(l,"d",Xs(150,150,115,210,510)),u(l,"stroke","#eee"),u(l,"fill","none"),u(l,"stroke-width","55"),u(n,"d",i=Xs(150,150,115,210,210+300*t[0]/100)),u(n,"stroke",t[1]),u(n,"fill","none"),u(n,"stroke-width","55"),u(e,"viewBox","0 0 300 300"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"height","100%")},m(o,r){y(o,e,r),s(e,l),s(e,n)},p(o,[r]){r&1&&i!==(i=Xs(150,150,115,210,210+300*o[0]/100))&&u(n,"d",i),r&2&&u(n,"stroke",o[1])},i:ne,o:ne,d(o){o&&w(e)}}}function sa(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 Xs(t,e,l,n,i){var o=sa(t,e,l,i),r=sa(t,e,l,n),a=i-n<=180?"0":"1",f=["M",o.x,o.y,"A",l,l,0,a,0,r.x,r.y].join(" ");return f}function jm(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 Wm extends Ce{constructor(e){super(),ye(this,e,jm,Hm,ke,{pct:0,color:1})}}function oa(t){let e,l,n,i,o,r,a,f;return{c(){e=m("br"),l=h(),n=m("span"),i=C(t[3]),o=h(),r=m("span"),a=C(t[4]),f=C("/kWh"),u(n,"class","pl-sub"),u(r,"class","pl-snt")},m(c,p){y(c,e,p),y(c,l,p),y(c,n,p),s(n,i),y(c,o,p),y(c,r,p),s(r,a),s(r,f)},p(c,p){p&8&&B(i,c[3]),p&16&&B(a,c[4])},d(c){c&&w(e),c&&w(l),c&&w(n),c&&w(o),c&&w(r)}}}function Gm(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,k;l=new Wm({props:{pct:t[6],color:t[5](t[6])}});let $=t[3]&&oa(t);return{c(){e=m("div"),J(l.$$.fragment),n=h(),i=m("span"),o=m("span"),r=C(t[2]),a=h(),f=m("br"),c=h(),p=m("span"),_=C(t[0]),b=h(),d=m("span"),v=C(t[1]),g=h(),$&&$.c(),u(o,"class","pl-lab"),u(p,"class","pl-val"),u(d,"class","pl-unt"),u(i,"class","pl-ov"),u(e,"class","pl-root")},m(T,P){y(T,e,P),X(l,e,null),s(e,n),s(e,i),s(i,o),s(o,r),s(i,a),s(i,f),s(i,c),s(i,p),s(p,_),s(i,b),s(i,d),s(d,v),s(i,g),$&&$.m(i,null),k=!0},p(T,[P]){const I={};P&64&&(I.pct=T[6]),P&96&&(I.color=T[5](T[6])),l.$set(I),(!k||P&4)&&B(r,T[2]),(!k||P&1)&&B(_,T[0]),(!k||P&2)&&B(v,T[1]),T[3]?$?$.p(T,P):($=oa(T),$.c(),$.m(i,null)):$&&($.d(1),$=null)},i(T){k||(N(l.$$.fragment,T),k=!0)},o(T){D(l.$$.fragment,T),k=!1},d(T){T&&w(e),Z(l),$&&$.d()}}}function Bm(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:r}=e,{sub:a=""}=e,{subunit:f=""}=e,{colorFn:c}=e,p=0;return t.$$set=_=>{"val"in _&&l(0,n=_.val),"max"in _&&l(7,i=_.max),"unit"in _&&l(1,o=_.unit),"label"in _&&l(2,r=_.label),"sub"in _&&l(3,a=_.sub),"subunit"in _&&l(4,f=_.subunit),"colorFn"in _&&l(5,c=_.colorFn)},t.$$.update=()=>{t.$$.dirty&129&&l(6,p=Math.min(n,i)/i*100)},[n,o,r,a,f,c,p,i]}class Oc extends Ce{constructor(e){super(),ye(this,e,Bm,Gm,ke,{val:0,max:7,unit:1,label:2,sub:3,subunit:4,colorFn:5})}}function ua(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function ra(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function aa(t,e,l){const n=t.slice();return n[13]=e[l],n}function fa(t){let e,l,n,i,o,r=t[0].title&&ca(t),a=t[0].y.ticks,f=[];for(let d=0;d20||t[11]%2==0)&&da(t);return{c(){e=Oe("g"),n&&n.c(),u(e,"class","tick"),u(e,"transform",l="translate("+t[5](t[11])+","+t[4]+")")},m(i,o){y(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[11]%2==0?n?n.p(i,o):(n=da(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&48&&l!==(l="translate("+i[5](i[11])+","+i[4]+")")&&u(e,"transform",l)},d(i){i&&w(e),n&&n.d()}}}function da(t){let e,l=t[9].label+"",n,i;return{c(){e=Oe("text"),n=C(l),u(e,"x",i=t[3]/2),u(e,"y","-4")},m(o,r){y(o,e,r),s(e,n)},p(o,r){r&1&&l!==(l=o[9].label+"")&&B(n,l),r&8&&i!==(i=o[3]/2)&&u(e,"x",i)},d(o){o&&w(e)}}}function va(t){let e=!isNaN(t[5](t[11])),l,n=e&&_a(t);return{c(){n&&n.c(),l=We()},m(i,o){n&&n.m(i,o),y(i,l,o)},p(i,o){o&32&&(e=!isNaN(i[5](i[11]))),e?n?n.p(i,o):(n=_a(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&w(l)}}}function ha(t){let e,l,n=t[9].value!==void 0&&ba(t),i=t[9].value2>1e-4&&wa(t);return{c(){e=Oe("g"),n&&n.c(),l=Oe("g"),i&&i.c()},m(o,r){y(o,e,r),n&&n.m(e,null),y(o,l,r),i&&i.m(l,null)},p(o,r){o[9].value!==void 0?n?n.p(o,r):(n=ba(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[9].value2>1e-4?i?i.p(o,r):(i=wa(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&w(e),n&&n.d(),o&&w(l),i&&i.d()}}}function ba(t){let e,l,n,i,o,r,a,f=t[3]>15&&ga(t);return{c(){e=Oe("rect"),f&&f.c(),a=We(),u(e,"x",l=t[5](t[11])+2),u(e,"y",n=t[6](t[9].value)),u(e,"width",i=t[3]-4),u(e,"height",o=t[6](t[0].y.min)-t[6](Math.min(t[0].y.min,0)+t[9].value)),u(e,"fill",r=t[9].color)},m(c,p){y(c,e,p),f&&f.m(c,p),y(c,a,p)},p(c,p){p&32&&l!==(l=c[5](c[11])+2)&&u(e,"x",l),p&65&&n!==(n=c[6](c[9].value))&&u(e,"y",n),p&8&&i!==(i=c[3]-4)&&u(e,"width",i),p&65&&o!==(o=c[6](c[0].y.min)-c[6](Math.min(c[0].y.min,0)+c[9].value))&&u(e,"height",o),p&1&&r!==(r=c[9].color)&&u(e,"fill",r),c[3]>15?f?f.p(c,p):(f=ga(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&w(e),f&&f.d(c),c&&w(a)}}}function ga(t){let e,l=t[9].label+"",n,i,o,r,a,f,c=t[9].title&&ka(t);return{c(){e=Oe("text"),n=C(l),c&&c.c(),f=We(),u(e,"width",i=t[3]-4),u(e,"dominant-baseline","middle"),u(e,"text-anchor",o=t[3]t[6](0)-t[7]?t[9].color:"white"),u(e,"transform",a="translate("+(t[5](t[11])+t[3]/2)+" "+(t[6](t[9].value)>t[6](0)-t[7]?t[6](t[9].value)-t[7]:t[6](t[9].value)+10)+") rotate("+(t[3]p[6](0)-p[7]?p[9].color:"white")&&u(e,"fill",r),_&233&&a!==(a="translate("+(p[5](p[11])+p[3]/2)+" "+(p[6](p[9].value)>p[6](0)-p[7]?p[6](p[9].value)-p[7]:p[6](p[9].value)+10)+") rotate("+(p[3]15&&ya(t);return{c(){e=Oe("rect"),f&&f.c(),a=We(),u(e,"x",l=t[5](t[11])+2),u(e,"y",n=t[6](0)),u(e,"width",i=t[3]-4),u(e,"height",o=t[6](t[0].y.min)-t[6](t[0].y.min+t[9].value2)),u(e,"fill",r=t[9].color)},m(c,p){y(c,e,p),f&&f.m(c,p),y(c,a,p)},p(c,p){p&32&&l!==(l=c[5](c[11])+2)&&u(e,"x",l),p&64&&n!==(n=c[6](0))&&u(e,"y",n),p&8&&i!==(i=c[3]-4)&&u(e,"width",i),p&65&&o!==(o=c[6](c[0].y.min)-c[6](c[0].y.min+c[9].value2))&&u(e,"height",o),p&1&&r!==(r=c[9].color)&&u(e,"fill",r),c[3]>15?f?f.p(c,p):(f=ya(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&w(e),f&&f.d(c),c&&w(a)}}}function ya(t){let e,l=t[9].label2+"",n,i,o,r,a,f=t[9].title2&&Ca(t);return{c(){e=Oe("text"),n=C(l),f&&f.c(),a=We(),u(e,"width",i=t[3]-4),u(e,"dominant-baseline","middle"),u(e,"text-anchor","middle"),u(e,"fill",o=t[6](-t[9].value2)t[8].call(e))},m(i,o){y(i,e,o),n&&n.m(e,null),l=Kc(e,t[8].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=fa(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:ne,o:ne,d(i){i&&w(e),n&&n.d(),l()}}}let fn=30;function Ym(t,e,l){let{config:n}=e,i,o,r,a,f,c,p;function _(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return t.$$set=b=>{"config"in b&&l(0,n=b.config)},t.$$.update=()=>{if(t.$$.dirty&31){l(4,c=o-(n.title?20:0));let b=i-(n.padding.left+n.padding.right);l(3,r=b/n.points.length),l(7,p=rn.y.max?g=n.padding.bottom:vc||g<0?0:g})}},[n,i,o,r,c,a,f,p,_]}class mn extends Ce{constructor(e){super(),ye(this,e,Ym,zm,ke,{config:0})}}function Vm(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Km(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{ds:r}=e,a={};function f(c){return{label:ce(c)+"V",title:c.toFixed(1)+" V",value:isNaN(c)?0:c,color:nm(c||0)}}return t.$$set=c=>{"u1"in c&&l(1,n=c.u1),"u2"in c&&l(2,i=c.u2),"u3"in c&&l(3,o=c.u3),"ds"in c&&l(4,r=c.ds)},t.$$.update=()=>{if(t.$$.dirty&30){let c=[],p=[];n>0&&(c.push({label:r===1?"L1-L2":"L1"}),p.push(f(n))),i>0&&(c.push({label:r===1?"L1-L3":"L2"}),p.push(f(i))),o>0&&(c.push({label:r===1?"L2-L3":"L3"}),p.push(f(o))),l(0,a={padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:c},points:p})}},[a,n,i,o,r]}class Qm extends Ce{constructor(e){super(),ye(this,e,Km,Vm,ke,{u1:1,u2:2,u3:3,ds:4})}}function Xm(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Zm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{i1:r}=e,{i2:a}=e,{i3:f}=e,{max:c}=e,p={};function _(b){return{label:ce(b)+"A",title:b.toFixed(1)+" A",value:isNaN(b)?0:b,color:Sc(b?b/c*100:0)}}return t.$$set=b=>{"u1"in b&&l(1,n=b.u1),"u2"in b&&l(2,i=b.u2),"u3"in b&&l(3,o=b.u3),"i1"in b&&l(4,r=b.i1),"i2"in b&&l(5,a=b.i2),"i3"in b&&l(6,f=b.i3),"max"in b&&l(7,c=b.max)},t.$$.update=()=>{if(t.$$.dirty&254){let b=[],d=[];n>0&&(b.push({label:"L1"}),d.push(_(r))),i>0&&(b.push({label:"L2"}),d.push(_(a))),o>0&&(b.push({label:"L3"}),d.push(_(f))),l(0,p={padding:{top:20,right:15,bottom:20,left:35},y:{min:0,max:c,ticks:[{value:0,label:"0%"},{value:c/4,label:"25%"},{value:c/2,label:"50%"},{value:c/4*3,label:"75%"},{value:c,label:"100%"}]},x:{ticks:b},points:d})}},[p,n,i,o,r,a,f,c]}class Jm extends Ce{constructor(e){super(),ye(this,e,Zm,Xm,ke,{u1:1,u2:2,u3:3,i1:4,i2:5,i3:6,max:7})}}function xm(t){let e,l,n,i,o,r,a,f=(typeof t[0]<"u"?t[0].toFixed(0):"-")+"",c,p,_,b,d,v,g=(typeof t[1]<"u"?t[1].toFixed(0):"-")+"",k,$,T,P,I,S,A,E=(typeof t[2]<"u"?t[2].toFixed(1):"-")+"",F,Y,U,R,q,z,O=(typeof t[3]<"u"?t[3].toFixed(1):"-")+"",H,G;return{c(){e=m("div"),l=m("strong"),l.textContent="Reactive",n=h(),i=m("div"),o=m("div"),o.textContent="Instant in",r=h(),a=m("div"),c=C(f),p=C(" VAr"),_=h(),b=m("div"),b.textContent="Instant out",d=h(),v=m("div"),k=C(g),$=C(" VAr"),T=h(),P=m("div"),I=m("div"),I.textContent="Total in",S=h(),A=m("div"),F=C(E),Y=C(" kVArh"),U=h(),R=m("div"),R.textContent="Total out",q=h(),z=m("div"),H=C(O),G=C(" kVArh"),u(a,"class","text-right"),u(v,"class","text-right"),u(i,"class","grid grid-cols-2 mt-4"),u(A,"class","text-right"),u(z,"class","text-right"),u(P,"class","grid grid-cols-2 mt-4"),u(e,"class","mx-2 text-sm")},m(L,W){y(L,e,W),s(e,l),s(e,n),s(e,i),s(i,o),s(i,r),s(i,a),s(a,c),s(a,p),s(i,_),s(i,b),s(i,d),s(i,v),s(v,k),s(v,$),s(e,T),s(e,P),s(P,I),s(P,S),s(P,A),s(A,F),s(A,Y),s(P,U),s(P,R),s(P,q),s(P,z),s(z,H),s(z,G)},p(L,[W]){W&1&&f!==(f=(typeof L[0]<"u"?L[0].toFixed(0):"-")+"")&&B(c,f),W&2&&g!==(g=(typeof L[1]<"u"?L[1].toFixed(0):"-")+"")&&B(k,g),W&4&&E!==(E=(typeof L[2]<"u"?L[2].toFixed(1):"-")+"")&&B(F,E),W&8&&O!==(O=(typeof L[3]<"u"?L[3].toFixed(1):"-")+"")&&B(H,O)},i:ne,o:ne,d(L){L&&w(e)}}}function ep(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:o}=e,{exportTotal:r}=e;return t.$$set=a=>{"importInstant"in a&&l(0,n=a.importInstant),"exportInstant"in a&&l(1,i=a.exportInstant),"importTotal"in a&&l(2,o=a.importTotal),"exportTotal"in a&&l(3,r=a.exportTotal)},[n,i,o,r]}class tp extends Ce{constructor(e){super(),ye(this,e,ep,xm,ke,{importInstant:0,exportInstant:1,importTotal:2,exportTotal:3})}}function Ta(t){let e;function l(o,r){return o[3]?np:lp}let n=l(t),i=n(t);return{c(){i.c(),e=We()},m(o,r){i.m(o,r),y(o,e,r)},p(o,r){n===(n=l(o))&&i?i.p(o,r):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&w(e)}}}function lp(t){let e,l,n,i,o,r,a=ce(t[1].h.u,2)+"",f,c,p,_,b,d,v=ce(t[1].d.u,1)+"",g,k,$,T,P,I,S=ce(t[1].m.u)+"",A,E,F,Y,U,R,q=ce(t[0].last_month.u)+"",z,O,H,G,L=t[4]&&Sa(t);return{c(){e=m("strong"),e.textContent="Consumption",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),r=m("div"),f=C(a),c=C(" kWh"),p=h(),_=m("div"),_.textContent="Day",b=h(),d=m("div"),g=C(v),k=C(" kWh"),$=h(),T=m("div"),T.textContent="Month",P=h(),I=m("div"),A=C(S),E=C(" kWh"),F=h(),Y=m("div"),Y.textContent="Last month",U=h(),R=m("div"),z=C(q),O=C(" kWh"),H=h(),L&&L.c(),G=We(),u(r,"class","text-right"),u(d,"class","text-right"),u(I,"class","text-right"),u(R,"class","text-right"),u(n,"class","grid grid-cols-2 mb-3")},m(W,j){y(W,e,j),y(W,l,j),y(W,n,j),s(n,i),s(n,o),s(n,r),s(r,f),s(r,c),s(n,p),s(n,_),s(n,b),s(n,d),s(d,g),s(d,k),s(n,$),s(n,T),s(n,P),s(n,I),s(I,A),s(I,E),s(n,F),s(n,Y),s(n,U),s(n,R),s(R,z),s(R,O),y(W,H,j),L&&L.m(W,j),y(W,G,j)},p(W,j){j&2&&a!==(a=ce(W[1].h.u,2)+"")&&B(f,a),j&2&&v!==(v=ce(W[1].d.u,1)+"")&&B(g,v),j&2&&S!==(S=ce(W[1].m.u)+"")&&B(A,S),j&1&&q!==(q=ce(W[0].last_month.u)+"")&&B(z,q),W[4]?L?L.p(W,j):(L=Sa(W),L.c(),L.m(G.parentNode,G)):L&&(L.d(1),L=null)},d(W){W&&w(e),W&&w(l),W&&w(n),W&&w(H),L&&L.d(W),W&&w(G)}}}function np(t){let e,l,n,i,o,r,a=ce(t[1].h.u,2)+"",f,c,p,_,b,d,v,g=ce(t[1].d.u,1)+"",k,$,T,P,I,S,A,E=ce(t[1].m.u)+"",F,Y,U,R,q,z,O,H=ce(t[0].last_month.u)+"",G,L,W,j,te,le,de,ie,we,Ie,$e,Ee=ce(t[1].h.p,2)+"",ve,Pe,Ae,me,se,pe,Q,oe=ce(t[1].d.p,1)+"",Ne,Me,he,x,_e,Le,je,Ke=ce(t[1].m.p)+"",Fe,He,re,ge,Ot,Wl,xt,ft=ce(t[0].last_month.p)+"",Nl,_l,qt,pt,Qe=t[4]&&Pa(t),Xe=t[4]&&Na(t),Ze=t[4]&&Ma(t),Ue=t[4]&&Aa(t),Je=t[4]&&Da(t),Ge=t[4]&&Ia(t),xe=t[4]&&Ea(t),et=t[4]&&Fa(t);return{c(){e=m("strong"),e.textContent="Import",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),r=m("div"),f=C(a),c=C(" kWh"),p=h(),Qe&&Qe.c(),_=h(),b=m("div"),b.textContent="Day",d=h(),v=m("div"),k=C(g),$=C(" kWh"),T=h(),Xe&&Xe.c(),P=h(),I=m("div"),I.textContent="Month",S=h(),A=m("div"),F=C(E),Y=C(" kWh"),U=h(),Ze&&Ze.c(),R=h(),q=m("div"),q.textContent="Last mo.",z=h(),O=m("div"),G=C(H),L=C(" kWh"),W=h(),Ue&&Ue.c(),te=h(),le=m("strong"),le.textContent="Export",de=h(),ie=m("div"),we=m("div"),we.textContent="Hour",Ie=h(),$e=m("div"),ve=C(Ee),Pe=C(" kWh"),Ae=h(),Je&&Je.c(),me=h(),se=m("div"),se.textContent="Day",pe=h(),Q=m("div"),Ne=C(oe),Me=C(" kWh"),he=h(),Ge&&Ge.c(),x=h(),_e=m("div"),_e.textContent="Month",Le=h(),je=m("div"),Fe=C(Ke),He=C(" kWh"),re=h(),xe&&xe.c(),ge=h(),Ot=m("div"),Ot.textContent="Last mo.",Wl=h(),xt=m("div"),Nl=C(ft),_l=C(" kWh"),qt=h(),et&&et.c(),u(r,"class","text-right"),u(v,"class","text-right"),u(A,"class","text-right"),u(O,"class","text-right"),u(n,"class",j="grid grid-cols-"+t[5]+" mb-3"),u($e,"class","text-right"),u(Q,"class","text-right"),u(je,"class","text-right"),u(xt,"class","text-right"),u(ie,"class",pt="grid grid-cols-"+t[5])},m(ue,be){y(ue,e,be),y(ue,l,be),y(ue,n,be),s(n,i),s(n,o),s(n,r),s(r,f),s(r,c),s(n,p),Qe&&Qe.m(n,null),s(n,_),s(n,b),s(n,d),s(n,v),s(v,k),s(v,$),s(n,T),Xe&&Xe.m(n,null),s(n,P),s(n,I),s(n,S),s(n,A),s(A,F),s(A,Y),s(n,U),Ze&&Ze.m(n,null),s(n,R),s(n,q),s(n,z),s(n,O),s(O,G),s(O,L),s(n,W),Ue&&Ue.m(n,null),y(ue,te,be),y(ue,le,be),y(ue,de,be),y(ue,ie,be),s(ie,we),s(ie,Ie),s(ie,$e),s($e,ve),s($e,Pe),s(ie,Ae),Je&&Je.m(ie,null),s(ie,me),s(ie,se),s(ie,pe),s(ie,Q),s(Q,Ne),s(Q,Me),s(ie,he),Ge&&Ge.m(ie,null),s(ie,x),s(ie,_e),s(ie,Le),s(ie,je),s(je,Fe),s(je,He),s(ie,re),xe&&xe.m(ie,null),s(ie,ge),s(ie,Ot),s(ie,Wl),s(ie,xt),s(xt,Nl),s(xt,_l),s(ie,qt),et&&et.m(ie,null)},p(ue,be){be&2&&a!==(a=ce(ue[1].h.u,2)+"")&&B(f,a),ue[4]?Qe?Qe.p(ue,be):(Qe=Pa(ue),Qe.c(),Qe.m(n,_)):Qe&&(Qe.d(1),Qe=null),be&2&&g!==(g=ce(ue[1].d.u,1)+"")&&B(k,g),ue[4]?Xe?Xe.p(ue,be):(Xe=Na(ue),Xe.c(),Xe.m(n,P)):Xe&&(Xe.d(1),Xe=null),be&2&&E!==(E=ce(ue[1].m.u)+"")&&B(F,E),ue[4]?Ze?Ze.p(ue,be):(Ze=Ma(ue),Ze.c(),Ze.m(n,R)):Ze&&(Ze.d(1),Ze=null),be&1&&H!==(H=ce(ue[0].last_month.u)+"")&&B(G,H),ue[4]?Ue?Ue.p(ue,be):(Ue=Aa(ue),Ue.c(),Ue.m(n,null)):Ue&&(Ue.d(1),Ue=null),be&32&&j!==(j="grid grid-cols-"+ue[5]+" mb-3")&&u(n,"class",j),be&2&&Ee!==(Ee=ce(ue[1].h.p,2)+"")&&B(ve,Ee),ue[4]?Je?Je.p(ue,be):(Je=Da(ue),Je.c(),Je.m(ie,me)):Je&&(Je.d(1),Je=null),be&2&&oe!==(oe=ce(ue[1].d.p,1)+"")&&B(Ne,oe),ue[4]?Ge?Ge.p(ue,be):(Ge=Ia(ue),Ge.c(),Ge.m(ie,x)):Ge&&(Ge.d(1),Ge=null),be&2&&Ke!==(Ke=ce(ue[1].m.p)+"")&&B(Fe,Ke),ue[4]?xe?xe.p(ue,be):(xe=Ea(ue),xe.c(),xe.m(ie,ge)):xe&&(xe.d(1),xe=null),be&1&&ft!==(ft=ce(ue[0].last_month.p)+"")&&B(Nl,ft),ue[4]?et?et.p(ue,be):(et=Fa(ue),et.c(),et.m(ie,null)):et&&(et.d(1),et=null),be&32&&pt!==(pt="grid grid-cols-"+ue[5])&&u(ie,"class",pt)},d(ue){ue&&w(e),ue&&w(l),ue&&w(n),Qe&&Qe.d(),Xe&&Xe.d(),Ze&&Ze.d(),Ue&&Ue.d(),ue&&w(te),ue&&w(le),ue&&w(de),ue&&w(ie),Je&&Je.d(),Ge&&Ge.d(),xe&&xe.d(),et&&et.d()}}}function Sa(t){let e,l,n,i,o,r,a=ce(t[1].h.c,2)+"",f,c,p,_,b,d,v,g=ce(t[1].d.c,1)+"",k,$,T,P,I,S,A,E=ce(t[1].m.c)+"",F,Y,U,R,q,z,O,H=ce(t[0].last_month.c)+"",G,L,W;return{c(){e=m("strong"),e.textContent="Cost",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),r=m("div"),f=C(a),c=h(),p=C(t[2]),_=h(),b=m("div"),b.textContent="Day",d=h(),v=m("div"),k=C(g),$=h(),T=C(t[2]),P=h(),I=m("div"),I.textContent="Month",S=h(),A=m("div"),F=C(E),Y=h(),U=C(t[2]),R=h(),q=m("div"),q.textContent="Last month",z=h(),O=m("div"),G=C(H),L=h(),W=C(t[2]),u(r,"class","text-right"),u(v,"class","text-right"),u(A,"class","text-right"),u(O,"class","text-right"),u(n,"class","grid grid-cols-2")},m(j,te){y(j,e,te),y(j,l,te),y(j,n,te),s(n,i),s(n,o),s(n,r),s(r,f),s(r,c),s(r,p),s(n,_),s(n,b),s(n,d),s(n,v),s(v,k),s(v,$),s(v,T),s(n,P),s(n,I),s(n,S),s(n,A),s(A,F),s(A,Y),s(A,U),s(n,R),s(n,q),s(n,z),s(n,O),s(O,G),s(O,L),s(O,W)},p(j,te){te&2&&a!==(a=ce(j[1].h.c,2)+"")&&B(f,a),te&4&&B(p,j[2]),te&2&&g!==(g=ce(j[1].d.c,1)+"")&&B(k,g),te&4&&B(T,j[2]),te&2&&E!==(E=ce(j[1].m.c)+"")&&B(F,E),te&4&&B(U,j[2]),te&1&&H!==(H=ce(j[0].last_month.c)+"")&&B(G,H),te&4&&B(W,j[2])},d(j){j&&w(e),j&&w(l),j&&w(n)}}}function Pa(t){let e,l=ce(t[1].h.c,2)+"",n,i,o;return{c(){e=m("div"),n=C(l),i=h(),o=C(t[2]),u(e,"class","text-right")},m(r,a){y(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].h.c,2)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&w(e)}}}function Na(t){let e,l=ce(t[1].d.c,1)+"",n,i,o;return{c(){e=m("div"),n=C(l),i=h(),o=C(t[2]),u(e,"class","text-right")},m(r,a){y(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].d.c,1)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&w(e)}}}function Ma(t){let e,l=ce(t[1].m.c)+"",n,i,o;return{c(){e=m("div"),n=C(l),i=h(),o=C(t[2]),u(e,"class","text-right")},m(r,a){y(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].m.c)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&w(e)}}}function Aa(t){let e,l=ce(t[0].last_month.c)+"",n,i,o;return{c(){e=m("div"),n=C(l),i=h(),o=C(t[2]),u(e,"class","text-right")},m(r,a){y(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&1&&l!==(l=ce(r[0].last_month.c)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&w(e)}}}function Da(t){let e,l=ce(t[1].h.i,2)+"",n,i,o;return{c(){e=m("div"),n=C(l),i=h(),o=C(t[2]),u(e,"class","text-right")},m(r,a){y(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].h.i,2)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&w(e)}}}function Ia(t){let e,l=ce(t[1].d.i,1)+"",n,i,o;return{c(){e=m("div"),n=C(l),i=h(),o=C(t[2]),u(e,"class","text-right")},m(r,a){y(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].d.i,1)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&w(e)}}}function Ea(t){let e,l=ce(t[1].m.i)+"",n,i,o;return{c(){e=m("div"),n=C(l),i=h(),o=C(t[2]),u(e,"class","text-right")},m(r,a){y(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=ce(r[1].m.i)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&w(e)}}}function Fa(t){let e,l=ce(t[0].last_month.i)+"",n,i,o;return{c(){e=m("div"),n=C(l),i=h(),o=C(t[2]),u(e,"class","text-right")},m(r,a){y(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&1&&l!==(l=ce(r[0].last_month.i)+"")&&B(n,l),a&4&&B(o,r[2])},d(r){r&&w(e)}}}function ip(t){let e,l,n,i,o,r,a=t[1]&&Ta(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Real time calculation",n=h(),i=m("br"),o=m("br"),r=h(),a&&a.c(),u(e,"class","mx-2 text-sm")},m(f,c){y(f,e,c),s(e,l),s(e,n),s(e,i),s(e,o),s(e,r),a&&a.m(e,null)},p(f,[c]){f[1]?a?a.p(f,c):(a=Ta(f),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i:ne,o:ne,d(f){f&&w(e),a&&a.d()}}}function sp(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:r}=e,a=!1,f=3;return t.$$set=c=>{"sysinfo"in c&&l(0,n=c.sysinfo),"data"in c&&l(1,i=c.data),"currency"in c&&l(2,o=c.currency),"hasExport"in c&&l(3,r=c.hasExport)},t.$$.update=()=>{t.$$.dirty&18&&(l(4,a=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(5,f=a?3:2))},[n,i,o,r,a,f]}class op extends Ce{constructor(e){super(),ye(this,e,sp,ip,ke,{sysinfo:0,data:1,currency:2,hasExport:3})}}function up(t){let e,l,n,i;return n=new mn({props:{config:t[0]}}),{c(){e=m("a"),e.textContent="Provided by ENTSO-E",l=h(),J(n.$$.fragment),u(e,"href","https://transparency.entsoe.eu/"),u(e,"target","_blank"),u(e,"class","text-xs float-right z-40")},m(o,r){y(o,e,r),y(o,l,r),X(n,o,r),i=!0},p(o,[r]){const a={};r&1&&(a.config=o[0]),n.$set(a)},i(o){i||(N(n.$$.fragment,o),i=!0)},o(o){D(n.$$.fragment,o),i=!1},d(o){o&&w(e),o&&w(l),Z(n,o)}}}function rp(t,e,l){let{json:n}=e,{sysinfo:i}=e,o={},r,a;return t.$$set=f=>{"json"in f&&l(1,n=f.json),"sysinfo"in f&&l(2,i=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let f=n.currency,c=new Date().getUTCHours(),p=0,_=0,b=0,d=[],v=[],g=[];l(4,a=l(3,r=0));let k=new Date;for(fl(k,i.clock_offset),p=c;p<24&&(_=n[De(b++)],_!=null);p++)v.push({label:De(k.getUTCHours())}),g.push(_*100),l(4,a=Math.min(a,_*100)),l(3,r=Math.max(r,_*100)),fl(k,1);for(p=0;p<24&&(_=n[De(b++)],_!=null);p++)v.push({label:De(k.getUTCHours())}),g.push(_*100),l(4,a=Math.min(a,_*100)),l(3,r=Math.max(r,_*100)),fl(k,1);if(a>-100&&r<100){switch(f){case"NOK":case"SEK":case"DKK":f="\xF8re";break;case"EUR":f="cent";break;default:f=f+"/100"}for(l(4,a*=100),l(3,r*=100),p=0;p=0?S.toFixed(A):"",title:S>=0?S.toFixed(2)+" "+f:"",value:_>=0?Math.abs(_):0,label2:S<0?S.toFixed(A):"",title2:S<0?S.toFixed(2)+" "+f:"",value2:_<0?Math.abs(_):0,color:"#7c3aed"})}let T=Math.max(r,Math.abs(a));if(a<0){l(4,a=Math.min(T/4*-1,a));let S=Math.ceil(Math.abs(a)/T*4),A=a/S;for(p=1;p{"json"in f&&l(1,n=f.json),"sysinfo"in f&&l(2,i=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let f=0,c=[],p=[],_=[];l(4,a=l(3,r=0));let b=fl(new Date,-24),d=new Date().getUTCHours();for(fl(b,i.clock_offset-(b.getHours()-b.getUTCHours())%24),f=d;f<24;f++){let k=n["i"+De(f)],$=n["e"+De(f)];k===void 0&&(k=0),$===void 0&&($=0),p.push({label:De(b.getHours())}),_.push({label:k.toFixed(1),title:k.toFixed(2)+" kWh",value:k*10,label2:$.toFixed(1),title2:$.toFixed(2)+" kWh",value2:$*10,color:"#7c3aed"}),l(4,a=Math.max(a,$*10)),l(3,r=Math.max(r,k*10)),fl(b,1)}for(f=0;f{"json"in f&&l(1,n=f.json),"sysinfo"in f&&l(2,i=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let f=0,c=[],p=[],_=[];l(4,a=l(3,r=0));let b=new Date,d=new Date;for(fl(b,i.clock_offset-(b.getHours()-b.getUTCHours())%24),fl(d,i.clock_offset-(d.getHours()-d.getUTCHours())%24),d.setDate(0),f=b.getDate();f<=d.getDate();f++){let k=n["i"+De(f)],$=n["e"+De(f)];k===void 0&&(k=0),$===void 0&&($=0),p.push({label:De(f)}),_.push({label:k.toFixed(k<10?1:0),title:k.toFixed(2)+" kWh",value:k,label2:$.toFixed($<10?1:0),title2:$.toFixed(2)+" kWh",value2:$,color:"#7c3aed"}),l(4,a=Math.max(a,$)),l(3,r=Math.max(r,k))}for(f=1;f{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=0,f=0,c=[],p=[],_=[];n.s&&n.s.forEach((v,g)=>{var k=v.n?v.n:v.a;f=v.v,f==-127&&(f=0),p.push({label:k.slice(-4)}),_.push({label:f.toFixed(1),value:f,color:"#7c3aed"}),l(3,r=Math.min(r,f)),l(2,o=Math.max(o,f))}),l(2,o=Math.ceil(o)),l(3,r=Math.floor(r));let b=o;r<0&&(b+=Math.abs(r));let d=b/4;for(a=0;a<5;a++)f=r+d*a,c.push({value:f,label:f.toFixed(1)});l(0,i={title:"Temperature sensors (\xB0C)",height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:r,max:o,ticks:c},x:{ticks:p},points:_})}},[i,n,o,r]}class bp extends Ce{constructor(e){super(),ye(this,e,hp,vp,ke,{json:1})}}function gp(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}let kp=0;function wp(t,e,l){let n={},i=0,o;return Ec.subscribe(r=>{l(2,o=r)}),Ic(),t.$$.update=()=>{if(t.$$.dirty&6){let r=0,a=[],f=[],c=[];if(a.push({value:0,label:0}),o&&o.p)for(r=0;r0?De(p.d)+"."+to[new Date().getMonth()]:"-"}),l(1,i=Math.max(i,p.v))}if(o&&o.t){for(r=0;r=i)break;a.push({value:p,label:p})}a.push({label:o.m.toFixed(1),align:"right",color:"green",value:o.m})}o&&o.c&&(a.push({label:o.c.toFixed(0),color:"orange",value:o.c}),l(1,i=Math.max(i,o.c))),l(1,i=Math.ceil(i)),l(0,n={title:"Tariff peaks",padding:{top:20,right:35,bottom:20,left:35},y:{min:kp,max:i,ticks:a},x:{ticks:f},points:c})}},[n,i,o]}class yp extends Ce{constructor(e){super(),ye(this,e,wp,gp,ke,{})}}function Ra(t){let e,l,n,i,o,r,a=(t[0].mt?Cs(t[0].mt):"-")+"",f,c,p,_=(t[0].ic?t[0].ic.toFixed(1):"-")+"",b,d,v;return i=new Oc({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:"Import",sub:t[0].p,subunit:t[0].pc,colorFn:Sc}}),{c(){e=m("div"),l=m("div"),n=m("div"),J(i.$$.fragment),o=h(),r=m("div"),f=C(a),c=h(),p=m("div"),b=C(_),d=C(" kWh"),u(n,"class","col-span-2"),u(p,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(g,k){y(g,e,k),s(e,l),s(l,n),X(i,n,null),s(l,o),s(l,r),s(r,f),s(l,c),s(l,p),s(p,b),s(p,d),v=!0},p(g,k){const $={};k&1&&($.val=g[0].i?g[0].i:0),k&1&&($.max=g[0].im?g[0].im:15e3),k&1&&($.sub=g[0].p),k&1&&($.subunit=g[0].pc),i.$set($),(!v||k&1)&&a!==(a=(g[0].mt?Cs(g[0].mt):"-")+"")&&B(f,a),(!v||k&1)&&_!==(_=(g[0].ic?g[0].ic.toFixed(1):"-")+"")&&B(b,_)},i(g){v||(N(i.$$.fragment,g),v=!0)},o(g){D(i.$$.fragment,g),v=!1},d(g){g&&w(e),Z(i)}}}function La(t){let e,l,n,i,o,r,a,f,c=(t[0].ec?t[0].ec.toFixed(1):"-")+"",p,_,b;return i=new Oc({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:"Export",colorFn:im}}),{c(){e=m("div"),l=m("div"),n=m("div"),J(i.$$.fragment),o=h(),r=m("div"),a=h(),f=m("div"),p=C(c),_=C(" kWh"),u(n,"class","col-span-2"),u(f,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(d,v){y(d,e,v),s(e,l),s(l,n),X(i,n,null),s(l,o),s(l,r),s(l,a),s(l,f),s(f,p),s(f,_),b=!0},p(d,v){const g={};v&1&&(g.val=d[0].e?d[0].e:0),v&1&&(g.max=d[0].om?d[0].om*1e3:1e4),i.$set(g),(!b||v&1)&&c!==(c=(d[0].ec?d[0].ec.toFixed(1):"-")+"")&&B(p,c)},i(d){b||(N(i.$$.fragment,d),b=!0)},o(d){D(i.$$.fragment,d),b=!1},d(d){d&&w(e),Z(i)}}}function Ua(t){let e,l,n;return l=new Qm({props:{u1:t[0].u1,u2:t[0].u2,u3:t[0].u3,ds:t[0].ds}}),{c(){e=m("div"),J(l.$$.fragment),u(e,"class","cnt")},m(i,o){y(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&1&&(r.u1=i[0].u1),o&1&&(r.u2=i[0].u2),o&1&&(r.u3=i[0].u3),o&1&&(r.ds=i[0].ds),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&w(e),Z(l)}}}function Oa(t){let e,l,n;return l=new Jm({props:{u1:t[0].u1,u2:t[0].u2,u3:t[0].u3,i1:t[0].i1,i2:t[0].i2,i3:t[0].i3,max:t[0].mf?t[0].mf:32}}),{c(){e=m("div"),J(l.$$.fragment),u(e,"class","cnt")},m(i,o){y(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&1&&(r.u1=i[0].u1),o&1&&(r.u2=i[0].u2),o&1&&(r.u3=i[0].u3),o&1&&(r.i1=i[0].i1),o&1&&(r.i2=i[0].i2),o&1&&(r.i3=i[0].i3),o&1&&(r.max=i[0].mf?i[0].mf:32),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&w(e),Z(l)}}}function qa(t){let e,l,n;return l=new tp({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec}}),{c(){e=m("div"),J(l.$$.fragment),u(e,"class","cnt")},m(i,o){y(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&1&&(r.importInstant=i[0].ri),o&1&&(r.exportInstant=i[0].re),o&1&&(r.importTotal=i[0].ric),o&1&&(r.exportTotal=i[0].rec),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&w(e),Z(l)}}}function Ha(t){let e,l,n;return l=new op({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"),J(l.$$.fragment),u(e,"class","cnt")},m(i,o){y(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&2&&(r.sysinfo=i[1]),o&1&&(r.data=i[0].ea),o&1&&(r.currency=i[0].pc),o&1&&(r.hasExport=i[0].om>0||i[0].e>0),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&w(e),Z(l)}}}function ja(t){let e,l,n;return l=new yp({}),{c(){e=m("div"),J(l.$$.fragment),u(e,"class","cnt h-64")},m(i,o){y(i,e,o),X(l,e,null),n=!0},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&w(e),Z(l)}}}function Wa(t){let e,l,n;return l=new ap({props:{json:t[2],sysinfo:t[1]}}),{c(){e=m("div"),J(l.$$.fragment),u(e,"class","cnt gwf")},m(i,o){y(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&4&&(r.json=i[2]),o&2&&(r.sysinfo=i[1]),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&w(e),Z(l)}}}function Ga(t){let e,l,n;return l=new mp({props:{json:t[3],sysinfo:t[1]}}),{c(){e=m("div"),J(l.$$.fragment),u(e,"class","cnt gwf")},m(i,o){y(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&8&&(r.json=i[3]),o&2&&(r.sysinfo=i[1]),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&w(e),Z(l)}}}function Ba(t){let e,l,n;return l=new dp({props:{json:t[4],sysinfo:t[1]}}),{c(){e=m("div"),J(l.$$.fragment),u(e,"class","cnt gwf")},m(i,o){y(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&16&&(r.json=i[4]),o&2&&(r.sysinfo=i[1]),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&w(e),Z(l)}}}function za(t){let e,l,n;return l=new bp({props:{json:t[5]}}),{c(){e=m("div"),J(l.$$.fragment),u(e,"class","cnt gwf")},m(i,o){y(i,e,o),X(l,e,null),n=!0},p(i,o){const r={};o&32&&(r.json=i[5]),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&w(e),Z(l)}}}function Cp(t){let e,l=ze(t[1].ui.i,t[0].i),n,i=ze(t[1].ui.e,t[0].om||t[0].e>0),o,r=ze(t[1].ui.v,t[0].u1>100||t[0].u2>100||t[0].u3>100),a,f=ze(t[1].ui.a,t[0].i1>.01||t[0].i2>.01||t[0].i3>.01),c,p=ze(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),_,b=ze(t[1].ui.c,t[0].ea),d,v=ze(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("10YNO")||t[0].pr=="10Y1001A1001A48H")),g,k=ze(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),$,T=ze(t[1].ui.d,t[3]),P,I=ze(t[1].ui.m,t[4]),S,A=ze(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),E,F=l&&Ra(t),Y=i&&La(t),U=r&&Ua(t),R=f&&Oa(t),q=p&&qa(t),z=b&&Ha(t),O=v&&ja(),H=k&&Wa(t),G=T&&Ga(t),L=I&&Ba(t),W=A&&za(t);return{c(){e=m("div"),F&&F.c(),n=h(),Y&&Y.c(),o=h(),U&&U.c(),a=h(),R&&R.c(),c=h(),q&&q.c(),_=h(),z&&z.c(),d=h(),O&&O.c(),g=h(),H&&H.c(),$=h(),G&&G.c(),P=h(),L&&L.c(),S=h(),W&&W.c(),u(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(j,te){y(j,e,te),F&&F.m(e,null),s(e,n),Y&&Y.m(e,null),s(e,o),U&&U.m(e,null),s(e,a),R&&R.m(e,null),s(e,c),q&&q.m(e,null),s(e,_),z&&z.m(e,null),s(e,d),O&&O.m(e,null),s(e,g),H&&H.m(e,null),s(e,$),G&&G.m(e,null),s(e,P),L&&L.m(e,null),s(e,S),W&&W.m(e,null),E=!0},p(j,[te]){te&3&&(l=ze(j[1].ui.i,j[0].i)),l?F?(F.p(j,te),te&3&&N(F,1)):(F=Ra(j),F.c(),N(F,1),F.m(e,n)):F&&(Te(),D(F,1,1,()=>{F=null}),Se()),te&3&&(i=ze(j[1].ui.e,j[0].om||j[0].e>0)),i?Y?(Y.p(j,te),te&3&&N(Y,1)):(Y=La(j),Y.c(),N(Y,1),Y.m(e,o)):Y&&(Te(),D(Y,1,1,()=>{Y=null}),Se()),te&3&&(r=ze(j[1].ui.v,j[0].u1>100||j[0].u2>100||j[0].u3>100)),r?U?(U.p(j,te),te&3&&N(U,1)):(U=Ua(j),U.c(),N(U,1),U.m(e,a)):U&&(Te(),D(U,1,1,()=>{U=null}),Se()),te&3&&(f=ze(j[1].ui.a,j[0].i1>.01||j[0].i2>.01||j[0].i3>.01)),f?R?(R.p(j,te),te&3&&N(R,1)):(R=Oa(j),R.c(),N(R,1),R.m(e,c)):R&&(Te(),D(R,1,1,()=>{R=null}),Se()),te&3&&(p=ze(j[1].ui.r,j[0].ri>0||j[0].re>0||j[0].ric>0||j[0].rec>0)),p?q?(q.p(j,te),te&3&&N(q,1)):(q=qa(j),q.c(),N(q,1),q.m(e,_)):q&&(Te(),D(q,1,1,()=>{q=null}),Se()),te&3&&(b=ze(j[1].ui.c,j[0].ea)),b?z?(z.p(j,te),te&3&&N(z,1)):(z=Ha(j),z.c(),N(z,1),z.m(e,d)):z&&(Te(),D(z,1,1,()=>{z=null}),Se()),te&3&&(v=ze(j[1].ui.t,j[0].pr&&(j[0].pr.startsWith("10YNO")||j[0].pr=="10Y1001A1001A48H"))),v?O?te&3&&N(O,1):(O=ja(),O.c(),N(O,1),O.m(e,g)):O&&(Te(),D(O,1,1,()=>{O=null}),Se()),te&3&&(k=ze(j[1].ui.p,j[0].pe&&!Number.isNaN(j[0].p))),k?H?(H.p(j,te),te&3&&N(H,1)):(H=Wa(j),H.c(),N(H,1),H.m(e,$)):H&&(Te(),D(H,1,1,()=>{H=null}),Se()),te&10&&(T=ze(j[1].ui.d,j[3])),T?G?(G.p(j,te),te&10&&N(G,1)):(G=Ga(j),G.c(),N(G,1),G.m(e,P)):G&&(Te(),D(G,1,1,()=>{G=null}),Se()),te&18&&(I=ze(j[1].ui.m,j[4])),I?L?(L.p(j,te),te&18&&N(L,1)):(L=Ba(j),L.c(),N(L,1),L.m(e,S)):L&&(Te(),D(L,1,1,()=>{L=null}),Se()),te&35&&(A=ze(j[1].ui.s,j[0].t&&j[0].t!=-127&&j[5].c>1)),A?W?(W.p(j,te),te&35&&N(W,1)):(W=za(j),W.c(),N(W,1),W.m(e,null)):W&&(Te(),D(W,1,1,()=>{W=null}),Se())},i(j){E||(N(F),N(Y),N(U),N(R),N(q),N(z),N(O),N(H),N(G),N(L),N(W),E=!0)},o(j){D(F),D(Y),D(U),D(R),D(q),D(z),D(O),D(H),D(G),D(L),D(W),E=!1},d(j){j&&w(e),F&&F.d(),Y&&Y.d(),U&&U.d(),R&&R.d(),q&&q.d(),z&&z.d(),O&&O.d(),H&&H.d(),G&&G.d(),L&&L.d(),W&&W.d()}}}function $p(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},r={},a={},f={};return Pc.subscribe(c=>{l(2,o=c)}),Nc.subscribe(c=>{l(3,r=c)}),Mc.subscribe(c=>{l(4,a=c)}),Dc.subscribe(c=>{l(5,f=c)}),t.$$set=c=>{"data"in c&&l(0,n=c.data),"sysinfo"in c&&l(1,i=c.sysinfo)},[n,i,o,r,a,f]}class Tp extends Ce{constructor(e){super(),ye(this,e,$p,Cp,ke,{data:0,sysinfo:1})}}let ro={};const qc=rt(ro);async function Sp(){ro=await(await fetch("/configuration.json")).json(),qc.set(ro)}function Ya(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Pp(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Np(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Va(t){let e;return{c(){e=m("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Ka(t){let e,l,n;return{c(){e=m("option"),e.textContent="UART1",l=h(),n=m("option"),n.textContent="UART2",e.__value=9,e.value=e.__value,n.__value=16,n.value=n.__value},m(i,o){y(i,e,o),y(i,l,o),y(i,n,o)},d(i){i&&w(e),i&&w(l),i&&w(n)}}}function Qa(t){let e;return{c(){e=m("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Xa(t){let e,l,n;return{c(){e=m("option"),l=C("GPIO"),n=C(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){y(i,e,o),s(e,l),s(e,n)},d(i){i&&w(e)}}}function Za(t){let e,l=t[4]>3&&!(t[0]=="esp32"&&(t[4]==9||t[4]==16))&&!(t[0]=="esp32s2"&&t[4]==18)&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Xa(t);return{c(){l&&l.c(),e=We()},m(n,i){l&&l.m(n,i),y(n,e,i)},p(n,i){n[4]>3&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!(n[0]=="esp32s2"&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Xa(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&w(e)}}}function Mp(t){let e,l,n,i,o;function r(v,g){return v[0]=="esp32c3"?Np:Pp}let a=r(t),f=a(t),c=t[0]=="esp8266"&&Va(),p=(t[0]=="esp32"||t[0]=="esp32solo")&&Ka(),_=t[0]=="esp32s2"&&Qa(),b={length:t[1]+1},d=[];for(let v=0;v{"chip"in o&&l(0,n=o.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32c3":l(1,i=19);break}},[n,i]}class Hc extends Ce{constructor(e){super(),ye(this,e,Ap,Mp,ke,{chip:0})}}function Ja(t){let e,l,n=t[1]&&xa(t);return{c(){e=m("div"),l=m("div"),n&&n.c(),u(l,"class","fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center"),u(e,"class","z-50"),u(e,"aria-modal","true")},m(i,o){y(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=xa(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&w(e),n&&n.d()}}}function xa(t){let e,l;return{c(){e=m("div"),l=C(t[1]),u(e,"class","bg-white m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 w-96")},m(n,i){y(n,e,i),s(e,l)},p(n,i){i&2&&B(l,n[1])},d(n){n&&w(e)}}}function Dp(t){let e,l=t[0]&&Ja(t);return{c(){l&&l.c(),e=We()},m(n,i){l&&l.m(n,i),y(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Ja(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:ne,o:ne,d(n){l&&l.d(n),n&&w(e)}}}function Ip(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 At extends Ce{constructor(e){super(),ye(this,e,Ip,Dp,ke,{active:0,message:1})}}function ef(t,e,l){const n=t.slice();return n[1]=e[l],n}function tf(t){let e,l,n=t[1]+"",i;return{c(){e=m("option"),l=C("Europe/"),i=C(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,r){y(o,e,r),s(e,l),s(e,i)},p:ne,d(o){o&&w(e)}}}function Ep(t){let e,l,n,i=t[0],o=[];for(let r=0;r{r[p]=null}),Se(),l=r[e],l||(l=r[e]=o[e](f),l.c()),N(l,1),l.m(n.parentNode,n))},i(f){i||(N(l),i=!0)},o(f){D(l),i=!1},d(f){r[e].d(f),f&&w(n)}}}function Bp(t){let e,l;return e=new cl({props:{color:"blue",text:"Upload cert",title:"Click here to upload certificate"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function zp(t){let e,l;return e=new cl({props:{color:"green",text:"Cert OK",title:"Click here to replace certificate"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Yp(t){let e,l,n,i;const o=[zp,Bp],r=[];function a(f,c){return f[3].q.s.r?0:1}return e=a(t),l=r[e]=o[e](t),{c(){l.c(),n=We()},m(f,c){r[e].m(f,c),y(f,n,c),i=!0},p(f,c){let p=e;e=a(f),e!==p&&(Te(),D(r[p],1,1,()=>{r[p]=null}),Se(),l=r[e],l||(l=r[e]=o[e](f),l.c()),N(l,1),l.m(n.parentNode,n))},i(f){i||(N(l),i=!0)},o(f){D(l),i=!1},d(f){r[e].d(f),f&&w(n)}}}function Vp(t){let e,l;return e=new cl({props:{color:"blue",text:"Upload key",title:"Click here to upload key"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Kp(t){let e,l;return e=new cl({props:{color:"green",text:"Key OK",title:"Click here to replace key"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function Qp(t){let e,l,n,i;const o=[Kp,Vp],r=[];function a(f,c){return f[3].q.s.k?0:1}return e=a(t),l=r[e]=o[e](t),{c(){l.c(),n=We()},m(f,c){r[e].m(f,c),y(f,n,c),i=!0},p(f,c){let p=e;e=a(f),e!==p&&(Te(),D(r[p],1,1,()=>{r[p]=null}),Se(),l=r[e],l||(l=r[e]=o[e](f),l.c()),N(l,1),l.m(n.parentNode,n))},i(f){i||(N(l),i=!0)},o(f){D(l),i=!1},d(f){r[e].d(f),f&&w(n)}}}function pf(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,k,$,T,P,I,S,A,E,F,Y,U,R,q,z,O,H,G;return o=new Rt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Domoticz",n=h(),i=m("a"),J(o.$$.fragment),r=h(),a=m("input"),f=h(),c=m("div"),p=m("div"),_=C("Electricity IDX"),b=m("br"),d=h(),v=m("input"),g=h(),k=m("div"),$=C("Current IDX"),T=m("br"),P=h(),I=m("input"),S=h(),A=m("div"),E=C(`Voltage IDX: L1, L2 & L3\r - `),F=m("div"),Y=m("input"),U=h(),R=m("input"),q=h(),z=m("input"),u(l,"class","text-sm"),u(i,"href",Lt("MQTT-configuration#domoticz")),u(i,"target","_blank"),u(i,"class","float-right"),u(a,"type","hidden"),u(a,"name","o"),a.value="true",u(v,"name","oe"),u(v,"type","text"),u(v,"class","in-f tr w-full"),u(p,"class","w-1/2"),u(I,"name","oc"),u(I,"type","text"),u(I,"class","in-l tr w-full"),u(k,"class","w-1/2"),u(c,"class","my-1 flex"),u(Y,"name","ou1"),u(Y,"type","text"),u(Y,"class","in-f tr w-1/3"),u(R,"name","ou2"),u(R,"type","text"),u(R,"class","in-m tr w-1/3"),u(z,"name","ou3"),u(z,"type","text"),u(z,"class","in-l tr w-1/3"),u(F,"class","flex"),u(A,"class","my-1"),u(e,"class","cnt")},m(L,W){y(L,e,W),s(e,l),s(e,n),s(e,i),X(o,i,null),s(e,r),s(e,a),s(e,f),s(e,c),s(c,p),s(p,_),s(p,b),s(p,d),s(p,v),V(v,t[3].o.e),s(c,g),s(c,k),s(k,$),s(k,T),s(k,P),s(k,I),V(I,t[3].o.c),s(e,S),s(e,A),s(A,E),s(A,F),s(F,Y),V(Y,t[3].o.u1),s(F,U),s(F,R),V(R,t[3].o.u2),s(F,q),s(F,z),V(z,t[3].o.u3),O=!0,H||(G=[K(v,"input",t[61]),K(I,"input",t[62]),K(Y,"input",t[63]),K(R,"input",t[64]),K(z,"input",t[65])],H=!0)},p(L,W){W[0]&8&&v.value!==L[3].o.e&&V(v,L[3].o.e),W[0]&8&&I.value!==L[3].o.c&&V(I,L[3].o.c),W[0]&8&&Y.value!==L[3].o.u1&&V(Y,L[3].o.u1),W[0]&8&&R.value!==L[3].o.u2&&V(R,L[3].o.u2),W[0]&8&&z.value!==L[3].o.u3&&V(z,L[3].o.u3)},i(L){O||(N(o.$$.fragment,L),O=!0)},o(L){D(o.$$.fragment,L),O=!1},d(L){L&&w(e),Z(o),H=!1,Ve(G)}}}function _f(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,k,$,T,P,I,S,A,E,F,Y,U,R,q,z;return o=new Rt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Home-Assistant",n=h(),i=m("a"),J(o.$$.fragment),r=h(),a=m("input"),f=h(),c=m("div"),p=C("Discovery topic prefix"),_=m("br"),b=h(),d=m("input"),v=h(),g=m("div"),k=C("Hostname for URL"),$=m("br"),T=h(),P=m("input"),S=h(),A=m("div"),E=C("Name tag"),F=m("br"),Y=h(),U=m("input"),u(l,"class","text-sm"),u(i,"href",Lt("MQTT-configuration#home-assistant")),u(i,"target","_blank"),u(i,"class","float-right"),u(a,"type","hidden"),u(a,"name","h"),a.value="true",u(d,"name","ht"),u(d,"type","text"),u(d,"class","in-s"),u(d,"placeholder","homeassistant"),u(c,"class","my-1"),u(P,"name","hh"),u(P,"type","text"),u(P,"class","in-s"),u(P,"placeholder",I=t[3].g.h+".local"),u(g,"class","my-1"),u(U,"name","hn"),u(U,"type","text"),u(U,"class","in-s"),u(A,"class","my-1"),u(e,"class","cnt")},m(O,H){y(O,e,H),s(e,l),s(e,n),s(e,i),X(o,i,null),s(e,r),s(e,a),s(e,f),s(e,c),s(c,p),s(c,_),s(c,b),s(c,d),V(d,t[3].h.t),s(e,v),s(e,g),s(g,k),s(g,$),s(g,T),s(g,P),V(P,t[3].h.h),s(e,S),s(e,A),s(A,E),s(A,F),s(A,Y),s(A,U),V(U,t[3].h.n),R=!0,q||(z=[K(d,"input",t[66]),K(P,"input",t[67]),K(U,"input",t[68])],q=!0)},p(O,H){H[0]&8&&d.value!==O[3].h.t&&V(d,O[3].h.t),(!R||H[0]&8&&I!==(I=O[3].g.h+".local"))&&u(P,"placeholder",I),H[0]&8&&P.value!==O[3].h.h&&V(P,O[3].h.h),H[0]&8&&U.value!==O[3].h.n&&V(U,O[3].h.n)},i(O){R||(N(o.$$.fragment,O),R=!0)},o(O){D(o.$$.fragment,O),R=!1},d(O){O&&w(e),Z(o),q=!1,Ve(z)}}}function df(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,k,$,T,P;o=new Rt({});let I={length:9},S=[];for(let A=0;A20&&gf(t),p=t[0].chip=="esp8266"&&yf(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Hardware",n=h(),i=m("a"),J(o.$$.fragment),r=h(),c&&c.c(),a=h(),p&&p.c(),u(l,"class","text-sm"),u(i,"href",Lt("GPIO-configuration")),u(i,"target","_blank"),u(i,"class","float-right"),u(e,"class","cnt")},m(_,b){y(_,e,b),s(e,l),s(e,n),s(e,i),X(o,i,null),s(e,r),c&&c.m(e,null),s(e,a),p&&p.m(e,null),f=!0},p(_,b){_[0].board>20?c?(c.p(_,b),b[0]&1&&N(c,1)):(c=gf(_),c.c(),N(c,1),c.m(e,a)):c&&(Te(),D(c,1,1,()=>{c=null}),Se()),_[0].chip=="esp8266"?p?p.p(_,b):(p=yf(_),p.c(),p.m(e,null)):p&&(p.d(1),p=null)},i(_){f||(N(o.$$.fragment,_),N(c),f=!0)},o(_){D(o.$$.fragment,_),D(c),f=!1},d(_){_&&w(e),Z(o),c&&c.d(),p&&p.d()}}}function gf(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,k,$,T,P,I,S,A,E,F,Y,U,R,q,z,O,H,G,L,W,j,te,le,de,ie,we,Ie,$e,Ee,ve,Pe,Ae,me,se,pe,Q,oe,Ne,Me,he,x,_e,Le,je,Ke;b=new Hc({props:{chip:t[0].chip}});let Fe=t[0].chip!="esp8266"&&kf(t),He=t[3].i.v.p>0&&wf(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=C("HAN"),r=m("label"),a=m("input"),f=C(" pullup"),c=m("br"),p=h(),_=m("select"),J(b.$$.fragment),d=h(),v=m("div"),g=C("AP button"),k=m("br"),$=h(),T=m("input"),P=h(),I=m("div"),S=C("LED"),A=m("label"),E=m("input"),F=C(" inv"),Y=m("br"),U=h(),R=m("div"),q=m("input"),z=h(),O=m("div"),H=C("RGB"),G=m("label"),L=m("input"),W=C(" inverted"),j=m("br"),te=h(),le=m("div"),de=m("input"),ie=h(),we=m("input"),Ie=h(),$e=m("input"),Ee=h(),ve=m("div"),Pe=C("Temperature"),Ae=m("br"),me=h(),se=m("input"),pe=h(),Q=m("div"),oe=C("Analog temp"),Ne=m("br"),Me=h(),he=m("input"),x=h(),Fe&&Fe.c(),_e=h(),He&&He.c(),u(e,"type","hidden"),u(e,"name","i"),e.value="true",u(a,"name","ihu"),a.__value="true",a.value=a.__value,u(a,"type","checkbox"),u(a,"class","rounded mb-1"),u(r,"class","ml-2"),u(_,"name","ihp"),u(_,"class","in-f w-full"),t[3].i.h.p===void 0&&tt(()=>t[73].call(_)),u(i,"class","w-1/3"),u(T,"name","ia"),u(T,"type","number"),u(T,"min","0"),u(T,"max",t[6]),u(T,"class","in-m tr w-full"),u(v,"class","w-1/3"),u(E,"name","ili"),E.__value="true",E.value=E.__value,u(E,"type","checkbox"),u(E,"class","rounded mb-1"),u(A,"class","ml-4"),u(q,"name","ilp"),u(q,"type","number"),u(q,"min","0"),u(q,"max",t[6]),u(q,"class","in-l tr w-full"),u(R,"class","flex"),u(I,"class","w-1/3"),u(L,"name","iri"),L.__value="true",L.value=L.__value,u(L,"type","checkbox"),u(L,"class","rounded mb-1"),u(G,"class","ml-4"),u(de,"name","irr"),u(de,"type","number"),u(de,"min","0"),u(de,"max",t[6]),u(de,"class","in-f tr w-1/3"),u(we,"name","irg"),u(we,"type","number"),u(we,"min","0"),u(we,"max",t[6]),u(we,"class","in-m tr w-1/3"),u($e,"name","irb"),u($e,"type","number"),u($e,"min","0"),u($e,"max",t[6]),u($e,"class","in-l tr w-1/3"),u(le,"class","flex"),u(O,"class","w-full"),u(se,"name","itd"),u(se,"type","number"),u(se,"min","0"),u(se,"max",t[6]),u(se,"class","in-f tr w-full"),u(ve,"class","my-1 w-1/3"),u(he,"name","ita"),u(he,"type","number"),u(he,"min","0"),u(he,"max",t[6]),u(he,"class","in-l tr w-full"),u(Q,"class","my-1 pr-1 w-1/3"),u(n,"class","flex flex-wrap")},m(re,ge){y(re,e,ge),y(re,l,ge),y(re,n,ge),s(n,i),s(i,o),s(i,r),s(r,a),a.checked=t[3].i.h.u,s(r,f),s(i,c),s(i,p),s(i,_),X(b,_,null),Re(_,t[3].i.h.p),s(n,d),s(n,v),s(v,g),s(v,k),s(v,$),s(v,T),V(T,t[3].i.a),s(n,P),s(n,I),s(I,S),s(I,A),s(A,E),E.checked=t[3].i.l.i,s(A,F),s(I,Y),s(I,U),s(I,R),s(R,q),V(q,t[3].i.l.p),s(n,z),s(n,O),s(O,H),s(O,G),s(G,L),L.checked=t[3].i.r.i,s(G,W),s(O,j),s(O,te),s(O,le),s(le,de),V(de,t[3].i.r.r),s(le,ie),s(le,we),V(we,t[3].i.r.g),s(le,Ie),s(le,$e),V($e,t[3].i.r.b),s(n,Ee),s(n,ve),s(ve,Pe),s(ve,Ae),s(ve,me),s(ve,se),V(se,t[3].i.t.d),s(n,pe),s(n,Q),s(Q,oe),s(Q,Ne),s(Q,Me),s(Q,he),V(he,t[3].i.t.a),s(n,x),Fe&&Fe.m(n,null),s(n,_e),He&&He.m(n,null),Le=!0,je||(Ke=[K(a,"change",t[72]),K(_,"change",t[73]),K(T,"input",t[74]),K(E,"change",t[75]),K(q,"input",t[76]),K(L,"change",t[77]),K(de,"input",t[78]),K(we,"input",t[79]),K($e,"input",t[80]),K(se,"input",t[81]),K(he,"input",t[82])],je=!0)},p(re,ge){ge[0]&8&&(a.checked=re[3].i.h.u);const Ot={};ge[0]&1&&(Ot.chip=re[0].chip),b.$set(Ot),ge[0]&8&&Re(_,re[3].i.h.p),(!Le||ge[0]&64)&&u(T,"max",re[6]),ge[0]&8&&ae(T.value)!==re[3].i.a&&V(T,re[3].i.a),ge[0]&8&&(E.checked=re[3].i.l.i),(!Le||ge[0]&64)&&u(q,"max",re[6]),ge[0]&8&&ae(q.value)!==re[3].i.l.p&&V(q,re[3].i.l.p),ge[0]&8&&(L.checked=re[3].i.r.i),(!Le||ge[0]&64)&&u(de,"max",re[6]),ge[0]&8&&ae(de.value)!==re[3].i.r.r&&V(de,re[3].i.r.r),(!Le||ge[0]&64)&&u(we,"max",re[6]),ge[0]&8&&ae(we.value)!==re[3].i.r.g&&V(we,re[3].i.r.g),(!Le||ge[0]&64)&&u($e,"max",re[6]),ge[0]&8&&ae($e.value)!==re[3].i.r.b&&V($e,re[3].i.r.b),(!Le||ge[0]&64)&&u(se,"max",re[6]),ge[0]&8&&ae(se.value)!==re[3].i.t.d&&V(se,re[3].i.t.d),(!Le||ge[0]&64)&&u(he,"max",re[6]),ge[0]&8&&ae(he.value)!==re[3].i.t.a&&V(he,re[3].i.t.a),re[0].chip!="esp8266"?Fe?Fe.p(re,ge):(Fe=kf(re),Fe.c(),Fe.m(n,_e)):Fe&&(Fe.d(1),Fe=null),re[3].i.v.p>0?He?He.p(re,ge):(He=wf(re),He.c(),He.m(n,null)):He&&(He.d(1),He=null)},i(re){Le||(N(b.$$.fragment,re),Le=!0)},o(re){D(b.$$.fragment,re),Le=!1},d(re){re&&w(e),re&&w(l),re&&w(n),Z(b),Fe&&Fe.d(),He&&He.d(),je=!1,Ve(Ke)}}}function kf(t){let e,l,n,i,o,r,a;return{c(){e=m("div"),l=C("Vcc"),n=m("br"),i=h(),o=m("input"),u(o,"name","ivp"),u(o,"type","number"),u(o,"min","0"),u(o,"max",t[6]),u(o,"class","in-s tr w-full"),u(e,"class","my-1 pl-1 w-1/3")},m(f,c){y(f,e,c),s(e,l),s(e,n),s(e,i),s(e,o),V(o,t[3].i.v.p),r||(a=K(o,"input",t[83]),r=!0)},p(f,c){c[0]&64&&u(o,"max",f[6]),c[0]&8&&ae(o.value)!==f[3].i.v.p&&V(o,f[3].i.v.p)},d(f){f&&w(e),r=!1,a()}}}function wf(t){let e,l,n,i,o,r,a,f,c,p;return{c(){e=m("div"),l=C("Voltage divider"),n=m("br"),i=h(),o=m("div"),r=m("input"),a=h(),f=m("input"),u(r,"name","ivdv"),u(r,"type","number"),u(r,"min","0"),u(r,"max","65535"),u(r,"class","in-f tr w-full"),u(r,"placeholder","VCC"),u(f,"name","ivdg"),u(f,"type","number"),u(f,"min","0"),u(f,"max","65535"),u(f,"class","in-l tr w-full"),u(f,"placeholder","GND"),u(o,"class","flex"),u(e,"class","my-1")},m(_,b){y(_,e,b),s(e,l),s(e,n),s(e,i),s(e,o),s(o,r),V(r,t[3].i.v.d.v),s(o,a),s(o,f),V(f,t[3].i.v.d.g),c||(p=[K(r,"input",t[84]),K(f,"input",t[85])],c=!0)},p(_,b){b[0]&8&&ae(r.value)!==_[3].i.v.d.v&&V(r,_[3].i.v.d.v),b[0]&8&&ae(f.value)!==_[3].i.v.d.g&&V(f,_[3].i.v.d.g)},d(_){_&&w(e),c=!1,Ve(p)}}}function yf(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,k,$,T=(t[0].board==2||t[0].board==100)&&Cf(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=C("Vcc offset"),r=m("br"),a=h(),f=m("input"),c=h(),p=m("div"),_=C("Multiplier"),b=m("br"),d=h(),v=m("input"),g=h(),T&&T.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(v,"name","ivm"),u(v,"type","number"),u(v,"min","0.1"),u(v,"max","10"),u(v,"step","0.01"),u(v,"class","in-l tr w-full"),u(p,"class","w-1/3 pr-1"),u(n,"class","my-1 flex flex-wrap")},m(P,I){y(P,e,I),y(P,l,I),y(P,n,I),s(n,i),s(i,o),s(i,r),s(i,a),s(i,f),V(f,t[3].i.v.o),s(n,c),s(n,p),s(p,_),s(p,b),s(p,d),s(p,v),V(v,t[3].i.v.m),s(n,g),T&&T.m(n,null),k||($=[K(f,"input",t[86]),K(v,"input",t[87])],k=!0)},p(P,I){I[0]&8&&ae(f.value)!==P[3].i.v.o&&V(f,P[3].i.v.o),I[0]&8&&ae(v.value)!==P[3].i.v.m&&V(v,P[3].i.v.m),P[0].board==2||P[0].board==100?T?T.p(P,I):(T=Cf(P),T.c(),T.m(n,null)):T&&(T.d(1),T=null)},d(P){P&&w(e),P&&w(l),P&&w(n),T&&T.d(),k=!1,Ve($)}}}function Cf(t){let e,l,n,i,o,r,a;return{c(){e=m("div"),l=C("Boot limit"),n=m("br"),i=h(),o=m("input"),u(o,"name","ivb"),u(o,"type","number"),u(o,"min","2.5"),u(o,"max","3.5"),u(o,"step","0.1"),u(o,"class","in-s tr w-full"),u(e,"class","w-1/3 pl-1")},m(f,c){y(f,e,c),s(e,l),s(e,n),s(e,i),s(e,o),V(o,t[3].i.v.b),r||(a=K(o,"input",t[88]),r=!0)},p(f,c){c[0]&8&&ae(o.value)!==f[3].i.v.b&&V(o,f[3].i.v.b)},d(f){f&&w(e),r=!1,a()}}}function $f(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,k,$=t[3].d.t&&Tf();return{c(){e=m("div"),e.textContent="Debug can cause sudden reboots. Do not leave on!",l=h(),n=m("div"),i=m("label"),o=m("input"),r=C(" Enable telnet"),a=h(),$&&$.c(),f=h(),c=m("div"),p=m("select"),_=m("option"),_.textContent="Verbose",b=m("option"),b.textContent="Debug",d=m("option"),d.textContent="Info",v=m("option"),v.textContent="Warning",u(e,"class","bd-red"),u(o,"type","checkbox"),u(o,"name","dt"),o.__value="true",o.value=o.__value,u(o,"class","rounded mb-1"),u(n,"class","my-1"),_.__value=1,_.value=_.__value,b.__value=2,b.value=b.__value,d.__value=3,d.value=d.__value,v.__value=4,v.value=v.__value,u(p,"name","dl"),u(p,"class","in-s"),t[3].d.l===void 0&&tt(()=>t[91].call(p)),u(c,"class","my-1")},m(T,P){y(T,e,P),y(T,l,P),y(T,n,P),s(n,i),s(i,o),o.checked=t[3].d.t,s(i,r),y(T,a,P),$&&$.m(T,P),y(T,f,P),y(T,c,P),s(c,p),s(p,_),s(p,b),s(p,d),s(p,v),Re(p,t[3].d.l),g||(k=[K(o,"change",t[90]),K(p,"change",t[91])],g=!0)},p(T,P){P[0]&8&&(o.checked=T[3].d.t),T[3].d.t?$||($=Tf(),$.c(),$.m(f.parentNode,f)):$&&($.d(1),$=null),P[0]&8&&Re(p,T[3].d.l)},d(T){T&&w(e),T&&w(l),T&&w(n),T&&w(a),$&&$.d(T),T&&w(f),T&&w(c),g=!1,Ve(k)}}}function Tf(t){let e;return{c(){e=m("div"),e.textContent="Telnet is unsafe and should be off when not in use",u(e,"class","bd-red")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Xp(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,k,$,T,P,I,S,A,E,F,Y,U,R,q,z,O,H,G,L,W,j,te,le,de,ie,we,Ie,$e,Ee,ve,Pe,Ae,me,se,pe,Q,oe,Ne,Me,he,x,_e,Le,je,Ke,Fe,He,re,ge,Ot,Wl,xt,ft,Nl,_l,qt,pt,Qe,Xe,Ze,Ue,Je,Ge,xe,et,ue,be,Pi,dl,pn,Tt,Ni,Mi,Ai,vl,Di,Ii,Ei,St,Ml,Be,hl,Gl,Ps,qe,el,Fi,Al,_n,$o,ai,To,tl,Ri,So,Ns,Po,fi,Ht,No,Mo,Dl,ll,Il,Ao,Li,Do,ct,El,Io,Ui,dn,vn,hn,bn,Oi,Eo,Dt,Fo,Bl,Ro,Lo,Uo,nl,gn,kn,Oo,wn,zl,qo,Ho,jo,yn,jt,Wo,qi,Go,Yl,Bo,zo,Yo,Cn,Wt,Vo,Hi,Ko,Ms,Qo,Vl,ji,Gt,Xo,Zo,Jo,As,Wi,Bt,xo,eu,tu,lt,Gi,lu,$n,Tn,nu,ci,iu,Kl,su,ou,uu,bl,ru,Ql,au,fu,cu,gl,mu,Sn,Xl,pu,_u,du,It,Pn,Nn,Mn,An,vu,Zl,hu,bu,gu,Dn,Et,ku,Bi,wu,zi,Yi,zt,yu,Cu,Vi,Ki,Yt,$u,Tu,at,Qi,Su,In,En,Pu,Jl,Nu,Mu,Au,Fl,il,Fn,Rn,Du,Pt,Xi,Zi,Iu,Nt,Ln,Ji,xi,Eu,Ds,es,ts,Vt,Fu,Ru,mi,Lu,Rl,Uu,pi,Kt,Ou,qu,Hu,ls,kl,ju,Ye,ns,Wu,Un,On,Gu,_i,Bu,sl,zu,Is,Yu,Vu,qn,wl,Ku,Qt,Qu,Es,xl,Xu,Zu,Ju,yl,xu,en,er,tr,lr,Cl,nr,Hn,jn,ir,sr,or,$l,ur,Wn,rr,ar,fr,_t,Gn,Bn,zn,Yn,Vn,Kn,cr,tn,mr,pr,_r,Tl,dr,Fs,Rs,Ls=t[3].p.r.startsWith("10YNO")||t[3].p.r=="10Y1001A1001A48H",Us,ol,is,vr,Qn,Xn,hr,di,br,vi,gr,Os,Mt,ss,kr,Zn,Jn,wr,hi,yr,os,us,Xt,Cr,$r,Tr,Ll,qs,xn,Sr,rs,ei,Pr,as,Hs,ln,js,nn,Ws,sn,Gs,on,Zt,Bs,Nr;a=new Rt({}),F=new Rp({});let Wc=["NOK","SEK","DKK","EUR"],fs=[];for(let M=0;M<4;M+=1)fs[M]=qp(Op(t,Wc,M));let dt=t[3].p.e&&t[0].chip!="esp8266"&&sf(t),vt=t[3].g.s>0&&of(t);_n=new Rt({});let Gc=[24,48,96,192,384,576,1152],cs=[];for(let M=0;M<7;M+=1)cs[M]=Hp(Up(t,Gc,M));let ht=t[3].m.e.e&&uf(t),bt=t[3].m.e.e&&rf(t),gt=t[3].m.m.e&&af(t);Tn=new Rt({}),En=new Rt({}),Ln=new jc({});let kt=t[3].n.m=="static"&&ff(t);On=new Rt({});let wt=t[0].chip!="esp8266"&&cf(t),nt=t[3].q.s.e&&mf(t),it=t[3].q.m==3&&pf(t),st=t[3].q.m==4&&_f(t),ot=Ls&&df(t);Xn=new Rt({});let ti=t[7],yt=[];for(let M=0;M20||t[0].chip=="esp8266")&&bf(t);Jn=new Rt({});let Ct=t[3].d.s&&$f(t);return ln=new At({props:{active:t[1],message:"Loading configuration"}}),nn=new At({props:{active:t[2],message:"Saving configuration"}}),sn=new At({props:{active:t[4],message:"Performing factory reset"}}),on=new At({props:{active:t[5],message:"Device have been factory reset and switched to AP mode"}}),{c(){e=m("form"),l=m("div"),n=m("div"),i=m("strong"),i.textContent="General",o=h(),r=m("a"),J(a.$$.fragment),f=h(),c=m("input"),p=h(),_=m("div"),b=m("div"),d=m("div"),v=C("Hostname"),g=m("br"),k=h(),$=m("input"),T=h(),P=m("div"),I=C("Time zone"),S=m("br"),A=h(),E=m("select"),J(F.$$.fragment),Y=h(),U=m("input"),R=h(),q=m("div"),z=m("div"),O=m("div"),H=C("Price region"),G=m("br"),L=h(),W=m("select"),j=m("optgroup"),te=m("option"),te.textContent="NO1",le=m("option"),le.textContent="NO2",de=m("option"),de.textContent="NO3",ie=m("option"),ie.textContent="NO4",we=m("option"),we.textContent="NO5",Ie=m("optgroup"),$e=m("option"),$e.textContent="SE1",Ee=m("option"),Ee.textContent="SE2",ve=m("option"),ve.textContent="SE3",Pe=m("option"),Pe.textContent="SE4",Ae=m("optgroup"),me=m("option"),me.textContent="DK1",se=m("option"),se.textContent="DK2",pe=m("option"),pe.textContent="Austria",Q=m("option"),Q.textContent="Belgium",oe=m("option"),oe.textContent="Czech Republic",Ne=m("option"),Ne.textContent="Estonia",Me=m("option"),Me.textContent="Finland",he=m("option"),he.textContent="France",x=m("option"),x.textContent="Germany",_e=m("option"),_e.textContent="Great Britain",Le=m("option"),Le.textContent="Latvia",je=m("option"),je.textContent="Lithuania",Ke=m("option"),Ke.textContent="Netherland",Fe=m("option"),Fe.textContent="Poland",He=m("option"),He.textContent="Switzerland",re=h(),ge=m("div"),Ot=C("Currency"),Wl=m("br"),xt=h(),ft=m("select");for(let M=0;M<4;M+=1)fs[M].c();Nl=h(),_l=m("div"),qt=m("div"),pt=m("div"),Qe=C("Fixed price"),Xe=m("br"),Ze=h(),Ue=m("input"),Je=h(),Ge=m("div"),xe=C("Multiplier"),et=m("br"),ue=h(),be=m("input"),Pi=h(),dl=m("div"),pn=m("label"),Tt=m("input"),Ni=C(" Enable price fetch from remote server"),Mi=h(),dt&&dt.c(),Ai=h(),vl=m("div"),Di=C("Security"),Ii=m("br"),Ei=h(),St=m("select"),Ml=m("option"),Ml.textContent="None",Be=m("option"),Be.textContent="Only configuration",hl=m("option"),hl.textContent="Everything",Gl=h(),vt&&vt.c(),Ps=h(),qe=m("div"),el=m("strong"),el.textContent="Meter",Fi=h(),Al=m("a"),J(_n.$$.fragment),$o=h(),ai=m("input"),To=h(),tl=m("div"),Ri=m("span"),Ri.textContent="Buffer size",So=h(),Ns=m("span"),Ns.textContent="Serial conf.",Po=h(),fi=m("label"),Ht=m("input"),No=C(" inverted"),Mo=h(),Dl=m("div"),ll=m("select"),Il=m("option"),Ao=C("Autodetect");for(let M=0;M<7;M+=1)cs[M].c();Do=h(),ct=m("select"),El=m("option"),Io=C("-"),dn=m("option"),dn.textContent="7N1",vn=m("option"),vn.textContent="8N1",hn=m("option"),hn.textContent="7E1",bn=m("option"),bn.textContent="8E1",Eo=h(),Dt=m("input"),Fo=h(),Bl=m("div"),Ro=C("Voltage"),Lo=m("br"),Uo=h(),nl=m("select"),gn=m("option"),gn.textContent="400V (TN)",kn=m("option"),kn.textContent="230V (IT/TT)",Oo=h(),wn=m("div"),zl=m("div"),qo=C("Main fuse"),Ho=m("br"),jo=h(),yn=m("label"),jt=m("input"),Wo=h(),qi=m("span"),qi.textContent="A",Go=h(),Yl=m("div"),Bo=C("Production"),zo=m("br"),Yo=h(),Cn=m("label"),Wt=m("input"),Vo=h(),Hi=m("span"),Hi.textContent="kWp",Ko=h(),Ms=m("div"),Qo=h(),Vl=m("div"),ji=m("label"),Gt=m("input"),Xo=C(" Meter is encrypted"),Zo=h(),ht&&ht.c(),Jo=h(),bt&&bt.c(),As=h(),Wi=m("label"),Bt=m("input"),xo=C(" Multipliers"),eu=h(),gt&>.c(),tu=h(),lt=m("div"),Gi=m("strong"),Gi.textContent="WiFi",lu=h(),$n=m("a"),J(Tn.$$.fragment),nu=h(),ci=m("input"),iu=h(),Kl=m("div"),su=C("SSID"),ou=m("br"),uu=h(),bl=m("input"),ru=h(),Ql=m("div"),au=C("Password"),fu=m("br"),cu=h(),gl=m("input"),mu=h(),Sn=m("div"),Xl=m("div"),pu=C("Power saving"),_u=m("br"),du=h(),It=m("select"),Pn=m("option"),Pn.textContent="Default",Nn=m("option"),Nn.textContent="Off",Mn=m("option"),Mn.textContent="Minimum",An=m("option"),An.textContent="Maximum",vu=h(),Zl=m("div"),hu=C("Power"),bu=m("br"),gu=h(),Dn=m("div"),Et=m("input"),ku=h(),Bi=m("span"),Bi.textContent="dBm",wu=h(),zi=m("div"),Yi=m("label"),zt=m("input"),yu=C(" Auto reboot on connection problem"),Cu=h(),Vi=m("div"),Ki=m("label"),Yt=m("input"),$u=C(" Allow 802.11b legacy rates"),Tu=h(),at=m("div"),Qi=m("strong"),Qi.textContent="Network",Su=h(),In=m("a"),J(En.$$.fragment),Pu=h(),Jl=m("div"),Nu=C("IP"),Mu=m("br"),Au=h(),Fl=m("div"),il=m("select"),Fn=m("option"),Fn.textContent="DHCP",Rn=m("option"),Rn.textContent="Static",Du=h(),Pt=m("input"),Iu=h(),Nt=m("select"),J(Ln.$$.fragment),Eu=h(),kt&&kt.c(),Ds=h(),es=m("div"),ts=m("label"),Vt=m("input"),Fu=C(" enable mDNS"),Ru=h(),mi=m("input"),Lu=h(),Rl=m("div"),Uu=C("NTP "),pi=m("label"),Kt=m("input"),Ou=C(" obtain from DHCP"),qu=m("br"),Hu=h(),ls=m("div"),kl=m("input"),ju=h(),Ye=m("div"),ns=m("strong"),ns.textContent="MQTT",Wu=h(),Un=m("a"),J(On.$$.fragment),Gu=h(),_i=m("input"),Bu=h(),sl=m("div"),zu=C(`Server\r - `),wt&&wt.c(),Is=h(),Yu=m("br"),Vu=h(),qn=m("div"),wl=m("input"),Ku=h(),Qt=m("input"),Qu=h(),nt&&nt.c(),Es=h(),xl=m("div"),Xu=C("Username"),Zu=m("br"),Ju=h(),yl=m("input"),xu=h(),en=m("div"),er=C("Password"),tr=m("br"),lr=h(),Cl=m("input"),nr=h(),Hn=m("div"),jn=m("div"),ir=C("Client ID"),sr=m("br"),or=h(),$l=m("input"),ur=h(),Wn=m("div"),rr=C("Payload"),ar=m("br"),fr=h(),_t=m("select"),Gn=m("option"),Gn.textContent="JSON",Bn=m("option"),Bn.textContent="Raw (minimal)",zn=m("option"),zn.textContent="Raw (full)",Yn=m("option"),Yn.textContent="Domoticz",Vn=m("option"),Vn.textContent="HomeAssistant",Kn=m("option"),Kn.textContent="HEX dump",cr=h(),tn=m("div"),mr=C("Publish topic"),pr=m("br"),_r=h(),Tl=m("input"),dr=h(),it&&it.c(),Fs=h(),st&&st.c(),Rs=h(),ot&&ot.c(),Us=h(),ol=m("div"),is=m("strong"),is.textContent="User interface",vr=h(),Qn=m("a"),J(Xn.$$.fragment),hr=h(),di=m("input"),br=h(),vi=m("div");for(let M=0;MSave',Hs=h(),J(ln.$$.fragment),js=h(),J(nn.$$.fragment),Ws=h(),J(sn.$$.fragment),Gs=h(),J(on.$$.fragment),u(i,"class","text-sm"),u(r,"href",Lt("General-configuration")),u(r,"target","_blank"),u(r,"class","float-right"),u(c,"type","hidden"),u(c,"name","g"),c.value="true",u($,"name","gh"),u($,"type","text"),u($,"class","in-f w-full"),u($,"pattern","[A-Za-z0-9-]+"),u(E,"name","gt"),u(E,"class","in-l w-full"),t[3].g.t===void 0&&tt(()=>t[13].call(E)),u(b,"class","flex"),u(_,"class","my-1"),u(U,"type","hidden"),u(U,"name","p"),U.value="true",te.__value="10YNO-1--------2",te.value=te.__value,le.__value="10YNO-2--------T",le.value=le.__value,de.__value="10YNO-3--------J",de.value=de.__value,ie.__value="10YNO-4--------9",ie.value=ie.__value,we.__value="10Y1001A1001A48H",we.value=we.__value,u(j,"label","Norway"),$e.__value="10Y1001A1001A44P",$e.value=$e.__value,Ee.__value="10Y1001A1001A45N",Ee.value=Ee.__value,ve.__value="10Y1001A1001A46L",ve.value=ve.__value,Pe.__value="10Y1001A1001A47J",Pe.value=Pe.__value,u(Ie,"label","Sweden"),me.__value="10YDK-1--------W",me.value=me.__value,se.__value="10YDK-2--------M",se.value=se.__value,u(Ae,"label","Denmark"),pe.__value="10YAT-APG------L",pe.value=pe.__value,Q.__value="10YBE----------2",Q.value=Q.__value,oe.__value="10YCZ-CEPS-----N",oe.value=oe.__value,Ne.__value="10Y1001A1001A39I",Ne.value=Ne.__value,Me.__value="10YFI-1--------U",Me.value=Me.__value,he.__value="10YFR-RTE------C",he.value=he.__value,x.__value="10Y1001A1001A83F",x.value=x.__value,_e.__value="10YGB----------A",_e.value=_e.__value,Le.__value="10YLV-1001A00074",Le.value=Le.__value,je.__value="10YLT-1001A0008Q",je.value=je.__value,Ke.__value="10YNL----------L",Ke.value=Ke.__value,Fe.__value="10YPL-AREA-----S",Fe.value=Fe.__value,He.__value="10YCH-SWISSGRIDZ",He.value=He.__value,u(W,"name","pr"),u(W,"class","in-f w-full"),t[3].p.r===void 0&&tt(()=>t[14].call(W)),u(O,"class","w-full"),u(ft,"name","pc"),u(ft,"class","in-l"),t[3].p.c===void 0&&tt(()=>t[15].call(ft)),u(z,"class","flex"),u(q,"class","my-1"),u(Ue,"name","pf"),u(Ue,"type","number"),u(Ue,"min","0.001"),u(Ue,"max","65"),u(Ue,"step","0.001"),u(Ue,"class","in-f tr w-full"),u(pt,"class","w-1/2"),u(be,"name","pm"),u(be,"type","number"),u(be,"min","0.001"),u(be,"max","1000"),u(be,"step","0.001"),u(be,"class","in-l tr w-full"),u(Ge,"class","w-1/2"),u(qt,"class","flex"),u(_l,"class","my-1"),u(Tt,"type","checkbox"),u(Tt,"name","pe"),Tt.__value="true",Tt.value=Tt.__value,u(Tt,"class","rounded mb-1"),u(dl,"class","my-1"),Ml.__value=0,Ml.value=Ml.__value,Be.__value=1,Be.value=Be.__value,hl.__value=2,hl.value=hl.__value,u(St,"name","gs"),u(St,"class","in-s"),t[3].g.s===void 0&&tt(()=>t[20].call(St)),u(vl,"class","my-1"),u(n,"class","cnt"),u(el,"class","text-sm"),u(Al,"href",Lt("Meter-configuration")),u(Al,"target","_blank"),u(Al,"class","float-right"),u(ai,"type","hidden"),u(ai,"name","m"),ai.value="true",u(Ri,"class","float-right"),u(Ht,"name","mi"),Ht.__value="true",Ht.value=Ht.__value,u(Ht,"type","checkbox"),u(Ht,"class","rounded mb-1"),u(fi,"class","mt-2 ml-3 whitespace-nowrap"),Il.__value=0,Il.value=Il.__value,Il.disabled=Li=t[3].m.b!=0,u(ll,"name","mb"),u(ll,"class","in-f tr w-1/2"),t[3].m.b===void 0&&tt(()=>t[24].call(ll)),El.__value=0,El.value=El.__value,El.disabled=Ui=t[3].m.b!=0,dn.__value=2,dn.value=dn.__value,vn.__value=3,vn.value=vn.__value,hn.__value=10,hn.value=hn.__value,bn.__value=11,bn.value=bn.__value,u(ct,"name","mp"),u(ct,"class","in-m"),ct.disabled=Oi=t[3].m.b==0,t[3].m.p===void 0&&tt(()=>t[25].call(ct)),u(Dt,"name","ms"),u(Dt,"type","number"),u(Dt,"min",64),u(Dt,"max",4096),u(Dt,"step",64),u(Dt,"class","in-l tr w-1/2"),u(Dl,"class","flex w-full"),u(tl,"class","my-1"),gn.__value=2,gn.value=gn.__value,kn.__value=1,kn.value=kn.__value,u(nl,"name","md"),u(nl,"class","in-s"),t[3].m.d===void 0&&tt(()=>t[27].call(nl)),u(Bl,"class","my-1"),u(jt,"name","mf"),u(jt,"type","number"),u(jt,"min","5"),u(jt,"max","65535"),u(jt,"class","in-f tr w-full"),u(qi,"class","in-post"),u(yn,"class","flex"),u(zl,"class","mx-1"),u(Wt,"name","mr"),u(Wt,"type","number"),u(Wt,"min","0"),u(Wt,"max","65535"),u(Wt,"class","in-f tr w-full"),u(Hi,"class","in-post"),u(Cn,"class","flex"),u(Yl,"class","mx-1"),u(wn,"class","my-1 flex"),u(Ms,"class","my-1"),u(Gt,"type","checkbox"),u(Gt,"name","me"),Gt.__value="true",Gt.value=Gt.__value,u(Gt,"class","rounded mb-1"),u(Vl,"class","my-1"),u(Bt,"type","checkbox"),u(Bt,"name","mm"),Bt.__value="true",Bt.value=Bt.__value,u(Bt,"class","rounded mb-1"),u(qe,"class","cnt"),u(Gi,"class","text-sm"),u($n,"href",Lt("WiFi-configuration")),u($n,"target","_blank"),u($n,"class","float-right"),u(ci,"type","hidden"),u(ci,"name","w"),ci.value="true",u(bl,"name","ws"),u(bl,"type","text"),u(bl,"class","in-s"),u(Kl,"class","my-1"),u(gl,"name","wp"),u(gl,"type","password"),u(gl,"class","in-s"),u(Ql,"class","my-1"),Pn.__value=255,Pn.value=Pn.__value,Nn.__value=0,Nn.value=Nn.__value,Mn.__value=1,Mn.value=Mn.__value,An.__value=2,An.value=An.__value,u(It,"name","wz"),u(It,"class","in-s"),t[3].w.z===void 0&&tt(()=>t[40].call(It)),u(Xl,"class","w-1/2"),u(Et,"name","ww"),u(Et,"type","number"),u(Et,"min","0"),u(Et,"max","20.5"),u(Et,"step","0.5"),u(Et,"class","in-f tr w-full"),u(Bi,"class","in-post"),u(Dn,"class","flex"),u(Zl,"class","ml-2 w-1/2"),u(Sn,"class","my-1 flex"),u(zt,"type","checkbox"),u(zt,"name","wa"),zt.__value="true",zt.value=zt.__value,u(zt,"class","rounded mb-1"),u(zi,"class","my-3"),u(Yt,"type","checkbox"),u(Yt,"name","wb"),Yt.__value="true",Yt.value=Yt.__value,u(Yt,"class","rounded mb-1"),u(Vi,"class","my-3"),u(lt,"class","cnt"),u(Qi,"class","text-sm"),u(In,"href",Lt("Network-configuration")),u(In,"target","_blank"),u(In,"class","float-right"),Fn.__value="dhcp",Fn.value=Fn.__value,Rn.__value="static",Rn.value=Rn.__value,u(il,"name","nm"),u(il,"class","in-f"),t[3].n.m===void 0&&tt(()=>t[44].call(il)),u(Pt,"name","ni"),u(Pt,"type","text"),u(Pt,"class","in-m w-full"),Pt.disabled=Xi=t[3].n.m=="dhcp",Pt.required=Zi=t[3].n.m=="static",u(Nt,"name","ns"),u(Nt,"class","in-l"),Nt.disabled=Ji=t[3].n.m=="dhcp",Nt.required=xi=t[3].n.m=="static",t[3].n.s===void 0&&tt(()=>t[46].call(Nt)),u(Fl,"class","flex"),u(Jl,"class","my-1"),u(Vt,"name","nd"),Vt.__value="true",Vt.value=Vt.__value,u(Vt,"type","checkbox"),u(Vt,"class","rounded mb-1"),u(es,"class","my-1"),u(mi,"type","hidden"),u(mi,"name","ntp"),mi.value="true",u(Kt,"name","ntpd"),Kt.__value="true",Kt.value=Kt.__value,u(Kt,"type","checkbox"),u(Kt,"class","rounded mb-1"),u(pi,"class","ml-4"),u(kl,"name","ntph"),u(kl,"type","text"),u(kl,"class","in-s"),u(ls,"class","flex"),u(Rl,"class","my-1"),u(at,"class","cnt"),u(ns,"class","text-sm"),u(Un,"href",Lt("MQTT-configuration")),u(Un,"target","_blank"),u(Un,"class","float-right"),u(_i,"type","hidden"),u(_i,"name","q"),_i.value="true",u(wl,"name","qh"),u(wl,"type","text"),u(wl,"class","in-f w-3/4"),u(Qt,"name","qp"),u(Qt,"type","number"),u(Qt,"min","1024"),u(Qt,"max","65535"),u(Qt,"class","in-l tr w-1/4"),u(qn,"class","flex"),u(sl,"class","my-1"),u(yl,"name","qu"),u(yl,"type","text"),u(yl,"class","in-s"),u(xl,"class","my-1"),u(Cl,"name","qa"),u(Cl,"type","password"),u(Cl,"class","in-s"),u(en,"class","my-1"),u($l,"name","qc"),u($l,"type","text"),u($l,"class","in-f w-full"),Gn.__value=0,Gn.value=Gn.__value,Bn.__value=1,Bn.value=Bn.__value,zn.__value=2,zn.value=zn.__value,Yn.__value=3,Yn.value=Yn.__value,Vn.__value=4,Vn.value=Vn.__value,Kn.__value=255,Kn.value=Kn.__value,u(_t,"name","qm"),u(_t,"class","in-l"),t[3].q.m===void 0&&tt(()=>t[59].call(_t)),u(Hn,"class","my-1 flex"),u(Tl,"name","qb"),u(Tl,"type","text"),u(Tl,"class","in-s"),u(tn,"class","my-1"),u(Ye,"class","cnt"),u(is,"class","text-sm"),u(Qn,"href",Lt("User-interface")),u(Qn,"target","_blank"),u(Qn,"class","float-right"),u(di,"type","hidden"),u(di,"name","u"),di.value="true",u(vi,"class","flex flex-wrap"),u(ol,"class","cnt"),u(ss,"class","text-sm"),u(Zn,"href","https://amsleser.no/blog/post/24-telnet-debug"),u(Zn,"target","_blank"),u(Zn,"class","float-right"),u(hi,"type","hidden"),u(hi,"name","d"),hi.value="true",u(Xt,"type","checkbox"),u(Xt,"name","ds"),Xt.__value="true",Xt.value=Xt.__value,u(Xt,"class","rounded mb-1"),u(os,"class","mt-3"),u(Mt,"class","cnt"),u(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),u(xn,"type","button"),u(xn,"class","py-2 px-4 rounded bg-red-500 text-white ml-2"),u(ei,"type","button"),u(ei,"class","py-2 px-4 rounded bg-yellow-500 text-white"),u(rs,"class","text-center"),u(as,"class","text-right"),u(Ll,"class","grid grid-cols-3"),u(e,"autocomplete","off")},m(M,ee){y(M,e,ee),s(e,l),s(l,n),s(n,i),s(n,o),s(n,r),X(a,r,null),s(n,f),s(n,c),s(n,p),s(n,_),s(_,b),s(b,d),s(d,v),s(d,g),s(d,k),s(d,$),V($,t[3].g.h),s(b,T),s(b,P),s(P,I),s(P,S),s(P,A),s(P,E),X(F,E,null),Re(E,t[3].g.t),s(n,Y),s(n,U),s(n,R),s(n,q),s(q,z),s(z,O),s(O,H),s(O,G),s(O,L),s(O,W),s(W,j),s(j,te),s(j,le),s(j,de),s(j,ie),s(j,we),s(W,Ie),s(Ie,$e),s(Ie,Ee),s(Ie,ve),s(Ie,Pe),s(W,Ae),s(Ae,me),s(Ae,se),s(W,pe),s(W,Q),s(W,oe),s(W,Ne),s(W,Me),s(W,he),s(W,x),s(W,_e),s(W,Le),s(W,je),s(W,Ke),s(W,Fe),s(W,He),Re(W,t[3].p.r),s(z,re),s(z,ge),s(ge,Ot),s(ge,Wl),s(ge,xt),s(ge,ft);for(let $t=0;$t<4;$t+=1)fs[$t].m(ft,null);Re(ft,t[3].p.c),s(n,Nl),s(n,_l),s(_l,qt),s(qt,pt),s(pt,Qe),s(pt,Xe),s(pt,Ze),s(pt,Ue),V(Ue,t[3].p.f),s(qt,Je),s(qt,Ge),s(Ge,xe),s(Ge,et),s(Ge,ue),s(Ge,be),V(be,t[3].p.m),s(n,Pi),s(n,dl),s(dl,pn),s(pn,Tt),Tt.checked=t[3].p.e,s(pn,Ni),s(dl,Mi),dt&&dt.m(dl,null),s(n,Ai),s(n,vl),s(vl,Di),s(vl,Ii),s(vl,Ei),s(vl,St),s(St,Ml),s(St,Be),s(St,hl),Re(St,t[3].g.s),s(n,Gl),vt&&vt.m(n,null),s(l,Ps),s(l,qe),s(qe,el),s(qe,Fi),s(qe,Al),X(_n,Al,null),s(qe,$o),s(qe,ai),s(qe,To),s(qe,tl),s(tl,Ri),s(tl,So),s(tl,Ns),s(tl,Po),s(tl,fi),s(fi,Ht),Ht.checked=t[3].m.i,s(fi,No),s(tl,Mo),s(tl,Dl),s(Dl,ll),s(ll,Il),s(Il,Ao);for(let $t=0;$t<7;$t+=1)cs[$t].m(ll,null);Re(ll,t[3].m.b),s(Dl,Do),s(Dl,ct),s(ct,El),s(El,Io),s(ct,dn),s(ct,vn),s(ct,hn),s(ct,bn),Re(ct,t[3].m.p),s(Dl,Eo),s(Dl,Dt),V(Dt,t[3].m.s),s(qe,Fo),s(qe,Bl),s(Bl,Ro),s(Bl,Lo),s(Bl,Uo),s(Bl,nl),s(nl,gn),s(nl,kn),Re(nl,t[3].m.d),s(qe,Oo),s(qe,wn),s(wn,zl),s(zl,qo),s(zl,Ho),s(zl,jo),s(zl,yn),s(yn,jt),V(jt,t[3].m.f),s(yn,Wo),s(yn,qi),s(wn,Go),s(wn,Yl),s(Yl,Bo),s(Yl,zo),s(Yl,Yo),s(Yl,Cn),s(Cn,Wt),V(Wt,t[3].m.r),s(Cn,Vo),s(Cn,Hi),s(qe,Ko),s(qe,Ms),s(qe,Qo),s(qe,Vl),s(Vl,ji),s(ji,Gt),Gt.checked=t[3].m.e.e,s(ji,Xo),s(Vl,Zo),ht&&ht.m(Vl,null),s(qe,Jo),bt&&bt.m(qe,null),s(qe,As),s(qe,Wi),s(Wi,Bt),Bt.checked=t[3].m.m.e,s(Wi,xo),s(qe,eu),gt&>.m(qe,null),s(l,tu),s(l,lt),s(lt,Gi),s(lt,lu),s(lt,$n),X(Tn,$n,null),s(lt,nu),s(lt,ci),s(lt,iu),s(lt,Kl),s(Kl,su),s(Kl,ou),s(Kl,uu),s(Kl,bl),V(bl,t[3].w.s),s(lt,ru),s(lt,Ql),s(Ql,au),s(Ql,fu),s(Ql,cu),s(Ql,gl),V(gl,t[3].w.p),s(lt,mu),s(lt,Sn),s(Sn,Xl),s(Xl,pu),s(Xl,_u),s(Xl,du),s(Xl,It),s(It,Pn),s(It,Nn),s(It,Mn),s(It,An),Re(It,t[3].w.z),s(Sn,vu),s(Sn,Zl),s(Zl,hu),s(Zl,bu),s(Zl,gu),s(Zl,Dn),s(Dn,Et),V(Et,t[3].w.w),s(Dn,ku),s(Dn,Bi),s(lt,wu),s(lt,zi),s(zi,Yi),s(Yi,zt),zt.checked=t[3].w.a,s(Yi,yu),s(lt,Cu),s(lt,Vi),s(Vi,Ki),s(Ki,Yt),Yt.checked=t[3].w.b,s(Ki,$u),s(l,Tu),s(l,at),s(at,Qi),s(at,Su),s(at,In),X(En,In,null),s(at,Pu),s(at,Jl),s(Jl,Nu),s(Jl,Mu),s(Jl,Au),s(Jl,Fl),s(Fl,il),s(il,Fn),s(il,Rn),Re(il,t[3].n.m),s(Fl,Du),s(Fl,Pt),V(Pt,t[3].n.i),s(Fl,Iu),s(Fl,Nt),X(Ln,Nt,null),Re(Nt,t[3].n.s),s(at,Eu),kt&&kt.m(at,null),s(at,Ds),s(at,es),s(es,ts),s(ts,Vt),Vt.checked=t[3].n.d,s(ts,Fu),s(at,Ru),s(at,mi),s(at,Lu),s(at,Rl),s(Rl,Uu),s(Rl,pi),s(pi,Kt),Kt.checked=t[3].n.h,s(pi,Ou),s(Rl,qu),s(Rl,Hu),s(Rl,ls),s(ls,kl),V(kl,t[3].n.n1),s(l,ju),s(l,Ye),s(Ye,ns),s(Ye,Wu),s(Ye,Un),X(On,Un,null),s(Ye,Gu),s(Ye,_i),s(Ye,Bu),s(Ye,sl),s(sl,zu),wt&&wt.m(sl,null),s(sl,Is),s(sl,Yu),s(sl,Vu),s(sl,qn),s(qn,wl),V(wl,t[3].q.h),s(qn,Ku),s(qn,Qt),V(Qt,t[3].q.p),s(Ye,Qu),nt&&nt.m(Ye,null),s(Ye,Es),s(Ye,xl),s(xl,Xu),s(xl,Zu),s(xl,Ju),s(xl,yl),V(yl,t[3].q.u),s(Ye,xu),s(Ye,en),s(en,er),s(en,tr),s(en,lr),s(en,Cl),V(Cl,t[3].q.a),s(Ye,nr),s(Ye,Hn),s(Hn,jn),s(jn,ir),s(jn,sr),s(jn,or),s(jn,$l),V($l,t[3].q.c),s(Hn,ur),s(Hn,Wn),s(Wn,rr),s(Wn,ar),s(Wn,fr),s(Wn,_t),s(_t,Gn),s(_t,Bn),s(_t,zn),s(_t,Yn),s(_t,Vn),s(_t,Kn),Re(_t,t[3].q.m),s(Ye,cr),s(Ye,tn),s(tn,mr),s(tn,pr),s(tn,_r),s(tn,Tl),V(Tl,t[3].q.b),s(l,dr),it&&it.m(l,null),s(l,Fs),st&&st.m(l,null),s(l,Rs),ot&&ot.m(l,null),s(l,Us),s(l,ol),s(ol,is),s(ol,vr),s(ol,Qn),X(Xn,Qn,null),s(ol,hr),s(ol,di),s(ol,br),s(ol,vi);for(let $t=0;$t0?vt?vt.p(M,ee):(vt=of(M),vt.c(),vt.m(n,null)):vt&&(vt.d(1),vt=null),ee[0]&8&&(Ht.checked=M[3].m.i),(!Zt||ee[0]&8&&Li!==(Li=M[3].m.b!=0))&&(Il.disabled=Li),ee[0]&8&&Re(ll,M[3].m.b),(!Zt||ee[0]&8&&Ui!==(Ui=M[3].m.b!=0))&&(El.disabled=Ui),(!Zt||ee[0]&8&&Oi!==(Oi=M[3].m.b==0))&&(ct.disabled=Oi),ee[0]&8&&Re(ct,M[3].m.p),ee[0]&8&&ae(Dt.value)!==M[3].m.s&&V(Dt,M[3].m.s),ee[0]&8&&Re(nl,M[3].m.d),ee[0]&8&&ae(jt.value)!==M[3].m.f&&V(jt,M[3].m.f),ee[0]&8&&ae(Wt.value)!==M[3].m.r&&V(Wt,M[3].m.r),ee[0]&8&&(Gt.checked=M[3].m.e.e),M[3].m.e.e?ht?ht.p(M,ee):(ht=uf(M),ht.c(),ht.m(Vl,null)):ht&&(ht.d(1),ht=null),M[3].m.e.e?bt?bt.p(M,ee):(bt=rf(M),bt.c(),bt.m(qe,As)):bt&&(bt.d(1),bt=null),ee[0]&8&&(Bt.checked=M[3].m.m.e),M[3].m.m.e?gt?gt.p(M,ee):(gt=af(M),gt.c(),gt.m(qe,null)):gt&&(gt.d(1),gt=null),ee[0]&8&&bl.value!==M[3].w.s&&V(bl,M[3].w.s),ee[0]&8&&gl.value!==M[3].w.p&&V(gl,M[3].w.p),ee[0]&8&&Re(It,M[3].w.z),ee[0]&8&&ae(Et.value)!==M[3].w.w&&V(Et,M[3].w.w),ee[0]&8&&(zt.checked=M[3].w.a),ee[0]&8&&(Yt.checked=M[3].w.b),ee[0]&8&&Re(il,M[3].n.m),(!Zt||ee[0]&8&&Xi!==(Xi=M[3].n.m=="dhcp"))&&(Pt.disabled=Xi),(!Zt||ee[0]&8&&Zi!==(Zi=M[3].n.m=="static"))&&(Pt.required=Zi),ee[0]&8&&Pt.value!==M[3].n.i&&V(Pt,M[3].n.i),(!Zt||ee[0]&8&&Ji!==(Ji=M[3].n.m=="dhcp"))&&(Nt.disabled=Ji),(!Zt||ee[0]&8&&xi!==(xi=M[3].n.m=="static"))&&(Nt.required=xi),ee[0]&8&&Re(Nt,M[3].n.s),M[3].n.m=="static"?kt?kt.p(M,ee):(kt=ff(M),kt.c(),kt.m(at,Ds)):kt&&(kt.d(1),kt=null),ee[0]&8&&(Vt.checked=M[3].n.d),ee[0]&8&&(Kt.checked=M[3].n.h),ee[0]&8&&kl.value!==M[3].n.n1&&V(kl,M[3].n.n1),M[0].chip!="esp8266"?wt?wt.p(M,ee):(wt=cf(M),wt.c(),wt.m(sl,Is)):wt&&(wt.d(1),wt=null),ee[0]&8&&wl.value!==M[3].q.h&&V(wl,M[3].q.h),ee[0]&8&&ae(Qt.value)!==M[3].q.p&&V(Qt,M[3].q.p),M[3].q.s.e?nt?(nt.p(M,ee),ee[0]&8&&N(nt,1)):(nt=mf(M),nt.c(),N(nt,1),nt.m(Ye,Es)):nt&&(Te(),D(nt,1,1,()=>{nt=null}),Se()),ee[0]&8&&yl.value!==M[3].q.u&&V(yl,M[3].q.u),ee[0]&8&&Cl.value!==M[3].q.a&&V(Cl,M[3].q.a),ee[0]&8&&$l.value!==M[3].q.c&&V($l,M[3].q.c),ee[0]&8&&Re(_t,M[3].q.m),ee[0]&8&&Tl.value!==M[3].q.b&&V(Tl,M[3].q.b),M[3].q.m==3?it?(it.p(M,ee),ee[0]&8&&N(it,1)):(it=pf(M),it.c(),N(it,1),it.m(l,Fs)):it&&(Te(),D(it,1,1,()=>{it=null}),Se()),M[3].q.m==4?st?(st.p(M,ee),ee[0]&8&&N(st,1)):(st=_f(M),st.c(),N(st,1),st.m(l,Rs)):st&&(Te(),D(st,1,1,()=>{st=null}),Se()),ee[0]&8&&(Ls=M[3].p.r.startsWith("10YNO")||M[3].p.r=="10Y1001A1001A48H"),Ls?ot?(ot.p(M,ee),ee[0]&8&&N(ot,1)):(ot=df(M),ot.c(),N(ot,1),ot.m(l,Us)):ot&&(Te(),D(ot,1,1,()=>{ot=null}),Se()),ee[0]&136){ti=M[7];let Ft;for(Ft=0;Ft20||M[0].chip=="esp8266"?ut?(ut.p(M,ee),ee[0]&1&&N(ut,1)):(ut=bf(M),ut.c(),N(ut,1),ut.m(l,Os)):ut&&(Te(),D(ut,1,1,()=>{ut=null}),Se()),ee[0]&8&&(Xt.checked=M[3].d.s),M[3].d.s?Ct?Ct.p(M,ee):(Ct=$f(M),Ct.c(),Ct.m(Mt,null)):Ct&&(Ct.d(1),Ct=null);const $t={};ee[0]&2&&($t.active=M[1]),ln.$set($t);const Mr={};ee[0]&4&&(Mr.active=M[2]),nn.$set(Mr);const Ar={};ee[0]&16&&(Ar.active=M[4]),sn.$set(Ar);const Dr={};ee[0]&32&&(Dr.active=M[5]),on.$set(Dr)},i(M){Zt||(N(a.$$.fragment,M),N(F.$$.fragment,M),N(_n.$$.fragment,M),N(Tn.$$.fragment,M),N(En.$$.fragment,M),N(Ln.$$.fragment,M),N(On.$$.fragment,M),N(nt),N(it),N(st),N(ot),N(Xn.$$.fragment,M),N(ut),N(Jn.$$.fragment,M),N(ln.$$.fragment,M),N(nn.$$.fragment,M),N(sn.$$.fragment,M),N(on.$$.fragment,M),Zt=!0)},o(M){D(a.$$.fragment,M),D(F.$$.fragment,M),D(_n.$$.fragment,M),D(Tn.$$.fragment,M),D(En.$$.fragment,M),D(Ln.$$.fragment,M),D(On.$$.fragment,M),D(nt),D(it),D(st),D(ot),D(Xn.$$.fragment,M),D(ut),D(Jn.$$.fragment,M),D(ln.$$.fragment,M),D(nn.$$.fragment,M),D(sn.$$.fragment,M),D(on.$$.fragment,M),Zt=!1},d(M){M&&w(e),Z(a),Z(F),ml(fs,M),dt&&dt.d(),vt&&vt.d(),Z(_n),ml(cs,M),ht&&ht.d(),bt&&bt.d(),gt&>.d(),Z(Tn),Z(En),Z(Ln),kt&&kt.d(),Z(On),wt&&wt.d(),nt&&nt.d(),it&&it.d(),st&&st.d(),ot&&ot.d(),Z(Xn),ml(yt,M),ut&&ut.d(),Z(Jn),Ct&&Ct.d(),M&&w(Hs),Z(ln,M),M&&w(js),Z(nn,M),M&&w(Ws),Z(sn,M),M&&w(Gs),Z(on,M),Bs=!1,Ve(Nr)}}}async function Zp(){await(await fetch("/reboot",{method:"POST"})).json()}function Jp(t,e,l){let{sysinfo:n={}}=e,i=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{name:"Reactive",key:"r"},{name:"Realtime",key:"c"},{name:"Peaks",key:"t"},{name:"Price",key:"p"},{name:"Day plot",key:"d"},{name:"Month plot",key:"m"},{name:"Temperature plot",key:"s"}],o=!0,r=!1,a={g:{t:"",h:"",s:0,u:"",p:""},m:{b:2400,p:11,i:!1,d:0,f:0,r:0,e:{e:!1,k:"",a:""},m:{e:!1,w:!1,v:!1,a:!1,c:!1}},w:{s:"",p:"",w:0,z:255,a:!0,b:!0},n:{m:"",i:"",s:"",g:"",d1:"",d2:"",d:!1,n1:"",n2:"",h:!1},q:{h:"",p:1883,u:"",a:"",b:"",s:{e:!1,c:!1,r:!0,k:!1}},o:{e:"",c:"",u1:"",u2:"",u3:""},t:{t:[0,0,0,0,0,0,0,0,0,0],h:1},p:{e:!1,t:"",r:"",c:"",m:1,f:null},d:{s:!1,t:!1,l:5},u:{i:0,e:0,v:0,a:0,r:0,c:0,t:0,p:0,d:0,m:0,s:0},i:{h:{p:null,u:!0},a:null,l:{p:null,i:!1},r:{r:null,g:null,b:null,i:!1},t:{d:null,a:null},v:{p:null,d:{v:null,g:null},o:null,m:null,b:null}},h:{t:"",h:"",n:""}};qc.subscribe(Be=>{Be.version&&(l(3,a=Be),l(1,o=!1))}),Sp();let f=!1,c=!1;async function p(){if(confirm("Are you sure you want to factory reset the device?")){l(4,f=!0);const Be=new URLSearchParams;Be.append("perform","true");let Gl=await(await fetch("/reset",{method:"POST",body:Be})).json();l(4,f=!1),l(5,c=Gl.success)}}async function _(Be){l(2,r=!0);const hl=new FormData(Be.target),Gl=new URLSearchParams;for(let el of hl){const[Fi,Al]=el;Gl.append(Fi,Al)}let qe=await(await fetch("/save",{method:"POST",body:Gl})).json();Ut.update(el=>(el.booting=qe.reboot,el.ui=a.u,el)),l(2,r=!1),ii("/")}const b=function(){confirm("Are you sure you want to reboot the device?")&&(Ut.update(Be=>(Be.booting=!0,Be)),Zp())},d=function(){a.q.s.e?a.q.p==1883&&l(3,a.q.p=8883,a):a.q.p==8883&&l(3,a.q.p=1883,a)};let v=44;function g(){a.g.h=this.value,l(3,a)}function k(){a.g.t=mt(this),l(3,a)}function $(){a.p.r=mt(this),l(3,a)}function T(){a.p.c=mt(this),l(3,a)}function P(){a.p.f=ae(this.value),l(3,a)}function I(){a.p.m=ae(this.value),l(3,a)}function S(){a.p.e=this.checked,l(3,a)}function A(){a.p.t=this.value,l(3,a)}function E(){a.g.s=mt(this),l(3,a)}function F(){a.g.u=this.value,l(3,a)}function Y(){a.g.p=this.value,l(3,a)}function U(){a.m.i=this.checked,l(3,a)}function R(){a.m.b=mt(this),l(3,a)}function q(){a.m.p=mt(this),l(3,a)}function z(){a.m.s=ae(this.value),l(3,a)}function O(){a.m.d=mt(this),l(3,a)}function H(){a.m.f=ae(this.value),l(3,a)}function G(){a.m.r=ae(this.value),l(3,a)}function L(){a.m.e.e=this.checked,l(3,a)}function W(){a.m.e.k=this.value,l(3,a)}function j(){a.m.e.a=this.value,l(3,a)}function te(){a.m.m.e=this.checked,l(3,a)}function le(){a.m.m.w=ae(this.value),l(3,a)}function de(){a.m.m.v=ae(this.value),l(3,a)}function ie(){a.m.m.a=ae(this.value),l(3,a)}function we(){a.m.m.c=ae(this.value),l(3,a)}function Ie(){a.w.s=this.value,l(3,a)}function $e(){a.w.p=this.value,l(3,a)}function Ee(){a.w.z=mt(this),l(3,a)}function ve(){a.w.w=ae(this.value),l(3,a)}function Pe(){a.w.a=this.checked,l(3,a)}function Ae(){a.w.b=this.checked,l(3,a)}function me(){a.n.m=mt(this),l(3,a)}function se(){a.n.i=this.value,l(3,a)}function pe(){a.n.s=mt(this),l(3,a)}function Q(){a.n.g=this.value,l(3,a)}function oe(){a.n.d1=this.value,l(3,a)}function Ne(){a.n.d2=this.value,l(3,a)}function Me(){a.n.d=this.checked,l(3,a)}function he(){a.n.h=this.checked,l(3,a)}function x(){a.n.n1=this.value,l(3,a)}function _e(){a.q.s.e=this.checked,l(3,a)}function Le(){a.q.h=this.value,l(3,a)}function je(){a.q.p=ae(this.value),l(3,a)}function Ke(){a.q.u=this.value,l(3,a)}function Fe(){a.q.a=this.value,l(3,a)}function He(){a.q.c=this.value,l(3,a)}function re(){a.q.m=mt(this),l(3,a)}function ge(){a.q.b=this.value,l(3,a)}function Ot(){a.o.e=this.value,l(3,a)}function Wl(){a.o.c=this.value,l(3,a)}function xt(){a.o.u1=this.value,l(3,a)}function ft(){a.o.u2=this.value,l(3,a)}function Nl(){a.o.u3=this.value,l(3,a)}function _l(){a.h.t=this.value,l(3,a)}function qt(){a.h.h=this.value,l(3,a)}function pt(){a.h.n=this.value,l(3,a)}function Qe(Be){a.t.t[Be]=ae(this.value),l(3,a)}function Xe(){a.t.h=ae(this.value),l(3,a)}function Ze(Be){a.u[Be.key]=mt(this),l(3,a)}function Ue(){a.i.h.u=this.checked,l(3,a)}function Je(){a.i.h.p=mt(this),l(3,a)}function Ge(){a.i.a=ae(this.value),l(3,a)}function xe(){a.i.l.i=this.checked,l(3,a)}function et(){a.i.l.p=ae(this.value),l(3,a)}function ue(){a.i.r.i=this.checked,l(3,a)}function be(){a.i.r.r=ae(this.value),l(3,a)}function Pi(){a.i.r.g=ae(this.value),l(3,a)}function dl(){a.i.r.b=ae(this.value),l(3,a)}function pn(){a.i.t.d=ae(this.value),l(3,a)}function Tt(){a.i.t.a=ae(this.value),l(3,a)}function Ni(){a.i.v.p=ae(this.value),l(3,a)}function Mi(){a.i.v.d.v=ae(this.value),l(3,a)}function Ai(){a.i.v.d.g=ae(this.value),l(3,a)}function vl(){a.i.v.o=ae(this.value),l(3,a)}function Di(){a.i.v.m=ae(this.value),l(3,a)}function Ii(){a.i.v.b=ae(this.value),l(3,a)}function Ei(){a.d.s=this.checked,l(3,a)}function St(){a.d.t=this.checked,l(3,a)}function Ml(){a.d.l=mt(this),l(3,a)}return t.$$set=Be=>{"sysinfo"in Be&&l(0,n=Be.sysinfo)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(6,v=n.chip=="esp8266"?16:n.chip=="esp32s2"?44:39)},[n,o,r,a,f,c,v,i,p,_,b,d,g,k,$,T,P,I,S,A,E,F,Y,U,R,q,z,O,H,G,L,W,j,te,le,de,ie,we,Ie,$e,Ee,ve,Pe,Ae,me,se,pe,Q,oe,Ne,Me,he,x,_e,Le,je,Ke,Fe,He,re,ge,Ot,Wl,xt,ft,Nl,_l,qt,pt,Qe,Xe,Ze,Ue,Je,Ge,xe,et,ue,be,Pi,dl,pn,Tt,Ni,Mi,Ai,vl,Di,Ii,Ei,St,Ml]}class xp extends Ce{constructor(e){super(),ye(this,e,Jp,Xp,ke,{sysinfo:0},null,[-1,-1,-1,-1])}}function Sf(t,e,l){const n=t.slice();return n[20]=e[l],n}function e0(t){let e=fe(t[1].chip,t[1].board)+"",l;return{c(){l=C(e)},m(n,i){y(n,l,i)},p(n,i){i&2&&e!==(e=fe(n[1].chip,n[1].board)+"")&&B(l,e)},d(n){n&&w(l)}}}function Pf(t){let e,l,n=t[1].apmac+"",i,o,r,a,f,c,p,_,b,d=Qr(t[1])+"",v,g,k=t[1].boot_reason+"",$,T,P=t[1].ex_cause+"",I,S,A;const E=[l0,t0],F=[];function Y(U,R){return U[0].u>0?0:1}return f=Y(t),c=F[f]=E[f](t),{c(){e=m("div"),l=C("AP MAC: "),i=C(n),o=h(),r=m("div"),a=C(`Last boot:\r - `),c.c(),p=h(),_=m("div"),b=C("Reason: "),v=C(d),g=C(" ("),$=C(k),T=C("/"),I=C(P),S=C(")"),u(e,"class","my-2"),u(r,"class","my-2"),u(_,"class","my-2")},m(U,R){y(U,e,R),s(e,l),s(e,i),y(U,o,R),y(U,r,R),s(r,a),F[f].m(r,null),y(U,p,R),y(U,_,R),s(_,b),s(_,v),s(_,g),s(_,$),s(_,T),s(_,I),s(_,S),A=!0},p(U,R){(!A||R&2)&&n!==(n=U[1].apmac+"")&&B(i,n);let q=f;f=Y(U),f===q?F[f].p(U,R):(Te(),D(F[q],1,1,()=>{F[q]=null}),Se(),c=F[f],c?c.p(U,R):(c=F[f]=E[f](U),c.c()),N(c,1),c.m(r,null)),(!A||R&2)&&d!==(d=Qr(U[1])+"")&&B(v,d),(!A||R&2)&&k!==(k=U[1].boot_reason+"")&&B($,k),(!A||R&2)&&P!==(P=U[1].ex_cause+"")&&B(I,P)},i(U){A||(N(c),A=!0)},o(U){D(c),A=!1},d(U){U&&w(e),U&&w(o),U&&w(r),F[f].d(),U&&w(p),U&&w(_)}}}function t0(t){let e;return{c(){e=C("-")},m(l,n){y(l,e,n)},p:ne,i:ne,o:ne,d(l){l&&w(e)}}}function l0(t){let e,l;return e=new Lc({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:""}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.timestamp=new Date(new Date().getTime()-n[0].u*1e3)),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function n0(t){let e;return{c(){e=m("span"),e.textContent="Update consents",u(e,"class","btn-pri-sm")},m(l,n){y(l,e,n)},p:ne,d(l){l&&w(e)}}}function Nf(t){let e,l,n,i,o,r=Cs(t[1].meter.mfg)+"",a,f,c,p,_=t[1].meter.model+"",b,d,v,g,k=t[1].meter.id+"",$;return{c(){e=m("div"),l=m("strong"),l.textContent="Meter",n=h(),i=m("div"),o=C("Manufacturer: "),a=C(r),f=h(),c=m("div"),p=C("Model: "),b=C(_),d=h(),v=m("div"),g=C("ID: "),$=C(k),u(l,"class","text-sm"),u(i,"class","my-2"),u(c,"class","my-2"),u(v,"class","my-2"),u(e,"class","cnt")},m(T,P){y(T,e,P),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,f),s(e,c),s(c,p),s(c,b),s(e,d),s(e,v),s(v,g),s(v,$)},p(T,P){P&2&&r!==(r=Cs(T[1].meter.mfg)+"")&&B(a,r),P&2&&_!==(_=T[1].meter.model+"")&&B(b,_),P&2&&k!==(k=T[1].meter.id+"")&&B($,k)},d(T){T&&w(e)}}}function Mf(t){let e,l,n,i,o,r=t[1].net.ip+"",a,f,c,p,_=t[1].net.mask+"",b,d,v,g,k=t[1].net.gw+"",$,T,P,I,S=t[1].net.dns1+"",A,E,F=t[1].net.dns2&&Af(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Network",n=h(),i=m("div"),o=C("IP: "),a=C(r),f=h(),c=m("div"),p=C("Mask: "),b=C(_),d=h(),v=m("div"),g=C("Gateway: "),$=C(k),T=h(),P=m("div"),I=C("DNS: "),A=C(S),E=h(),F&&F.c(),u(l,"class","text-sm"),u(i,"class","my-2"),u(c,"class","my-2"),u(v,"class","my-2"),u(P,"class","my-2"),u(e,"class","cnt")},m(Y,U){y(Y,e,U),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,f),s(e,c),s(c,p),s(c,b),s(e,d),s(e,v),s(v,g),s(v,$),s(e,T),s(e,P),s(P,I),s(P,A),s(P,E),F&&F.m(P,null)},p(Y,U){U&2&&r!==(r=Y[1].net.ip+"")&&B(a,r),U&2&&_!==(_=Y[1].net.mask+"")&&B(b,_),U&2&&k!==(k=Y[1].net.gw+"")&&B($,k),U&2&&S!==(S=Y[1].net.dns1+"")&&B(A,S),Y[1].net.dns2?F?F.p(Y,U):(F=Af(Y),F.c(),F.m(P,null)):F&&(F.d(1),F=null)},d(Y){Y&&w(e),F&&F.d()}}}function Af(t){let e,l=t[1].net.dns2+"",n;return{c(){e=C("/ "),n=C(l)},m(i,o){y(i,e,o),y(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns2+"")&&B(n,l)},d(i){i&&w(e),i&&w(n)}}}function Df(t){let e,l,n,i=t[1].upgrade.t+"",o,r,a=t[1].version+"",f,c,p=t[1].upgrade.x+"",_,b,d=t[1].upgrade.e+"",v,g;return{c(){e=m("div"),l=m("div"),n=C("Previous upgrade attempt ("),o=C(i),r=C(") does not match current version ("),f=C(a),c=C(") ["),_=C(p),b=C("/"),v=C(d),g=C("]"),u(l,"class","bd-yellow"),u(e,"class","my-2")},m(k,$){y(k,e,$),s(e,l),s(l,n),s(l,o),s(l,r),s(l,f),s(l,c),s(l,_),s(l,b),s(l,v),s(l,g)},p(k,$){$&2&&i!==(i=k[1].upgrade.t+"")&&B(o,i),$&2&&a!==(a=k[1].version+"")&&B(f,a),$&2&&p!==(p=k[1].upgrade.x+"")&&B(_,p),$&2&&d!==(d=k[1].upgrade.e+"")&&B(v,d)},d(k){k&&w(e)}}}function If(t){let e,l,n,i=t[2].tag_name+"",o,r,a,f,c,p,_=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[2]&&t[2].tag_name!=t[1].version&&Ef(t),b=t[1].fwconsent===2&&Ff();return{c(){e=m("div"),l=C(`Latest version: \r - `),n=m("a"),o=C(i),a=h(),_&&_.c(),f=h(),b&&b.c(),c=We(),u(n,"href",r=t[2].html_url),u(n,"class","ml-2 text-blue-600 hover:text-blue-800"),u(n,"target","_blank"),u(n,"rel","noreferrer"),u(e,"class","my-2 flex")},m(d,v){y(d,e,v),s(e,l),s(e,n),s(n,o),s(e,a),_&&_.m(e,null),y(d,f,v),b&&b.m(d,v),y(d,c,v),p=!0},p(d,v){(!p||v&4)&&i!==(i=d[2].tag_name+"")&&B(o,i),(!p||v&4&&r!==(r=d[2].html_url))&&u(n,"href",r),(d[1].security==0||d[0].a)&&d[1].fwconsent===1&&d[2]&&d[2].tag_name!=d[1].version?_?(_.p(d,v),v&7&&N(_,1)):(_=Ef(d),_.c(),N(_,1),_.m(e,null)):_&&(Te(),D(_,1,1,()=>{_=null}),Se()),d[1].fwconsent===2?b||(b=Ff(),b.c(),b.m(c.parentNode,c)):b&&(b.d(1),b=null)},i(d){p||(N(_),p=!0)},o(d){D(_),p=!1},d(d){d&&w(e),_&&_.d(),d&&w(f),b&&b.d(d),d&&w(c)}}}function Ef(t){let e,l,n,i,o,r;return n=new Uc({}),{c(){e=m("div"),l=m("button"),J(n.$$.fragment),u(e,"class","flex-none ml-2 text-green-500"),u(e,"title","Install this version")},m(a,f){y(a,e,f),s(e,l),X(n,l,null),i=!0,o||(r=K(l,"click",t[10]),o=!0)},p:ne,i(a){i||(N(n.$$.fragment,a),i=!0)},o(a){D(n.$$.fragment,a),i=!1},d(a){a&&w(e),Z(n),o=!1,r()}}}function Ff(t){let e;return{c(){e=m("div"),e.innerHTML='
You have disabled one-click firmware upgrade, link to self-upgrade is disabled
',u(e,"class","my-2")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Rf(t){let e,l=$s(fe(t[1].chip,t[1].board))+"",n;return{c(){e=m("div"),n=C(l),u(e,"class","bd-red")},m(i,o){y(i,e,o),s(e,n)},p(i,o){o&2&&l!==(l=$s(fe(i[1].chip,i[1].board))+"")&&B(n,l)},d(i){i&&w(e)}}}function Lf(t){let e,l,n,i,o,r;function a(p,_){return p[4].length==0?s0:i0}let f=a(t),c=f(t);return{c(){e=m("div"),l=m("form"),n=m("input"),i=h(),c.c(),Jf(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(p,_){y(p,e,_),s(e,l),s(l,n),t[12](n),s(l,i),c.m(l,null),o||(r=[K(n,"change",t[13]),K(l,"submit",t[15])],o=!0)},p(p,_){f===(f=a(p))&&c?c.p(p,_):(c.d(1),c=f(p),c&&(c.c(),c.m(l,null)))},d(p){p&&w(e),t[12](null),c.d(),o=!1,Ve(r)}}}function i0(t){let e=t[4][0].name+"",l,n,i;return{c(){l=C(e),n=h(),i=m("button"),i.textContent="Upload",u(i,"type","submit"),u(i,"class","btn-pri-sm float-right")},m(o,r){y(o,l,r),y(o,n,r),y(o,i,r)},p(o,r){r&16&&e!==(e=o[4][0].name+"")&&B(l,e)},d(o){o&&w(l),o&&w(n),o&&w(i)}}}function s0(t){let e,l,n;return{c(){e=m("button"),e.textContent="Select firmware file for upgrade",u(e,"type","button"),u(e,"class","btn-pri-sm float-right")},m(i,o){y(i,e,o),l||(n=K(e,"click",t[14]),l=!0)},p:ne,d(i){i&&w(e),l=!1,n()}}}function Uf(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g=t[9],k=[];for(let S=0;S Include Secrets
(SSID, PSK, passwords and tokens)',f=h(),$&&$.c(),c=h(),p=m("form"),_=m("input"),b=h(),I.c(),u(l,"class","text-sm"),u(a,"class","my-1 mx-3 col-span-2"),u(o,"class","grid grid-cols-2"),u(i,"method","get"),u(i,"action","/configfile.cfg"),u(i,"autocomplete","off"),Jf(_,"display","none"),u(_,"name","file"),u(_,"type","file"),u(_,"accept",".cfg"),u(p,"action","/configfile"),u(p,"enctype","multipart/form-data"),u(p,"method","post"),u(p,"autocomplete","off"),u(e,"class","cnt")},m(S,A){y(S,e,A),s(e,l),s(e,n),s(e,i),s(i,o);for(let E=0;E{me=null}),Se());const je={};_e&8388608&&(je.$$scope={dirty:_e,ctx:x}),S.$set(je),x[1].meter?se?se.p(x,_e):(se=Nf(x),se.c(),se.m(e,Y)):se&&(se.d(1),se=null),x[1].net?pe?pe.p(x,_e):(pe=Mf(x),pe.c(),pe.m(e,U)):pe&&(pe.d(1),pe=null),(!ve||_e&2)&&G!==(G=x[1].version+"")&&B(L,G),x[1].upgrade.t&&x[1].upgrade.t!=x[1].version?Q?Q.p(x,_e):(Q=Df(x),Q.c(),Q.m(R,j)):Q&&(Q.d(1),Q=null),x[2]?oe?(oe.p(x,_e),_e&4&&N(oe,1)):(oe=If(x),oe.c(),N(oe,1),oe.m(R,te)):oe&&(Te(),D(oe,1,1,()=>{oe=null}),Se()),_e&3&&(le=(x[1].security==0||x[0].a)&&si(x[1].board)),le?Ne?Ne.p(x,_e):(Ne=Rf(x),Ne.c(),Ne.m(R,de)):Ne&&(Ne.d(1),Ne=null),x[1].security==0||x[0].a?Me?Me.p(x,_e):(Me=Lf(x),Me.c(),Me.m(R,null)):Me&&(Me.d(1),Me=null),x[1].security==0||x[0].a?he?he.p(x,_e):(he=Uf(x),he.c(),he.m(e,null)):he&&(he.d(1),he=null);const Ke={};_e&32&&(Ke.active=x[5]),Ie.$set(Ke);const Fe={};_e&256&&(Fe.active=x[8]),Ee.$set(Fe)},i(x){ve||(N(b.$$.fragment,x),N(me),N(S.$$.fragment,x),N(oe),N(Ie.$$.fragment,x),N(Ee.$$.fragment,x),ve=!0)},o(x){D(b.$$.fragment,x),D(me),D(S.$$.fragment,x),D(oe),D(Ie.$$.fragment,x),D(Ee.$$.fragment,x),ve=!1},d(x){x&&w(e),Z(b),me&&me.d(),Z(S),se&&se.d(),pe&&pe.d(),Q&&Q.d(),oe&&oe.d(),Ne&&Ne.d(),Me&&Me.d(),he&&he.d(),x&&w(we),Z(Ie,x),x&&w($e),Z(Ee,x),Pe=!1,Ae()}}}async function a0(){await(await fetch("/reboot",{method:"POST"})).json()}function f0(t,e,l){let{data:n}=e,{sysinfo:i}=e,o=[{name:"WiFi",key:"iw"},{name:"MQTT",key:"im"},{name:"Web",key:"ie"},{name:"Meter",key:"it"},{name:"Thresholds",key:"ih"},{name:"GPIO",key:"ig"},{name:"NTP",key:"in"},{name:"Price API",key:"is"}],r={};yo.subscribe(E=>{l(2,r=Rc(i.version,E)),r||l(2,r=E[0])});function a(){confirm("Do you want to upgrade this device to "+r.tag_name+"?")&&(i.board!=2&&i.board!=4&&i.board!=7||confirm($s(fe(i.chip,i.board))))&&(Ut.update(E=>(E.upgrading=!0,E)),Fc(r.tag_name))}const f=function(){confirm("Are you sure you want to reboot the device?")&&(Ut.update(E=>(E.booting=!0,E)),a0())};let c,p=[],_=!1,b,d=[],v=!1;go();function g(E){ws[E?"unshift":"push"](()=>{c=E,l(3,c)})}function k(){p=this.files,l(4,p)}const $=()=>{c.click()},T=()=>l(5,_=!0);function P(E){ws[E?"unshift":"push"](()=>{b=E,l(6,b)})}function I(){d=this.files,l(7,d)}const S=()=>{b.click()},A=()=>l(8,v=!0);return t.$$set=E=>{"data"in E&&l(0,n=E.data),"sysinfo"in E&&l(1,i=E.sysinfo)},[n,i,r,c,p,_,b,d,v,o,a,f,g,k,$,T,P,I,S,A]}class c0 extends Ce{constructor(e){super(),ye(this,e,f0,r0,ke,{data:0,sysinfo:1})}}function Hf(t){let e,l,n=fe(t[0],7)+"",i,o,r=fe(t[0],5)+"",a,f,c=fe(t[0],4)+"",p,_,b=fe(t[0],3)+"",d,v,g,k,$=fe(t[0],2)+"",T,P,I=fe(t[0],1)+"",S,A,E=fe(t[0],0)+"",F,Y,U,R,q=fe(t[0],101)+"",z,O,H=fe(t[0],100)+"",G;return{c(){e=m("optgroup"),l=m("option"),i=C(n),o=m("option"),a=C(r),f=m("option"),p=C(c),_=m("option"),d=C(b),v=h(),g=m("optgroup"),k=m("option"),T=C($),P=m("option"),S=C(I),A=m("option"),F=C(E),Y=h(),U=m("optgroup"),R=m("option"),z=C(q),O=m("option"),G=C(H),l.__value=7,l.value=l.__value,o.__value=5,o.value=o.__value,f.__value=4,f.value=f.__value,_.__value=3,_.value=_.__value,u(e,"label","amsleser.no"),k.__value=2,k.value=k.__value,P.__value=1,P.value=P.__value,A.__value=0,A.value=A.__value,u(g,"label","Custom hardware"),R.__value=101,R.value=R.__value,O.__value=100,O.value=O.__value,u(U,"label","Generic hardware")},m(L,W){y(L,e,W),s(e,l),s(l,i),s(e,o),s(o,a),s(e,f),s(f,p),s(e,_),s(_,d),y(L,v,W),y(L,g,W),s(g,k),s(k,T),s(g,P),s(P,S),s(g,A),s(A,F),y(L,Y,W),y(L,U,W),s(U,R),s(R,z),s(U,O),s(O,G)},p(L,W){W&1&&n!==(n=fe(L[0],7)+"")&&B(i,n),W&1&&r!==(r=fe(L[0],5)+"")&&B(a,r),W&1&&c!==(c=fe(L[0],4)+"")&&B(p,c),W&1&&b!==(b=fe(L[0],3)+"")&&B(d,b),W&1&&$!==($=fe(L[0],2)+"")&&B(T,$),W&1&&I!==(I=fe(L[0],1)+"")&&B(S,I),W&1&&E!==(E=fe(L[0],0)+"")&&B(F,E),W&1&&q!==(q=fe(L[0],101)+"")&&B(z,q),W&1&&H!==(H=fe(L[0],100)+"")&&B(G,H)},d(L){L&&w(e),L&&w(v),L&&w(g),L&&w(Y),L&&w(U)}}}function jf(t){let e,l,n=fe(t[0],201)+"",i,o,r=fe(t[0],202)+"",a,f,c=fe(t[0],203)+"",p,_,b=fe(t[0],200)+"",d;return{c(){e=m("optgroup"),l=m("option"),i=C(n),o=m("option"),a=C(r),f=m("option"),p=C(c),_=m("option"),d=C(b),l.__value=201,l.value=l.__value,o.__value=202,o.value=o.__value,f.__value=203,f.value=f.__value,_.__value=200,_.value=_.__value,u(e,"label","Generic hardware")},m(v,g){y(v,e,g),s(e,l),s(l,i),s(e,o),s(o,a),s(e,f),s(f,p),s(e,_),s(_,d)},p(v,g){g&1&&n!==(n=fe(v[0],201)+"")&&B(i,n),g&1&&r!==(r=fe(v[0],202)+"")&&B(a,r),g&1&&c!==(c=fe(v[0],203)+"")&&B(p,c),g&1&&b!==(b=fe(v[0],200)+"")&&B(d,b)},d(v){v&&w(e)}}}function Wf(t){let e,l,n=fe(t[0],7)+"",i,o,r=fe(t[0],6)+"",a,f,c=fe(t[0],5)+"",p,_,b,d,v=fe(t[0],51)+"",g,k,$=fe(t[0],50)+"",T;return{c(){e=m("optgroup"),l=m("option"),i=C(n),o=m("option"),a=C(r),f=m("option"),p=C(c),_=h(),b=m("optgroup"),d=m("option"),g=C(v),k=m("option"),T=C($),l.__value=7,l.value=l.__value,o.__value=6,o.value=o.__value,f.__value=5,f.value=f.__value,u(e,"label","amsleser.no"),d.__value=51,d.value=d.__value,k.__value=50,k.value=k.__value,u(b,"label","Generic hardware")},m(P,I){y(P,e,I),s(e,l),s(l,i),s(e,o),s(o,a),s(e,f),s(f,p),y(P,_,I),y(P,b,I),s(b,d),s(d,g),s(b,k),s(k,T)},p(P,I){I&1&&n!==(n=fe(P[0],7)+"")&&B(i,n),I&1&&r!==(r=fe(P[0],6)+"")&&B(a,r),I&1&&c!==(c=fe(P[0],5)+"")&&B(p,c),I&1&&v!==(v=fe(P[0],51)+"")&&B(g,v),I&1&&$!==($=fe(P[0],50)+"")&&B(T,$)},d(P){P&&w(e),P&&w(_),P&&w(b)}}}function Gf(t){let e,l,n=fe(t[0],8)+"",i,o,r,a,f=fe(t[0],71)+"",c,p,_=fe(t[0],70)+"",b;return{c(){e=m("optgroup"),l=m("option"),i=C(n),o=h(),r=m("optgroup"),a=m("option"),c=C(f),p=m("option"),b=C(_),l.__value=8,l.value=l.__value,u(e,"label","Custom hardware"),a.__value=71,a.value=a.__value,p.__value=70,p.value=p.__value,u(r,"label","Generic hardware")},m(d,v){y(d,e,v),s(e,l),s(l,i),y(d,o,v),y(d,r,v),s(r,a),s(a,c),s(r,p),s(p,b)},p(d,v){v&1&&n!==(n=fe(d[0],8)+"")&&B(i,n),v&1&&f!==(f=fe(d[0],71)+"")&&B(c,f),v&1&&_!==(_=fe(d[0],70)+"")&&B(b,_)},d(d){d&&w(e),d&&w(o),d&&w(r)}}}function Bf(t){let e,l,n=fe(t[0],200)+"",i;return{c(){e=m("optgroup"),l=m("option"),i=C(n),l.__value=200,l.value=l.__value,u(e,"label","Generic hardware")},m(o,r){y(o,e,r),s(e,l),s(l,i)},p(o,r){r&1&&n!==(n=fe(o[0],200)+"")&&B(i,n)},d(o){o&&w(e)}}}function m0(t){let e,l,n,i,o,r,a,f=t[0]=="esp8266"&&Hf(t),c=t[0]=="esp32"&&jf(t),p=t[0]=="esp32s2"&&Wf(t),_=t[0]=="esp32c3"&&Gf(t),b=t[0]=="esp32solo"&&Bf(t);return{c(){e=m("option"),l=h(),f&&f.c(),n=h(),c&&c.c(),i=h(),p&&p.c(),o=h(),_&&_.c(),r=h(),b&&b.c(),a=We(),e.__value=-1,e.value=e.__value},m(d,v){y(d,e,v),y(d,l,v),f&&f.m(d,v),y(d,n,v),c&&c.m(d,v),y(d,i,v),p&&p.m(d,v),y(d,o,v),_&&_.m(d,v),y(d,r,v),b&&b.m(d,v),y(d,a,v)},p(d,[v]){d[0]=="esp8266"?f?f.p(d,v):(f=Hf(d),f.c(),f.m(n.parentNode,n)):f&&(f.d(1),f=null),d[0]=="esp32"?c?c.p(d,v):(c=jf(d),c.c(),c.m(i.parentNode,i)):c&&(c.d(1),c=null),d[0]=="esp32s2"?p?p.p(d,v):(p=Wf(d),p.c(),p.m(o.parentNode,o)):p&&(p.d(1),p=null),d[0]=="esp32c3"?_?_.p(d,v):(_=Gf(d),_.c(),_.m(r.parentNode,r)):_&&(_.d(1),_=null),d[0]=="esp32solo"?b?b.p(d,v):(b=Bf(d),b.c(),b.m(a.parentNode,a)):b&&(b.d(1),b=null)},i:ne,o:ne,d(d){d&&w(e),d&&w(l),f&&f.d(d),d&&w(n),c&&c.d(d),d&&w(i),p&&p.d(d),d&&w(o),_&&_.d(d),d&&w(r),b&&b.d(d),d&&w(a)}}}function p0(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class _0 extends Ce{constructor(e){super(),ye(this,e,p0,m0,ke,{chip:0})}}function zf(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",u(e,"class","bd-red")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function Yf(t){let e,l,n,i,o,r,a;return r=new Hc({props:{chip:t[0].chip}}),{c(){e=m("div"),l=C("HAN GPIO"),n=m("br"),i=h(),o=m("select"),J(r.$$.fragment),u(o,"name","vh"),u(o,"class","in-s"),u(e,"class","my-3")},m(f,c){y(f,e,c),s(e,l),s(e,n),s(e,i),s(e,o),X(r,o,null),a=!0},p(f,c){const p={};c&1&&(p.chip=f[0].chip),r.$set(p)},i(f){a||(N(r.$$.fragment,f),a=!0)},o(f){D(r.$$.fragment,f),a=!1},d(f){f&&w(e),Z(r)}}}function d0(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,k,$,T,P,I,S,A,E,F,Y,U,R,q,z,O=t[0].usrcfg&&zf();v=new _0({props:{chip:t[0].chip}});let H=t[0].board&&t[0].board>20&&Yf(t);return U=new At({props:{active:t[1],message:"Saving device configuration"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=h(),r=m("strong"),r.textContent="Initial configuration",a=h(),O&&O.c(),f=h(),c=m("div"),p=C("Board type"),_=m("br"),b=h(),d=m("select"),J(v.$$.fragment),g=h(),H&&H.c(),k=h(),$=m("div"),T=m("label"),P=m("input"),I=C(" Clear all other configuration"),S=h(),A=m("div"),A.innerHTML='',E=h(),F=m("span"),F.textContent="\xA0",Y=h(),J(U.$$.fragment),u(i,"type","hidden"),u(i,"name","v"),i.value="true",u(r,"class","text-sm"),u(d,"name","vb"),u(d,"class","in-s"),t[0].board===void 0&&tt(()=>t[4].call(d)),u(c,"class","my-3"),u(P,"type","checkbox"),u(P,"name","vr"),P.__value="true",P.value=P.__value,u(P,"class","rounded mb-1"),u($,"class","my-3"),u(A,"class","my-3"),u(F,"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(G,L){y(G,e,L),s(e,l),s(l,n),s(n,i),s(n,o),s(n,r),s(n,a),O&&O.m(n,null),s(n,f),s(n,c),s(c,p),s(c,_),s(c,b),s(c,d),X(v,d,null),Re(d,t[0].board),s(n,g),H&&H.m(n,null),s(n,k),s(n,$),s($,T),s(T,P),P.checked=t[2],s(T,I),s(n,S),s(n,A),s(n,E),s(n,F),y(G,Y,L),X(U,G,L),R=!0,q||(z=[K(d,"change",t[4]),K(P,"change",t[5]),K(n,"submit",Ts(t[3]))],q=!0)},p(G,[L]){G[0].usrcfg?O||(O=zf(),O.c(),O.m(n,f)):O&&(O.d(1),O=null);const W={};L&1&&(W.chip=G[0].chip),v.$set(W),L&1&&Re(d,G[0].board),G[0].board&&G[0].board>20?H?(H.p(G,L),L&1&&N(H,1)):(H=Yf(G),H.c(),N(H,1),H.m(n,k)):H&&(Te(),D(H,1,1,()=>{H=null}),Se()),L&4&&(P.checked=G[2]);const j={};L&2&&(j.active=G[1]),U.$set(j)},i(G){R||(N(v.$$.fragment,G),N(H),N(U.$$.fragment,G),R=!0)},o(G){D(v.$$.fragment,G),D(H),D(U.$$.fragment,G),R=!1},d(G){G&&w(e),O&&O.d(),Z(v),H&&H.d(),G&&w(Y),Z(U,G),q=!1,Ve(z)}}}function v0(t,e,l){let{sysinfo:n={}}=e,i=!1;async function o(c){l(1,i=!0);const p=new FormData(c.target),_=new URLSearchParams;for(let v of p){const[g,k]=v;_.append(g,k)}let d=await(await fetch("/save",{method:"POST",body:_})).json();l(1,i=!1),Ut.update(v=>(v.vndcfg=d.success,v.booting=d.reboot,v)),ii(n.usrcfg?"/":"/setup")}let r=!1;function a(){n.board=mt(this),l(0,n)}function f(){r=this.checked,l(2,r),l(0,n)}return t.$$set=c=>{"sysinfo"in c&&l(0,n=c.sysinfo)},t.$$.update=()=>{t.$$.dirty&1&&l(2,r=!n.usrcfg)},[n,i,r,o,a,f]}class h0 extends Ce{constructor(e){super(),ye(this,e,v0,d0,ke,{sysinfo:0})}}function Vf(t){let e,l,n,i,o,r,a,f;return a=new jc({}),{c(){e=m("br"),l=h(),n=m("div"),i=m("input"),o=h(),r=m("select"),J(a.$$.fragment),u(i,"name","si"),u(i,"type","text"),u(i,"class","in-f w-full"),i.required=t[1],u(r,"name","su"),u(r,"class","in-l"),r.required=t[1],u(n,"class","flex")},m(c,p){y(c,e,p),y(c,l,p),y(c,n,p),s(n,i),s(n,o),s(n,r),X(a,r,null),f=!0},p(c,p){(!f||p&2)&&(i.required=c[1]),(!f||p&2)&&(r.required=c[1])},i(c){f||(N(a.$$.fragment,c),f=!0)},o(c){D(a.$$.fragment,c),f=!1},d(c){c&&w(e),c&&w(l),c&&w(n),Z(a)}}}function Kf(t){let e;return{c(){e=m("div"),e.innerHTML=`
Gateway
+Occurred in: ${i}`:"",r=vo(t),a=tc(e)?e(r):e;return`<${r}> ${a}${o}`}const dc=t=>(...e)=>t(w1(...e)),vc=dc(t=>{throw new Error(t)}),ks=dc(console.warn),Or=4,y1=3,C1=2,$1=1,T1=1;function S1(t,e){const l=t.default?0:ml(t.fullPath).reduce((n,i)=>{let o=n;return o+=Or,m1(i)?o+=T1:p1(i)?o+=C1:ac(i)?o-=Or+$1:o+=y1,o},0);return{route:t,score:l,index:e}}function M1(t){return t.map(S1).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function hc(t,e){let l,n;const[i]=e.split("?"),o=ml(i),r=o[0]==="",a=M1(t);for(let f=0,c=a.length;f({...p,params:b,uri:C});if(p.default){n=d(e);continue}const v=ml(p.fullPath),g=Math.max(o.length,v.length);let T=0;for(;T{c===".."?f.pop():c!=="."&&f.push(c)}),Bs(`/${f.join("/")}`,n)}function Ur(t,e){const{pathname:l,hash:n="",search:i="",state:o}=t,r=ml(e,!0),a=ml(l,!0);for(;r.length;)r[0]!==a[0]&&vc(fn,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),r.shift(),a.shift();return{pathname:Mi(...a),hash:n,search:i,state:o}}const qr=t=>t.length===1?"":t,ho=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,o=i?qr(wi(t,l)):"",r=i?wi(t,0,l):t,a=n?qr(wi(r,e)):"";return{pathname:(n?wi(r,0,e):r)||"/",search:a,hash:o}},P1=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function A1(t,e,l){return Mi(l,N1(t,e))}function D1(t,e){const l=po(_1(t)),n=ml(l,!0),i=ml(e,!0).slice(0,n.length),o=bc({fullPath:l},Mi(...i));return o&&o.uri}const zs="POP",E1="PUSH",I1="REPLACE";function Ys(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function F1(t){let e=[],l=Ys(t),n=zs;const i=(o=e)=>o.forEach(r=>r({location:l,action:n}));return{get location(){return l},listen(o){e.push(o);const r=()=>{l=Ys(t),n=zs,i([o])};i([o]);const a=ic(t,"popstate",r);return()=>{a(),e=e.filter(f=>f!==o)}},navigate(o,r){const{state:a={},replace:f=!1}=r||{};if(n=f?I1:E1,lc(o))r&&ks(_c,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=zs,t.history.go(o);else{const c={...a,_key:r1()};try{t.history[f?"replaceState":"pushState"](c,"",o)}catch{t.location[f?"replace":"assign"](o)}}l=Ys(t),i()}}}function Vs(t,e){return{...ho(e),state:t}}function R1(t="/"){let e=0,l=[Vs(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(Vs(n,o))},replaceState(n,i,o){l[e]=Vs(n,o)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const L1=!!(!ql&&window.document&&window.document.createElement),O1=!ql&&window.location.origin==="null",gc=F1(L1&&!O1?window:R1()),{navigate:si}=gc;let Sl=null,kc=!0;function U1(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nSl.level||t.level===Sl.level&&U1(t.routerId,Sl.routerId))&&(Sl=t)}function H1(){Sl=null}function j1(){kc=!1}function Hr(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=ic(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function W1(t,e){return Number(t.dataset.svnavRouteEnd)===e}function G1(t){return/^H[1-6]$/i.test(t.tagName)}function jr(t,e=document){return e.querySelector(t)}function B1(t){let l=jr(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!W1(l,t);){if(G1(l))return l;const n=jr("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function z1(t){Promise.resolve(ui(t.focusElement)).then(e=>{const l=e||B1(t.id);l||ks(fn,`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,$s),!Hr(l)&&Hr(document.documentElement)})}const Y1=(t,e,l)=>(n,i)=>n1().then(()=>{if(!Sl||kc){j1();return}if(n&&z1(Sl.route),t.announcements&&i){const{path:o,fullPath:r,meta:a,params:f,uri:c}=Sl.route,p=t.createAnnouncement({path:o,fullPath:r,meta:a,params:f,uri:c},ui(l));Promise.resolve(p).then(_=>{e.set(_)})}H1()}),V1="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 K1(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},sc(t[6],V1)],i={};for(let o=0;o`Navigated to ${le.uri}`,announcements:!0,...v},C=p,$=po(p),M=Ul(Zs),E=Ul(ai),S=!M,A=X1(),I=d&&!(E&&!E.manageFocus),F=rt("");rl(t,F,le=>l(0,a=le));const Y=E?E.disableInlineStyles:g,O=rt([]);rl(t,O,le=>l(20,r=le));const H=rt(null);rl(t,H,le=>l(18,i=le));let q=!1;const z=S?0:E.level+1,R=S?rt((()=>Ur(ql?ho(_):b.location,$))()):M;rl(t,R,le=>l(17,n=le));const B=rt(n);rl(t,B,le=>l(19,o=le));const L=Y1(T,F,R),j=le=>pe=>pe.filter(ie=>ie.id!==le);function W(le){if(ql){if(q)return;const pe=bc(le,n.pathname);if(pe)return q=!0,pe}else O.update(pe=>{const ie=j(le.id)(pe);return ie.push(le),ie})}function te(le){O.update(j(le))}return!S&&p!==Wr&&ks(fn,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:p}),S&&(e1(()=>b.listen(pe=>{const ie=Ur(pe.location,$);B.set(n),R.set(ie)})),Ci(Zs,R)),Ci(ai,{activeRoute:H,registerRoute:W,unregisterRoute:te,manageFocus:I,level:z,id:A,history:S?b:E.history,basepath:S?$:E.basepath,disableInlineStyles:Y}),t.$$set=le=>{"basepath"in le&&l(11,p=le.basepath),"url"in le&&l(12,_=le.url),"history"in le&&l(13,b=le.history),"primary"in le&&l(14,d=le.primary),"a11y"in le&&l(15,v=le.a11y),"disableInlineStyles"in le&&l(16,g=le.disableInlineStyles),"$$scope"in le&&l(21,c=le.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&p!==C&&ks(fn,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const le=hc(r,n.pathname);H.set(le)}if(t.$$.dirty[0]&655360&&S){const le=!!n.hash,pe=!le&&I,ie=!le||n.pathname!==o.pathname;L(pe,ie)}t.$$.dirty[0]&262144&&I&&i&&i.primary&&q1({level:z,routerId:A,route:i})},[a,T,S,A,I,F,Y,O,H,R,B,p,_,b,d,v,g,n,i,o,r,c,f]}class J1 extends Me{constructor(e){super(),Se(this,e,Z1,Q1,$e,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const wc=J1;function Ni(t,e,l=ai,n=fn){Ul(l)||vc(t,o=>`You cannot use ${o} outside of a ${vo(n)}.`,e)}const x1=t=>{const{subscribe:e}=Ul(t);return{subscribe:e}};function yc(){return Ni(cc),x1(Zs)}function Cc(){const{history:t}=Ul(ai);return t}function $c(){const t=Ul(uc);return t?a1(t,e=>e.base):rt("/")}function Tc(){Ni(pc);const t=$c(),{basepath:e}=Ul(ai);return n=>A1(n,ui(t),e)}function em(){Ni(mc);const t=Tc(),{navigate:e}=Cc();return(n,i)=>{const o=lc(n)?n:t(n);return e(o,i)}}const tm=t=>({params:t&16,location:t&8}),Gr=t=>({params:ql?ui(t[10]):t[4],location:t[3],navigate:t[11]});function Br(t){let e,l;return e=new wc({props:{primary:t[1],$$slots:{default:[im]},$$scope:{ctx:t}}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.primary=n[1]),i&528409&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function lm(t){let e;const l=t[18].default,n=ao(l,t,t[19],Gr);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&524312)&&co(n,l,i,i[19],e?fo(l,i[19],o,tm):mo(i[19]),Gr)},i(i){e||(N(n,i),e=!0)},o(i){D(n,i),e=!1},d(i){n&&n.d(i)}}}function nm(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},ql?ui(t[10]):t[4],t[12]];var o=t[0];function r(a){let f={};for(let c=0;c{X(p,1)}),De()}o?(e=Ir(o,r()),Z(e.$$.fragment),N(e.$$.fragment,1),Q(e,l.parentNode,l)):e=null}else o&&e.$set(c)},i(a){n||(e&&N(e.$$.fragment,a),n=!0)},o(a){e&&D(e.$$.fragment,a),n=!1},d(a){a&&k(l),e&&X(e,a)}}}function im(t){let e,l,n,i;const o=[nm,lm],r=[];function a(f,c){return f[0]!==null?0:1}return e=a(t),l=r[e]=o[e](t),{c(){l.c(),n=Ge()},m(f,c){r[e].m(f,c),w(f,n,c),i=!0},p(f,c){let p=e;e=a(f),e===p?r[e].p(f,c):(Ae(),D(r[p],1,1,()=>{r[p]=null}),De(),l=r[e],l?l.p(f,c):(l=r[e]=o[e](f),l.c()),N(l,1),l.m(n.parentNode,n))},i(f){i||(N(l),i=!0)},o(f){D(l),i=!1},d(f){r[e].d(f),f&&k(n)}}}function sm(t){let e,l,n,i,o,r=[Xs(t[7]),{"data-svnav-route-start":t[5]}],a={};for(let _=0;_{f=null}),De())},i(_){o||(N(f),o=!0)},o(_){D(f),o=!1},d(_){_&&k(e),_&&k(l),f&&f.d(_),_&&k(n),_&&k(i)}}}const om=nc();function um(t,e,l){let n;const i=["path","component","meta","primary"];let o=bs(e,i),r,a,f,c,{$$slots:p={},$$scope:_}=e,{path:b=""}=e,{component:d=null}=e,{meta:v={}}=e,{primary:g=!0}=e;Ni($s,e);const T=om(),{registerRoute:C,unregisterRoute:$,activeRoute:M,disableInlineStyles:E}=Ul(ai);rl(t,M,q=>l(16,r=q));const S=$c();rl(t,S,q=>l(17,f=q));const A=yc();rl(t,A,q=>l(3,a=q));const I=rt(null);let F;const Y=rt(),O=rt({});rl(t,O,q=>l(4,c=q)),Ci(uc,Y),Ci(f1,O),Ci(c1,I);const H=em();return ql||t1(()=>$(T)),t.$$set=q=>{l(24,e=Jt(Jt({},e),hs(q))),l(12,o=bs(e,i)),"path"in q&&l(13,b=q.path),"component"in q&&l(0,d=q.component),"meta"in q&&l(14,v=q.meta),"primary"in q&&l(1,g=q.primary),"$$scope"in q&&l(19,_=q.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const q=b==="",z=Mi(f,b),U={id:T,path:b,meta:v,default:q,fullPath:q?"":z,base:q?f:D1(z,a.pathname),primary:g,focusElement:I};Y.set(U),l(15,F=C(U))}if(t.$$.dirty&98304&&l(2,n=!!(F||r&&r.id===T)),t.$$.dirty&98308&&n){const{params:q}=F||r;O.set(q)}},e=hs(e),[d,g,n,a,c,T,M,E,S,A,O,H,o,b,v,F,r,f,p,_]}class rm extends Me{constructor(e){super(),Se(this,e,um,sm,$e,{path:13,component:0,meta:14,primary:1})}}const Tl=rm;function am(t){let e,l,n,i;const o=t[13].default,r=ao(o,t,t[12],null);let a=[{href:t[0]},t[2],t[1]],f={};for(let c=0;cl(11,_=I));const M=l1(),E=Tc(),{navigate:S}=Cc();function A(I){M("click",I),u1(I)&&(I.preventDefault(),S(n,{state:T,replace:r||g}))}return t.$$set=I=>{l(19,e=Jt(Jt({},e),hs(I))),l(18,p=bs(e,c)),"to"in I&&l(5,v=I.to),"replace"in I&&l(6,g=I.replace),"state"in I&&l(7,T=I.state),"getProps"in I&&l(8,C=I.getProps),"$$scope"in I&&l(12,d=I.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=E(v,_)),t.$$.dirty&2049&&l(10,i=Js(_.pathname,n)),t.$$.dirty&2049&&l(9,o=n===_.pathname),t.$$.dirty&2049&&(r=ho(n)===P1(_)),t.$$.dirty&512&&l(2,a=o?{"aria-current":"page"}:{}),l(1,f=(()=>{if(tc(C)){const I=C({location:_,href:n,isPartiallyCurrent:i,isCurrent:o});return{...p,...I}}return p})())},e=hs(e),[n,f,a,$,A,v,g,T,C,o,i,_,d,b]}class cm extends Me{constructor(e){super(),Se(this,e,fm,am,$e,{to:5,replace:6,state:7,getProps:8})}}const Ol=cm;let xs=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ll(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function mm(t){return t>218&&t<242?"#32d900":t>212&&t<248?"#b1d900":t>208&&t<252?"#ffb800":"#d90000"}function Sc(t){return t>90?"#d90000":t>85?"#e32100":t>80?"#ffb800":t>75?"#dcd800":"#32d900"}function pm(t){return t>75?"#32d900":t>50?"#77d900":t>25?"#94d900":"#dcd800"}function ws(t){switch(t){case 1:return"Aidon";case 2:return"Kaifa";case 3:return"Kamstrup";case 8:return"Iskra";case 9:return"Landis+Gyr";case 10:return"Sagemcom";default:return""}}function Re(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function ce(t,e){switch(e){case 5:switch(t){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(t){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 200:return"Generic ESP32";case 2:return"HAN Reader 2.0 by Max Spencer";case 0:return"Custom hardware by Roar Fredriksen";case 1:return"Kamstrup module by Egil Opsahl";case 8:return"µHAN mosquito by dbeinder";case 3:return"Pow-K (UART0)";case 4:return"Pow-U (UART0)";case 101:return"Wemos D1 mini";case 100:return"Generic ESP8266";case 70:return"Generic ESP32-C3";case 71:return"ESP32-C3-DevKitM-1"}}function zr(t){switch(t){case-1:return"Parse error";case-2:return"Incomplete data received";case-3:return"Payload boundry flag missing";case-4:return"Header checksum error";case-5:return"Footer checksum error";case-9:return"Unknown data received, check meter config";case-41:return"Frame length not equal";case-51:return"Authentication failed";case-52:return"Decryption failed";case-53:return"Encryption key invalid";case 90:return"No HAN data received for at least 30s";case 91:return"Serial break";case 92:return"Serial buffer full";case 93:return"Serial FIFO overflow";case 94:return"Serial frame error";case 95:return"Serial parity error";case 96:return"RX error";case 98:return"Exception in code, debugging necessary";case 99:return"Autodetection failed"}return t<0?"Unspecified error "+t:""}function Yr(t){switch(t){case-3:return"Connection failed";case-4:return"Network timeout";case-10:return"Connection denied";case-11:return"Failed to subscribe";case-13:return"Connection lost"}return t<0?"Unspecified error "+t:""}function Vr(t){switch(t){case 401:case 403:return"Unauthorized, check API key";case 404:return"Price unavailable, not found";case 425:return"Server says its too early";case 429:return"Exceeded API rate limit";case 500:return"Internal server error";case-2:return"Incomplete data received";case-3:return"Invalid data, tag missing";case-51:return"Authentication failed";case-52:return"Decryption failed";case-53:return"Encryption key invalid"}return t<0?"Unspecified error "+t:""}function oi(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Ye(t,e){return t==1||t==2&&e}function Ot(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function me(t,e){return isNaN(t)?"-":(isNaN(e)&&(e=t<10?1:0),t.toFixed(e))}function al(t,e){return t.setTime(t.getTime()+e*36e5),t}function Kr(t){if(t.chip=="esp8266")switch(t.boot_reason){case 0:return"Normal";case 1:return"WDT reset";case 2:return"Exception reset";case 3:return"Soft WDT reset";case 4:return"Software restart";case 5:return"Deep sleep";case 6:return"External reset";default:return"Unknown (8266)"}else switch(t.boot_reason){case 1:return"Vbat power on reset";case 3:return"Software reset";case 4:return"WDT reset";case 5:return"Deep sleep";case 6:return"SLC reset";case 7:return"Timer Group0 WDT reset";case 8:return"Timer Group1 WDT reset";case 9:return"RTC WDT reset";case 10:return"Instrusion test reset CPU";case 11:return"Time Group reset CPU";case 12:return"Software reset CPU";case 13:return"RTC WTD reset CPU";case 14:return"PRO CPU";case 15:return"Brownout";case 16:return"RTC reset";default:return"Unknown"}}async function Hl(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 ul={version:"",chip:"",mac:null,apmac:null,vndcfg:null,usrcfg:null,fwconsent:null,booting:!1,upgrading:!1,ui:{},security:0,boot_reason:0,upgrade:{x:-1,e:0,f:null,t:null},trying:null};const Ut=rt(ul);async function bo(){ul=await(await Hl("/sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),Ut.set(ul)}let _s=0,Qr=-127,Xr=null,_m={};const dm=oc(_m,t=>{let e;async function l(){Hl("/data.json").then(n=>n.json()).then(n=>{t(n),Qr!=n.t&&(Qr=n.t,setTimeout(Ac,2e3)),Xr!=n.p&&n.pe&&(Xr=n.p,setTimeout(vm,1e3)),ul.upgrading?window.location.reload():(!ul||!ul.chip||ul.booting||_s>1&&!oi(ul.board))&&(bo(),un&&clearTimeout(un),un=setTimeout(go,2e3),rn&&clearTimeout(rn),rn=setTimeout(ko,3e3));let i=5e3;if(oi(ul.board)&&n.v>2.5){let o=3.3-Math.min(3.3,n.v);o>0&&(i=Math.max(o,.1)*10*5e3)}i>5e3&&console.log("Scheduling next data fetch in "+i+"ms"),e&&clearTimeout(e),e=setTimeout(l,i),_s=0}).catch(n=>{_s++,_s>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(l,15e3)):e=setTimeout(l,oi(ul.board)?1e4:5e3)})}return l(),function(){clearTimeout(e)}});let eo={};const Mc=rt(eo);async function vm(){eo=await(await Hl("/energyprice.json")).json(),Mc.set(eo)}let to={},un;async function go(){un&&(clearTimeout(un),un=0),to=await(await Hl("/dayplot.json")).json(),Nc.set(to),un=setTimeout(go,(60-new Date().getMinutes())*6e4+20)}const Nc=rt(to,t=>(go(),function(){}));let lo={},rn;async function ko(){rn&&(clearTimeout(rn),rn=0),lo=await(await Hl("/monthplot.json")).json(),Pc.set(lo),rn=setTimeout(ko,(24-new Date().getHours())*36e5+40)}const Pc=rt(lo,t=>(ko(),function(){}));let no={};async function Ac(){no=await(await Hl("/temperature.json")).json(),Dc.set(no)}const Dc=rt(no,t=>(Ac(),function(){}));let io={},ds;async function Ec(){ds&&(clearTimeout(ds),ds=0),io=await(await Hl("/tariff.json")).json(),Ic.set(io),ds=setTimeout(Ec,(60-new Date().getMinutes())*6e4+30)}const Ic=rt(io,t=>function(){});let so=[];const wo=rt(so);async function hm(){so=await(await Hl("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),wo.set(so)}function ys(t){return"WARNING: "+t+" must be connected to an external power supply during firmware upgrade. Failure to do so may cause power-down during upload resulting in non-functioning unit."}async function Fc(t){await(await fetch("/upgrade?expected_version="+t,{method:"POST"})).json()}function Rc(t,e){if(/^v\d{1,2}\.\d{1,2}\.\d{1,2}$/.test(t)){let l=t.substring(1).split("."),n=parseInt(l[0]),i=parseInt(l[1]),o=parseInt(l[2]),r=[...e];r.reverse();let a,f,c;for(let p=0;po&&(a=_):g==i+1&&(f=_);else if(v==n+1)if(c){let C=c.tag_name.substring(1).split(".");parseInt(C[0]);let $=parseInt(C[1]);parseInt(C[2]),g==$&&(c=_)}else c=_}return f||c||a||!1}else return e[0]}const bm="/github.svg";function Zr(t){let e,l;function n(r,a){return r[1]>1?Tm:r[1]>0?$m:r[2]>1?Cm:r[2]>0?ym:r[3]>1?wm:r[3]>0?km:gm}let i=n(t),o=i(t);return{c(){e=y(`Up + `),o.c(),l=Ge()},m(r,a){w(r,e,a),o.m(r,a),w(r,l,a)},p(r,a){i===(i=n(r))&&o?o.p(r,a):(o.d(1),o=i(r),o&&(o.c(),o.m(l.parentNode,l)))},d(r){r&&k(e),o.d(r),r&&k(l)}}}function gm(t){let e,l;return{c(){e=y(t[0]),l=y(" seconds")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&1&&G(e,n[0])},d(n){n&&k(e),n&&k(l)}}}function km(t){let e,l;return{c(){e=y(t[3]),l=y(" minute")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&8&&G(e,n[3])},d(n){n&&k(e),n&&k(l)}}}function wm(t){let e,l;return{c(){e=y(t[3]),l=y(" minutes")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&8&&G(e,n[3])},d(n){n&&k(e),n&&k(l)}}}function ym(t){let e,l;return{c(){e=y(t[2]),l=y(" hour")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&4&&G(e,n[2])},d(n){n&&k(e),n&&k(l)}}}function Cm(t){let e,l;return{c(){e=y(t[2]),l=y(" hours")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&4&&G(e,n[2])},d(n){n&&k(e),n&&k(l)}}}function $m(t){let e,l;return{c(){e=y(t[1]),l=y(" day")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&2&&G(e,n[1])},d(n){n&&k(e),n&&k(l)}}}function Tm(t){let e,l;return{c(){e=y(t[1]),l=y(" days")},m(n,i){w(n,e,i),w(n,l,i)},p(n,i){i&2&&G(e,n[1])},d(n){n&&k(e),n&&k(l)}}}function Sm(t){let e,l=t[0]&&Zr(t);return{c(){l&&l.c(),e=Ge()},m(n,i){l&&l.m(n,i),w(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Zr(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:ne,o:ne,d(n){l&&l.d(n),n&&k(e)}}}function Mm(t,e,l){let{epoch:n}=e,i=0,o=0,r=0;return t.$$set=a=>{"epoch"in a&&l(0,n=a.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(1,i=Math.floor(n/86400)),l(2,o=Math.floor(n/3600)),l(3,r=Math.floor(n/60)))},[n,i,o,r]}class Nm extends Me{constructor(e){super(),Se(this,e,Mm,Sm,$e,{epoch:0})}}function Pm(t){let e,l,n;return{c(){e=m("span"),l=y(t[2]),u(e,"title",t[1]),u(e,"class",n="bd-"+t[0])},m(i,o){w(i,e,o),s(e,l)},p(i,[o]){o&4&&G(l,i[2]),o&2&&u(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&u(e,"class",n)},i:ne,o:ne,d(i){i&&k(e)}}}function Am(t,e,l){let{color:n}=e,{title:i}=e,{text:o}=e;return t.$$set=r=>{"color"in r&&l(0,n=r.color),"title"in r&&l(1,i=r.title),"text"in r&&l(2,o=r.text)},[n,i,o]}class fl extends Me{constructor(e){super(),Se(this,e,Am,Pm,$e,{color:0,title:1,text:2})}}function Dm(t){let e,l=`${Re(t[0].getDate())}.${Re(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Re(t[0].getHours())}:${Re(t[0].getMinutes())}`,n;return{c(){e=m("span"),n=y(l),u(e,"class",t[1])},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${Re(i[0].getDate())}.${Re(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Re(i[0].getHours())}:${Re(i[0].getMinutes())}`)&&G(n,l),o&2&&u(e,"class",i[1])},d(i){i&&k(e)}}}function Em(t){let e=`${Re(t[0].getDate())}. ${xs[t[0].getMonth()]} ${Re(t[0].getHours())}:${Re(t[0].getMinutes())}`,l;return{c(){l=y(e)},m(n,i){w(n,l,i)},p(n,i){i&1&&e!==(e=`${Re(n[0].getDate())}. ${xs[n[0].getMonth()]} ${Re(n[0].getHours())}:${Re(n[0].getMinutes())}`)&&G(l,e)},d(n){n&&k(l)}}}function Im(t){let e;function l(o,r){return o[2]?Em:Dm}let n=l(t),i=n(t);return{c(){i.c(),e=Ge()},m(o,r){i.m(o,r),w(o,e,r)},p(o,[r]){n===(n=l(o))&&i?i.p(o,r):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:ne,o:ne,d(o){i.d(o),o&&k(e)}}}function Fm(t,e,l){let{timestamp:n}=e,{fullTimeColor:i}=e,{offset:o}=e,r;return t.$$set=a=>{"timestamp"in a&&l(0,n=a.timestamp),"fullTimeColor"in a&&l(1,i=a.fullTimeColor),"offset"in a&&l(3,o=a.offset)},t.$$.update=()=>{t.$$.dirty&9&&(l(2,r=Math.abs(new Date().getTime()-n.getTime())<3e5),isNaN(o)||al(n,o-(24+n.getHours()-n.getUTCHours())%24))},[n,i,r,o]}class Lc extends Me{constructor(e){super(),Se(this,e,Fm,Im,$e,{timestamp:0,fullTimeColor:1,offset:3})}}function Rm(t){let e,l,n;return{c(){e=qe("svg"),l=qe("path"),n=qe("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(l,"d","M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z"),u(n,"stroke-linecap","round"),u(n,"stroke-linejoin","round"),u(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(i,o){w(i,e,o),s(e,l),s(e,n)},p:ne,i:ne,o:ne,d(i){i&&k(e)}}}class Lm extends Me{constructor(e){super(),Se(this,e,null,Rm,$e,{})}}function Om(t){let e,l;return{c(){e=qe("svg"),l=qe("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(l,"d","M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(n,i){w(n,e,i),s(e,l)},p:ne,i:ne,o:ne,d(n){n&&k(e)}}}class Um extends Me{constructor(e){super(),Se(this,e,null,Om,$e,{})}}function qm(t){let e,l;return{c(){e=qe("svg"),l=qe("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(l,"d","M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(n,i){w(n,e,i),s(e,l)},p:ne,i:ne,o:ne,d(n){n&&k(e)}}}class Lt extends Me{constructor(e){super(),Se(this,e,null,qm,$e,{})}}function Hm(t){let e,l;return{c(){e=qe("svg"),l=qe("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(l,"d","M9 8.25H7.5a2.25 2.25 0 00-2.25 2.25v9a2.25 2.25 0 002.25 2.25h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25H15M9 12l3 3m0 0l3-3m-3 3V2.25"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(n,i){w(n,e,i),s(e,l)},p:ne,i:ne,o:ne,d(n){n&&k(e)}}}class Oc extends Me{constructor(e){super(),Se(this,e,null,Hm,$e,{})}}function jm(t){let e,l,n=t[1].version+"",i;return{c(){e=y("AMS reader "),l=m("span"),i=y(n)},m(o,r){w(o,e,r),w(o,l,r),s(l,i)},p(o,r){r&2&&n!==(n=o[1].version+"")&&G(i,n)},d(o){o&&k(e),o&&k(l)}}}function Jr(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=m("div"),n=y(l),i=y("°C"),u(e,"class","flex-none my-auto")},m(o,r){w(o,e,r),s(e,n),s(e,i)},p(o,r){r&1&&l!==(l=(o[0].t>-50?o[0].t.toFixed(1):"-")+"")&&G(n,l)},d(o){o&&k(e)}}}function xr(t){let e,l="HAN: "+zr(t[0].he),n;return{c(){e=m("div"),n=y(l),u(e,"class","bd-red")},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="HAN: "+zr(i[0].he))&&G(n,l)},d(i){i&&k(e)}}}function ea(t){let e,l="MQTT: "+Yr(t[0].me),n;return{c(){e=m("div"),n=y(l),u(e,"class","bd-red")},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="MQTT: "+Yr(i[0].me))&&G(n,l)},d(i){i&&k(e)}}}function ta(t){let e,l="PriceAPI: "+Vr(t[0].ee),n;return{c(){e=m("div"),n=y(l),u(e,"class","bd-red")},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="PriceAPI: "+Vr(i[0].ee))&&G(n,l)},d(i){i&&k(e)}}}function la(t){let e,l,n,i,o,r;return l=new Ol({props:{to:"/configuration",$$slots:{default:[Wm]},$$scope:{ctx:t}}}),o=new Ol({props:{to:"/status",$$slots:{default:[Gm]},$$scope:{ctx:t}}}),{c(){e=m("div"),Z(l.$$.fragment),n=h(),i=m("div"),Z(o.$$.fragment),u(e,"class","flex-none px-1 mt-1"),u(e,"title","Configuration"),u(i,"class","flex-none px-1 mt-1"),u(i,"title","Device information")},m(a,f){w(a,e,f),Q(l,e,null),w(a,n,f),w(a,i,f),Q(o,i,null),r=!0},i(a){r||(N(l.$$.fragment,a),N(o.$$.fragment,a),r=!0)},o(a){D(l.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&k(e),X(l),a&&k(n),a&&k(i),X(o)}}}function Wm(t){let e,l;return e=new Lm({}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function Gm(t){let e,l;return e=new Um({}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function na(t){let e,l,n,i,o;const r=[zm,Bm],a=[];function f(c,p){return c[1].security==0||c[0].a?0:1}return l=f(t),n=a[l]=r[l](t),{c(){e=m("div"),n.c(),u(e,"class","flex-none mr-3 text-yellow-500"),u(e,"title",i="New version: "+t[2].tag_name)},m(c,p){w(c,e,p),a[l].m(e,null),o=!0},p(c,p){let _=l;l=f(c),l===_?a[l].p(c,p):(Ae(),D(a[_],1,1,()=>{a[_]=null}),De(),n=a[l],n?n.p(c,p):(n=a[l]=r[l](c),n.c()),N(n,1),n.m(e,null)),(!o||p&4&&i!==(i="New version: "+c[2].tag_name))&&u(e,"title",i)},i(c){o||(N(n),o=!0)},o(c){D(n),o=!1},d(c){c&&k(e),a[l].d()}}}function Bm(t){let e,l,n=t[2].tag_name+"",i;return{c(){e=m("span"),l=y("New version: "),i=y(n)},m(o,r){w(o,e,r),s(e,l),s(e,i)},p(o,r){r&4&&n!==(n=o[2].tag_name+"")&&G(i,n)},i:ne,o:ne,d(o){o&&k(e)}}}function zm(t){let e,l,n,i=t[2].tag_name+"",o,r,a,f,c,p;return a=new Oc({}),{c(){e=m("button"),l=m("span"),n=y("New version: "),o=y(i),r=h(),Z(a.$$.fragment),u(l,"class","mt-1"),u(e,"class","flex")},m(_,b){w(_,e,b),s(e,l),s(l,n),s(l,o),s(e,r),Q(a,e,null),f=!0,c||(p=K(e,"click",t[3]),c=!0)},p(_,b){(!f||b&4)&&i!==(i=_[2].tag_name+"")&&G(o,i)},i(_){f||(N(a.$$.fragment,_),f=!0)},o(_){D(a.$$.fragment,_),f=!1},d(_){_&&k(e),X(a),c=!1,p()}}}function Ym(t){let e,l,n,i,o,r,a,f,c,p,_,b,d=(t[0].m?(t[0].m/1e3).toFixed(1):"-")+"",v,g,T,C,$,M,E,S,A,I,F,Y,O,H,q,z,U,R,B,L,j,W,te,le,pe,ie,Te,je,Pe,We;i=new Ol({props:{to:"/",$$slots:{default:[jm]},$$scope:{ctx:t}}}),f=new Nm({props:{epoch:t[0].u}});let be=t[0].t>-50&&Jr(t);$=new fl({props:{title:"ESP",text:t[1].booting?"Booting":t[0].v>2?t[0].v.toFixed(2)+"V":"ESP",color:Ll(t[1].booting?2:t[0].em)}}),E=new fl({props:{title:"HAN",text:"HAN",color:Ll(t[1].booting?9:t[0].hm)}}),A=new fl({props:{title:"WiFi",text:t[0].r?t[0].r.toFixed(0)+"dBm":"WiFi",color:Ll(t[1].booting?9:t[0].wm)}}),F=new fl({props:{title:"MQTT",text:"MQTT",color:Ll(t[1].booting?9:t[0].mm)}});let ke=(t[0].he<0||t[0].he>0)&&xr(t),Ie=t[0].me<0&&ea(t),ge=(t[0].ee>0||t[0].ee<0)&&ta(t);te=new Lc({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),offset:t[1].clock_offset,fullTimeColor:"text-red-500"}});let ae=t[1].vndcfg&&t[1].usrcfg&&la(t);je=new Lt({});let we=t[1].fwconsent===1&&t[2]&&na(t);return{c(){e=m("nav"),l=m("div"),n=m("div"),Z(i.$$.fragment),o=h(),r=m("div"),a=m("div"),Z(f.$$.fragment),c=h(),be&&be.c(),p=h(),_=m("div"),b=y("Free mem: "),v=y(d),g=y("kb"),T=h(),C=m("div"),Z($.$$.fragment),M=h(),Z(E.$$.fragment),S=h(),Z(A.$$.fragment),I=h(),Z(F.$$.fragment),Y=h(),ke&&ke.c(),O=h(),Ie&&Ie.c(),H=h(),ge&&ge.c(),q=h(),z=m("div"),U=m("div"),R=m("a"),B=m("img"),j=h(),W=m("div"),Z(te.$$.fragment),le=h(),ae&&ae.c(),pe=h(),ie=m("div"),Te=m("a"),Z(je.$$.fragment),Pe=h(),we&&we.c(),u(n,"class","flex text-lg text-gray-100 p-2"),u(a,"class","flex-none my-auto"),u(_,"class","flex-none my-auto"),u(r,"class","flex-none my-auto p-2 flex space-x-4"),u(C,"class","flex-auto flex-wrap my-auto justify-center p-2"),u(B,"class","gh-logo"),Bc(B.src,L=bm)||u(B,"src",L),u(B,"alt","GitHub repo"),u(R,"class","float-right"),u(R,"href","https://github.com/UtilitechAS/amsreader-firmware"),u(R,"target","_blank"),u(R,"rel","noreferrer"),u(R,"aria-label","GitHub"),u(U,"class","flex-none"),u(W,"class","flex-none my-auto px-2"),u(Te,"href",Ot("")),u(Te,"target","_blank"),u(Te,"rel","noreferrer"),u(ie,"class","flex-none px-1 mt-1"),u(ie,"title","Documentation"),u(z,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),u(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),u(e,"class","bg-violet-600 p-1 rounded-md mx-2")},m(J,se){w(J,e,se),s(e,l),s(l,n),Q(i,n,null),s(l,o),s(l,r),s(r,a),Q(f,a,null),s(r,c),be&&be.m(r,null),s(r,p),s(r,_),s(_,b),s(_,v),s(_,g),s(l,T),s(l,C),Q($,C,null),s(C,M),Q(E,C,null),s(C,S),Q(A,C,null),s(C,I),Q(F,C,null),s(l,Y),ke&&ke.m(l,null),s(l,O),Ie&&Ie.m(l,null),s(l,H),ge&&ge.m(l,null),s(l,q),s(l,z),s(z,U),s(U,R),s(R,B),s(z,j),s(z,W),Q(te,W,null),s(z,le),ae&&ae.m(z,null),s(z,pe),s(z,ie),s(ie,Te),Q(je,Te,null),s(z,Pe),we&&we.m(z,null),We=!0},p(J,[se]){const Ee={};se&18&&(Ee.$$scope={dirty:se,ctx:J}),i.$set(Ee);const Fe={};se&1&&(Fe.epoch=J[0].u),f.$set(Fe),J[0].t>-50?be?be.p(J,se):(be=Jr(J),be.c(),be.m(r,p)):be&&(be.d(1),be=null),(!We||se&1)&&d!==(d=(J[0].m?(J[0].m/1e3).toFixed(1):"-")+"")&&G(v,d);const _e={};se&3&&(_e.text=J[1].booting?"Booting":J[0].v>2?J[0].v.toFixed(2)+"V":"ESP"),se&3&&(_e.color=Ll(J[1].booting?2:J[0].em)),$.$set(_e);const ye={};se&3&&(ye.color=Ll(J[1].booting?9:J[0].hm)),E.$set(ye);const Ne={};se&1&&(Ne.text=J[0].r?J[0].r.toFixed(0)+"dBm":"WiFi"),se&3&&(Ne.color=Ll(J[1].booting?9:J[0].wm)),A.$set(Ne);const de={};se&3&&(de.color=Ll(J[1].booting?9:J[0].mm)),F.$set(de),J[0].he<0||J[0].he>0?ke?ke.p(J,se):(ke=xr(J),ke.c(),ke.m(l,O)):ke&&(ke.d(1),ke=null),J[0].me<0?Ie?Ie.p(J,se):(Ie=ea(J),Ie.c(),Ie.m(l,H)):Ie&&(Ie.d(1),Ie=null),J[0].ee>0||J[0].ee<0?ge?ge.p(J,se):(ge=ta(J),ge.c(),ge.m(l,q)):ge&&(ge.d(1),ge=null);const Ce={};se&1&&(Ce.timestamp=J[0].c?new Date(J[0].c*1e3):new Date(0)),se&2&&(Ce.offset=J[1].clock_offset),te.$set(Ce),J[1].vndcfg&&J[1].usrcfg?ae?se&2&&N(ae,1):(ae=la(J),ae.c(),N(ae,1),ae.m(z,pe)):ae&&(Ae(),D(ae,1,1,()=>{ae=null}),De()),J[1].fwconsent===1&&J[2]?we?(we.p(J,se),se&6&&N(we,1)):(we=na(J),we.c(),N(we,1),we.m(z,null)):we&&(Ae(),D(we,1,1,()=>{we=null}),De())},i(J){We||(N(i.$$.fragment,J),N(f.$$.fragment,J),N($.$$.fragment,J),N(E.$$.fragment,J),N(A.$$.fragment,J),N(F.$$.fragment,J),N(te.$$.fragment,J),N(ae),N(je.$$.fragment,J),N(we),We=!0)},o(J){D(i.$$.fragment,J),D(f.$$.fragment,J),D($.$$.fragment,J),D(E.$$.fragment,J),D(A.$$.fragment,J),D(F.$$.fragment,J),D(te.$$.fragment,J),D(ae),D(je.$$.fragment,J),D(we),We=!1},d(J){J&&k(e),X(i),X(f),be&&be.d(),X($),X(E),X(A),X(F),ke&&ke.d(),Ie&&Ie.d(),ge&&ge.d(),X(te),ae&&ae.d(),X(je),we&&we.d()}}}function Vm(t,e,l){let{data:n={}}=e,i={},o={};function r(){confirm("Do you want to upgrade this device to "+o.tag_name+"?")&&(!oi(i.board)||confirm(ys(ce(i.chip,i.board))))&&(Ut.update(a=>(a.upgrading=!0,a)),Fc(o.tag_name))}return Ut.subscribe(a=>{l(1,i=a),a.fwconsent===1&&hm()}),wo.subscribe(a=>{l(2,o=Rc(i.version,a))}),t.$$set=a=>{"data"in a&&l(0,n=a.data)},[n,i,o,r]}class Km extends Me{constructor(e){super(),Se(this,e,Vm,Ym,$e,{data:0})}}function Qm(t){let e,l,n,i;return{c(){e=qe("svg"),l=qe("path"),n=qe("path"),u(l,"d",Ks(150,150,115,210,510)),u(l,"stroke","#eee"),u(l,"fill","none"),u(l,"stroke-width","55"),u(n,"d",i=Ks(150,150,115,210,210+300*t[0]/100)),u(n,"stroke",t[1]),u(n,"fill","none"),u(n,"stroke-width","55"),u(e,"viewBox","0 0 300 300"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"height","100%")},m(o,r){w(o,e,r),s(e,l),s(e,n)},p(o,[r]){r&1&&i!==(i=Ks(150,150,115,210,210+300*o[0]/100))&&u(n,"d",i),r&2&&u(n,"stroke",o[1])},i:ne,o:ne,d(o){o&&k(e)}}}function ia(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 Ks(t,e,l,n,i){var o=ia(t,e,l,i),r=ia(t,e,l,n),a=i-n<=180?"0":"1",f=["M",o.x,o.y,"A",l,l,0,a,0,r.x,r.y].join(" ");return f}function Xm(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 Zm extends Me{constructor(e){super(),Se(this,e,Xm,Qm,$e,{pct:0,color:1})}}function sa(t){let e,l,n,i,o,r,a,f;return{c(){e=m("br"),l=h(),n=m("span"),i=y(t[3]),o=h(),r=m("span"),a=y(t[4]),f=y("/kWh"),u(n,"class","pl-sub"),u(r,"class","pl-snt")},m(c,p){w(c,e,p),w(c,l,p),w(c,n,p),s(n,i),w(c,o,p),w(c,r,p),s(r,a),s(r,f)},p(c,p){p&8&&G(i,c[3]),p&16&&G(a,c[4])},d(c){c&&k(e),c&&k(l),c&&k(n),c&&k(o),c&&k(r)}}}function Jm(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,T;l=new Zm({props:{pct:t[6],color:t[5](t[6])}});let C=t[3]&&sa(t);return{c(){e=m("div"),Z(l.$$.fragment),n=h(),i=m("span"),o=m("span"),r=y(t[2]),a=h(),f=m("br"),c=h(),p=m("span"),_=y(t[0]),b=h(),d=m("span"),v=y(t[1]),g=h(),C&&C.c(),u(o,"class","pl-lab"),u(p,"class","pl-val"),u(d,"class","pl-unt"),u(i,"class","pl-ov"),u(e,"class","pl-root")},m($,M){w($,e,M),Q(l,e,null),s(e,n),s(e,i),s(i,o),s(o,r),s(i,a),s(i,f),s(i,c),s(i,p),s(p,_),s(i,b),s(i,d),s(d,v),s(i,g),C&&C.m(i,null),T=!0},p($,[M]){const E={};M&64&&(E.pct=$[6]),M&96&&(E.color=$[5]($[6])),l.$set(E),(!T||M&4)&&G(r,$[2]),(!T||M&1)&&G(_,$[0]),(!T||M&2)&&G(v,$[1]),$[3]?C?C.p($,M):(C=sa($),C.c(),C.m(i,null)):C&&(C.d(1),C=null)},i($){T||(N(l.$$.fragment,$),T=!0)},o($){D(l.$$.fragment,$),T=!1},d($){$&&k(e),X(l),C&&C.d()}}}function xm(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:r}=e,{sub:a=""}=e,{subunit:f=""}=e,{colorFn:c}=e,p=0;return t.$$set=_=>{"val"in _&&l(0,n=_.val),"max"in _&&l(7,i=_.max),"unit"in _&&l(1,o=_.unit),"label"in _&&l(2,r=_.label),"sub"in _&&l(3,a=_.sub),"subunit"in _&&l(4,f=_.subunit),"colorFn"in _&&l(5,c=_.colorFn)},t.$$.update=()=>{t.$$.dirty&129&&l(6,p=Math.min(n,i)/i*100)},[n,o,r,a,f,c,p,i]}class Uc extends Me{constructor(e){super(),Se(this,e,xm,Jm,$e,{val:0,max:7,unit:1,label:2,sub:3,subunit:4,colorFn:5})}}function oa(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function ua(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function ra(t,e,l){const n=t.slice();return n[13]=e[l],n}function aa(t){let e,l,n,i,o,r=t[0].title&&fa(t),a=t[0].y.ticks,f=[];for(let d=0;d20||t[11]%2==0)&&_a(t);return{c(){e=qe("g"),n&&n.c(),u(e,"class","tick"),u(e,"transform",l="translate("+t[5](t[11])+","+t[4]+")")},m(i,o){w(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[11]%2==0?n?n.p(i,o):(n=_a(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&48&&l!==(l="translate("+i[5](i[11])+","+i[4]+")")&&u(e,"transform",l)},d(i){i&&k(e),n&&n.d()}}}function _a(t){let e,l=t[9].label+"",n,i;return{c(){e=qe("text"),n=y(l),u(e,"x",i=t[3]/2),u(e,"y","-4")},m(o,r){w(o,e,r),s(e,n)},p(o,r){r&1&&l!==(l=o[9].label+"")&&G(n,l),r&8&&i!==(i=o[3]/2)&&u(e,"x",i)},d(o){o&&k(e)}}}function da(t){let e=!isNaN(t[5](t[11])),l,n=e&&pa(t);return{c(){n&&n.c(),l=Ge()},m(i,o){n&&n.m(i,o),w(i,l,o)},p(i,o){o&32&&(e=!isNaN(i[5](i[11]))),e?n?n.p(i,o):(n=pa(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&k(l)}}}function va(t){let e,l,n=t[9].value!==void 0&&ha(t),i=t[9].value2>1e-4&&ka(t);return{c(){e=qe("g"),n&&n.c(),l=qe("g"),i&&i.c()},m(o,r){w(o,e,r),n&&n.m(e,null),w(o,l,r),i&&i.m(l,null)},p(o,r){o[9].value!==void 0?n?n.p(o,r):(n=ha(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[9].value2>1e-4?i?i.p(o,r):(i=ka(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&k(e),n&&n.d(),o&&k(l),i&&i.d()}}}function ha(t){let e,l,n,i,o,r,a,f=t[3]>15&&ba(t);return{c(){e=qe("rect"),f&&f.c(),a=Ge(),u(e,"x",l=t[5](t[11])+2),u(e,"y",n=t[6](t[9].value)),u(e,"width",i=t[3]-4),u(e,"height",o=t[6](t[0].y.min)-t[6](Math.min(t[0].y.min,0)+t[9].value)),u(e,"fill",r=t[9].color)},m(c,p){w(c,e,p),f&&f.m(c,p),w(c,a,p)},p(c,p){p&32&&l!==(l=c[5](c[11])+2)&&u(e,"x",l),p&65&&n!==(n=c[6](c[9].value))&&u(e,"y",n),p&8&&i!==(i=c[3]-4)&&u(e,"width",i),p&65&&o!==(o=c[6](c[0].y.min)-c[6](Math.min(c[0].y.min,0)+c[9].value))&&u(e,"height",o),p&1&&r!==(r=c[9].color)&&u(e,"fill",r),c[3]>15?f?f.p(c,p):(f=ba(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&k(e),f&&f.d(c),c&&k(a)}}}function ba(t){let e,l=t[9].label+"",n,i,o,r,a,f,c=t[9].title&&ga(t);return{c(){e=qe("text"),n=y(l),c&&c.c(),f=Ge(),u(e,"width",i=t[3]-4),u(e,"dominant-baseline","middle"),u(e,"text-anchor",o=t[3]t[6](0)-t[7]?t[9].color:"white"),u(e,"transform",a="translate("+(t[5](t[11])+t[3]/2)+" "+(t[6](t[9].value)>t[6](0)-t[7]?t[6](t[9].value)-t[7]:t[6](t[9].value)+10)+") rotate("+(t[3]p[6](0)-p[7]?p[9].color:"white")&&u(e,"fill",r),_&233&&a!==(a="translate("+(p[5](p[11])+p[3]/2)+" "+(p[6](p[9].value)>p[6](0)-p[7]?p[6](p[9].value)-p[7]:p[6](p[9].value)+10)+") rotate("+(p[3]15&&wa(t);return{c(){e=qe("rect"),f&&f.c(),a=Ge(),u(e,"x",l=t[5](t[11])+2),u(e,"y",n=t[6](0)),u(e,"width",i=t[3]-4),u(e,"height",o=t[6](t[0].y.min)-t[6](t[0].y.min+t[9].value2)),u(e,"fill",r=t[9].color)},m(c,p){w(c,e,p),f&&f.m(c,p),w(c,a,p)},p(c,p){p&32&&l!==(l=c[5](c[11])+2)&&u(e,"x",l),p&64&&n!==(n=c[6](0))&&u(e,"y",n),p&8&&i!==(i=c[3]-4)&&u(e,"width",i),p&65&&o!==(o=c[6](c[0].y.min)-c[6](c[0].y.min+c[9].value2))&&u(e,"height",o),p&1&&r!==(r=c[9].color)&&u(e,"fill",r),c[3]>15?f?f.p(c,p):(f=wa(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&k(e),f&&f.d(c),c&&k(a)}}}function wa(t){let e,l=t[9].label2+"",n,i,o,r,a,f=t[9].title2&&ya(t);return{c(){e=qe("text"),n=y(l),f&&f.c(),a=Ge(),u(e,"width",i=t[3]-4),u(e,"dominant-baseline","middle"),u(e,"text-anchor","middle"),u(e,"fill",o=t[6](-t[9].value2)t[8].call(e))},m(i,o){w(i,e,o),n&&n.m(e,null),l=Jc(e,t[8].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=aa(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:ne,o:ne,d(i){i&&k(e),n&&n.d(),l()}}}let an=30;function tp(t,e,l){let{config:n}=e,i,o,r,a,f,c,p;function _(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return t.$$set=b=>{"config"in b&&l(0,n=b.config)},t.$$.update=()=>{if(t.$$.dirty&31){l(4,c=o-(n.title?20:0));let b=i-(n.padding.left+n.padding.right);l(3,r=b/n.points.length),l(7,p=rn.y.max?g=n.padding.bottom:vc||g<0?0:g})}},[n,i,o,r,c,a,f,p,_]}class cn extends Me{constructor(e){super(),Se(this,e,tp,ep,$e,{config:0})}}function lp(t){let e,l;return e=new cn({props:{config:t[0]}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function np(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{ds:r}=e,a={};function f(c){return{label:me(c)+"V",title:c.toFixed(1)+" V",value:isNaN(c)?0:c,color:mm(c||0)}}return t.$$set=c=>{"u1"in c&&l(1,n=c.u1),"u2"in c&&l(2,i=c.u2),"u3"in c&&l(3,o=c.u3),"ds"in c&&l(4,r=c.ds)},t.$$.update=()=>{if(t.$$.dirty&30){let c=[],p=[];n>0&&(c.push({label:r===1?"L1-L2":"L1"}),p.push(f(n))),i>0&&(c.push({label:r===1?"L1-L3":"L2"}),p.push(f(i))),o>0&&(c.push({label:r===1?"L2-L3":"L3"}),p.push(f(o))),l(0,a={padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:c},points:p})}},[a,n,i,o,r]}class ip extends Me{constructor(e){super(),Se(this,e,np,lp,$e,{u1:1,u2:2,u3:3,ds:4})}}function sp(t){let e,l;return e=new cn({props:{config:t[0]}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function op(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{i1:r}=e,{i2:a}=e,{i3:f}=e,{max:c}=e,p={};function _(b){return{label:me(b)+"A",title:b.toFixed(1)+" A",value:isNaN(b)?0:b,color:Sc(b?b/c*100:0)}}return t.$$set=b=>{"u1"in b&&l(1,n=b.u1),"u2"in b&&l(2,i=b.u2),"u3"in b&&l(3,o=b.u3),"i1"in b&&l(4,r=b.i1),"i2"in b&&l(5,a=b.i2),"i3"in b&&l(6,f=b.i3),"max"in b&&l(7,c=b.max)},t.$$.update=()=>{if(t.$$.dirty&254){let b=[],d=[];n>0&&(b.push({label:"L1"}),d.push(_(r))),i>0&&(b.push({label:"L2"}),d.push(_(a))),o>0&&(b.push({label:"L3"}),d.push(_(f))),l(0,p={padding:{top:20,right:15,bottom:20,left:35},y:{min:0,max:c,ticks:[{value:0,label:"0%"},{value:c/4,label:"25%"},{value:c/2,label:"50%"},{value:c/4*3,label:"75%"},{value:c,label:"100%"}]},x:{ticks:b},points:d})}},[p,n,i,o,r,a,f,c]}class up extends Me{constructor(e){super(),Se(this,e,op,sp,$e,{u1:1,u2:2,u3:3,i1:4,i2:5,i3:6,max:7})}}function rp(t){let e,l,n,i,o,r,a,f=(typeof t[0]<"u"?t[0].toFixed(0):"-")+"",c,p,_,b,d,v,g=(typeof t[1]<"u"?t[1].toFixed(0):"-")+"",T,C,$,M,E,S,A,I=(typeof t[2]<"u"?t[2].toFixed(1):"-")+"",F,Y,O,H,q,z,U=(typeof t[3]<"u"?t[3].toFixed(1):"-")+"",R,B;return{c(){e=m("div"),l=m("strong"),l.textContent="Reactive",n=h(),i=m("div"),o=m("div"),o.textContent="Instant in",r=h(),a=m("div"),c=y(f),p=y(" VAr"),_=h(),b=m("div"),b.textContent="Instant out",d=h(),v=m("div"),T=y(g),C=y(" VAr"),$=h(),M=m("div"),E=m("div"),E.textContent="Total in",S=h(),A=m("div"),F=y(I),Y=y(" kVArh"),O=h(),H=m("div"),H.textContent="Total out",q=h(),z=m("div"),R=y(U),B=y(" kVArh"),u(a,"class","text-right"),u(v,"class","text-right"),u(i,"class","grid grid-cols-2 mt-4"),u(A,"class","text-right"),u(z,"class","text-right"),u(M,"class","grid grid-cols-2 mt-4"),u(e,"class","mx-2 text-sm")},m(L,j){w(L,e,j),s(e,l),s(e,n),s(e,i),s(i,o),s(i,r),s(i,a),s(a,c),s(a,p),s(i,_),s(i,b),s(i,d),s(i,v),s(v,T),s(v,C),s(e,$),s(e,M),s(M,E),s(M,S),s(M,A),s(A,F),s(A,Y),s(M,O),s(M,H),s(M,q),s(M,z),s(z,R),s(z,B)},p(L,[j]){j&1&&f!==(f=(typeof L[0]<"u"?L[0].toFixed(0):"-")+"")&&G(c,f),j&2&&g!==(g=(typeof L[1]<"u"?L[1].toFixed(0):"-")+"")&&G(T,g),j&4&&I!==(I=(typeof L[2]<"u"?L[2].toFixed(1):"-")+"")&&G(F,I),j&8&&U!==(U=(typeof L[3]<"u"?L[3].toFixed(1):"-")+"")&&G(R,U)},i:ne,o:ne,d(L){L&&k(e)}}}function ap(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:o}=e,{exportTotal:r}=e;return t.$$set=a=>{"importInstant"in a&&l(0,n=a.importInstant),"exportInstant"in a&&l(1,i=a.exportInstant),"importTotal"in a&&l(2,o=a.importTotal),"exportTotal"in a&&l(3,r=a.exportTotal)},[n,i,o,r]}class fp extends Me{constructor(e){super(),Se(this,e,ap,rp,$e,{importInstant:0,exportInstant:1,importTotal:2,exportTotal:3})}}function $a(t){let e;function l(o,r){return o[3]?mp:cp}let n=l(t),i=n(t);return{c(){i.c(),e=Ge()},m(o,r){i.m(o,r),w(o,e,r)},p(o,r){n===(n=l(o))&&i?i.p(o,r):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&k(e)}}}function cp(t){let e,l,n,i,o,r,a=me(t[1].h.u,2)+"",f,c,p,_,b,d,v=me(t[1].d.u,1)+"",g,T,C,$,M,E,S=me(t[1].m.u)+"",A,I,F,Y,O,H,q=me(t[0].last_month.u)+"",z,U,R,B,L=t[4]&&Ta(t);return{c(){e=m("strong"),e.textContent="Consumption",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),r=m("div"),f=y(a),c=y(" kWh"),p=h(),_=m("div"),_.textContent="Day",b=h(),d=m("div"),g=y(v),T=y(" kWh"),C=h(),$=m("div"),$.textContent="Month",M=h(),E=m("div"),A=y(S),I=y(" kWh"),F=h(),Y=m("div"),Y.textContent="Last month",O=h(),H=m("div"),z=y(q),U=y(" kWh"),R=h(),L&&L.c(),B=Ge(),u(r,"class","text-right"),u(d,"class","text-right"),u(E,"class","text-right"),u(H,"class","text-right"),u(n,"class","grid grid-cols-2 mb-3")},m(j,W){w(j,e,W),w(j,l,W),w(j,n,W),s(n,i),s(n,o),s(n,r),s(r,f),s(r,c),s(n,p),s(n,_),s(n,b),s(n,d),s(d,g),s(d,T),s(n,C),s(n,$),s(n,M),s(n,E),s(E,A),s(E,I),s(n,F),s(n,Y),s(n,O),s(n,H),s(H,z),s(H,U),w(j,R,W),L&&L.m(j,W),w(j,B,W)},p(j,W){W&2&&a!==(a=me(j[1].h.u,2)+"")&&G(f,a),W&2&&v!==(v=me(j[1].d.u,1)+"")&&G(g,v),W&2&&S!==(S=me(j[1].m.u)+"")&&G(A,S),W&1&&q!==(q=me(j[0].last_month.u)+"")&&G(z,q),j[4]?L?L.p(j,W):(L=Ta(j),L.c(),L.m(B.parentNode,B)):L&&(L.d(1),L=null)},d(j){j&&k(e),j&&k(l),j&&k(n),j&&k(R),L&&L.d(j),j&&k(B)}}}function mp(t){let e,l,n,i,o,r,a=me(t[1].h.u,2)+"",f,c,p,_,b,d,v,g=me(t[1].d.u,1)+"",T,C,$,M,E,S,A,I=me(t[1].m.u)+"",F,Y,O,H,q,z,U,R=me(t[0].last_month.u)+"",B,L,j,W,te,le,pe,ie,Te,je,Pe,We=me(t[1].h.p,2)+"",be,ke,Ie,ge,ae,we,J,se=me(t[1].d.p,1)+"",Ee,Fe,_e,ye,Ne,de,Ce,x=me(t[1].m.p)+"",oe,Oe,ue,ve,dt,jl,xt,ct=me(t[0].last_month.p)+"",Ml,pl,qt,vt,Qe=t[4]&&Sa(t),Xe=t[4]&&Ma(t),Ze=t[4]&&Na(t),Ue=t[4]&&Pa(t),Je=t[4]&&Aa(t),Be=t[4]&&Da(t),xe=t[4]&&Ea(t),et=t[4]&&Ia(t);return{c(){e=m("strong"),e.textContent="Import",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),r=m("div"),f=y(a),c=y(" kWh"),p=h(),Qe&&Qe.c(),_=h(),b=m("div"),b.textContent="Day",d=h(),v=m("div"),T=y(g),C=y(" kWh"),$=h(),Xe&&Xe.c(),M=h(),E=m("div"),E.textContent="Month",S=h(),A=m("div"),F=y(I),Y=y(" kWh"),O=h(),Ze&&Ze.c(),H=h(),q=m("div"),q.textContent="Last mo.",z=h(),U=m("div"),B=y(R),L=y(" kWh"),j=h(),Ue&&Ue.c(),te=h(),le=m("strong"),le.textContent="Export",pe=h(),ie=m("div"),Te=m("div"),Te.textContent="Hour",je=h(),Pe=m("div"),be=y(We),ke=y(" kWh"),Ie=h(),Je&&Je.c(),ge=h(),ae=m("div"),ae.textContent="Day",we=h(),J=m("div"),Ee=y(se),Fe=y(" kWh"),_e=h(),Be&&Be.c(),ye=h(),Ne=m("div"),Ne.textContent="Month",de=h(),Ce=m("div"),oe=y(x),Oe=y(" kWh"),ue=h(),xe&&xe.c(),ve=h(),dt=m("div"),dt.textContent="Last mo.",jl=h(),xt=m("div"),Ml=y(ct),pl=y(" kWh"),qt=h(),et&&et.c(),u(r,"class","text-right"),u(v,"class","text-right"),u(A,"class","text-right"),u(U,"class","text-right"),u(n,"class",W="grid grid-cols-"+t[5]+" mb-3"),u(Pe,"class","text-right"),u(J,"class","text-right"),u(Ce,"class","text-right"),u(xt,"class","text-right"),u(ie,"class",vt="grid grid-cols-"+t[5])},m(re,he){w(re,e,he),w(re,l,he),w(re,n,he),s(n,i),s(n,o),s(n,r),s(r,f),s(r,c),s(n,p),Qe&&Qe.m(n,null),s(n,_),s(n,b),s(n,d),s(n,v),s(v,T),s(v,C),s(n,$),Xe&&Xe.m(n,null),s(n,M),s(n,E),s(n,S),s(n,A),s(A,F),s(A,Y),s(n,O),Ze&&Ze.m(n,null),s(n,H),s(n,q),s(n,z),s(n,U),s(U,B),s(U,L),s(n,j),Ue&&Ue.m(n,null),w(re,te,he),w(re,le,he),w(re,pe,he),w(re,ie,he),s(ie,Te),s(ie,je),s(ie,Pe),s(Pe,be),s(Pe,ke),s(ie,Ie),Je&&Je.m(ie,null),s(ie,ge),s(ie,ae),s(ie,we),s(ie,J),s(J,Ee),s(J,Fe),s(ie,_e),Be&&Be.m(ie,null),s(ie,ye),s(ie,Ne),s(ie,de),s(ie,Ce),s(Ce,oe),s(Ce,Oe),s(ie,ue),xe&&xe.m(ie,null),s(ie,ve),s(ie,dt),s(ie,jl),s(ie,xt),s(xt,Ml),s(xt,pl),s(ie,qt),et&&et.m(ie,null)},p(re,he){he&2&&a!==(a=me(re[1].h.u,2)+"")&&G(f,a),re[4]?Qe?Qe.p(re,he):(Qe=Sa(re),Qe.c(),Qe.m(n,_)):Qe&&(Qe.d(1),Qe=null),he&2&&g!==(g=me(re[1].d.u,1)+"")&&G(T,g),re[4]?Xe?Xe.p(re,he):(Xe=Ma(re),Xe.c(),Xe.m(n,M)):Xe&&(Xe.d(1),Xe=null),he&2&&I!==(I=me(re[1].m.u)+"")&&G(F,I),re[4]?Ze?Ze.p(re,he):(Ze=Na(re),Ze.c(),Ze.m(n,H)):Ze&&(Ze.d(1),Ze=null),he&1&&R!==(R=me(re[0].last_month.u)+"")&&G(B,R),re[4]?Ue?Ue.p(re,he):(Ue=Pa(re),Ue.c(),Ue.m(n,null)):Ue&&(Ue.d(1),Ue=null),he&32&&W!==(W="grid grid-cols-"+re[5]+" mb-3")&&u(n,"class",W),he&2&&We!==(We=me(re[1].h.p,2)+"")&&G(be,We),re[4]?Je?Je.p(re,he):(Je=Aa(re),Je.c(),Je.m(ie,ge)):Je&&(Je.d(1),Je=null),he&2&&se!==(se=me(re[1].d.p,1)+"")&&G(Ee,se),re[4]?Be?Be.p(re,he):(Be=Da(re),Be.c(),Be.m(ie,ye)):Be&&(Be.d(1),Be=null),he&2&&x!==(x=me(re[1].m.p)+"")&&G(oe,x),re[4]?xe?xe.p(re,he):(xe=Ea(re),xe.c(),xe.m(ie,ve)):xe&&(xe.d(1),xe=null),he&1&&ct!==(ct=me(re[0].last_month.p)+"")&&G(Ml,ct),re[4]?et?et.p(re,he):(et=Ia(re),et.c(),et.m(ie,null)):et&&(et.d(1),et=null),he&32&&vt!==(vt="grid grid-cols-"+re[5])&&u(ie,"class",vt)},d(re){re&&k(e),re&&k(l),re&&k(n),Qe&&Qe.d(),Xe&&Xe.d(),Ze&&Ze.d(),Ue&&Ue.d(),re&&k(te),re&&k(le),re&&k(pe),re&&k(ie),Je&&Je.d(),Be&&Be.d(),xe&&xe.d(),et&&et.d()}}}function Ta(t){let e,l,n,i,o,r,a=me(t[1].h.c,2)+"",f,c,p,_,b,d,v,g=me(t[1].d.c,1)+"",T,C,$,M,E,S,A,I=me(t[1].m.c)+"",F,Y,O,H,q,z,U,R=me(t[0].last_month.c)+"",B,L,j;return{c(){e=m("strong"),e.textContent="Cost",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),r=m("div"),f=y(a),c=h(),p=y(t[2]),_=h(),b=m("div"),b.textContent="Day",d=h(),v=m("div"),T=y(g),C=h(),$=y(t[2]),M=h(),E=m("div"),E.textContent="Month",S=h(),A=m("div"),F=y(I),Y=h(),O=y(t[2]),H=h(),q=m("div"),q.textContent="Last month",z=h(),U=m("div"),B=y(R),L=h(),j=y(t[2]),u(r,"class","text-right"),u(v,"class","text-right"),u(A,"class","text-right"),u(U,"class","text-right"),u(n,"class","grid grid-cols-2")},m(W,te){w(W,e,te),w(W,l,te),w(W,n,te),s(n,i),s(n,o),s(n,r),s(r,f),s(r,c),s(r,p),s(n,_),s(n,b),s(n,d),s(n,v),s(v,T),s(v,C),s(v,$),s(n,M),s(n,E),s(n,S),s(n,A),s(A,F),s(A,Y),s(A,O),s(n,H),s(n,q),s(n,z),s(n,U),s(U,B),s(U,L),s(U,j)},p(W,te){te&2&&a!==(a=me(W[1].h.c,2)+"")&&G(f,a),te&4&&G(p,W[2]),te&2&&g!==(g=me(W[1].d.c,1)+"")&&G(T,g),te&4&&G($,W[2]),te&2&&I!==(I=me(W[1].m.c)+"")&&G(F,I),te&4&&G(O,W[2]),te&1&&R!==(R=me(W[0].last_month.c)+"")&&G(B,R),te&4&&G(j,W[2])},d(W){W&&k(e),W&&k(l),W&&k(n)}}}function Sa(t){let e,l=me(t[1].h.c,2)+"",n,i,o;return{c(){e=m("div"),n=y(l),i=h(),o=y(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=me(r[1].h.c,2)+"")&&G(n,l),a&4&&G(o,r[2])},d(r){r&&k(e)}}}function Ma(t){let e,l=me(t[1].d.c,1)+"",n,i,o;return{c(){e=m("div"),n=y(l),i=h(),o=y(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=me(r[1].d.c,1)+"")&&G(n,l),a&4&&G(o,r[2])},d(r){r&&k(e)}}}function Na(t){let e,l=me(t[1].m.c)+"",n,i,o;return{c(){e=m("div"),n=y(l),i=h(),o=y(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=me(r[1].m.c)+"")&&G(n,l),a&4&&G(o,r[2])},d(r){r&&k(e)}}}function Pa(t){let e,l=me(t[0].last_month.c)+"",n,i,o;return{c(){e=m("div"),n=y(l),i=h(),o=y(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&1&&l!==(l=me(r[0].last_month.c)+"")&&G(n,l),a&4&&G(o,r[2])},d(r){r&&k(e)}}}function Aa(t){let e,l=me(t[1].h.i,2)+"",n,i,o;return{c(){e=m("div"),n=y(l),i=h(),o=y(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=me(r[1].h.i,2)+"")&&G(n,l),a&4&&G(o,r[2])},d(r){r&&k(e)}}}function Da(t){let e,l=me(t[1].d.i,1)+"",n,i,o;return{c(){e=m("div"),n=y(l),i=h(),o=y(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=me(r[1].d.i,1)+"")&&G(n,l),a&4&&G(o,r[2])},d(r){r&&k(e)}}}function Ea(t){let e,l=me(t[1].m.i)+"",n,i,o;return{c(){e=m("div"),n=y(l),i=h(),o=y(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&2&&l!==(l=me(r[1].m.i)+"")&&G(n,l),a&4&&G(o,r[2])},d(r){r&&k(e)}}}function Ia(t){let e,l=me(t[0].last_month.i)+"",n,i,o;return{c(){e=m("div"),n=y(l),i=h(),o=y(t[2]),u(e,"class","text-right")},m(r,a){w(r,e,a),s(e,n),s(e,i),s(e,o)},p(r,a){a&1&&l!==(l=me(r[0].last_month.i)+"")&&G(n,l),a&4&&G(o,r[2])},d(r){r&&k(e)}}}function pp(t){let e,l,n,i,o,r,a=t[1]&&$a(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Real time calculation",n=h(),i=m("br"),o=m("br"),r=h(),a&&a.c(),u(e,"class","mx-2 text-sm")},m(f,c){w(f,e,c),s(e,l),s(e,n),s(e,i),s(e,o),s(e,r),a&&a.m(e,null)},p(f,[c]){f[1]?a?a.p(f,c):(a=$a(f),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i:ne,o:ne,d(f){f&&k(e),a&&a.d()}}}function _p(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:r}=e,a=!1,f=3;return t.$$set=c=>{"sysinfo"in c&&l(0,n=c.sysinfo),"data"in c&&l(1,i=c.data),"currency"in c&&l(2,o=c.currency),"hasExport"in c&&l(3,r=c.hasExport)},t.$$.update=()=>{t.$$.dirty&18&&(l(4,a=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(5,f=a?3:2))},[n,i,o,r,a,f]}class dp extends Me{constructor(e){super(),Se(this,e,_p,pp,$e,{sysinfo:0,data:1,currency:2,hasExport:3})}}function vp(t){let e,l,n,i;return n=new cn({props:{config:t[0]}}),{c(){e=m("a"),e.textContent="Provided by ENTSO-E",l=h(),Z(n.$$.fragment),u(e,"href","https://transparency.entsoe.eu/"),u(e,"target","_blank"),u(e,"class","text-xs float-right z-40")},m(o,r){w(o,e,r),w(o,l,r),Q(n,o,r),i=!0},p(o,[r]){const a={};r&1&&(a.config=o[0]),n.$set(a)},i(o){i||(N(n.$$.fragment,o),i=!0)},o(o){D(n.$$.fragment,o),i=!1},d(o){o&&k(e),o&&k(l),X(n,o)}}}function hp(t,e,l){let{json:n}=e,{sysinfo:i}=e,o={},r,a;return t.$$set=f=>{"json"in f&&l(1,n=f.json),"sysinfo"in f&&l(2,i=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let f=n.currency,c=new Date().getUTCHours(),p=0,_=0,b=0,d=[],v=[],g=[];l(4,a=l(3,r=0));let T=new Date;for(al(T,i.clock_offset),p=c;p<24&&(_=n[Re(b++)],_!=null);p++)v.push({label:Re(T.getUTCHours())}),g.push(_*100),l(4,a=Math.min(a,_*100)),l(3,r=Math.max(r,_*100)),al(T,1);for(p=0;p<24&&(_=n[Re(b++)],_!=null);p++)v.push({label:Re(T.getUTCHours())}),g.push(_*100),l(4,a=Math.min(a,_*100)),l(3,r=Math.max(r,_*100)),al(T,1);if(a>-100&&r<100){switch(f){case"NOK":case"SEK":case"DKK":f="øre";break;case"EUR":f="cent";break;default:f=f+"/100"}for(l(4,a*=100),l(3,r*=100),p=0;p=0?S.toFixed(A):"",title:S>=0?S.toFixed(2)+" "+f:"",value:_>=0?Math.abs(_):0,label2:S<0?S.toFixed(A):"",title2:S<0?S.toFixed(2)+" "+f:"",value2:_<0?Math.abs(_):0,color:"#7c3aed"})}let $=Math.max(r,Math.abs(a));if(a<0){l(4,a=Math.min($/4*-1,a));let S=Math.ceil(Math.abs(a)/$*4),A=a/S;for(p=1;p{"json"in f&&l(1,n=f.json),"sysinfo"in f&&l(2,i=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let f=0,c=[],p=[],_=[];l(4,a=l(3,r=0));let b=al(new Date,-24),d=new Date().getUTCHours();for(al(b,i.clock_offset-(24+b.getHours()-b.getUTCHours())%24),f=d;f<24;f++){let C=n["i"+Re(f)],$=n["e"+Re(f)];C===void 0&&(C=0),$===void 0&&($=0),p.push({label:Re(b.getHours())}),_.push({label:C.toFixed(1),title:C.toFixed(2)+" kWh",value:C*10,label2:$.toFixed(1),title2:$.toFixed(2)+" kWh",value2:$*10,color:"#7c3aed"}),l(4,a=Math.max(a,$*10)),l(3,r=Math.max(r,C*10)),al(b,1)}for(f=0;f{"json"in f&&l(1,n=f.json),"sysinfo"in f&&l(2,i=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let f=0,c=[],p=[],_=[];l(4,a=l(3,r=0));let b=new Date,d=new Date;for(al(b,i.clock_offset-(24+b.getHours()-b.getUTCHours())%24),al(d,i.clock_offset-(24+d.getHours()-d.getUTCHours())%24),d.setDate(0),f=b.getDate();f<=d.getDate();f++){let C=n["i"+Re(f)],$=n["e"+Re(f)];C===void 0&&(C=0),$===void 0&&($=0),p.push({label:Re(f)}),_.push({label:C.toFixed(C<10?1:0),title:C.toFixed(2)+" kWh",value:C,label2:$.toFixed($<10?1:0),title2:$.toFixed(2)+" kWh",value2:$,color:"#7c3aed"}),l(4,a=Math.max(a,$)),l(3,r=Math.max(r,C))}for(f=1;f{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=0,f=0,c=[],p=[],_=[];n.s&&n.s.forEach((v,g)=>{var T=v.n?v.n:v.a;f=v.v,f==-127&&(f=0),p.push({label:T.slice(-4)}),_.push({label:f.toFixed(1),value:f,color:"#7c3aed"}),l(3,r=Math.min(r,f)),l(2,o=Math.max(o,f))}),l(2,o=Math.ceil(o)),l(3,r=Math.floor(r));let b=o;r<0&&(b+=Math.abs(r));let d=b/4;for(a=0;a<5;a++)f=r+d*a,c.push({value:f,label:f.toFixed(1)});l(0,i={title:"Temperature sensors (°C)",height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:r,max:o,ticks:c},x:{ticks:p},points:_})}},[i,n,o,r]}class Mp extends Me{constructor(e){super(),Se(this,e,Sp,Tp,$e,{json:1})}}function Np(t){let e,l;return e=new cn({props:{config:t[0]}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}let Pp=0;function Ap(t,e,l){let n={},i=0,o;return Ic.subscribe(r=>{l(2,o=r)}),Ec(),t.$$.update=()=>{if(t.$$.dirty&6){let r=0,a=[],f=[],c=[];if(a.push({value:0,label:0}),o&&o.p)for(r=0;r0?Re(p.d)+"."+xs[new Date().getMonth()]:"-"}),l(1,i=Math.max(i,p.v))}if(o&&o.t){for(r=0;r=i)break;a.push({value:p,label:p})}a.push({label:o.m.toFixed(1),align:"right",color:"green",value:o.m})}o&&o.c&&(a.push({label:o.c.toFixed(0),color:"orange",value:o.c}),l(1,i=Math.max(i,o.c))),l(1,i=Math.ceil(i)),l(0,n={title:"Tariff peaks",padding:{top:20,right:35,bottom:20,left:35},y:{min:Pp,max:i,ticks:a},x:{ticks:f},points:c})}},[n,i,o]}class Dp extends Me{constructor(e){super(),Se(this,e,Ap,Np,$e,{})}}function Fa(t){let e,l,n,i,o,r,a=(t[0].mt?ws(t[0].mt):"-")+"",f,c,p,_=(t[0].ic?t[0].ic.toFixed(1):"-")+"",b,d,v;return i=new Uc({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:"Import",sub:t[0].p,subunit:t[0].pc,colorFn:Sc}}),{c(){e=m("div"),l=m("div"),n=m("div"),Z(i.$$.fragment),o=h(),r=m("div"),f=y(a),c=h(),p=m("div"),b=y(_),d=y(" kWh"),u(n,"class","col-span-2"),u(p,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(g,T){w(g,e,T),s(e,l),s(l,n),Q(i,n,null),s(l,o),s(l,r),s(r,f),s(l,c),s(l,p),s(p,b),s(p,d),v=!0},p(g,T){const C={};T&1&&(C.val=g[0].i?g[0].i:0),T&1&&(C.max=g[0].im?g[0].im:15e3),T&1&&(C.sub=g[0].p),T&1&&(C.subunit=g[0].pc),i.$set(C),(!v||T&1)&&a!==(a=(g[0].mt?ws(g[0].mt):"-")+"")&&G(f,a),(!v||T&1)&&_!==(_=(g[0].ic?g[0].ic.toFixed(1):"-")+"")&&G(b,_)},i(g){v||(N(i.$$.fragment,g),v=!0)},o(g){D(i.$$.fragment,g),v=!1},d(g){g&&k(e),X(i)}}}function Ra(t){let e,l,n,i,o,r,a,f,c=(t[0].ec?t[0].ec.toFixed(1):"-")+"",p,_,b;return i=new Uc({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:"Export",colorFn:pm}}),{c(){e=m("div"),l=m("div"),n=m("div"),Z(i.$$.fragment),o=h(),r=m("div"),a=h(),f=m("div"),p=y(c),_=y(" kWh"),u(n,"class","col-span-2"),u(f,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(d,v){w(d,e,v),s(e,l),s(l,n),Q(i,n,null),s(l,o),s(l,r),s(l,a),s(l,f),s(f,p),s(f,_),b=!0},p(d,v){const g={};v&1&&(g.val=d[0].e?d[0].e:0),v&1&&(g.max=d[0].om?d[0].om*1e3:1e4),i.$set(g),(!b||v&1)&&c!==(c=(d[0].ec?d[0].ec.toFixed(1):"-")+"")&&G(p,c)},i(d){b||(N(i.$$.fragment,d),b=!0)},o(d){D(i.$$.fragment,d),b=!1},d(d){d&&k(e),X(i)}}}function La(t){let e,l,n;return l=new ip({props:{u1:t[0].u1,u2:t[0].u2,u3:t[0].u3,ds:t[0].ds}}),{c(){e=m("div"),Z(l.$$.fragment),u(e,"class","cnt")},m(i,o){w(i,e,o),Q(l,e,null),n=!0},p(i,o){const r={};o&1&&(r.u1=i[0].u1),o&1&&(r.u2=i[0].u2),o&1&&(r.u3=i[0].u3),o&1&&(r.ds=i[0].ds),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),X(l)}}}function Oa(t){let e,l,n;return l=new up({props:{u1:t[0].u1,u2:t[0].u2,u3:t[0].u3,i1:t[0].i1,i2:t[0].i2,i3:t[0].i3,max:t[0].mf?t[0].mf:32}}),{c(){e=m("div"),Z(l.$$.fragment),u(e,"class","cnt")},m(i,o){w(i,e,o),Q(l,e,null),n=!0},p(i,o){const r={};o&1&&(r.u1=i[0].u1),o&1&&(r.u2=i[0].u2),o&1&&(r.u3=i[0].u3),o&1&&(r.i1=i[0].i1),o&1&&(r.i2=i[0].i2),o&1&&(r.i3=i[0].i3),o&1&&(r.max=i[0].mf?i[0].mf:32),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),X(l)}}}function Ua(t){let e,l,n;return l=new fp({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec}}),{c(){e=m("div"),Z(l.$$.fragment),u(e,"class","cnt")},m(i,o){w(i,e,o),Q(l,e,null),n=!0},p(i,o){const r={};o&1&&(r.importInstant=i[0].ri),o&1&&(r.exportInstant=i[0].re),o&1&&(r.importTotal=i[0].ric),o&1&&(r.exportTotal=i[0].rec),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),X(l)}}}function qa(t){let e,l,n;return l=new dp({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"),Z(l.$$.fragment),u(e,"class","cnt")},m(i,o){w(i,e,o),Q(l,e,null),n=!0},p(i,o){const r={};o&2&&(r.sysinfo=i[1]),o&1&&(r.data=i[0].ea),o&1&&(r.currency=i[0].pc),o&1&&(r.hasExport=i[0].om>0||i[0].e>0),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),X(l)}}}function Ha(t){let e,l,n;return l=new Dp({}),{c(){e=m("div"),Z(l.$$.fragment),u(e,"class","cnt h-64")},m(i,o){w(i,e,o),Q(l,e,null),n=!0},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),X(l)}}}function ja(t){let e,l,n;return l=new bp({props:{json:t[2],sysinfo:t[1]}}),{c(){e=m("div"),Z(l.$$.fragment),u(e,"class","cnt gwf")},m(i,o){w(i,e,o),Q(l,e,null),n=!0},p(i,o){const r={};o&4&&(r.json=i[2]),o&2&&(r.sysinfo=i[1]),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),X(l)}}}function Wa(t){let e,l,n;return l=new wp({props:{json:t[3],sysinfo:t[1]}}),{c(){e=m("div"),Z(l.$$.fragment),u(e,"class","cnt gwf")},m(i,o){w(i,e,o),Q(l,e,null),n=!0},p(i,o){const r={};o&8&&(r.json=i[3]),o&2&&(r.sysinfo=i[1]),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),X(l)}}}function Ga(t){let e,l,n;return l=new $p({props:{json:t[4],sysinfo:t[1]}}),{c(){e=m("div"),Z(l.$$.fragment),u(e,"class","cnt gwf")},m(i,o){w(i,e,o),Q(l,e,null),n=!0},p(i,o){const r={};o&16&&(r.json=i[4]),o&2&&(r.sysinfo=i[1]),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),X(l)}}}function Ba(t){let e,l,n;return l=new Mp({props:{json:t[5]}}),{c(){e=m("div"),Z(l.$$.fragment),u(e,"class","cnt gwf")},m(i,o){w(i,e,o),Q(l,e,null),n=!0},p(i,o){const r={};o&32&&(r.json=i[5]),l.$set(r)},i(i){n||(N(l.$$.fragment,i),n=!0)},o(i){D(l.$$.fragment,i),n=!1},d(i){i&&k(e),X(l)}}}function Ep(t){let e,l=Ye(t[1].ui.i,t[0].i),n,i=Ye(t[1].ui.e,t[0].om||t[0].e>0),o,r=Ye(t[1].ui.v,t[0].u1>100||t[0].u2>100||t[0].u3>100),a,f=Ye(t[1].ui.a,t[0].i1>.01||t[0].i2>.01||t[0].i3>.01),c,p=Ye(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),_,b=Ye(t[1].ui.c,t[0].ea),d,v=Ye(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("10YNO")||t[0].pr=="10Y1001A1001A48H")),g,T=Ye(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),C,$=Ye(t[1].ui.d,t[3]),M,E=Ye(t[1].ui.m,t[4]),S,A=Ye(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),I,F=l&&Fa(t),Y=i&&Ra(t),O=r&&La(t),H=f&&Oa(t),q=p&&Ua(t),z=b&&qa(t),U=v&&Ha(),R=T&&ja(t),B=$&&Wa(t),L=E&&Ga(t),j=A&&Ba(t);return{c(){e=m("div"),F&&F.c(),n=h(),Y&&Y.c(),o=h(),O&&O.c(),a=h(),H&&H.c(),c=h(),q&&q.c(),_=h(),z&&z.c(),d=h(),U&&U.c(),g=h(),R&&R.c(),C=h(),B&&B.c(),M=h(),L&&L.c(),S=h(),j&&j.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(W,te){w(W,e,te),F&&F.m(e,null),s(e,n),Y&&Y.m(e,null),s(e,o),O&&O.m(e,null),s(e,a),H&&H.m(e,null),s(e,c),q&&q.m(e,null),s(e,_),z&&z.m(e,null),s(e,d),U&&U.m(e,null),s(e,g),R&&R.m(e,null),s(e,C),B&&B.m(e,null),s(e,M),L&&L.m(e,null),s(e,S),j&&j.m(e,null),I=!0},p(W,[te]){te&3&&(l=Ye(W[1].ui.i,W[0].i)),l?F?(F.p(W,te),te&3&&N(F,1)):(F=Fa(W),F.c(),N(F,1),F.m(e,n)):F&&(Ae(),D(F,1,1,()=>{F=null}),De()),te&3&&(i=Ye(W[1].ui.e,W[0].om||W[0].e>0)),i?Y?(Y.p(W,te),te&3&&N(Y,1)):(Y=Ra(W),Y.c(),N(Y,1),Y.m(e,o)):Y&&(Ae(),D(Y,1,1,()=>{Y=null}),De()),te&3&&(r=Ye(W[1].ui.v,W[0].u1>100||W[0].u2>100||W[0].u3>100)),r?O?(O.p(W,te),te&3&&N(O,1)):(O=La(W),O.c(),N(O,1),O.m(e,a)):O&&(Ae(),D(O,1,1,()=>{O=null}),De()),te&3&&(f=Ye(W[1].ui.a,W[0].i1>.01||W[0].i2>.01||W[0].i3>.01)),f?H?(H.p(W,te),te&3&&N(H,1)):(H=Oa(W),H.c(),N(H,1),H.m(e,c)):H&&(Ae(),D(H,1,1,()=>{H=null}),De()),te&3&&(p=Ye(W[1].ui.r,W[0].ri>0||W[0].re>0||W[0].ric>0||W[0].rec>0)),p?q?(q.p(W,te),te&3&&N(q,1)):(q=Ua(W),q.c(),N(q,1),q.m(e,_)):q&&(Ae(),D(q,1,1,()=>{q=null}),De()),te&3&&(b=Ye(W[1].ui.c,W[0].ea)),b?z?(z.p(W,te),te&3&&N(z,1)):(z=qa(W),z.c(),N(z,1),z.m(e,d)):z&&(Ae(),D(z,1,1,()=>{z=null}),De()),te&3&&(v=Ye(W[1].ui.t,W[0].pr&&(W[0].pr.startsWith("10YNO")||W[0].pr=="10Y1001A1001A48H"))),v?U?te&3&&N(U,1):(U=Ha(),U.c(),N(U,1),U.m(e,g)):U&&(Ae(),D(U,1,1,()=>{U=null}),De()),te&3&&(T=Ye(W[1].ui.p,W[0].pe&&!Number.isNaN(W[0].p))),T?R?(R.p(W,te),te&3&&N(R,1)):(R=ja(W),R.c(),N(R,1),R.m(e,C)):R&&(Ae(),D(R,1,1,()=>{R=null}),De()),te&10&&($=Ye(W[1].ui.d,W[3])),$?B?(B.p(W,te),te&10&&N(B,1)):(B=Wa(W),B.c(),N(B,1),B.m(e,M)):B&&(Ae(),D(B,1,1,()=>{B=null}),De()),te&18&&(E=Ye(W[1].ui.m,W[4])),E?L?(L.p(W,te),te&18&&N(L,1)):(L=Ga(W),L.c(),N(L,1),L.m(e,S)):L&&(Ae(),D(L,1,1,()=>{L=null}),De()),te&35&&(A=Ye(W[1].ui.s,W[0].t&&W[0].t!=-127&&W[5].c>1)),A?j?(j.p(W,te),te&35&&N(j,1)):(j=Ba(W),j.c(),N(j,1),j.m(e,null)):j&&(Ae(),D(j,1,1,()=>{j=null}),De())},i(W){I||(N(F),N(Y),N(O),N(H),N(q),N(z),N(U),N(R),N(B),N(L),N(j),I=!0)},o(W){D(F),D(Y),D(O),D(H),D(q),D(z),D(U),D(R),D(B),D(L),D(j),I=!1},d(W){W&&k(e),F&&F.d(),Y&&Y.d(),O&&O.d(),H&&H.d(),q&&q.d(),z&&z.d(),U&&U.d(),R&&R.d(),B&&B.d(),L&&L.d(),j&&j.d()}}}function Ip(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},r={},a={},f={};return Mc.subscribe(c=>{l(2,o=c)}),Nc.subscribe(c=>{l(3,r=c)}),Pc.subscribe(c=>{l(4,a=c)}),Dc.subscribe(c=>{l(5,f=c)}),t.$$set=c=>{"data"in c&&l(0,n=c.data),"sysinfo"in c&&l(1,i=c.sysinfo)},[n,i,o,r,a,f]}class Fp extends Me{constructor(e){super(),Se(this,e,Ip,Ep,$e,{data:0,sysinfo:1})}}let oo={};const qc=rt(oo);async function Rp(){oo=await(await fetch("/configuration.json")).json(),qc.set(oo)}function za(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Lp(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function Op(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function Ya(t){let e;return{c(){e=m("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function Va(t){let e,l,n;return{c(){e=m("option"),e.textContent="UART1",l=h(),n=m("option"),n.textContent="UART2",e.__value=9,e.value=e.__value,n.__value=16,n.value=n.__value},m(i,o){w(i,e,o),w(i,l,o),w(i,n,o)},d(i){i&&k(e),i&&k(l),i&&k(n)}}}function Ka(t){let e;return{c(){e=m("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function Qa(t){let e,l,n;return{c(){e=m("option"),l=y("GPIO"),n=y(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){w(i,e,o),s(e,l),s(e,n)},d(i){i&&k(e)}}}function Xa(t){let e,l=t[4]>3&&!(t[0]=="esp32"&&(t[4]==9||t[4]==16))&&!(t[0]=="esp32s2"&&t[4]==18)&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Qa(t);return{c(){l&&l.c(),e=Ge()},m(n,i){l&&l.m(n,i),w(n,e,i)},p(n,i){n[4]>3&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!(n[0]=="esp32s2"&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Qa(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&k(e)}}}function Up(t){let e,l,n,i,o;function r(v,g){return v[0]=="esp32c3"?Op:Lp}let a=r(t),f=a(t),c=t[0]=="esp8266"&&Ya(),p=(t[0]=="esp32"||t[0]=="esp32solo")&&Va(),_=t[0]=="esp32s2"&&Ka(),b={length:t[1]+1},d=[];for(let v=0;v{"chip"in o&&l(0,n=o.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32c3":l(1,i=19);break}},[n,i]}class Hc extends Me{constructor(e){super(),Se(this,e,qp,Up,$e,{chip:0})}}function Za(t){let e,l,n=t[1]&&Ja(t);return{c(){e=m("div"),l=m("div"),n&&n.c(),u(l,"class","fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center"),u(e,"class","z-50"),u(e,"aria-modal","true")},m(i,o){w(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=Ja(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&k(e),n&&n.d()}}}function Ja(t){let e,l;return{c(){e=m("div"),l=y(t[1]),u(e,"class","bg-white m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 w-96")},m(n,i){w(n,e,i),s(e,l)},p(n,i){i&2&&G(l,n[1])},d(n){n&&k(e)}}}function Hp(t){let e,l=t[0]&&Za(t);return{c(){l&&l.c(),e=Ge()},m(n,i){l&&l.m(n,i),w(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Za(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:ne,o:ne,d(n){l&&l.d(n),n&&k(e)}}}function jp(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 Dt extends Me{constructor(e){super(),Se(this,e,jp,Hp,$e,{active:0,message:1})}}function xa(t,e,l){const n=t.slice();return n[1]=e[l],n}function ef(t){let e,l,n=t[1]+"",i;return{c(){e=m("option"),l=y("Europe/"),i=y(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,r){w(o,e,r),s(e,l),s(e,i)},p:ne,d(o){o&&k(e)}}}function Wp(t){let e,l,n,i=t[0],o=[];for(let r=0;r{r[p]=null}),De(),l=r[e],l||(l=r[e]=o[e](f),l.c()),N(l,1),l.m(n.parentNode,n))},i(f){i||(N(l),i=!0)},o(f){D(l),i=!1},d(f){r[e].d(f),f&&k(n)}}}function xp(t){let e,l;return e=new fl({props:{color:"blue",text:"Upload cert",title:"Click here to upload certificate"}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function e0(t){let e,l;return e=new fl({props:{color:"green",text:"Cert OK",title:"Click here to replace certificate"}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function t0(t){let e,l,n,i;const o=[e0,xp],r=[];function a(f,c){return f[3].q.s.r?0:1}return e=a(t),l=r[e]=o[e](t),{c(){l.c(),n=Ge()},m(f,c){r[e].m(f,c),w(f,n,c),i=!0},p(f,c){let p=e;e=a(f),e!==p&&(Ae(),D(r[p],1,1,()=>{r[p]=null}),De(),l=r[e],l||(l=r[e]=o[e](f),l.c()),N(l,1),l.m(n.parentNode,n))},i(f){i||(N(l),i=!0)},o(f){D(l),i=!1},d(f){r[e].d(f),f&&k(n)}}}function l0(t){let e,l;return e=new fl({props:{color:"blue",text:"Upload key",title:"Click here to upload key"}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function n0(t){let e,l;return e=new fl({props:{color:"green",text:"Key OK",title:"Click here to replace key"}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function i0(t){let e,l,n,i;const o=[n0,l0],r=[];function a(f,c){return f[3].q.s.k?0:1}return e=a(t),l=r[e]=o[e](t),{c(){l.c(),n=Ge()},m(f,c){r[e].m(f,c),w(f,n,c),i=!0},p(f,c){let p=e;e=a(f),e!==p&&(Ae(),D(r[p],1,1,()=>{r[p]=null}),De(),l=r[e],l||(l=r[e]=o[e](f),l.c()),N(l,1),l.m(n.parentNode,n))},i(f){i||(N(l),i=!0)},o(f){D(l),i=!1},d(f){r[e].d(f),f&&k(n)}}}function mf(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,T,C,$,M,E,S,A,I,F,Y,O,H,q,z,U,R,B;return o=new Lt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Domoticz",n=h(),i=m("a"),Z(o.$$.fragment),r=h(),a=m("input"),f=h(),c=m("div"),p=m("div"),_=y("Electricity IDX"),b=m("br"),d=h(),v=m("input"),g=h(),T=m("div"),C=y("Current IDX"),$=m("br"),M=h(),E=m("input"),S=h(),A=m("div"),I=y(`Voltage IDX: L1, L2 & L3 + `),F=m("div"),Y=m("input"),O=h(),H=m("input"),q=h(),z=m("input"),u(l,"class","text-sm"),u(i,"href",Ot("MQTT-configuration#domoticz")),u(i,"target","_blank"),u(i,"class","float-right"),u(a,"type","hidden"),u(a,"name","o"),a.value="true",u(v,"name","oe"),u(v,"type","text"),u(v,"class","in-f tr w-full"),u(p,"class","w-1/2"),u(E,"name","oc"),u(E,"type","text"),u(E,"class","in-l tr w-full"),u(T,"class","w-1/2"),u(c,"class","my-1 flex"),u(Y,"name","ou1"),u(Y,"type","text"),u(Y,"class","in-f tr w-1/3"),u(H,"name","ou2"),u(H,"type","text"),u(H,"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(F,"class","flex"),u(A,"class","my-1"),u(e,"class","cnt")},m(L,j){w(L,e,j),s(e,l),s(e,n),s(e,i),Q(o,i,null),s(e,r),s(e,a),s(e,f),s(e,c),s(c,p),s(p,_),s(p,b),s(p,d),s(p,v),V(v,t[3].o.e),s(c,g),s(c,T),s(T,C),s(T,$),s(T,M),s(T,E),V(E,t[3].o.c),s(e,S),s(e,A),s(A,I),s(A,F),s(F,Y),V(Y,t[3].o.u1),s(F,O),s(F,H),V(H,t[3].o.u2),s(F,q),s(F,z),V(z,t[3].o.u3),U=!0,R||(B=[K(v,"input",t[61]),K(E,"input",t[62]),K(Y,"input",t[63]),K(H,"input",t[64]),K(z,"input",t[65])],R=!0)},p(L,j){j[0]&8&&v.value!==L[3].o.e&&V(v,L[3].o.e),j[0]&8&&E.value!==L[3].o.c&&V(E,L[3].o.c),j[0]&8&&Y.value!==L[3].o.u1&&V(Y,L[3].o.u1),j[0]&8&&H.value!==L[3].o.u2&&V(H,L[3].o.u2),j[0]&8&&z.value!==L[3].o.u3&&V(z,L[3].o.u3)},i(L){U||(N(o.$$.fragment,L),U=!0)},o(L){D(o.$$.fragment,L),U=!1},d(L){L&&k(e),X(o),R=!1,Ke(B)}}}function pf(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,T,C,$,M,E,S,A,I,F,Y,O,H,q,z;return o=new Lt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Home-Assistant",n=h(),i=m("a"),Z(o.$$.fragment),r=h(),a=m("input"),f=h(),c=m("div"),p=y("Discovery topic prefix"),_=m("br"),b=h(),d=m("input"),v=h(),g=m("div"),T=y("Hostname for URL"),C=m("br"),$=h(),M=m("input"),S=h(),A=m("div"),I=y("Name tag"),F=m("br"),Y=h(),O=m("input"),u(l,"class","text-sm"),u(i,"href",Ot("MQTT-configuration#home-assistant")),u(i,"target","_blank"),u(i,"class","float-right"),u(a,"type","hidden"),u(a,"name","h"),a.value="true",u(d,"name","ht"),u(d,"type","text"),u(d,"class","in-s"),u(d,"placeholder","homeassistant"),u(c,"class","my-1"),u(M,"name","hh"),u(M,"type","text"),u(M,"class","in-s"),u(M,"placeholder",E=t[3].g.h+".local"),u(g,"class","my-1"),u(O,"name","hn"),u(O,"type","text"),u(O,"class","in-s"),u(A,"class","my-1"),u(e,"class","cnt")},m(U,R){w(U,e,R),s(e,l),s(e,n),s(e,i),Q(o,i,null),s(e,r),s(e,a),s(e,f),s(e,c),s(c,p),s(c,_),s(c,b),s(c,d),V(d,t[3].h.t),s(e,v),s(e,g),s(g,T),s(g,C),s(g,$),s(g,M),V(M,t[3].h.h),s(e,S),s(e,A),s(A,I),s(A,F),s(A,Y),s(A,O),V(O,t[3].h.n),H=!0,q||(z=[K(d,"input",t[66]),K(M,"input",t[67]),K(O,"input",t[68])],q=!0)},p(U,R){R[0]&8&&d.value!==U[3].h.t&&V(d,U[3].h.t),(!H||R[0]&8&&E!==(E=U[3].g.h+".local"))&&u(M,"placeholder",E),R[0]&8&&M.value!==U[3].h.h&&V(M,U[3].h.h),R[0]&8&&O.value!==U[3].h.n&&V(O,U[3].h.n)},i(U){H||(N(o.$$.fragment,U),H=!0)},o(U){D(o.$$.fragment,U),H=!1},d(U){U&&k(e),X(o),q=!1,Ke(z)}}}function _f(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,T,C,$,M;o=new Lt({});let E={length:9},S=[];for(let A=0;A20&&bf(t),p=t[0].chip=="esp8266"&&wf(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Hardware",n=h(),i=m("a"),Z(o.$$.fragment),r=h(),c&&c.c(),a=h(),p&&p.c(),u(l,"class","text-sm"),u(i,"href",Ot("GPIO-configuration")),u(i,"target","_blank"),u(i,"class","float-right"),u(e,"class","cnt")},m(_,b){w(_,e,b),s(e,l),s(e,n),s(e,i),Q(o,i,null),s(e,r),c&&c.m(e,null),s(e,a),p&&p.m(e,null),f=!0},p(_,b){_[0].board>20?c?(c.p(_,b),b[0]&1&&N(c,1)):(c=bf(_),c.c(),N(c,1),c.m(e,a)):c&&(Ae(),D(c,1,1,()=>{c=null}),De()),_[0].chip=="esp8266"?p?p.p(_,b):(p=wf(_),p.c(),p.m(e,null)):p&&(p.d(1),p=null)},i(_){f||(N(o.$$.fragment,_),N(c),f=!0)},o(_){D(o.$$.fragment,_),D(c),f=!1},d(_){_&&k(e),X(o),c&&c.d(),p&&p.d()}}}function bf(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,T,C,$,M,E,S,A,I,F,Y,O,H,q,z,U,R,B,L,j,W,te,le,pe,ie,Te,je,Pe,We,be,ke,Ie,ge,ae,we,J,se,Ee,Fe,_e,ye,Ne,de,Ce,x;b=new Hc({props:{chip:t[0].chip}});let oe=t[0].chip!="esp8266"&&gf(t),Oe=t[3].i.v.p>0&&kf(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=y("HAN"),r=m("label"),a=m("input"),f=y(" pullup"),c=m("br"),p=h(),_=m("select"),Z(b.$$.fragment),d=h(),v=m("div"),g=y("AP button"),T=m("br"),C=h(),$=m("input"),M=h(),E=m("div"),S=y("LED"),A=m("label"),I=m("input"),F=y(" inv"),Y=m("br"),O=h(),H=m("div"),q=m("input"),z=h(),U=m("div"),R=y("RGB"),B=m("label"),L=m("input"),j=y(" inverted"),W=m("br"),te=h(),le=m("div"),pe=m("input"),ie=h(),Te=m("input"),je=h(),Pe=m("input"),We=h(),be=m("div"),ke=y("Temperature"),Ie=m("br"),ge=h(),ae=m("input"),we=h(),J=m("div"),se=y("Analog temp"),Ee=m("br"),Fe=h(),_e=m("input"),ye=h(),oe&&oe.c(),Ne=h(),Oe&&Oe.c(),u(e,"type","hidden"),u(e,"name","i"),e.value="true",u(a,"name","ihu"),a.__value="true",a.value=a.__value,u(a,"type","checkbox"),u(a,"class","rounded mb-1"),u(r,"class","ml-2"),u(_,"name","ihp"),u(_,"class","in-f w-full"),t[3].i.h.p===void 0&&tt(()=>t[73].call(_)),u(i,"class","w-1/3"),u($,"name","ia"),u($,"type","number"),u($,"min","0"),u($,"max",t[6]),u($,"class","in-m tr w-full"),u(v,"class","w-1/3"),u(I,"name","ili"),I.__value="true",I.value=I.__value,u(I,"type","checkbox"),u(I,"class","rounded mb-1"),u(A,"class","ml-4"),u(q,"name","ilp"),u(q,"type","number"),u(q,"min","0"),u(q,"max",t[6]),u(q,"class","in-l tr w-full"),u(H,"class","flex"),u(E,"class","w-1/3"),u(L,"name","iri"),L.__value="true",L.value=L.__value,u(L,"type","checkbox"),u(L,"class","rounded mb-1"),u(B,"class","ml-4"),u(pe,"name","irr"),u(pe,"type","number"),u(pe,"min","0"),u(pe,"max",t[6]),u(pe,"class","in-f tr w-1/3"),u(Te,"name","irg"),u(Te,"type","number"),u(Te,"min","0"),u(Te,"max",t[6]),u(Te,"class","in-m tr w-1/3"),u(Pe,"name","irb"),u(Pe,"type","number"),u(Pe,"min","0"),u(Pe,"max",t[6]),u(Pe,"class","in-l tr w-1/3"),u(le,"class","flex"),u(U,"class","w-full"),u(ae,"name","itd"),u(ae,"type","number"),u(ae,"min","0"),u(ae,"max",t[6]),u(ae,"class","in-f tr w-full"),u(be,"class","my-1 w-1/3"),u(_e,"name","ita"),u(_e,"type","number"),u(_e,"min","0"),u(_e,"max",t[6]),u(_e,"class","in-l tr w-full"),u(J,"class","my-1 pr-1 w-1/3"),u(n,"class","flex flex-wrap")},m(ue,ve){w(ue,e,ve),w(ue,l,ve),w(ue,n,ve),s(n,i),s(i,o),s(i,r),s(r,a),a.checked=t[3].i.h.u,s(r,f),s(i,c),s(i,p),s(i,_),Q(b,_,null),Le(_,t[3].i.h.p,!0),s(n,d),s(n,v),s(v,g),s(v,T),s(v,C),s(v,$),V($,t[3].i.a),s(n,M),s(n,E),s(E,S),s(E,A),s(A,I),I.checked=t[3].i.l.i,s(A,F),s(E,Y),s(E,O),s(E,H),s(H,q),V(q,t[3].i.l.p),s(n,z),s(n,U),s(U,R),s(U,B),s(B,L),L.checked=t[3].i.r.i,s(B,j),s(U,W),s(U,te),s(U,le),s(le,pe),V(pe,t[3].i.r.r),s(le,ie),s(le,Te),V(Te,t[3].i.r.g),s(le,je),s(le,Pe),V(Pe,t[3].i.r.b),s(n,We),s(n,be),s(be,ke),s(be,Ie),s(be,ge),s(be,ae),V(ae,t[3].i.t.d),s(n,we),s(n,J),s(J,se),s(J,Ee),s(J,Fe),s(J,_e),V(_e,t[3].i.t.a),s(n,ye),oe&&oe.m(n,null),s(n,Ne),Oe&&Oe.m(n,null),de=!0,Ce||(x=[K(a,"change",t[72]),K(_,"change",t[73]),K($,"input",t[74]),K(I,"change",t[75]),K(q,"input",t[76]),K(L,"change",t[77]),K(pe,"input",t[78]),K(Te,"input",t[79]),K(Pe,"input",t[80]),K(ae,"input",t[81]),K(_e,"input",t[82])],Ce=!0)},p(ue,ve){ve[0]&8&&(a.checked=ue[3].i.h.u);const dt={};ve[0]&1&&(dt.chip=ue[0].chip),b.$set(dt),ve[0]&8&&Le(_,ue[3].i.h.p),(!de||ve[0]&64)&&u($,"max",ue[6]),ve[0]&8&&fe($.value)!==ue[3].i.a&&V($,ue[3].i.a),ve[0]&8&&(I.checked=ue[3].i.l.i),(!de||ve[0]&64)&&u(q,"max",ue[6]),ve[0]&8&&fe(q.value)!==ue[3].i.l.p&&V(q,ue[3].i.l.p),ve[0]&8&&(L.checked=ue[3].i.r.i),(!de||ve[0]&64)&&u(pe,"max",ue[6]),ve[0]&8&&fe(pe.value)!==ue[3].i.r.r&&V(pe,ue[3].i.r.r),(!de||ve[0]&64)&&u(Te,"max",ue[6]),ve[0]&8&&fe(Te.value)!==ue[3].i.r.g&&V(Te,ue[3].i.r.g),(!de||ve[0]&64)&&u(Pe,"max",ue[6]),ve[0]&8&&fe(Pe.value)!==ue[3].i.r.b&&V(Pe,ue[3].i.r.b),(!de||ve[0]&64)&&u(ae,"max",ue[6]),ve[0]&8&&fe(ae.value)!==ue[3].i.t.d&&V(ae,ue[3].i.t.d),(!de||ve[0]&64)&&u(_e,"max",ue[6]),ve[0]&8&&fe(_e.value)!==ue[3].i.t.a&&V(_e,ue[3].i.t.a),ue[0].chip!="esp8266"?oe?oe.p(ue,ve):(oe=gf(ue),oe.c(),oe.m(n,Ne)):oe&&(oe.d(1),oe=null),ue[3].i.v.p>0?Oe?Oe.p(ue,ve):(Oe=kf(ue),Oe.c(),Oe.m(n,null)):Oe&&(Oe.d(1),Oe=null)},i(ue){de||(N(b.$$.fragment,ue),de=!0)},o(ue){D(b.$$.fragment,ue),de=!1},d(ue){ue&&k(e),ue&&k(l),ue&&k(n),X(b),oe&&oe.d(),Oe&&Oe.d(),Ce=!1,Ke(x)}}}function gf(t){let e,l,n,i,o,r,a;return{c(){e=m("div"),l=y("Vcc"),n=m("br"),i=h(),o=m("input"),u(o,"name","ivp"),u(o,"type","number"),u(o,"min","0"),u(o,"max",t[6]),u(o,"class","in-s tr w-full"),u(e,"class","my-1 pl-1 w-1/3")},m(f,c){w(f,e,c),s(e,l),s(e,n),s(e,i),s(e,o),V(o,t[3].i.v.p),r||(a=K(o,"input",t[83]),r=!0)},p(f,c){c[0]&64&&u(o,"max",f[6]),c[0]&8&&fe(o.value)!==f[3].i.v.p&&V(o,f[3].i.v.p)},d(f){f&&k(e),r=!1,a()}}}function kf(t){let e,l,n,i,o,r,a,f,c,p;return{c(){e=m("div"),l=y("Voltage divider"),n=m("br"),i=h(),o=m("div"),r=m("input"),a=h(),f=m("input"),u(r,"name","ivdv"),u(r,"type","number"),u(r,"min","0"),u(r,"max","65535"),u(r,"class","in-f tr w-full"),u(r,"placeholder","VCC"),u(f,"name","ivdg"),u(f,"type","number"),u(f,"min","0"),u(f,"max","65535"),u(f,"class","in-l tr w-full"),u(f,"placeholder","GND"),u(o,"class","flex"),u(e,"class","my-1")},m(_,b){w(_,e,b),s(e,l),s(e,n),s(e,i),s(e,o),s(o,r),V(r,t[3].i.v.d.v),s(o,a),s(o,f),V(f,t[3].i.v.d.g),c||(p=[K(r,"input",t[84]),K(f,"input",t[85])],c=!0)},p(_,b){b[0]&8&&fe(r.value)!==_[3].i.v.d.v&&V(r,_[3].i.v.d.v),b[0]&8&&fe(f.value)!==_[3].i.v.d.g&&V(f,_[3].i.v.d.g)},d(_){_&&k(e),c=!1,Ke(p)}}}function wf(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,T,C,$=(t[0].board==2||t[0].board==100)&&yf(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=y("Vcc offset"),r=m("br"),a=h(),f=m("input"),c=h(),p=m("div"),_=y("Multiplier"),b=m("br"),d=h(),v=m("input"),g=h(),$&&$.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(v,"name","ivm"),u(v,"type","number"),u(v,"min","0.1"),u(v,"max","10"),u(v,"step","0.01"),u(v,"class","in-l tr w-full"),u(p,"class","w-1/3 pr-1"),u(n,"class","my-1 flex flex-wrap")},m(M,E){w(M,e,E),w(M,l,E),w(M,n,E),s(n,i),s(i,o),s(i,r),s(i,a),s(i,f),V(f,t[3].i.v.o),s(n,c),s(n,p),s(p,_),s(p,b),s(p,d),s(p,v),V(v,t[3].i.v.m),s(n,g),$&&$.m(n,null),T||(C=[K(f,"input",t[86]),K(v,"input",t[87])],T=!0)},p(M,E){E[0]&8&&fe(f.value)!==M[3].i.v.o&&V(f,M[3].i.v.o),E[0]&8&&fe(v.value)!==M[3].i.v.m&&V(v,M[3].i.v.m),M[0].board==2||M[0].board==100?$?$.p(M,E):($=yf(M),$.c(),$.m(n,null)):$&&($.d(1),$=null)},d(M){M&&k(e),M&&k(l),M&&k(n),$&&$.d(),T=!1,Ke(C)}}}function yf(t){let e,l,n,i,o,r,a;return{c(){e=m("div"),l=y("Boot limit"),n=m("br"),i=h(),o=m("input"),u(o,"name","ivb"),u(o,"type","number"),u(o,"min","2.5"),u(o,"max","3.5"),u(o,"step","0.1"),u(o,"class","in-s tr w-full"),u(e,"class","w-1/3 pl-1")},m(f,c){w(f,e,c),s(e,l),s(e,n),s(e,i),s(e,o),V(o,t[3].i.v.b),r||(a=K(o,"input",t[88]),r=!0)},p(f,c){c[0]&8&&fe(o.value)!==f[3].i.v.b&&V(o,f[3].i.v.b)},d(f){f&&k(e),r=!1,a()}}}function Cf(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,T,C=t[3].d.t&&$f();return{c(){e=m("div"),e.textContent="Debug can cause sudden reboots. Do not leave on!",l=h(),n=m("div"),i=m("label"),o=m("input"),r=y(" Enable telnet"),a=h(),C&&C.c(),f=h(),c=m("div"),p=m("select"),_=m("option"),_.textContent="Verbose",b=m("option"),b.textContent="Debug",d=m("option"),d.textContent="Info",v=m("option"),v.textContent="Warning",u(e,"class","bd-red"),u(o,"type","checkbox"),u(o,"name","dt"),o.__value="true",o.value=o.__value,u(o,"class","rounded mb-1"),u(n,"class","my-1"),_.__value=1,_.value=_.__value,b.__value=2,b.value=b.__value,d.__value=3,d.value=d.__value,v.__value=4,v.value=v.__value,u(p,"name","dl"),u(p,"class","in-s"),t[3].d.l===void 0&&tt(()=>t[91].call(p)),u(c,"class","my-1")},m($,M){w($,e,M),w($,l,M),w($,n,M),s(n,i),s(i,o),o.checked=t[3].d.t,s(i,r),w($,a,M),C&&C.m($,M),w($,f,M),w($,c,M),s(c,p),s(p,_),s(p,b),s(p,d),s(p,v),Le(p,t[3].d.l,!0),g||(T=[K(o,"change",t[90]),K(p,"change",t[91])],g=!0)},p($,M){M[0]&8&&(o.checked=$[3].d.t),$[3].d.t?C||(C=$f(),C.c(),C.m(f.parentNode,f)):C&&(C.d(1),C=null),M[0]&8&&Le(p,$[3].d.l)},d($){$&&k(e),$&&k(l),$&&k(n),$&&k(a),C&&C.d($),$&&k(f),$&&k(c),g=!1,Ke(T)}}}function $f(t){let e;return{c(){e=m("div"),e.textContent="Telnet is unsafe and should be off when not in use",u(e,"class","bd-red")},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function s0(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,T,C,$,M,E,S,A,I,F,Y,O,H,q,z,U,R,B,L,j,W,te,le,pe,ie,Te,je,Pe,We,be,ke,Ie,ge,ae,we,J,se,Ee,Fe,_e,ye,Ne,de,Ce,x,oe,Oe,ue,ve,dt,jl,xt,ct,Ml,pl,qt,vt,Qe,Xe,Ze,Ue,Je,Be,xe,et,re,he,Pi,_l,mn,St,Ai,Di,Ei,dl,Ii,Fi,Ri,Mt,Nl,ze,vl,Wl,Ts,He,el,Li,Pl,pn,Co,fi,$o,tl,Oi,To,Ss,So,ci,Ht,Mo,No,Al,ll,Dl,Po,Ui,Ao,mt,El,Do,qi,_n,dn,vn,hn,Hi,Eo,Et,Io,Gl,Fo,Ro,Lo,nl,bn,gn,Oo,kn,Bl,Uo,qo,Ho,wn,jt,jo,ji,Wo,zl,Go,Bo,zo,yn,Wt,Yo,Wi,Vo,Ms,Ko,Yl,Gi,Gt,Qo,Xo,Zo,Ns,Bi,Bt,Jo,xo,eu,lt,zi,tu,Cn,$n,lu,mi,nu,Vl,iu,su,ou,hl,uu,Kl,ru,au,fu,bl,cu,Tn,Ql,mu,pu,_u,It,Sn,Mn,Nn,Pn,du,Xl,vu,hu,bu,An,Ft,gu,Yi,ku,Vi,Ki,zt,wu,yu,Qi,Xi,Yt,Cu,$u,at,Zi,Tu,Dn,En,Su,Zl,Mu,Nu,Pu,Il,il,In,Fn,Au,Nt,Ji,xi,Du,Pt,Rn,es,ts,Eu,Ps,ls,ns,Vt,Iu,Fu,pi,Ru,Fl,Lu,_i,Kt,Ou,Uu,qu,is,gl,Hu,Ve,ss,ju,Ln,On,Wu,di,Gu,sl,Bu,As,zu,Yu,Un,kl,Vu,Qt,Ku,Ds,Jl,Qu,Xu,Zu,wl,Ju,xl,xu,er,tr,yl,lr,qn,Hn,nr,ir,sr,Cl,or,jn,ur,rr,ar,ht,Wn,Gn,Bn,zn,Yn,Vn,fr,en,cr,mr,pr,$l,_r,Es,Is,Fs=t[3].p.r.startsWith("10YNO")||t[3].p.r=="10Y1001A1001A48H",Rs,ol,os,dr,Kn,Qn,vr,vi,hr,hi,br,Ls,At,us,gr,Xn,Zn,kr,bi,wr,rs,as,Xt,yr,Cr,$r,Rl,Os,Jn,Tr,fs,xn,Sr,cs,Us,tn,qs,ln,Hs,nn,js,sn,Zt,Ws,Mr;a=new Lt({}),F=new Bp({});let Wc=["NOK","SEK","DKK","EUR"],gi=[];for(let P=0;P<4;P+=1)gi[P]=Kp(Vp(t,Wc,P));let bt=t[3].p.e&&t[0].chip!="esp8266"&&nf(t),gt=t[3].g.s>0&&sf(t);pn=new Lt({});let Gc=[24,48,96,192,384,576,1152],ki=[];for(let P=0;P<7;P+=1)ki[P]=Qp(Yp(t,Gc,P));let kt=t[3].m.e.e&&of(t),wt=t[3].m.e.e&&uf(t),yt=t[3].m.m.e&&rf(t);$n=new Lt({}),En=new Lt({}),Rn=new jc({});let Ct=t[3].n.m=="static"&&af(t);On=new Lt({});let $t=t[0].chip!="esp8266"&&ff(t),nt=t[3].q.s.e&&cf(t),it=t[3].q.m==3&&mf(t),st=t[3].q.m==4&&pf(t),ot=Fs&&_f(t);Qn=new Lt({});let ei=t[7],pt=[];for(let P=0;P20||t[0].chip=="esp8266")&&hf(t);Zn=new Lt({});let Tt=t[3].d.s&&Cf(t);return tn=new Dt({props:{active:t[1],message:"Loading configuration"}}),ln=new Dt({props:{active:t[2],message:"Saving configuration"}}),nn=new Dt({props:{active:t[4],message:"Performing factory reset"}}),sn=new Dt({props:{active:t[5],message:"Device have been factory reset and switched to AP mode"}}),{c(){e=m("form"),l=m("div"),n=m("div"),i=m("strong"),i.textContent="General",o=h(),r=m("a"),Z(a.$$.fragment),f=h(),c=m("input"),p=h(),_=m("div"),b=m("div"),d=m("div"),v=y("Hostname"),g=m("br"),T=h(),C=m("input"),$=h(),M=m("div"),E=y("Time zone"),S=m("br"),A=h(),I=m("select"),Z(F.$$.fragment),Y=h(),O=m("input"),H=h(),q=m("div"),z=m("div"),U=m("div"),R=y("Price region"),B=m("br"),L=h(),j=m("select"),W=m("optgroup"),te=m("option"),te.textContent="NO1",le=m("option"),le.textContent="NO2",pe=m("option"),pe.textContent="NO3",ie=m("option"),ie.textContent="NO4",Te=m("option"),Te.textContent="NO5",je=m("optgroup"),Pe=m("option"),Pe.textContent="SE1",We=m("option"),We.textContent="SE2",be=m("option"),be.textContent="SE3",ke=m("option"),ke.textContent="SE4",Ie=m("optgroup"),ge=m("option"),ge.textContent="DK1",ae=m("option"),ae.textContent="DK2",we=m("option"),we.textContent="Austria",J=m("option"),J.textContent="Belgium",se=m("option"),se.textContent="Czech Republic",Ee=m("option"),Ee.textContent="Estonia",Fe=m("option"),Fe.textContent="Finland",_e=m("option"),_e.textContent="France",ye=m("option"),ye.textContent="Germany",Ne=m("option"),Ne.textContent="Great Britain",de=m("option"),de.textContent="Latvia",Ce=m("option"),Ce.textContent="Lithuania",x=m("option"),x.textContent="Netherland",oe=m("option"),oe.textContent="Poland",Oe=m("option"),Oe.textContent="Switzerland",ue=h(),ve=m("div"),dt=y("Currency"),jl=m("br"),xt=h(),ct=m("select");for(let P=0;P<4;P+=1)gi[P].c();Ml=h(),pl=m("div"),qt=m("div"),vt=m("div"),Qe=y("Fixed price"),Xe=m("br"),Ze=h(),Ue=m("input"),Je=h(),Be=m("div"),xe=y("Multiplier"),et=m("br"),re=h(),he=m("input"),Pi=h(),_l=m("div"),mn=m("label"),St=m("input"),Ai=y(" Enable price fetch from remote server"),Di=h(),bt&&bt.c(),Ei=h(),dl=m("div"),Ii=y("Security"),Fi=m("br"),Ri=h(),Mt=m("select"),Nl=m("option"),Nl.textContent="None",ze=m("option"),ze.textContent="Only configuration",vl=m("option"),vl.textContent="Everything",Wl=h(),gt&>.c(),Ts=h(),He=m("div"),el=m("strong"),el.textContent="Meter",Li=h(),Pl=m("a"),Z(pn.$$.fragment),Co=h(),fi=m("input"),$o=h(),tl=m("div"),Oi=m("span"),Oi.textContent="Buffer size",To=h(),Ss=m("span"),Ss.textContent="Serial conf.",So=h(),ci=m("label"),Ht=m("input"),Mo=y(" inverted"),No=h(),Al=m("div"),ll=m("select"),Dl=m("option"),Po=y("Autodetect");for(let P=0;P<7;P+=1)ki[P].c();Ao=h(),mt=m("select"),El=m("option"),Do=y("-"),_n=m("option"),_n.textContent="7N1",dn=m("option"),dn.textContent="8N1",vn=m("option"),vn.textContent="7E1",hn=m("option"),hn.textContent="8E1",Eo=h(),Et=m("input"),Io=h(),Gl=m("div"),Fo=y("Voltage"),Ro=m("br"),Lo=h(),nl=m("select"),bn=m("option"),bn.textContent="400V (TN)",gn=m("option"),gn.textContent="230V (IT/TT)",Oo=h(),kn=m("div"),Bl=m("div"),Uo=y("Main fuse"),qo=m("br"),Ho=h(),wn=m("label"),jt=m("input"),jo=h(),ji=m("span"),ji.textContent="A",Wo=h(),zl=m("div"),Go=y("Production"),Bo=m("br"),zo=h(),yn=m("label"),Wt=m("input"),Yo=h(),Wi=m("span"),Wi.textContent="kWp",Vo=h(),Ms=m("div"),Ko=h(),Yl=m("div"),Gi=m("label"),Gt=m("input"),Qo=y(" Meter is encrypted"),Xo=h(),kt&&kt.c(),Zo=h(),wt&&wt.c(),Ns=h(),Bi=m("label"),Bt=m("input"),Jo=y(" Multipliers"),xo=h(),yt&&yt.c(),eu=h(),lt=m("div"),zi=m("strong"),zi.textContent="WiFi",tu=h(),Cn=m("a"),Z($n.$$.fragment),lu=h(),mi=m("input"),nu=h(),Vl=m("div"),iu=y("SSID"),su=m("br"),ou=h(),hl=m("input"),uu=h(),Kl=m("div"),ru=y("Password"),au=m("br"),fu=h(),bl=m("input"),cu=h(),Tn=m("div"),Ql=m("div"),mu=y("Power saving"),pu=m("br"),_u=h(),It=m("select"),Sn=m("option"),Sn.textContent="Default",Mn=m("option"),Mn.textContent="Off",Nn=m("option"),Nn.textContent="Minimum",Pn=m("option"),Pn.textContent="Maximum",du=h(),Xl=m("div"),vu=y("Power"),hu=m("br"),bu=h(),An=m("div"),Ft=m("input"),gu=h(),Yi=m("span"),Yi.textContent="dBm",ku=h(),Vi=m("div"),Ki=m("label"),zt=m("input"),wu=y(" Auto reboot on connection problem"),yu=h(),Qi=m("div"),Xi=m("label"),Yt=m("input"),Cu=y(" Allow 802.11b legacy rates"),$u=h(),at=m("div"),Zi=m("strong"),Zi.textContent="Network",Tu=h(),Dn=m("a"),Z(En.$$.fragment),Su=h(),Zl=m("div"),Mu=y("IP"),Nu=m("br"),Pu=h(),Il=m("div"),il=m("select"),In=m("option"),In.textContent="DHCP",Fn=m("option"),Fn.textContent="Static",Au=h(),Nt=m("input"),Du=h(),Pt=m("select"),Z(Rn.$$.fragment),Eu=h(),Ct&&Ct.c(),Ps=h(),ls=m("div"),ns=m("label"),Vt=m("input"),Iu=y(" enable mDNS"),Fu=h(),pi=m("input"),Ru=h(),Fl=m("div"),Lu=y("NTP "),_i=m("label"),Kt=m("input"),Ou=y(" obtain from DHCP"),Uu=m("br"),qu=h(),is=m("div"),gl=m("input"),Hu=h(),Ve=m("div"),ss=m("strong"),ss.textContent="MQTT",ju=h(),Ln=m("a"),Z(On.$$.fragment),Wu=h(),di=m("input"),Gu=h(),sl=m("div"),Bu=y(`Server + `),$t&&$t.c(),As=h(),zu=m("br"),Yu=h(),Un=m("div"),kl=m("input"),Vu=h(),Qt=m("input"),Ku=h(),nt&&nt.c(),Ds=h(),Jl=m("div"),Qu=y("Username"),Xu=m("br"),Zu=h(),wl=m("input"),Ju=h(),xl=m("div"),xu=y("Password"),er=m("br"),tr=h(),yl=m("input"),lr=h(),qn=m("div"),Hn=m("div"),nr=y("Client ID"),ir=m("br"),sr=h(),Cl=m("input"),or=h(),jn=m("div"),ur=y("Payload"),rr=m("br"),ar=h(),ht=m("select"),Wn=m("option"),Wn.textContent="JSON",Gn=m("option"),Gn.textContent="Raw (minimal)",Bn=m("option"),Bn.textContent="Raw (full)",zn=m("option"),zn.textContent="Domoticz",Yn=m("option"),Yn.textContent="HomeAssistant",Vn=m("option"),Vn.textContent="HEX dump",fr=h(),en=m("div"),cr=y("Publish topic"),mr=m("br"),pr=h(),$l=m("input"),_r=h(),it&&it.c(),Es=h(),st&&st.c(),Is=h(),ot&&ot.c(),Rs=h(),ol=m("div"),os=m("strong"),os.textContent="User interface",dr=h(),Kn=m("a"),Z(Qn.$$.fragment),vr=h(),vi=m("input"),hr=h(),hi=m("div");for(let P=0;PSave',Us=h(),Z(tn.$$.fragment),qs=h(),Z(ln.$$.fragment),Hs=h(),Z(nn.$$.fragment),js=h(),Z(sn.$$.fragment),u(i,"class","text-sm"),u(r,"href",Ot("General-configuration")),u(r,"target","_blank"),u(r,"class","float-right"),u(c,"type","hidden"),u(c,"name","g"),c.value="true",u(C,"name","gh"),u(C,"type","text"),u(C,"class","in-f w-full"),u(C,"pattern","[A-Za-z0-9-]+"),u(I,"name","gt"),u(I,"class","in-l w-full"),t[3].g.t===void 0&&tt(()=>t[13].call(I)),u(b,"class","flex"),u(_,"class","my-1"),u(O,"type","hidden"),u(O,"name","p"),O.value="true",te.__value="10YNO-1--------2",te.value=te.__value,le.__value="10YNO-2--------T",le.value=le.__value,pe.__value="10YNO-3--------J",pe.value=pe.__value,ie.__value="10YNO-4--------9",ie.value=ie.__value,Te.__value="10Y1001A1001A48H",Te.value=Te.__value,u(W,"label","Norway"),Pe.__value="10Y1001A1001A44P",Pe.value=Pe.__value,We.__value="10Y1001A1001A45N",We.value=We.__value,be.__value="10Y1001A1001A46L",be.value=be.__value,ke.__value="10Y1001A1001A47J",ke.value=ke.__value,u(je,"label","Sweden"),ge.__value="10YDK-1--------W",ge.value=ge.__value,ae.__value="10YDK-2--------M",ae.value=ae.__value,u(Ie,"label","Denmark"),we.__value="10YAT-APG------L",we.value=we.__value,J.__value="10YBE----------2",J.value=J.__value,se.__value="10YCZ-CEPS-----N",se.value=se.__value,Ee.__value="10Y1001A1001A39I",Ee.value=Ee.__value,Fe.__value="10YFI-1--------U",Fe.value=Fe.__value,_e.__value="10YFR-RTE------C",_e.value=_e.__value,ye.__value="10Y1001A1001A83F",ye.value=ye.__value,Ne.__value="10YGB----------A",Ne.value=Ne.__value,de.__value="10YLV-1001A00074",de.value=de.__value,Ce.__value="10YLT-1001A0008Q",Ce.value=Ce.__value,x.__value="10YNL----------L",x.value=x.__value,oe.__value="10YPL-AREA-----S",oe.value=oe.__value,Oe.__value="10YCH-SWISSGRIDZ",Oe.value=Oe.__value,u(j,"name","pr"),u(j,"class","in-f w-full"),t[3].p.r===void 0&&tt(()=>t[14].call(j)),u(U,"class","w-full"),u(ct,"name","pc"),u(ct,"class","in-l"),t[3].p.c===void 0&&tt(()=>t[15].call(ct)),u(z,"class","flex"),u(q,"class","my-1"),u(Ue,"name","pf"),u(Ue,"type","number"),u(Ue,"min","0.001"),u(Ue,"max","65"),u(Ue,"step","0.001"),u(Ue,"class","in-f tr w-full"),u(vt,"class","w-1/2"),u(he,"name","pm"),u(he,"type","number"),u(he,"min","0.001"),u(he,"max","1000"),u(he,"step","0.001"),u(he,"class","in-l tr w-full"),u(Be,"class","w-1/2"),u(qt,"class","flex"),u(pl,"class","my-1"),u(St,"type","checkbox"),u(St,"name","pe"),St.__value="true",St.value=St.__value,u(St,"class","rounded mb-1"),u(_l,"class","my-1"),Nl.__value=0,Nl.value=Nl.__value,ze.__value=1,ze.value=ze.__value,vl.__value=2,vl.value=vl.__value,u(Mt,"name","gs"),u(Mt,"class","in-s"),t[3].g.s===void 0&&tt(()=>t[20].call(Mt)),u(dl,"class","my-1"),u(n,"class","cnt"),u(el,"class","text-sm"),u(Pl,"href",Ot("Meter-configuration")),u(Pl,"target","_blank"),u(Pl,"class","float-right"),u(fi,"type","hidden"),u(fi,"name","m"),fi.value="true",u(Oi,"class","float-right"),u(Ht,"name","mi"),Ht.__value="true",Ht.value=Ht.__value,u(Ht,"type","checkbox"),u(Ht,"class","rounded mb-1"),u(ci,"class","mt-2 ml-3 whitespace-nowrap"),Dl.__value=0,Dl.value=Dl.__value,Dl.disabled=Ui=t[3].m.b!=0,u(ll,"name","mb"),u(ll,"class","in-f tr w-1/2"),t[3].m.b===void 0&&tt(()=>t[24].call(ll)),El.__value=0,El.value=El.__value,El.disabled=qi=t[3].m.b!=0,_n.__value=2,_n.value=_n.__value,dn.__value=3,dn.value=dn.__value,vn.__value=10,vn.value=vn.__value,hn.__value=11,hn.value=hn.__value,u(mt,"name","mp"),u(mt,"class","in-m"),mt.disabled=Hi=t[3].m.b==0,t[3].m.p===void 0&&tt(()=>t[25].call(mt)),u(Et,"name","ms"),u(Et,"type","number"),u(Et,"min",64),u(Et,"max",4096),u(Et,"step",64),u(Et,"class","in-l tr w-1/2"),u(Al,"class","flex w-full"),u(tl,"class","my-1"),bn.__value=2,bn.value=bn.__value,gn.__value=1,gn.value=gn.__value,u(nl,"name","md"),u(nl,"class","in-s"),t[3].m.d===void 0&&tt(()=>t[27].call(nl)),u(Gl,"class","my-1"),u(jt,"name","mf"),u(jt,"type","number"),u(jt,"min","5"),u(jt,"max","65535"),u(jt,"class","in-f tr w-full"),u(ji,"class","in-post"),u(wn,"class","flex"),u(Bl,"class","mx-1"),u(Wt,"name","mr"),u(Wt,"type","number"),u(Wt,"min","0"),u(Wt,"max","65535"),u(Wt,"class","in-f tr w-full"),u(Wi,"class","in-post"),u(yn,"class","flex"),u(zl,"class","mx-1"),u(kn,"class","my-1 flex"),u(Ms,"class","my-1"),u(Gt,"type","checkbox"),u(Gt,"name","me"),Gt.__value="true",Gt.value=Gt.__value,u(Gt,"class","rounded mb-1"),u(Yl,"class","my-1"),u(Bt,"type","checkbox"),u(Bt,"name","mm"),Bt.__value="true",Bt.value=Bt.__value,u(Bt,"class","rounded mb-1"),u(He,"class","cnt"),u(zi,"class","text-sm"),u(Cn,"href",Ot("WiFi-configuration")),u(Cn,"target","_blank"),u(Cn,"class","float-right"),u(mi,"type","hidden"),u(mi,"name","w"),mi.value="true",u(hl,"name","ws"),u(hl,"type","text"),u(hl,"class","in-s"),u(Vl,"class","my-1"),u(bl,"name","wp"),u(bl,"type","password"),u(bl,"class","in-s"),u(Kl,"class","my-1"),Sn.__value=255,Sn.value=Sn.__value,Mn.__value=0,Mn.value=Mn.__value,Nn.__value=1,Nn.value=Nn.__value,Pn.__value=2,Pn.value=Pn.__value,u(It,"name","wz"),u(It,"class","in-s"),t[3].w.z===void 0&&tt(()=>t[40].call(It)),u(Ql,"class","w-1/2"),u(Ft,"name","ww"),u(Ft,"type","number"),u(Ft,"min","0"),u(Ft,"max","20.5"),u(Ft,"step","0.5"),u(Ft,"class","in-f tr w-full"),u(Yi,"class","in-post"),u(An,"class","flex"),u(Xl,"class","ml-2 w-1/2"),u(Tn,"class","my-1 flex"),u(zt,"type","checkbox"),u(zt,"name","wa"),zt.__value="true",zt.value=zt.__value,u(zt,"class","rounded mb-1"),u(Vi,"class","my-3"),u(Yt,"type","checkbox"),u(Yt,"name","wb"),Yt.__value="true",Yt.value=Yt.__value,u(Yt,"class","rounded mb-1"),u(Qi,"class","my-3"),u(lt,"class","cnt"),u(Zi,"class","text-sm"),u(Dn,"href",Ot("Network-configuration")),u(Dn,"target","_blank"),u(Dn,"class","float-right"),In.__value="dhcp",In.value=In.__value,Fn.__value="static",Fn.value=Fn.__value,u(il,"name","nm"),u(il,"class","in-f"),t[3].n.m===void 0&&tt(()=>t[44].call(il)),u(Nt,"name","ni"),u(Nt,"type","text"),u(Nt,"class","in-m w-full"),Nt.disabled=Ji=t[3].n.m=="dhcp",Nt.required=xi=t[3].n.m=="static",u(Pt,"name","ns"),u(Pt,"class","in-l"),Pt.disabled=es=t[3].n.m=="dhcp",Pt.required=ts=t[3].n.m=="static",t[3].n.s===void 0&&tt(()=>t[46].call(Pt)),u(Il,"class","flex"),u(Zl,"class","my-1"),u(Vt,"name","nd"),Vt.__value="true",Vt.value=Vt.__value,u(Vt,"type","checkbox"),u(Vt,"class","rounded mb-1"),u(ls,"class","my-1"),u(pi,"type","hidden"),u(pi,"name","ntp"),pi.value="true",u(Kt,"name","ntpd"),Kt.__value="true",Kt.value=Kt.__value,u(Kt,"type","checkbox"),u(Kt,"class","rounded mb-1"),u(_i,"class","ml-4"),u(gl,"name","ntph"),u(gl,"type","text"),u(gl,"class","in-s"),u(is,"class","flex"),u(Fl,"class","my-1"),u(at,"class","cnt"),u(ss,"class","text-sm"),u(Ln,"href",Ot("MQTT-configuration")),u(Ln,"target","_blank"),u(Ln,"class","float-right"),u(di,"type","hidden"),u(di,"name","q"),di.value="true",u(kl,"name","qh"),u(kl,"type","text"),u(kl,"class","in-f w-3/4"),u(Qt,"name","qp"),u(Qt,"type","number"),u(Qt,"min","1024"),u(Qt,"max","65535"),u(Qt,"class","in-l tr w-1/4"),u(Un,"class","flex"),u(sl,"class","my-1"),u(wl,"name","qu"),u(wl,"type","text"),u(wl,"class","in-s"),u(Jl,"class","my-1"),u(yl,"name","qa"),u(yl,"type","password"),u(yl,"class","in-s"),u(xl,"class","my-1"),u(Cl,"name","qc"),u(Cl,"type","text"),u(Cl,"class","in-f w-full"),Wn.__value=0,Wn.value=Wn.__value,Gn.__value=1,Gn.value=Gn.__value,Bn.__value=2,Bn.value=Bn.__value,zn.__value=3,zn.value=zn.__value,Yn.__value=4,Yn.value=Yn.__value,Vn.__value=255,Vn.value=Vn.__value,u(ht,"name","qm"),u(ht,"class","in-l"),t[3].q.m===void 0&&tt(()=>t[59].call(ht)),u(qn,"class","my-1 flex"),u($l,"name","qb"),u($l,"type","text"),u($l,"class","in-s"),u(en,"class","my-1"),u(Ve,"class","cnt"),u(os,"class","text-sm"),u(Kn,"href",Ot("User-interface")),u(Kn,"target","_blank"),u(Kn,"class","float-right"),u(vi,"type","hidden"),u(vi,"name","u"),vi.value="true",u(hi,"class","flex flex-wrap"),u(ol,"class","cnt"),u(us,"class","text-sm"),u(Xn,"href","https://amsleser.no/blog/post/24-telnet-debug"),u(Xn,"target","_blank"),u(Xn,"class","float-right"),u(bi,"type","hidden"),u(bi,"name","d"),bi.value="true",u(Xt,"type","checkbox"),u(Xt,"name","ds"),Xt.__value="true",Xt.value=Xt.__value,u(Xt,"class","rounded mb-1"),u(rs,"class","mt-3"),u(At,"class","cnt"),u(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),u(Jn,"type","button"),u(Jn,"class","py-2 px-4 rounded bg-red-500 text-white ml-2"),u(xn,"type","button"),u(xn,"class","py-2 px-4 rounded bg-yellow-500 text-white"),u(fs,"class","text-center"),u(cs,"class","text-right"),u(Rl,"class","grid grid-cols-3"),u(e,"autocomplete","off")},m(P,ee){w(P,e,ee),s(e,l),s(l,n),s(n,i),s(n,o),s(n,r),Q(a,r,null),s(n,f),s(n,c),s(n,p),s(n,_),s(_,b),s(b,d),s(d,v),s(d,g),s(d,T),s(d,C),V(C,t[3].g.h),s(b,$),s(b,M),s(M,E),s(M,S),s(M,A),s(M,I),Q(F,I,null),Le(I,t[3].g.t,!0),s(n,Y),s(n,O),s(n,H),s(n,q),s(q,z),s(z,U),s(U,R),s(U,B),s(U,L),s(U,j),s(j,W),s(W,te),s(W,le),s(W,pe),s(W,ie),s(W,Te),s(j,je),s(je,Pe),s(je,We),s(je,be),s(je,ke),s(j,Ie),s(Ie,ge),s(Ie,ae),s(j,we),s(j,J),s(j,se),s(j,Ee),s(j,Fe),s(j,_e),s(j,ye),s(j,Ne),s(j,de),s(j,Ce),s(j,x),s(j,oe),s(j,Oe),Le(j,t[3].p.r,!0),s(z,ue),s(z,ve),s(ve,dt),s(ve,jl),s(ve,xt),s(ve,ct);for(let ft=0;ft<4;ft+=1)gi[ft]&&gi[ft].m(ct,null);Le(ct,t[3].p.c,!0),s(n,Ml),s(n,pl),s(pl,qt),s(qt,vt),s(vt,Qe),s(vt,Xe),s(vt,Ze),s(vt,Ue),V(Ue,t[3].p.f),s(qt,Je),s(qt,Be),s(Be,xe),s(Be,et),s(Be,re),s(Be,he),V(he,t[3].p.m),s(n,Pi),s(n,_l),s(_l,mn),s(mn,St),St.checked=t[3].p.e,s(mn,Ai),s(_l,Di),bt&&bt.m(_l,null),s(n,Ei),s(n,dl),s(dl,Ii),s(dl,Fi),s(dl,Ri),s(dl,Mt),s(Mt,Nl),s(Mt,ze),s(Mt,vl),Le(Mt,t[3].g.s,!0),s(n,Wl),gt&>.m(n,null),s(l,Ts),s(l,He),s(He,el),s(He,Li),s(He,Pl),Q(pn,Pl,null),s(He,Co),s(He,fi),s(He,$o),s(He,tl),s(tl,Oi),s(tl,To),s(tl,Ss),s(tl,So),s(tl,ci),s(ci,Ht),Ht.checked=t[3].m.i,s(ci,Mo),s(tl,No),s(tl,Al),s(Al,ll),s(ll,Dl),s(Dl,Po);for(let ft=0;ft<7;ft+=1)ki[ft]&&ki[ft].m(ll,null);Le(ll,t[3].m.b,!0),s(Al,Ao),s(Al,mt),s(mt,El),s(El,Do),s(mt,_n),s(mt,dn),s(mt,vn),s(mt,hn),Le(mt,t[3].m.p,!0),s(Al,Eo),s(Al,Et),V(Et,t[3].m.s),s(He,Io),s(He,Gl),s(Gl,Fo),s(Gl,Ro),s(Gl,Lo),s(Gl,nl),s(nl,bn),s(nl,gn),Le(nl,t[3].m.d,!0),s(He,Oo),s(He,kn),s(kn,Bl),s(Bl,Uo),s(Bl,qo),s(Bl,Ho),s(Bl,wn),s(wn,jt),V(jt,t[3].m.f),s(wn,jo),s(wn,ji),s(kn,Wo),s(kn,zl),s(zl,Go),s(zl,Bo),s(zl,zo),s(zl,yn),s(yn,Wt),V(Wt,t[3].m.r),s(yn,Yo),s(yn,Wi),s(He,Vo),s(He,Ms),s(He,Ko),s(He,Yl),s(Yl,Gi),s(Gi,Gt),Gt.checked=t[3].m.e.e,s(Gi,Qo),s(Yl,Xo),kt&&kt.m(Yl,null),s(He,Zo),wt&&wt.m(He,null),s(He,Ns),s(He,Bi),s(Bi,Bt),Bt.checked=t[3].m.m.e,s(Bi,Jo),s(He,xo),yt&&yt.m(He,null),s(l,eu),s(l,lt),s(lt,zi),s(lt,tu),s(lt,Cn),Q($n,Cn,null),s(lt,lu),s(lt,mi),s(lt,nu),s(lt,Vl),s(Vl,iu),s(Vl,su),s(Vl,ou),s(Vl,hl),V(hl,t[3].w.s),s(lt,uu),s(lt,Kl),s(Kl,ru),s(Kl,au),s(Kl,fu),s(Kl,bl),V(bl,t[3].w.p),s(lt,cu),s(lt,Tn),s(Tn,Ql),s(Ql,mu),s(Ql,pu),s(Ql,_u),s(Ql,It),s(It,Sn),s(It,Mn),s(It,Nn),s(It,Pn),Le(It,t[3].w.z,!0),s(Tn,du),s(Tn,Xl),s(Xl,vu),s(Xl,hu),s(Xl,bu),s(Xl,An),s(An,Ft),V(Ft,t[3].w.w),s(An,gu),s(An,Yi),s(lt,ku),s(lt,Vi),s(Vi,Ki),s(Ki,zt),zt.checked=t[3].w.a,s(Ki,wu),s(lt,yu),s(lt,Qi),s(Qi,Xi),s(Xi,Yt),Yt.checked=t[3].w.b,s(Xi,Cu),s(l,$u),s(l,at),s(at,Zi),s(at,Tu),s(at,Dn),Q(En,Dn,null),s(at,Su),s(at,Zl),s(Zl,Mu),s(Zl,Nu),s(Zl,Pu),s(Zl,Il),s(Il,il),s(il,In),s(il,Fn),Le(il,t[3].n.m,!0),s(Il,Au),s(Il,Nt),V(Nt,t[3].n.i),s(Il,Du),s(Il,Pt),Q(Rn,Pt,null),Le(Pt,t[3].n.s,!0),s(at,Eu),Ct&&Ct.m(at,null),s(at,Ps),s(at,ls),s(ls,ns),s(ns,Vt),Vt.checked=t[3].n.d,s(ns,Iu),s(at,Fu),s(at,pi),s(at,Ru),s(at,Fl),s(Fl,Lu),s(Fl,_i),s(_i,Kt),Kt.checked=t[3].n.h,s(_i,Ou),s(Fl,Uu),s(Fl,qu),s(Fl,is),s(is,gl),V(gl,t[3].n.n1),s(l,Hu),s(l,Ve),s(Ve,ss),s(Ve,ju),s(Ve,Ln),Q(On,Ln,null),s(Ve,Wu),s(Ve,di),s(Ve,Gu),s(Ve,sl),s(sl,Bu),$t&&$t.m(sl,null),s(sl,As),s(sl,zu),s(sl,Yu),s(sl,Un),s(Un,kl),V(kl,t[3].q.h),s(Un,Vu),s(Un,Qt),V(Qt,t[3].q.p),s(Ve,Ku),nt&&nt.m(Ve,null),s(Ve,Ds),s(Ve,Jl),s(Jl,Qu),s(Jl,Xu),s(Jl,Zu),s(Jl,wl),V(wl,t[3].q.u),s(Ve,Ju),s(Ve,xl),s(xl,xu),s(xl,er),s(xl,tr),s(xl,yl),V(yl,t[3].q.a),s(Ve,lr),s(Ve,qn),s(qn,Hn),s(Hn,nr),s(Hn,ir),s(Hn,sr),s(Hn,Cl),V(Cl,t[3].q.c),s(qn,or),s(qn,jn),s(jn,ur),s(jn,rr),s(jn,ar),s(jn,ht),s(ht,Wn),s(ht,Gn),s(ht,Bn),s(ht,zn),s(ht,Yn),s(ht,Vn),Le(ht,t[3].q.m,!0),s(Ve,fr),s(Ve,en),s(en,cr),s(en,mr),s(en,pr),s(en,$l),V($l,t[3].q.b),s(l,_r),it&&it.m(l,null),s(l,Es),st&&st.m(l,null),s(l,Is),ot&&ot.m(l,null),s(l,Rs),s(l,ol),s(ol,os),s(ol,dr),s(ol,Kn),Q(Qn,Kn,null),s(ol,vr),s(ol,vi),s(ol,hr),s(ol,hi);for(let ft=0;ft0?gt?gt.p(P,ee):(gt=sf(P),gt.c(),gt.m(n,null)):gt&&(gt.d(1),gt=null),ee[0]&8&&(Ht.checked=P[3].m.i),(!Zt||ee[0]&8&&Ui!==(Ui=P[3].m.b!=0))&&(Dl.disabled=Ui),ee[0]&8&&Le(ll,P[3].m.b),(!Zt||ee[0]&8&&qi!==(qi=P[3].m.b!=0))&&(El.disabled=qi),(!Zt||ee[0]&8&&Hi!==(Hi=P[3].m.b==0))&&(mt.disabled=Hi),ee[0]&8&&Le(mt,P[3].m.p),ee[0]&8&&fe(Et.value)!==P[3].m.s&&V(Et,P[3].m.s),ee[0]&8&&Le(nl,P[3].m.d),ee[0]&8&&fe(jt.value)!==P[3].m.f&&V(jt,P[3].m.f),ee[0]&8&&fe(Wt.value)!==P[3].m.r&&V(Wt,P[3].m.r),ee[0]&8&&(Gt.checked=P[3].m.e.e),P[3].m.e.e?kt?kt.p(P,ee):(kt=of(P),kt.c(),kt.m(Yl,null)):kt&&(kt.d(1),kt=null),P[3].m.e.e?wt?wt.p(P,ee):(wt=uf(P),wt.c(),wt.m(He,Ns)):wt&&(wt.d(1),wt=null),ee[0]&8&&(Bt.checked=P[3].m.m.e),P[3].m.m.e?yt?yt.p(P,ee):(yt=rf(P),yt.c(),yt.m(He,null)):yt&&(yt.d(1),yt=null),ee[0]&8&&hl.value!==P[3].w.s&&V(hl,P[3].w.s),ee[0]&8&&bl.value!==P[3].w.p&&V(bl,P[3].w.p),ee[0]&8&&Le(It,P[3].w.z),ee[0]&8&&fe(Ft.value)!==P[3].w.w&&V(Ft,P[3].w.w),ee[0]&8&&(zt.checked=P[3].w.a),ee[0]&8&&(Yt.checked=P[3].w.b),ee[0]&8&&Le(il,P[3].n.m),(!Zt||ee[0]&8&&Ji!==(Ji=P[3].n.m=="dhcp"))&&(Nt.disabled=Ji),(!Zt||ee[0]&8&&xi!==(xi=P[3].n.m=="static"))&&(Nt.required=xi),ee[0]&8&&Nt.value!==P[3].n.i&&V(Nt,P[3].n.i),(!Zt||ee[0]&8&&es!==(es=P[3].n.m=="dhcp"))&&(Pt.disabled=es),(!Zt||ee[0]&8&&ts!==(ts=P[3].n.m=="static"))&&(Pt.required=ts),ee[0]&8&&Le(Pt,P[3].n.s),P[3].n.m=="static"?Ct?Ct.p(P,ee):(Ct=af(P),Ct.c(),Ct.m(at,Ps)):Ct&&(Ct.d(1),Ct=null),ee[0]&8&&(Vt.checked=P[3].n.d),ee[0]&8&&(Kt.checked=P[3].n.h),ee[0]&8&&gl.value!==P[3].n.n1&&V(gl,P[3].n.n1),P[0].chip!="esp8266"?$t?$t.p(P,ee):($t=ff(P),$t.c(),$t.m(sl,As)):$t&&($t.d(1),$t=null),ee[0]&8&&kl.value!==P[3].q.h&&V(kl,P[3].q.h),ee[0]&8&&fe(Qt.value)!==P[3].q.p&&V(Qt,P[3].q.p),P[3].q.s.e?nt?(nt.p(P,ee),ee[0]&8&&N(nt,1)):(nt=cf(P),nt.c(),N(nt,1),nt.m(Ve,Ds)):nt&&(Ae(),D(nt,1,1,()=>{nt=null}),De()),ee[0]&8&&wl.value!==P[3].q.u&&V(wl,P[3].q.u),ee[0]&8&&yl.value!==P[3].q.a&&V(yl,P[3].q.a),ee[0]&8&&Cl.value!==P[3].q.c&&V(Cl,P[3].q.c),ee[0]&8&&Le(ht,P[3].q.m),ee[0]&8&&$l.value!==P[3].q.b&&V($l,P[3].q.b),P[3].q.m==3?it?(it.p(P,ee),ee[0]&8&&N(it,1)):(it=mf(P),it.c(),N(it,1),it.m(l,Es)):it&&(Ae(),D(it,1,1,()=>{it=null}),De()),P[3].q.m==4?st?(st.p(P,ee),ee[0]&8&&N(st,1)):(st=pf(P),st.c(),N(st,1),st.m(l,Is)):st&&(Ae(),D(st,1,1,()=>{st=null}),De()),ee[0]&8&&(Fs=P[3].p.r.startsWith("10YNO")||P[3].p.r=="10Y1001A1001A48H"),Fs?ot?(ot.p(P,ee),ee[0]&8&&N(ot,1)):(ot=_f(P),ot.c(),N(ot,1),ot.m(l,Rs)):ot&&(Ae(),D(ot,1,1,()=>{ot=null}),De()),ee[0]&136){ei=P[7];let Rt;for(Rt=0;Rt20||P[0].chip=="esp8266"?ut?(ut.p(P,ee),ee[0]&1&&N(ut,1)):(ut=hf(P),ut.c(),N(ut,1),ut.m(l,Ls)):ut&&(Ae(),D(ut,1,1,()=>{ut=null}),De()),ee[0]&8&&(Xt.checked=P[3].d.s),P[3].d.s?Tt?Tt.p(P,ee):(Tt=Cf(P),Tt.c(),Tt.m(At,null)):Tt&&(Tt.d(1),Tt=null);const ft={};ee[0]&2&&(ft.active=P[1]),tn.$set(ft);const Nr={};ee[0]&4&&(Nr.active=P[2]),ln.$set(Nr);const Pr={};ee[0]&16&&(Pr.active=P[4]),nn.$set(Pr);const Ar={};ee[0]&32&&(Ar.active=P[5]),sn.$set(Ar)},i(P){Zt||(N(a.$$.fragment,P),N(F.$$.fragment,P),N(pn.$$.fragment,P),N($n.$$.fragment,P),N(En.$$.fragment,P),N(Rn.$$.fragment,P),N(On.$$.fragment,P),N(nt),N(it),N(st),N(ot),N(Qn.$$.fragment,P),N(ut),N(Zn.$$.fragment,P),N(tn.$$.fragment,P),N(ln.$$.fragment,P),N(nn.$$.fragment,P),N(sn.$$.fragment,P),Zt=!0)},o(P){D(a.$$.fragment,P),D(F.$$.fragment,P),D(pn.$$.fragment,P),D($n.$$.fragment,P),D(En.$$.fragment,P),D(Rn.$$.fragment,P),D(On.$$.fragment,P),D(nt),D(it),D(st),D(ot),D(Qn.$$.fragment,P),D(ut),D(Zn.$$.fragment,P),D(tn.$$.fragment,P),D(ln.$$.fragment,P),D(nn.$$.fragment,P),D(sn.$$.fragment,P),Zt=!1},d(P){P&&k(e),X(a),X(F),cl(gi,P),bt&&bt.d(),gt&>.d(),X(pn),cl(ki,P),kt&&kt.d(),wt&&wt.d(),yt&&yt.d(),X($n),X(En),X(Rn),Ct&&Ct.d(),X(On),$t&&$t.d(),nt&&nt.d(),it&&it.d(),st&&st.d(),ot&&ot.d(),X(Qn),cl(pt,P),ut&&ut.d(),X(Zn),Tt&&Tt.d(),P&&k(Us),X(tn,P),P&&k(qs),X(ln,P),P&&k(Hs),X(nn,P),P&&k(js),X(sn,P),Ws=!1,Ke(Mr)}}}async function o0(){await(await fetch("/reboot",{method:"POST"})).json()}function u0(t,e,l){let{sysinfo:n={}}=e,i=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{name:"Reactive",key:"r"},{name:"Realtime",key:"c"},{name:"Peaks",key:"t"},{name:"Price",key:"p"},{name:"Day plot",key:"d"},{name:"Month plot",key:"m"},{name:"Temperature plot",key:"s"}],o=!0,r=!1,a={g:{t:"",h:"",s:0,u:"",p:""},m:{b:2400,p:11,i:!1,d:0,f:0,r:0,e:{e:!1,k:"",a:""},m:{e:!1,w:!1,v:!1,a:!1,c:!1}},w:{s:"",p:"",w:0,z:255,a:!0,b:!0},n:{m:"",i:"",s:"",g:"",d1:"",d2:"",d:!1,n1:"",n2:"",h:!1},q:{h:"",p:1883,u:"",a:"",b:"",s:{e:!1,c:!1,r:!0,k:!1}},o:{e:"",c:"",u1:"",u2:"",u3:""},t:{t:[0,0,0,0,0,0,0,0,0,0],h:1},p:{e:!1,t:"",r:"",c:"",m:1,f:null},d:{s:!1,t:!1,l:5},u:{i:0,e:0,v:0,a:0,r:0,c:0,t:0,p:0,d:0,m:0,s:0},i:{h:{p:null,u:!0},a:null,l:{p:null,i:!1},r:{r:null,g:null,b:null,i:!1},t:{d:null,a:null},v:{p:null,d:{v:null,g:null},o:null,m:null,b:null}},h:{t:"",h:"",n:""}};qc.subscribe(ze=>{ze.version&&(l(3,a=ze),l(1,o=!1))}),Rp();let f=!1,c=!1;async function p(){if(confirm("Are you sure you want to factory reset the device?")){l(4,f=!0);const ze=new URLSearchParams;ze.append("perform","true");let Wl=await(await fetch("/reset",{method:"POST",body:ze})).json();l(4,f=!1),l(5,c=Wl.success)}}async function _(ze){l(2,r=!0);const vl=new FormData(ze.target),Wl=new URLSearchParams;for(let el of vl){const[Li,Pl]=el;Wl.append(Li,Pl)}let He=await(await fetch("/save",{method:"POST",body:Wl})).json();Ut.update(el=>(el.booting=He.reboot,el.ui=a.u,el)),l(2,r=!1),si("/")}const b=function(){confirm("Are you sure you want to reboot the device?")&&(Ut.update(ze=>(ze.booting=!0,ze)),o0())},d=function(){a.q.s.e?a.q.p==1883&&l(3,a.q.p=8883,a):a.q.p==8883&&l(3,a.q.p=1883,a)};let v=44;function g(){a.g.h=this.value,l(3,a)}function T(){a.g.t=_t(this),l(3,a)}function C(){a.p.r=_t(this),l(3,a)}function $(){a.p.c=_t(this),l(3,a)}function M(){a.p.f=fe(this.value),l(3,a)}function E(){a.p.m=fe(this.value),l(3,a)}function S(){a.p.e=this.checked,l(3,a)}function A(){a.p.t=this.value,l(3,a)}function I(){a.g.s=_t(this),l(3,a)}function F(){a.g.u=this.value,l(3,a)}function Y(){a.g.p=this.value,l(3,a)}function O(){a.m.i=this.checked,l(3,a)}function H(){a.m.b=_t(this),l(3,a)}function q(){a.m.p=_t(this),l(3,a)}function z(){a.m.s=fe(this.value),l(3,a)}function U(){a.m.d=_t(this),l(3,a)}function R(){a.m.f=fe(this.value),l(3,a)}function B(){a.m.r=fe(this.value),l(3,a)}function L(){a.m.e.e=this.checked,l(3,a)}function j(){a.m.e.k=this.value,l(3,a)}function W(){a.m.e.a=this.value,l(3,a)}function te(){a.m.m.e=this.checked,l(3,a)}function le(){a.m.m.w=fe(this.value),l(3,a)}function pe(){a.m.m.v=fe(this.value),l(3,a)}function ie(){a.m.m.a=fe(this.value),l(3,a)}function Te(){a.m.m.c=fe(this.value),l(3,a)}function je(){a.w.s=this.value,l(3,a)}function Pe(){a.w.p=this.value,l(3,a)}function We(){a.w.z=_t(this),l(3,a)}function be(){a.w.w=fe(this.value),l(3,a)}function ke(){a.w.a=this.checked,l(3,a)}function Ie(){a.w.b=this.checked,l(3,a)}function ge(){a.n.m=_t(this),l(3,a)}function ae(){a.n.i=this.value,l(3,a)}function we(){a.n.s=_t(this),l(3,a)}function J(){a.n.g=this.value,l(3,a)}function se(){a.n.d1=this.value,l(3,a)}function Ee(){a.n.d2=this.value,l(3,a)}function Fe(){a.n.d=this.checked,l(3,a)}function _e(){a.n.h=this.checked,l(3,a)}function ye(){a.n.n1=this.value,l(3,a)}function Ne(){a.q.s.e=this.checked,l(3,a)}function de(){a.q.h=this.value,l(3,a)}function Ce(){a.q.p=fe(this.value),l(3,a)}function x(){a.q.u=this.value,l(3,a)}function oe(){a.q.a=this.value,l(3,a)}function Oe(){a.q.c=this.value,l(3,a)}function ue(){a.q.m=_t(this),l(3,a)}function ve(){a.q.b=this.value,l(3,a)}function dt(){a.o.e=this.value,l(3,a)}function jl(){a.o.c=this.value,l(3,a)}function xt(){a.o.u1=this.value,l(3,a)}function ct(){a.o.u2=this.value,l(3,a)}function Ml(){a.o.u3=this.value,l(3,a)}function pl(){a.h.t=this.value,l(3,a)}function qt(){a.h.h=this.value,l(3,a)}function vt(){a.h.n=this.value,l(3,a)}function Qe(ze){a.t.t[ze]=fe(this.value),l(3,a)}function Xe(){a.t.h=fe(this.value),l(3,a)}function Ze(ze){a.u[ze.key]=_t(this),l(3,a)}function Ue(){a.i.h.u=this.checked,l(3,a)}function Je(){a.i.h.p=_t(this),l(3,a)}function Be(){a.i.a=fe(this.value),l(3,a)}function xe(){a.i.l.i=this.checked,l(3,a)}function et(){a.i.l.p=fe(this.value),l(3,a)}function re(){a.i.r.i=this.checked,l(3,a)}function he(){a.i.r.r=fe(this.value),l(3,a)}function Pi(){a.i.r.g=fe(this.value),l(3,a)}function _l(){a.i.r.b=fe(this.value),l(3,a)}function mn(){a.i.t.d=fe(this.value),l(3,a)}function St(){a.i.t.a=fe(this.value),l(3,a)}function Ai(){a.i.v.p=fe(this.value),l(3,a)}function Di(){a.i.v.d.v=fe(this.value),l(3,a)}function Ei(){a.i.v.d.g=fe(this.value),l(3,a)}function dl(){a.i.v.o=fe(this.value),l(3,a)}function Ii(){a.i.v.m=fe(this.value),l(3,a)}function Fi(){a.i.v.b=fe(this.value),l(3,a)}function Ri(){a.d.s=this.checked,l(3,a)}function Mt(){a.d.t=this.checked,l(3,a)}function Nl(){a.d.l=_t(this),l(3,a)}return t.$$set=ze=>{"sysinfo"in ze&&l(0,n=ze.sysinfo)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(6,v=n.chip=="esp8266"?16:n.chip=="esp32s2"?44:39)},[n,o,r,a,f,c,v,i,p,_,b,d,g,T,C,$,M,E,S,A,I,F,Y,O,H,q,z,U,R,B,L,j,W,te,le,pe,ie,Te,je,Pe,We,be,ke,Ie,ge,ae,we,J,se,Ee,Fe,_e,ye,Ne,de,Ce,x,oe,Oe,ue,ve,dt,jl,xt,ct,Ml,pl,qt,vt,Qe,Xe,Ze,Ue,Je,Be,xe,et,re,he,Pi,_l,mn,St,Ai,Di,Ei,dl,Ii,Fi,Ri,Mt,Nl]}class r0 extends Me{constructor(e){super(),Se(this,e,u0,s0,$e,{sysinfo:0},null,[-1,-1,-1,-1])}}function Tf(t,e,l){const n=t.slice();return n[20]=e[l],n}function a0(t){let e=ce(t[1].chip,t[1].board)+"",l;return{c(){l=y(e)},m(n,i){w(n,l,i)},p(n,i){i&2&&e!==(e=ce(n[1].chip,n[1].board)+"")&&G(l,e)},d(n){n&&k(l)}}}function Sf(t){let e,l,n=t[1].apmac+"",i,o,r,a,f,c,p,_,b,d=Kr(t[1])+"",v,g,T=t[1].boot_reason+"",C,$,M=t[1].ex_cause+"",E,S,A;const I=[c0,f0],F=[];function Y(O,H){return O[0].u>0?0:1}return f=Y(t),c=F[f]=I[f](t),{c(){e=m("div"),l=y("AP MAC: "),i=y(n),o=h(),r=m("div"),a=y(`Last boot: + `),c.c(),p=h(),_=m("div"),b=y("Reason: "),v=y(d),g=y(" ("),C=y(T),$=y("/"),E=y(M),S=y(")"),u(e,"class","my-2"),u(r,"class","my-2"),u(_,"class","my-2")},m(O,H){w(O,e,H),s(e,l),s(e,i),w(O,o,H),w(O,r,H),s(r,a),F[f].m(r,null),w(O,p,H),w(O,_,H),s(_,b),s(_,v),s(_,g),s(_,C),s(_,$),s(_,E),s(_,S),A=!0},p(O,H){(!A||H&2)&&n!==(n=O[1].apmac+"")&&G(i,n);let q=f;f=Y(O),f===q?F[f].p(O,H):(Ae(),D(F[q],1,1,()=>{F[q]=null}),De(),c=F[f],c?c.p(O,H):(c=F[f]=I[f](O),c.c()),N(c,1),c.m(r,null)),(!A||H&2)&&d!==(d=Kr(O[1])+"")&&G(v,d),(!A||H&2)&&T!==(T=O[1].boot_reason+"")&&G(C,T),(!A||H&2)&&M!==(M=O[1].ex_cause+"")&&G(E,M)},i(O){A||(N(c),A=!0)},o(O){D(c),A=!1},d(O){O&&k(e),O&&k(o),O&&k(r),F[f].d(),O&&k(p),O&&k(_)}}}function f0(t){let e;return{c(){e=y("-")},m(l,n){w(l,e,n)},p:ne,i:ne,o:ne,d(l){l&&k(e)}}}function c0(t){let e,l;return e=new Lc({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:""}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.timestamp=new Date(new Date().getTime()-n[0].u*1e3)),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function m0(t){let e;return{c(){e=m("span"),e.textContent="Update consents",u(e,"class","btn-pri-sm")},m(l,n){w(l,e,n)},p:ne,d(l){l&&k(e)}}}function Mf(t){let e,l,n,i,o,r=ws(t[1].meter.mfg)+"",a,f,c,p,_=t[1].meter.model+"",b,d,v,g,T=t[1].meter.id+"",C;return{c(){e=m("div"),l=m("strong"),l.textContent="Meter",n=h(),i=m("div"),o=y("Manufacturer: "),a=y(r),f=h(),c=m("div"),p=y("Model: "),b=y(_),d=h(),v=m("div"),g=y("ID: "),C=y(T),u(l,"class","text-sm"),u(i,"class","my-2"),u(c,"class","my-2"),u(v,"class","my-2"),u(e,"class","cnt")},m($,M){w($,e,M),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,f),s(e,c),s(c,p),s(c,b),s(e,d),s(e,v),s(v,g),s(v,C)},p($,M){M&2&&r!==(r=ws($[1].meter.mfg)+"")&&G(a,r),M&2&&_!==(_=$[1].meter.model+"")&&G(b,_),M&2&&T!==(T=$[1].meter.id+"")&&G(C,T)},d($){$&&k(e)}}}function Nf(t){let e,l,n,i,o,r=t[1].net.ip+"",a,f,c,p,_=t[1].net.mask+"",b,d,v,g,T=t[1].net.gw+"",C,$,M,E,S=t[1].net.dns1+"",A,I,F=t[1].net.dns2&&Pf(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Network",n=h(),i=m("div"),o=y("IP: "),a=y(r),f=h(),c=m("div"),p=y("Mask: "),b=y(_),d=h(),v=m("div"),g=y("Gateway: "),C=y(T),$=h(),M=m("div"),E=y("DNS: "),A=y(S),I=h(),F&&F.c(),u(l,"class","text-sm"),u(i,"class","my-2"),u(c,"class","my-2"),u(v,"class","my-2"),u(M,"class","my-2"),u(e,"class","cnt")},m(Y,O){w(Y,e,O),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,f),s(e,c),s(c,p),s(c,b),s(e,d),s(e,v),s(v,g),s(v,C),s(e,$),s(e,M),s(M,E),s(M,A),s(M,I),F&&F.m(M,null)},p(Y,O){O&2&&r!==(r=Y[1].net.ip+"")&&G(a,r),O&2&&_!==(_=Y[1].net.mask+"")&&G(b,_),O&2&&T!==(T=Y[1].net.gw+"")&&G(C,T),O&2&&S!==(S=Y[1].net.dns1+"")&&G(A,S),Y[1].net.dns2?F?F.p(Y,O):(F=Pf(Y),F.c(),F.m(M,null)):F&&(F.d(1),F=null)},d(Y){Y&&k(e),F&&F.d()}}}function Pf(t){let e,l=t[1].net.dns2+"",n;return{c(){e=y("/ "),n=y(l)},m(i,o){w(i,e,o),w(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns2+"")&&G(n,l)},d(i){i&&k(e),i&&k(n)}}}function Af(t){let e,l,n,i=t[1].upgrade.t+"",o,r,a=t[1].version+"",f,c,p=t[1].upgrade.x+"",_,b,d=t[1].upgrade.e+"",v,g;return{c(){e=m("div"),l=m("div"),n=y("Previous upgrade attempt ("),o=y(i),r=y(") does not match current version ("),f=y(a),c=y(") ["),_=y(p),b=y("/"),v=y(d),g=y("]"),u(l,"class","bd-yellow"),u(e,"class","my-2")},m(T,C){w(T,e,C),s(e,l),s(l,n),s(l,o),s(l,r),s(l,f),s(l,c),s(l,_),s(l,b),s(l,v),s(l,g)},p(T,C){C&2&&i!==(i=T[1].upgrade.t+"")&&G(o,i),C&2&&a!==(a=T[1].version+"")&&G(f,a),C&2&&p!==(p=T[1].upgrade.x+"")&&G(_,p),C&2&&d!==(d=T[1].upgrade.e+"")&&G(v,d)},d(T){T&&k(e)}}}function Df(t){let e,l,n,i=t[2].tag_name+"",o,r,a,f,c,p,_=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[2]&&t[2].tag_name!=t[1].version&&Ef(t),b=t[1].fwconsent===2&&If();return{c(){e=m("div"),l=y(`Latest version: + `),n=m("a"),o=y(i),a=h(),_&&_.c(),f=h(),b&&b.c(),c=Ge(),u(n,"href",r=t[2].html_url),u(n,"class","ml-2 text-blue-600 hover:text-blue-800"),u(n,"target","_blank"),u(n,"rel","noreferrer"),u(e,"class","my-2 flex")},m(d,v){w(d,e,v),s(e,l),s(e,n),s(n,o),s(e,a),_&&_.m(e,null),w(d,f,v),b&&b.m(d,v),w(d,c,v),p=!0},p(d,v){(!p||v&4)&&i!==(i=d[2].tag_name+"")&&G(o,i),(!p||v&4&&r!==(r=d[2].html_url))&&u(n,"href",r),(d[1].security==0||d[0].a)&&d[1].fwconsent===1&&d[2]&&d[2].tag_name!=d[1].version?_?(_.p(d,v),v&7&&N(_,1)):(_=Ef(d),_.c(),N(_,1),_.m(e,null)):_&&(Ae(),D(_,1,1,()=>{_=null}),De()),d[1].fwconsent===2?b||(b=If(),b.c(),b.m(c.parentNode,c)):b&&(b.d(1),b=null)},i(d){p||(N(_),p=!0)},o(d){D(_),p=!1},d(d){d&&k(e),_&&_.d(),d&&k(f),b&&b.d(d),d&&k(c)}}}function Ef(t){let e,l,n,i,o,r;return n=new Oc({}),{c(){e=m("div"),l=m("button"),Z(n.$$.fragment),u(e,"class","flex-none ml-2 text-green-500"),u(e,"title","Install this version")},m(a,f){w(a,e,f),s(e,l),Q(n,l,null),i=!0,o||(r=K(l,"click",t[10]),o=!0)},p:ne,i(a){i||(N(n.$$.fragment,a),i=!0)},o(a){D(n.$$.fragment,a),i=!1},d(a){a&&k(e),X(n),o=!1,r()}}}function If(t){let e;return{c(){e=m("div"),e.innerHTML='
You have disabled one-click firmware upgrade, link to self-upgrade is disabled
',u(e,"class","my-2")},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function Ff(t){let e,l=ys(ce(t[1].chip,t[1].board))+"",n;return{c(){e=m("div"),n=y(l),u(e,"class","bd-red")},m(i,o){w(i,e,o),s(e,n)},p(i,o){o&2&&l!==(l=ys(ce(i[1].chip,i[1].board))+"")&&G(n,l)},d(i){i&&k(e)}}}function Rf(t){let e,l,n,i,o,r;function a(p,_){return p[4].length==0?_0:p0}let f=a(t),c=f(t);return{c(){e=m("div"),l=m("form"),n=m("input"),i=h(),c.c(),Xf(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(p,_){w(p,e,_),s(e,l),s(l,n),t[12](n),s(l,i),c.m(l,null),o||(r=[K(n,"change",t[13]),K(l,"submit",t[15])],o=!0)},p(p,_){f===(f=a(p))&&c?c.p(p,_):(c.d(1),c=f(p),c&&(c.c(),c.m(l,null)))},d(p){p&&k(e),t[12](null),c.d(),o=!1,Ke(r)}}}function p0(t){let e=t[4][0].name+"",l,n,i;return{c(){l=y(e),n=h(),i=m("button"),i.textContent="Upload",u(i,"type","submit"),u(i,"class","btn-pri-sm float-right")},m(o,r){w(o,l,r),w(o,n,r),w(o,i,r)},p(o,r){r&16&&e!==(e=o[4][0].name+"")&&G(l,e)},d(o){o&&k(l),o&&k(n),o&&k(i)}}}function _0(t){let e,l,n;return{c(){e=m("button"),e.textContent="Select firmware file for upgrade",u(e,"type","button"),u(e,"class","btn-pri-sm float-right")},m(i,o){w(i,e,o),l||(n=K(e,"click",t[14]),l=!0)},p:ne,d(i){i&&k(e),l=!1,n()}}}function Lf(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g=t[9],T=[];for(let S=0;S Include Secrets
(SSID, PSK, passwords and tokens)',f=h(),C&&C.c(),c=h(),p=m("form"),_=m("input"),b=h(),E.c(),u(l,"class","text-sm"),u(a,"class","my-1 mx-3 col-span-2"),u(o,"class","grid grid-cols-2"),u(i,"method","get"),u(i,"action","/configfile.cfg"),u(i,"autocomplete","off"),Xf(_,"display","none"),u(_,"name","file"),u(_,"type","file"),u(_,"accept",".cfg"),u(p,"action","/configfile"),u(p,"enctype","multipart/form-data"),u(p,"method","post"),u(p,"autocomplete","off"),u(e,"class","cnt")},m(S,A){w(S,e,A),s(e,l),s(e,n),s(e,i),s(i,o);for(let I=0;I{se=null}),De());const ue={};oe&8388608&&(ue.$$scope={dirty:oe,ctx:x}),Y.$set(ue),x[1].meter?Ee?Ee.p(x,oe):(Ee=Mf(x),Ee.c(),Ee.m(e,z)):Ee&&(Ee.d(1),Ee=null),x[1].net?Fe?Fe.p(x,oe):(Fe=Nf(x),Fe.c(),Fe.m(e,U)):Fe&&(Fe.d(1),Fe=null),(!ae||oe&2)&&te!==(te=x[1].version+"")&&G(le,te),x[1].upgrade.t&&x[1].upgrade.t!=x[1].version?_e?_e.p(x,oe):(_e=Af(x),_e.c(),_e.m(R,ie)):_e&&(_e.d(1),_e=null),x[2]?ye?(ye.p(x,oe),oe&4&&N(ye,1)):(ye=Df(x),ye.c(),N(ye,1),ye.m(R,Te)):ye&&(Ae(),D(ye,1,1,()=>{ye=null}),De()),oe&3&&(je=(x[1].security==0||x[0].a)&&oi(x[1].board)),je?Ne?Ne.p(x,oe):(Ne=Ff(x),Ne.c(),Ne.m(R,Pe)):Ne&&(Ne.d(1),Ne=null),x[1].security==0||x[0].a?de?de.p(x,oe):(de=Rf(x),de.c(),de.m(R,null)):de&&(de.d(1),de=null),x[1].security==0||x[0].a?Ce?Ce.p(x,oe):(Ce=Lf(x),Ce.c(),Ce.m(e,null)):Ce&&(Ce.d(1),Ce=null);const ve={};oe&32&&(ve.active=x[5]),ke.$set(ve);const dt={};oe&256&&(dt.active=x[8]),ge.$set(dt)},i(x){ae||(N(T.$$.fragment,x),N(se),N(Y.$$.fragment,x),N(ye),N(ke.$$.fragment,x),N(ge.$$.fragment,x),ae=!0)},o(x){D(T.$$.fragment,x),D(se),D(Y.$$.fragment,x),D(ye),D(ke.$$.fragment,x),D(ge.$$.fragment,x),ae=!1},d(x){x&&k(e),X(T),se&&se.d(),X(Y),Ee&&Ee.d(),Fe&&Fe.d(),_e&&_e.d(),ye&&ye.d(),Ne&&Ne.d(),de&&de.d(),Ce&&Ce.d(),x&&k(be),X(ke,x),x&&k(Ie),X(ge,x),we=!1,J()}}}async function b0(){await(await fetch("/reboot",{method:"POST"})).json()}function g0(t,e,l){let{data:n}=e,{sysinfo:i}=e,o=[{name:"WiFi",key:"iw"},{name:"MQTT",key:"im"},{name:"Web",key:"ie"},{name:"Meter",key:"it"},{name:"Thresholds",key:"ih"},{name:"GPIO",key:"ig"},{name:"NTP",key:"in"},{name:"Price API",key:"is"}],r={};wo.subscribe(I=>{l(2,r=Rc(i.version,I)),r||l(2,r=I[0])});function a(){confirm("Do you want to upgrade this device to "+r.tag_name+"?")&&(i.board!=2&&i.board!=4&&i.board!=7||confirm(ys(ce(i.chip,i.board))))&&(Ut.update(I=>(I.upgrading=!0,I)),Fc(r.tag_name))}const f=function(){confirm("Are you sure you want to reboot the device?")&&(Ut.update(I=>(I.booting=!0,I)),b0())};let c,p=[],_=!1,b,d=[],v=!1;bo();function g(I){gs[I?"unshift":"push"](()=>{c=I,l(3,c)})}function T(){p=this.files,l(4,p)}const C=()=>{c.click()},$=()=>l(5,_=!0);function M(I){gs[I?"unshift":"push"](()=>{b=I,l(6,b)})}function E(){d=this.files,l(7,d)}const S=()=>{b.click()},A=()=>l(8,v=!0);return t.$$set=I=>{"data"in I&&l(0,n=I.data),"sysinfo"in I&&l(1,i=I.sysinfo)},[n,i,r,c,p,_,b,d,v,o,a,f,g,T,C,$,M,E,S,A]}class k0 extends Me{constructor(e){super(),Se(this,e,g0,h0,$e,{data:0,sysinfo:1})}}function qf(t){let e,l,n=ce(t[0],7)+"",i,o,r=ce(t[0],5)+"",a,f,c=ce(t[0],4)+"",p,_,b=ce(t[0],3)+"",d,v,g,T,C=ce(t[0],2)+"",$,M,E=ce(t[0],1)+"",S,A,I=ce(t[0],0)+"",F,Y,O,H,q=ce(t[0],101)+"",z,U,R=ce(t[0],100)+"",B;return{c(){e=m("optgroup"),l=m("option"),i=y(n),o=m("option"),a=y(r),f=m("option"),p=y(c),_=m("option"),d=y(b),v=h(),g=m("optgroup"),T=m("option"),$=y(C),M=m("option"),S=y(E),A=m("option"),F=y(I),Y=h(),O=m("optgroup"),H=m("option"),z=y(q),U=m("option"),B=y(R),l.__value=7,l.value=l.__value,o.__value=5,o.value=o.__value,f.__value=4,f.value=f.__value,_.__value=3,_.value=_.__value,u(e,"label","amsleser.no"),T.__value=2,T.value=T.__value,M.__value=1,M.value=M.__value,A.__value=0,A.value=A.__value,u(g,"label","Custom hardware"),H.__value=101,H.value=H.__value,U.__value=100,U.value=U.__value,u(O,"label","Generic hardware")},m(L,j){w(L,e,j),s(e,l),s(l,i),s(e,o),s(o,a),s(e,f),s(f,p),s(e,_),s(_,d),w(L,v,j),w(L,g,j),s(g,T),s(T,$),s(g,M),s(M,S),s(g,A),s(A,F),w(L,Y,j),w(L,O,j),s(O,H),s(H,z),s(O,U),s(U,B)},p(L,j){j&1&&n!==(n=ce(L[0],7)+"")&&G(i,n),j&1&&r!==(r=ce(L[0],5)+"")&&G(a,r),j&1&&c!==(c=ce(L[0],4)+"")&&G(p,c),j&1&&b!==(b=ce(L[0],3)+"")&&G(d,b),j&1&&C!==(C=ce(L[0],2)+"")&&G($,C),j&1&&E!==(E=ce(L[0],1)+"")&&G(S,E),j&1&&I!==(I=ce(L[0],0)+"")&&G(F,I),j&1&&q!==(q=ce(L[0],101)+"")&&G(z,q),j&1&&R!==(R=ce(L[0],100)+"")&&G(B,R)},d(L){L&&k(e),L&&k(v),L&&k(g),L&&k(Y),L&&k(O)}}}function Hf(t){let e,l,n=ce(t[0],201)+"",i,o,r=ce(t[0],202)+"",a,f,c=ce(t[0],203)+"",p,_,b=ce(t[0],200)+"",d;return{c(){e=m("optgroup"),l=m("option"),i=y(n),o=m("option"),a=y(r),f=m("option"),p=y(c),_=m("option"),d=y(b),l.__value=201,l.value=l.__value,o.__value=202,o.value=o.__value,f.__value=203,f.value=f.__value,_.__value=200,_.value=_.__value,u(e,"label","Generic hardware")},m(v,g){w(v,e,g),s(e,l),s(l,i),s(e,o),s(o,a),s(e,f),s(f,p),s(e,_),s(_,d)},p(v,g){g&1&&n!==(n=ce(v[0],201)+"")&&G(i,n),g&1&&r!==(r=ce(v[0],202)+"")&&G(a,r),g&1&&c!==(c=ce(v[0],203)+"")&&G(p,c),g&1&&b!==(b=ce(v[0],200)+"")&&G(d,b)},d(v){v&&k(e)}}}function jf(t){let e,l,n=ce(t[0],7)+"",i,o,r=ce(t[0],6)+"",a,f,c=ce(t[0],5)+"",p,_,b,d,v=ce(t[0],51)+"",g,T,C=ce(t[0],50)+"",$;return{c(){e=m("optgroup"),l=m("option"),i=y(n),o=m("option"),a=y(r),f=m("option"),p=y(c),_=h(),b=m("optgroup"),d=m("option"),g=y(v),T=m("option"),$=y(C),l.__value=7,l.value=l.__value,o.__value=6,o.value=o.__value,f.__value=5,f.value=f.__value,u(e,"label","amsleser.no"),d.__value=51,d.value=d.__value,T.__value=50,T.value=T.__value,u(b,"label","Generic hardware")},m(M,E){w(M,e,E),s(e,l),s(l,i),s(e,o),s(o,a),s(e,f),s(f,p),w(M,_,E),w(M,b,E),s(b,d),s(d,g),s(b,T),s(T,$)},p(M,E){E&1&&n!==(n=ce(M[0],7)+"")&&G(i,n),E&1&&r!==(r=ce(M[0],6)+"")&&G(a,r),E&1&&c!==(c=ce(M[0],5)+"")&&G(p,c),E&1&&v!==(v=ce(M[0],51)+"")&&G(g,v),E&1&&C!==(C=ce(M[0],50)+"")&&G($,C)},d(M){M&&k(e),M&&k(_),M&&k(b)}}}function Wf(t){let e,l,n=ce(t[0],8)+"",i,o,r,a,f=ce(t[0],71)+"",c,p,_=ce(t[0],70)+"",b;return{c(){e=m("optgroup"),l=m("option"),i=y(n),o=h(),r=m("optgroup"),a=m("option"),c=y(f),p=m("option"),b=y(_),l.__value=8,l.value=l.__value,u(e,"label","Custom hardware"),a.__value=71,a.value=a.__value,p.__value=70,p.value=p.__value,u(r,"label","Generic hardware")},m(d,v){w(d,e,v),s(e,l),s(l,i),w(d,o,v),w(d,r,v),s(r,a),s(a,c),s(r,p),s(p,b)},p(d,v){v&1&&n!==(n=ce(d[0],8)+"")&&G(i,n),v&1&&f!==(f=ce(d[0],71)+"")&&G(c,f),v&1&&_!==(_=ce(d[0],70)+"")&&G(b,_)},d(d){d&&k(e),d&&k(o),d&&k(r)}}}function Gf(t){let e,l,n=ce(t[0],200)+"",i;return{c(){e=m("optgroup"),l=m("option"),i=y(n),l.__value=200,l.value=l.__value,u(e,"label","Generic hardware")},m(o,r){w(o,e,r),s(e,l),s(l,i)},p(o,r){r&1&&n!==(n=ce(o[0],200)+"")&&G(i,n)},d(o){o&&k(e)}}}function w0(t){let e,l,n,i,o,r,a,f=t[0]=="esp8266"&&qf(t),c=t[0]=="esp32"&&Hf(t),p=t[0]=="esp32s2"&&jf(t),_=t[0]=="esp32c3"&&Wf(t),b=t[0]=="esp32solo"&&Gf(t);return{c(){e=m("option"),l=h(),f&&f.c(),n=h(),c&&c.c(),i=h(),p&&p.c(),o=h(),_&&_.c(),r=h(),b&&b.c(),a=Ge(),e.__value=-1,e.value=e.__value},m(d,v){w(d,e,v),w(d,l,v),f&&f.m(d,v),w(d,n,v),c&&c.m(d,v),w(d,i,v),p&&p.m(d,v),w(d,o,v),_&&_.m(d,v),w(d,r,v),b&&b.m(d,v),w(d,a,v)},p(d,[v]){d[0]=="esp8266"?f?f.p(d,v):(f=qf(d),f.c(),f.m(n.parentNode,n)):f&&(f.d(1),f=null),d[0]=="esp32"?c?c.p(d,v):(c=Hf(d),c.c(),c.m(i.parentNode,i)):c&&(c.d(1),c=null),d[0]=="esp32s2"?p?p.p(d,v):(p=jf(d),p.c(),p.m(o.parentNode,o)):p&&(p.d(1),p=null),d[0]=="esp32c3"?_?_.p(d,v):(_=Wf(d),_.c(),_.m(r.parentNode,r)):_&&(_.d(1),_=null),d[0]=="esp32solo"?b?b.p(d,v):(b=Gf(d),b.c(),b.m(a.parentNode,a)):b&&(b.d(1),b=null)},i:ne,o:ne,d(d){d&&k(e),d&&k(l),f&&f.d(d),d&&k(n),c&&c.d(d),d&&k(i),p&&p.d(d),d&&k(o),_&&_.d(d),d&&k(r),b&&b.d(d),d&&k(a)}}}function y0(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class C0 extends Me{constructor(e){super(),Se(this,e,y0,w0,$e,{chip:0})}}function Bf(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",u(e,"class","bd-red")},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function zf(t){let e,l,n,i,o,r,a;return r=new Hc({props:{chip:t[0].chip}}),{c(){e=m("div"),l=y("HAN GPIO"),n=m("br"),i=h(),o=m("select"),Z(r.$$.fragment),u(o,"name","vh"),u(o,"class","in-s"),u(e,"class","my-3")},m(f,c){w(f,e,c),s(e,l),s(e,n),s(e,i),s(e,o),Q(r,o,null),a=!0},p(f,c){const p={};c&1&&(p.chip=f[0].chip),r.$set(p)},i(f){a||(N(r.$$.fragment,f),a=!0)},o(f){D(r.$$.fragment,f),a=!1},d(f){f&&k(e),X(r)}}}function $0(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,T,C,$,M,E,S,A,I,F,Y,O,H,q,z,U=t[0].usrcfg&&Bf();v=new C0({props:{chip:t[0].chip}});let R=t[0].board&&t[0].board>20&&zf(t);return O=new Dt({props:{active:t[1],message:"Saving device configuration"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=h(),r=m("strong"),r.textContent="Initial configuration",a=h(),U&&U.c(),f=h(),c=m("div"),p=y("Board type"),_=m("br"),b=h(),d=m("select"),Z(v.$$.fragment),g=h(),R&&R.c(),T=h(),C=m("div"),$=m("label"),M=m("input"),E=y(" Clear all other configuration"),S=h(),A=m("div"),A.innerHTML='',I=h(),F=m("span"),F.textContent=" ",Y=h(),Z(O.$$.fragment),u(i,"type","hidden"),u(i,"name","v"),i.value="true",u(r,"class","text-sm"),u(d,"name","vb"),u(d,"class","in-s"),t[0].board===void 0&&tt(()=>t[4].call(d)),u(c,"class","my-3"),u(M,"type","checkbox"),u(M,"name","vr"),M.__value="true",M.value=M.__value,u(M,"class","rounded mb-1"),u(C,"class","my-3"),u(A,"class","my-3"),u(F,"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(B,L){w(B,e,L),s(e,l),s(l,n),s(n,i),s(n,o),s(n,r),s(n,a),U&&U.m(n,null),s(n,f),s(n,c),s(c,p),s(c,_),s(c,b),s(c,d),Q(v,d,null),Le(d,t[0].board,!0),s(n,g),R&&R.m(n,null),s(n,T),s(n,C),s(C,$),s($,M),M.checked=t[2],s($,E),s(n,S),s(n,A),s(n,I),s(n,F),w(B,Y,L),Q(O,B,L),H=!0,q||(z=[K(d,"change",t[4]),K(M,"change",t[5]),K(n,"submit",Cs(t[3]))],q=!0)},p(B,[L]){B[0].usrcfg?U||(U=Bf(),U.c(),U.m(n,f)):U&&(U.d(1),U=null);const j={};L&1&&(j.chip=B[0].chip),v.$set(j),L&1&&Le(d,B[0].board),B[0].board&&B[0].board>20?R?(R.p(B,L),L&1&&N(R,1)):(R=zf(B),R.c(),N(R,1),R.m(n,T)):R&&(Ae(),D(R,1,1,()=>{R=null}),De()),L&4&&(M.checked=B[2]);const W={};L&2&&(W.active=B[1]),O.$set(W)},i(B){H||(N(v.$$.fragment,B),N(R),N(O.$$.fragment,B),H=!0)},o(B){D(v.$$.fragment,B),D(R),D(O.$$.fragment,B),H=!1},d(B){B&&k(e),U&&U.d(),X(v),R&&R.d(),B&&k(Y),X(O,B),q=!1,Ke(z)}}}function T0(t,e,l){let{sysinfo:n={}}=e,i=!1;async function o(c){l(1,i=!0);const p=new FormData(c.target),_=new URLSearchParams;for(let v of p){const[g,T]=v;_.append(g,T)}let d=await(await fetch("/save",{method:"POST",body:_})).json();l(1,i=!1),Ut.update(v=>(v.vndcfg=d.success,v.booting=d.reboot,v)),si(n.usrcfg?"/":"/setup")}let r=!1;function a(){n.board=_t(this),l(0,n)}function f(){r=this.checked,l(2,r),l(0,n)}return t.$$set=c=>{"sysinfo"in c&&l(0,n=c.sysinfo)},t.$$.update=()=>{t.$$.dirty&1&&l(2,r=!n.usrcfg)},[n,i,r,o,a,f]}class S0 extends Me{constructor(e){super(),Se(this,e,T0,$0,$e,{sysinfo:0})}}function Yf(t){let e,l,n,i,o,r,a,f;return a=new jc({}),{c(){e=m("br"),l=h(),n=m("div"),i=m("input"),o=h(),r=m("select"),Z(a.$$.fragment),u(i,"name","si"),u(i,"type","text"),u(i,"class","in-f w-full"),i.required=t[1],u(r,"name","su"),u(r,"class","in-l"),r.required=t[1],u(n,"class","flex")},m(c,p){w(c,e,p),w(c,l,p),w(c,n,p),s(n,i),s(n,o),s(n,r),Q(a,r,null),f=!0},p(c,p){(!f||p&2)&&(i.required=c[1]),(!f||p&2)&&(r.required=c[1])},i(c){f||(N(a.$$.fragment,c),f=!0)},o(c){D(a.$$.fragment,c),f=!1},d(c){c&&k(e),c&&k(l),c&&k(n),X(a)}}}function Vf(t){let e;return{c(){e=m("div"),e.innerHTML=`
Gateway
DNS
-
`,u(e,"class","my-3 flex")},m(l,n){y(l,e,n)},d(l){l&&w(e)}}}function b0(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,k,$,T,P,I,S,A,E,F,Y,U,R,q,z=t[1]&&Vf(t),O=t[1]&&Kf();return Y=new At({props:{active:t[2],message:"Saving your configuration to the device"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=h(),r=m("strong"),r.textContent="Setup",a=h(),f=m("div"),f.innerHTML=`SSID
+
`,u(e,"class","my-3 flex")},m(l,n){w(l,e,n)},d(l){l&&k(e)}}}function M0(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,T,C,$,M,E,S,A,I,F,Y,O,H,q,z=t[1]&&Yf(t),U=t[1]&&Vf();return Y=new Dt({props:{active:t[2],message:"Saving your configuration to the device"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=h(),r=m("strong"),r.textContent="Setup",a=h(),f=m("div"),f.innerHTML=`SSID
`,c=h(),p=m("div"),p.innerHTML=`PSK
- `,_=h(),b=m("div"),d=C(`Hostname - `),v=m("input"),g=h(),k=m("div"),$=m("label"),T=m("input"),P=C(" Static IP"),I=h(),z&&z.c(),S=h(),O&&O.c(),A=h(),E=m("div"),E.innerHTML='',F=h(),J(Y.$$.fragment),u(i,"type","hidden"),u(i,"name","s"),i.value="true",u(r,"class","text-sm"),u(f,"class","my-3"),u(p,"class","my-3"),u(v,"name","sh"),u(v,"type","text"),u(v,"class","in-s"),u(v,"maxlength","32"),u(v,"pattern","[a-z0-9_-]+"),u(v,"placeholder","Optional, ex.: ams-reader"),u(v,"autocomplete","off"),u(T,"type","checkbox"),u(T,"name","sm"),T.__value="static",T.value=T.__value,u(T,"class","rounded mb-1"),u(k,"class","my-3"),u(E,"class","my-3"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(H,G){y(H,e,G),s(e,l),s(l,n),s(n,i),s(n,o),s(n,r),s(n,a),s(n,f),s(n,c),s(n,p),s(n,_),s(n,b),s(b,d),s(b,v),V(v,t[0].hostname),s(n,g),s(n,k),s(k,$),s($,T),T.checked=t[1],s($,P),s(k,I),z&&z.m(k,null),s(n,S),O&&O.m(n,null),s(n,A),s(n,E),y(H,F,G),X(Y,H,G),U=!0,R||(q=[K(v,"input",t[4]),K(T,"change",t[5]),K(n,"submit",Ts(t[3]))],R=!0)},p(H,[G]){G&1&&v.value!==H[0].hostname&&V(v,H[0].hostname),G&2&&(T.checked=H[1]),H[1]?z?(z.p(H,G),G&2&&N(z,1)):(z=Vf(H),z.c(),N(z,1),z.m(k,null)):z&&(Te(),D(z,1,1,()=>{z=null}),Se()),H[1]?O||(O=Kf(),O.c(),O.m(n,A)):O&&(O.d(1),O=null);const L={};G&4&&(L.active=H[2]),Y.$set(L)},i(H){U||(N(z),N(Y.$$.fragment,H),U=!0)},o(H){D(z),D(Y.$$.fragment,H),U=!1},d(H){H&&w(e),z&&z.d(),O&&O.d(),H&&w(F),Z(Y,H),R=!1,Ve(q)}}}function g0(t,e,l){let{sysinfo:n={}}=e,i=!1,o=!1,r=0;function a(){var _="";r++;var b=function(){setTimeout(a,1e3)};if(n.net.ip&&r%3==0){if(!n.net.ip){b();return}_="http://"+n.net.ip}else n.hostname&&r%3==1?_="http://"+n.hostname:n.hostname&&r%3==2?_="http://"+n.hostname+".local":_="";console&&console.log("Trying url "+_),Ut.update(v=>(v.trying=_,v));var d=new XMLHttpRequest;d.timeout=5e3,d.addEventListener("abort",b),d.addEventListener("error",b),d.addEventListener("timeout",b),d.addEventListener("load",function(v){window.location.href=_||"/"}),d.open("GET",_+"/is-alive",!0),d.send()}async function f(_){l(2,o=!0);const b=new FormData(_.target),d=new URLSearchParams;for(let k of b){const[$,T]=k;d.append($,T)}let g=await(await fetch("/save",{method:"POST",body:d})).json();l(2,o=!1),Ut.update(k=>(k.hostname=b.get("sh"),k.usrcfg=g.success,k.booting=g.reboot,i&&(k.net.ip=b.get("si"),k.net.mask=b.get("su"),k.net.gw=b.get("sg"),k.net.dns1=b.get("sd")),setTimeout(a,5e3),k))}function c(){n.hostname=this.value,l(0,n)}function p(){i=this.checked,l(1,i)}return t.$$set=_=>{"sysinfo"in _&&l(0,n=_.sysinfo)},[n,i,o,f,c,p]}class k0 extends Ce{constructor(e){super(),ye(this,e,g0,b0,ke,{sysinfo:0})}}function w0(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,k,$;return v=new At({props:{active:t[2],message:"Uploading file, please wait"}}),{c(){e=m("div"),l=m("div"),n=m("strong"),i=C("Upload "),o=C(t[1]),r=h(),a=m("p"),a.textContent="Select a suitable file and click upload",f=h(),c=m("form"),p=m("input"),_=h(),b=m("div"),b.innerHTML='',d=h(),J(v.$$.fragment),u(a,"class","mb-4"),u(p,"name","file"),u(p,"type","file"),u(b,"class","w-full text-right mt-4"),u(c,"action",t[0]),u(c,"enctype","multipart/form-data"),u(c,"method","post"),u(c,"autocomplete","off"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2")},m(T,P){y(T,e,P),s(e,l),s(l,n),s(n,i),s(n,o),s(l,r),s(l,a),s(l,f),s(l,c),s(c,p),s(c,_),s(c,b),y(T,d,P),X(v,T,P),g=!0,k||($=K(c,"submit",t[3]),k=!0)},p(T,[P]){(!g||P&2)&&B(o,T[1]),(!g||P&1)&&u(c,"action",T[0]);const I={};P&4&&(I.active=T[2]),v.$set(I)},i(T){g||(N(v.$$.fragment,T),g=!0)},o(T){D(v.$$.fragment,T),g=!1},d(T){T&&w(e),T&&w(d),Z(v,T),k=!1,$()}}}function y0(t,e,l){let{action:n}=e,{title:i}=e,o=!1;const r=()=>l(2,o=!0);return t.$$set=a=>{"action"in a&&l(0,n=a.action),"title"in a&&l(1,i=a.title)},[n,i,o,r]}class Co extends Ce{constructor(e){super(),ye(this,e,y0,w0,ke,{action:0,title:1})}}function C0(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,k,$,T,P,I,S,A,E,F,Y,U,R,q,z,O,H;return q=new At({props:{active:t[1],message:"Saving preferences"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("div"),i.textContent="Various permissions we need to do stuff:",o=h(),r=m("hr"),a=h(),f=m("div"),c=C("Enable one-click upgrade? (implies data collection)"),p=m("br"),_=h(),b=m("a"),d=C("Read more"),v=m("br"),g=h(),k=m("label"),$=m("input"),P=C(" Yes"),I=m("label"),S=m("input"),E=C(" No"),F=m("br"),Y=h(),U=m("div"),U.innerHTML='',R=h(),J(q.$$.fragment),u(b,"href",Lt("Data-collection-on-one-click-firmware-upgrade")),u(b,"target","_blank"),u(b,"class","text-blue-600 hover:text-blue-800"),u($,"type","radio"),u($,"name","sf"),$.value=1,$.checked=T=t[0].fwconsent===1,u($,"class","rounded m-2"),$.required=!0,u(S,"type","radio"),u(S,"name","sf"),S.value=2,S.checked=A=t[0].fwconsent===2,u(S,"class","rounded m-2"),S.required=!0,u(f,"class","my-3"),u(U,"class","my-3"),u(n,"autocomplete","off"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-3 lg:grid-cols-2")},m(G,L){y(G,e,L),s(e,l),s(l,n),s(n,i),s(n,o),s(n,r),s(n,a),s(n,f),s(f,c),s(f,p),s(f,_),s(f,b),s(b,d),s(f,v),s(f,g),s(f,k),s(k,$),s(k,P),s(f,I),s(I,S),s(I,E),s(f,F),s(n,Y),s(n,U),y(G,R,L),X(q,G,L),z=!0,O||(H=K(n,"submit",Ts(t[2])),O=!0)},p(G,[L]){(!z||L&1&&T!==(T=G[0].fwconsent===1))&&($.checked=T),(!z||L&1&&A!==(A=G[0].fwconsent===2))&&(S.checked=A);const W={};L&2&&(W.active=G[1]),q.$set(W)},i(G){z||(N(q.$$.fragment,G),z=!0)},o(G){D(q.$$.fragment,G),z=!1},d(G){G&&w(e),G&&w(R),Z(q,G),O=!1,H()}}}function $0(t,e,l){let{sysinfo:n={}}=e,i=!1;async function o(r){l(1,i=!0);const a=new FormData(r.target),f=new URLSearchParams;for(let _ of a){const[b,d]=_;f.append(b,d)}let p=await(await fetch("/save",{method:"POST",body:f})).json();l(1,i=!1),Ut.update(_=>(_.fwconsent=a.sf===!0?1:a.sf===!1?2:0,_.booting=p.reboot,_)),ii("/")}return t.$$set=r=>{"sysinfo"in r&&l(0,n=r.sysinfo)},[n,i,o]}class T0 extends Ce{constructor(e){super(),ye(this,e,$0,C0,ke,{sysinfo:0})}}function S0(t){let e,l;return e=new Tp({props:{data:t[1],sysinfo:t[0]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.data=n[1]),i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function P0(t){let e,l;return e=new xp({props:{sysinfo:t[0]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function N0(t){let e,l;return e=new c0({props:{sysinfo:t[0],data:t[1]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),i&2&&(o.data=n[1]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function M0(t){let e,l;return e=new Co({props:{title:"CA",action:"/mqtt-ca"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p:ne,i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function A0(t){let e,l;return e=new Co({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p:ne,i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function D0(t){let e,l;return e=new Co({props:{title:"private key",action:"/mqtt-key"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p:ne,i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function I0(t){let e,l;return e=new T0({props:{sysinfo:t[0]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function E0(t){let e,l;return e=new k0({props:{sysinfo:t[0]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function F0(t){let e,l;return e=new h0({props:{sysinfo:t[0]}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function R0(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,k,$,T,P,I;return e=new qm({props:{data:t[1]}}),n=new Sl({props:{path:"/",$$slots:{default:[S0]},$$scope:{ctx:t}}}),o=new Sl({props:{path:"/configuration",$$slots:{default:[P0]},$$scope:{ctx:t}}}),a=new Sl({props:{path:"/status",$$slots:{default:[N0]},$$scope:{ctx:t}}}),c=new Sl({props:{path:"/mqtt-ca",$$slots:{default:[M0]},$$scope:{ctx:t}}}),_=new Sl({props:{path:"/mqtt-cert",$$slots:{default:[A0]},$$scope:{ctx:t}}}),d=new Sl({props:{path:"/mqtt-key",$$slots:{default:[D0]},$$scope:{ctx:t}}}),g=new Sl({props:{path:"/consent",$$slots:{default:[I0]},$$scope:{ctx:t}}}),$=new Sl({props:{path:"/setup",$$slots:{default:[E0]},$$scope:{ctx:t}}}),P=new Sl({props:{path:"/vendor",$$slots:{default:[F0]},$$scope:{ctx:t}}}),{c(){J(e.$$.fragment),l=h(),J(n.$$.fragment),i=h(),J(o.$$.fragment),r=h(),J(a.$$.fragment),f=h(),J(c.$$.fragment),p=h(),J(_.$$.fragment),b=h(),J(d.$$.fragment),v=h(),J(g.$$.fragment),k=h(),J($.$$.fragment),T=h(),J(P.$$.fragment)},m(S,A){X(e,S,A),y(S,l,A),X(n,S,A),y(S,i,A),X(o,S,A),y(S,r,A),X(a,S,A),y(S,f,A),X(c,S,A),y(S,p,A),X(_,S,A),y(S,b,A),X(d,S,A),y(S,v,A),X(g,S,A),y(S,k,A),X($,S,A),y(S,T,A),X(P,S,A),I=!0},p(S,A){const E={};A&2&&(E.data=S[1]),e.$set(E);const F={};A&7&&(F.$$scope={dirty:A,ctx:S}),n.$set(F);const Y={};A&5&&(Y.$$scope={dirty:A,ctx:S}),o.$set(Y);const U={};A&7&&(U.$$scope={dirty:A,ctx:S}),a.$set(U);const R={};A&4&&(R.$$scope={dirty:A,ctx:S}),c.$set(R);const q={};A&4&&(q.$$scope={dirty:A,ctx:S}),_.$set(q);const z={};A&4&&(z.$$scope={dirty:A,ctx:S}),d.$set(z);const O={};A&5&&(O.$$scope={dirty:A,ctx:S}),g.$set(O);const H={};A&5&&(H.$$scope={dirty:A,ctx:S}),$.$set(H);const G={};A&5&&(G.$$scope={dirty:A,ctx:S}),P.$set(G)},i(S){I||(N(e.$$.fragment,S),N(n.$$.fragment,S),N(o.$$.fragment,S),N(a.$$.fragment,S),N(c.$$.fragment,S),N(_.$$.fragment,S),N(d.$$.fragment,S),N(g.$$.fragment,S),N($.$$.fragment,S),N(P.$$.fragment,S),I=!0)},o(S){D(e.$$.fragment,S),D(n.$$.fragment,S),D(o.$$.fragment,S),D(a.$$.fragment,S),D(c.$$.fragment,S),D(_.$$.fragment,S),D(d.$$.fragment,S),D(g.$$.fragment,S),D($.$$.fragment,S),D(P.$$.fragment,S),I=!1},d(S){Z(e,S),S&&w(l),Z(n,S),S&&w(i),Z(o,S),S&&w(r),Z(a,S),S&&w(f),Z(c,S),S&&w(p),Z(_,S),S&&w(b),Z(d,S),S&&w(v),Z(g,S),S&&w(k),Z($,S),S&&w(T),Z(P,S)}}}function L0(t){let e,l,n,i;const o=[q0,O0],r=[];function a(f,c){return f[0].trying?0:1}return e=a(t),l=r[e]=o[e](t),{c(){l.c(),n=We()},m(f,c){r[e].m(f,c),y(f,n,c),i=!0},p(f,c){let p=e;e=a(f),e===p?r[e].p(f,c):(Te(),D(r[p],1,1,()=>{r[p]=null}),Se(),l=r[e],l?l.p(f,c):(l=r[e]=o[e](f),l.c()),N(l,1),l.m(n.parentNode,n))},i(f){i||(N(l),i=!0)},o(f){D(l),i=!1},d(f){r[e].d(f),f&&w(n)}}}function U0(t){let e,l;return e=new At({props:{active:"true",message:"Device is upgrading, please wait"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p:ne,i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function O0(t){let e,l;return e=new At({props:{active:"true",message:"Device is booting, please wait"}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p:ne,i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function q0(t){let e,l;return e=new At({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[0].trying}}),{c(){J(e.$$.fragment)},m(n,i){X(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.message="Device is booting, please wait. Trying to reach it on "+n[0].trying),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){Z(e,n)}}}function H0(t){let e,l,n,i,o,r;l=new wc({props:{$$slots:{default:[R0]},$$scope:{ctx:t}}});const a=[U0,L0],f=[];function c(p,_){return p[0].upgrading?0:p[0].booting?1:-1}return~(i=c(t))&&(o=f[i]=a[i](t)),{c(){e=m("div"),J(l.$$.fragment),n=h(),o&&o.c(),u(e,"class","container mx-auto m-3")},m(p,_){y(p,e,_),X(l,e,null),s(e,n),~i&&f[i].m(e,null),r=!0},p(p,[_]){const b={};_&7&&(b.$$scope={dirty:_,ctx:p}),l.$set(b);let d=i;i=c(p),i===d?~i&&f[i].p(p,_):(o&&(Te(),D(f[d],1,1,()=>{f[d]=null}),Se()),~i?(o=f[i],o?o.p(p,_):(o=f[i]=a[i](p),o.c()),N(o,1),o.m(e,null)):o=null)},i(p){r||(N(l.$$.fragment,p),N(o),r=!0)},o(p){D(l.$$.fragment,p),D(o),r=!1},d(p){p&&w(e),Z(l),~i&&f[i].d()}}}function j0(t,e,l){let n={};Ut.subscribe(o=>{l(0,n=o),n.vndcfg===!1?ii("/vendor"):n.usrcfg===!1?ii("/setup"):n.fwconsent===0&&ii("/consent")}),go();let i={};return om.subscribe(o=>{l(1,i=o)}),[n,i]}class W0 extends Ce{constructor(e){super(),ye(this,e,j0,H0,ke,{})}}new W0({target:document.getElementById("app")}); + `,_=h(),b=m("div"),d=y(`Hostname + `),v=m("input"),g=h(),T=m("div"),C=m("label"),$=m("input"),M=y(" Static IP"),E=h(),z&&z.c(),S=h(),U&&U.c(),A=h(),I=m("div"),I.innerHTML='',F=h(),Z(Y.$$.fragment),u(i,"type","hidden"),u(i,"name","s"),i.value="true",u(r,"class","text-sm"),u(f,"class","my-3"),u(p,"class","my-3"),u(v,"name","sh"),u(v,"type","text"),u(v,"class","in-s"),u(v,"maxlength","32"),u(v,"pattern","[a-z0-9_-]+"),u(v,"placeholder","Optional, ex.: ams-reader"),u(v,"autocomplete","off"),u($,"type","checkbox"),u($,"name","sm"),$.__value="static",$.value=$.__value,u($,"class","rounded mb-1"),u(T,"class","my-3"),u(I,"class","my-3"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(R,B){w(R,e,B),s(e,l),s(l,n),s(n,i),s(n,o),s(n,r),s(n,a),s(n,f),s(n,c),s(n,p),s(n,_),s(n,b),s(b,d),s(b,v),V(v,t[0].hostname),s(n,g),s(n,T),s(T,C),s(C,$),$.checked=t[1],s(C,M),s(T,E),z&&z.m(T,null),s(n,S),U&&U.m(n,null),s(n,A),s(n,I),w(R,F,B),Q(Y,R,B),O=!0,H||(q=[K(v,"input",t[4]),K($,"change",t[5]),K(n,"submit",Cs(t[3]))],H=!0)},p(R,[B]){B&1&&v.value!==R[0].hostname&&V(v,R[0].hostname),B&2&&($.checked=R[1]),R[1]?z?(z.p(R,B),B&2&&N(z,1)):(z=Yf(R),z.c(),N(z,1),z.m(T,null)):z&&(Ae(),D(z,1,1,()=>{z=null}),De()),R[1]?U||(U=Vf(),U.c(),U.m(n,A)):U&&(U.d(1),U=null);const L={};B&4&&(L.active=R[2]),Y.$set(L)},i(R){O||(N(z),N(Y.$$.fragment,R),O=!0)},o(R){D(z),D(Y.$$.fragment,R),O=!1},d(R){R&&k(e),z&&z.d(),U&&U.d(),R&&k(F),X(Y,R),H=!1,Ke(q)}}}function N0(t,e,l){let{sysinfo:n={}}=e,i=!1,o=!1,r=0;function a(){var _="";r++;var b=function(){setTimeout(a,1e3)};if(n.net.ip&&r%3==0){if(!n.net.ip){b();return}_="http://"+n.net.ip}else n.hostname&&r%3==1?_="http://"+n.hostname:n.hostname&&r%3==2?_="http://"+n.hostname+".local":_="";console&&console.log("Trying url "+_),Ut.update(v=>(v.trying=_,v));var d=new XMLHttpRequest;d.timeout=5e3,d.addEventListener("abort",b),d.addEventListener("error",b),d.addEventListener("timeout",b),d.addEventListener("load",function(v){window.location.href=_||"/"}),d.open("GET",_+"/is-alive",!0),d.send()}async function f(_){l(2,o=!0);const b=new FormData(_.target),d=new URLSearchParams;for(let T of b){const[C,$]=T;d.append(C,$)}let g=await(await fetch("/save",{method:"POST",body:d})).json();l(2,o=!1),Ut.update(T=>(T.hostname=b.get("sh"),T.usrcfg=g.success,T.booting=g.reboot,i&&(T.net.ip=b.get("si"),T.net.mask=b.get("su"),T.net.gw=b.get("sg"),T.net.dns1=b.get("sd")),setTimeout(a,5e3),T))}function c(){n.hostname=this.value,l(0,n)}function p(){i=this.checked,l(1,i)}return t.$$set=_=>{"sysinfo"in _&&l(0,n=_.sysinfo)},[n,i,o,f,c,p]}class P0 extends Me{constructor(e){super(),Se(this,e,N0,M0,$e,{sysinfo:0})}}function A0(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,T,C;return v=new Dt({props:{active:t[2],message:"Uploading file, please wait"}}),{c(){e=m("div"),l=m("div"),n=m("strong"),i=y("Upload "),o=y(t[1]),r=h(),a=m("p"),a.textContent="Select a suitable file and click upload",f=h(),c=m("form"),p=m("input"),_=h(),b=m("div"),b.innerHTML='',d=h(),Z(v.$$.fragment),u(a,"class","mb-4"),u(p,"name","file"),u(p,"type","file"),u(b,"class","w-full text-right mt-4"),u(c,"action",t[0]),u(c,"enctype","multipart/form-data"),u(c,"method","post"),u(c,"autocomplete","off"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2")},m($,M){w($,e,M),s(e,l),s(l,n),s(n,i),s(n,o),s(l,r),s(l,a),s(l,f),s(l,c),s(c,p),s(c,_),s(c,b),w($,d,M),Q(v,$,M),g=!0,T||(C=K(c,"submit",t[3]),T=!0)},p($,[M]){(!g||M&2)&&G(o,$[1]),(!g||M&1)&&u(c,"action",$[0]);const E={};M&4&&(E.active=$[2]),v.$set(E)},i($){g||(N(v.$$.fragment,$),g=!0)},o($){D(v.$$.fragment,$),g=!1},d($){$&&k(e),$&&k(d),X(v,$),T=!1,C()}}}function D0(t,e,l){let{action:n}=e,{title:i}=e,o=!1;const r=()=>l(2,o=!0);return t.$$set=a=>{"action"in a&&l(0,n=a.action),"title"in a&&l(1,i=a.title)},[n,i,o,r]}class yo extends Me{constructor(e){super(),Se(this,e,D0,A0,$e,{action:0,title:1})}}function E0(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,T,C,$,M,E,S,A,I,F,Y,O,H,q,z,U,R;return q=new Dt({props:{active:t[1],message:"Saving preferences"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("div"),i.textContent="Various permissions we need to do stuff:",o=h(),r=m("hr"),a=h(),f=m("div"),c=y("Enable one-click upgrade? (implies data collection)"),p=m("br"),_=h(),b=m("a"),d=y("Read more"),v=m("br"),g=h(),T=m("label"),C=m("input"),M=y(" Yes"),E=m("label"),S=m("input"),I=y(" No"),F=m("br"),Y=h(),O=m("div"),O.innerHTML='',H=h(),Z(q.$$.fragment),u(b,"href",Ot("Data-collection-on-one-click-firmware-upgrade")),u(b,"target","_blank"),u(b,"class","text-blue-600 hover:text-blue-800"),u(C,"type","radio"),u(C,"name","sf"),C.value=1,C.checked=$=t[0].fwconsent===1,u(C,"class","rounded m-2"),C.required=!0,u(S,"type","radio"),u(S,"name","sf"),S.value=2,S.checked=A=t[0].fwconsent===2,u(S,"class","rounded m-2"),S.required=!0,u(f,"class","my-3"),u(O,"class","my-3"),u(n,"autocomplete","off"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-3 lg:grid-cols-2")},m(B,L){w(B,e,L),s(e,l),s(l,n),s(n,i),s(n,o),s(n,r),s(n,a),s(n,f),s(f,c),s(f,p),s(f,_),s(f,b),s(b,d),s(f,v),s(f,g),s(f,T),s(T,C),s(T,M),s(f,E),s(E,S),s(E,I),s(f,F),s(n,Y),s(n,O),w(B,H,L),Q(q,B,L),z=!0,U||(R=K(n,"submit",Cs(t[2])),U=!0)},p(B,[L]){(!z||L&1&&$!==($=B[0].fwconsent===1))&&(C.checked=$),(!z||L&1&&A!==(A=B[0].fwconsent===2))&&(S.checked=A);const j={};L&2&&(j.active=B[1]),q.$set(j)},i(B){z||(N(q.$$.fragment,B),z=!0)},o(B){D(q.$$.fragment,B),z=!1},d(B){B&&k(e),B&&k(H),X(q,B),U=!1,R()}}}function I0(t,e,l){let{sysinfo:n={}}=e,i=!1;async function o(r){l(1,i=!0);const a=new FormData(r.target),f=new URLSearchParams;for(let _ of a){const[b,d]=_;f.append(b,d)}let p=await(await fetch("/save",{method:"POST",body:f})).json();l(1,i=!1),Ut.update(_=>(_.fwconsent=a.sf===!0?1:a.sf===!1?2:0,_.booting=p.reboot,_)),si("/")}return t.$$set=r=>{"sysinfo"in r&&l(0,n=r.sysinfo)},[n,i,o]}class F0 extends Me{constructor(e){super(),Se(this,e,I0,E0,$e,{sysinfo:0})}}function R0(t){let e,l;return e=new Fp({props:{data:t[1],sysinfo:t[0]}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.data=n[1]),i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function L0(t){let e,l;return e=new r0({props:{sysinfo:t[0]}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function O0(t){let e,l;return e=new k0({props:{sysinfo:t[0],data:t[1]}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),i&2&&(o.data=n[1]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function U0(t){let e,l;return e=new yo({props:{title:"CA",action:"/mqtt-ca"}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p:ne,i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function q0(t){let e,l;return e=new yo({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p:ne,i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function H0(t){let e,l;return e=new yo({props:{title:"private key",action:"/mqtt-key"}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p:ne,i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function j0(t){let e,l;return e=new F0({props:{sysinfo:t[0]}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function W0(t){let e,l;return e=new P0({props:{sysinfo:t[0]}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function G0(t){let e,l;return e=new S0({props:{sysinfo:t[0]}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function B0(t){let e,l,n,i,o,r,a,f,c,p,_,b,d,v,g,T,C,$,M,E;return e=new Km({props:{data:t[1]}}),n=new Tl({props:{path:"/",$$slots:{default:[R0]},$$scope:{ctx:t}}}),o=new Tl({props:{path:"/configuration",$$slots:{default:[L0]},$$scope:{ctx:t}}}),a=new Tl({props:{path:"/status",$$slots:{default:[O0]},$$scope:{ctx:t}}}),c=new Tl({props:{path:"/mqtt-ca",$$slots:{default:[U0]},$$scope:{ctx:t}}}),_=new Tl({props:{path:"/mqtt-cert",$$slots:{default:[q0]},$$scope:{ctx:t}}}),d=new Tl({props:{path:"/mqtt-key",$$slots:{default:[H0]},$$scope:{ctx:t}}}),g=new Tl({props:{path:"/consent",$$slots:{default:[j0]},$$scope:{ctx:t}}}),C=new Tl({props:{path:"/setup",$$slots:{default:[W0]},$$scope:{ctx:t}}}),M=new Tl({props:{path:"/vendor",$$slots:{default:[G0]},$$scope:{ctx:t}}}),{c(){Z(e.$$.fragment),l=h(),Z(n.$$.fragment),i=h(),Z(o.$$.fragment),r=h(),Z(a.$$.fragment),f=h(),Z(c.$$.fragment),p=h(),Z(_.$$.fragment),b=h(),Z(d.$$.fragment),v=h(),Z(g.$$.fragment),T=h(),Z(C.$$.fragment),$=h(),Z(M.$$.fragment)},m(S,A){Q(e,S,A),w(S,l,A),Q(n,S,A),w(S,i,A),Q(o,S,A),w(S,r,A),Q(a,S,A),w(S,f,A),Q(c,S,A),w(S,p,A),Q(_,S,A),w(S,b,A),Q(d,S,A),w(S,v,A),Q(g,S,A),w(S,T,A),Q(C,S,A),w(S,$,A),Q(M,S,A),E=!0},p(S,A){const I={};A&2&&(I.data=S[1]),e.$set(I);const F={};A&7&&(F.$$scope={dirty:A,ctx:S}),n.$set(F);const Y={};A&5&&(Y.$$scope={dirty:A,ctx:S}),o.$set(Y);const O={};A&7&&(O.$$scope={dirty:A,ctx:S}),a.$set(O);const H={};A&4&&(H.$$scope={dirty:A,ctx:S}),c.$set(H);const q={};A&4&&(q.$$scope={dirty:A,ctx:S}),_.$set(q);const z={};A&4&&(z.$$scope={dirty:A,ctx:S}),d.$set(z);const U={};A&5&&(U.$$scope={dirty:A,ctx:S}),g.$set(U);const R={};A&5&&(R.$$scope={dirty:A,ctx:S}),C.$set(R);const B={};A&5&&(B.$$scope={dirty:A,ctx:S}),M.$set(B)},i(S){E||(N(e.$$.fragment,S),N(n.$$.fragment,S),N(o.$$.fragment,S),N(a.$$.fragment,S),N(c.$$.fragment,S),N(_.$$.fragment,S),N(d.$$.fragment,S),N(g.$$.fragment,S),N(C.$$.fragment,S),N(M.$$.fragment,S),E=!0)},o(S){D(e.$$.fragment,S),D(n.$$.fragment,S),D(o.$$.fragment,S),D(a.$$.fragment,S),D(c.$$.fragment,S),D(_.$$.fragment,S),D(d.$$.fragment,S),D(g.$$.fragment,S),D(C.$$.fragment,S),D(M.$$.fragment,S),E=!1},d(S){X(e,S),S&&k(l),X(n,S),S&&k(i),X(o,S),S&&k(r),X(a,S),S&&k(f),X(c,S),S&&k(p),X(_,S),S&&k(b),X(d,S),S&&k(v),X(g,S),S&&k(T),X(C,S),S&&k($),X(M,S)}}}function z0(t){let e,l,n,i;const o=[K0,V0],r=[];function a(f,c){return f[0].trying?0:1}return e=a(t),l=r[e]=o[e](t),{c(){l.c(),n=Ge()},m(f,c){r[e].m(f,c),w(f,n,c),i=!0},p(f,c){let p=e;e=a(f),e===p?r[e].p(f,c):(Ae(),D(r[p],1,1,()=>{r[p]=null}),De(),l=r[e],l?l.p(f,c):(l=r[e]=o[e](f),l.c()),N(l,1),l.m(n.parentNode,n))},i(f){i||(N(l),i=!0)},o(f){D(l),i=!1},d(f){r[e].d(f),f&&k(n)}}}function Y0(t){let e,l;return e=new Dt({props:{active:"true",message:"Device is upgrading, please wait"}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p:ne,i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function V0(t){let e,l;return e=new Dt({props:{active:"true",message:"Device is booting, please wait"}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p:ne,i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function K0(t){let e,l;return e=new Dt({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[0].trying}}),{c(){Z(e.$$.fragment)},m(n,i){Q(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.message="Device is booting, please wait. Trying to reach it on "+n[0].trying),e.$set(o)},i(n){l||(N(e.$$.fragment,n),l=!0)},o(n){D(e.$$.fragment,n),l=!1},d(n){X(e,n)}}}function Q0(t){let e,l,n,i,o,r;l=new wc({props:{$$slots:{default:[B0]},$$scope:{ctx:t}}});const a=[Y0,z0],f=[];function c(p,_){return p[0].upgrading?0:p[0].booting?1:-1}return~(i=c(t))&&(o=f[i]=a[i](t)),{c(){e=m("div"),Z(l.$$.fragment),n=h(),o&&o.c(),u(e,"class","container mx-auto m-3")},m(p,_){w(p,e,_),Q(l,e,null),s(e,n),~i&&f[i].m(e,null),r=!0},p(p,[_]){const b={};_&7&&(b.$$scope={dirty:_,ctx:p}),l.$set(b);let d=i;i=c(p),i===d?~i&&f[i].p(p,_):(o&&(Ae(),D(f[d],1,1,()=>{f[d]=null}),De()),~i?(o=f[i],o?o.p(p,_):(o=f[i]=a[i](p),o.c()),N(o,1),o.m(e,null)):o=null)},i(p){r||(N(l.$$.fragment,p),N(o),r=!0)},o(p){D(l.$$.fragment,p),D(o),r=!1},d(p){p&&k(e),X(l),~i&&f[i].d()}}}function X0(t,e,l){let n={};Ut.subscribe(o=>{l(0,n=o),n.vndcfg===!1?si("/vendor"):n.usrcfg===!1?si("/setup"):n.fwconsent===0&&si("/consent")}),bo();let i={};return dm.subscribe(o=>{l(1,i=o)}),[n,i]}class Z0 extends Me{constructor(e){super(),Se(this,e,X0,Q0,$e,{})}}new Z0({target:document.getElementById("app")});