"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[44286],{453007(e,n,t){t.d(n,{A:()=>o});var i=t(179102),r=t(247816),s=t(291508);const o=(0,r.A)(i.A,(0,s.A)("colorOverride"))`
  ${({colorOverride:e})=>e?`color: ${e} !important`:""};
`},109700(e,n,t){t.d(n,{A:()=>c});var i=t(274934),r=t(100978),s=t(535322),o=t(376892),l=t(597377),a=t(906701),d=t(924453);const c=({oob_info:{mac:e,v4_address:n,v6_addresses:t}={},type:c,uplink:m,device_mode_override:A})=>e||n||t?(0,i.jsx)(s.A,{type:s.I.ACCORDION,items:[{id:"oob-port-information",label:(0,i.jsx)(o.A,{id:"DEVICE_MANAGEMENT_PORT"}),renderContent:()=>(0,i.jsxs)(r.A,{height:"100%",flexDirection:"column",children:[n?(0,i.jsx)(l.A,{ip:n,lan_ip:n,type:c,uplink:m,device_mode_override:A}):null,e?(0,i.jsx)(d.A,{mac:e}):null,t?(0,i.jsx)(a.A,{ipv6_address:t}):null]}),openByDefault:!0}]}):null},241092(e,n,t){t.d(n,{A:()=>T});var i=t(274934),r=t(798282),s=t(309130),o=t(376892),l=t(100978),a=t(535322),d=t(548941),c=t(505817),m=t(179102),A=t(627308),x=t(711950),p=t(247816),u=t(291508),_=t(470070);var j,h=t(820510);!function(e){e.ORANGE="orange",e.RED="red"}(j||(j={}));const E=(e,n)=>(e.index||0)-(n.index||0),g=(0,p.A)(A.A)`
  color: ${({theme:e})=>c.Ay[`desktop-color-neutral-00-${e.themeName}`]};
`,C=(0,p.A)(x.A,(0,u.A)("color"))`
  color: ${({theme:e,color:n})=>c.Ay[`desktop-color-${n}-06-${e.themeName}`]};
`,I=(0,p.A)(l.A)`
  width: ${s.S2};
  height: ${s.S2};
  border-radius: 4px;
  background-color: ${({theme:e})=>c.Ay[`desktop-color-green-06-${e.themeName}`]};
`,N=(0,p.A)(I)`
  background-color: ${({theme:e})=>c.Ay[`desktop-color-neutral-03-${e.themeName}`]};
`,f=({fan:{index:e,speed:n}})=>(0,i.jsxs)(h.m,{children:[(0,i.jsx)(h.Y,{id:"DEVICE_FAN",children:e}),(0,i.jsx)(h.Y,{id:"DEVICE_LEVEL",children:n})]}),O=({fan:e})=>(0,i.jsx)(d.A,{description:(0,i.jsx)(f,{fan:e}),width:100,children:(0,i.jsx)(I,{justifyContent:"center",alignItems:"center",children:(0,i.jsx)(g,{})})}),w=({index:e,messageId:n,color:t=j.ORANGE})=>(0,i.jsx)(d.A,{description:(0,i.jsx)(_.sA,{id:n,values:{index:e}}),width:199,children:(0,i.jsx)(N,{justifyContent:"center",alignItems:"center",children:(0,i.jsx)(C,{color:t,size:"original",variant:"fill"})})}),k=({fan:e})=>{switch(!0){case!e.present:return(0,i.jsx)(w,{index:e.index,messageId:"DEVICE_FAN_UNAVAILABLE",color:j.RED});case!!(1&e.critical_state):return(0,i.jsx)(w,{index:e.index,messageId:"DEVICE_FAN_SPEED_TOO_HIGH"});case!!(2&e.critical_state):return(0,i.jsx)(w,{index:e.index,messageId:"DEVICE_FAN_STOPPED"});case!!(4&e.critical_state):return(0,i.jsx)(w,{index:e.index,messageId:"DEVICE_FAN_UNAVAILABLE",color:j.RED});default:return(0,i.jsx)(O,{fan:e})}},v=({fan:e})=>(0,i.jsxs)(l.A,{flexDirection:"column",justifyContent:"center",alignItems:"center",children:[(0,i.jsx)(k,{fan:e}),(0,i.jsx)(m.A,{size:"small",color:"text-3",children:e.present&&void 0!==e.speed?e.speed:(0,i.jsx)(_.sA,{id:"COMMON_FALLBACK"})})]}),y=({fan_table:e})=>(0,i.jsx)(l.A,{flexDirection:"row",justifyContent:"center",gap:s.S2,children:e.sort(E).map(e=>(0,i.jsx)(v,{fan:e},e.index))});var M=t(203071);const T=({psu_table:e=[],fan_table:n=[]})=>e.length>0?(0,i.jsx)(a.A,{type:a.I.ACCORDION,items:[{id:"powerSource",openByDefault:!0,label:(0,i.jsx)(o.A,{id:n.length?"DEVICE_HEADER_POWER_AND_FAN_UTILIZATION":"DEVICE_HEADER_POWER_UTILIZATION"}),renderContent:()=>(0,i.jsxs)(l.A,{flexDirection:"column",gap:s.Ln,children:[(0,i.jsx)(M.A,{psuTable:e,marginBottom:0}),n.length?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.A,{}),(0,i.jsx)(y,{fan_table:n})]}):null]})}]}):null},203071(e,n,t){t.d(n,{A:()=>O});var i=t(274934),r=t(602086),s=t(713035),o=t(548941),l=t(505817),a=t(505753),d=t(651172),c=t(179102),m=t(711950),A=t(247816),x=t(263705),p=t(662986),u=t(309130),_=t(100978),j=t(453007),h=t(470070),E=t(314229),g=t(820510);const C=(0,A.A)(_.A)`
  justify-content: space-between;
`,I=(0,A.A)(d.A)`
  margin: 0 6px;
  height: 10px;
`,N=(0,A.A)(m.A)`
  margin: 0 6px;
`,f=({index:e,item:n})=>(0,i.jsxs)(g.m,{children:[(0,i.jsx)(g.Y,{id:"COMMON_POWER_SUPPLY_UNIT",values:{psuIndex:""},children:e+1}),n.temp?Object.entries(n.temp).map(([e,n])=>(0,i.jsxs)(g.Y,{id:"DEVICE_TEMPERATURE_SENSOR",values:{index:+e+1},children:[n?.toFixed(1)||(0,i.jsx)(h.sA,{id:"COMMON_FALLBACK"})," ",(0,i.jsx)(h.sA,{id:"COMMON_UNIT_CELSIUS"})]},e)):null,n.fanSpeed?(0,i.jsxs)(g.Y,{id:"DEVICE_FAN_SPEED",children:[n.fanSpeed," ",(0,i.jsx)(h.sA,{id:"COMMON_UNIT_RPM"})]}):null]}),O=({psuTable:e=[],marginBottom:n})=>{const{themeName:t,motifPalette:d}=(0,x.u)(),{motif:m}=(0,s.A)(),{formatMessage:A}=(0,h.tz)(),g=(0,r.useMemo)(()=>e.map(({power:n,power_capacity:r,temp:s,fan:x,present:u,online:g,label:O},w)=>{const k=r||550,v=Math.ceil(Number.parseFloat(n)/k*100),y={variant:(0,E.NH)(v),value:v,temp:s,fanSpeed:x?.[0],online:g,present:u},M=e?.[w]?.power;return(0,i.jsxs)(_.A,{flexDirection:"column",children:[(0,i.jsxs)(C,{children:[(0,i.jsx)(c.A,{color:"text-2",size:"medium",children:(0,i.jsx)(h.sA,{id:"COMMON_POWER_SUPPLY_UNIT",values:{psuIndex:w+1}})}),(0,i.jsx)(_.A,{justifyContent:"space-between",alignItems:"center",children:y.present?(0,i.jsxs)(i.Fragment,{children:[y.online||y.value?null:(0,i.jsx)(o.A,{description:A({id:"DEVICE_USW_MC_PSU_OFFLINE_TOOLTIP"},{index:w+1}),portal:!0,children:(0,i.jsx)(N,{size:"original",variant:"fill",color:l.Ay[`desktop-color-orange-06-${t}`],fill:l.Ay[`desktop-color-neutral-00-${t}`]})}),y.online?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.A,{color:"text-3",size:"medium",children:(0,i.jsx)(h.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:`${Math.ceil(Number.parseFloat(M))}/${k}`}})}),(0,i.jsx)(I,{orientation:"vertical",color:l.Ay[`desktop-color-neutral-04-${t}`]}),(0,i.jsx)(j.A,{size:"medium",colorOverride:y.value?d[y.variant]:l.Ay[`desktop-color-text-3-${m}`],children:(0,p.A)(y.value)})]}):null]}):(0,i.jsx)(c.A,{color:"text-3",size:"medium",children:(0,i.jsx)(h.sA,{id:"DEVICE_NOT_INSTALLED"})})})]}),(0,i.jsx)(o.A,{description:y.present?(0,i.jsx)(f,{index:w,item:y}):null,width:250,children:(0,i.jsx)(a.A,{items:[y],rounded:!0})})]},O)}),[e]);return(0,i.jsx)(_.A,{flexDirection:"column",marginBottom:n??u.kI,gap:u.kc,children:g})}},384780(e,n,t){t.d(n,{A:()=>F});var i=t(274934),r=t(505817),s=t(977872),o=t(602086),l=t(548941),a=t(645759),d=t(711950),c=t(263705),m=t(244081),A=t(112104),x=t(61322),p=t(449339),u=t(974390),_=t(650632),j=t(535322),h=t(205521),E=t(347625),g=t(754924),C=t(223597),I=t(34118),N=t(239627),f=t(645682),O=t(254590),w=t(857780);const k=({name:e,mac:n,model:t})=>e===n&&t?t:e,v=e=>{switch(e?.uplink?.type){case w.au.WIRE:return e?.connection_network_name||O.L;case w.au.WIRELESS:return e?.connection_network_name||e?.uplink?.essid||O.L;default:return O.L}};var y,M=t(526744),T=t(594005),D=t(309130),R=t(156007);!function(e){e.NAME="name",e.PORT="port",e.NETWORK="network"}(y||(y={}));const b={[y.NAME]:"COMMON_NAME",[y.PORT]:"COMMON_PORT",[y.NETWORK]:"COMMON_NETWORK"};var L=t(100978),S=t(470070),P=t(850352);const $=({port:e,mac:n})=>{const{handleGoToPortsPage:t}=(0,P.e)();return(0,i.jsx)(M.A,{variant:"inline",type:"button",size:"medium",onClick:()=>{t(n,e)},children:e})},F=({activeItem:e})=>{const{themeName:n}=(0,c.u)(),t=(0,s.wA)(),O=(0,s.d4)(g.ID),w=(0,o.useMemo)(()=>((e,n)=>(e||[]).map(e=>{const t=n.find(({mac:n})=>n===e.mac||n===e.ap_mac);return t?{...e,id:t._id,name:(0,E.Q)(t),activeItem:t,model:(0,E.Lm)(t.model)}:null}).filter(Boolean))(e.downlink_table,O),[e.downlink_table,O]),M=(0,s.d4)((0,I.Ax)(e.mac)).filter(e=>e.type===C.sK.WIRED);(0,o.useEffect)(()=>{t((0,N.$3)(void 0,{crudCacheStrategy:{type:m.e.CACHE}}))},[t]);const P=(0,o.useMemo)(()=>M.map(e=>({id:`${e.id}${e.sw_port}`,name:e.display_name,mac:e.mac,network:e.network_name,port:e.sw_port,image:(0,i.jsx)(_.A,{client:e}),isClient:!0})),[M]),F=(0,o.useMemo)(()=>w.map(({id:e,name:t,mac:s,port_idx:o,activeItem:a})=>({id:`${e}${o}`,name:k({name:t,mac:a.mac,model:a.model}),mac:s,network:v(a),port:o,image:(0,i.jsx)(u.A,{model:a.model}),isClient:!1,warning:a.detailed_states?.negotiated_low_uplink_port_speed?(0,i.jsx)(l.A,{portal:!0,description:(0,i.jsx)(f.A,{color:"text-1"}),children:(0,i.jsx)(d.A,{size:"medium",color:r.Ay[`desktop-color-orange-06-${n}`]})}):void 0,stacking_group_id:a.stacking_group_id})),[w,r.Ay[`desktop-color-orange-06-${n}`]]),U=(0,o.useMemo)(()=>Array.prototype.concat.apply([],[P,F]),[F,P]),V=(0,o.useMemo)(()=>(({mac:e})=>[{id:y.NAME,label:(0,i.jsx)(S.sA,{id:b[y.NAME]}),renderCell:({image:e,name:n})=>(0,i.jsxs)(L.A,{alignItems:"center",justifyContent:"center",width:"100%",children:[(0,i.jsx)(L.A,{alignItems:"center",justifyContent:"center",height:"20px",width:"20px",children:e}),(0,i.jsx)(R.A,{color:"inherit",size:"medium",style:{width:"170px",paddingLeft:"6px",paddingRight:"6px"},children:n})]}),width:170,compare:(0,T.l0)(({name:e})=>e)},{id:y.NETWORK,label:(0,i.jsx)(S.sA,{id:b[y.NETWORK]}),renderCell:({network:e})=>(0,i.jsx)(R.A,{color:"inherit",size:"medium",children:e}),width:112,compare:(0,T.l0)(({network:e})=>e)},{id:y.PORT,align:"right",label:(0,i.jsx)(S.sA,{id:b[y.PORT]}),renderCell:({port:n,warning:t})=>(0,i.jsxs)(L.A,{justifyContent:"flex-end",alignItems:"center",flexGrow:1,children:[(0,i.jsx)(L.A,{marginTop:-2,marginRight:D.YC,children:t}),(0,i.jsx)($,{port:n,mac:e})]}),width:54,compare:(0,T.l0)(({port:e})=>e)}])({mac:e.mac}),[e.mac]),W=(0,o.useCallback)(({mac:e,isClient:n,stacking_group_id:i})=>{t((0,h.XP)({type:n?p.H.CLIENT:i?p.H.STACKING:p.H.DEVICE,id:i||e}))},[t]),{rowLimit:H,renderFooter:z}=(0,A.A)(U.length,{defaultCount:10});return U.length?(0,i.jsx)(j.A,{children:(0,i.jsx)(a.A,{items:U,columns:V,idField:"id",initialSortBy:"port",initiallySortAscending:!0,disableColumnFilters:!0,rowOffset:0,disableSelection:!0,onRowClick:W,rowLimit:H,renderFooter:()=>z,rowHeight:x.I.ROW_HEIGHT,truncateHeaderCells:!0})}):null}}}]);