"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[90512],{22169:(e,t,r)=>{r.d(t,{A:()=>c});var n=r(296540),l=r(217439),i=r(699784),a=r(115829),o=r(39705),s=r(294303);const c=({ipv6:e,size:t="inherit",color:r="inherit"})=>{const c=e?.[0];return c?n.createElement(s.A,{width:"100%",justifyContent:"flex-end"},n.createElement(a.A,{flexProps:{justifyContent:"flex-end",alignItems:"center"},color:r,size:t},c),e?.length>1?n.createElement(o.A,{items:e,isInteractive:!0,showListMarkers:!1,getItemKey:e=>e,renderListItem:e=>n.createElement(n.Fragment,null,e),renderMultipleItemsSummary:()=>null}):null):n.createElement(l.A,{size:t,color:r},n.createElement(i.sA,{id:"COMMON_FALLBACK"}))}},30386:(e,t,r)=>{r.d(t,{A:()=>n});const n=e=>+(e||0).toFixed(1)},32753:(e,t,r)=>{r.d(t,{A:()=>s});var n=r(296540),l=r(927099),i=r(699784),a=r(780811),o=r(360113);const s=({systemStatsMem:e,compact:t=!1})=>{const r=(0,a.HBQ)(e);return r?n.createElement(o.A,{compact:t},n.createElement(l.A,{color:"secondary",size:"body"},n.createElement(i.sA,{id:"DEVICE_PROPERTY_OVERVIEW_MEMORY_USAGE"})),n.createElement(l.A,{color:"tertiary",size:"body"},r,"%")):null}},39705:(e,t,r)=>{r.d(t,{A:()=>c});var n=r(296540),l=r(705145),i=r(699784),a=r(115829),o=r(424135),s=r(819127);const c=function({items:e,renderMultipleItemsSummary:t,renderListItem:r,renderNoItems:c,getItemKey:m,enabled:d=!0,showListMarkers:E,cursorType:A,isInteractive:u}){const p=d?"inherit":"disabled";return e.length>1?n.createElement(o.A,{tooltip:n.createElement(s.A,{items:e,getItemKey:m,renderItem:r,showListMarkers:E,isInteractive:u,cursorType:A})},n.createElement(a.A,{color:p,cursorType:A},t(e))):1===e.length?n.createElement(a.A,{color:p,cursorType:A},r(e[0])):c?n.createElement(n.Fragment,null,c()):n.createElement(l.A,{isTruncated:!0,color:p},n.createElement(i.sA,{id:"COMMON_FALLBACK"}))}},46119:(e,t,r)=>{r.d(t,{A:()=>n});const n={open:(e,t="_blank",r="noopener,noreferrer")=>window.open(e,t,r)}},146784:(e,t,r)=>{r.d(t,{A:()=>A});var n=r(296540),l=r(349424),i=r(217439),a=r(383653),o=r(568560),s=r(22169),c=r(294303),m=r(699784),d=r(348466),E=r(360113);const A=(0,n.memo)(({ipv6_address:e=[],wan_dhcpv6_pd_size:t})=>{const{globalAddresses:r,linkLocalAddress:A}=(0,n.useMemo)(()=>{const t=[];let r=null;for(let n=0;n<e.length;n+=1){const i=e[n];new l.Address6(i).isLinkLocal()?r=i?.split(d.Ed)?.[0]:t.push(i.split(d.Ed)?.[0])}return{globalAddresses:t,linkLocalAddress:r}},[e]);return r.length?n.createElement(n.Fragment,null,n.createElement(E.A,null,n.createElement(i.A,{color:"text-2",size:"medium"},n.createElement(m.sA,{id:"COMMON_IPV6_ADDRESS"})),n.createElement(o.A,{ipv6:r,size:"medium",color:"text-3"})),t?n.createElement(E.A,null,n.createElement(i.A,{color:"text-2",size:"medium"},n.createElement(m.sA,{id:"COMMON_IPV6_PREFIX"})),n.createElement(c.A,{flex:"1",minWidth:"0",justifyContent:"flex-end"},n.createElement(s.A,{ipv6:[`${(0,a.Gh)(r[0],t)}/${t}`],color:"text-3",size:"medium"}))):null,A?n.createElement(E.A,null,n.createElement(i.A,{color:"text-2",size:"medium"},n.createElement(m.sA,{id:"COMMON_IPV6_LINK_LOCAL"})),n.createElement(o.A,{ipv6:[A],size:"medium",color:"text-3"})):null):null})},258117:(e,t,r)=>{r.d(t,{A:()=>A});var n=r(296540),l=r(325898),i=r(927099),a=r(71479),o=r(903216),s=r(294303),c=r(699784),m=r(360113),d=r(863489);const E=(0,a.A)(s.A)`
  .tooltip-position-fixer {
    margin-right: -14px;
  }
`,A=({uplink:e,portSpeed:t})=>{const r=Number(t||e?.speed),{motif:a}=(0,l.A)();return r>0?n.createElement(m.A,null,n.createElement(i.A,{color:"secondary",size:"body"},n.createElement(c.sA,{id:"COMMON_EXPERIENCE"})),n.createElement(E,{alignItems:"center"},n.createElement(i.A,{style:{color:(0,d.xe)(r,a,!1)},size:"body"},(0,o.ir)(r)))):null}},373934:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(296540),l=r(758649),i=r(216211);const a=({mac:e,port:t,children:r})=>{const{handleGoToPortsPage:a}=(0,i.e)(),o=(0,n.useCallback)(r=>{r.stopPropagation(),a(e,+t)},[a,e,t]);return n.createElement(l.A,{type:"button",size:"inherit",variant:"inline",onClick:o},r)}},424135:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(296540),l=r(566723),i=r(294303);const a=({children:e,tooltip:t})=>n.createElement(i.A,{maxWidth:"100%",overflow:"hidden",gap:l.YC,alignItems:"center"},n.createElement(i.A,{flex:1,overflow:"hidden"},e),t)},530813:(e,t,r)=>{r.d(t,{A:()=>A,d:()=>E});var n=r(296540),l=r(217439),i=r(705145),a=r(71479),o=r(311785),s=r(566723),c=r(699784),m=r(795097),d=r(294303);const E=(0,a.A)(m.A,(0,o.A)("showListMarkers","gap"))`
  padding-left: ${({showListMarkers:e})=>e?s.Ln:0};
  display: flex;
  flex-direction: column;
  gap: ${({gap:e})=>e??s.YC};

  > li {
    list-style-type: ${({showListMarkers:e})=>e?"disc":"none"};
  }
`;const A=function({items:e,getItemKey:t,renderItem:r,maxItemCount:a=20,renderShowMore:o,showListMarkers:m,listGap:A}){return n.createElement(d.A,{flexDirection:"column",gap:s.YC},n.createElement(E,{showListMarkers:m,gap:A},e.slice(0,a).map((e,l)=>n.createElement("li",{key:t(e,l)},n.createElement(i.A,{variant:"inherit",isTruncated:!0},r(e))))),a&&e.length>a?o?o(e):n.createElement(l.A,{variant:"inherit"},n.createElement(c.sA,{id:"COMMON_X_MORE",values:{count:e.length-a}})):null)}},551753:(e,t,r)=>{r.d(t,{A:()=>u});var n=r(296540),l=r(758649),i=r(217439),a=r(162420),o=r(823858),s=r(793336),c=r(998837),m=r(46119),d=r(699784),E=r(224948),A=r(294303);const u=(0,n.memo)(({children:e,customIcon:t,link:r,nested:u,extra:p,variant:_="warning",...g})=>{const{motifPalette:{warning:I,danger:h}}=(0,c.u)(),C=(0,n.useMemo)(()=>{switch(_){case"warning":return n.createElement(o.A,{size:"original",color:I,variant:"fill"});case"info":return n.createElement(a.A,{isActive:!0,size:"original",variant:"fill"});case"custom":return t;default:return n.createElement(s.A,{size:"medium",color:h,variant:"fill"})}},[_,I,h,t]),v=(0,n.useCallback)(()=>{m.A.open(r)},[r]);return n.createElement(E.A,{icon:C,nested:u,...g},n.createElement(A.A,{flexDirection:"column",alignItems:"flex-start"},n.createElement(i.A,null,e),n.createElement(i.A,null,r?n.createElement(l.A,{type:"button",variant:"inline",onClick:v},n.createElement(d.sA,{id:"COMMON_LEARN_MORE"})):null),p))})},568560:(e,t,r)=>{r.d(t,{A:()=>p});var n=r(469733),l=r(296540),i=r(217439),a=r(895795),o=r(383653),s=r(742920),c=r(115829),m=r(39705),d=r(294303),E=r(675359),A=r(699784),u=r(348466);const p=({ipv6:e=[],enabled:t=!0,size:r="inherit",color:p="inherit",showOnlyPrefix:_=!1})=>{const g=(0,n.useDispatch)(),I=(0,l.useCallback)(e=>{navigator.clipboard.writeText(e).then(()=>{g((0,E.ox)({icon:s.C.success,message:"COMMON_COPIED_TO_CLIPBOARD"}))})},[g]),h=(0,l.useCallback)((e,t)=>{t.stopPropagation(),t.preventDefault(),I(e)},[I]),C=(0,l.useMemo)(()=>(e=>{const t=e=>(0,o.G8)(e)?0:(0,o.ZV)(e)?1:2;return e.sort((e,r)=>t(e)-t(r))})(e||[]).map(e=>{const[t,r]=e.split(u.Ed);return _?`${(0,o.Gh)(t,Number(r))}/${r}`:(0,o.z2)(e)}),[e,_]),v=C?.[0];return v?l.createElement(d.A,{maxWidth:"100%",justifyContent:"flex-end"},l.createElement(c.A,{enabled:t,flexProps:{justifyContent:"flex-end",alignItems:"center"},color:t?p:"disabled",size:r},v),C?.length>1?l.createElement(m.A,{items:C,isInteractive:!0,showListMarkers:!1,getItemKey:e=>e,renderListItem:e=>l.createElement(l.Fragment,null,e,l.createElement(a.A,{size:"original",actionable:!0,onClick:t=>h(e,t)})),renderMultipleItemsSummary:()=>null}):l.createElement(a.A,{size:"original",actionable:!0,onClick:e=>h(v,e)})):l.createElement(i.A,{size:r,color:t?p:"disabled"},l.createElement(A.sA,{id:"COMMON_FALLBACK"}))}},795097:(e,t,r)=>{r.d(t,{A:()=>i});var n=r(71479),l=r(566723);const i=(0,n.A)("ul")`
  padding-left: ${l.Er};
  margin-bottom: 0;
  margin-top: 0;
`},819127:(e,t,r)=>{r.d(t,{A:()=>a});var n=r(296540),l=r(766624),i=r(530813);const a=function({items:e,getItemKey:t,renderItem:r,maxItemCount:a,renderShowMore:o,showListMarkers:s,title:c,position:m,isInteractive:d,cursorType:E,listGap:A}){return n.createElement(l.A,{title:c,position:m,isInteractive:d,cursorType:E,description:n.createElement(i.A,{items:e,getItemKey:t,renderItem:r,maxItemCount:a,listGap:A,renderShowMore:o,showListMarkers:s})})}},889879:(e,t,r)=>{r.d(t,{A:()=>B});var n=r(469733),l=r(296540),i=r(217439),a=r(718073),o=r(162420),s=r(71479),c=r(566723),m=r(30386),d=r(551753),E=r(294303),A=r(689965),u=r(699784),p=r(801081);const _="poeInfo",g=e=>e.models[_]?.byId;var I=r(691189);var h=r(780811),C=r(765562),v=r(930662);const M=r(132196).AH`
  margin: 0; // to properly align top & bottom spacing
`,O=({usedPower:e,maxPower:t,device_near_power_limit:r})=>l.createElement(v.A,{value:e/t*100,size:"larger",variant:r?"warning":"success",className:M});var f,w=r(963070),T=r(396660),y=r(879905),N=r(596441),x=r(398300),k=r(115829);!function(e){e.NAME="name",e.AVERAGE="average",e.PEAK="peak",e.PORT="port"}(f||(f={}));var b=r(373934),P=r(6176),L=r(703447),z=r(845030),D=r(532419),R=r(239417);const S={[f.NAME]:l.createElement(u.sA,{id:"COMMON_DEVICE"}),[f.AVERAGE]:l.createElement(u.sA,{id:"COMMON_AVG"}),[f.PEAK]:l.createElement(u.sA,{id:"COMMON_PEAK"}),[f.PORT]:"#"},G=[{id:f.NAME,sortable:!1,label:S[f.NAME],renderCell:({image:e,name:t})=>l.createElement(E.A,{alignItems:"center",justifyContent:"center",gap:c.YC},l.createElement(E.A,{alignItems:"center",justifyContent:"center",height:"20px",width:"20px"},e),l.createElement(E.A,{width:"110px"},l.createElement(k.A,{color:"inherit",size:"medium"},t))),width:120,compare:(0,T.l0)(({name:e})=>e)},{id:f.AVERAGE,sortable:!0,label:S[f.AVERAGE],renderCell:({average:e})=>l.createElement(i.A,{color:"inherit",size:"medium"},l.createElement(u.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:e}})),width:42,compare:(0,T.l0)(({average:e})=>e)},{id:f.PEAK,sortable:!0,label:S[f.PEAK],renderCell:({peak:e})=>l.createElement(i.A,{color:"inherit",size:"medium"},l.createElement(u.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:e}})),width:42,compare:(0,T.l0)(({peak:e})=>e)},{id:f.PORT,sortable:!0,label:S[f.PORT],renderCell:({uplinkMac:e,port:t})=>l.createElement(i.A,{color:"inherit",size:"medium"},l.createElement(b.A,{mac:e,port:t},t)),width:20,compare:(0,T.l0)(({port:e})=>e)}],V=({mac:e,consumers:t})=>{const r=(0,n.useDispatch)(),i=(0,n.useSelector)(D.DV),a=(0,n.useSelector)(R.Ew),o=[];for(let r=0;r<t.length;r+=1){const n=i[t[r].mac]?.record,s=!n&&a[t[r].mac]?.record;(n||s)&&o.push({id:n?._id||s?.id,name:t[r].display_name,mac:t[r].mac,image:n?l.createElement(P.A,{model:n.model}):l.createElement(L.A,{client:s}),average:(0,m.A)(t[r].avg_poe_usage),peak:(0,m.A)(t[r].max_poe_usage),port:t[r].port_number,uplinkMac:e})}const{rowLimit:s,renderFooter:c}=(0,y.A)(o.length,{defaultCount:10}),d=(0,l.useCallback)(({mac:e})=>{r((0,z.XP)({type:x.H.DEVICE,id:e}))},[r]);return l.createElement(w.A,{items:o,columns:G,idField:"id",initialSortBy:f.AVERAGE,disableColumnFilters:!0,rowOffset:0,disableSelection:!0,onRowClick:d,rowLimit:s,renderFooter:()=>c,rowHeight:N.I.ROW_HEIGHT,truncateHeaderCells:!0})},K=(0,s.A)(i.A)`
  flex: 1 1 auto;
`,B=(0,l.memo)(({mac:e,type:t,model:r,device_near_power_limit:s,device_near_effective_power_limit:v,total_used_power:M,total_max_power:f,isPoeAdapter:w})=>{const T=(0,n.useDispatch)(),y=(0,n.useSelector)((0,l.useMemo)(()=>(e=>(0,p.Mz)(g,t=>t?.[e]?.record?.poe_host_device_info))(e),[e])),N=(0,l.useMemo)(()=>(0,h.Tbi)({type:t})||(0,h.QyX)({model:r}),[t,r]);return(0,l.useEffect)(()=>{T(((e,t={})=>(0,I.Kd)(_,"/v2/api/site/{site}/poe-info",e,{queryParams:{mac:e}},{...t,idField:"mac"}))(e))},[e,T]),y?l.createElement(A.A,null,l.createElement(E.A,{alignItems:"center",marginBottom:c.Ln},l.createElement(K,{size:"medium",weight:"bold",color:"text-1"},w?l.createElement(u.sA,{id:"DEVICE_POE_BUDGET_TITLE_POE_ADAPTER"}):l.createElement(u.sA,{id:"DEVICE_POE_BUDGET_TITLE"})),w?l.createElement(i.A,{color:"text-3",size:"medium"},l.createElement(u.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:(0,m.A)(M)}})):l.createElement(E.A,{alignItems:"center",gap:c.YC},l.createElement(i.A,{color:"text-3",size:"medium"},(0,m.A)(M),"/",l.createElement(u.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:(0,m.A)(f)}})),v?l.createElement(a.A,{description:l.createElement(u.sA,{id:"DEVICE_POE_WARNING_IN_BUDGET_WIDGET_CABLE_LOSS"})},l.createElement("span",null,l.createElement(o.A,{size:"original",isActive:!0}))):null)),w?l.createElement(d.A,{variant:"info",link:C.A.poeBudgetingUrl,nested:!0},l.createElement(u.sA,{id:"DEVICE_POE_ADAPTER_NOTIFICATION"})):l.createElement(O,{usedPower:M,maxPower:f,device_near_power_limit:s}),s&&!w?l.createElement(E.A,{marginTop:c.Ln,flexDirection:"column"},l.createElement(d.A,{variant:"info",link:C.A.poeBudgetingUrl,nested:!0},l.createElement(u.sA,{id:N?"DEVICE_POE_WARNING_IN_BUDGET_WIDGET":"DEVICE_POE_WARNING_IN_BUDGET_WIDGET_CONSOLE_DEVICES"})),y?.near_power_limit_downlinks?.length?l.createElement(V,{mac:e,consumers:y.near_power_limit_downlinks}):null):null):null})}}]);