"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[8844],{608844:(e,t,l)=>{l.r(t),l.d(t,{default:()=>U});var n=l(296540),a=l(878538),r=l(582724),i=l(592510),d=l(687602),s=l(469733),c=l(459449),o=l(294303),m=l(566723),E=l(838963),u=l(305712),A=l(602021),C=l(905410),p=l(249304),_=l(98160),h=l(46420),M=l(342214),w=l(438628),O=l(185469),g=l(398300),N=l(845030),S=l(115829),b=l(816919),R=l(141281),L=l(959341);const y=[{id:"name",label:n.createElement(c.sA,{id:"COMMON_LABEL_USERNAME"}),minWidth:100,growthFactor:1,renderCell:({name:e})=>n.createElement(S.A,null,e||n.createElement(c.sA,{id:"COMMON_FALLBACK"}))},{id:"vlan",label:n.createElement(c.sA,{id:"COMMON_VLAN"}),minWidth:100,growthFactor:1,maxWidth:200,renderCell:({vlan:e})=>n.createElement(S.A,null,e||n.createElement(c.sA,{id:"COMMON_FALLBACK"}))},{id:"tunnel_type",label:n.createElement(c.sA,{id:"COMMON_TUNNEL_TYPE"}),minWidth:100,growthFactor:1,renderCell:({tunnel_type:e})=>n.createElement(S.A,null,n.createElement(c.sA,{id:b.vx[e],values:{id:e}}))},{id:"tunnel_medium_type",label:n.createElement(c.sA,{id:"COMMON_TUNNEL_MEDIUM_TYPE"}),minWidth:100,growthFactor:1,renderCell:({tunnel_medium_type:e})=>n.createElement(S.A,null,n.createElement(c.sA,{id:b.tI[e],values:{id:e}}))},{id:"x_password",label:n.createElement(c.sA,{id:"COMMON_PASSWORD"}),minWidth:100,growthFactor:1,renderCell:({x_password:e})=>n.createElement(o.A,{width:"100%",onClick:e=>e.stopPropagation()},n.createElement(w.A,{type:"password",value:e,passwordToggle:!0,style:{width:"100%",flex:1}}))}],f=({items:e})=>{const t=(0,s.useDispatch)(),l=(0,s.useSelector)(A.EL),r=(0,n.useCallback)(async e=>{t((0,a.Bv)(e.map(({_id:e})=>e)))},[t]);return n.createElement(R.Ay,{disableColumnFilters:!0,idField:"_id",items:e,onRowClick:({_id:e})=>t((0,N.XP)({type:g.H.RADIUS_USER,id:e})),columns:y,isRemovable:({_id:e})=>!!e,removeItems:r,showEmptyTable:!0,footerContent:l?null:n.createElement(O.A,{disabled:l,onClick:()=>t((0,N.XP)({type:g.H.RADIUS_USER,id:L.R6}))},n.createElement(c.sA,{id:"COMMON_CREATE_NEW"}))})},v=()=>{(0,s.useDispatch)();const{formatMessage:e}=(0,c.tz)(),t=(0,s.useSelector)(E.Of),[l,a]=((0,s.useSelector)(A.EL),(0,n.useState)(0)),[r,i]=(0,n.useState)(""),w=(0,u.d)(r,100),O=(0,n.useMemo)(()=>{const e=w.toLowerCase();return t.filter(t=>t.name.toLowerCase().includes(e))},[t,w]);return n.createElement(_.A,null,n.createElement(h.R1,null,n.createElement(h.Iq,{wide:!0},n.createElement(o.A,{width:"100%",gap:m.kc,flexDirection:"column"},n.createElement(o.A,{gap:m.Ln},n.createElement(d.A,{"aria-label":e({id:"COMMON_SEARCH"}),width:344,placeholder:e({id:"COMMON_SEARCH"}),value:r,onChange:e=>{i(e),a(0)}})),n.createElement(M.j,{noMargin:!0},n.createElement(C.A,{itemCount:O.length,tableType:p.l.RADIUS_USERS,wrapperFlexProps:{padding:"none"},onPageChanged:a,pageNumber:l,onRenderTable:({from:e,rowsPerPage:t})=>n.createElement(f,{items:O.slice(e,e+t)})}))))))},U=()=>(0,r.A)([(0,a.xL)(void 0,{crudCacheStrategy:{type:i.e.CACHE}})],n.createElement(v,null))}}]);