import{d as at,c as et,a as k,f as Y,h as st,s as c}from"../chunks/DktbhmWA.js";import{p as q,f as rt,a as C,t as ot,a4 as nt,c as t,r as a,s as r,n as f,g as e,h as x}from"../chunks/CPWcrcMP.js";import{c as it,S as B,s as K,A as g,a as M}from"../chunks/CNDZS43m.js";import"../chunks/DyeZe3S9.js";import"../chunks/CvCfPjaJ.js";import"../chunks/1Qdbf8Yb.js";import"../chunks/DUxDMF0-.js";import{i as lt}from"../chunks/0jvM7PZf.js";import{p as ct}from"../chunks/DBypTyp2.js";import{A as dt}from"../chunks/CzZhYwF2.js";import{T as pt}from"../chunks/B-q2MrrX.js";import{U as vt}from"../chunks/CP_-kVfK.js";const mt=!1,kt=Object.freeze(Object.defineProperty({__proto__:null,prerender:mt},Symbol.toStringTag,{value:"Module"}));at(["click"]);function P(u,d){q(d,!0);let b=ct(d,"alarm",3,!0);var p=et(),_=rt(p);{var o=s=>{pt(s,{class:"w-16 h-16 mr-1 text-error"})};lt(_,s=>{dt.value&&b()&&s(o)})}k(u,p),C()}var ft=Y('<meta name="description" content="Varibits process UI"/>'),xt=Y('<div class="container mx-auto px-4"><a class="badge badge-lg badge-primary font-semibold"> </a> <a class="badge badge-lg badge-primary font-semibold"> </a>    <div class="flex items-center gap-2"></div>       <div class="grid gap-0 lg:gap-4 lg:grid-cols-2"><a class="card pt-3 shadow-sm" href="/devices"><div class="card bg-base-200 p-6 text-base-content"><div class="flex items-center justify-between gap-2"><div><h3 class="text-2xl font-semibold">Devices</h3> <p class="mt-2 flex items-baseline"><span> </span> <span class="ml-1 text-xl font-semibold">online</span></p> <p class="mt-4 text-sm text-gray-400">Each module can control up to two dampers.</p></div> <!></div></div></a> <a class="card pt-3 shadow-sm" href="/zones"><div class="card bg-base-200 p-6 text-base-content"><div class="flex items-center justify-between gap-2"><div><h3 class="text-2xl font-semibold">Zones</h3> <p class="mt-2 flex items-baseline"><span> </span> <span class="ml-1 text-xl font-semibold">OK</span></p> <p class="mt-4 text-sm text-gray-400">Each zone is usually one Air Handling Unit.</p></div> <!></div></div></a></div> <div class="flex flex-col items-center pt-3"><p class="text-sm font-bold">Software version: <span class="text-sm font-normal text-gray-400"> </span></p></div></div>');function zt(u,d){q(d,!0);const b=new it("$SYS/SoftwareVersion"),p=new B(["Devices/+/Health"]),_=new B(["Zones/+/Status"]);let o=x(()=>{const i=p.getData();let n=0,l=0;for(const[,U]of Object.entries(i))n++,U==="1"&&l++;return{total:n,online:l}}),s=x(()=>{const i=_.getData();let n=0,l=0;for(const[,U]of Object.entries(i))n++,U==="1"&&l++;return{total:n,status:l}});var h=xt();st(i=>{var n=ft();nt.title="Varibits",k(i,n)});var v=t(h),F=t(v);a(v);var m=r(v,2),G=t(m);a(m);var w=r(m,4),y=t(w),z=t(y),I=t(z),S=t(I),O=r(t(S),2),$=t(O),J=t($);a($),f(2),a(O),f(2),a(S);var L=r(S,2);const N=x(()=>e(o).total!==e(o).online);P(L,{get alarm(){return e(N)}}),a(I),a(z),a(y);var D=r(y,2),T=t(D),V=t(T),j=t(V),H=r(t(j),2),A=t(H),Q=t(A);a(A),f(2),a(H),f(2),a(j);var W=r(j,2);const X=x(()=>e(s).total!==e(s).status);P(W,{get alarm(){return e(X)}}),a(V),a(T),a(D),a(w);var E=r(w,2),R=t(E),Z=r(t(R)),tt=t(Z,!0);a(Z),a(R),a(E),a(h),ot(()=>{K(v,"href",`/users/${g.userId??""}`),c(F,`Username: ${g.username??""}`),K(m,"href",`/users/${g.userId??""}`),c(G,`Role: ${vt[g.roles]??""}`),M($,1,`text-5xl font-bold tracking-tight ${e(o).total!==e(o).online?"text-error":""}`),c(J,`${e(o).online??""}/${e(o).total??""}`),M(A,1,`text-5xl font-bold tracking-tight ${e(s).total!==e(s).status?"text-error":""}`),c(Q,`${e(s).status??""}/${e(s).total??""}`),c(tt,b.value)}),k(u,h),C()}export{zt as component,kt as universal};
