1import{n as f,r as a,u as p,a as d}from"./index-gDMovoVd.js";import{b as S}from"./buildQueryString-CFId9shU.js";async function g(r){const{locale:s="ru",...o}=r;try{const t=S(o),c=t?`${f}?${t}`:f,e=await fetch(c,{method:"GET",credentials:"include",headers:{"Content-Type":"application/json","Accept-Language":s}});if(e.status===400)throw new Response("News not found",{status:404});return await e.json()}catch(t){throw t instanceof Response?t:new Response("Internal Server Error",{status:500})}}const h={count:0,next:null,previous:null,results:[]};function E({page:r,page_size:s=15}={}){const[o,t]=a.useState(h),[c,e]=a.useState(!0),{i18n:u}=p(),{filters:w}=d(),i=r||w.page,l=a.useCallback(async()=>{e(!0);try{const n=await g({page:i,page_size:s,locale:u.locale});t(n)}finally{e(!1)}},[i,s,u.locale]);return a.useEffect(()=>{let n=!0;return(async()=>n&&await l())(),()=>{n=!1}},[l]),{newsData:o,isLoading:c}}export{E as u};
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.