import{i as e}from"./chunk-aKtaBQYM.js";import{Ft as t,L as n,Mt as r,Nt as i,d as a,t as o,vt as s}from"./mui-BgU4WrXF.js";import{l as c,t as l}from"./IconButton-oialqkv3.js";import{n as u}from"./MenuItem-BNgF7Xqv.js";import{t as d}from"./TableHead-DZPVxfXH.js";import{St as f,Tt as p,pt as m,vt as h,wt as g,xt as _}from"./index-bel1r0Sr.js";import{t as v}from"./ReportsMenu-CwjT__h7.js";var y=e(t(),1),b=s(),x=n((0,b.jsx)(`path`,{d:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z`}),`CheckCircleOutlined`),S=n((0,b.jsx)(`path`,{d:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25`}),`HelpOutlined`),C=o()(e=>({columnAction:{width:`1%`,paddingLeft:e.spacing(1)}})),w=()=>{let{classes:e}=C(),t=c(),n=r(),o=m();(0,y.useEffect)(()=>(n(a.enableLogs(!0)),()=>n(a.enableLogs(!1))),[n]);let s=i(e=>e.session.logs),w=e=>{t(`/settings/device?${new URLSearchParams({uniqueId:e}).toString()}`)};return(0,b.jsx)(u,{menu:(0,b.jsx)(v,{}),breadcrumbs:[`reportTitle`,`sharedLogs`],children:(0,b.jsxs)(g,{children:[(0,b.jsx)(d,{children:(0,b.jsxs)(h,{children:[(0,b.jsx)(_,{className:e.columnAction}),(0,b.jsx)(_,{children:o(`deviceIdentifier`)}),(0,b.jsx)(_,{children:o(`positionProtocol`)}),(0,b.jsx)(_,{children:o(`commandData`)})]})}),(0,b.jsx)(f,{children:s.map((t,n)=>(0,b.jsxs)(h,{children:[(0,b.jsx)(_,{className:e.columnAction,padding:`none`,children:t.deviceId?(0,b.jsx)(l,{color:`success`,size:`small`,disabled:!0,children:(0,b.jsx)(x,{fontSize:`small`})}):(0,b.jsx)(p,{title:o(`loginRegister`),children:(0,b.jsx)(l,{color:`error`,size:`small`,onClick:()=>w(t.uniqueId),children:(0,b.jsx)(S,{fontSize:`small`})})})}),(0,b.jsx)(_,{children:t.uniqueId}),(0,b.jsx)(_,{children:t.protocol}),(0,b.jsx)(_,{children:t.data})]},n))})]})})};export{w as default};