PageSourceSearch

https://santabarbara.ba.gov.br/assets/CabecalhoRodape-Bwec4uQs.js

js santabarbara.ba.gov.br collected 2026-09-25 09:14:36 UTC 15,776 bytes, 1 lines download raw bytes

1import{c as qe,u as w,b as u,j as e}from"./vendor-query-CAW0R6Fd.js";import{r as m}from"./vendor-react-BIBNHc4z.js";import{bq as Fe,g as Ce,j as D,t as L,v as O,b1 as ne,x as T,B as o,au as P,k as R,b6 as V,b3 as M,G as k,c5 as f,ax as y,cA as Ke,as as Se,c4 as ze,cB as Qe,cC as Ee,q as n,cD as Ae,cE as De,cF as Le,cG as Oe,cH as Te,cI as Pe,cJ as Re,cK as Ve,cL as He,cM as $e,cN as Ge,cO as Be,bX as Je,cP as Xe,cQ as Ue,ch as We,Q as Ye,ak as Ze}from"./index-DxX8Lkqr.js";import{S as J}from"./separator-baIi7Zyh.js";import{D as H,C as $,P as G}from"./react-beautiful-dnd.esm-CCXwC5WM.js";import{M as B}from"./MenuItemModal-BsVfwVO_.js";import{u as es,c as ss,d as as,t as ns,a as ts,b as is}from"./menu-items-transparencia.service-Co0os6QJ.js";import"./ui-radix-CMPBktV5.js";import"./utils-objBp_8x.js";import"./charts-DbJut-2U.js";import"./input-CeFgxTaw.js";import"./select-BXEbz950.js";import"./textarea-BuWWaW-H.js";import"./IconPicker-ggLYRFxy.js";import"./CategoryCascadeSelector-4LjObeRJ.js";import"./command-BttoojA0.js";import"./popover-BjZewgOI.js";import"./paginas.service-Cc2VNCzo.js";import"./atos-normativos.service-nqrXDPm9.js";import"./licitacoes.service-D4EA9Lga.js";import"./portais-setoriais.service-C1utnO4d.js";const Fs=()=>{var ae;Fe();const{toast:d}=Ce(),t=qe(),[te,_]=m.useState(!1),[I,q]=m.useState(null),[rs,ie]=m.useState({titulo:"",tipo_link:"url_direta",link_url:"",link_referencia_id:"",icone:"Menu",visivel:!0,abrir_nova_aba:!1}),[re,F]=m.useState(!1),[C,K]=m.useState(null),[os,oe]=m.useState({titulo:"",tipo_link:"url_direta",link_url:"",link_referencia_id:"",icone:"Link",visivel:!0,abrir_nova_aba:!1}),[le,S]=m.useState(!1),[z,Q]=m.useState(null),[ce,E]=m.useState(!1),[j,A]=m.useState(null),{data:g}=w({queryKey:n.menus.principalAdmin(),queryFn:Xe}),x=g==null?void 0:g.filter(s=>!s.parent_id),{data:N}=w({queryKey:n.menus.topAdmin(),queryFn:Ue}),{data:v}=w({queryKey:n.menus.transparenciaAdmin(),queryFn:is}),h=v==null?void 0:v.filter(s=>!s.parent_id),{data:b}=w({queryKey:n.menus.footerAdmin(),queryFn:We}),{data:p}=w({queryKey:n.menus.config(),queryFn:async()=>{const s=await Ye(),a={};return s.filter(l=>["menu_tema","top_menu_visivel","top_menu_tema"].includes(l.chave)).forEach(l=>{a[l.chave]=l.valor}),a}}),de=u({mutationFn:async s=>I?await Qe(I.id,s):await Ee(s),onSuccess:()=>{t.invalidateQueries({queryKey:n.menus.principalAdmin()}),d({title:I?"Item atualizado":"Item criado"}),_(!1),q(null)},onError:s=>{d({title:"Erro ao salvar",description:s.message,variant:"destructive"})}}),X=u({mutationFn:Ae,onSuccess:()=>{t.invalidateQueries({queryKey:n.menus.principalAdmin()}),d({title:"Item removido"})}}),U=u({mutationFn:async({id:s})=>await De(s),onSuccess:()=>{t.invalidateQueries({queryKey:n.menus.principalAdmin()})}}),ue=u({mutationFn:Le,onSuccess:()=>{t.invalidateQueries({queryKey:n.menus.principalAdmin()}),d({title:"Ordem atualizada"})}}),me=u({mutationFn:async s=>C?await Oe(C.id,s):await Te(s),onSuccess:()=>{t.invalidateQueries({queryKey:n.menus.topAdmin()}),t.invalidateQueries({queryKey:n.menus.top()}),d({title:C?"Item atualizado":"Item criado"}),F(!1),K(null)},onError:s=>{d({title:"Erro ao salvar",description:s.message,variant:"destructive"})}}),pe=u({mutationFn:Pe,onSuccess:()=>{t.invalidateQueries({queryKey:n.menus.topAdmin()}),t.invalidateQueries({queryKey:n.menus.top()}),d({title:"Item removido"})}}),xe=u({mutationFn:async({id:s})=>await Re(s),onSuccess:()=>{t.invalidateQueries({queryKey:n.menus.topAdmin()}),t.invalidateQueries({queryKey:n.menus.top()})}}),he=u({mutationFn:Ve,onSuccess:()=>{t.invalidateQueries({queryKey:n.menus.topAdmin()}),t.invalidateQueries({queryKey:n.menus.top()}),d({title:"Ordem atualizada"})}}),je=u({mutationFn:async s=>z?await es(z.id,s):await ss(s),onSuccess:()=>{t.invalidateQueries({queryKey:n.menus.transparenciaAdmin()}),t.invalidateQueries({queryKey:n.menus.transparencia()}),d({title:z?"Item atualizado":"Item criado"}),S(!1),Q(null)},onError:s=>{d({title:"Erro ao salvar",description:s.message,variant:"destructive"})}}),W=u({mutationFn:as,onSuccess:()=>{t.invalidateQueries({queryKey:n.menus.transparenciaAdmin()}),t.invalidateQueries({queryKey:n.menus.transparencia()}),d({title:"Item removido"})}}),Y=u({mutationFn:async({id:s})=>await ns(s),onSuccess:()=>{t.invalidateQueries({queryKey:n.menus.transparenciaAdmin()}),t.invalidateQueries({queryKey:n.menus.transparencia()})}}),ge=u({mutationFn:ts,onSuccess:()=>{t.invalidateQueries({queryKey:n.menus.transparenciaAdmin()}),t.invalidateQueries({queryKey:n.menus.transparencia()}),d({title:"Ordem atualizada"})}}),ve=u({mutationFn:async s=>j?await He(j.id,s):await $e(s),onSuccess:()=>{t.invalidateQueries({queryKey:n.menus.footerAdmin()}),t.invalidateQueries({queryKey:n.menus.footer()}),d({title:j?"Link atualizado":"Link criado"}),E(!1),A(null)},onError:s=>{d({title:"Erro ao salvar",description:s.message,variant:"destructive"})}}),fe=u({mutationFn:Ge,onSuccess:()=>{t.invalidateQueries({queryKey:n.menus.footerAdmin()}),t.invalidateQueries({queryKey:n.menus.footer()}),d({title:"Link deletado"})}}),ye=u({mutationFn:Be,onSuccess:()=>{t.invalidateQueries({queryKey:n.menus.footerAdmin()}),t.invalidateQueries({queryKey:n.menus.footer()}),d({title:"Ordem atualizada"})}});u({mutationFn:async({chave:s,valor:a})=>{await Je(s,{valor:a})},onSuccess:()=>{t.invalidateQueries({queryKey:n.menus.config()}),d({title:"Configuração atualizada"})}});const Ne=s=>{if(!s.destination||!x)return;const a=Array.from(x),[l]=a.splice(s.source.index,1);a.splice(s.destination.index,0,l);const i=a.map((c,r)=>({id:c.id,ordem:r}));ue.mutate(i)},be=s=>{if(!s.destination||!N)return;const a=Array.from(N),[l]=a.splice(s.source.index,1);a.splice(s.destination.index,0,l);const i=a.map((c,r)=>({id:c.id,ordem:r}));he.mutate(i)},we=s=>{if(!s.destination||!h)return;const a=Array.from(h),[l]=a.splice(s.source.index,1);a.splice(s.destination.index,0,l);const i=a.map((c,r)=>({id:c.id,ordem:r}));ge.mutate(i)},Me=s=>{if(!s.destination||!b)return;const a=Array.from(b),[l]=a.splice(s.source.index,1);a.splice(s.destination.index,0,l);const i=a.map((c,r)=>({id:c.id,ordem:r}));ye.mutate(i)},Z=s=>{q(s),ie({titulo:s.titulo,tipo_link:s.tipo_link,link_url:s.link_url||"",link_referencia_id:s.link_referencia_id||"",icone:s.icone||"Menu",visivel:s.visivel,abrir_nova_aba:s.abrir_nova_aba}),_(!0)},ke=s=>{K(s),oe({titulo:s.titulo,tipo_link:s.tipo_link,link_url:s.link_url||"",link_referencia_id:s.link_referencia_id||"",icone:s.icone,visivel:s.visivel,abrir_nova_aba:s.abrir_nova_aba}),F(!0)},ee=s=>{Q(s),S(!0)},_e=s=>{A(s),E(!0)},Ie=s=>{const a=j?{...s,id:j.id}:s;ve.mutate(a)},se=s=>{const a=Ze[s];return a?e.jsx(a,{className:"h-4 w-4"}):e.jsx(ne,{className:"h-4 w-4"})};return p!=null&&p.menu_tema,(ae=p==null?void 0:p.top_menu_visivel)==null||ae.ativo,p!=null&&p.top_menu_tema,e.jsxs("div",{className:"p-4 md:p-8 space-y-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold",children:"Cabeçalho e Rodapé"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"Gerencie todos os menus e links do site"})]}),e.jsxs(D,{children:[e.jsx(L,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(O,{className:"flex items-center gap-2",children:[e.jsx(ne,{className:"h-5 w-5"}),"Menu Principal"]}),e.jsx(T,{children:"Arraste para reordenar os itens"})]}),e.jsxs(o,{onClick:()=>{q(null),_(!0)},size:"sm",children:[e.jsx(P,{className:"h-4 w-4 mr-2"}),"Novo Item"]})]})}),e.jsx(R,{children:e.jsx(H,{onDragEnd:Ne,children:e.jsx($,{droppableId:"menu-items",direction:"horizontal",children:s=>e.jsxs("div",{...s.droppableProps,ref:s.innerRef,className:"flex flex-wrap gap-2 min-w-0",children:[x==null?void 0:x.map((a,l)=>{const i=(g==null?void 0:g.filter(c=>c.parent_id===a.id))||[];return e.jsx(G,{draggableId:a.id,index:l,children:c=>e.jsxs("div",{ref:c.innerRef,...c.draggableProps,...c.dragHandleProps,className:"border rounded p-2 bg-background text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("span",{className:"font-medium",children:a.titulo}),i.length>0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",i.length," sub)"]}),e.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[e.jsx(o,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>U.mutate({id:a.id}),children:a.visivel?e.jsx(M,{className:"h-3 w-3"}):e.jsx(k,{className:"h-3 w-3"})}),e.jsx(o,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>Z(a),children:e.jsx(f,{className:"h-3 w-3"})}),e.jsx(o,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>X.mutate(a.id),children:e.jsx(y,{className:"h-3 w-3"})})]})]}),i.length>0&&e.jsx("div",{className:"ml-6 mt-1 border-l-2 border-muted pl-3 space-y-1",children:i.map(r=>e.jsxs("div",{className:"flex items-center justify-between py-1 text-xs",children:[e.jsxs("span",{className:"text-muted-foreground",children:["↳ ",r.titulo]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(o,{size:"sm",variant:"ghost",className:"h-5 w-5 p-0",onClick:()=>U.mutate({id:r.id}),children:r.visivel?e.jsx(M,{className:"h-3 w-3"}):e.jsx(k,{className:"h-3 w-3"})}),e.jsx(o,{size:"sm",variant:"ghost",className:"h-5 w-5 p-0",onClick:()=>Z(r),children:e.jsx(f,{className:"h-3 w-3"})}),e.jsx(o,{size:"sm",variant:"ghost",className:"h-5 w-5 p-0",onClick:()=>X.mutate(r.id),children:e.jsx(y,{className:"h-3 w-3"})})]})]},r.id))})]})},a.id)}),s.placeholder]})})})})]}),e.jsx(J,{}),e.jsxs(D,{children:[e.jsx(L,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(O,{className:"flex items-center gap-2",children:[e.jsx(Ke,{className:"h-5 w-5"}),"Top Menu"]}),e.jsx(T,{children:"Menu superior do site"})]}),e.jsxs(o,{onClick:()=>{K(null),F(!0)},size:"sm",children:[e.jsx(P,{className:"h-4 w-4 mr-2"}),"Novo Item"]})]})}),e.jsx(R,{children:e.jsx(H,{onDragEnd:be,children:e.jsx($,{droppableId:"top-menu-items",children:s=>e.jsxs("div",{...s.droppableProps,ref:s.innerRef,className:"space-y-2",children:[N==null?void 0:N.map((a,l)=>e.jsx(G,{draggableId:a.id,index:l,children:i=>e.jsxs("div",{ref:i.innerRef,...i.draggableProps,className:"border rounded p-3 bg-background flex items-center gap-3",children:[e.jsx("div",{...i.dragHandleProps,children:e.jsx(V,{className:"h-4 w-4 text-muted-foreground"})}),se(a.icone),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-medium text-sm",children:a.titulo}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a.link_url})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(o,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>xe.mutate({id:a.id}),children:a.visivel?e.jsx(M,{className:"h-3 w-3"}):e.jsx(k,{className:"h-3 w-3"})}),e.jsx(o,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>ke(a),children:e.jsx(f,{className:"h-3 w-3"})}),e.jsx(o,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>pe.mutate(a.id),children:e.jsx(y,{className:"h-3 w-3"})})]})]})},a.id)),s.placeholder]})})})})]}),e.jsx(J,{}),e.jsxs(D,{children:[e.jsx(L,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(O,{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"h-5 w-5"}),"Menu do Portal da Transparência"]}
1),e.jsx(T,{children:"Itens exibidos apenas no cabeçalho das páginas de transparência. Arraste para reordenar."})]}),e.jsxs(o,{onClick:()=>{Q(null),S(!0)},size:"sm",children:[e.jsx(P,{className:"h-4 w-4 mr-2"}),"Novo Item"]})]})}),e.jsx(R,{children:e.jsx(H,{onDragEnd:we,children:e.jsx($,{droppableId:"menu-transparencia-items",direction:"horizontal",children:s=>e.jsxs("div",{...s.droppableProps,ref:s.innerRef,className:"flex flex-wrap gap-2 min-w-0",children:[h==null?void 0:h.map((a,l)=>{const i=(v==null?void 0:v.filter(c=>c.parent_id===a.id))||[];return e.jsx(G,{draggableId:a.id,index:l,children:c=>e.jsxs("div",{ref:c.innerRef,...c.draggableProps,...c.dragHandleProps,className:"border rounded p-2 bg-background text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("span",{className:"font-medium",children:a.titulo}),i.length>0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",i.length," sub)"]}),e.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[e.jsx(o,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>Y.mutate({id:a.id}),children:a.visivel?e.jsx(M,{className:"h-3 w-3"}):e.jsx(k,{className:"h-3 w-3"})}),e.jsx(o,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>ee(a),children:e.jsx(f,{className:"h-3 w-3"})}),e.jsx(o,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>W.mutate(a.id),children:e.jsx(y,{className:"h-3 w-3"})})]})]}),i.length>0&&e.jsx("div",{className:"ml-6 mt-1 border-l-2 border-muted pl-3 space-y-1",children:i.map(r=>e.jsxs("div",{className:"flex items-center justify-between py-1 text-xs",children:[e.jsxs("span",{className:"text-muted-foreground",children:["↳ ",r.titulo]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(o,{size:"sm",variant:"ghost",className:"h-5 w-5 p-0",onClick:()=>Y.mutate({id:r.id}),children:r.visivel?e.jsx(M,{className:"h-3 w-3"}):e.jsx(k,{className:"h-3 w-3"})}),e.jsx(o,{size:"sm",variant:"ghost",className:"h-5 w-5 p-0",onClick:()=>ee(r),children:e.jsx(f,{className:"h-3 w-3"})}),e.jsx(o,{size:"sm",variant:"ghost",className:"h-5 w-5 p-0",onClick:()=>W.mutate(r.id),children:e.jsx(y,{className:"h-3 w-3"})})]})]},r.id))})]})},a.id)}),s.placeholder]})})})})]}),e.jsx(J,{}),e.jsxs(D,{children:[e.jsx(L,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(O,{className:"flex items-center gap-2",children:[e.jsx(ze,{className:"h-5 w-5"}),"Menu do Rodapé"]}),e.jsx(T,{children:'Links exibidos como "Links" no rodapé do site'})]}),e.jsxs(o,{onClick:()=>{A(null),E(!0)},size:"sm",children:[e.jsx(P,{className:"h-4 w-4 mr-2"}),"Novo Link"]})]})}),e.jsx(R,{children:e.jsx(H,{onDragEnd:Me,children:e.jsx($,{droppableId:"footer-links",children:s=>e.jsxs("div",{...s.droppableProps,ref:s.innerRef,className:"space-y-2",children:[b==null?void 0:b.map((a,l)=>e.jsx(G,{draggableId:a.id,index:l,children:i=>e.jsxs("div",{ref:i.innerRef,...i.draggableProps,className:"border rounded p-3 bg-background flex items-center gap-3",children:[e.jsx("div",{...i.dragHandleProps,children:e.jsx(V,{className:"h-4 w-4 text-muted-foreground"})}),a.icone&&se(a.icone),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-medium text-sm",children:a.titulo}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a.link_url})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(o,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>_e(a),children:e.jsx(f,{className:"h-3 w-3"})}),e.jsx(o,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0",onClick:()=>fe.mutate(a.id),children:e.jsx(y,{className:"h-3 w-3"})})]})]})},a.id)),s.placeholder]})})})})]}),e.jsx(B,{isOpen:te,onClose:()=>{_(!1),q(null)},onSave:s=>de.mutate(s),editingItem:I,mode:"menu_principal",menuItems:x==null?void 0:x.map(s=>({id:s.id,titulo:s.titulo}))}),e.jsx(B,{isOpen:re,onClose:()=>{F(!1),K(null)},onSave:s=>me.mutate(s),editingItem:C,mode:"top_menu"}),e.jsx(B,{isOpen:le,onClose:()=>{S(!1),Q(null)},onSave:s=>je.mutate(s),editingItem:z,mode:"menu_principal",menuItems:h==null?void 0:h.map(s=>({id:s.id,titulo:s.titulo}))}),e.jsx(B,{isOpen:ce,onClose:()=>{E(!1),A(null)},onSave:Ie,editingItem:j,mode:"footer_links"})]})};export{Fs 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.