"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[83550],{260449(e,t,i){i.d(t,{A:()=>A});var n=i(274934),r=i(505817),s=i(602086),o=i(179102),a=i(711950),c=i(263705),l=i(309130),d=i(620627),m=i(793442),_=i(100978),u=i(470070),p=i(726831);const A=(0,s.memo)(({children:e,isWire:t=!0})=>{const{themeName:i}=(0,c.u)();return(0,n.jsx)(d.A,{icon:(0,n.jsx)(a.A,{size:"original",color:r.Ay[`desktop-color-orange-06-${i}`],variant:"fill"}),children:(0,n.jsxs)(_.A,{flexDirection:"column",gap:l.kc,children:[(0,n.jsx)(o.A,{size:"medium",color:"text-2",children:(0,n.jsx)(u.sA,{id:t?"COMMON_DEVICE_OFFLINE_WARNING":"COMMON_DEVICE_OFFLINE_WIFI_WARNING",values:{b:u.b,link:(0,n.jsx)(m.A,{href:p.A.offlineArticle,id:"COMMON_LEARN_MORE",noWrap:!0})}})}),e]})})})},249295(e,t,i){i.d(t,{A:()=>A});var n=i(274934),r=i(896743),s=i(775250),o=i(247816),a=i(409844),c=i(347625),l=i(309130),d=i(100978),m=i(885404),_=i(974390);const u=a.AH`
  margin-bottom: ${l.Ln};
  margin-top: ${l.Ln};
`,p=(0,o.A)("div")`
  align-self: center;
  overflow: hidden;
  word-break: break-word;
`,A=({children:e,description:t,meshingDescription:i,isOffline:o,activeItem:A,style:E,className:N,isStacking:g,badge:f})=>(0,n.jsx)(r.A,{className:(0,a.cx)(u,N),sections:[(0,n.jsxs)("div",{children:[(0,n.jsxs)(d.A,{gap:l.kc,children:[g?(0,n.jsx)(m.A,{size:40}):(0,n.jsx)(_.A,{model:A.model,width:40,height:40}),(0,n.jsxs)(p,{style:E,children:[(0,n.jsxs)(s.A,{color:o?"text-3":"text-1",weight:"bold",isTruncated:!0,children:[(0,c.Lm)(A.model),f]}),t]})]}),i,e]})]})},383550(e,t,i){i.d(t,{A:()=>Q});var n=i(274934),r=i(602086),s=i(977872),o=i(247816),a=i(179102),c=i(309130),l=i(969819),d=i(423564),m=i(613609),_=i(100978),u=i(470070),p=i(197571),A=i(857780),E=i(263705),N=i(378767),g=i(620627),f=i(468898),k=i(358935),v=i(505817),h=i(775250);const x=(0,o.A)(_.A)`
  flex-direction: column;
  margin-top: ${c.kc};
  padding-top: ${c.kc};
  border-top: ${({theme:{themeName:e}})=>v.Ay[`desktop-border-divider-${e}`]};
`,I=(0,o.A)(_.A)`
  width: 100%;
  justify-content: space-between;
`,C=(0,o.A)(_.A)`
  gap: ${c.Ln};
  align-items: center;
`,j=(0,o.A)(h.A)`
  max-width: 150px;
`,w=(0,r.memo)(({mac:e,replacementMac:t})=>{const i=(0,s.wA)(),[o,c]=(0,r.useState)(!1),l=(0,r.useCallback)(()=>{c(!0),i((0,k.X2)(e)).finally(()=>{c(!1)})},[i,e]);return(0,n.jsx)(x,{children:(0,n.jsxs)(I,{children:[(0,n.jsx)(j,{isTruncated:!0,size:"medium",color:"text-2",children:(0,n.jsx)(u.sA,{id:"DEVICE_REPLACEMENT_DEVICE"})}),(0,n.jsxs)(C,{children:[(0,n.jsx)(a.A,{size:"medium",color:"text-3",children:t}),(0,n.jsx)(f.A,{actionable:!0,onClick:l,disabled:o})]})]})})}),O=(0,o.A)(_.A)`
  flex-direction: column;
  gap: ${c.kc};
`;var L=i(830990),M=i(711950);const b=({state:e},{uBlue06:t,orange06:i})=>e===A.gQ.WAITING_FOR_REPLACEMENT?(0,n.jsx)(L.A,{size:"original",color:t,variant:"fill"}):(0,n.jsx)(M.A,{size:"original",color:i,variant:"fill"}),P=({state:e})=>{switch(e){case A.gQ.WAITING_FOR_REPLACEMENT:return"DEVICE_REPLACEMENT_PENDING_WAITING_FOR_REPLACEMENT";case A.gQ.WAITING_FOR_REPLACED_DEVICE_DISCONNECT:return"DEVICE_REPLACEMENT_PENDING_WAITING_FOR_REPLACED_DEVICE_DISCONNECT";case A.gQ.INCOMPATIBLE_REPLACEMENT:return"DEVICE_REPLACEMENT_PENDING_INCOMPATIBLE_REPLACEMENT";default:return"DEVICE_REPLACEMENT_PENDING_CANNOT_REPLACE"}},T=(0,r.memo)(({mac:e,replacement:t})=>{const{motifPalette:i}=(0,E.u)();return t?.device_mac?(0,n.jsx)(N.A,{children:(0,n.jsxs)(g.A,{icon:b(t,i),children:[(0,n.jsx)(O,{children:(0,n.jsx)(a.A,{size:"medium",color:"text-2",children:(0,n.jsx)(u.sA,{id:P(t),values:{b:u.b}})})}),(0,n.jsx)(w,{mac:e,replacementMac:t.device_mac})]})}):null});var D=i(999837),R=i(451336),F=i(260449),S=i(159911),V=i(326841),y=i(562896),$=i(249295),W=i(83597),G=i(231083);const z=(0,o.A)(_.A)`
  & > :first-child {
    margin-top: ${c.kc};
  }
`,B=({device:e})=>{const t=(0,s.d4)(p.wf),i=(0,s.d4)(p.Tn),r=e.mgmt_network_id,o=r&&r!==t,c=(0,l.ki)(o?e:void 0,r);if(!o||!c.hasConflict)return null;const m=i.find(e=>e._id===r),_=m?(0,d.gm)(m):r;return(0,n.jsx)(a.A,{size:"medium",color:"text-2",children:(0,n.jsx)(u.sA,{id:"DEVICE_OFFLINE_CHECK_NETWORK_OVERRIDE",values:{networkName:_}})})},Q=({activeItem:e,activeItem:{deviceState:t,uplink:i,mac:s,model:o,type:a,replacement:l},showPortOverview:d,hidePortsButton:_,isStacking:u,multipleDisplayedDevicesData:p,overviewChildren:E,children:N,badge:g,hideUpdate:f,connectionStatusOverride:k})=>{const v=(0,r.useMemo)(()=>k||(0,S.H)(t,i?.type),[k,t,i?.type]),h=Boolean(e?.port_table?.length),x=d&&h;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)($.A,{activeItem:e,isOffline:v===y.v.OFFLINE,description:(0,n.jsx)(R.A,{activeItem:e,connectionStatus:v}),meshingDescription:(0,n.jsx)(V.A,{activeItem:e,connectionStatus:v}),isStacking:u,badge:g,children:[E,x?(0,n.jsx)("div",{style:{marginTop:c.Ln},children:(0,n.jsx)(m.A,{activeItem:e,disableOnPortClick:!0,showFullScreenDiagramButton:!1,useBubbleWrapper:!1,multipleDisplayedDevicesData:p,isStacking:u})}):null,(0,n.jsxs)(z,{gap:c.kc,flexDirection:"column",children:[f?null:(0,n.jsx)(W.A,{activeItem:e}),!_&&h?(0,n.jsx)(G.A,{mac:s}):null]}),N]}),v===y.v.OFFLINE?(0,n.jsxs)(F.A,{isWire:i?.type===A.au.WIRE,children:[l?.device_mac?null:(0,n.jsx)(D.A,{mac:s,model:o,type:a}),(0,n.jsx)(B,{device:e})]}):null,(0,n.jsx)(T,{mac:s,replacement:l})]})}},378767(e,t,i){i.d(t,{A:()=>o});var n=i(274934),r=i(977872),s=i(897166);const o=({children:e=null})=>(0,r.d4)(s.EL)?null:(0,n.jsx)(n.Fragment,{children:e})},969819(e,t,i){i.d(t,{GJ:()=>N,Sn:()=>j,US:()=>n,Xs:()=>C,af:()=>g,bO:()=>v,gJ:()=>h,j5:()=>f,ki:()=>I,uj:()=>x});var n,r=i(602086),s=i(977872),o=i(466241),a=i(826022),c=i(340820),l=i(904614),d=i(423564),m=i(857780),_=i(754924),u=i(197571),p=i(347625),A=i(831433);!function(e){e.WIFI="wifi",e.MGMT="mgmt",e.VNO="vno"}(n||(n={}));const E=(e,t)=>{if(e?.port_table&&null!=t)return e.port_table.find(e=>e.port_idx===t)},N=(e,t)=>!(!e||!t||(0,a.cd)(t,e.tagged_vlan_mgmt,e.native_networkconf_id,e.excluded_networkconf_ids)),g=(e,t)=>!(!e||!t||t===e.native_networkconf_id||e.tagged_vlan_mgmt===m.sg.BLOCK_ALL||e.tagged_vlan_mgmt===m.sg.CUSTOM&&e.excluded_networkconf_ids?.includes(t)),f=(e,t,i,n)=>!(!e||e===i)&&t!==m.sg.BLOCK_ALL&&(t!==m.sg.CUSTOM||n?.includes(e)||!1),k=(e,t)=>{const i=t.find(t=>t._id===e);return i?(0,d.gm)(i):e},v=e=>e.find(e=>e.attr_no_delete&&"LAN"===e.attr_hidden_id)?._id,h=({mac:e,devicesMap:t,wlanConfigs:i,apGroups:r,networks:s,clients:a,defaultNetworkId:d,isVlanCarried:m,isWifiVlanTagged:_,isNativeVlan:u,seen:E,base:N})=>{const g=[],f=t.get(e);if(f&&(e=>(0,c.j)(e.model)?.deviceCapabilities?.includes(o.t.ACCESS_POINT)??!1)(f)){const t=((e,t,i)=>t.filter(t=>{if(!t.enabled)return!1;if(t.ap_group_mode===l.qq.ALL)return!0;const n=new Set(t.ap_group_ids??[]);return i.some(t=>n.has(t._id)&&t.device_macs?.includes(e))}))(e,i,r),o=_||m;for(const i of t){const t=i.networkconf_id;if(!t||t===d)continue;const r=`${e}:${t}`;E.has(r)||(E.add(r),o(t)||g.push({networkName:k(t,s),entityName:(0,p.Q)(f),reason:n.WIFI,isNativeVlanConflict:u?.(t)||!1,...N}))}const c=a.filter(t=>"ap_mac"in t&&t.ap_mac===e);for(const e of c){if(!("virtual_network_override_enabled"in e)||!e.virtual_network_override_enabled)continue;const t=e.virtual_network_override_id;if(!t||t===d)continue;const i=`${e.mac}:vno:${t}`;E.has(i)||(E.add(i),m(t)||g.push({networkName:k(t,s),entityName:(0,A.tn)(e)||e.mac,reason:n.VNO,...N}))}}if(f?.mgmt_network_id){const t=f.mgmt_network_id;if(t!==d){const i=`${e}:mgmt:${t}`;E.has(i)||(E.add(i),m(t)||g.push({networkName:k(t,s),entityName:(0,p.Q)(f),reason:n.MGMT,...N}))}}if(!f){const t=a.find(t=>"mac"in t&&t.mac===e);if(t&&"virtual_network_override_enabled"in t&&t.virtual_network_override_enabled){const i=t.virtual_network_override_id;if(i&&i!==d){const r=`${e}:vno:${i}`;E.has(r)||(E.add(r),m(i)||g.push({networkName:k(i,s),entityName:(0,A.tn)(t)||e,reason:n.VNO,...N}))}}}return g},x=(e,t)=>{const i=e.uplink?.uplink_mac??e.last_uplink?.uplink_mac,n=e.uplink?.uplink_remote_port??e.last_uplink?.uplink_remote_port,r=e.uplink?.port_idx??e.last_uplink?.port_idx,s=i?t.get(i):void 0;return{localPort:E(e,r),remotePort:E(s,n)}},I=(e,t)=>{const i=(0,s.d4)(_.Kh);return(0,r.useMemo)(()=>{if(!e||!t)return{hasConflict:!1,localPortMissing:!1,remotePortMissing:!1};const{localPort:n,remotePort:r}=x(e,i),s=!!r&&!g(r,t),o=!!n&&!g(n,t);return{hasConflict:s||o,localPortMissing:o,remotePortMissing:s}},[e,t,i])},C=(e,t,i,n,r)=>{if(!e)return;if(null!=t){const s=n.get(e),o=E(s,t);if(!o||g(o,i))return;return{networkName:k(i,r),switchName:(0,p.Q)(s??{mac:e}),port:t}}const s=n.get(e),o=s?.uplink?.uplink_mac??s?.last_uplink?.uplink_mac,a=s?.uplink?.uplink_remote_port??s?.last_uplink?.uplink_remote_port;if(!o||null==a)return;const c=n.get(o),l=E(c,a);return l&&!g(l,i)?{networkName:k(i,r),switchName:(0,p.Q)(c??{mac:o}),port:a,apName:(0,p.Q)(s??{mac:e})}:void 0},j=(e,t,i,n)=>{const o=(0,s.d4)(_.Kh),a=(0,s.d4)(u.Tn);return(0,r.useMemo)(()=>{if(n&&i)return C(e,t,i,o,a)},[n,e,t,i,o,a])}}}]);