import{d as w,b6 as S,ly as T,r as b,lz as o,j as r,B as y,T as g}from"./index-c121b02d.js";import{c as F,b as u,l as U,u as B}from"./index.esm-0c6778ff.js";import{T as L}from"./index-4981d6f8.js";import{o as N}from"./yup-1361ecb6.js";import{T as q}from"./TopComponent-fbb2eda6.js";import"./TableRow-0b65a5b3.js";import"./useMediaQuery-4319583b.js";import"./TableContainer-be48ac32.js";import"./TableHead-9a25be14.js";import"./Grow-9a484472.js";import"./TablePagination-6fddb4ff.js";import"./Select-dd7adaf8.js";import"./index-e5978b8b.js";import"./KeyboardArrowRight-87bf88d8.js";import"./LastPage-df7292bf.js";import"./Toolbar-600c82f3.js";import"./MenuItem-0f1fc7f8.js";import"./dividerClasses-81752629.js";import"./listItemTextClasses-27b4ea1b.js";import"./listItemIconClasses-b2c374f0.js";import"./GenericThumbnailView-77114fcb.js";import"./index-2d756126.js";import"./createClass-66eb0661.js";import"./popper-f3391c26.js";import"./InputAdornment-ae4c2625.js";import"./TextField-f9d2a024.js";import"./isMuiElement-d52f64c2.js";import"./ScrollableList-dc408f1e.js";import"./CircularProgress-fa872e62.js";import"./componentStyles-2d610038.js";import"./PageBreadCrumb-c5db4f23.js";import"./PageMetaData-a1035f31.js";import"./TextArea-dfbfc4f6.js";import"./Grid2-1ceedf41.js";import"./Badge-fa1b30d0.js";import"./FilterFilled-a045b23e.js";import"./AntdIcon-28682171.js";import"./objectSpread2-d754d5ed.js";import"./FilterOutlined-2ca7e07d.js";const ze=()=>{const a=w(),c=S(),{loggedUsers:{list:d,pageParams:t,loading:h,count:l,selectedData:A},system:{userAccessList:E}}=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 z=F().shape({newPassword:u().min(8,"Password must be at least 8 characters long").required("New Password is required"),confirmPassword:u().oneOf([U("newPassword"),""],"Passwords must match").required("Confirm Password is required")});B({resolver:N(z)});const v=e=>{const s=e.target.value;a(o({...t,search:s||"",page:1,page_size:10}))};return r.jsxs(r.Fragment,{children:[r.jsx(q,{permissionPreFix:"core_users",permissionPostFix:"current_logged_users",navigateLink:"/pages/settings/manage-users/0",showAddButton:!1,showFilterButton:!1,addButtonName:"Add User",handleSearch:_,handleInputChange:v,children:r.jsxs(y,{sx:{display:"flex",gap:2},children:[r.jsx(g,{variant:"h4",children:" Count"}),r.jsx(g,{variant:"subtitle1",color:"primary",children:l})]})}),r.jsx(L,{count:l,columns:x,rows:P,loading:h,page:t.page,pageSize:t.page_size,handleChangePage:j,handleChangeRowsPerPage:C})]})};export{ze as default};
