"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[89965,99969],{34662:(e,t,r)=>{r.d(t,{A:()=>D});var n=r(469733),a=r(296540),l=r(927099),o=r(963070),i=r(897547),c=r(71479),s=r(960407),m=r(398300),E=r(855019),d=r(294303),_=r(955161),p=r(689965),u=r(845030),A=r(699784),O=r(170163),T=r(56437),g=r(436953),R=r(325530);const I=(0,c.A)(i.A)`
  position: absolute;
  right: 8px;
  color: inherit;
`,b=(0,c.A)("div")`
  table {
    tr {
      cursor: pointer;
    }
  }
`,h=e=>a.createElement(p.A,null,e),D=({activeItem:e,onRowClick:t,isInSection:r})=>{const i=(0,n.useDispatch)(),c=(0,n.useSelector)(s.oI),p=e.rps?.rps_port_table?.map(({port_idx:t})=>({id:t,...(0,O.Z4)(e,t)})),D=(0,a.useCallback)(({id:r})=>{p.some(({port_state:e})=>e)&&(t?t(String(r)):i((0,u.XP)({type:m.H.DEVICE,id:e.mac,tab:c,subPanel:E.uY.RPS_OUTLETS,subId:String(r)})))},[e.mac,c,i,p,t]),P=(0,a.useMemo)(()=>{return t=e.mac,[{id:"name",label:a.createElement(A.sA,{id:"COMMON_NAME"}),renderCell:({name:e})=>a.createElement(l.A,{color:"inherit",size:"body",truncate:!0},e)},{id:"outletStatus",label:a.createElement(A.sA,{id:"COMMON_STATUS"}),width:45,renderCell:e=>{let r;return e.port_mode===T.c.DISABLED&&(r="COMMON_DISABLED"),e.port_state&&(r=(0,R.x)(e.port_state)),a.createElement(a.Fragment,null,a.createElement(d.A,{alignItems:"center"},a.createElement(g.A,{activeItemMac:t,cellData:e,isTableItem:!0}),a.createElement(l.A,{color:"inherit",size:"body"},a.createElement(A.sA,{id:r||"COMMON_INITIALIZING"}),r?null:a.createElement(l.A,{color:"inherit",size:"body"},"..."))),a.createElement(I,{size:"small"}))}}];var t},[e.mac]);return p?.length?a.createElement(_.A,{condition:!r,wrapper:h},a.createElement(b,null,a.createElement(o.A,{columns:P,items:p,disableColumnFilters:!0,hideCellOverflow:!1,onRowClick:D,truncateHeaderCells:!0}))):null}},56437:(e,t,r)=>{var n,a;r.d(t,{c:()=>a,e:()=>n}),function(e){e.INITIALIZING="initializing",e.DISCONNECTED="disconnected",e.SEARCHING="searching",e.BOUND="bound",e.STANDBY="standby",e.POWER_DELIVERING="power_delivering",e.OUT_OF_POWER_BUDGET="out_of_power_budget",e.POWER_OVERLOAD="power_overload",e.BLOCKED="blocked"}(n||(n={})),function(e){e.AUTO="auto",e.MANUAL="manual",e.DISABLED="disabled"}(a||(a={}))},86571:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(296540),a=r(217439),l=r(699784);const o=({id:e,children:t,values:r})=>n.createElement(a.A,{color:"text-1",weight:"bold",size:"medium"},e?n.createElement(l.sA,{id:e,values:r}):null,t)},167579:(e,t,r)=>{r.d(t,{A:()=>n});const n=[12,54]},170163:(e,t,r)=>{r.d(t,{ST:()=>O,FP:()=>T,o3:()=>d,Z4:()=>I,Ib:()=>A,I:()=>_,F9:()=>N,eV:()=>C,Yk:()=>h,y$:()=>P,AD:()=>D,Yf:()=>b,eq:()=>R,hf:()=>g});var n=r(847439),a=r(967431),l=r(101617),o=r(860631),i=r(325752),c=r(953394),s=r(56437),m=r(167579);var E=r(557260);const d=(e,t=0,r=void 0)=>{let n=(e.outlet_table||[])[t]||{index:t,has_relay:!1,has_metering:!1,relay_state:!1,cycle_enabled:!1},a=(e.outlet_overrides||[])[t]||{};return void 0!==r&&(n=(e.outlet_table||[]).find(e=>e.index===r),a=(e.outlet_overrides||[]).find(e=>e.index===r)),(0,o.sQ)(e,E.A.AUTO_RELAY)&&e.vbms_table?.battpool?{...n}:{...n,...a}},_=(e,t)=>e&&Object.keys(e).find(r=>e[r]&&e[r].includes(t))||c.s.STANDARD,p=(e,t)=>{return(l[e]?.outlets?.meta||{})[(r=t,r.toString().padStart(2,"0"))]||{};var r},u=e=>{if(e){if(Array.isArray(e))return e;let t;const r=String(e);if(/^[0-9]+$/.test(r)?t={start:0,end:parseInt(r,10)}:/^([0-9]+)-([0-9]+)$/.test(r)&&(t={start:parseInt(r.split("-")[0],10),end:parseInt(r.split("-")[1],10)}),t)return(0,n.A)(t.end-t.start+1,e=>e+t.start)}return[]},A=e=>{const t=l[e]?.outlets;return{[c.s.STANDARD]:u(t?.[c.s.STANDARD]),[c.s.USB]:u(t?.[c.s.USB]),[c.s.LAN]:u(t?.[c.s.LAN]),[c.s.RJ45]:u(t?.[c.s.RJ45]),[c.s.WAN]:u(t?.[c.s.WAN]),[c.s.SURGE]:u(t?.[c.s.SURGE])}},O=(e,t)=>{const r=A(t);let a=2;e<=5&&(a=1);const l=Math.ceil(e/a);return(0,n.A)(a,e=>(0,n.A)(l,n=>{const l=n*a+e+1,o=_(r,l),i=p(t,l);return l?{outletNumber:l,outletType:o,iconRotation:i.rotation,centerIcon:i.center,portIdx:i.portIdx,nonClickable:i.nonClickable,marginLeft:i.marginLeft}:void 0}))},T=(e,t)=>{const r=A(t);return e.map(e=>e.split(" ").map(e=>{const n=e.split("-"),a=parseInt(n[0],10);if(Number.isNaN(a))return;const{rotation:l,center:o,portIdx:i,nonClickable:s,marginLeft:m,surgeType:E,vertical:d}=p(t,a);return{outletNumber:a,outletType:_(r,a),iconRotation:l,centerIcon:o,portIdx:i,nonClickable:s,surgeType:E,marginLeft:m,subOutlets:n.length>1?n.map(e=>"__"===e?void 0:parseInt(e,10)):void 0,vertical:d,showBatteryPowered:Boolean(r[c.s.STANDARD]?.length&&r[c.s.SURGE]?.length)}}))},g=({outlet_table:e=[],outlet_ac_power_budget:t=String(1875),outlet_ac_power_consumption:r=String(0)})=>{const n=(0,a.A)(Number(t),2),l=(0,a.A)(Number(r),2);let o=0;e.forEach(({outlet_current:e})=>{o+=Number(e)||0});const i={usedPower:l,maxPower:n,totalCurrent:(0,a.A)(o,2),usedPowerPercentage:l/n*100,barVariant:"primary"};return i.usedPowerPercentage>81&&(i.barVariant="warning"),i},R=(e,t)=>{if(t)switch(e.index){case 1:return 3;case 2:return 4;case 3:return 1;case 4:return 2}},I=({rps:e,rps_override:t},r=0)=>({...(e?.rps_port_table||[]).find(e=>e?.port_idx===r)||{},...(t?.rps_port_table||[]).find(e=>e?.port_idx===r)||{}}),b=e=>{switch(!0){case e?.port_state===s.e.OUT_OF_POWER_BUDGET:case e?.port_state===s.e.BLOCKED:case e?.anomalies>0:return i.FZ.WARNING;case e?.power_delivering:return i.FZ.POWER_DELIVERING;case e?.high_priority:return i.FZ.HIGH_PRIORITY;default:return}},h=e=>{const t=[];return e.port_mode===s.c.DISABLED||([s.e.OUT_OF_POWER_BUDGET,s.e.BLOCKED].includes(e?.port_state)||e?.anomalies>0?t.push(i.FZ.WARNING):(e?.power_delivering&&t.push(i.FZ.POWER_DELIVERING),e?.high_priority&&t.push(i.FZ.HIGH_PRIORITY),(e?.power_12v_batt_guard||e?.power_54v_batt_guard)&&t.push(i.FZ.BATTERY_PROTECTED))),t},D=e=>e?.anomalies&&0!==e?.anomalies||e?.port_error_disabled?"red06":e.port_state===s.e.OUT_OF_POWER_BUDGET?"neutral00":e?.power_active||e.port_mode===s.c.DISABLED?e?.power_active&&e.port_mode!==s.c.DISABLED?"success":e.port_mode===s.c.DISABLED?"":"neutral04":"neutral07",P=e=>{if(!(e?.anomalies&&0!==e?.anomalies||e?.port_error_disabled))return e.port_state===s.e.OUT_OF_POWER_BUDGET?"neutral05":e.port_mode===s.c.DISABLED?"neutral04":void 0},S=(e,t)=>({id:t?.port_idx,peer:t?.peer,powerRequired:t?.port_state===s.e.STANDBY?Number(t?.peer?.[`power_required_${e}v`]||0):Number(t?.[`power_${e}v_power`]||0)}),N=e=>m.A.map(t=>{const r={voltage:t,utilizationActive:!1,backup:{sum:0,total:0,ports:[]},delivering:{sum:0,total:0,ports:[]}};return(e?.rps_port_table||[]).forEach(e=>{e?.port_state===s.e.STANDBY&&e?.peer[`power_required_max_${t}v`]>0&&(r.backup.ports.push(S(t,e)),r.backup.sum+=e?.peer[`power_required_${t}v`]||0),e?.port_state===s.e.POWER_DELIVERING&&e?.[`power_${t}v_power`]>0&&r.delivering.ports.push(S(t,e))}),r.backup.total=Math.max(e?.[`power_supply_${t}v`],r.backup.sum),r.delivering.sum=e?.[`power_delivering_${t}v`],r.delivering.total=e?.[`power_supply_${t}v`],(r.delivering.sum||r.backup.sum)&&(r.utilizationActive=!0),r}),C=(e,t)=>{const r=N(e),n=t?.[0]?.relay_state?+(t?.[0]?.outlet_power||0):0,a=r.findIndex(e=>e.voltage===m.A[1]);return n&&a>-1&&(r[a].utilizationActive=!0,r[a].delivering.sum+=n,r[a].delivering.outlet={id:"1",powerRequired:n}),r}},175734:(e,t,r)=>{r.d(t,{A:()=>A});var n=r(296540),a=r(162420),l=r(71479),o=r(566723),i=r(294303),c=r(699784),s=r(170163),m=r(780811),E=r(436953);const d=(0,l.A)(i.A)`
  font-size: ${({theme:{fontSizes:e}})=>e[0]}px;
`,_=(0,l.A)(i.A)`
  &:not(:first-child) {
    margin-top: ${o.YC};
  }
`,p=(0,l.A)(a.A)`
  margin-right: ${o.xO};
`,u=(0,l.A)("div")`
  width: 5px;
`,A=({activeItem:e,activeItem:{model:t,mac:r},multiIcon:a,disableOnPortClick:l})=>{const{rps:{diagram:o,primaryPortGroupCount:i}}=(0,m.joB)(t),A=o.length?(0,s.FP)(o,e.model):(0,s.ST)(i,e.model);return A&&0!==A.length?n.createElement(n.Fragment,null,A.map((t,o)=>n.createElement(_,{justifyContent:"center",width:"100%",key:`RpsOutletLayoutRow-${o+1}`},t.map((t,i)=>t?n.createElement(E.A,{activeItemMac:r,cellData:(0,s.Z4)(e,t.outletNumber),key:`RpsOutlet-${o+1}-${i+1}`,multiIcon:a,disableOnPortClick:l}):n.createElement(u,{key:`RpsOutletSpacer-${o+1}-${i+1}`}))))):n.createElement(d,null,n.createElement(p,{isActive:!0}),n.createElement(c.sA,{id:"DEVICE_DIAGRAM_MISSING"}))}},216211:(e,t,r)=>{r.d(t,{e:()=>d});var n=r(956347),a=r(469733),l=r(296540),o=r(15095),i=r(627440),c=r(431247),s=r(293016),m=r(649413),E=r(497470);const d=()=>{const e=(0,a.useDispatch)(),t=(0,n.W6)(),r=(0,o.A)(`${i.VO.PORTS}`);return{handleGoToPortsPage:(0,l.useCallback)((n,a,l)=>{if(n)if(e((0,E.gU)(!0)),e((0,E.U)((0,m.HN)(s.F7.DEVICE,[n]))),l&&(e((0,E.IU)(!0)),e((0,E.E1)(!1))),a){const t=(0,c.FS)(n,a);e((0,E.Ao)([t]))}else e((0,E.Ao)([]));t.push(r)},[r,t,e])}}},325530:(e,t,r)=>{r.d(t,{x:()=>a});var n=r(56437);const a=e=>{switch(e){case n.e.INITIALIZING:return"COMMON_INITIALIZING";case n.e.DISCONNECTED:return"COMMON_DISCONNECTED";case n.e.SEARCHING:return"COMMON_SEARCHING";case n.e.BOUND:return"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_BOUND";case n.e.STANDBY:return"COMMON_ENABLED";case n.e.POWER_DELIVERING:return"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_POWER_DELIVERING";case n.e.OUT_OF_POWER_BUDGET:return"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_OUT_OF_POWER_BUDGET";case n.e.POWER_OVERLOAD:return"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_POWER_OVERLOAD";case n.e.BLOCKED:return"COMMON_BLOCKED";default:return"COMMON_UNKNOWN"}}},388925:(e,t,r)=>{r.r(t),r.d(t,{default:()=>M});var n=r(296540),a=r(689965),l=r(87250),o=r(275357),i=r(175734),c=r(406816),s=r(71479);const m=(e,t)=>Object.keys(t).filter(t=>parseInt(t,10)&e).map(e=>t[e]),E={1:"RPS_PORT_12V_OUT_OF_BUDGET",2:"RPS_PORT_54V_OUT_OF_BUDGET",4:"RPS_PORT_12V_OVERLOAD",8:"RPS_PORT_54V_OVERLOAD",16:"RPS_PORT_POWER_DENIED_PSU_12V_OVERLOAD",32:"RPS_PORT_POWER_DENIED_PSU_54V_OVERLOAD",64:"RPS_PORT_BLOCKED"},d={RPS_PORT_OUT_OF_BUDGET_SOLUTION:["RPS_PORT_12V_OUT_OF_BUDGET","RPS_PORT_54V_OUT_OF_BUDGET"],RPS_PORT_OVERLOAD_SOLUTION:["RPS_PORT_12V_OVERLOAD","RPS_PORT_54V_OVERLOAD"],RPS_PORT_POWER_DENIED_PSU_OVERLOAD_SOLUTION:["RPS_PORT_POWER_DENIED_PSU_12V_OVERLOAD","RPS_PORT_POWER_DENIED_PSU_54V_OVERLOAD"],RPS_PORT_BLOCKED_SOLUTION:["RPS_PORT_BLOCKED"]};var _=r(927099),p=r(345410),u=r(758649),A=r(823858),O=r(618983),T=r(566723),g=r(294303),R=r(699784),I=r(765562);const b=(0,s.A)(g.A)`
  padding: 10px 0;
`,h=(0,s.A)("ul")`
  padding-left: 22px;
  margin-top: 6px;
  margin-bottom: 0;
  li {
    margin-bottom: ${({theme:{spacing:e}})=>e["spacing-xs"]};
    span {
      line-height: 16px;
    }
  }

  li:last-child {
    margin-bottom: 0;
  }
`,D=(0,s.A)(O.A)`
  color: ${({theme:{motifPalette:{success:e}}})=>e};
  margin-right: 9px;
  width: 18px;
  height: 18px;
`,P=(0,s.A)(A.A)`
  color: ${({theme:{motifPalette:{danger:e}}})=>e};
  margin-right: 9px;
  width: 18px;
  height: 18px;
`,S=(0,s.A)("div")`
  margin: ${T.Er} 0;
`,N=({anomalies:e})=>{const{formatMessage:t}=(0,R.tz)(),[r,a]=(0,n.useState)(!1),l=(0,n.useMemo)(()=>t({id:"COMMON_AND"}),[t]),o=Object.keys(e).filter(t=>e[t].length),i=o.length;return n.createElement(n.Fragment,null,o.slice(0,r?i:2).map(t=>n.createElement(g.A,{marginTop:4,flexDirection:"column"},n.createElement(b,{flexDirection:"column"},n.createElement(g.A,{alignItems:"flex-start"},n.createElement(P,null),n.createElement(_.A,null,n.createElement(p.A,{weight:"bold",color:"danger"},n.createElement(R.sA,{id:"RPS_ANOMALY_PROBLEM"})))),n.createElement(h,null,e[t].map(e=>{const t={ports:(r=e.values.ports,[r.slice(0,-1).join(", "),r.slice(-1)].filter(Boolean).join(` ${l} `)),count:e.values.ports.length,b:R.b};var r;return n.createElement("li",{key:`rps-problem-${e.problem}-${t.count}`},n.createElement(R.sA,{id:`${e.problem}_PROBLEM`,values:t}))}))),n.createElement(b,{flexDirection:"column"},n.createElement(g.A,{alignItems:"flex-start"},n.createElement(D,null),n.createElement(_.A,null,n.createElement(p.A,{weight:"bold",color:"success"},n.createElement(R.sA,{id:"RPS_ANOMALY_SOLUTION"})))),n.createElement(h,null,n.createElement("li",{key:`rps-solution-${t}`},n.createElement(R.sA,{id:t,values:{link:n.createElement("a",{href:I.A.supportUi,target:"_blank",rel:"noopener noreferrer"},new URL(I.A.supportUi).host),b:R.b}})))))),n.createElement(S,null,n.createElement(R.sA,{id:"RPS_ANOMALY_FOOTER_RECORDS",values:{length:i>2&&!r?2:i,total:i}}),i>2?n.createElement(n.Fragment,null," ",n.createElement(u.A,{type:"button",variant:"inline",size:"small",weight:"bold",onClick:()=>{a(!r)}},n.createElement(R.sA,{id:"COMMON_SHOW"})," ",n.createElement(R.sA,{id:r?"COMMON_LESS":"COMMON_ALL"}))):null))},C=(0,s.A)("div")`
  padding-top: 16px;
`,v=({activeItem:e})=>{const t=((e,t,r)=>{const n=Object.keys(r);return(e?.rps?.anomalies_details?.map(e=>({problem:m(e.anomaly,t)[0],values:{ports:e.ports}}))||[]).reduce((e,t)=>{const a=n.find(e=>r[e].includes(t.problem));return e[a]=e[a]||[],e[a].push(t),e},{})})(e,E,d);return Object.keys(t).length?n.createElement(a.A,null,n.createElement(C,null,n.createElement(N,{anomalies:t}))):null};var L=r(540739),f=r(525901),w=r(470995),y=r(34662);const M=({activeItem:e,activeItem:{mac:t,model:r}})=>n.createElement(n.Fragment,null,n.createElement(a.A,null,n.createElement(i.A,{activeItem:e})),n.createElement(a.A,null,n.createElement(c.Ay,{activeItem:e})),n.createElement(v,{activeItem:e}),n.createElement(y.A,{activeItem:e}),n.createElement(f.A,{mac:t,model:r,logType:L.F.DEVICE,ignoreActionableValues:[o.dl.DEVICE],label:"COMMON_HISTORY",hideClientTabs:!0}),n.createElement(w.A,{mac:t,object:l.qv.SW}))},406816:(e,t,r)=>{r.d(t,{Ay:()=>I,Jv:()=>R,Vf:()=>g,cs:()=>O});var n=r(296540),a=r(822336),l=r(118818),o=r(217439),i=r(985550),c=r(383704),s=r(823858),m=r(19058),E=r(71479),d=r(998837),_=r(566723),p=r(294303),u=r(699784),A=r(780811);const O=(0,E.A)("div",{shouldForwardProp:e=>"noTopBorder"!==e})`
  display: grid;
  grid-template-columns: repeat(3, minmax(min-content, 1fr));
  grid-gap: ${_.YC};
  margin-top: ${_.Ln};
  ${({noTopBorder:e,theme:{themeName:t}})=>e?"":`\n  padding-top: ${_.Ln};\n  border-top: ${a.Ay[`desktop-border-divider-${t}`]};\n  `}
`,T=(0,E.A)(p.A)`
  color: ${({theme:{motifPalette:{text02:e}}})=>e};

  > span {
    white-space: nowrap;
  }
`,g=(0,E.A)(l.A,{shouldForwardProp:e=>!["background","borderColor"].includes(e)})`
  background-color: ${e=>e.background};
  border-radius: 1px;
  border: ${({borderColor:e})=>e&&`1px solid ${e}`};
`,R=({label:e,icon:t})=>n.createElement(T,{alignItems:"center",gap:_.YC},n.createElement(p.A,{width:16,justifyContent:"center"},t),n.createElement(o.A,{size:"small",color:"text-3"},e)),I=(0,n.memo)(({activeItem:e,noTopBorder:t})=>{const r=(0,A.Tl7)(e),a=(0,A.kYz)(e),l=(0,A.aR8)(e),o=(0,A.FeX)(e),{motifPalette:{neutral04:E,neutral07:_,neutral03:p,neutral08:T,warning:I,lime06:b}}=(0,d.u)();return n.createElement(O,{noTopBorder:t},n.createElement(R,{icon:n.createElement(g,{variant:"success"}),label:n.createElement(u.sA,{id:"COMMON_ENABLED"})}),n.createElement(R,{icon:n.createElement(g,{borderColor:E,background:"transparent"}),label:n.createElement(u.sA,{id:"COMMON_DISABLED"})}),r||a||l||o?n.createElement(R,{icon:n.createElement(g,{background:_}),label:n.createElement(u.sA,{id:"COMMON_DISCONNECTED"})}):null,a?n.createElement(R,{icon:n.createElement(g,{background:p}),label:n.createElement(u.sA,{id:"DEVICE_OUTLET_STATE_NO_STATUS"})}):null,r||a?n.createElement(R,{icon:n.createElement(g,{background:b}),label:n.createElement(u.sA,{id:"DEVICE_PORT_STATE_MBPS",values:{speed:"100/10"}})}):null,l||o?n.createElement(n.Fragment,null,n.createElement(R,{icon:n.createElement(c.A,{size:"small",color:T}),label:n.createElement(u.sA,{id:"DEVICE_OUTLET_STATE_DELIVERING"})}),n.createElement(R,{icon:n.createElement(s.A,{size:"small",color:I}),label:n.createElement(u.sA,{id:"DEVICE_OUTLET_STATE_WARNING"})}),n.createElement(R,{icon:n.createElement(g,{variant:"danger"}),label:n.createElement(u.sA,{id:"DEVICE_OUTLET_STATE_ERROR"})})):null,o?n.createElement(n.Fragment,null,n.createElement(R,{icon:n.createElement(i.A,{size:"small",color:T}),label:n.createElement(u.sA,{id:"DEVICE_OUTLET_STATE_HIGH_PRIORITY"})}),n.createElement(R,{icon:n.createElement(m.A,{size:"small",color:T}),label:n.createElement(u.sA,{id:"DEVICE_BATTERY_TYPE_EXTERNAL"})})):null)})},436953:(e,t,r)=>{r.d(t,{A:()=>N});var n=r(469733),a=r(296540),l=r(271856),o=r(927099),i=r(71479),c=r(273299),s=r(6510),m=r(960407),E=r(398300),d=r(566723),_=r(855019),p=r(213601),u=r(294303),A=r(845030),O=r(699784),T=r(170163),g=r(56437),R=r(532419),I=r(167579),b=r(325530);const h=(0,i.A)(l.A,{shouldForwardProp:e=>"color"!==e&&"isTableItem"!==e})`
  width: ${({isTableItem:e})=>e?"20px":"90px"};
  height: ${({isTableItem:e})=>e?"20px":"18px"};
  align-items: center;
  background-color: ${({color:e,theme:{motifPalette:t}})=>t[e]};
  border-radius: 2px;
  color: #fff;
  justify-content: center;
  display: flex;
  position: relative;
  ${({isTableItem:e})=>e&&"margin-right: 8px;"}

  border: ${({theme:{motifPalette:e},borderColor:t})=>t?`1px solid ${e[t]}`:"none"};

  &:not(:first-child) {
    margin-left: ${d.YC};
  }
`,D=(0,i.A)("div")`
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

  svg {
    max-width: 70%;
    max-height: 70%;
  }
`,P=(0,i.A)("div")`
  width: initial;
  position: relative;
  height: 100%;

  > div {
    position: initial;
    width: 18px;
  }
`,S=(0,i.A)(o.A)`
  max-width: 140px;
`,N=({activeItemMac:e,cellData:t,isTableItem:r=!1,multiIcon:l,disableOnPortClick:i})=>{const N=(0,n.useDispatch)(),C=(0,n.useSelector)(m.oI),v=(0,n.useSelector)(R.ID).find(e=>e.mac===t.peer?.mac),L=(0,s.Q)(v),f=(0,s.Lm)(v?.model)||t.peer?.model,w=(0,T.Yf)(t),y=(0,T.Yk)(t),M=(0,T.AD)(t),x=(0,T.y$)(t),U=(0,a.useCallback)(r=>{r?.preventDefault?.(),r?.stopPropagation?.(),i||N((0,A.XP)({type:E.H.DEVICE,id:e,tab:C,subPanel:_.uY.RPS_OUTLETS,subId:String(t.port_idx)}))},[N,C,e,t.port_idx,i]);return a.createElement(h,{color:M,borderColor:x,onClick:U,width:v?240:200,isTableItem:r,description:a.createElement(u.A,{flexDirection:"column",justifyContent:"space-between",width:"100%"},t?.port_state===g.e.OUT_OF_POWER_BUDGET?a.createElement(u.A,{marginBottom:d.kc},a.createElement(o.A,{size:"caption",weight:"bold"},a.createElement(O.sA,{id:"DEVICE_PROPERTIES_RPS_TOOLTIP_VALUE_STATE_OUT_OF_POWER_BUDGET_DESCRIPTION",values:{peer:L||a.createElement(O.sA,{id:"COMMON_DEVICE"})}}))):null,a.createElement(u.A,{justifyContent:"space-between"},a.createElement(o.A,{size:"caption",color:"secondary"},a.createElement(O.sA,{id:"COMMON_PORT"})),a.createElement(o.A,{size:"caption",color:"secondary"},t.port_idx)),a.createElement(u.A,{justifyContent:"space-between",alignItems:"center",gap:d.YC},a.createElement(o.A,{size:"caption",color:"secondary"},a.createElement(O.sA,{id:"COMMON_NAME"})),a.createElement(o.A,{size:"caption",color:"secondary",truncate:!0},t?.name)),t?.port_mode?a.createElement(u.A,{justifyContent:"space-between"},a.createElement(o.A,{size:"caption",color:"secondary"},a.createElement(O.sA,{id:"COMMON_MODE"})),a.createElement(o.A,{size:"caption",color:"secondary"},(0,c.Z)(t.port_mode))):null,t?.port_state?a.createElement(u.A,{justifyContent:"space-between"},a.createElement(o.A,{size:"caption",color:"secondary"},a.createElement(O.sA,{id:"COMMON_STATE"})),a.createElement(o.A,{size:"caption",color:"secondary"},a.createElement(O.sA,{id:(0,b.x)(t.port_state)}))):null,t?.up?I.A.map(e=>a.createElement("div",{key:e},a.createElement(u.A,{justifyContent:"space-between"},a.createElement(o.A,{size:"caption",color:"secondary",weight:"bold"},a.createElement(O.sA,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:e}}))),a.createElement(u.A,{justifyContent:"space-between"},a.createElement(o.A,{size:"caption",color:"secondary"},a.createElement(O.sA,{id:"COMMON_CURRENT"})),a.createElement(o.A,{size:"caption",color:"secondary"},a.createElement(O.sA,{id:"COMMON_UNIT_AMPERES_SHORT",values:{value:t[`power_${e}v_current`]}}))),a.createElement(u.A,{justifyContent:"space-between"},a.createElement(o.A,{size:"caption",color:"secondary"},a.createElement(O.sA,{id:"COMMON_VOLTAGE"})),a.createElement(o.A,{size:"caption",color:"secondary"},a.createElement(O.sA,{id:"COMMON_UNIT_VOLTAGE_SHORT",values:{value:t[`power_${e}v_voltage`]}}))),a.createElement(u.A,{justifyContent:"space-between"},a.createElement(o.A,{size:"caption",color:"secondary"},a.createElement(O.sA,{id:"COMMON_POWER"})),a.createElement(o.A,{size:"caption",color:"secondary"},a.createElement(O.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:t[`power_${e}v_power`]}}))))):null,t.peer||v?a.createElement(a.Fragment,null,a.createElement(u.A,{justifyContent:"space-between"},a.createElement(o.A,{size:"caption",color:"secondary",weight:"bold"},a.createElement(O.sA,{id:"DEVICE_PROPERTIES_RPS_TOOLTIP_PEER"}))),L||t.peer?.hostname?a.createElement(u.A,{justifyContent:"space-between",gap:d.YC},a.createElement(o.A,{size:"caption",color:"secondary"},a.createElement(O.sA,{id:"COMMON_NAME"})),a.createElement(S,{size:"caption",color:"secondary",truncate:!0},L||t.peer?.hostname)):null,t.peer.mac?a.createElement(u.A,{justifyContent:"space-between"},a.createElement(o.A,{size:"caption",color:"secondary"},a.createElement(O.sA,{id:"COMMON_MAC"})),a.createElement(o.A,{size:"caption",color:"secondary"},t.peer.mac)):null,f?a.createElement(u.A,{justifyContent:"space-between",gap:d.YC},a.createElement(o.A,{size:"caption",color:"secondary"},a.createElement(O.sA,{id:"COMMON_MODEL"})),a.createElement(S,{size:"caption",color:"secondary",truncate:!0},f)):null,I.A.map(e=>a.createElement(u.A,{key:e,justifyContent:"space-between"},a.createElement(o.A,{size:"caption",color:"secondary"},a.createElement(O.sA,{id:"DEVICE_PROPERTIES_RPS_TOOLTIP_PEER_POWER_REQUIRED",values:{voltage:e}})),a.createElement(o.A,{size:"caption",color:"secondary"},a.createElement(O.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:t.peer?.[`power_required_${e}v`]}}))))):null),portal:!0},l?a.createElement(a.Fragment,null,y.map(e=>a.createElement(P,{key:e},a.createElement(p.A,{icon:e,smallerIcons:!0})))):a.createElement(D,null,t.port_mode!==g.c.DISABLED?a.createElement(p.A,{icon:w,smallerIcons:!0}):null))}},689965:(e,t,r)=>{r.d(t,{A:()=>_,I:()=>n});var n,a=r(296540),l=r(822336),o=r(427853),i=r(71479),c=r(825032),s=r(566723),m=r(294303);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(n||(n={}));const E=(0,i.A)(m.A,{shouldForwardProp:e=>!["marginBottom","isButtonList","margin","flex","width","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:r}})=>e||l.Ay[r===c.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:r})=>r||(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}})=>l.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,d=(0,i.A)(o.A,{shouldForwardProp:e=>!["marginBottom","margin","flex","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:r}})=>e||l.Ay[r===c.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||l.Ay[t===c.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${s.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0 ${s.Ln} ${s.Ln};
      > div {
        padding: 0;
      }
    }
  }
`,_=({type:e,marginBottom:t,margin:r,padding:l,flex:o,width:i,nested:c,...s})=>"items"in s?a.createElement(d,{marginBottom:t,margin:r,padding:l,flex:o,nested:c,...s}):a.createElement(E,{nested:c,width:i,marginBottom:t,margin:r,padding:l,flex:o,isButtonList:e===n.BUTTON_LIST,...s},s.children)},953394:(e,t,r)=>{var n;r.d(t,{s:()=>n}),function(e){e.STANDARD="standard",e.USB="usb",e.LAN="lan",e.WAN="wan",e.RJ45="rj45",e.SURGE="surge"}(n||(n={}))}}]);