"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[93187],{913242(e,t,o){o.r(t),o.d(t,{default:()=>ke});var i=o(274934),n=o(602086),s=o(977872),a=o(809036),l=o(724081),r=o(244081),c=o(247816),d=o(100978),u=o(309130);const m=(0,c.A)(d.A)`
  flex-direction: column;
  gap: ${u.Ln};
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: ${u.Ln};
`;var A=o(357159),T=o(263705),C=o(820633),h=o(239875);const M=(e,t)=>{const o=(0,n.useRef)(e);return t||(o.current=e),o.current};var S=o(927027),p=o(470070),g=o(897166),x=o(455425),E=o(570801),_=o(667927),I=o(882355),O=o(465103),L=o(488839),N=o(222102),R=o(656466),f=o(401042),P=o(720770),b=o(363332);const v=e=>(0,R.uh)((0,b.V)(e)),w=e=>(0,N.Mz)(v(e),f.RQ);var j=o(780089),D=o(991331),y=o(550871);const H=({index:e,colorIndex:t,timeSeriesData:o,maxY:s,yAxisMax:a,yAxisMin:l,mouseData:r,getCoordinates:c,chartHovered:d,tooltipRef:u,renderTooltip:m})=>{const A=(0,n.useCallback)(o=>m(o,e,t),[m,e,t]);return(0,i.jsx)(D.A,{data:o,maxY:s,mouseData:r,getCoordinates:c,interpolation:"curved",variant:"line",allowCustomDots:!0,yAxisMax:a,yAxisMin:l,tooltipPortal:u?.current||void 0,lineColor:(0,y.C)(t+1,(0,T.u)().themeName),showTooltip:d,renderTooltip:A})},F=(0,c.A)(d.A)`
  width: 100%;
  position: relative;
`;var k=o(706987),U=o(142667),W=o(938984);const Y=(0,c.A)(d.A)`
  flex-direction: column;
  gap: ${u.YC};
`,K=(0,c.A)(d.A)`
  justify-content: space-between;
  align-items: center;
  gap: ${u.Ln};
`,z=(0,c.A)(d.A)`
  align-items: center;
  gap: ${u.YC};
  white-space: nowrap;
`,$=(0,c.A)(d.A)`
  width: ${u.kc};
  height: ${u.kc};
`;var B,Z;!function(e){e.PKTS="pkts",e.NAME="name"}(B||(B={})),function(e){e.COLOR_INDEX="colorIndex",e.MULTICAST_GRAPH_HISTORY="multicastGraphHistory"}(Z||(Z={}));const G=({custom:e,theme:t,multicastPktsFormatCompact:o})=>(0,i.jsx)(Y,{children:Object.entries(e).sort(([e,{[B.PKTS]:t}],[o,{[B.PKTS]:i}])=>i-t).map(([e,{[B.NAME]:n,[B.PKTS]:s}])=>(0,i.jsxs)(K,{children:[(0,i.jsxs)(z,{children:[(0,i.jsx)($,{background:(0,y.C)(Number(e)+1,t)}),(0,i.jsx)(W.A,{style:{maxWidth:"200px"},color:"text-1",size:"small",isTruncated:!0,children:n})]}),(0,i.jsxs)(W.A,{color:"text-1",size:"small",children:[o.format(s)," ",(0,i.jsx)(p.sA,{id:"COMMON_UNIT_PKTS"})]})]},e))}),V=({tooltipProps:e,tooltipRenderCondition:t,top:o,left:n,chartWidth:s,chartHeight:a,hidden:l,index:r,theme:c,custom:d,multicastPktsFormatCompact:u})=>(0,i.jsx)(U.A,{width:300,topA:o,leftA:n,topB:e.top,leftB:e.left,chartWidth:s,chartHeight:a,hidden:l,description:(0,i.jsx)(G,{custom:d,theme:c,multicastPktsFormatCompact:u}),innerColor:(0,y.C)(r+1,c),tooltipRenderCondition:t,useFullHeightConnector:!0});var X=o(895728),q=o(693270),Q=o(214333),J=o(768167),ee=o(744724);const te=Object.values({[ee.b.TYPES]:({[J.Fg.MULTICAST_TYPE]:e},{[ee.b.TYPES]:t})=>!t.length||t.includes(e),[ee.b.NETWORKS]:({[J.Fg.NETWORKS]:e},{[ee.b.NETWORKS]:t})=>!t.length||e.some(({[J.xv.NETWORK_ID]:e})=>t.includes(e)),[ee.b.SWITCHES]:({[J.Fg.SW_MAC]:e},{[ee.b.SWITCHES]:t})=>!t.length||t.includes(e),[ee.b.ACCESS_POINTS]:({[J.Fg.AP_MAC]:e},{[ee.b.ACCESS_POINTS]:t})=>!t.length||t.includes(e),[ee.b.RADIOS]:({[J.Fg.RADIOS]:e},{[ee.b.RADIOS]:t})=>!t.length||e.some(e=>t.includes(e)),[ee.b.SERVICES]:({[J.Fg.SERVICES]:e},{[ee.b.SERVICES]:t})=>!t.length||e.some(({[J.Up.CODE]:e})=>t.includes(e)),[ee.b.WLANS]:({[J.Fg.WLANS]:e},{[ee.b.WLANS]:t})=>!t.length||e.some(({[J.Tz.WLAN_CONF_ID]:e})=>t.includes(e))}),oe=te.length,ie=e=>(0,N.Mz)((0,L.tH)(e),X.cY,(e,t)=>e.filter(e=>((e,t)=>{for(let o=0;o<oe;o+=1)if(!te[o](e,t))return!1;return!0})(e,t))),ne=(e,t)=>(0,N.Mz)((e=>(0,N.Mz)(ie(e),e=>e.map(({[J.Fg.MAC]:e})=>e)))(e),(e=>(0,N.Mz)((e=>(0,N.Mz)(v(e),f.i6))(e),({[O.eN.TIME_SERIES]:e=(0,P.A)()})=>e))(t),(e,t)=>{if(!t[0]?.[O.Cd.MAC])return t;const o=[];for(let i=0;i<t.length;i+=1){const n=t[i];e.includes(n[O.Cd.MAC])&&o.push(n)}return o}),se=()=>{const e=(0,n.useRef)({value:0,left:0,top:0}),{themeName:t}=(0,T.u)(),{formatMessage:o}=(0,p.tz)(),a=(0,n.useRef)(null),{ref:l,width:r=0}=(0,h.A)(),c=(0,s.d4)(C.zi),d=(0,s.d4)(E.BQ),u=(0,s.d4)(g.hq),m=(0,s.d4)(E.jc),{preset:N}=(0,s.d4)(X.eZ),R=(0,s.d4)(X.pF),f=(0,s.d4)(X.Rb),P=(0,s.d4)((0,n.useMemo)(()=>(0,L.tc)(f),[f])),b=(0,s.d4)((0,n.useMemo)(()=>w(R),[R])),v=P||b,D=(0,s.d4)((0,n.useMemo)(()=>ne(f,R),[f,R])),y=M(D,v),U=(0,s.d4)((0,n.useMemo)(()=>(0,L.a)(f),[f])),W=M(U,v),Y=(0,s.d4)(X.dw),K=M(Y,v),z=(0,n.useMemo)(()=>o({id:"COMMON_ALL_CLIENTS"}),[o]),{multicastGraphHistoryCollection:$,highestPkts:G}=(0,n.useMemo)(()=>{let e=0;const t=[],o=y.length;if(Object.keys(K).length>0){const i=new Map,n=new Map;for(let s=0;s<o;s+=1){const{[O.Cd.MAC]:o,[O.Cd.TOTAL_PKTS]:a,[O.Cd.TIMESTAMP]:l}=y[s];a>e&&(e=a);const r=K[o];let c=n.get(l);void 0===c&&(c={},n.set(l,c)),c[r]={[B.PKTS]:a,[B.NAME]:W[o]};let d=i.get(o);void 0===d&&(d=t.length,i.set(o,d),t.push({[Z.COLOR_INDEX]:r,[Z.MULTICAST_GRAPH_HISTORY]:[]})),t[d][Z.MULTICAST_GRAPH_HISTORY].push({x:l,y:a,custom:c})}}else if(o>0&&y.some(({[O.Cd.TOTAL_PKTS]:e})=>e>0)){const i=[],n=j.f.FIRST;for(let t=0;t<o;t+=1){const{[O.Cd.TOTAL_PKTS]:o,[O.Cd.TIMESTAMP]:s}=y[t];o>e&&(e=o),i.push({x:s,y:o,custom:{[n]:{[B.PKTS]:o,[B.NAME]:z}}})}t.push({[Z.COLOR_INDEX]:n,[Z.MULTICAST_GRAPH_HISTORY]:i})}return{multicastGraphHistoryCollection:t,highestPkts:e}},[y,K,W,z]),{[Q.s.COMPACT]:J}=(0,q.A)(),ee=(0,n.useMemo)(()=>({[_.d.ONE_DAY]:new Intl.DateTimeFormat(c,{timeZone:u,hourCycle:d,hour:"numeric",...m&&{minute:"numeric"}}),[_.d.THREE_DAYS]:new Intl.DateTimeFormat(c,{timeZone:u,hourCycle:d,day:"numeric",month:"short",hour:"numeric",minute:"numeric"}),[_.d.ONE_WEEK]:new Intl.DateTimeFormat(c,{timeZone:u,hourCycle:d,weekday:"short"}),[_.d.TWO_WEEKS]:new Intl.DateTimeFormat(c,{timeZone:u,hourCycle:d,day:"numeric",month:"short"}),[_.d.ONE_MONTH]:new Intl.DateTimeFormat(c,{timeZone:u,hourCycle:d}),[I.j]:new Intl.DateTimeFormat(c,{timeZone:u,hourCycle:d})}),[c,d,u,m]),te=(0,n.useMemo)(()=>(0,S.Y)(G>k.ZD?G+.1*G:k.ZD,k.H1,!0).map(({value:e},t)=>({value:e,label:0===t?o({id:"COMMON_UNIT_PKTS"}):t%2==0?J.format(Number(e)):void 0})),[G,o,J]),oe=(0,n.useMemo)(()=>(0,S.v)([y?.[0]?.[O.Cd.TIMESTAMP]||Date.now()-x.jU,y?.at(-1)?.[O.Cd.TIMESTAMP]||Date.now()],k._B).map((e,t,i)=>({value:e,label:i.length-1===t?o({id:"COMMON_NOW"}):t%4==0?ee[N].format(e):void 0})),[ee,N,o,y]),ie=(0,n.useCallback)(({top:o,left:n,y:s,hidden:a,custom:l={}},c,d)=>{const u=0===c;return u&&(e.current={value:s,left:n,top:o}),(0,i.jsx)(V,{top:o,left:n,chartWidth:r,chartHeight:k.K3,hidden:a,index:d,theme:t,tooltipProps:e.current,tooltipRenderCondition:u,custom:l,multicastPktsFormatCompact:J})},[r,t,J]),se=(0,n.useCallback)((e,t,o,s,l,r,c,d,u,m)=>(0,i.jsx)(n.Fragment,{children:$.map(({[Z.COLOR_INDEX]:n,[Z.MULTICAST_GRAPH_HISTORY]:s},l)=>(0,i.jsx)(H,{index:l,colorIndex:n,timeSeriesData:s,maxY:o,yAxisMax:r,yAxisMin:c,mouseData:t,getCoordinates:e,tooltipRef:a,chartHovered:m,renderTooltip:ie},n))}),[$,ie]);return(0,i.jsxs)(F,{ref:l,children:[(0,i.jsx)(A.A,{yAxis:te,xAxis:oe,width:r,height:k.K3,margin:k.Su,children:se}),(0,i.jsx)("div",{ref:a})]})};var ae=o(656705),le=o(722837),re=o(591917),ce=o(332530),de=o(54013),ue=o(94411),me=o(449339),Ae=o(797888),Te=o(360088),Ce=o(205521),he=o(800892);const Me=e=>e,Se=({header:{id:e}})=>he.yC[e](e),pe=e=>he.h[e],ge=e=>he.VL[e],xe=({column:{id:e},getValue:t})=>he.$3[e](t()),Ee=he.$v.map(e=>({id:e,accessorFn:Me,header:Se,cell:xe,...pe(e),enableResizing:!0,enableSorting:!0,sortingFn:ge(e)}));var _e=o(883122);const Ie="MULTICAST_TABLE_WRAPPER_CLASSNAME",Oe="MULTICAST_TABLE_HEADER_CLASSNAME",Le="MULTICAST_TABLE_ROW_CLASSNAME",Ne={columns:Ee,wrapperClassName:Ie,headerClassName:Oe,rowClassName:Le,stickyHeader:!0,multiSelectMode:!0,maximumSelections:_e.qY},Re=(0,c.A)(d.A)`
  width: 100%;
  height: 100%;
  overflow: auto;
  flex-direction: column;
  position: relative;
  .${Ie} {
    width: 100%;
  }
  .${Oe} {
    > tr {
      > th {
        height: 24px !important;
        > div {
          height: 24px !important;
        }
        padding: 0 ${u.kc};
      }
    }
  }
  .${Le} {
    height: 24px !important;
    > td {
      padding: 0 ${u.kc};
      > div {
        display: flex;
        white-space: pre-line;
      }
    }
  }
`;var fe=o(768737),Pe=o(954702),be=o(686222),ve=o(227170),we=o(158402),je=o(718195);const De=({multicastClientsLoading:e,multicastHasColumns:t})=>{const o=(0,s.wA)(),a=(0,n.useCallback)(()=>{o((0,je.A)()),o((0,we.yT)(le.l.MULTICAST,{initialColumns:ce.W2[de.xz.TABLES][le.l.MULTICAST]?.initialColumns||[],columnSize:Object.entries(he.h).reduce((e,[t,{size:o=0}])=>(e[t]=o,e),{})}))},[o]);return e?(0,i.jsx)(be.A,{position:"relative",left:`-${u.Tj}`}):(0,i.jsx)(ve.A,t?{title:(0,i.jsx)(p.sA,{id:"MULTICAST_TABLE_EMPTY_HEADER"}),description:(0,i.jsx)(p.sA,{id:"MULTICAST_TABLE_EMPTY_NO_MULTICAST_DETAILS"})}:{title:(0,i.jsx)(p.sA,{id:"COMMON_NO_MATCH"}),description:(0,i.jsx)(p.sA,{id:"MULTICAST_TABLE_EMPTY_COLUMNS_DETAILS",values:{button:(0,i.jsx)(Pe.A,{type:"button",onClick:a,children:(0,i.jsx)(p.sA,{id:"COMMON_RESET_THEM_BUTTON_TEXT"})})}})})},ye=()=>{const e=(0,s.wA)(),t=(0,s.d4)(X.x3),o=(0,s.d4)(X.dw),a=(0,s.d4)(X.Rb),l=(0,s.d4)(X.pF),c=(0,s.d4)((0,n.useMemo)(()=>(0,L.tc)(a),[a])),d=(0,s.d4)((0,n.useMemo)(()=>w(l),[l])),u=c||d,m=(0,s.d4)((0,n.useMemo)(()=>ie(a),[a])),A=M(m,u),T=(0,n.useCallback)(t=>{e((0,fe.d3)(t.map(e=>String(e))))},[e]),C=(0,n.useCallback)(t=>{e((0,Ce.XP)({type:me.H.MULTICAST,id:t}))},[e]),h=(0,n.useCallback)(({[J.Fg.MAC]:t})=>{C(t),e((0,Te.S)(t,void 0,{crudCacheStrategy:{type:r.e.CACHE}})).then(()=>{C(t)})},[e,C]),S=(0,n.useCallback)(({[J.Fg.MAC]:e})=>e,[]),[p,g]=(0,re.A)(le.l.MULTICAST),{initialColumns:x=[]}=(0,ue.A)(le.l.MULTICAST),E=(0,n.useMemo)(()=>(ce.W2[de.xz.TABLES][le.l.MULTICAST]?.columns||[]).reduce((e,t)=>(e[t]=x.includes(t),e),{}),[x]),_=(0,n.useMemo)(()=>Object.values(E).some(Boolean),[E]),I=(0,Ae.A)([me.H.MULTICAST]),O=(0,n.useMemo)(()=>Object.keys(o),[o]);return(0,n.useEffect)(()=>{t&&(e((0,fe.d3)([...A].slice(0,_e.UU).map(({[J.Fg.MAC]:e})=>e))),e((0,fe.Xd)(!1)))},[e,t,A]),(0,i.jsx)(Re,{children:A.length&&_?(0,i.jsx)(ae.A,{data:A,getRowId:S,onChangeSelection:T,onRowClick:h,selection:O,initialColumnSize:p,onColumnSizingChange:g,columnVisibility:E,activeRows:I,...Ne}):(0,i.jsx)(De,{multicastClientsLoading:c,multicastHasColumns:_})})};var He=o(597438),Fe=o(5109);const ke=()=>{(()=>{const e=(0,s.wA)(),t=(0,s.d4)(X.dw),o=(0,s.d4)(X.Rb),i=(0,s.d4)((0,n.useMemo)(()=>(0,L.tH)(o),[o])),a=(0,s.d4)((0,n.useMemo)(()=>(0,L.tc)(o),[o]));(0,n.useEffect)(()=>{if(a)return;const o=Object.keys(t);if(0===o.length)return;const n=new Set(i.map(({[J.Fg.MAC]:e})=>e)),s=o.filter(e=>n.has(e));s.length!==o.length&&e((0,fe.d3)(s))},[e,i,a,t])})();const e=(0,s.d4)(X.Y1),{[Q.s.COMPACT]:t,[Q.s.STANDARD]:o}=(0,q.A)(),c=(0,s.d4)(X.Rb),d=(0,n.useMemo)(()=>({[Fe.t.MULTICAST_PKTS_COMPACT_FORMAT]:t,[Fe.t.MULTICAST_PKTS_STANDARD_FORMAT]:o}),[t,o]);return(0,l.A)([(0,a.r)(c,void 0,{crudCacheStrategy:{type:r.e.CACHE}})],(0,i.jsx)(He.A.Provider,{value:d,children:(0,i.jsxs)(m,{children:[e?(0,i.jsx)(se,{}):null,(0,i.jsx)(ye,{})]})}))}},214333(e,t,o){var i;o.d(t,{s:()=>i}),function(e){e.COMPACT="compact",e.STANDARD="standard"}(i||(i={}))},693270(e,t,o){o.d(t,{A:()=>l});var i=o(602086),n=o(977872),s=o(820633),a=o(214333);const l=()=>{const e=(0,n.d4)(s.zi);return(0,i.useMemo)(()=>({[a.s.COMPACT]:new Intl.NumberFormat(e,{notation:"compact",compactDisplay:"short",maximumFractionDigits:1}),[a.s.STANDARD]:new Intl.NumberFormat(e,{notation:"standard"})}),[e])}}}]);