import{ab as F,ac as y,a0 as B,a9 as C,r as d,aD as w,a7 as j,j as e,aF as W,ak as z,l as r,m as R,T as c,x as T,at as k,u as H,A as M,f as $,B as x,q as D}from"./index-cc84e56a.js";import{u as U}from"./useConfig-efd62a4a.js";import{b as I,p as P}from"./env-198ff0f3.js";import{d as _,C as q,G as f}from"./MoreVert-64b91ae9.js";import{C as v}from"./Card-ecc10a21.js";import{C as E}from"./CardHeader-ce2759f4.js";import{A as L}from"./Avatar-74796535.js";import{C as A}from"./CardContent-3949478d.js";import{a as N}from"./pwdpromptLogo-90b3250a.js";import"./createContainer-a5dd8c1d.js";function G(t){return F("MuiCardActions",t)}y("MuiCardActions",["root","spacing"]);const J=["disableSpacing","className"],X=t=>{const{classes:a,disableSpacing:o}=t;return z({root:["root",!o&&"spacing"]},G,a)},K=B("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(t,a)=>{const{ownerState:o}=t;return[a.root,!o.disableSpacing&&a.spacing]}})(({ownerState:t})=>C({display:"flex",alignItems:"center",padding:8},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),Q=d.forwardRef(function(a,o){const n=w({props:a,name:"MuiCardActions"}),{disableSpacing:l=!1,className:u}=n,m=j(n,J),i=C({},n,{disableSpacing:l}),p=X(i);return e(K,C({className:W(p.root,u),ownerState:i,ref:o},m))}),V=Q;function Y({user:t}){return r(v,{sx:{maxWidth:300,height:"220px",backgroundColor:"#71A63C",color:"#FFF"},children:[e(E,{avatar:e(L,{src:"",sx:{width:56,height:56},"aria-label":"recipe",alt:"user"}),action:e(R,{"aria-label":"settings",children:e(_,{})}),title:t.nombre,subheader:t.rol,sx:{color:"#FFF","& .MuiCardHeader-subheader":{color:"#FFF"}}}),r(A,{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(V,{sx:{backgroundColor:"#84BF49",height:"100%"},disableSpacing:!0})]})}const Z="/WizardJS/assets/Recurso3-b9afce00.png";function O({imgBackground:t,imgIcon:a,cardText:o}){return r(v,{variant:"elevation",sx:{maxWidth:300,height:"220px",position:"relative"},children:[e("div",{style:{backgroundImage:`url(${t||Z})`,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/${a}.png`,loading:"lazy"})})}),e(A,{sx:{},children:e(c,{noWrap:!0,fontWeight:"700",fontSize:"1rem",textAlign:"center",sx:{},children:o})})]})}const ue=()=>{const{loading:t,data:a,load:o}=U(),n=T();k();const[l,u]=d.useState([]),m=async()=>{await o()},{logout:i,user:p}=H(),{empresaActual:g}=d.useContext(M);return d.useEffect(()=>{m(),$.get(`${I}/${P}/Engine?paquete=std.extjs&clase=Tree2JSon&metodo=getMenusRapidos&parametros=`).then(s=>{if(s.data.msg==="Acceso Denegado"){console.log("Sesión expirada"),i();return}u(s.data)})},[]),r(q,{sx:{minHeight:"100vh"},children:[r(x,{sx:{},marginTop:"3rem",width:"100%",children:[e(x,{margin:"1rem auto",width:"300px",children:e("img",{style:{objectFit:"cover",maxWidth:"100%"},src:N,loading:"lazy",alt:"Prompt logo"})}),r(c,{fontWeight:"bolder",noWrap:!0,fontSize:"1.7rem",textAlign:"center",children:[(()=>{const s=new Date().getHours();return s<6||s>20?"¡Buenas noches":s<12?"¡Buenos días":"¡Buenas tardes"})(),", ",r("span",{children:["equipo ",(g==null?void 0:g.empNombre)||""]}),"!"]})]}),r(x,{sx:{marginTop:"2rem"},children:[e(c,{fontSize:"2rem",textAlign:"center",children:"Categorias"}),e(f,{container:!0,spacing:{xs:2,md:3},columns:{xs:4,sm:8,md:12},mt:2,children:l.map(({ObjIcon:s,ObjNom:h,ObjMenuLink:S},b)=>h==="Bandeja de Trámites"?e(f,{sx:{cursor:"pointer"},onClick:()=>{n(S)},xs:2,sm:2,md:3,children:e(Y,{user:p})},b):e(f,{sx:{cursor:"pointer"},onClick:()=>{h==="Salir"?D(i):n(S)},xs:2,sm:2,md:3,children:e(O,{cardText:h,imgIcon:s})},b))})]})]})};export{ue as default};
