import{t as e}from"./parse-date-BdYTmLpo.mjs";import{a as t,i as n,o as r,r as i,t as a}from"./utils-DCgcdm3z.mjs";import{t as o}from"./post-B1ZZfRM9.mjs";const s={path:[`/timeline/:user`],categories:[`social-media`],example:`/cara/timeline/fengz`,parameters:{user:`username`},name:`Timeline`,maintainers:[`KarasuShin`],handler:c,radar:[{source:[`cara.app/:user`,`cara.app/:user/*`],target:`/timeline/:user`}]};async function c(s){let c=s.req.param(`user`),l=s.req.query(`limit`)?Number.parseInt(s.req.query(`limit`),10):15,u=await i(c),d=(await a(`${n}/posts/getAllByUser?slug=${u.slug}&take=${l}`)).data.map(n=>{let i=o({content:n.content,images:n.images.filter(e=>!e.isCoverImg).map(e=>({...e,src:`${t}/${e.src}`}))});return{title:n.title||n.content,pubDate:e(n.createdAt),link:`${r}/post/${n.id}`,description:i}});return{title:`Timeline - ${u.name}`,link:`${r}/${c}/all`,image:`${t}/${u.photo}`,item:d}}export{s as route};