(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[58046,89965],{86571:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var a=n(296540),r=n(217439),i=n(699784);const o=({id:e,children:t,values:n})=>a.createElement(r.A,{color:"text-1",weight:"bold",size:"medium"},e?a.createElement(i.sA,{id:e,values:n}):null,t)},216211:(e,t,n)=>{"use strict";n.d(t,{e:()=>u});var a=n(956347),r=n(469733),i=n(296540),o=n(15095),l=n(627440),s=n(431247),d=n(293016),c=n(649413),m=n(497470);const u=()=>{const e=(0,r.useDispatch)(),t=(0,a.W6)(),n=(0,o.A)(`${l.VO.PORTS}`);return{handleGoToPortsPage:(0,i.useCallback)((a,r,i)=>{if(a)if(e((0,m.gU)(!0)),e((0,m.U)((0,c.HN)(d.F7.DEVICE,[a]))),i&&(e((0,m.IU)(!0)),e((0,m.E1)(!1))),r){const t=(0,s.FS)(a,r);e((0,m.Ao)([t]))}else e((0,m.Ao)([]));t.push(n)},[n,t,e])}}},566524:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>G});var a=n(469733),r=n(296540),i=n(979106),o=n(888170),l=n(943887),s=n(943805),d=n(566723),c=n(86571),m=n(294303),u=n(689965),g=n(699784),p=n(87250),E=n(656372),h=n(275357),A=n(540739),f=n(525901),b=n(847439),I=n(429252),x=n.n(I),T=n(93404),y=n.n(T),N=n(605977),S=n.n(N),M=n(966353),O=n.n(M),_=n(894713),k=n.n(_),L=n(633297),$=n(964238),R=n(927099),C=n(936344),U=n(71479),D=n(998837),v=n(132196),B=n(853699),Y=n(195462),w=n(212401),P=n(198494);const F=(0,U.A)(R.A,{shouldForwardProp:e=>"legendcolor"!==e})`
  display: block;
  position: relative;
  padding-left: 20px;
  margin-left: 15px;

  ::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 1px;
    width: 12px;
    border-bottom: 1px ${({legendcolor:e})=>`solid ${e}`};
  }

  :last-of-type {
    margin-right: 0;
  }
`,H=(0,b.A)(6,e=>({value:e,label:String(e)})).reverse(),V=({motifPalette:{text02:e}})=>v.AH`
  fill: ${e};
  font-size: 11px;
`,K=(0,D.b)((0,r.memo)(({mac:e,keys:t,heading:n,theme:i,colors:o,noLegend:l=!1,fetchReport:s,legend:d,reportType:c=p.qv.UBB})=>{const u=(0,a.useSelector)((0,r.useMemo)(()=>(0,w.dF)(e,s,c,t),[e,s,c,t])),E=(0,a.useSelector)(P.jc),{xAxis:h,startDate:A}=(0,r.useMemo)(()=>(e=>({xAxis:e,startDate:e[0].value}))(((e,t,n=6)=>new Array(n+1).fill(0).map((a,r)=>{return i=y()(e,24/n*(n-r)),{label:O()(i,t),value:i.getTime()};var i}))(S()(k()(Date.now(),1)).getTime(),E?"H:ss":"ha")),[E]),f=(0,r.useMemo)(()=>{const e={},n=(0,L.Hf)(u.filter(e=>e.time>A).map(e=>({...e,x:e.time})),B.UE.MINUTES.grain);return n[0]&&t[0]in n[0]&&n.forEach(n=>{t.forEach((t,a)=>{e[t]||(e[t]={key:t,lineColor:o[a],maxY:0,data:[]}),e[t].data.push({x:n.x,y:n[t]})})}),e},[o,u,t,A]),b=(0,r.useMemo)(()=>{return(e=Math.max(...t.map(e=>f[e]?f[e].data.map(e=>e.y||0):0).flat(),4))>5?(0,Y.Y)(e,6):H;var e},[f,t]);return r.createElement(r.Fragment,null,r.createElement(m.A,{justifyContent:"space-between",marginBottom:20},r.createElement(R.A,{size:"body",weight:"bold",color:"primary"},r.createElement(g.sA,{id:n})),l?null:r.createElement(m.A,{justifyContent:"flex-end"},r.createElement(m.A,null,d.map((e,t)=>r.createElement(F,{size:"body",legendcolor:o[t],key:e},r.createElement(g.sA,{id:e})))))),r.createElement(m.A,null,r.createElement(C.A,{xAxis:h,yAxis:b,width:336,height:150,margin:[0,0,20,35],labelClassName:V(i)},(e,n,a)=>r.createElement(r.Fragment,null,t.map(t=>f[t]&&f[t].data.length?r.createElement($.A,{key:f[t].key,data:f[t].data,maxY:a,mouseData:n,getCoordinates:e,variant:"gradientArea",lineColor:f[t].lineColor,dashed:!1,hideMissingData:!0}):null)))))},(e,t)=>e.mac===t.mac&&x()(e.keys,t.keys))),G=({activeItem:{mac:e,peer_ubb:t={},radio_table:n=[],model:b}})=>{const{formatMessage:I}=(0,g.tz)(),x=(0,a.useDispatch)(),T=(0,r.useMemo)(()=>(n||[]).map(({name:e,radio:t})=>({id:e,label:`${I({id:(0,l.dI)(t)})}`})),[n,I]),y=(0,r.useMemo)(()=>[{id:e,label:r.createElement(g.sA,{id:"COMMON_AP"})},{id:t.mac,label:r.createElement(g.sA,{id:"DEVICE_TYPE_UBB_STATION"})}],[e,t.mac]),[N,S]=(0,r.useState)(e),[M,O]=(0,r.useState)(n?.[0]?.name||s._),{droppedStatKeys:_,retriesStatKeys:k}=(0,r.useMemo)(()=>({retriesStatKeys:[`${M}-tx_retries`],droppedStatKeys:[`${M}-rx_dropped`,`${M}-tx_dropped`]}),[M]);(0,r.useEffect)(()=>{x((0,E.aN)(N,p.qv.UBB))},[x,N]),(0,r.useEffect)(()=>{x((0,E.jU)(N,p.qv.UBB,_)),x((0,E.lV)(N,p.qv.UBB,k))},[x,_,k,N]);const L=(0,r.useCallback)(({id:e})=>{S(e)},[S]),$=(0,r.useCallback)(({id:e})=>{O(e)},[O]),R=(0,r.useMemo)(()=>[{id:"statistics",openByDefault:!0,label:r.createElement(c.A,null,r.createElement(g.sA,{id:"DEVICE_PROPERTY_SYSTEM_STATISTICS"})),renderContent:()=>r.createElement(m.A,{flexDirection:"column",gap:d.Ln},r.createElement(m.A,{width:"fit-content"},r.createElement(i.A,{variant:"filter",tabs:y,onSelectTab:L})),r.createElement(K,{mac:N,keys:["cpu","mem"],colors:[o.Ay["orange-1"],o.Ay["blue-3"]],heading:"DEVICE_PROPERTIES_LABEL_USAGE_PERCENT",fetchReport:E.aN,legend:["COMMON_CPU","COMMON_MEMORY"]}),r.createElement(m.A,{width:"fit-content"},r.createElement(i.A,{variant:"filter",tabs:T,onSelectTab:$})),r.createElement(K,{mac:N,keys:_,colors:[o.Ay["purple-1"],o.Ay["purple-1"]],noLegend:!0,fetchReport:E.jU,heading:"DEVICE_PROPERTIES_LABEL_DROPPED"}),r.createElement(K,{mac:N,keys:k,colors:[o.Ay["purple-1"]],noLegend:!0,fetchReport:E.lV,heading:"DEVICE_PROPERTIES_LABEL_RETRIES"}))}],[T,_,k,N,y,L,$]);return r.createElement(r.Fragment,null,r.createElement(f.A,{mac:e,model:b,logType:A.F.DEVICE,label:"COMMON_HISTORY",ignoreActionableValues:[h.dl.DEVICE],hideClientTabs:!0}),r.createElement(u.A,{type:u.I.ACCORDION,items:R}))}},605977:(e,t,n)=>{var a=n(596221);e.exports=function(e){var t=a(e);return t.setMinutes(0,0,0),t}},689965:(e,t,n)=>{"use strict";n.d(t,{A:()=>g,I:()=>a});var a,r=n(296540),i=n(822336),o=n(427853),l=n(71479),s=n(825032),d=n(566723),c=n(294303);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(a||(a={}));const m=(0,l.A)(c.A,{shouldForwardProp:e=>!["marginBottom","isButtonList","margin","flex","width","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:n})=>n||(t?`0 ${e.spacing["spacing-l"]}`:e.spacing["spacing-l"])};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>i.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,u=(0,l.A)(o.A,{shouldForwardProp:e=>!["marginBottom","margin","flex","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,theme:{themeName:t}})=>e||i.Ay[t===s.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0 ${d.Ln} ${d.Ln};
      > div {
        padding: 0;
      }
    }
  }
`,g=({type:e,marginBottom:t,margin:n,padding:i,flex:o,width:l,nested:s,...d})=>"items"in d?r.createElement(u,{marginBottom:t,margin:n,padding:i,flex:o,nested:s,...d}):r.createElement(m,{nested:s,width:l,marginBottom:t,margin:n,padding:i,flex:o,isButtonList:e===a.BUTTON_LIST,...d},d.children)},853699:(e,t,n)=>{"use strict";n.d(t,{$V:()=>l,UE:()=>o,Vi:()=>s});var a=n(741494),r=n.n(a),i=n(874734);const o={NONE:{url:null,grain:null,grainInSeconds:null,translationKey:null},MINUTES:{url:i.FE.MINUTES,grain:3e5,grainInSeconds:300,translationKey:"GRANULARITY_5_MINUTES"},HOURLY:{url:i.FE.HOURLY,grain:36e5,grainInSeconds:3600,translationKey:"GRANULARITY_HOURLY"},DAILY:{url:i.FE.DAILY,grain:864e5,grainInSeconds:86400,translationKey:"GRANULARITY_DAILY"},MONTHLY:{url:i.FE.MONTHLY,grain:2592e6,grainInSeconds:2592e3,translationKey:"GRANULARITY_MONTHLY"}},l=(e,t,n,a)=>{const i=r()(t,e);return n&&(i<1||a&&i<=1)?o.MINUTES:i<=7?o.HOURLY:i<120?o.DAILY:o.MONTHLY},s=(e,t)=>{switch(e){case i.FE.DAILY:return`1${t({id:"COMMON_UNIT_D"})}`;case i.FE.HOURLY:return`1${t({id:"COMMON_UNIT_H"})}`;case i.FE.MINUTES:return`5${t({id:"COMMON_UNIT_MIN"})}`;default:return""}}}}]);