import{r as j,u as g,j as s,F as c,k as B,a_ as k,by as E,h as P,bz as u,bA as v,bB as x,bC as C,bD as p}from"./index-a36IMXuN.js";import{s as w}from"./snakeCase-BMb4_GjJ.js";const L=j.memo(h=>{const{device:b,batteryPercent:r,batteryState:m,batteryLow:f,showLevel:d,...i}=h,{t:n}=g("zigbee");let t;switch(b?.power_source&&(t=b.power_source),t){case"Battery":{let a=n(y=>y.battery),l="",e=u,o=!1;if(r!=null)l=`${r}%`,r>=85?e=u:r>=65?e=v:r>=40?e=x:r>=20?e=C:(e=p,o=!0);else if(m!=null)switch(l=m,m){case"high":e=u;break;case"medium":e=x;break;case"low":e=p,o=!0;break}else f!=null&&(l=f?"low":"ok",e=f?p:u);return f===!0&&(o=!0),l!==""&&(a+=`, ${n(y=>y.power_level)}: ${l}`),s.jsxs("span",{className:o?"text-error":"",children:[s.jsx(c,{icon:e,fade:o,title:a,...i}),d&&s.jsx("span",{className:"ps-2",children:l})]})}case"Mains (single phase)":case"Mains (3 phase)":case"DC Source":return s.jsx(c,{icon:P,"aria-label":n(a=>a[w(t)]),...i});case"Emergency mains and transfer switch":case"Emergency mains constantly powered":return s.jsx(c,{icon:E,"aria-label":n(a=>a[w(t)]),...i});default:return b?.type==="GreenPower"?s.jsx(c,{icon:B,"aria-label":"Green",...i}):s.jsx(c,{icon:k,"aria-label":t?n(a=>a[w(t)]):void 0,...i})}});export{L as P};
