"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[83885],{385273(e,t,i){i.d(t,{Mi:()=>f,Bp:()=>g,lc:()=>O,Eg:()=>b,Wm:()=>I});var n=i(801081),s=i(189601),o=i(834959),r=i(282556),a=i(807516),l=i(532419),_=i(691294),c=i(239417),d=i(943887),p=i(903216),m=i(6510),E=i(951106);const u=(e,t,i,n)=>{const s=(0,E.ei)(t,e),o="oui"in e?e.oui:void 0,r=(0,c.lP)(i,"fingerprint"in e?e.fingerprint:void 0),a=r?.fingerprint_device_vendor,l=r?.fingerprint_device_name,u={id:e.id,ip:e.ip,name:e.name,display_name:e.display_name,type:e.type,uplink:s,uplinkName:s&&(0,m.Q)(s)||"",vendor:(a?String(a):o)||void 0,fingerprint_device_name:l||void 0,assoc_time:e.assoc_time,status:e.status,tags:e.tags};switch(u.type){case _.sK.TELEPORT:e.type===_.sK.TELEPORT&&(u.uniqueId=e.id,u.search_connection=n.COMMON_TELEPORT);break;case _.sK.VPN:e.type===_.sK.VPN&&(u.uniqueId=e.id,u.remote_ip=e.remote_ip,u.network_id=e.network_id,u.network_name=e.network_name,u.search_connection=n.COMMON_VPN,u["rx_bytes-r"]=e["rx_bytes-r"],u["tx_bytes-r"]=e["tx_bytes-r"]);break;case _.sK.WIRED:e.type===_.sK.WIRED&&(u.is_wired=e.is_wired,u.sw_port=e.sw_port,u.wired_rate_mbps=e.wired_rate_mbps,u.ipv4_lease_expiration_timestamp_seconds=e.ipv4_lease_expiration_timestamp_seconds,u.last_connection_network_name=e.last_connection_network_name,u.last_ip=e.last_ip,u.search_connection=n.COMMON_WIRED,u.search_wired_experience=(0,p.ir)(e.wired_rate_mbps),u.ipv6_address=e.ipv6_address?e.ipv6_address:[]);break;case _.sK.WIRELESS:e.type===_.sK.WIRELESS&&(u.ap_mac=e.ap_mac,u.channel=e.channel,u.channel_width=e.channel_width,u.essid=e.essid,u.eagerly_discovered=e.eagerly_discovered,u.radio=e.radio,u.radio_proto=e.radio_proto,u.fixed_ap_enabled=e.fixed_ap_enabled,u.mimo=e.mimo,u.ipv4_lease_expiration_timestamp_seconds=e.ipv4_lease_expiration_timestamp_seconds,u.last_connection_network_name=e.last_connection_network_name,u.last_ip=e.last_ip,u.signal=e.signal,u.search_connection=n.COMMON_WIRELESS,u.search_wifi_standard=(0,E.z0)(e.radio_proto),u.search_radio_band=n[(0,d.dI)(e.radio)],u.is_mlo=e.is_mlo,u.mlo_details=e.mlo_details,u.wifi_experience_score=e.wifi_experience_score,u.ipv6_address=e.ipv6_address?e.ipv6_address:[],u.wifi_tx_retries_percentage=e.wifi_tx_retries_percentage||0)}return u.type!==_.sK.VPN&&u.type!==_.sK.TELEPORT&&e.type!==_.sK.VPN&&e.type!==_.sK.TELEPORT&&(u.uniqueId=`${e.id}-${e.assoc_time}`,u.blocked=e.blocked,u.fingerprint=e.fingerprint,u.first_seen=e.first_seen,u.last_seen=60*Math.floor((e.last_seen||0)/60),u.hostname=e.hostname,u.is_guest=e.is_guest,u.mac=e.mac,u.note=e.note,u.network_id=e.network_id,u.network_name=e.network_name,u.network_members_group_ids=e.network_members_group_ids,u.oui=e.oui,u.uplink_mac=s?.mac||e.uplink_mac,u.unifi_device_info=e.unifi_device_info,u.usage_bytes=e.usage_bytes,u["1x_identity"]=e["1x_identity"],u.vlan=e.vlan,u.use_fixedip=e.use_fixedip,u.fixed_ip=e.fixed_ip,u.local_dns_record_enabled=e.local_dns_record_enabled,u.local_dns_record=e.local_dns_record,u["rx_bytes-r"]=e["rx_bytes-r"],u["tx_bytes-r"]=e["tx_bytes-r"],u.ups_device=e.ups_device),u},v=(e,t,i,n)=>{const s=e.length,r=[],a=new Set;for(let l=0;l<s;l+=1){const s=e[l];s.type!==_.sK.VPN&&s.type!==_.sK.TELEPORT&&s.unifi_device||a.has(s.id)||(r.push(u(s,t,i,n[o.B.COMMON])),a.add(s.id))}return r},I=(0,s.WY)()((0,n.Mz)(c.A8,l.gt,a.y1,(0,r.AF)([o.B.COMMON]),v),e=>e),b=(0,s.WY)()((0,n.Mz)(c.fq,l.gt,a.y1,(0,r.AF)([o.B.COMMON]),v),e=>e),f=(0,s.WY)()((0,n.Mz)(c.xD,l.gt,a.y1,(0,r.AF)([o.B.COMMON]),v),e=>e),g=(0,s.WY)()((0,n.Mz)(c.qs,l.gt,a.y1,(0,r.AF)([o.B.COMMON]),v),e=>e),O=(0,s.WY)()((0,n.Mz)(I,b,g,(e,t,i)=>[...e,...t,...i]),e=>e)},175522(e,t,i){i.d(t,{A:()=>s,Q:()=>o});var n=i(416348);const s="_",o=[n.ZM,n.Je]},263130(e,t,i){i.d(t,{A:()=>d});var n=i(822336),s=i(296540),o=i(217439),r=i(71479),a=i(382389),l=i(566723),_=i(294303);const c=(0,r.A)(o.A)`
  line-height: 20px;
`,d=({icon:e,description:t,action:i,footer:o,background:r,...d})=>{const{themeName:p}=(0,a.u)();return s.createElement(_.A,{flexGrow:1,borderRadius:l.YC,padding:l.kc,background:r||n.Ay[`desktop-color-neutral-01-${p}`],gap:l.kc,flexDirection:"column",...d},s.createElement(_.A,{flexGrow:1,gap:l.kc},e,t?s.createElement(c,{size:"medium"},t):null,i?s.createElement(_.A,{marginLeft:"auto"},s.createElement(c,{size:"medium"},i)):null),o)}},543815(e,t,i){i.d(t,{A:()=>f});var n=i(469733),s=i(296540),o=i(979106),r=i(963070),a=i(438628),l=i(566723),_=i(705426),c=i(294303),d=i(703447),p=i(916537),m=i(385273),E=i(951106),u=i(691294);const v=[{id:"name",renderCell:e=>s.createElement(c.A,{alignItems:"center"},s.createElement(c.A,{height:25},s.createElement(d.A,{client:e})),(0,E.tn)(e))},{id:"mac",renderCell:e=>s.createElement("div",null,e.mac)}];var I;!function(e){e.ONLINE="ONLINE",e.OFFLINE="OFFLINE"}(I||(I={}));const b=[{id:I.ONLINE,label:s.createElement(p.sA,{id:"COMMON_ONLINE"})},{id:I.OFFLINE,label:s.createElement(p.sA,{id:"COMMON_OFFLINE"})}],f=({onClose:e,onSubmit:t})=>{const{formatMessage:i}=(0,p.tz)(),[d,f]=(0,s.useState)(I.ONLINE),[g,O]=(0,s.useState)([]),[A,N]=(0,s.useState)(),h=(0,n.useSelector)(m.Wm),M=(0,n.useSelector)(m.Eg),C=(0,s.useMemo)(()=>(d===I.ONLINE?h:M).filter(e=>(e.type===u.sK.WIRED||e.type===u.sK.WIRELESS)&&(!A||(0,E.tn)(e).toLowerCase().includes(A.toLowerCase())||e.mac.toLowerCase().includes(A.toLowerCase()))),[d,A,h,M]),y=(0,s.useCallback)(({id:e})=>{f(e),O([])},[]),k=(0,s.useCallback)((e,t)=>{N(String(t))},[]),w=(0,s.useCallback)(()=>{t(g),e()},[e,t,g]),L=(0,s.useMemo)(()=>[{text:s.createElement(p.sA,{id:"COMMON_ACTION_CANCEL"}),type:"button",variant:"default",onClick:e},{text:s.createElement(p.sA,{id:"COMMON_ACTION_ADD"}),type:"button",variant:"primary",disabled:!g.length,onClick:w}],[e,w,g]);return s.createElement(_.A,{size:"small",isOpen:!0,title:s.createElement(p.sA,{id:"COMMON_ADD_CLIENT"}),actions:L,style:{content:{height:484}}},s.createElement(c.A,{gap:l.kc,alignItems:"center",marginBottom:l.Ln},s.createElement("div",{style:{flex:1}},s.createElement(a.A,{name:"search",variant:"secondary",width:"100%",placeholder:i({id:"COMMON_SEARCH"}),onChange:k})),s.createElement("div",null,s.createElement(o.A,{variant:"filter",onSelectTab:y,selectedTab:d,tabs:b}))),s.createElement(r.A,{items:C,key:d,columns:v,multiSelectMode:!0,disableColumnFilters:!0,onChangeSelection:e=>O(e)}))}},280258(e,t,i){i.d(t,{H:()=>n});const n=""},596441(e,t,i){i.d(t,{I:()=>n});const n={HEADER_HEIGHT:32,ROW_HEIGHT:32,EDIT_FIELD_HEIGHT:36,getHeight(e,t,i,n){return Math.min((n||this.ROW_HEIGHT)*e+(i??this.HEADER_HEIGHT),(n||this.ROW_HEIGHT)*t+(i??this.HEADER_HEIGHT))},getEditContainerHeight(e,t,i){return Math.min((i||this.EDIT_FIELD_HEIGHT)*e,(i||this.EDIT_FIELD_HEIGHT)*t)}}},504779(e,t,i){i.d(t,{A:()=>_});var n=i(296540),s=i(271856),o=i(132196),r=i(284428),a=i(641777);const l=o.AH`
  width: fit-content;
`,_=({reasons:e,reason:t,children:i,isInteractive:o,noWrap:_,position:c,fitContent:d})=>{const p=(0,r.pv)(),m=[t,...e||[]].filter(Boolean)[0]||null,E=!!m;return n.createElement(a.A,{isDisabled:{fields:E,labels:E,tooltipIcons:E,tooltipPopovers:!p.fields&&E}},n.createElement(s.A,{description:p.fields?null:m,portal:!0,isInteractive:o,noWrap:_,position:c,className:d?l:void 0},i))}},641777(e,t,i){i.d(t,{A:()=>r});var n=i(296540),s=i(284428),o=i(451449);const r=({isDisabled:e,isAdditive:t=!0,children:i})=>{const r=(0,s.pv)(),a=(0,n.useMemo)(()=>"boolean"==typeof e?{fields:e,labels:e,tooltipIcons:e,tooltipPopovers:!1}:e,[e]),l=(0,n.useMemo)(()=>({fields:t?a.fields||r.fields:a.fields,labels:t?a.labels||r.labels:a.labels,tooltipIcons:t?a.tooltipIcons||r.tooltipIcons:a.tooltipIcons,tooltipPopovers:t?a.tooltipPopovers||r.tooltipPopovers:a.tooltipPopovers}),[t,a.fields,a.labels,a.tooltipIcons,a.tooltipPopovers,r.fields,r.labels,r.tooltipIcons,r.tooltipPopovers]);return n.createElement(o.I.Provider,{value:l},i)}},19607(e,t,i){i.d(t,{V:()=>r});var n=i(614476),s=i(546391),o=i(263963);const r=n.z.string({message:(0,o.rn)("SETTINGS_ACL_RULES_MAC_VALIDATION_GENERIC")}).refine(e=>s.b8.test(e),{message:(0,o.rn)("SETTINGS_ACL_RULES_MAC_VALIDATION_GENERIC")})},362412(e,t,i){i.d(t,{A:()=>d});var n=i(296540),s=i(469733),o=i(436331),r=i(805837),a=i(282556),l=i(71265);const _=e=>n.createElement(o.A,{renderOption:r.q,...e}),c=e=>n.createElement(_,{...e});c.Sorted=e=>{const t=(0,s.useSelector)(a.zi),i=(0,n.useMemo)(()=>(0,l.k)(t),[t]);return n.createElement(_,{...e,sortBy:i})};const d=c},71265(e,t,i){i.d(t,{R:()=>d,k:()=>p});var n=i(280258),s=i(190497),o=i(953048),r=i(175522),a=i(936621),l=i(742525);const _=[...new Set([n.H,r.Q.join(r.A),o.Zt,a.F,s.nc,l.Vr])],c={numeric:!0,sensitivity:"base"},d=(e,t)=>{const i=[];for(let n=e;n<=t;n+=1)i.push({value:n,label:String(n)});return i},p=e=>({value:t,label:i},{value:n,label:s})=>_.includes(t?.toString())||_.includes(n?.toString())?1/0:i?.toString().localeCompare(s?.toString(),e,c)??-1}}]);