import{_ as S}from"./G7u0egV4.js";import{d as U,J as k,j as A,a as I,f as o,e as a,W as C,w as r,g as e,aj as V,s as h,R as D,i as L,o as N,A as B,_ as $,t as w,n as E}from"./JQJBiNWj.js";import{_ as P}from"./DUQr9DrG.js";import{_ as T}from"./CYDRfonM.js";import{r as j}from"./CLkB_muw.js";import z from"./CuNuZBQO.js";import K from"./BBDFeM-T.js";import O from"./CJYlvWEf.js";import{D as F}from"./DKM0wLqG.js";import{u as M}from"./CL7Msd7o.js";import{u as q}from"./B-La3K3C.js";import"./HM4z-iuB.js";import"./DqVYbxj5.js";import"./BwwR4PPN.js";import"./B6O9xiO5.js";import"./CxkaGOlL.js";import"./BgAkS4D_.js";import"./DMxbovom.js";import"./DBWLnasn.js";import"./RO0fiRDZ.js";import"./Cr9ZZaT-.js";import"./DNRi6U01.js";import"./BYfmWBgX.js";import"./CeWG_dyW.js";import"./CDSORL4U.js";import"./vkXHPWu2.js";import"./3oa0FK2h.js";import"./ClVEEBFD.js";import"./qAEGbaa4.js";import"./CASPyZT-.js";import"./CeGk6Fsr.js";import"./D1rKqwCM.js";import"./CfLdzzlL.js";import"./CjLYEAc3.js";import"./BTchAptP.js";import"./BuR5k2Xw.js";import"./2JTb7YQn.js";import"./Dk4pWsnS.js";import"./BSHuRY0P.js";import"./F98GHXdS.js";import"./DvBDpJyt.js";const J={class:"col-span-6 md:col-span-4 flex flex-col"},W={class:"col-span-6 md:col-span-4 flex flex-col"},Y={class:"col-span-12 flex justify-end space-x-4 mt-4 mb-16"},To=U({__name:"index",setup(G){const d=M({add:D.SYS_USUARIO_INCLUIR}),s=k({search:void 0,tipo:void 0,status:void 0,grupo:void 0,empresa:[]});function c(){s.search=void 0,s.tipo=void 0,s.status=void 0,s.grupo=void 0,s.empresa=[]}const _=A(!1),l=q("usuarios",i=>L.usuarios.findUsuariosKeycloak({...s,...i}));function f(i){E(`/configuracoes/usuarios/${i.data.id}`)}return(i,t)=>{const v=S,x=B,g=P,b=O,y=K,p=$,u=h,m=z,R=T;return N(),I("div",null,[o(g,{title:"Usuários"},C({_:2},[e(d).add?{name:"title-buttons",fn:r(()=>[o(x,{to:("resolveRelativeRoute"in i?i.resolveRelativeRoute:e(j))(e(F))},{default:r(()=>[o(v,{mode:"add"})]),_:1},8,["to"])]),key:"0"}:void 0]),1024),a("div",{class:"base-grid",onKeypress:t[2]||(t[2]=V(()=>e(l).execute(),["enter"]))},[a("div",J,[t[4]||(t[4]=a("label",{for:"localizar"},"Localizar:",-1)),o(b,{id:"localizar",modelValue:e(s).search,"onUpdate:modelValue":t[0]||(t[0]=n=>e(s).search=n),type:"search",fluid:""},null,8,["modelValue"])]),a("div",W,[t[5]||(t[5]=a("label",{for:"status"},"Status:",-1)),o(y,{id:"status",modelValue:e(s).status,"onUpdate:modelValue":t[1]||(t[1]=n=>e(s).status=n),options:[{text:"Todos",value:void 0},{text:"Ativo",value:"A"},{text:"Inativo",value:"I"}],"option-label":"text","option-value":"value",placeholder:"Selecione...",fluid:""},null,8,["modelValue"])])],32),a("div",Y,[o(u,{severity:"secondary",label:"Limpar",onClick:c},{icon:r(()=>[o(p,{name:"material-symbols:ink-eraser"})]),_:1}),o(u,{severity:"primary",label:"Pesquisar",loading:e(l).status.value==="pending",onClick:t[3]||(t[3]=()=>e(l).execute())},{icon:r(()=>[o(p,{name:"material-symbols:search"})]),_:1},8,["loading"])]),o(R,{value:e(l),rows:10,"auto-paginator":!0,"empty-message":"Não há dados",loading:e(_),onRowClick:f},{default:r(()=>[o(m,{field:"nome",header:"Nome",sortable:""}),o(m,{field:"login",header:"Login",sortable:""}),o(m,{field:"email",header:"E-mail",sortable:""}),o(m,{field:"status",header:"Status",sortable:""},{body:r(n=>[a("span",null,w(n.data.status==="A"?"Ativo":"Inativo"),1)]),_:1})]),_:1},8,["value","loading"])])}}});export{To as default};
