1import{u as j,j as e}from"./vendor-query-CAW0R6Fd.js";import{j as p,L as f}from"./vendor-react-BIBNHc4z.js";import{aq as g,p as N,S as y,T as w,H as b,B as n,A as k,b as o,j as i,k as c,C as v,ao as C,o as M,D as B,F as S,f as _,a5 as F}from"./index-DxX8Lkqr.js";import{g as H}from"./ps-conteudos.service-BKDep2EE.js";import{g as L}from"./utils-objBp_8x.js";import"./ui-radix-CMPBktV5.js";function $(a){if(!a||a<=0)return"";const t=["B","KB","MB","GB"],l=Math.min(Math.floor(Math.log(a)/Math.log(1024)),t.length-1);return`${(a/Math.pow(1024,l)).toFixed(1)} ${t[l]}`}function O(){const{portalSlug:a,catSlug:t,conteudoSlug:l}=p(),{data:s,isLoading:h,isError:u}=j({queryKey:["ps-conteudo-detalhe",a,t,l],queryFn:()=>H(a,t,l),enabled:!!a&&!!t&&!!l}),d=s!=null&&s.data?g(s.data):null,x=(s==null?void 0:s.arquivos)||[],m=s!=null&&s.conteudo?N.sanitize(s.conteudo):"";return e.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[e.jsx(y,{title:s==null?void 0:s.titulo,description:(s==null?void 0:s.descricao)||void 0,path:`/portais-setoriais/${a}/${t}/${l}`,type:"article"}),e.jsx(w,{}),e.jsx(b,{}),e.jsxs("main",{className:"flex-1 container mx-auto max-w-4xl px-4 py-8",children:[e.jsx(n,{asChild:!0,variant:"ghost",size:"sm",className:"mb-4",children:e.jsxs(f,{to:`/portais-setoriais/${a}`,children:[e.jsx(k,{className:"h-4 w-4 mr-2"})," Voltar ao portal"]})}),h?e.jsxs("div",{className:"space-y-4",children:[e.jsx(o,{className:"h-10 w-3/4"}),e.jsx(o,{className:"h-4 w-1/3"}),e.jsx(o,{className:"h-64 w-full"})]}):u||!s?e.jsx(i,{children:e.jsx(c,{className:"py-12 text-center text-muted-foreground",children:"Conteúdo não encontrado ou não publicado."})}):e.jsxs("article",{className:"space-y-6",children:[e.jsxs("header",{className:"space-y-2",children:[e.jsx("h1",{className:"text-3xl font-bold",children:s.titulo}),d&&e.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx(v,{className:"h-4 w-4"}),L(d,"dd 'de' MMMM 'de' yyyy",{locale:F})]}),s.descricao&&e.jsx("p",{className:"text-base text-muted-foreground",children:s.descricao})]}),m&&e.jsx("div",{className:"prose prose-slate max-w-none",dangerouslySetInnerHTML:{__html:m}}),s.link_externo&&e.jsx(i,{children:e.jsx(c,{className:"pt-6",children:e.jsx(n,{asChild:!0,variant:"outline",children:e.jsxs("a",{href:s.link_externo,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(C,{className:"h-4 w-4 mr-2"}),"Acessar link externo"]})})})}),x.length>0&&e.jsx(i,{children:e.jsxs(c,{className:"pt-6 space-y-2",children:[e.jsx("h2",{className:"font-semibold mb-2",children:"Anexos"}),e.jsx("ul",{className:"divide-y border rounded-md",children:x.map(r=>e.jsxs("li",{className:"flex items-center justify-between p-3 gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(M,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),e.jsx("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm hover:underline truncate",title:r.nome,children:r.titulo||r.nome}),r.tamanho?e.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:["(",$(r.tamanho),")"]}):null]}),e.jsx(n,{asChild:!0,variant:"ghost",size:"sm",children:e.jsx("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",download:!0,children:e.jsx(B,{className:"h-4 w-4"})})})]},r.id))})]})})]})]}),e.jsx(S,{}),e.jsx(_,{})]})}export{O 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.