PageSourceSearch

https://politicaspublicasdelnorte.cl/assets/publicaciones._slug-WFzrilYO.js

js politicaspublicasdelnorte.cl collected 2026-10-02 13:26:29 UTC 5,613 bytes, 1 lines download raw bytes

1import{g as x,s as c,j as e,L as n}from"./index-DmrZbqIw.js";import{u as o}from"./useQuery-BsQuUJOp.js";import{P as p}from"./PublicLayout-BrzvSvJj.js";import{B as d}from"./button-BZvngp_e.js";import{A as h}from"./arrow-left-Bhy7r9Uv.js";import{B as g}from"./building-2-CA3VEhzp.js";import{M as j}from"./map-pin-BgxZT0Wk.js";import{C as f}from"./calendar-DMR7rGQ3.js";import{F as b}from"./file-text-E9_KAPK0.js";import{E as m}from"./external-link-DtMqpZiA.js";import"./useRouterState-B4yCJhwn.js";import"./utils-D7iammCF.js";import"./chevron-down-DTHQhLoK.js";import"./createLucideIcon-BhHQ8QKH.js";import"./x-CBqx6EXH.js";function R(){const{policy:r}=x.useLoaderData(),i=o({queryKey:["policy-docs",r.id],queryFn:async()=>{const{data:t}=await c.from("documents").select("id,title,slug,document_type,external_url,file_url,year").eq("policy_id",r.id).eq("publication_status","published");return t??[]}}),a=o({queryKey:["related",r.category_id,r.id],enabled:!!r.category_id,queryFn:async()=>{const{data:t}=await c.from("public_policies").select("id,title,slug,short_summary").eq("publication_status","published").eq("category_id",r.category_id).neq("id",r.id).limit(3);return t??[]}});return e.jsx(p,{children:e.jsxs("article",{className:"container-narrow py-14",children:[e.jsxs(n,{to:"/publicaciones",className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",children:[e.jsx(h,{className:"h-3.5 w-3.5"})," Volver a publicaciones"]}),e.jsxs("div",{className:"mt-8",children:[e.jsx("span",{className:"text-xs uppercase tracking-[0.18em] text-accent-electric font-medium",children:r.category?.name??"Publicación"}),e.jsx("h1",{className:"mt-3 font-display text-xl md:text-2xl leading-[1.15]",children:r.title}),e.jsx("p",{className:"mt-4 text-lg text-muted-foreground leading-relaxed",children:r.short_summary})]}),e.jsxs("dl",{className:"mt-8 grid sm:grid-cols-2 gap-4 rounded-xl border border-border bg-surface p-5 text-sm",children:[r.institution&&e.jsx(l,{icon:g,label:"Institución responsable",value:r.institution.name}),r.region&&e.jsx(l,{icon:j,label:"Región / alcance",value:r.region}),r.published_at&&e.jsx(l,{icon:f,label:"Publicación",value:new Date(r.published_at).toLocaleDateString("es-ES",{timeZone:"UTC",day:"2-digit",month:"long",year:"numeric"})}),r.status&&e.jsx(l,{icon:b,label:"Estado",value:r.status})]}),r.executive_summary&&e.jsx(s,{title:"Resumen ejecutivo",children:e.jsx("p",{children:r.executive_summary})}),r.description&&e.jsx(s,{title:"Descripción",children:e.jsx("p",{className:"whitespace-pre-line",children:r.description})}),r.objectives&&e.jsx(s,{title:"Objetivos",children:e.jsx("p",{className:"whitespace-pre-line",children:r.objectives})}),r.beneficiaries&&e.jsx(s,{title:"Beneficiarios",children:e.jsx("p",{className:"whitespace-pre-line",children:r.beneficiaries})}),Array.isArray(r.related_links)&&r.related_links.length>0&&e.jsx(s,{title:"Descargas",children:e.jsx("ul",{className:"space-y-2",children:r.related_links.map((t,u)=>e.jsx("li",{children:e.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between rounded-lg border border-border bg-card p-4 hover:border-primary/40 transition",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"PDF"}),e.jsx("div",{className:"mt-1 font-medium text-foreground",children:t.title||t.label||"Descargar documento"})]}),e.jsx(m,{className:"h-4 w-4 text-primary"})]})},u))})}),(i.data?.length??0)>0&&e.jsx(s,{title:"Documentos relacionados",children:e.jsx("ul",{className:"space-y-2",children:i.data.map(t=>e.jsx("li",{children:e.jsxs("a",{href:t.external_url||t.file_url||"#",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between rounded-lg border border-border bg-card p-4 hover:border-primary/40 transition",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:[t.document_type," ",t.year&&`· ${t.year}`]}),e.jsx("div",{className:"mt-1 font-medium text-foreground",children:t.title})]}),e.jsx(m,{className:"h-4 w-4 text-primary"})]})},t.id))})}),(a.data?.length??0)>0&&e.jsx(s,{title:"Publicaciones relacionadas",children:e.jsx("div",{className:"grid sm:grid-cols-3 gap-4",children:a.data.map(t=>e.jsxs(n,{to:"/publicaciones/$slug",params:{slug:t.slug},className:"rounded-lg border border-border p-4 hover:border-primary/40 transition",children:[e.jsx("div",{className:"font-medium text-foreground line-clamp-2",children:t.title}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:t.short_summary})]},t.id))})}),e.jsxs("div",{className:"mt-14 flex flex-wrap gap-3",children:[e.jsx(d,{asChild:!0,children:e.jsx(n,{to:"/publicaciones",children:"Ver más publicaciones"})}),e.jsx(d,{variant:"outline",onClick:()=>navigator.share?.({title:r.title,url:window.location.href}).catch(()=>{}),children:"Compartir"})]})]})})}function l({icon:r,label:i,value:a}){return e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(r,{className:"h-4 w-4 mt-0.5 text-accent-electric"}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:i}),e.jsx("dd",{className:"mt-0.5 text-foreground",children:a})]})]})}function s({title:r,children:i}){return e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{className:"font-serif text-2xl text-foreground mb-3",children:r}),e.jsx("div",{className:"text-foreground leading-relaxed text-[15px]",children:i})]})}export{R as component};

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.