import{i as e}from"./chunk-aKtaBQYM.js";import{O as t,Vt as n,t as r,wt as i,zt as a}from"./mui-B6lh3XSP.js";import{l as o,t as s,u as c}from"./IconButton-BEBOUWhl.js";import{t as l}from"./Container-CHg71Wor.js";import{t as u}from"./Typography-DfQXhGTT.js";import{t as d}from"./AppBar-DnD8yI_W.js";import{t as f}from"./TableHead-_KJlbpnj.js";import{At as p,Dt as m,Ot as h,Tt as g,l as _,pt as v,s as y,w as b,wt as x,yt as S}from"./index-KVuxnkWj.js";import{t as C}from"./BackIcon-BjuxlqVJ.js";var w=e(n(),1),T=i(),E=r()(e=>({root:{height:`100%`,display:`flex`,flexDirection:`column`},content:{overflow:`auto`,paddingTop:e.spacing(2),paddingBottom:e.spacing(2)}})),D=()=>{let{classes:e}=E(),n=o(),r=S(),i=_(r),{id:D}=c(),[O,k]=(0,w.useState)();v(async({signal:e})=>{if(D){let t=await(await b(`/api/positions?id=${D}`,{signal:e})).json();t.length>0&&k(t[0])}},[D]);let A=a(e=>{if(O){let t=e.devices.items[O.deviceId];if(t)return t.name}return null});return(0,T.jsxs)(`div`,{className:e.root,children:[(0,T.jsx)(d,{position:`sticky`,color:`inherit`,children:(0,T.jsxs)(g,{children:[(0,T.jsx)(s,{color:`inherit`,edge:`start`,sx:{mr:2},onClick:()=>n(-1),children:(0,T.jsx)(C,{})}),(0,T.jsx)(u,{variant:`h6`,children:A})]})}),(0,T.jsx)(`div`,{className:e.content,children:(0,T.jsx)(l,{maxWidth:`sm`,children:(0,T.jsx)(t,{children:(0,T.jsxs)(p,{children:[(0,T.jsx)(f,{children:(0,T.jsxs)(x,{children:[(0,T.jsx)(m,{children:r(`stateName`)}),(0,T.jsx)(m,{children:r(`sharedName`)}),(0,T.jsx)(m,{children:r(`stateValue`)})]})}),(0,T.jsxs)(h,{children:[O&&Object.getOwnPropertyNames(O).filter(e=>e!==`attributes`).map(e=>(0,T.jsxs)(x,{children:[(0,T.jsx)(m,{children:e}),(0,T.jsx)(m,{children:(0,T.jsx)(`strong`,{children:i[e]?.name})}),(0,T.jsx)(m,{children:(0,T.jsx)(y,{position:O,property:e})})]},e)),O&&Object.getOwnPropertyNames(O.attributes).map(e=>(0,T.jsxs)(x,{children:[(0,T.jsx)(m,{children:e}),(0,T.jsx)(m,{children:(0,T.jsx)(`strong`,{children:i[e]?.name})}),(0,T.jsx)(m,{children:(0,T.jsx)(y,{position:O,attribute:e})})]},e))]})]})})})})]})};export{D as default};