"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[88788],{564328:(e,t,a)=>{a.d(t,{Fw:()=>i,Ql:()=>r,pN:()=>l,vB:()=>n});const r="createSimpleAppBlock",l="mac",i="appId",n="simpleAppBlockId"},632017:(e,t,a)=>{a.d(t,{P:()=>o});var r=a(572112),l=a(546391),i=a(584916);const n=e=>e>=r.A.XXL.TO?25:e>=r.A.L.TO?13:e>=r.A.M.TO?7:4,o={[i.l.ONE_HOUR]:{frequency:n,label:({index:e,value:t,selfHourCycle:a,documentWidth:r,formatMessage:l,siteTimezone:i,language:o})=>e!==n(r)-1?new Intl.DateTimeFormat(o,{hourCycle:a,hour:"numeric",timeZone:i,minute:"numeric"}).format(t):l({id:"COMMON_NOW"})},[i.l.ONE_DAY]:{frequency:n,label:({index:e,value:t,use24HourTime:a,selfHourCycle:r,siteTimezone:l,language:i,documentWidth:o,formatMessage:c})=>e!==n(o)-1?new Intl.DateTimeFormat(i,{hourCycle:r,hour:"numeric",minute:"numeric",timeZone:l,...a&&{minute:"numeric"}}).format(t).toUpperCase():c({id:"COMMON_NOW"})},[i.l.ONE_WEEK]:{frequency:()=>7,label:({value:e,language:t})=>new Intl.DateTimeFormat(t,{weekday:"short"}).format(e)},[i.l.ONE_MONTH]:{frequency:(e,t)=>Math.ceil(t/(e>=r.A.XXL.TO?1:e>=r.A.M.TO?2:4)),label:({value:e,language:t})=>new Intl.DateTimeFormat(t,{month:"short",day:"numeric"}).format(e)},[i.l.TWELVE_HOURS]:{frequency:()=>12,label:({value:e,selfHourCycle:t,siteTimezone:a,language:r})=>new Intl.DateTimeFormat(r,{hourCycle:t,hour:"numeric",timeZone:a}).format(e)},[i.l.SIX_HOURS]:{frequency:()=>6,label:({value:e,selfHourCycle:t,siteTimezone:a,language:r})=>new Intl.DateTimeFormat(r,{hourCycle:t,hour:"numeric",timeZone:a}).format(e)},[i.l.THIRTY_MINUTES]:{frequency:()=>6,label:({value:e,selfHourCycle:t,siteTimezone:a,language:r})=>new Intl.DateTimeFormat(r,{hourCycle:t,hour:"numeric",minute:"numeric",timeZone:a}).format(e)},[i.j]:{frequency:()=>10,label:({value:e,selfHourCycle:t,siteTimezone:a,language:r})=>new Intl.DateTimeFormat(r,{hourCycle:t,timeZone:a,month:"short",day:"numeric",hour:"numeric",minute:"numeric"}).format(e).replace(l.sO,e=>e.toUpperCase())}}},638334:(e,t,a)=>{a.d(t,{I:()=>i,w:()=>l});var r=a(945132);const l=(e,t)=>Math.floor(Math.abs(new Date(t).getTime()-new Date(e).getTime())/r.jU),i=(e,t)=>Math.floor(Math.abs(t-e)/r.jU)},663591:(e,t,a)=>{a.d(t,{A:()=>p});var r=a(469733),l=a(296540),i=a(758649),n=a(928085),o=a(566723),c=a(294303),m=a(699784),s=a(564328),A=a(767974),u=a(792072),d=a(959341),T=a(196010),E=a(966376);const p=(0,l.memo)(({dpiAppId:e,mac:t})=>{const a=(0,r.useSelector)(u.JP),p=(0,n.A)(d.bB),C=(0,n.A)(d.tz),h=(0,l.useMemo)(()=>{if(a){const a=new URLSearchParams;return a.set(s.Ql,"true"),t&&a.set(s.pN,t),e&&a.set(s.Fw,e.toString()),{pathname:`${p}/${d.Uy.CYBERSECURE}`,search:a.toString()}}return{pathname:`${C}/${E.D.TRAFFIC_RULES}/${d.fW}/${d.R6}`,state:{[A.U3.APP_ID]:e.toString(),[A.U3.CLIENT]:t}}},[e,a,t,p,C]);return l.createElement(c.A,{justifyContent:"flex-end",paddingRight:o.xO},l.createElement(i.A,{component:T.A,to:h,variant:"inline",color:"danger"},l.createElement(m.sA,{id:"COMMON_ACTION_BLOCK_APP"})))})},824443:(e,t,a)=>{a.r(t),a.d(t,{default:()=>Dt});var r=a(340936),l=a(469733),i=a(296540),n=a(592510),o=a(874807);const c=(e=o.P1,t=o.P1)=>((0,i.useEffect)(()=>(e(),t),[]),null);var m,s,A=a(582724),u=a(670180),d=a(792542),T=a(947027),E=a(89716),p=a(987309),C=a(177846),h=a(71479),O=a(566723),I=a(294303);!function(e){e.CLIENT="client",e.TOTAL_TRAFFIC="total_bytes",e.DOWNLOAD="bytes_received",e.UPLOAD="bytes_transmitted",e.EMPTY_SPACE="isSummary",e.TIME_ESTIMATE="timeEstimate",e.TOP_APPS="topApps",e.APP_COUNT="appCount"}(m||(m={})),function(e){e.APPLICATION="name",e.TOTAL_TRAFFIC="total_bytes",e.DOWNLOAD="bytes_received",e.UPLOAD="bytes_transmitted",e.EMPTY_SPACE="isSummary",e.TIME_ESTIMATE="timeEstimate",e.TOP_CLIENT="topClient",e.CLIENT_COUNT="clientCount"}(s||(s={}));const y="summaryId",_=[s.APPLICATION,s.TOTAL_TRAFFIC,s.DOWNLOAD,s.UPLOAD,s.TOP_CLIENT,s.CLIENT_COUNT],f=[s.APPLICATION,s.TOTAL_TRAFFIC,s.DOWNLOAD,s.UPLOAD,s.EMPTY_SPACE,s.TIME_ESTIMATE],M=[m.CLIENT,m.TOTAL_TRAFFIC,m.DOWNLOAD,m.UPLOAD,m.TOP_APPS,m.APP_COUNT],P=[m.CLIENT,m.TOTAL_TRAFFIC,m.DOWNLOAD,m.UPLOAD,m.EMPTY_SPACE,m.TIME_ESTIMATE],g={[s.APPLICATION]:90,[s.TOTAL_TRAFFIC]:65,[s.DOWNLOAD]:45,[s.UPLOAD]:45,[s.EMPTY_SPACE]:80,[s.TIME_ESTIMATE]:40,[s.TOP_CLIENT]:80,[s.CLIENT_COUNT]:40},L={[m.CLIENT]:90,[m.TOTAL_TRAFFIC]:65,[m.DOWNLOAD]:45,[m.UPLOAD]:45,[m.EMPTY_SPACE]:80,[m.TIME_ESTIMATE]:40,[m.TOP_APPS]:80,[m.APP_COUNT]:40},N="ACTIVITY_TRAFFIC_TABLE_PLACEHOLDER_CLASSNAME",S=(0,h.A)(I.A)`
  flex-direction: column;
  overflow: auto;
  scrollbar-width: none;
  padding: 0 ${O.Ln};
  width: 100%;
  height: 100%;
  > div:first-child {
    width: 100%;
    height: 90%;
    > div:last-child {
      width: 100%;
      justify-content: center;
    }
  }
  th {
    svg {
      width: 16px;
      height: 16px;
    }
  }
  .${N} {
    width: 100%;
    height: 100%;
    justify-content: center;
  }
`;var D=a(120205),v=a(895795),b=a(199582),F=a(668995),w=a(416348);(0,h.A)(v.A)`
  color: ${({theme:{motifPalette:{neutral08:e}}})=>e};
`;const x=(0,h.A)(I.A,{shouldForwardProp:e=>!["activityTab","activityGraphApp","activityGraphClient"].includes(e)})`
  ${({activityTab:e,activityGraphApp:t,activityGraphClient:a,theme:{motifPalette:{neutral02:r}}})=>`[${b.L}="${((e,{cat:t,app:a},r)=>{switch(e){case D.f.CLIENTS:return t!==w.ZM&&a!==w.Je?String((0,F.h)(t,a)):y;case D.f.APPS:return r&&r!==w.Y$?r:y;default:return y}})(e,t,a)}"]{ background-color: ${r}; }`}}
`;var U=a(963070),R=a(523275),W=a(840279),z=a(699784),Y=a(217439),H=a(903216),B=a(75354),$=a(438369),G=a(670);const V=(0,i.memo)(({isSummary:e,total_bytes:t,traffic_percentage:a})=>{const r=(0,i.useMemo)(()=>{let t;if(!e){const e=a.toFixed(1);t=a>0?"0.0"===e?"<0.1":e:"0.0"}return t?` (${t}%)`:null},[e,a]);return i.createElement(Y.A,{color:"text-2",size:"medium"},(0,H.FI)(t),r)});var k=a(396660),j=a(934645);const q=e=>(t,a,r,l,i)=>(0,k.l0)(t=>t.isSummary?(0,j.K)(!i):(t=>{switch(e){case s.TOP_CLIENT:return"topClientTotalBytes"in t?t.topClientTotalBytes:t;case m.TOP_APPS:return Array.isArray(t)?t.length:t;default:return t}})(t[e]))(t,a,r,l,i),Z={[m.CLIENT]:"COMMON_CLIENT",[m.TOTAL_TRAFFIC]:"ACTIVITY_DATA_TRAFFIC",[m.DOWNLOAD]:"COMMON_DOWNLOAD",[m.UPLOAD]:"COMMON_UPLOAD",[m.EMPTY_SPACE]:void 0,[m.TIME_ESTIMATE]:"ACTIVITY_TIME_ESTIMATE",[m.TOP_APPS]:"COMMON_TOP_APPS",[m.APP_COUNT]:"COMMON_APPS"};var X=a(518689),K=a(601242),J=a(455155),Q=a(271856);const ee=(0,h.A)(I.A)`
  align-items: center;
  width: 25px;
  height: 25px;
`,te=(0,h.A)(Q.A)`
  display: flex;
  align-items: center;
`,ae=24,re=({topApps:e})=>i.createElement(I.A,{gap:O.kc},e.map(({isSummary:e,totalBytes:t,topAppTotalBytes:a,topAppBytesReceived:r,topAppBytesTransmitted:l,timeEstimate:n,topApp:{category:o,application:c}})=>(o=>(({name:c,iconFileName:m})=>{return i.createElement(ee,{key:o},i.createElement(te,{description:i.createElement(I.A,{flexDirection:"column",gap:O.YC,minWidth:200},i.createElement(I.A,{position:"relative",right:O.YC,alignItems:"center",gap:O.YC},i.createElement(J.A,{iconFileName:m,dimension:ae}),i.createElement(Y.A,{size:"small",color:"text-1",weight:"bold"},c)),i.createElement(I.A,{justifyContent:"space-between"},i.createElement(Y.A,{size:"small",color:"text-1"},i.createElement(z.sA,{id:"COMMON_TRAFFIC"})),i.createElement(Y.A,{size:"small",color:"text-2"},`${(0,H.FI)(t-(t-a))} (${s=(0,X.i)(a/t*100),String(0===s?"<0.1":s)}%)`)),i.createElement(I.A,{justifyContent:"space-between"},i.createElement(Y.A,{size:"small",color:"text-1"},i.createElement(z.sA,{id:"COMMON_DOWNLOAD"})),i.createElement(Y.A,{size:"small",color:"traffic-down"},(0,H.FI)(r))),i.createElement(I.A,{justifyContent:"space-between"},i.createElement(Y.A,{size:"small",color:"text-1"},i.createElement(z.sA,{id:"COMMON_UPLOAD"})),i.createElement(Y.A,{size:"small",color:"traffic-up"},(0,H.FI)(l))),e?null:i.createElement(I.A,{justifyContent:"space-between"},i.createElement(Y.A,{size:"small",color:"text-1"},i.createElement(z.sA,{id:"ACTIVITY_TIME_ESTIMATE"})),i.createElement(Y.A,{size:"small",color:"text-2"},i.createElement(B.A,{uptime:n})))),portal:!0,delay:0,cursorType:"pointer"},i.createElement(J.A,{iconFileName:m,dimension:ae})));var s})((0,K.HH)(o)))((0,F.h)(o,c))));var le=a(398300),ie=a(703447),ne=a(845030),oe=a(705145),ce=a(411502),me=a(956347),se=a(162420),Ae=a(15095),ue=a(627440),de=a(277517),Te=a(758649);const Ee=({onClick:e})=>i.createElement(z.sA,{id:"ACTIVITY_VIEW_ENCRYPTED_TOOLTIP",values:{button:i.createElement(Te.A,{type:"button",variant:"inline",onClick:e},i.createElement(z.sA,{id:"COMMON_FLOWS"}))}}),pe={open:0,close:200},Ce=(0,i.memo)(()=>{const e=(0,me.W6)(),t=(0,l.useSelector)(de.YX),a=(0,Ae.A)(`${ue.VO.INSIGHTS}/${u.H.FLOWS}`),r=(0,i.useCallback)(t=>{t.stopPropagation(),e.push(a)},[e,a]);return t?i.createElement(Q.A,{description:i.createElement(Ee,{onClick:r}),portal:!0,delay:pe,isInteractive:!0,cursorType:"pointer"},i.createElement(se.A,{isActive:!0,size:"original"})):null}),he=(0,i.memo)(()=>i.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.createElement("g",{clipPath:"url(#clip0_874_261811)"},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.96036 14.417L11.5726 18.2407C11.815 18.4059 12.1334 18.4075 12.3774 18.2448L18.1191 14.417L19.0205 15.0179C19.4479 15.3029 19.4479 15.9311 19.0205 16.2161L12.3774 20.6448C12.1334 20.8075 11.815 20.8059 11.5726 20.6407L5.07241 16.212C4.65295 15.9262 4.65295 15.3078 5.07241 15.022L5.96036 14.417Z",fill:"#A252E3"}),i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.96036 10.8174L11.5726 14.6411C11.815 14.8063 12.1334 14.8079 12.3774 14.6452L18.1191 10.8174L19.0205 11.4183C19.4479 11.7033 19.4479 12.3315 19.0205 12.6165L12.3774 17.0452C12.1334 17.2079 11.815 17.2063 11.5726 17.0411L5.07241 12.6124C4.65295 12.3266 4.65295 11.7082 5.07241 11.4224L5.96036 10.8174Z",fill:"#46C7FD"}),i.createElement("path",{d:"M11.5726 3.39353L5.07241 7.82224C4.65295 8.10803 4.65295 8.72649 5.07241 9.01228L11.5726 13.441C11.815 13.6061 12.1334 13.6077 12.3774 13.445L19.0205 9.01634C19.4479 8.73135 19.4479 8.10318 19.0205 7.81819L12.3774 3.38948C12.1334 3.22678 11.815 3.22839 11.5726 3.39353Z",fill:"#006FFF"})),i.createElement("defs",null,i.createElement("clipPath",{id:"clip0_874_261811"},i.createElement("rect",{width:"24",height:"24",rx:"12",fill:"white"}))))),Oe=(0,i.memo)(({isSummary:e,name:t,children:a,...r})=>i.createElement(I.A,{alignItems:"center",width:"100%",gap:O.YC},i.createElement(I.A,{alignItems:"center",justifyContent:"center",width:25,height:25,gap:O.YC},e?i.createElement(he,null):a),i.createElement(I.A,{gap:O.YC,alignItems:"center"},i.createElement(oe.A,{color:"text-2",size:"medium",style:{whiteSpace:"nowrap"},isTruncated:!0},t||i.createElement(z.sA,{id:"COMMON_UNKNOWN"})),"compoundId"in r&&r.compoundId===ce.jV?i.createElement(Ce,null):null))),Ie=({isSummary:e,client:t,name:a})=>{const r=(0,l.useDispatch)(),n=(0,i.useCallback)(e=>{e.stopPropagation(),r((0,ne.XP)({type:le.H.CLIENT,id:t.mac}))},[r,t.mac]);return i.createElement(Oe,{isSummary:e,name:a},i.createElement(ie.A,{width:ae,height:ae,client:t,onClick:n}))},ye=[{id:m.CLIENT,sortable:!0,label:i.createElement(Y.A,{size:"medium",weight:"bold",color:"inherit"},i.createElement(z.sA,{id:Z[m.CLIENT]})),minWidth:L[m.CLIENT],renderCell:({isSummary:e,client:t,name:a})=>i.createElement(Ie,{isSummary:e,client:t,name:a}),compare:q(m.CLIENT)},{id:m.TOTAL_TRAFFIC,sortable:!0,label:i.createElement(Y.A,{size:"medium",weight:"bold",color:"inherit"},i.createElement(z.sA,{id:Z[m.TOTAL_TRAFFIC]})),minWidth:L[m.TOTAL_TRAFFIC],renderCell:({isSummary:e,traffic_percentage:t=0,total_bytes:a=0})=>i.createElement(V,{isSummary:e,traffic_percentage:t,total_bytes:a}),compare:q(m.TOTAL_TRAFFIC)},{id:m.DOWNLOAD,sortable:!0,label:i.createElement(Y.A,{size:"medium",weight:"bold",color:"inherit"},i.createElement(z.sA,{id:Z[m.DOWNLOAD]})),minWidth:L[m.DOWNLOAD],renderCell:({bytes_received:e=0})=>i.createElement(G.A.Bytes,{size:"medium"},(0,H.FI)(e)),compare:q(m.DOWNLOAD)},{id:m.UPLOAD,sortable:!0,label:i.createElement(Y.A,{size:"medium",weight:"bold",color:"inherit"},i.createElement(z.sA,{id:Z[m.UPLOAD]})),minWidth:L[m.UPLOAD],renderCell:({bytes_transmitted:e=0})=>i.createElement($.A.Bytes,{size:"medium"},(0,H.FI)(e)),compare:q(m.UPLOAD)},{id:m.EMPTY_SPACE,sortable:!1,label:null,minWidth:L[m.EMPTY_SPACE],renderCell:()=>null},{id:m.TIME_ESTIMATE,sortable:!0,label:i.createElement(Y.A,{size:"medium",weight:"bold",color:"inherit"},i.createElement(z.sA,{id:Z[m.TIME_ESTIMATE]})),minWidth:L[m.TIME_ESTIMATE],renderCell:({isSummary:e,timeEstimate:t})=>i.createElement(Y.A,{size:"medium",color:"text-2"},e?i.createElement(z.sA,{id:"COMMON_FALLBACK"}):i.createElement(B.A,{uptime:t})),compare:q(m.TIME_ESTIMATE)},{id:m.TOP_APPS,sortable:!0,label:i.createElement(Y.A,{size:"medium",weight:"bold",color:"inherit"},i.createElement(z.sA,{id:Z[m.TOP_APPS]})),minWidth:L[m.TOP_APPS],renderCell:({topApps:e})=>i.createElement(re,{topApps:e}),compare:q(m.TOP_APPS)},{id:m.APP_COUNT,sortable:!0,label:i.createElement(Y.A,{size:"medium",weight:"bold",color:"inherit"},i.createElement(z.sA,{id:Z[m.APP_COUNT]})),minWidth:L[m.APP_COUNT],renderCell:({appCount:e})=>i.createElement(Y.A,{size:"medium",color:"text-2"},e),compare:q(m.APP_COUNT)}];var _e=a(260411);const fe=({formattedUsageByClient:e,activityGraphClient:t,queryParams:a})=>{const r=(0,l.useDispatch)(),o=(0,l.useSelector)(C.Uz);return(0,i.useEffect)(()=>{t!==w.Y$?e.some(({mac:e})=>e===t)?r((0,T.C)(a,{apps:o,client_macs:[]},void 0,{crudCacheStrategy:{type:n.e.CACHE}})):r((0,_e.fT)(w.Y$)):1===e.length&&e[0].mac!==t&&r((0,_e.fT)(e[0].mac))},[r,e,a,o,t]),null},Me=({isSummary:e,client:{mac:t}})=>({[b.L]:e?y:t});var Pe=a(596441),ge=a(928085),Le=a(196010),Ne=a(583286),Se=a(302167),De=a(959341);const ve=()=>{const e=(0,ge.A)(`${De.bB}/${De.Uy.TRAFFIC_LOGGING}`),t=(0,ge.A)(`${De.bB}/${De.Uy.CYBERSECURE}`),{enabled:a}=(0,l.useSelector)(Se.JY),{time_series_per_client_stats_enabled:r}=(0,l.useSelector)(Se.aK),n=(0,i.useMemo)(()=>i.createElement(Le.A,{to:t},i.createElement(z.sA,{id:"COMMON_TRAFFIC_IDENTIFICATION"})),[t]),o=(0,i.useMemo)(()=>i.createElement(Le.A,{to:`${e}?${Ne.mv}=super_mgmt.time_series_per_client_stats_enabled`},i.createElement(z.sA,{id:"COMMON_COLLECT_HISTORICAL_CLIENT_DATA"})),[e]),c=(0,i.useMemo)(()=>a||r?a?r?i.createElement(z.sA,{id:"ACTIVITY_NO_TRAFFIC"}):i.createElement(z.sA,{id:"ACTIVITY_ENABLE_TO_VIEW_TRAFFIC_STATISTICS",values:{action:o}}):i.createElement(z.sA,{id:"ACTIVITY_ENABLE_TO_VIEW_TRAFFIC_STATISTICS",values:{action:n}}):i.createElement(z.sA,{id:"ACTIVITY_MULTI_ENABLE_TO_VIEW_TRAFFIC_STATISTICS",values:{action1:n,action2:o}}),[a,r,n,o]);return i.createElement(Y.A,{color:"text-2",size:"medium"},c)},be=()=>i.createElement(ve,null),Fe={disableColumnFilters:!0,rowHeight:Pe.I.ROW_HEIGHT,initiallySortAscending:!1,renderPlaceholder:be,placeholderClassName:N},we=(e,t)=>{const{formatMessage:a}=(0,z.tz)(),r=(0,l.useDispatch)(),n=(0,l.useSelector)(C.Uz),c=(0,i.useMemo)(()=>a({id:"COMMON_ALL_CLIENTS"}),[a]),s=(0,l.useSelector)((0,i.useMemo)(()=>(0,E.WY)(e),[e])),A=(0,l.useSelector)((0,i.useMemo)(()=>(0,E._)(c,e),[c,e])),u=(0,l.useSelector)((0,i.useMemo)(()=>n.length?(0,E.x4)(n,e):W.A,[n,e])),d=(0,l.useSelector)((0,i.useMemo)(()=>n.length?(0,E.lz)(c):R.A,[c,n])),T=(0,i.useMemo)(()=>s.length>1?Array.prototype.concat.apply([],[A,s]).flat():s,[A,s]),p=(0,i.useMemo)(()=>u.length>1?Array.prototype.concat.apply([],[d,u]).flat():u,[d,u]),h=(0,i.useCallback)(({client:{mac:e=w.Y$}})=>r((0,_e.fT)(e)),[r]),O=(0,i.useMemo)(()=>({idField:"mac",items:n.length?p:T,columns:ye,columnOverride:n.length?P:M,initialSortBy:m.TOTAL_TRAFFIC,onRowClick:h,rowProps:Me,renderHoverContent:o.P1}),[T,p,n,h]),I=(0,i.useMemo)(()=>i.createElement(U.A,{...Fe,...O}),[O]);return i.createElement(i.Fragment,null,i.createElement(fe,{formattedUsageByClient:O.items,activityGraphClient:t,queryParams:e}),I)};var xe=a(663591),Ue=a(767974),Re=a(602021),We=a(532419);const ze={[s.APPLICATION]:"COMMON_APPLICATION",[s.TOTAL_TRAFFIC]:"ACTIVITY_DATA_TRAFFIC",[s.TIME_ESTIMATE]:"ACTIVITY_TIME_ESTIMATE",[s.DOWNLOAD]:"COMMON_DOWNLOAD",[s.UPLOAD]:"COMMON_UPLOAD",[s.EMPTY_SPACE]:void 0,[s.TOP_CLIENT]:"ACTIVITY_TOP_CLIENT",[s.CLIENT_COUNT]:"COMMON_CLIENTS"},Ye=({topClientBytesReceived:e,topClientBytesTransmitted:t,timeEstimate:a,topClientTotalBytes:r,client:l})=>i.createElement(I.A,{flexDirection:"column",minWidth:200,gap:O.YC},i.createElement(I.A,{alignItems:"center",gap:O.YC},i.createElement(ie.A,{client:l,width:ae,height:ae}),i.createElement(Y.A,{size:"small",color:"text-1",weight:"bold"},l.name)),i.createElement(I.A,{justifyContent:"space-between"},i.createElement(Y.A,{size:"small",color:"text-1"},i.createElement(z.sA,{id:"COMMON_DOWNLOAD"})),i.createElement(Y.A,{size:"small",color:"traffic-down"},(0,H.FI)(e))),i.createElement(I.A,{justifyContent:"space-between"},i.createElement(Y.A,{size:"small",color:"text-1"},i.createElement(z.sA,{id:"COMMON_UPLOAD"})),i.createElement(Y.A,{size:"small",color:"traffic-up"},(0,H.FI)(t))),i.createElement(I.A,{justifyContent:"space-between"},i.createElement(Y.A,{size:"small",color:"text-1"},i.createElement(z.sA,{id:"COMMON_TRAFFIC"})),i.createElement(Y.A,{size:"small",color:"text-2"},(0,H.FI)(r))),a?i.createElement(I.A,{justifyContent:"space-between"},i.createElement(Y.A,{size:"small",color:"text-1"},i.createElement(z.sA,{id:"ACTIVITY_TIME_ESTIMATE"})),i.createElement(Y.A,{size:"small",color:"text-2"},i.createElement(B.A,{uptime:a}))):null),He="TRAFFIC_APP_TOP_CLIENT_IMAGE_CLASSNAME",Be=(0,h.A)(I.A)`
  gap: ${O.kc};
  align-items: center;
  .${He} {
    width: ${ae}px !important;
    min-width: ${ae}px;
    height: ${ae}px !important;
    min-height: ${ae}px;
  }
`,$e=({topClient:{client:e={mac:void 0,name:void 0},topClientTotalBytes:t,topClientBytesReceived:a,topClientBytesTransmitted:r,isSummary:n,totalBytes:o,timeEstimate:c}={}})=>{const m=(0,l.useDispatch)(),s=(0,i.useCallback)(t=>{t.stopPropagation(),m((0,ne.XP)({type:le.H.CLIENT,id:e.mac}))},[m,e.mac]);return i.createElement(Be,null,i.createElement(te,{delay:0,portal:!0,cursorType:"pointer",description:i.createElement(Ye,{client:e,topClientTotalBytes:t,topClientBytesReceived:a,topClientBytesTransmitted:r,timeEstimate:n?void 0:c})},i.createElement(ie.A,{client:e,className:He})),i.createElement(I.A,{alignItems:"center",gap:O.YC},i.createElement(Te.A,{type:"button",variant:"inline",onClick:s},i.createElement(Y.A,{color:"inherit",size:"medium"},e.name||i.createElement(z.sA,{id:"COMMON_UNKNOWN"}))),i.createElement(Y.A,{size:"medium",color:"text-2"},`${(0,H.FI)(t)} (${(0,X.i)((t||0)/(o||0)*100)}%)`)))},Ge=[{id:s.APPLICATION,sortable:!0,label:i.createElement(Y.A,{size:"medium",weight:"bold",color:"inherit"},i.createElement(z.sA,{id:ze[s.APPLICATION]})),minWidth:g[s.APPLICATION],renderCell:({isSummary:e,name:t,iconFileName:a,compoundId:r})=>i.createElement(Oe,{isSummary:e,name:t,compoundId:r},i.createElement(J.A,{iconFileName:a,dimension:ae})),compare:q(s.APPLICATION)},{id:s.TOTAL_TRAFFIC,sortable:!0,label:i.createElement(Y.A,{size:"medium",weight:"bold",color:"inherit"},i.createElement(z.sA,{id:ze[s.TOTAL_TRAFFIC]})),minWidth:g[s.TOTAL_TRAFFIC],renderCell:({isSummary:e,traffic_percentage:t=0,total_bytes:a=0})=>i.createElement(V,{isSummary:e,traffic_percentage:t,total_bytes:a}),compare:q(s.TOTAL_TRAFFIC)},{id:s.DOWNLOAD,sortable:!0,label:i.createElement(Y.A,{size:"medium",weight:"bold",color:"inherit"},i.createElement(z.sA,{id:ze[s.DOWNLOAD]})),minWidth:g[s.DOWNLOAD],renderCell:({bytes_received:e=0})=>i.createElement(G.A.Bytes,{size:"medium"},(0,H.FI)(e)),compare:q(s.DOWNLOAD)},{id:s.UPLOAD,sortable:!0,label:i.createElement(Y.A,{size:"medium",weight:"bold",color:"inherit"},i.createElement(z.sA,{id:ze[s.UPLOAD]})),minWidth:g[s.UPLOAD],renderCell:({bytes_transmitted:e=0})=>i.createElement($.A.Bytes,{size:"medium"},(0,H.FI)(e)),compare:q(s.UPLOAD)},{id:s.EMPTY_SPACE,sortable:!1,label:null,minWidth:g[s.EMPTY_SPACE],renderCell:()=>null},{id:s.TIME_ESTIMATE,sortable:!0,label:i.createElement(Y.A,{size:"medium",weight:"bold",color:"inherit"},i.createElement(z.sA,{id:ze[s.TIME_ESTIMATE]})),minWidth:g[s.TIME_ESTIMATE],renderCell:({isSummary:e,timeEstimate:t})=>i.createElement(Y.A,{size:"medium",color:"text-2"},e?i.createElement(z.sA,{id:"COMMON_FALLBACK"}):i.createElement(B.A,{uptime:t})),compare:q(s.TIME_ESTIMATE)},{id:s.TOP_CLIENT,sortable:!0,label:i.createElement(Y.A,{size:"medium",weight:"bold",color:"inherit"},i.createElement(z.sA,{id:ze[s.TOP_CLIENT]})),minWidth:g[s.TOP_CLIENT],renderCell:({topClient:e})=>i.createElement($e,{topClient:e}),compare:q(s.TOP_CLIENT)},{id:s.CLIENT_COUNT,sortable:!0,label:i.createElement(Y.A,{size:"medium",weight:"bold",color:"inherit"},i.createElement(z.sA,{id:ze[s.CLIENT_COUNT]})),minWidth:g[s.CLIENT_COUNT],renderCell:({clientCount:e=0})=>i.createElement(Y.A,{size:"medium",color:"text-2"},e),compare:q(s.CLIENT_COUNT)}],Ve=({formattedUsageByApp:e,activityGraphApp:t,queryParams:a})=>{const r=(0,l.useDispatch)(),o=(0,l.useSelector)(C.Wq);return(0,i.useEffect)(()=>{t[Ue.wA.CAT]!==w.ZM||t[Ue.wA.APP]!==w.Je?e.some(({application:e,category:a})=>t[Ue.wA.CAT]===a&&t[Ue.wA.APP]===e)?r((0,T.C)(a,{apps:[],client_macs:o},void 0,{crudCacheStrategy:{type:n.e.CACHE}})):r((0,_e.Hl)({[Ue.wA.CAT]:w.ZM,[Ue.wA.APP]:w.Je})):1===e.length&&t[Ue.wA.CAT]!==e[0].category&&t[Ue.wA.APP]!==e[0].application&&r((0,_e.Hl)({[Ue.wA.CAT]:e[0].category,[Ue.wA.APP]:e[0].application}))},[r,e,a,o,t]),null},ke=({isSummary:e,compoundId:t})=>({[b.L]:e?y:String(t)}),je={disableColumnFilters:!0,rowHeight:Pe.I.ROW_HEIGHT,initiallySortAscending:!1,renderPlaceholder:be,placeholderClassName:N},qe=(e,t)=>{const{formatMessage:a}=(0,z.tz)(),r=(0,l.useDispatch)(),n=(0,l.useSelector)(We.m9),o=(0,l.useSelector)(Re.EL),c=(0,l.useSelector)(We.jY),m=(0,l.useSelector)(C.Wq),A=(0,i.useMemo)(()=>a({id:"COMMON_ALL_TRAFFIC"}),[a]),u=(0,l.useSelector)((0,i.useMemo)(()=>(0,E.mH)(e),[e])),d=(0,l.useSelector)((0,i.useMemo)(()=>(0,E.Gb)(A,e),[A,e])),T=(0,l.useSelector)((0,i.useMemo)(()=>m.length?(0,E.Nu)(A):R.A,[A,m])),p=(0,l.useSelector)((0,i.useMemo)(()=>m.length?(0,E.Hy)(m,e):W.A,[m,e])),h=(0,i.useMemo)(()=>u.length>1?Array.prototype.concat.apply([],[d,u]).flat():u,[d,u]),O=(0,i.useMemo)(()=>p.length>1?Array.prototype.concat.apply([],[T,p]).flat():p,[T,p]),I=(0,i.useCallback)(({category:e,application:t})=>r((0,_e.Hl)({[Ue.wA.CAT]:e,[Ue.wA.APP]:t})),[r]),y=(0,i.useCallback)(({isSummary:e,compoundId:t})=>n&&!e&&c&&!o?i.createElement(xe.A,{dpiAppId:t}):null,[n,c,o]),M=(0,i.useMemo)(()=>({idField:"compoundId",items:m.length?O:h,columns:Ge,columnOverride:m.length?f:_,initialSortBy:s.TOTAL_TRAFFIC,onRowClick:I,rowProps:ke,renderHoverContent:y}),[h,O,m,I,y]),P=(0,i.useMemo)(()=>i.createElement(U.A,{...je,...M}),[M]);return i.createElement(i.Fragment,null,i.createElement(Ve,{formattedUsageByApp:M.items,activityGraphApp:t,queryParams:e}),P)},Ze=({queryParams:e})=>{const t=(0,l.useSelector)(C.nc),a=(0,l.useSelector)(C.Jd),r=(0,l.useSelector)(C.dX),n=qe(e,r),o=we(e,a);return i.createElement(x,{activityTab:t,activityGraphApp:r,activityGraphClient:a},t===D.f.CLIENTS?n:o)},Xe=({queryParams:e})=>i.createElement(S,null,i.createElement(Ze,{queryParams:e})),Ke=(0,h.A)(I.A)`
  flex-direction: column;
`;var Je=a(489391),Qe=a(936344),et=a(195462);const tt=(0,h.A)(I.A)`
  width: 100%;
  position: relative;
`;var at=a(282556),rt=a(366702),lt=a(638334),it=a(198494),nt=a(632017),ot=a(584916);const ct=e=>e<400,mt=({preset:e,documentWidth:t,dayDifference:a,use24HourTime:r,siteTimezone:l,language:i,selfHourCycle:n,formatMessage:o,timestamps:c,startDate:m,endDate:s})=>{return A=c[0]||m.getTime(),u=c.length>1&&c[c.length-1]||s.getTime(),d=0===a?ot.l.ONE_DAY:ot.j,(0,et.v)([A,u],nt.P[e||d].frequency(t,a)).map((a,c)=>({label:nt.P[e||d].label({index:c,value:a,use24HourTime:r,siteTimezone:l,language:i,selfHourCycle:n,documentWidth:t,formatMessage:o}),value:a}));var A,u,d},st=(e,{startDate:t,endDate:a,preset:r})=>{const{formatMessage:n}=(0,z.tz)(),{width:o}=(0,rt.A)(),c=(0,i.useMemo)(()=>(0,lt.w)(t,a),[t,a]),m=(0,l.useSelector)(it.jc),s=(0,l.useSelector)(it.BQ),A=(0,l.useSelector)(Re.hq),u=(0,l.useSelector)(at.zi);return{xAxis:mt({preset:r,documentWidth:o,dayDifference:c,use24HourTime:m,siteTimezone:A,language:u,selfHourCycle:s,formatMessage:n,startDate:t,endDate:a,timestamps:e}),dayDifference:c}},At=()=>{const e=(0,l.useSelector)(it.BQ),t=(0,l.useSelector)(Re.hq),a=(0,l.useSelector)(at.zi);return(0,i.useMemo)(()=>({full:new Intl.DateTimeFormat(a,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"numeric",hourCycle:e,timeZone:t}),short:new Intl.DateTimeFormat(a,{hour:"numeric",minute:"numeric",hourCycle:e,timeZone:t}),tooltip:new Intl.DateTimeFormat(a,{day:"numeric",month:"short",hour:"numeric",minute:"numeric",hourCycle:e,timeZone:t})}),[e,t,a])},ut=e=>{const t=(0,i.useMemo)(()=>{return Math.max((t=e,Math.round(.8*Math.round((t||0)/2))),188);var t},[e]);return(0,i.useMemo)(()=>({chartHeight:t,isNarrowChart:ct(t)}),[t])};var dt=a(86747);const Tt=625e3;var Et=a(13994),pt=a(137298);const Ct=(0,i.memo)(({value:e,activityTrafficGraphState:t})=>{const a=(0,i.useMemo)(()=>t===dt.u.DOWNLOAD?G.A:$.A,[t]);return i.createElement(I.A,{alignItems:"center",justifyContent:"space-between"},i.createElement(Y.A,{size:"small",color:"text-1"},i.createElement(z.sA,{id:t===dt.u.DOWNLOAD?"COMMON_DOWNLOAD":"COMMON_UPLOAD"})),i.createElement(I.A,{alignItems:"center"},i.createElement(a.Icon,{size:"small"}),i.createElement(Y.A,{size:"small",color:t===dt.u.DOWNLOAD?"traffic-down":"traffic-up"},(0,pt.zX)(Math.max(e,0)))))}),ht=(0,i.memo)(({name:e,iconFileName:t})=>i.createElement(I.A,{gap:O.YC,alignItems:"center"},i.createElement(J.A,{iconFileName:t}),i.createElement(oe.A,{size:"small",color:"text-2",isTruncated:!0},e||i.createElement(z.sA,{id:"COMMON_UNKNOWN"})))),Ot=({timestamp:e,totalBytes:t,topApp:a,intervalSeconds:r,dayDifference:l,activityTrafficDownloadGraphState:n,activityTrafficUploadGraphState:o,rxValue:c,txValue:m,activityDateTimeFormats:{full:s,short:A}})=>i.createElement(I.A,{flexDirection:"column",width:"100%",whiteSpace:"nowrap",gap:O.YC},i.createElement(I.A,{marginBottom:O.YC},i.createElement(Y.A,{color:"text-1",weight:"bold",size:"medium"},i.createElement(z.sA,{id:"COMMON_TRAFFIC"}))),i.createElement(I.A,{justifyContent:"space-between"},i.createElement(Y.A,{size:"small",color:"text-1"},i.createElement(z.sA,{id:"COMMON_DATE_TIME"})),i.createElement(Y.A,{size:"small",color:"text-2"},s.format(e),l<=7&&r?i.createElement(i.Fragment,null," - ",A.format(e+1e3*r)):null)),i.createElement(I.A,{justifyContent:"space-between"},i.createElement(Y.A,{size:"small",color:"text-1"},i.createElement(z.sA,{id:"COMMON_TOTAL_TRAFFIC"})),i.createElement(Y.A,{size:"small",color:"text-2"},(0,H.FI)(t))),i.createElement(i.Fragment,null,n?i.createElement(Ct,{value:c,activityTrafficGraphState:dt.u.DOWNLOAD}):null,o?i.createElement(Ct,{value:m,activityTrafficGraphState:dt.u.UPLOAD}):null),a?i.createElement(I.A,{justifyContent:"space-between",alignItems:"center"},i.createElement(Y.A,{size:"small",color:"text-1"},i.createElement(z.sA,{id:"COMMON_MOST_ACTIVE"})),i.createElement(I.A,{alignItems:"center",maxWidth:"70%"},i.createElement(ht,{...(0,K.HH)((0,F.h)(a.category,a.application))}),i.createElement(oe.A,{size:"small",color:"text-2",isTruncated:!0}," (",(0,H.FI)(a.total_bytes||0),")"))):null),It=({hidden:e,top:t,left:a,x:r,customTooltipProps:{total_bytes:l=0,top_app:n,interval_seconds:o=null}={},chartWidth:c,chartHeight:m,activityTrafficDownloadGraphState:s,activityTrafficUploadGraphState:A,activityTrafficGraphState:u,gradientColor:d,uploadTooltipProps:T,rxValue:E,txValue:p,dayDifference:C,activityDateTimeFormats:h})=>i.createElement(Et.A,{width:300,topA:t,leftA:a,topB:T.top,leftB:T.left,chartWidth:c,chartHeight:m,hidden:e,description:i.createElement(Ot,{timestamp:r,totalBytes:l,topApp:n,intervalSeconds:o,dayDifference:C,activityTrafficDownloadGraphState:s,activityTrafficUploadGraphState:A,rxValue:E,txValue:p,activityDateTimeFormats:h}),innerColor:d,tooltipRenderCondition:![s,A].every(Boolean)||u===dt.u.UPLOAD});var yt=a(964238),_t=a(822336),ft=a(998837);const Mt={[dt.u.INTERNET_ACTIVITY]:void 0,[dt.u.DOWNLOAD]:"aqua-06",[dt.u.UPLOAD]:"purple-06"},Pt=({trafficRate:e,getCoordinates:t,mouseData:a,maxY:r,yAxisMax:l,yAxisMin:n,tooltipContainer:o,activityTrafficGraphState:c,renderTooltip:m,chartHovered:s})=>{const{themeName:A}=(0,ft.u)(),u=(0,i.useMemo)(()=>e.map(({timestamp:e,"rx_byte-r":t,"tx_byte-r":a,total_bytes:r,top_app:l,interval_seconds:i})=>({x:e,y:c===dt.u.UPLOAD?a:t,custom:{total_bytes:r,top_app:l,interval_seconds:i,rxValue:t,txValue:a}})),[e,c]),d=(0,i.useMemo)(()=>`${c}GradientId`,[c]),T=(0,i.useMemo)(()=>_t.Ay[`desktop-color-${Mt[c]}-${A}`],[c,A]),E=(0,i.useCallback)(()=>i.createElement("defs",null,i.createElement("linearGradient",{id:d,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},i.createElement("stop",{offset:"0%",stopColor:T,stopOpacity:.5}),i.createElement("stop",{offset:"100%",stopColor:T,stopOpacity:.1}))),[T,d]),p=(0,i.useCallback)(e=>m(e,c,T),[m,T,c]);return i.createElement(yt.A,{data:u,maxY:r,yAxisMax:l,yAxisMin:n,mouseData:a,getCoordinates:t,lineColor:T,variant:"gradientArea",interpolation:"curved",allowCustomDots:!0,tooltipPortal:o?o.current:void 0,customGradientId:d,renderCustomGradient:E,renderTooltip:p,showTooltip:s})},gt=({activityContainerHeight:e,activityDateRange:t})=>{const a=(0,i.useRef)(null),n=(0,i.useRef)({left:0,top:0}),{ref:o,width:c=0}=(0,r.A)(),{chartHeight:m,isNarrowChart:s}=ut(e),A=(0,l.useSelector)(C.mE),u=(0,l.useSelector)(d.Sm),{activityTrafficDownloadGraphState:T,activityTrafficUploadGraphState:E}=(0,i.useMemo)(()=>({activityTrafficDownloadGraphState:[dt.u.DOWNLOAD,dt.u.INTERNET_ACTIVITY].includes(A),activityTrafficUploadGraphState:[dt.u.UPLOAD,dt.u.INTERNET_ACTIVITY].includes(A)}),[A]),{power:p,unit:h,bytes:O}=(0,i.useMemo)(()=>{return e=Math.max(0,...u.map(({"tx_byte-r":e=0,"rx_byte-r":t=0})=>Math.max(Tt,T?t:0,E?e:0))),(0,Je.cS)(e,"bitrate","SI",e?void 0:2);var e},[u,T,E]),{xAxis:I,dayDifference:y}=st(u.map(({timestamp:e})=>e),t),_=(0,i.useMemo)(()=>{return e=O>Tt?Math.ceil(O+1/(s?5:10)*O):O,(0,et.Y)((0,Je.cS)(e,"bitrate","SI",p).value<1e3?e:O,s?6:11);var e},[O,p,s]),f=(0,i.useCallback)(({value:e},t)=>{return t!==(s?5:10)?(a=(0,Je.cS)(+e,"bitrate","SI",p).value,r=a.toFixed(1),0===t?h:String(r.length<=4?r:Math.trunc(a))):void 0;var a,r},[p,s,h]),M=At(),P=(0,i.useCallback)(({hidden:e,left:t=0,top:a=0,x:r,y:l,custom:o},s,A)=>(T&&E&&s===dt.u.UPLOAD&&(n.current={left:t,top:a}),i.createElement(It,{hidden:e,left:t,top:a,uploadTooltipProps:n.current,x:r,rxValue:o?.rxValue,txValue:o?.txValue,customTooltipProps:o,chartHeight:m,chartWidth:c,activityTrafficDownloadGraphState:T,activityTrafficUploadGraphState:E,activityTrafficGraphState:s,gradientColor:A,dayDifference:y,activityDateTimeFormats:M})),[m,c,T,E,n,y,M]),g=(0,i.useCallback)((e,t,r,l,n,o,c,m,s,A)=>i.createElement(i.Fragment,null,T?i.createElement(Pt,{trafficRate:u,getCoordinates:e,mouseData:t,maxY:r,yAxisMax:o,yAxisMin:c,tooltipContainer:a,renderTooltip:P,activityTrafficGraphState:dt.u.DOWNLOAD,chartHovered:A}):null,E?i.createElement(Pt,{trafficRate:u,getCoordinates:e,mouseData:t,maxY:r,yAxisMax:o,yAxisMin:c,tooltipContainer:a,renderTooltip:P,activityTrafficGraphState:dt.u.UPLOAD,chartHovered:A}):null),[T,E,u,P]);return i.createElement(tt,{ref:o},i.createElement(Qe.A,{xAxis:I,yAxis:_,width:c,height:m,renderYLabel:f},g),i.createElement("div",{ref:a}))},Lt=({activityContainerHeight:e,activityDateRange:t})=>i.createElement(Ke,null,i.createElement(gt,{activityContainerHeight:e,activityDateRange:t})),Nt=(0,h.A)(I.A)`
  margin: ${O.Ln};
  border: ${({theme:{themeName:e}})=>_t.Ay[`desktop-border-divider-${e}`]};
  border-radius: 6px;
  overflow: auto;
  width: 100%;
`,St=(0,h.A)(I.A)`
  width: 100%;
  min-width: 820px;
  height: 100%;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  gap: ${O.kc};
`,Dt=(0,i.memo)(()=>{const e=(0,l.useDispatch)(),{ref:t,height:a}=(0,r.A)(),o=(0,l.useSelector)(C.Vn),m=(0,l.useSelector)(C.Bw),s=(0,l.useSelector)(C.eD),h=(0,i.useMemo)(()=>({start:m.startDate.getTime(),end:m.endDate.getTime(),includeUnidentified:!0}),[m]),O=(0,l.useSelector)(d.Z7),I=(0,l.useSelector)((0,i.useMemo)(()=>(0,E.Vg)(h),[h]));return c(()=>{O||e((0,T.C)(h,s)),I||e((0,p._)(h))}),(0,A.A)([(0,T.C)(h,s,void 0,{crudCacheStrategy:{type:n.e.CACHE}}),(0,p._)(h,void 0,{crudCacheStrategy:{type:n.e.CACHE}})],i.createElement(Nt,null,i.createElement(St,{ref:t},o?i.createElement(Lt,{activityContainerHeight:a,activityDateRange:m}):null,i.createElement(Xe,{queryParams:h}))),{trackingName:u.H.ACTIVITY})})},966376:(e,t,a)=>{var r;a.d(t,{D:()=>r}),function(e){e.TRAFFIC_RULES="traffic-rules",e.FIREWALL_RULES="firewall-rules"}(r||(r={}))}}]);