import{i as e}from"./chunk-aKtaBQYM.js";import{E as t,Ft as n,Nt as r,t as i,vt as a}from"./mui-BgU4WrXF.js";import{l as o,t as s,u as c}from"./IconButton-oialqkv3.js";import{t as l}from"./Container-fY8-hTkD.js";import{t as u}from"./Typography-7EcQ2i3p.js";import{t as d}from"./AppBar-BDMWinc3.js";import{t as f}from"./TableHead-DZPVxfXH.js";import{St as p,l as m,pt as h,s as g,st as _,vt as v,w as y,wt as b,xt as x,yt as S}from"./index-bel1r0Sr.js";import{t as C}from"./BackIcon-CSBDQ_HZ.js";var w=e(n(),1),T=a(),E=i()(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(),i=h(),a=m(i),{id:D}=c(),[O,k]=(0,w.useState)();_(async({signal:e})=>{if(D){let t=await(await y(`/api/positions?id=${D}`,{signal:e})).json();t.length>0&&k(t[0])}},[D]);let A=r(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)(S,{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)(b,{children:[(0,T.jsx)(f,{children:(0,T.jsxs)(v,{children:[(0,T.jsx)(x,{children:i(`stateName`)}),(0,T.jsx)(x,{children:i(`sharedName`)}),(0,T.jsx)(x,{children:i(`stateValue`)})]})}),(0,T.jsxs)(p,{children:[O&&Object.getOwnPropertyNames(O).filter(e=>e!==`attributes`).map(e=>(0,T.jsxs)(v,{children:[(0,T.jsx)(x,{children:e}),(0,T.jsx)(x,{children:(0,T.jsx)(`strong`,{children:a[e]?.name})}),(0,T.jsx)(x,{children:(0,T.jsx)(g,{position:O,property:e})})]},e)),O&&Object.getOwnPropertyNames(O.attributes).map(e=>(0,T.jsxs)(v,{children:[(0,T.jsx)(x,{children:e}),(0,T.jsx)(x,{children:(0,T.jsx)(`strong`,{children:a[e]?.name})}),(0,T.jsx)(x,{children:(0,T.jsx)(g,{position:O,attribute:e})})]},e))]})]})})})})]})};export{D as default};