1import{g as e}from"./getFileSrc-Du9ih3ZQ.js";import{_ as s}from"./index-r3O2Rl_T.js";import{a as t,b as a}from"./index-BHHlZRRk.js";import{M as l,r,I as o,aa as i,o as n,c as d,d as c,t as m,x as p,Q as u,k as x,F as g,s as f,l as b,q as v,b as h,B as w,f as y}from"./vue-vendor-C4LtToJo.js";import"./jspdf-vendor-BmQZnK13.js";import"./primevue-DnZyMtkr.js";import"./datepicker-vendor-DX2zwzgb.js";import"./datefns-vendor-CmiML7te.js";const k={class:"conteudo my-8"},j={class:"h-[250px] w-full rounded-t-2xl flex flex-col gap-2 justify-center items-center",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--p) 80%, white) 0%, color-mix(in srgb, var(--p) 40%, var(--s)) 50%, color-mix(in srgb, var(--s) 70%, white) 100%)"}},_={class:"bg-[#00000031] backdrop-blur-sm border-1 border-white px-4 pb-2 rounded-2xl"},$={class:"flex gap-2"},z={style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--p) 80%, white) 0%, color-mix(in srgb, var(--p) 40%, var(--s)) 50%, color-mix(in srgb, var(--s) 70%, white) 100%)"},class:"inline-flex font-semibold items-center rounded-full px-2 py-1 text-xs text-white inset-ring inset-ring-white"},D={style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--p) 80%, white) 0%, color-mix(in srgb, var(--p) 40%, var(--s)) 50%, color-mix(in srgb, var(--s) 70%, white) 100%)"},class:"inline-flex font-semibold items-center rounded-full px-2 py-1 text-xs text-white inset-ring inset-ring-white"},I={style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--p) 80%, white) 0%, color-mix(in srgb, var(--p) 40%, var(--s)) 50%, color-mix(in srgb, var(--s) 70%, white) 100%)"},class:"inline-flex font-semibold items-center rounded-full px-2 py-1 text-xs text-white inset-ring inset-ring-white"},C={key:0,class:"px-5 py-2"},E={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2"},F={class:"flex flex-col"},N={class:"text-sm font-semibold text-base-content"},P=["href"],S={key:1},U={class:"w-full flex gap-4"},V={class:"w-full grid grid-cols-4 gap-4 m-0"},q={key:2,class:"w-full flex flex-col gap-4"},A={class:"w-full shadow-lg bg-base-100 grid grid-cols-1 sm:grid-cols-3 p-5 m-0 gap-5 rounded-b-xl"},B={class:"col-span-1 bg-base rounded-xl shadow-lg p-4"},R={class:"flex items-center gap-2 mb-4"},M={class:"flex flex-col gap-2"},O=["onClick"],Q={class:"truncate"},T={class:"col-span-2 grid grid-cols-2 gap-4 m-0"},G={class:"h-[140px] w-full flex flex-row gap-2 items-center px-6",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--p) 80%, white) 0%, color-mix(in srgb, var(--p) 40%, var(--s)) 50%, color-mix(in srgb, var(--s) 70%, white) 100%)"}},H={class:"bg-white/20 backdrop-blur-sm border border-white px-3 pt-1 pb-2 roun
1ded-xl"},J={class:"flex flex-col gap-2"},K={class:"text-white text-base font-bold uppercase leading-tight"},L={class:"p-6 flex flex-col flex-1"},W={class:"text-muted-color text-sm mb-4"},X={class:"text-muted-color text-sm mb-4 overflow-hidden break-all"},Y={class:"text-muted-color text-sm mb-4"},Z={class:"w-10 h-10 rounded-full bg-primary flex items-center justify-center group-hover:bg-primary-focus transition-colors"},ee={class:"h-[140px] w-full flex flex-row gap-2 items-center px-6",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--s) 80%, white) 0%, color-mix(in srgb, var(--s) 40%, var(--p)) 50%, color-mix(in srgb, var(--p) 70%, white) 100%)"}},se={class:"bg-white/20 backdrop-blur-sm border border-white/30 px-3 pt-1 pb-2 rounded-xl"},te={class:"flex flex-col gap-2"},ae={class:"text-white text-base font-bold uppercase leading-tight"},le={class:"p-6 flex flex-col flex-1"},re={class:"text-muted-color text-sm mb-4 line-clamp-2"},oe={key:0,class:"flex items-center gap-3 mb-4"},ie=["src","alt"],ne={key:1,class:"w-12 h-12 rounded-full bg-base-200 flex items-center justify-center"},de={class:"text-sm font-semibold text-base-content uppercase"},ce={class:"w-10 h-10 rounded-full bg-primary flex items-center justify-center group-hover:bg-primary-focus transition-colors"},me={class:"h-[140px] w-full flex flex-row gap-2 items-center px-6",style:{background:"linear-gradient(135deg, color-mix(in srgb, var(--a) 80%, white) 0%, color-mix(in srgb, var(--a) 40%, var(--s)) 50%, color-mix(in srgb, var(--s) 70%, white) 100%)"}},pe={class:"bg-white/20 backdrop-blur-sm border border-white/30 px-3 pt-1 pb-2 roun
1ded-xl"},ue={class:"flex flex-col gap-2"},xe={class:"text-white text-base font-bold uppercase leading-tight"},ge={class:"p-6 flex flex-col flex-1"},fe={class:"text-muted-color text-sm mb-4 line-clamp-2"},be={key:0,class:"flex items-center gap-3 mb-4"},ve=["src","alt"],he={key:1,class:"w-12 h-12 rounded-full bg-base-200 flex items-center justify-center"},we={class:"text-sm font-semibold text-base-content uppercase"},ye={class:"w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center group-hover:bg-primary transition-colors"},ke={key:0,class:"w-full text-center py-8 text-muted-color"},je={key:3},_e=s(l({__name:"Index",setup(s){const l=r(!1),_e=r(!1),$e=r([]),ze=r(null),De=r(null),Ie=o(()=>$e.value.reduce((e,s)=>e+(s.unidades?.length||0),0)),Ce=o(()=>$e.value.reduce((e,s)=>e+(s.unidades||[]).reduce((e,s)=>e+(s.departamentos?.length||0),0),0)),Ee=o(()=>{const e={orgaos:[],unidades:[],departamentos:[]};if(null===ze.value)e.orgaos=$e.value,$e.value.forEach(s=>{s.unidades&&s.unidades.length>0&&(e.unidades.push(...s.unidades),s.unidades.forEach(s=>{s.departamentos&&s.departamentos.length>0&&e.departamentos.push(...s.departamentos)}))});else{const s=$e.value.find(e=>e.id===ze.value);s&&(e.orgaos=[s],s.unidades&&s.unidades.length>0&&(e.unidades=s.unidades,s.unidades.forEach(s=>{s.departamentos&&s.departamentos.length>0&&e.departamentos.push(...s.departamentos)})))}return e}),Fe=e=>{if(!e)return"";const s=e.tipo_documento?.nome?`${e.tipo_documento.nome} `:"",t=(e=>e?.letra?`${e.numero} - ${e.letra}`:e?.sufixo?`${e.numero}${e.sufixo}`:e?.numero??"")(e);return`${s}${t}${e.descricao?` - ${e.descricao}`:""}`.trim()},Ne=async()=>{_e.value=!0;try{const e=await t();De.value=e?.valor??e??null}catch(e){}finally{_e.value=!1}},Pe=async()=>{_e.value=!0;try{$e.value=await a()}catch(e){}finally{_e.value=!1}};return i(async()=>{await Promise.all([Pe(),Ne()]),l.value=!0}),n(async()=>{l.value||await Promise.all([Pe(),Ne()])}),(s,t)=>{const a=v("app-icon"),l=v("Skeleton"),r=v("AppIcon"),o=v("router-link");return h(),d("div",k,[c("div",j,[c("div",_,[m(a,{nome:"bi:diagram-3-fill",class:"text-[3rem] z-20 text-white"})]),t[1]||(t[1]=c("h1",{class:"text-[36px] text-white"},"Orgãos",-1)),t[2]||(t[2]=c("h2",{class:"text-[22px] text-white"},"Secretarias e Departamentos",-1)),c("div",$,[c("span",z,p($e.value.length)+" Ãrgãos",1),c("span",D,p(Ie.value)+" Unidades",1),c("span",I,p(Ce.value)+" Departamentos",1)])]),De.value?(h(),d("div",C,[c("div",E,[c("div",F,[t[3]||(t[3]=c("span",{class:"text-xs text-base-content"},"Norma que institui/altera a estrutura organizacional",-1)),c("span",N,p(Fe(De.value)),1)]),De.value?.url?(h(),d("a",{key:0,class:"px-2 py-1 m-0 bg-transparent border-2 border-transparencia-secondary text-transparencia-secondary hover:bg-transparencia-secondary hover:text-transparencia-secondary-content rounded-md font-bold text-xs",target:"_blank",href:u(e)(De.value.url)}," Visualizar ",8,P)):x("",!0)])])):x("",!0),_e.value?(h(),d("div",S,[c("div",U,[c("div",V,[(h(),d(g,null,f(6,e=>m(l,{key:e,class:"w-full",size:"10rem"})),64))])])])):$e.value.length>0?(h(),d("div",q,[c("div",A,[c("div",B,[c("div",R,[m(a,{nome:"bi:funnel-fill",class:"text-primary"}),t[4]||(t[4]=c("h3",{class:"font-semibold text-base-content"},"Filtrar por Ãrgão",-1))]),c("div",M,[c("button",{class:b(["flex items-center gap-2 px-4 py-2 rounded-lg text-left transition-all",null===ze.value?"bg-primary text-white":"bg-base-100 text-base-content hover:bg-base-100"]),onClick:t[0]||(t[0]=e=>ze.value=null)},[m(a,{nome:"bi:grid-3x3-gap-fill"}),t[5]||(t[5]=c("span",{class:"font-medium"},"Todos os Ãrgãos",-1))],2),(h(!0),d(g,null,f($e.value,e=>(h(),d("button",{key:e.id,class:b(["flex items-center gap-2 px-4 py-2 rounded-lg text-left transition-all",ze.value===e.id?"bg-primary text-white":"bg-base-100 text-base-content hover:bg-base-100"]),onClick:s=>ze.value=e.id},[m(a,{nome:"bi:building"}),c("span",Q,p(e?.pessoa?.nome),1)],10,O))),128))])]),c("div",T,[(h(!0),d(g,null,f(Ee.value.orgaos,e=>(h(),d("div",{key:"orgao-"+e.id,class:"bg-base rounded-xl shadow-lg overflow-hidden hover:shadow-xl transition-shadow flex flex-col"},[c("div",G,[c("div",H,[m(a,{nome:"bi:building",class:"text-[2rem] text-white"})]),c("div",J,[t[6]||(t[6]=c("span",{class:"text-white text-sm font-medium"},"Ãrgão",-1)),c("h4",K,p(e?.pessoa?.nome),1)])]),c("div",L,[c("p",W,[m(a,{nome:"bi:file-check-fill",class:"mr-2"}),w(p(e?.pessoa?.cpf_cnpj||"[sem informação]"),1)]),c("p",X,[m
1(r,{nome:"bi:envelope-at-fill",class:"mr-2"}),w(p(e?.pessoa?.email||"[sem informação]"),1)]),c("p",Y,[m(a,{nome:"bi:telephone-fill",class:"mr-2"}),w(p(e?.pessoa?.fone||"[sem informação]"),1)]),m(o,{to:{name:"orgao.show",params:{id:e.id}},class:"flex items-center justify-between text-primary hover:text-primary-focus font-medium text-sm transition-colors group"},{default:y(()=>[t[7]||(t[7]=c("span",null,"Ver página completa",-1)),c("div",Z,[m(a,{nome:"bi:arrow-right",class:"text-white"})])]),_:1},8,["to"])])]))),128)),(h(!0),d(g,null,f(Ee.value.unidades,e=>(h(),d("div",{key:"unidade-"+e.id,class:"bg-base rounded-xl shadow-lg overflow-hidden hover:shadow-xl transition-shadow flex flex-col"},[c("div",ee,[c("div",se,[m(a,{nome:"bi:bank",class:"text-[2rem] text-white"})]),c("div",te,[t[8]||(t[8]=c("span",{class:"text-white text-sm font-medium"},"Unidade",-1)),c("h4",ae,p(e.nome),1)])]),c("div",le,[c("p",re,p(e.descricao||"Unidade do órgão"),1),e.responsavel?(h(),d("div",oe,[e.responsavel.foto?(h(),d("img",{key:0,src:e.responsavel.foto,alt:e.responsavel.nome,class:"w-12 h-12 rounded-full object-cover"},null,8,ie)):(h(),d("div",ne,[m(a,{nome:"bi:person-fill",class:"text-muted-color text-xl"})])),c("div",null,[t[9]||(t[9]=c("p",{class:"text-xs text-muted-color"},"Responsável",-1)),c("p",de,p(e.responsavel.nome),1)])])):x("",!0),m(o,{to:{name:"unidade.show",params:{id:e.id}},class:"flex items-center justify-between text-primary hover:text-primary-focus font-medium text-sm transition-colors group"},{default:y(()=>[t[10]||(t[10]=c("span",null,"Ver página completa",-1)),c("div",ce,[m(a,{nome:"bi:arrow-right",class:"text-white"})])]),_:1},8,["to"])])]))),128)),(h(!0),d(g,null,f(Ee.value.departamentos,e=>(h(),d("div",{key:"departamento-"+e.id,class:"bg-base rounded-xl shadow-lg overflow-hidden hover:shadow-xl transition-shadow flex flex-col"},[c("div",me,[c("div",pe,[m(a,{nome:"bi:briefcase",class:"text-[2rem] text-white"})]),c("div",ue,[t[11]||(t[11]=c("span",{class:"text-white text-sm font-medium"},"Departamento",-1)),c("h4",xe,p(e.nome),1)])]),c("div",ge,[c("p",fe,p(e.descricao||"Departamento vinculado"),1),e.responsavel?(h(),d("div",be,[e.responsavel.foto?(h(),d("img",{key:0,src:e.responsavel.foto,alt:e.responsavel.nome,class:"w-12 h-12 rounded-full object-cover"},null,8,ve)):(h(),d("div",he,[m(a,{nome:"bi:person-fill",class:"text-muted-color text-xl"})])),c("div",null,[t[12]||(t[12]=c("p",{class:"text-xs text-muted-color"},"Responsável",-1)),c("p",we,p(e.responsavel.nome),1)])])):x("",!0),m(o,{to:{name:"departamento.show",params:{id:e.id}},class:"flex items-center justify-between font-medium text-sm group mt-auto pt-3 border-t border-base-content/10"},{default:y(()=>[t[13]||(t[13]=c("span",{class:"uppercase text-xs font-bold tracking-wide text-primary group-hover:text-primary-focus transition-colors"},"Acessar Página",-1)),c("div",ye,[m(a,{nome:"bi:arrow-right",class:"text-primary group-hover:!text-white"})])]),_:1},8,["to"])])]))),128))])]),0===Ee.value.orgaos.length&&0===Ee.value.unidades.length&&0===Ee.value.departamentos.length&&ze.value?(h(),d("div",ke," Nenhum item encontrado para o órgão selecionado. ")):x("",!0)])):(h(),d("div",je,"Nenhum órgão cadastrado"))])}}}),[["__scopeId","data-v-c74f3deb"]]);export{_e as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.