import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{t as n}from"./got-BBDj7u1e.mjs";import{load as r}from"cheerio";const i={path:`/topic/:id`,categories:[`new-media`],example:`/panewslab/topic/1629365774078402`,parameters:{id:`专题 id，可在地址栏 URL 中找到`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`panewslab.com/`]}],name:`专题`,maintainers:[`nczitzk`],handler:a,url:`panewslab.com/`};async function a(i){let a=i.req.param(`id`),o=`https://panewslab.com`,s=`${o}/webapi/subject/articles?Rn=${i.req.query(`limit`)??25}&LId=1&sid=${a}&tw=0`,c=`${o}/zh/topiclist/${a}.html`,l=(await n({method:`get`,url:s})).data.data.map(e=>({title:e.title,author:e.author.name,pubDate:t(e.publishTime*1e3),link:`${o}/zh/articledetails/${e.id}.html`,description:`<blockquote>${e.desc}</blockquote>`,category:e.tags}));return l=await Promise.all(l.map(t=>e.tryGet(t.link,async()=>{let e=r((await n({method:`get`,url:t.link})).data);return t.description+=e(`#txtinfo`).html(),t}))),{title:`PANews - ${a}`,link:c,item:l}}export{i as route};