"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[27852],{602381(e,s,n){var i,t;n.d(s,{Z:()=>t,e:()=>i}),function(e){e.WIRED="WIRED",e.WIRELESS="WIRELESS"}(i||(i={})),function(e){e.CAPTURING="CAPTURING",e.STOP_CAPTURING="STOP_CAPTURING",e.UPLOADING="UPLOADING",e.READY_TO_DOWNLOAD="READY_TO_DOWNLOAD",e.TIMEOUT="TIMEOUT"}(t||(t={}))},189042(e,s,n){n.d(s,{A:()=>b});var i=n(274934),t=n(977872),r=n(602086),d=n(244081),o=n(586566),a=n(441318),c=n(996077),l=n(539453),_=n(553732),A=n(897166),u=n(147433),p=n(247816),x=n(669439),m=n(648175),h=n(470070),E=n(956978),j=n(434521),O=n(45978),C=n(147045);const N=(0,p.A)("span")`
  width: 100%;
`,w=({activeItem:e,onClick:s,disabledWithReason:n,[C.L]:t})=>{const r=(e=>{const s=(0,j.S9)(e);return e.disabled||s!==O.g.CONNECTED||!(0,E.sc7)(s)?"DEVICE_PCAP_DISABLED_TOOLTIP":null})(e)||n;return(0,i.jsx)(x.A,{description:r?(0,i.jsx)(h.sA,{id:r}):void 0,children:(0,i.jsx)(N,{...t&&{[C.L]:t},children:(0,i.jsx)(m.A,{onClick:s,isDisabled:!!r,width:"full",children:(0,i.jsx)(h.sA,{id:"COMMON_PACKET_CAPTURE"})})})})};var v=n(205521),T=n(449339),I=n(590979),P=n(231083),g=n(409844),R=n(309130),f=n(100978);const D=g.AH`
  &:empty {
    display: none;
  }
`,M=(0,p.A)("div")`
  flex: 1 1 0;
  min-width: 33%;
  box-sizing: border-box;
  padding-right: ${R.kc};

  &:last-child {
    padding-right: 0;
  }
`,W=({children:e,...s})=>(0,i.jsx)(f.A,{marginTop:R.kc,className:D,...s,children:r.Children.map(e,e=>e?(0,i.jsx)(M,{className:D,children:e}):null)}),b=({activeItem:e,showPortsButton:s,showCaptureButton:n})=>{const p=(0,t.wA)(),x=(0,t.d4)(A.vc),m=(0,t.d4)(a.ar),h=n&&x===e.mac&&m&&(0,o.W4)(e,u.A.PCAP),E=s&&e.port_table?.length>0;(0,r.useEffect)(()=>{p((0,_.Sk)(void 0,{crudCacheStrategy:{type:d.e.CACHE}})),p((0,l.hh)(void 0,{crudCacheStrategy:{type:d.e.CACHE}}))},[p]);const j=(0,r.useCallback)(()=>{p((0,v.XP)({type:T.H.PACKET_CAPTURE,id:e.mac,customData:{captureDeviceType:c.X.GATEWAY}}))},[p,e.mac]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(W,{children:[E?(0,i.jsx)(P.A,{mac:e.mac}):null,h?(0,i.jsx)(w,{activeItem:e,captureDeviceType:c.X.GATEWAY,onClick:j,...I.A.addDataTestId(I.A.TestId.SIDE_PANEL_TRIGGER)}):null]})})}},996077(e,s,n){var i,t;n.d(s,{A:()=>i,X:()=>t}),function(e){e.DEFAULT="default",e.IN_PROGRESS="inProgress",e.READY="ready",e.DOWNLOADING="downloading",e.STOPPING="stopping"}(i||(i={})),function(e){e.AP="ap",e.GATEWAY="gateway"}(t||(t={}))},441318(e,s,n){n.d(s,{VQ:()=>v,ar:()=>I,ax:()=>P,r8:()=>g});var i=n(222102),t=n(430328),r=n(197719),d=n(254590),o=n(243436),a=n(910577),c=n(407386),l=n(423564),_=n(581814),A=n(197571),u=n(267142),p=n(644533),x=n(754924),m=n(544691),h=n(602381),E=n(996077);const j=[_.rR.CORPORATE,_.rR.GUEST],O=e=>void 0===e||e,C=({_id:e,name:s,enabled:n,ip_subnet:i,ipv6_subnet:t,wan_networkgroup:r,vpn_type:o,purpose:a,l2tp_interface:c,openvpn_interface:_,wireguard_interface:A,ipsec_interface:p,sdwan_hub_spoke_local_wan_id:x},m)=>({_id:e,enabled:O(n),name:s||d.L,ip_subnet:m?d.L:(0,l.Qe)({ip_subnet:i,ipv6_subnet:t},u.L),wan_networkgroup:r,vpn_type:o,ipsec_interface:p,l2tp_interface:c,openvpn_interface:_,purpose:a,sdwan_hub_spoke_local_wan_id:x,wireguard_interface:A}),N=(e,s)=>e?e===r.C.WAN?s.wan1:s[e.toLocaleLowerCase()]||{}:{},w=(e,s=h.e.WIRELESS)=>(0,i.Mz)(A.Ct,a.Ag,(0,m.a5)(e),x.fq,x.Dx,(e,n,i,t,r)=>{const d=n.reduce((e,{enabled:s,networkconf_id:n,ap_group_ids:t=[]})=>(s&&i.some(({_id:e})=>t.includes(e))&&e.push(n),e),[]);return e.reduce((e,n)=>(p.A.includes(n.purpose)&&(d.includes(n._id)||s===h.e.WIRED)&&e.push(C(n,(0,o.cH)({gateway_device:n.gateway_device,purpose:n.purpose},t,r))),e),[])}),v=(e,s=h.e.WIRELESS)=>(0,i.Mz)(w(e,s),e=>Boolean(e.length)),T=(0,t.WY)()((0,i.Mz)(A.Ct,x.U$,c.$D,x.AL,(e,s,n,i)=>[...e.reduce((e,n)=>(n&&s.network_table?.some(({_id:e})=>e===n._id)&&O(n.enabled)&&n.gateway_type!==_.xk.SWITCH&&j.includes(n.purpose)&&e.push(C(n)),e),[]),...n.reduce((e,{configuration:n={}})=>{if((({purpose:e,wan_networkgroup:s},n)=>{if(e!==_.rR.WAN)return!1;if(s===r.C.WAN_LTE_FAILOVER)return!0;const i=N(s,n);return!!i?.up})(n,s)){let t;if(n.wan_networkgroup===r.C.WAN_LTE_FAILOVER)t=i?.lte_ip;else{const e=N(n.wan_networkgroup,s);t=e?.ip}e.push({...C(n),...t?{ip_subnet:t}:{}})}return e},[])]),e=>e),I=(0,t.WY)()((0,i.Mz)(T,e=>Boolean(e.length)),e=>e),P=(e,s,n)=>{switch(s){case E.X.AP:return n===h.e.WIRELESS?w(e,n):(e=>(0,i.Mz)((0,x.tG)(e),A.Ct,x.fq,x.Dx,(e,s,n,i)=>{if(!e.connection_network_id)return[];const t=s.find(({_id:s})=>s===e.connection_network_id);return t?[C(t,(0,o.cH)({gateway_device:t.gateway_device,purpose:t.purpose},n,i))]:[]}))(e);case E.X.GATEWAY:return T;default:return()=>[]}},g=e=>(0,i.Mz)(a.Ag,s=>{const n=s.filter(s=>s.networkconf_id===e);return[...new Set(n.flatMap(e=>e.wlan_bands))]})},664613(e,s,n){n.d(s,{A:()=>_});var i=n(274934),t=n(179102),r=n(664453),d=n(309130),o=n(100978),a=n(470070),c=n(956978),l=n(664092);const _=({sys_stats:e,flexProps:s,withTooltip:n,compact:_=!1})=>{const A=(0,c.eiG)(e);return A?(0,i.jsxs)(l.A,{flexProps:s,compact:_,children:[(0,i.jsx)(t.A,{color:"text-2",size:"medium",children:(0,i.jsx)(a.sA,{id:"COMMON_LOAD_AVERAGE"})}),n?(0,i.jsxs)(o.A,{alignItems:"center",gap:d.YC,children:[(0,i.jsx)(t.A,{color:"text-3",size:"medium",children:A}),(0,i.jsx)(r.A,{description:(0,i.jsx)(a.sA,{id:"DEVICE_PROPERTY_OVERVIEW_LOAD_AVERAGE_TOOLTIP"}),placement:"top start"})]}):(0,i.jsx)(t.A,{color:"text-3",size:"medium",children:A})]}):null}},382583(e,s,n){n.d(s,{A:()=>A});var i=n(274934),t=n(602086),r=n(179102),d=n(775250),o=n(977872),a=n(156007),c=n(470070),l=n(197571),_=n(664092);const A=({connection_network_id:e})=>{const s=(0,o.d4)(l.Tn),n=(0,t.useMemo)(()=>e?s.find(s=>s._id===e):void 0,[s,e]);return n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(_.A,{children:[(0,i.jsx)(r.A,{color:"text-2",size:"medium",children:(0,i.jsx)(c.sA,{id:"COMMON_NETWORK"})}),(0,i.jsx)(a.A,{color:"text-3",size:"medium",flexProps:{justifyContent:"flex-end"},children:n.name})]}),null!=n.vlan?(0,i.jsxs)(_.A,{children:[(0,i.jsx)(r.A,{color:"text-2",size:"medium",children:(0,i.jsx)(c.sA,{id:"COMMON_VLAN_ID"})}),(0,i.jsx)(d.A,{color:"text-3",size:"medium",isTruncated:!0,children:n.vlan})]}):null]}):null}},766022(e,s,n){n.d(s,{A:()=>o});var i=n(274934),t=n(179102),r=n(470070),d=n(664092);const o=({totalPower:e})=>e?(0,i.jsxs)(d.A,{children:[(0,i.jsx)(t.A,{color:"text-2",size:"medium",children:(0,i.jsx)(r.sA,{id:"DEVICE_HEADER_POWER_CONSUMPTION"})}),(0,i.jsx)(t.A,{color:"text-3",size:"medium",children:(0,i.jsx)(r.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:e.toFixed(1)}})})]}):null},23377(e,s,n){n.d(s,{A:()=>f});var i=n(274934),t=n(977872),r=n(602086),d=n(684935),o=n(237887),a=n(733360),c=n(197719),l=n(309130),_=n(100978),A=n(535322),u=n(470070),p=n(407386),x=n(51411),m=n(853109),h=n(886140),E=n(127347);var j=n(352510),O=n(179102),C=n(346949),N=n(320509),w=n(570203),v=n(635187),T=n(664092),I=n(631692),P=n(924453),g=n(906701);const R=({uplinkAttrs:e,configuration:s={wan_dns1:void 0,wan_dns2:void 0,wan_dhcpv6_pd_size:void 0,wan_type_v6:void 0,wan_prefixlen:void 0},details:n={},gatewayPort:{ipv6:t=[]}={}})=>{const{ip:r,speed:d,rx_packets:o,rx_bytes:a,tx_packets:c,tx_bytes:l,"rx_bytes-r":A,"tx_bytes-r":p,mac:x}=e||{};return(0,i.jsxs)(_.A,{height:"100%",flexDirection:"column",children:[r?(0,i.jsxs)(T.A,{children:[(0,i.jsx)(O.A,{size:"medium",children:(0,i.jsx)(u.sA,{id:"COMMON_IP_ADDRESS"})}),(0,i.jsx)(O.A,{size:"medium",color:"text-3",children:r})]}):null,t.length?(0,i.jsx)(g.A,{ipv6_address:t,wan_dhcpv6_pd_size:s.wan_type_v6===w.c.SLAAC||s.wan_type_v6===w.c.DHCPV6?s.wan_dhcpv6_pd_size:void 0}):null,(0,i.jsx)(P.A,{mac:x}),(0,i.jsx)(I.A,{portSpeed:d}),n.service_provider?.name?(0,i.jsxs)(T.A,{children:[(0,i.jsx)(O.A,{size:"medium",children:(0,i.jsx)(u.sA,{id:"COMMON_ISP"})}),(0,i.jsx)(O.A,{size:"medium",color:"text-3",children:n.service_provider.name})]}):null,(0,i.jsxs)(i.Fragment,{children:[s.wan_dns1?(0,i.jsxs)(T.A,{children:[(0,i.jsx)(O.A,{color:"text-2",size:"medium",children:(0,i.jsx)(u.sA,{id:"COMMON_DNS_SERVER_N",values:{n:1}})}),(0,i.jsx)(O.A,{color:"text-3",size:"medium",children:s.wan_dns1})]}):null,s.wan_dns2?(0,i.jsxs)(T.A,{children:[(0,i.jsx)(O.A,{color:"text-2",size:"medium",children:(0,i.jsx)(u.sA,{id:"COMMON_DNS_SERVER_N",values:{n:2}})}),(0,i.jsx)(O.A,{color:"text-3",size:"medium",children:s.wan_dns2})]}):null]}),o&&a?(0,i.jsxs)(T.A,{children:[(0,i.jsx)(O.A,{size:"medium",children:(0,i.jsx)(u.sA,{id:"COMMON_DOWN_PKTS_BYTES"})}),(0,i.jsxs)(O.A,{size:"medium",color:"text-3",children:[(0,j.A)(o,{spacer:v.HY})," / ",(0,N.z3)(a)]})]}):null,c&&l?(0,i.jsxs)(T.A,{children:[(0,i.jsx)(O.A,{size:"medium",children:(0,i.jsx)(u.sA,{id:"COMMON_UP_PKTS_BYTES"})}),(0,i.jsxs)(O.A,{size:"medium",color:"text-3",children:[(0,j.A)(c,{spacer:v.HY})," / ",(0,N.z3)(l)]})]}):null,(0,i.jsxs)(T.A,{children:[(0,i.jsx)(O.A,{size:"medium",children:(0,i.jsx)(u.sA,{id:"DEVICE_PROPERTY_UPLINK_DOWN_ACTIVITY"})}),(0,i.jsx)(O.A,{size:"medium",color:"text-3",children:void 0!==A?(0,i.jsx)(C.A,{type:"bytes",input:A,options:"bitrate",size:"body",color:"inherit"}):(0,i.jsx)(u.sA,{id:"COMMON_FALLBACK"})})]}),(0,i.jsxs)(T.A,{children:[(0,i.jsx)(O.A,{size:"medium",children:(0,i.jsx)(u.sA,{id:"DEVICE_PROPERTY_UPLINK_UP_ACTIVITY"})}),(0,i.jsx)(O.A,{size:"medium",color:"text-3",children:void 0!==p?(0,i.jsx)(C.A,{type:"bytes",input:p,options:"bitrate",size:"body",color:"inherit"}):(0,i.jsx)(u.sA,{id:"COMMON_FALLBACK"})})]})]})},f=({activeItem:e})=>{const{formatMessage:s}=(0,u.tz)(),n=((e,s)=>{const n=(e.port_table||[]).filter(({up:e})=>e);return Object.values(E.s).reduce((i,t)=>{const r=1===(0,a.si)(t)?c.C.WAN:t.toUpperCase();if(n.find(({ifname:s})=>s===(0,x.KF)(r,{ethernet_overrides:e.ethernet_overrides,model:e.model,usg_caps:e.usg_caps,usg2_caps:e.usg2_caps}))||(d=e[t],d?.type===h.YT)){const n=(0,m.q$)(e,t);n&&i.push({wanNetworkGroup:r,uplinkAttrs:n,...(()=>{const{configuration:e={},details:n={}}=s.find(({configuration:{wan_networkgroup:e}})=>e===r)||{};return{configuration:e,details:n}})(),gatewayPort:e[t]})}var d;return i},[])})(e,(0,t.d4)(p.ht)),j=(0,r.useMemo)(()=>n.map(({wanNetworkGroup:e})=>({id:e,label:s({id:"COMMON_NETWORK_PURPOSE_WANX"},{number:(0,a.si)(e)})})),[s,n]),O=(0,r.useMemo)(()=>n.map(({wanNetworkGroup:e,configuration:s={}})=>({value:e,label:s.name||"",additionalInfo:(0,i.jsx)(u.sA,{id:"COMMON_NETWORK_PURPOSE_WANX",values:{number:(0,a.si)(e)}})})),[n]),[C,N]=(0,r.useState)(n?.[0]?.wanNetworkGroup||c.C.WAN),w=n.length<=4,v=(0,r.useMemo)(()=>n.find(({wanNetworkGroup:e})=>e===C)||{},[n,C]),T=(0,r.useMemo)(()=>[{id:"wan",openByDefault:!0,label:(0,i.jsx)(u.sA,1===j.length?{id:"COMMON_NETWORK_PURPOSE_WANX",values:{number:1}}:{id:"COMMON_NETWORK_PURPOSE_WAN"}),renderContent:()=>(0,i.jsxs)(i.Fragment,{children:[j.length>1?(0,i.jsx)(_.A,{paddingBottom:l.kc,inline:w,children:w?(0,i.jsx)(d.A,{tabs:j,variant:"filter",onSelectTab:({id:e})=>{N(e)},selectedTab:C}):(0,i.jsx)(o.A,{options:O,width:"100%",variant:"secondary",value:C,onChange:({value:e})=>{N(e)}})}):null,(0,i.jsx)(R,{...v})]})}],[j,w,O,C,N,v]);return v?(0,i.jsx)(A.A,{type:A.I.ACCORDION,items:T}):null}},872926(e,s,n){n.d(s,{A:()=>A});var i=n(274934),t=n(977872),r=n(810024),d=n(589650),o=n(748094),a=n(470070),c=n(754924),l=n(726831);const _=({adopted:e})=>(0,i.jsx)(o.A,{link:l.A.virtualNetworkConnectivity,children:(0,i.jsx)(a.sA,{id:e?"DEVICE_FALLBACK_IP_ADOPTED_WITH_UNIFI_GATEWAY_WARNING":"DEVICE_FALLBACK_IP_NOT_ADOPTED_WARNING",values:{bold:(0,i.jsx)("strong",{children:(0,i.jsx)(a.sA,{id:e?"DEVICE_WARNING_FALLBACK_IP":"DEVICE_WARNING_ADOPTION_FAILED"})})}})}),A=({ip:e,adopted:s,config_network:n})=>(0,t.d4)(c.m9)&&(0,r.W5)(e)&&n?.type===d.NL.DHCP?(0,i.jsx)(_,{adopted:s}):null}}]);