1import{O as f,R as I,g as n}from"./vOe0WySJ.js";const D=r=>{const{getEndpoint:e}=f(),c=r?.limit||10,o=r?.page||1,a=r?.filters||{},d=r?.key||`news-${c}-${o}-${JSON.stringify(a)}`,{data:i,pending:g,error:l,refresh:u}=I(d,()=>$fetch(e("/api/public/news"),{method:"POST",body:{limit:c,page:o,category:a.category==="all"?void 0:a.category,tags:a.tags,neighborhood:a.neighborhood,search:a.search,departmentId:a.departmentId,projectId:a.projectId,hasVideo:a.hasVideo,sort:"createdAt",order:"DESC"}}),{server:!0,lazy:!1,default:()=>({success:!0,data:[],meta:null})}),y=n(()=>i.value?.data||[]),h=n(()=>i.value?.meta||null),p=async t=>{try{return(await $fetch(e(`/api/public/news/slug/${t}`)))?.data||null}catch(s){return console.error("Error fetching news by slug:",s),null}},m=async t=>{try{return(await $fetch(e("/api/public/news"),{method:"POST",body:{limit:t?.limit||10,page:t?.page||1,category:t?.category==="all"?void 0:t?.category,tags:t?.tags,search:t?.search,departmentId:t?.departmentId,projectId:t?.projectId,hasVideo:t?.hasVideo,sort:"createdAt",order:"DESC"}}))?.data||[]}catch(s){return console.error("Error fetching news:",s),[]}};return{newsItems:y,meta:h,loading:n(()=>g.value),error:n(()=>l.value?String(l.value):null),refresh:u,fetchNewsBySlug:p,fetchNews:m,getCategoryDisplayName:w,formatDate:S}},S=r=>{if(!r)return"";try{const e=new Date(r);return new Intl.DateTimeFormat("tr-TR",{year:"numeric",month:"long",day:"numeric"}).format(e)}catch{return""}},w=r=>{let e=r;if(Array.isArray(e)&&(e=e[0]),typeof e=="string"&&e.startsWith("[")&&e.endsWith("]"))try{const o=JSON.parse(e);Array.isArray(o)&&o.length>0&&(e=o[0])}catch{}return typeof e!="string"?"":{genel:"Güncel",GENEL:"Güncel",siyaset:"Siyaset",SIYASET:"Siyaset",ekonomi:"Ekonomi",EKONOMI:"Ekonomi",spor:"Spor",SPOR:"Spor",kultur:"Kültür & Turizm",KULTUR:"Kültür & Turizm",teknoloji:"Teknoloji",TEKNOLOJI:"Teknoloji",saglik:"SaÄlık",SAGLIK:"SaÄlık",egitim:"EÄitim",EGITIM:"EÄitim",diger:"DiÄer",DIGER:"DiÄer"}[e]||e};export{S as f,w as g,D 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.