import{i as x}from"./emotion-use-insertion-effect-with-fallbacks.browser.esm-6809063d.js";import{j as r,a as e,I as A,v as c,w as B}from"./Tooltip-ae8d7992.js";import{u as j}from"./useConfig-26d087aa.js";import{c as w,b as z,A as T,d as W,j as k,k as H,e as $}from"./index-dfa17bed.js";import{d as R,C as I}from"./MoreVert-40ae9564.js";import{C as f,a as D,A as E,b as C,c as q}from"./CardHeader-5e8a0efd.js";import{a as G}from"./pwdpromptLogo-90b3250a.js";import{G as s}from"./Grid2-68f59409.js";function J({user:a}){return r(f,{sx:{maxWidth:300,height:"220px",backgroundColor:"#71A63C",color:"#FFF"},children:[e(D,{avatar:e(E,{src:"",sx:{width:56,height:56},"aria-label":"recipe",alt:"user"}),action:e(A,{"aria-label":"settings",children:e(R,{})}),title:a.nombre,subheader:a.rol,sx:{color:"#FFF","& .MuiCardHeader-subheader":{color:"#FFF"}}}),r(C,{sx:{},children:[e(c,{color:"#FFF",fontWeight:700,gutterBottom:!0,fontSize:"1.2rem",component:"div",letterSpacing:1,sx:{textShadow:"0.4px 0.4px 0.4px #000"},children:"Bandeja de tramites"}),e(c,{color:"#FFF",gutterBottom:!0,fontSize:"0.8rem",component:"div",children:"Bandeja de tramites"})]}),e(q,{sx:{backgroundColor:"#84BF49",height:"100%"},disableSpacing:!0})]})}const L="/WizardJS/assets/Recurso3-b9afce00.png";function M({imgBackground:a,imgIcon:d,cardText:o}){return r(f,{variant:"elevation",sx:{maxWidth:300,height:"220px",position:"relative"},children:[e("div",{style:{backgroundImage:`url(${a||L})`,backgroundRepeat:"no-repeat",backgroundSize:"cover",objectFit:"cover",height:"150px",backgroundPositionX:"center",position:"relative"},children:e("div",{style:{display:"flex",textAlign:"center",justifyContent:"center"},children:e("img",{style:{width:"100px",marginTop:"1.5em"},src:`./assets/${d}.png`,loading:"lazy"})})}),e(C,{sx:{},children:e(c,{noWrap:!0,fontWeight:"700",fontSize:"1rem",textAlign:"center",sx:{},children:o})})]})}const{Box:i,Typography:h}=await x("@mui/material"),{useContext:P,useEffect:U,useState:X}=await x("react"),ee=()=>{const{loading:a,data:d,load:o}=j(),l=w();B();const[v,F]=X([]),b=async()=>{await o()},{logout:m,user:S}=z(),{empresaActual:u}=P(T);U(()=>{b(),W.post(`${k}/${H}/Engine?paquete=std.extjs&clase=Tree2JSon&metodo=getMenusRapidos&parametros=`).then(t=>{if(t.data.msg==="Acceso Denegado"){console.log("Sesión expirada"),m();return}F(t.data)})},[]);const y=()=>{const t=new Date().getHours();return t<6||t>20?"¡Buenas noches":t<12?"¡Buenos días":"¡Buenas tardes"};return r(I,{sx:{minHeight:"100vh"},children:[r(i,{sx:{},marginTop:"3rem",width:"100%",children:[e(i,{margin:"1rem auto",width:"300px",children:e("img",{style:{objectFit:"cover",maxWidth:"100%"},src:u?.EmpLogo||G,loading:"lazy",alt:"Prompt logo"})}),r(h,{fontWeight:"bolder",noWrap:!0,fontSize:"1.7rem",textAlign:"center",children:[y(),", ",r("span",{children:["equipo ",u?.empNombre||""]}),"!"]})]}),r(i,{sx:{marginTop:"2rem"},children:[e(h,{fontSize:"2rem",textAlign:"center",children:"Categorias"}),e(s,{container:!0,spacing:{xs:2,md:3},columns:{xs:4,sm:8,md:12},mt:2,children:v.map(({ObjIcon:t,ObjNom:n,ObjMenuLink:p},g)=>n==="Bandeja de Trámites"?e(s,{sx:{cursor:"pointer"},onClick:()=>{l(p)},xs:2,sm:2,md:3,children:e(J,{user:S})},g):e(s,{sx:{cursor:"pointer"},onClick:()=>{n==="Salir"?$(m):l(p)},xs:2,sm:2,md:3,children:e(M,{cardText:n,imgIcon:t})},g))})]})]})};export{ee as default};
