import{d as z,b7 as S,mP as T,r as b,mQ as o,j as r,B as F,T as l}from"./index-e79f7aad.js";import{c as U,b as u,l as y,u as B}from"./index.esm-1ca67d65.js";import{T as L}from"./index-a65810f4.js";import{o as N}from"./yup-96f14780.js";import{T as q}from"./TopComponent-c7efe4ac.js";import"./TableRow-0ea91e40.js";import"./useMediaQuery-9155ba05.js";import"./TableContainer-00013c19.js";import"./TableHead-1f8b658d.js";import"./Select-8a61e5a6.js";import"./index-e5978b8b.js";import"./TablePagination-6f9f31d4.js";import"./KeyboardArrowRight-4ee9435c.js";import"./LastPage-1ca2417e.js";import"./Toolbar-d2cd5725.js";import"./MenuItem-c14df0e9.js";import"./dividerClasses-691b251c.js";import"./listItemTextClasses-d3a968ad.js";import"./listItemIconClasses-03011ebf.js";import"./GenericThumbnailView-8a83a30c.js";import"./index-310d07a1.js";import"./createClass-b86a4c8d.js";import"./popper-f3391c26.js";import"./InputAdornment-d42c17cd.js";import"./TextField-21e22d39.js";import"./isMuiElement-db2b7d4c.js";import"./ScrollableList-5929779e.js";import"./CircularProgress-8c35778c.js";import"./componentStyles-7718fc5e.js";import"./PageBreadCrumb-b94acfd7.js";import"./PageMetaData-8b0c63da.js";import"./TextArea-ec29d1d5.js";import"./Grid2-7786e458.js";import"./Badge-d6f9bad7.js";import"./FilterFilled-8d538f67.js";import"./AntdIcon-1cfbd840.js";import"./objectSpread2-d56e1476.js";import"./FilterOutlined-c331cda0.js";const Ce=()=>{const a=z(),c=S(),{loggedUsers:{list:d,pageParams:t,loading:h,count:g,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 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(q,{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};
