import{_ as y,a as D,e as n,h as u,z as s,w as r,c as l,P as m,an as h,b as X,f,H as i,t as p,V as C,W as R,E as T,x as v}from"./index-DwzE-W2i.js";const N={props:{node:{type:[Object]},title:{type:[String]}},data(){return{hideNoDataStats:!1}},computed:{...D(v,["nodes"]),defaultColor(){return this.$vuetify.theme.current.colors.primary},total(){return this.nodes.reduce((t,o)=>{if(!o.statistics)return t;for(const e in t)t[e]+=o.statistics[e]||0;return t},{commandsTX:0,commandsRX:0,commandsDroppedTX:0,commandsDroppedRX:0})},stats(){return this.node.isControllerNode?{...this.node.statistics,commandsTX:this.total.commandsTX,commandsRX:this.total.commandsRX,commandsDroppedTX:this.total.commandsDroppedTX,commandsDroppedRX:this.total.commandsDroppedRX}:this.node.statistics},props(){const t={communication:{divider:!0,stats:{...this.createStat("CAN","CAN"),...this.createStat("NAK","NAK","error"),...this.createStat("timeoutACK","Timeout ACK","error"),...this.createStat("timeoutResponse","Timeout Response","error"),...this.createStat("timeoutCallback","Timeout Callback","error")},cols:6,statCols:4},[this.node.isControllerNode?"total Commands":"commands"]:{divider:this.node.isControllerNode,stats:{...this.createStat("commandsTX","TX"),...this.createStat("commandsRX","RX"),...this.createStat("commandsDroppedTX","Dropped TX","error"),...this.createStat("commandsDroppedRX","Dropped RX","error")},cols:3,statCols:6}};return this.node.isControllerNode&&(t.messages={divider:!1,stats:{...this.createStat("messagesTX","TX"),...this.createStat("messagesRX","RX"),...this.createStat("messagesDroppedTX","Dropped TX","error"),...this.createStat("messagesDroppedRX","Dropped RX","error")},cols:3,statCols:6}),t}},methods:{createStat(t,o,e=this.defaultColor){return{[`${t}`]:{title:o,value:this.stats[t],color:this.stats[t]?e:"grey"}}}}},k={class:"text-caption text-uppercase text-grey mb-2"},g={class:"text-caption"},x={class:"text-caption font-weight-bold"};function $(t,o,e,A,V,S){return e.node?(s(),n(C,{key:0,class:"pa-4"},{default:r(()=>[(s(!0),l(m,null,h(S.props,(a,d)=>(s(),l(m,{key:`section-content-${d}`},[X(f,{cols:"12",sm:a.cols},{default:r(()=>[i("div",null,[i("h1",k,p(d),1),X(C,{dense:""},{default:r(()=>[(s(!0),l(m,null,h(a.stats,(c,_)=>(s(),n(f,{class:"pa-1",key:`controller-stat-${_}`,cols:a.statCols,style:R({color:c.color})},{default:r(()=>[i("h2",g,p(c.title),1),i("div",x,p(c.value||"-"),1)]),_:2},1032,["cols","style"]))),128))]),_:2},1024)])]),_:2},1032,["sm"]),a.divider?(s(),n(T,{key:`section-divider-${d}`,vertical:t.$vuetify.display.smAndUp,class:"my-4"},null,8,["vertical"])):u("",!0)],64))),128))]),_:1})):u("",!0)}const B=y(N,[["render",$]]);export{B as default};
