const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Bind-Dc9kHm7v.js","./index-DtyjNqrf.js","./envs-DFlyG_dH.js","./index-EwioJBcA.css","./DevicePicker-_CY2TskL.js","./SelectField-DfdnxD7O.js","./EndpointPicker-Bik90BnT.js","./Clusters-D9hrSHnT.js","./DevConsole-DVk6LYDZ.js","./InputField-CYbmpJqW.js","./ClusterSinglePicker-Ca3Cu42z.js","./TextareaField-Xo9B_w91.js","./DeviceInfo-736faFET.js","./capitalize-C89IAw35.js","./_createCompounder-CbLsIfEE.js","./snakeCase-DmoQhYQA.js","./DeviceControlEditName-CIF4s9nK.js","./CheckboxField-DKhAwA85.js","./Availability-t6lZj-iw.js","./DeviceImage-D-FjKeE6.js","./index-Q3KOJDn9.js","./DisplayValue-B5Rw3jLu.js","./LastSeen-CvhRQlEh.js","./format-6Yb6jWnA.js","./VendorLink-D24n6LN-.js","./PowerSource-DgFKG_xU.js","./DeviceSettings-CZqhT3Vo.js","./SettingsList-m7AYDAw4.js","./NumberField-DVRroIAm.js","./DeviceSpecificSettings-DIaLmFsZ.js","./Feature-VsMzzVJz.js","./Exposes-OHqD_-Hv.js","./Groups-CCx1QUBg.js","./Reporting-JJt-aW2u.js","./Scene-CvuDpnvP.js","./RecallRemove-C7or_UUw.js","./DashboardFeatureWrapper-CWbT-TyR.js","./State-DwJDwttn.js"])))=>i.map(i=>d[i]);
import{r as t,b as p,j as e,L as v,P as x,F as r,f as j,a as f,d as b,u as g,N as n,e as y,g as h,h as N,i as E,k as T,l as w,m as D,n as L,o as P,p as $,q as A,_ as l}from"./index-DtyjNqrf.js";import"./envs-DFlyG_dH.js";const I=t.memo(i=>{const{devices:u,currentDevice:a,tab:m="info"}=i,[d,s]=t.useState(""),{t:o}=p("common"),_=t.useMemo(()=>u.filter(c=>c.type!=="Coordinator"&&c.friendly_name.toLowerCase().includes(d.toLowerCase())&&c.ieee_address!==a?.ieee_address).map(c=>e.jsx("li",{children:e.jsx(v,{to:`/device/${c.ieee_address}/${m}`,onClick:()=>s(""),className:"dropdown-item",children:c.friendly_name})},c.ieee_address)),[u,a,d,m]);return e.jsxs(x,{name:"header-device-selector",buttonChildren:`${a?`${a.friendly_name} (${a.ieee_address})`:o("unknown_device")}`,dropdownStyle:"dropdown-start",children:[e.jsxs("label",{className:"input",children:[e.jsx(r,{icon:j}),e.jsx("input",{type:"search",placeholder:o("type_to_filter"),onChange:c=>s(c.target.value),value:d})]},"search"),_]})}),R=t.lazy(async()=>await l(()=>import("./Bind-Dc9kHm7v.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),C=t.lazy(async()=>await l(()=>import("./Clusters-D9hrSHnT.js"),__vite__mapDeps([7,1,2,3]),import.meta.url)),O=t.lazy(async()=>await l(()=>import("./DevConsole-DVk6LYDZ.js"),__vite__mapDeps([8,1,2,3,9,10,5,6,11]),import.meta.url)),S=t.lazy(async()=>await l(()=>import("./DeviceInfo-736faFET.js"),__vite__mapDeps([12,1,2,3,13,14,15,16,17,9,18,11,19,20,21,22,23,24,25]),import.meta.url)),z=t.lazy(async()=>await l(()=>import("./DeviceSettings-CZqhT3Vo.js"),__vite__mapDeps([26,1,2,3,27,17,9,28,5]),import.meta.url)),V=t.lazy(async()=>await l(()=>import("./DeviceSpecificSettings-DIaLmFsZ.js"),__vite__mapDeps([29,1,2,3,30,21,14,13]),import.meta.url)),k=t.lazy(async()=>await l(()=>import("./Exposes-OHqD_-Hv.js"),__vite__mapDeps([31,1,2,3,30,21,14,13]),import.meta.url)),M=t.lazy(async()=>await l(()=>import("./Groups-CCx1QUBg.js"),__vite__mapDeps([32,1,2,3,6,5]),import.meta.url)),F=t.lazy(async()=>await l(()=>import("./Reporting-JJt-aW2u.js"),__vite__mapDeps([33,1,2,3,9,10,5,6]),import.meta.url)),G=t.lazy(async()=>await l(()=>import("./Scene-CvuDpnvP.js"),__vite__mapDeps([34,1,2,3,35,36,30,21,14,13,9,5]),import.meta.url)),B=t.lazy(async()=>await l(()=>import("./State-DwJDwttn.js"),__vite__mapDeps([37,1,2,3]),import.meta.url));function H(){const{t:i}=p(["devicePage","common"]),u=f(c=>c.devices),{deviceId:a,tab:m}=b(),d=g(),s=a?u.find(c=>c.ieee_address===a):void 0;t.useEffect(()=>{s&&(m?s.type==="Coordinator"&&d("/settings/about",{replace:!0}):d(s.type==="Coordinator"?"/settings/about":`/device/${s.ieee_address}/info`,{replace:!0}))},[m,s,d]);const o=({isActive:c})=>c?"tab tab-active":"tab",_=t.useMemo(()=>{if(!s)return e.jsx("div",{className:"flex-auto justify-center items-center",children:i("common:unknown_device")});switch(m){case"info":return e.jsx(S,{device:s});case"exposes":return e.jsx(k,{device:s});case"bind":return e.jsx(R,{device:s});case"reporting":return e.jsx(F,{device:s});case"settings":return e.jsx(z,{device:s});case"settings-specific":return e.jsx(V,{device:s});case"state":return e.jsx(B,{device:s});case"clusters":return e.jsx(C,{device:s});case"groups":return e.jsx(M,{device:s});case"scene":return e.jsx(G,{device:s});case"dev-console":return e.jsx(O,{device:s})}},[s,m,i]);return e.jsxs(e.Fragment,{children:[e.jsx(I,{devices:u,currentDevice:s,tab:m}),e.jsxs("div",{className:"tabs tabs-border mt-2",children:[e.jsxs(n,{to:`/device/${a}/info`,className:o,children:[e.jsx(r,{icon:y,className:"me-2"}),i("about")]}),e.jsxs(n,{to:`/device/${a}/exposes`,className:o,children:[e.jsx(r,{icon:h,className:"me-2"}),i("exposes")]}),e.jsxs(n,{to:`/device/${a}/bind`,className:o,children:[e.jsx(r,{icon:N,className:"me-2"}),i("bind")]}),e.jsxs(n,{to:`/device/${a}/reporting`,className:o,children:[e.jsx(r,{icon:E,className:"me-2"}),i("reporting")]}),e.jsxs(n,{to:`/device/${a}/settings`,className:o,children:[e.jsx(r,{icon:T,className:"me-2"}),i("settings")]}),e.jsxs(n,{to:`/device/${a}/settings-specific`,className:o,children:[e.jsx(r,{icon:w,className:"me-2"}),i("settings_specific")]}),e.jsxs(n,{to:`/device/${a}/state`,className:o,children:[e.jsx(r,{icon:D,className:"me-2"}),i("state")]}),e.jsxs(n,{to:`/device/${a}/clusters`,className:o,children:[e.jsx(r,{icon:L,className:"me-2"}),i("clusters")]}),e.jsxs(n,{to:`/device/${a}/groups`,className:o,children:[e.jsx(r,{icon:P,className:"me-2"}),i("groups")]}),e.jsxs(n,{to:`/device/${a}/scene`,className:o,children:[e.jsx(r,{icon:$,className:"me-2"}),i("scene")]}),e.jsxs(n,{to:`/device/${a}/dev-console`,className:o,children:[e.jsx(r,{icon:A,className:"me-2"}),i("dev_console")]}),e.jsx("div",{className:"tab-content block h-full bg-base-100 p-3",children:_})]})]})}export{H as default};
