import{_ as L}from"./G7u0egV4.js";import{d as B,z as d,c as u,a as $,f as t,e as l,W as O,w as o,g as a,F as V,i as z,R as D,o as _,A as P,b as x,E as y,G as b,t as C,h as W,n as j}from"./JQJBiNWj.js";import{_ as G}from"./DUQr9DrG.js";import{_ as Y}from"./gxHWKiUc.js";import{_ as q}from"./DTOFlTEg.js";import{_ as J}from"./Cc5nJC3F.js";import K from"./BDE-DWRM.js";import M from"./CuNuZBQO.js";import X from"./BBDFeM-T.js";import Z from"./CJYlvWEf.js";import{g as H,S as m,c as Q}from"./H4pzrCEL.js";import{u as tt}from"./CL7Msd7o.js";import{u as ot}from"./BScxs07x.js";import{u as et}from"./F98GHXdS.js";import"./HM4z-iuB.js";import"./DqVYbxj5.js";import"./BwwR4PPN.js";import"./B6O9xiO5.js";import"./CxkaGOlL.js";import"./BgAkS4D_.js";import"./DKM0wLqG.js";import"./Dm5UwSfy.js";import"./D42GNhrT.js";import"./Dc_YXEFz.js";import"./CH1bAkoS.js";import"./Dd3ROLQd.js";import"./f6QOa6wf.js";import"./Tk23Dwa0.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"./BTchAptP.js";import"./ClVEEBFD.js";import"./qAEGbaa4.js";import"./D1rKqwCM.js";import"./CeGk6Fsr.js";import"./BuR5k2Xw.js";import"./2JTb7YQn.js";import"./Dk4pWsnS.js";import"./BSHuRY0P.js";import"./3oa0FK2h.js";import"./FcRkkR--.js";const at={class:"flex flex-col gap-5"},st={class:"flex gap-5"},Qt=B({__name:"index",setup(nt){const f=tt({add:D.SYS_SETORES_AGENCIA_INCLUIR}),v=d.object({search:d.string(),inativo:d.string()}),s=ot(v),I=u(()=>s.value.inativo),{data:p,status:g}=et(()=>z.agencia.areas.findAll({inativo:s.value.inativo?s.value.inativo===m.Inativo:void 0}),{watch:[I]},"$WbuJXVSZWU"),A=u(()=>{var i,n;return!((i=p.value)!=null&&i.length)||!((n=s.value)!=null&&n.search)?p.value??[]:p.value.filter(r=>r.sigla.toLowerCase().includes(s.value.search.toLowerCase())||r.descricao.toLowerCase().includes(s.value.search.toLowerCase()))}),w=u(()=>H(A.value));function k(i){j("/configuracoes/areas/"+i.data.id,{open:{target:"_blank"}})}return(i,n)=>{const r=L,S=P,N=G,T=Z,h=Y,E=X,R=q,c=M,U=J,F=K;return _(),$(V,null,[t(N,{title:"Setores da agência"},O({_:2},[a(f).add?{name:"title-buttons",fn:o(()=>[t(S,{to:"/configuracoes/areas/nova"},{default:o(()=>[t(r,{mode:"add"})]),_:1})]),key:"0"}:void 0]),1024),l("div",at,[t(R,{schema:a(v),status:a(g),onChange:n[0]||(n[0]=e=>s.value=e)},{default:o(()=>[l("div",st,[t(h,{name:"search",label:"Localizar:",class:"w-full"},{default:o(()=>[t(T,{id:"localizar",placeholder:"Digite sua pesquisa...",type:"search",fluid:""})]),_:1}),t(h,{name:"inativo",label:"Status:",class:"w-full"},{default:o(()=>[t(E,{options:a(Q),"option-value":"value","option-label":"label","show-clear":"",placeholder:"Selecione..."},null,8,["options"])]),_:1})])]),_:1},8,["schema","status"]),t(F,{value:a(w),loading:a(g)==="pending",onRowClick:k},{empty:o(()=>n[1]||(n[1]=[W("Não há itens disponíveis.")])),default:o(()=>[t(c,{header:"Sigla","body-class":"min-column !p-4","header-class":"min-column !text-left py-3",field:"sigla",expander:""},{body:o(({node:e})=>[l("span",{class:b(e.data.status===a(m).Inativo&&"text-gray-500")},C(e.data.sigla),3)]),_:1}),t(c,{header:"Descrição",field:"descricao","body-class":"!text-left !p-4","header-class":"!text-left px-3 py-3"},{body:o(({node:e})=>[l("span",{class:b(e.data.status===a(m).Inativo&&"text-gray-500")},C(e.data.descricao),3)]),_:1}),t(c,{header:"Status","body-class":"min-column justify-center","header-class":"min-column",class:"text-center"},{body:o(({node:e})=>[e.data.status===a(m).Inativo?(_(),x(U,{key:0})):y("",!0)]),_:1}),a(f).add?(_(),x(c,{key:0,"body-class":"min-column"},{body:o(({node:e})=>[t(S,{to:`/configuracoes/areas/${e.data.id}`},{default:o(()=>[t(r,{mode:"editIcon"})]),_:2},1032,["to"])]),_:1})):y("",!0)]),_:1},8,["value","loading"])])],64)}}});export{Qt as default};
