PageSourceSearch

https://www.sentimientopopular.cl/_next/static/chunks/3a3ac_8vkgrco.js

js sentimientopopular.cl collected 2026-09-25 08:44:15 UTC 15,068 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,886072,e=>{"use strict";var t=e.i(289704),a=e.i(280515),r=e.i(715445),s=e.i(801647),l=e.i(859219);let n=(0,l.createServerReference)("40cd5e413a0bb7b8098cd2433b5a63745e0bfcc661",l.callServer,void 0,l.findSourceMapURL,"buscarAction"),c=/[.!?…:;"'«»“”‘’]$/u;var i=e.i(322426);function o(e){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);return t?{y:Number(t[1]),m:Number(t[2]),d:Number(t[3])}:null}function d(e,t,a){return`${e}-${String(t).padStart(2,"0")}-${String(a).padStart(2,"0")}`}function m(){let e=new Date;return d(e.getFullYear(),e.getMonth()+1,e.getDate())}function u(e){return e.charAt(0).toUpperCase()+e.slice(1)}function x(e){let{label:r,name:s,value:l,onChange:n,locale:c,min:x,max:h}=e,[p,b]=(0,a.useState)(!1),g=(0,a.useRef)(null),v=(0,a.useId)(),f=`${v}-cal`,j=(0,i.isEnglish)(c),y=j?"mm/dd/yyyy":"dd/mm/aaaa",N=h||m(),k=o(l),[w,S]=(0,a.useState)(()=>{let e=k??o(N)??o(m());return{y:e.y,m:e.m}}),M=()=>{let e=o(l)??o(N)??o(m());S({y:e.y,m:e.m}),b(!0)};(0,a.useEffect)(()=>{if(!p)return;let e=e=>{var t;(null==(t=g.current)?void 0:t.contains(e.target))||b(!1)},t=e=>{"Escape"===e.key&&b(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[p]);let C=(0,a.useMemo)(()=>{let e=new Intl.DateTimeFormat(c,{month:"long"});return Array.from({length:12},(t,a)=>u(e.format(new Date(2021,a,1))))},[c]),$=(0,a.useMemo)(()=>{let e=new Intl.DateTimeFormat(c,{weekday:"short"}),t=+!j;return Array.from({length:7},(a,r)=>u(e.format(new Date(2021,10,t+r))).replace(/\.$/,""))},[c,j]),D=(0,a.useMemo)(()=>{let e=new Date(w.y,w.m-1,1),t=j?e.getDay():(e.getDay()+6)%7,a=new Date(w.y,w.m-1,1-t);return Array.from({length:42},(e,t)=>{let r=new Date(a.getFullYear(),a.getMonth(),a.getDate()+t),s=d(r.getFullYear(),r.getMonth()+1,r.getDate());return{iso:s,day:r.getDate(),outside:r.getMonth()+1!==w.m||r.getFullYear()!==w.y,disabled:!!(x&&s<x)||s>N}})},[w,x,N,j]),L=m(),F=!x||d(w.y,w.m,1)>x,A=d(w.y,w.m,28)<N,H=e=>{let t=new Date(w.y,w.m-1+e,1);S({y:t.getFullYear(),m:t.getMonth()+1})},T=(0,a.useMemo)(()=>{let e=o(N).y,t=x?o(x).y:e-30,a=[];for(let r=e;r>=t;r--)a.push(r);return k&&!a.includes(k.y)&&a.push(k.y),a},[N,x,k]);return(0,t.jsxs)("div",{className:"block mt-3",ref:g,children:[(0,t.jsx)("label",{htmlFor:v,className:"block text-[13px] text-[#4b4b4b] cursor-pointer",children:r}),l&&(0,t.jsx)("input",{type:"hidden",name:s,value:l}),(0,t.jsxs)("div",{className:"relative mt-1",children:[(0,t.jsx)("input",{id:v,type:"text",readOnly:!0,value:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=o(e);if(!a)return"";let r=String(a.d).padStart(2,"0"),s=String(a.m).padStart(2,"0");return t?`${s}/${r}/${a.y}`:`${r}/${s}/${a.y}`}(l,j),placeholder:y,role:"combobox","aria-haspopup":"dialog","aria-expanded":p,"aria-controls":f,"aria-label":`${r.replace(/:$/,"")} (${y})`,onClick:()=>p?b(!1):M(),onKeyDown:e=>{("Enter"===e.key||" "===e.key||"ArrowDown"===e.key)&&(e.preventDefault(),M())},className:"block w-full cursor-pointer border border-[#cdcdcd] focus:border-black outline-none pl-3 pr-10 py-2 text-[14px] text-black placeholder:text-[#9a9a9a] bg-white"}),(0,t.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"#64748b",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 w-[19px] h-[19px]",children:(0,t.jsx)("path",{d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"})}),p&&(0,t.jsxs)("div",{id:f,role:"dialog","aria-label":(0,i.t)(c,`Elegir ${r.replace(/:$/,"").toLowerCase()}`,`Choose date: ${r.replace(/:$/,"")}`),className:"absolute z-30 left-0 top-[calc(100%+6px)] w-[268px] bg-white border border-[#e0e0e0] rounded-lg shadow-[0_8px_24px_rgba(0,0,0,0.12)] p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("button",{type:"button","aria-label":(0,i.t)(c,"Mes anterior","Previous month"),disabled:!F,onClick:()=>H(-1),className:"w-7 h-7 shrink-0 grid place-items-center text-[#4b4b4b] hover:bg-[#f2f2f2] rounded disabled:opacity-30 disabled:hover:bg-transparent",children:(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,className:"w-4 h-4",children:(0,t.jsx)("path",{d:"m15 18-6-6 6-6",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,t.jsxs)("div",{className:"flex-1 flex items-center justify-center gap-1",children:[(0,t.jsx)("select",{"aria-label":(0,i.t)(c,"Mes","Month"),value:w.m,onChange:e=>S(t=>({...t,m:Number(e.target.value)})),className:"appearance-none bg-transparent text-[14px] font-medium text-black text-center outline-none cursor-pointer hover:bg-[#f2f2f2] rounded px-1 py-0.5",children:C.map((e,a)=>
1(0,t.jsx)("option",{value:a+1,children:e},e))}),(0,t.jsx)("select",{"aria-label":(0,i.t)(c,"Año","Year"),value:w.y,onChange:e=>S(t=>({...t,y:Number(e.target.value)})),className:"appearance-none bg-transparent text-[14px] font-medium text-black text-center outline-none cursor-pointer hover:bg-[#f2f2f2] rounded px-1 py-0.5",children:T.map(e=>(0,t.jsx)("option",{value:e,children:e},e))})]}),(0,t.jsx)("button",{type:"button","aria-label":(0,i.t)(c,"Mes siguiente","Next month"),disabled:!A,onClick:()=>H(1),className:"w-7 h-7 shrink-0 grid place-items-center text-[#4b4b4b] hover:bg-[#f2f2f2] rounded disabled:opacity-30 disabled:hover:bg-transparent",children:(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,className:"w-4 h-4",children:(0,t.jsx)("path",{d:"m9 18 6-6-6-6",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),(0,t.jsxs)("div",{className:"mt-2 grid grid-cols-7 gap-y-1",children:[$.map(e=>(0,t.jsx)("div",{className:"h-7 grid place-items-center text-[11px] font-medium text-[#8a8a8a]",children:e},e)),D.map(e=>{let a=l===e.iso,r=L===e.iso;return(0,t.jsx)("button",{type:"button",disabled:e.disabled,"aria-current":r?"date":void 0,onClick:()=>{n(e.iso),b(!1)},className:["h-8 grid place-items-center text-[13px] rounded-full transition-colors",e.disabled?"text-[#d0d0d0] cursor-default":"hover:bg-[#f0f0f0] cursor-pointer",e.outside&&!e.disabled?"text-[#b5b5b5]":"",!e.outside&&!e.disabled?"text-black":"",r&&!a?"ring-1 ring-[#cdcdcd]":"",a?"bg-[var(--buscador-accent,#000)] text-white hover:bg-[var(--buscador-accent,#000)]":""].join(" "),children:e.day},e.iso)})]}),l&&(0,t.jsx)("button",{type:"button",onClick:()=>{n(""),b(!1)},className:"mt-2 w-full text-[12px] uppercase tracking-wider text-[#6b6b6b] hover:text-black py-1.5 border-t border-[#eee]",children:(0,i.t)(c,"Borrar fecha","Clear date")})]})]})]})}function h(e){let{row:a,locale:r}=e;return(0,t.jsx)("li",{className:"border border-[#e5e5e5] bg-white",children:(0,t.jsxs)("a",{href:a.url,className:"group flex flex-col sm:flex-row gap-4 sm:gap-6 p-4 sm:p-5",children:[a.cover&&(0,t.jsx)("div",{className:"shrink-0 w-full sm:w-[42%] sm:max-w-[440px] aspect-video overflow-hidden bg-[#f3f3f3] self-start",children:(0,t.jsx)("img",{src:a.cover,srcSet:a.cover2x?`${a.cover} 1x, ${a.cover2x} 2x`:void 0,alt:a.titulo,width:480,height:270,loading:"lazy",decoding:"async",className:"w-full h-full object-cover"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h2",{className:"text-[19px] sm:text-[22px] md:text-[24px] font-bold leading-[1.25] text-black",children:(0,t.jsx)("span",{className:"group-hover:underline",children:a.titulo})}),a.snippetHtml?(0,t.jsx)("p",{className:"mt-2 text-[14px] sm:text-[15px] text-[#4b4b4b] leading-snug line-clamp-2 [&_mark]:bg-yellow-100 [&_mark]:text-black [&_mark]:px-0.5",dangerouslySetInnerHTML:{__html:a.snippetHtml}}):a.resumen?(0,t.jsx)("p",{className:"mt-2 text-[14px] sm:text-[15px] text-[#4b4b4b] leading-snug line-clamp-2",children:function(e){if(!e)return null;let t=e.trim();return t?c.test(t)?t:`${t}.`:null}(a.resumen)}):null,(0,t.jsxs)("p",{className:"mt-3 text-[13px] text-[#6b6b6b]",children:[a.autor&&(0,t.jsxs)("span",{className:"font-medium",children:[(0,i.t)(r,"Por ","By "),a.autor]}),a.autor&&(0,t.jsx)("span",{"aria-hidden":!0,children:" · "}),a.fechaStr]})]})]})})}e.s(["BuscarClient",0,function(e){let{q:l,page:c,desde:o,hasta:d,slugs:m,sectionOptions:u,initial:p,locale:b,filtersOpen:g,copy:v}=e,[f,j]=(0,a.useState)({desde:o,hasta:d,slugs:m}),[y,N]=(0,a.useState)(c),[k,w]=(0,a.useState)(g),[S,M]=(0,a.useState)(p),[C,$]=(0,a.useState)(!1),D=(0,a.useRef)(null),L=(0,a.useRef)(0);(0,a.useEffect)(()=>()=>{D.current&&clearTimeout(D.current)},[]);let F=(0,a.useCallback)((e,t)=>{let a=new URLSearchParams;for(let t of(l&&a.set("q",l),e.desde&&a.set("desde",e.desde),e.hasta&&a.set("hasta",e.hasta),e.slugs))a.append("s",t);return t>1&&a.set("page",String(t)),a.toString()},[l]),A=(0,a.useCallback)(e=>{j(e),N(1);let t=F(e,1);window.history.replaceState(null,"",t?`/buscar?${t}`:"/buscar"),l.length<2||(D.current&&clearTimeout(D.current),$(!0),D.current=setTimeout(async()=>{let t=++L.current;try{let a=await n({q:l,page:1,desde:e.desde||void 0,hasta:e.hasta||void 0,s:e.slugs});if(t!==L.current)return;M(a)}catch{if(t!==L.current)return;M(e=>({...e,error:!0}))}finally{t===L.current&&$(!1)}},220))},[F,l]),{rows:H,total:T,totalIsApprox:Z,error:E}=S,P=!!f.desde||!!f.hasta||f.slugs.length>0,B=(0,t.jsxs)("div",{className:"space-y-7",children:[(0,t.jsxs)("fieldset",{children:[(0,t.jsx)("legend",{className:"text-[14px] font-bold text-black",children:(0,i.t)(b,"Fecha","Date")}
1),(0,t.jsx)(x,{label:(0,i.t)(b,"Desde:","From:"),name:"desde",value:f.desde,max:f.hasta||void 0,locale:b,onChange:e=>A({...f,desde:e})}),(0,t.jsx)(x,{label:(0,i.t)(b,"Hasta:","To:"),name:"hasta",value:f.hasta,min:f.desde||void 0,locale:b,onChange:e=>A({...f,hasta:e})})]}),u.length>0&&(0,t.jsxs)("fieldset",{children:[(0,t.jsx)("legend",{className:"text-[14px] font-bold text-black",children:(0,i.t)(b,"Sección","Section")}),(0,t.jsx)("div",{className:"mt-3 space-y-2.5",children:u.map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-2.5 text-[15px] text-black cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",name:"s",value:e.slug,checked:f.slugs.includes(e.slug),onChange:t=>{var a,r;let s;return a=e.slug,r=t.target.checked,s=new Set(f.slugs),void(r?s.add(a):s.delete(a),A({...f,slugs:u.map(e=>e.slug).filter(e=>s.has(e))}))},className:"w-[18px] h-[18px] shrink-0 accent-[var(--buscador-accent,#000)]"}),e.nombre]},e.id))})]}),P&&(0,t.jsx)("button",{type:"button",onClick:()=>A({desde:"",hasta:"",slugs:[]}),className:"w-full border border-[#cdcdcd] text-[#4b4b4b] text-[13px] font-medium uppercase tracking-wider py-2 hover:border-black hover:text-black",children:(0,i.t)(b,"Limpiar filtros","Clear filters")})]}),R=y<Math.max(1,Math.ceil((Z?Math.min(T,200):T)/20))&&20===H.length,_=y>1,V=e=>{let t=F(f,e);return t?`/buscar?${t}`:"/buscar"};return(0,t.jsx)("form",{method:"get",action:"/buscar",className:"mt-4",children:(0,t.jsxs)("div",{className:"md:grid md:grid-cols-[240px_1fr] md:gap-x-10",children:[(0,t.jsx)("aside",{className:"md:col-start-1 md:row-start-1 md:row-span-2 order-none",children:(0,t.jsxs)("details",{open:k,onToggle:e=>w(e.currentTarget.open),className:"mb-6 md:mb-0 md:sticky md:top-5 border border-[#e5e5e5] md:border-0 px-3 py-2 md:p-0",children:[(0,t.jsx)("summary",{className:"text-[13px] font-medium uppercase tracking-wider text-black cursor-pointer select-none md:hidden",children:(0,i.t)(b,"Filtros","Filters")}),(0,t.jsx)("div",{className:"mt-4 md:mt-0",children:B})]})}),(0,t.jsx)("div",{className:"md:col-start-2 md:row-start-1",children:(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("input",{type:"search",name:"q",defaultValue:l,placeholder:(0,i.t)(b,"¿Qué estás buscando?","What are you looking for?"),autoFocus:!0,className:"flex-1 min-w-0 border border-[#cdcdcd] focus:border-black outline-none px-3 py-2 text-[16px] text-black bg-white"}),(0,t.jsx)("button",{type:"submit",className:"bg-[var(--buscador-accent,#000)] text-white px-5 py-2 text-[14px] uppercase tracking-wider hover:opacity-90",children:(0,i.t)(b,"Buscar","Search")})]})}),(0,t.jsxs)("div",{className:"md:col-start-2 md:row-start-2 min-w-0",children:[0===l.length&&(0,t.jsx)("p",{className:"mt-8 text-[15px] text-[#666]",children:v.prompt}),l.length>0&&l.length<2&&(0,t.jsx)("p",{className:"mt-8 text-[15px] text-[#666]",children:v.tooShort}),E&&(0,t.jsx)("p",{className:"mt-8 text-[15px] text-red-600",children:v.error}),l.length>=2&&!E&&0===H.length&&!C&&(0,t.jsxs)("p",{className:"mt-8 text-[15px] text-[#666]",children:[(0,i.t)(b,"No encontramos noticias para ","We couldn't find any stories for "),(0,t.jsxs)("strong",{children:["“",l,"”"]}),P?(0,i.t)(b," con los filtros elegidos."," with the selected filters."):"."]}),l.length>=2&&0===H.length&&C&&(0,t.jsx)("p",{className:"mt-8 text-[15px] text-[#666]",children:(0,i.t)(b,"Buscando…","Searching…")}),H.length>0&&(0,t.jsxs)("div",{"aria-busy":C,className:C?"opacity-50 transition-opacity":"transition-opacity",children:[(0,t.jsxs)("div",{className:"mt-6 mb-2 text-[15px] text-[#4b4b4b]",children:[(0,t.jsxs)("strong",{className:"text-black",children:[Z?(0,i.t)(b,"Más de ","More than "):"",T]})," ",(0,i.isEnglish)(b)?(0,t.jsxs)(t.Fragment,{children:[1===T?"result":"results"," for"]}):(0,t.jsxs)(t.Fragment,{children:["resultado",1===T?"":"s"," para"]})," ",(0,t.jsxs)("span",{className:"font-bold text-[var(--buscador-accent,#000)]",children:["“",l,"”"]})]}),(0,t.jsx)("ul",{className:"mt-3 space-y-4",children:H.map(e=>(0,t.jsx)(h,{row:e,locale:b},e.id))}),(R||_)&&(0,t.jsxs)("nav",{"aria-label":(0,i.t)(b,"Paginación","Pagination"),className:"flex items-center justify-between gap-4 mt-10 pt-8 border-t border-[#cdcdcd]",children:[_?(0,t.jsxs)("a",{href:V(y-1),rel:"prev",className:"inline-flex items-center gap-2 text-[13px] font-medium uppercase tracking-[0.15em] text-black hover:underline",children:[(0,t.jsx)(r.ChevronLeft,{className:"w-4 h-4"}),(0,i.t)(b,"Página anterior","Previous page")]}):(0,t.jsx)("span",{}),(0,t.jsxs)("span",{className:"text-[13px] font-medium uppercase tracking-[0.15em] text-[#4b4b4b]",children:[(0,i.t)(b,"Página ","Page "),y]}),R?(0,t.jsxs)("a",{href:V(y+1),rel:"next",className:"inline-flex items-center gap-2 text-[13px] font-medium uppercase tracking-[0.15em] text-black hover:underline",children:[(0,i.t)(b,"Más resultados","More results"),(0,t.jsx)(s.ChevronRight,{className:"w-4 h-4"})]}):(0,t.jsx)("span",{})]})]})]})]})})}],886072)}]);

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.