import{d as z,b4 as S,kX as T,r as b,kY as o,j as r,B as F,T as l}from"./index-0698dbe6.js";import{c as U,b as u,k as y,u as B}from"./index.esm-85d015f3.js";import{T as L}from"./index-60056aa1.js";import{o as N}from"./yup-7a53beb8.js";import{T as k}from"./TopComponent-1e487f98.js";import"./TableRow-2848b050.js";import"./useMediaQuery-98e2832a.js";import"./TableContainer-99852104.js";import"./TableHead-0cf6a9bf.js";import"./Grow-ea87e600.js";import"./TablePagination-a4795561.js";import"./Select-371fc2c6.js";import"./index-e5978b8b.js";import"./KeyboardArrowRight-4fe4c481.js";import"./LastPage-1dfd52ba.js";import"./Toolbar-14560ae2.js";import"./MenuItem-aa4e2c66.js";import"./dividerClasses-2d12c750.js";import"./listItemTextClasses-d0728874.js";import"./listItemIconClasses-6eed47b3.js";import"./GenericThumbnailView-dca658f3.js";import"./index-c9a9ee7a.js";import"./createClass-61c32f27.js";import"./popper-f3391c26.js";import"./InputAdornment-0c2174b6.js";import"./TextField-4222c766.js";import"./isMuiElement-d179539f.js";import"./ScrollableList-fc87149c.js";import"./CircularProgress-4f55e66c.js";import"./componentStyles-91278318.js";import"./PageBreadCrumb-4672acbd.js";import"./PageMetaData-cd33e3c3.js";import"./TextArea-91c96faf.js";import"./Grid2-a3850bef.js";import"./FilterFilled-b68f936d.js";import"./AntdIcon-ef833303.js";import"./objectSpread2-86ebda25.js";import"./FilterOutlined-0ae4b12f.js";const Ce=()=>{const a=z(),c=S(),{loggedUsers:{list:d,pageParams:t,loading:h,count:g,selectedData:q},system:{userAccessList:A}}=T(),x=[{title:"S.No"},{title:"UserName"},{title:"Full Name"},{title:"Email"},{title:"Phone"},{title:"Group",width:100}];function f(e,s,p,n,i,m){return{index:e,username:s,fullname:p,email:n,phone:i,group:m}}const P=d.map((e,s)=>{var i;const p=(t.page-1)*t.page_size+(s+1),n=(i=e==null?void 0:e.groups)==null?void 0:i.map(m=>m).join(", ");return f(p,e.username||"",e.full_name||"",e.email||"",e.phone||"",n||"")}),_=({search:e})=>{a(o({...t,search:e||"",page:1,page_size:10}))},j=(e,s)=>{a(o({...t,search:"",page:s+1}))},C=e=>{a(o({...t,search:"",page:1,page_size:parseInt(e.target.value)}))};b.useEffect(()=>{a(o({...t,search:"",page:1,page_size:10})),c.setTitle("Logged Users"),c.setSubtitle("Settings")},[]);const v=U().shape({newPassword:u().min(8,"Password must be at least 8 characters long").required("New Password is required"),confirmPassword:u().oneOf([y("newPassword"),""],"Passwords must match").required("Confirm Password is required")});B({resolver:N(v)});const w=e=>{const s=e.target.value;a(o({...t,search:s||"",page:1,page_size:10}))};return r.jsxs(r.Fragment,{children:[r.jsx(k,{permissionPreFix:"core_users",permissionPostFix:"current_logged_users",navigateLink:"/pages/settings/manage-users/0",showAddButton:!1,showFilterButton:!1,addButtonName:"Add User",handleSearch:_,handleInputChange:w,children:r.jsxs(F,{sx:{display:"flex",gap:2},children:[r.jsx(l,{variant:"h4",children:" Count"}),r.jsx(l,{variant:"subtitle1",color:"primary",children:g})]})}),r.jsx(L,{count:g,columns:x,rows:P,loading:h,page:t.page,pageSize:t.page_size,handleChangePage:j,handleChangeRowsPerPage:C})]})};export{Ce as default};
