import{r as g,b as h,j as e,L as u,a as b}from"./index-vDL8KyrI.js";import{s as p}from"./snakeCase-B_0CeYWc.js";import"./_createCompounder-Bmfmbzn9.js";const k="1.0.2",j={version:k};function m({name:t,data:s}){const n=[],{t:d}=h("stats");for(const r in s){const i=s[r];n.push(e.jsx("li",{children:e.jsxs(u,{to:"#",children:[r,": ",i]})},r))}return e.jsx("li",{children:e.jsxs("details",{children:[e.jsx("summary",{children:d(t)}),e.jsx("ul",{children:n})]})})}const f=g.memo(t=>{const{devices:s}=t,{t:n}=h(["stats","zigbee"]),d=g.useMemo(()=>{const r={},i={},c={},l={};for(const a of s){if(a.type==="Coordinator")continue;const o=a.model_id||n("zigbee:unknown"),v=a.manufacturer||n("zigbee:unknown"),x=n(`zigbee:${p(a.power_source||"unknown")}`);r[n(a.type)]=(r[n(a.type)]||0)+1,i[x]=(i[x]||0)+1,c[o]=(c[o]||0)+1,l[v]=(l[v]||0)+1}return e.jsxs(e.Fragment,{children:[e.jsx(m,{name:"byType",data:r}),e.jsx(m,{name:"byPowerSource",data:i}),e.jsx(m,{name:"byModel",data:c}),e.jsx(m,{name:"byVendor",data:l})]})},[s,n]);return e.jsxs("ul",{children:[e.jsx("li",{children:e.jsxs(u,{to:"#",children:[n("total")," ",s.length-1]})}),d]})});function y(){const{t}=h("settings"),s=b(o=>o.bridgeInfo),n=b(o=>o.devices),r=s.version.match(/^\d+\.\d+\.\d+$/)===null?e.jsx("a",{className:"link link-hover text-secondary",target:"_blank",rel:"noopener noreferrer",href:"https://github.com/Koenkk/zigbee2mqtt/commits/dev/",children:s.version}):e.jsx("a",{className:"link link-hover",target:"_blank",rel:"noopener noreferrer",href:`https://github.com/Koenkk/zigbee2mqtt/releases/tag/${s.version}`,children:s.version}),i=s.commit?e.jsxs(e.Fragment,{children:["commit:"," ",e.jsx("a",{className:"link",target:"_blank",rel:"noopener noreferrer",href:`https://github.com/Koenkk/zigbee2mqtt/commit/${s.commit}`,children:s.commit})]}):null,c=e.jsx("a",{className:"link link-hover",target:"_blank",rel:"noopener noreferrer",href:`https://github.com/Nerivec/zigbee2mqtt-windfront/releases/tag/${j.version}`,children:j.version}),l=e.jsx("a",{className:"link link-hover",target:"_blank",rel:"noopener noreferrer",href:`https://github.com/Koenkk/zigbee-herdsman-converters/releases/tag/v${s.zigbee_herdsman_converters.version}`,children:s.zigbee_herdsman_converters.version}),a=e.jsx("a",{className:"link link-hover",target:"_blank",rel:"noopener noreferrer",href:`https://github.com/Koenkk/zigbee-herdsman/releases/tag/v${s.zigbee_herdsman.version}`,children:s.zigbee_herdsman.version});return e.jsxs("div",{className:"flex flex-col gap-3 items-center",children:[e.jsxs("div",{className:"stats stats-vertical lg:stats-horizontal shadow",children:[e.jsxs("div",{className:"stat place-items-center",children:[e.jsx("div",{className:"stat-title",children:t("zigbee2mqtt_version")}),e.jsx("div",{className:"stat-value",children:r}),e.jsx("div",{className:"stat-desc",children:i})]}),e.jsxs("div",{className:"stat place-items-center",children:[e.jsx("div",{className:"stat-title",children:t("frontend_version")}),e.jsx("div",{className:"stat-value",children:c})]}),e.jsxs("div",{className:"stat place-items-center",children:[e.jsx("div",{className:"stat-title",children:t("zigbee_herdsman_converters_version")}),e.jsx("div",{className:"stat-value",children:l})]}),e.jsxs("div",{className:"stat place-items-center",children:[e.jsx("div",{className:"stat-title",children:t("zigbee_herdsman_version")}),e.jsx("div",{className:"stat-value",children:a})]})]}),e.jsx("div",{className:"stats stats-vertical lg:stats-horizontal shadow",children:e.jsxs("div",{className:"stat place-items-center",children:[e.jsx("div",{className:"stat-title",children:t("coordinator")}),e.jsx("div",{className:"stat-value",children:s.coordinator.type}),e.jsxs("div",{className:"stat-desc flex flex-col gap-2 items-center",children:[e.jsx("span",{className:"badge badge-primary",title:t("coordinator_ieee_address"),children:s.coordinator.ieee_address}),e.jsxs("span",{children:[t("revision"),": ",s.coordinator.meta.revision||t("zigbee:unknown")]})]})]})}),e.jsx("ul",{className:"menu bg-base-100 rounded-box shadow min-w-sm",children:e.jsx("li",{children:e.jsxs("details",{open:!0,children:[e.jsx("summary",{children:t("stats")}),e.jsx(f,{devices:n})]})})})]})}export{y as default};
