import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./cache-DUthuMSu.mjs";import{t as n}from"./parse-date-BdYTmLpo.mjs";import{t as r}from"./utils-CTfII-Hq.mjs";import*as i from"cheerio";const a={path:`/user/article/:uid`,categories:[`programming`],example:`/luogu/user/article/1`,parameters:{name:`用户 UID`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`luogu.com/user/:uid`]},{source:[`luogu.com.cn/user/:uid`]}],name:`用户文章`,maintainers:[`TonyRL`],handler:s},o=`https://www.luogu.com`;async function s(a){let{uid:s}=a.req.param(),c=await r(s),l=(await e(`${o}/api/article/find`,{query:{user:s,page:1,ascending:!1}})).articles.result.map(e=>({title:e.title,link:`${o}/article/${e.lid}`,author:e.author.name,pubDate:n(e.time,`X`),description:e.content})),u=await Promise.all(l.map(n=>t.tryGet(n.link,async()=>{let t=await e(n.link);return n.description=i.load(t)(`div#rendered-preview`).html(),n})));return{title:`${c.name} 的个人中心 - 洛谷 | 计算机科学教育新生态`,description:c.description,link:`${o}/user/${s}#article`,image:c.avatar,item:u}}export{a as route};