import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./got-BBDj7u1e.mjs";import{c as n,d as r,f as i,s as a,t as o}from"./util-DndyIAOJ.mjs";const s={path:`/collection/:id`,categories:[`new-media`],example:`/huxiu/collection/212`,parameters:{id:`文集 id，可在对应文集页 URL 中找到`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!0,supportBT:!1,supportPodcast:!0,supportScihub:!1},name:`文集`,maintainers:[`AlexdanerZe`,`nczitzk`],handler:c,description:`更多文集请参见 [文集](https://www.huxiu.com/collection)`};async function c(c){let l=c.req.param(`id`),u=c.req.query(`limit`)?Number.parseInt(c.req.query(`limit`),10):10,d=new URL(`web/collection/articleList`,o).href,f=new URL(`collection/${l}.html`,i).href,{data:p}=await t.post(d,{form:{platform:`www`,collection_id:l}});return{item:await r(p.data.datalist,u,e.tryGet),...await n({currentUrl:f,apiUrl:new URL(`web/collection/detail`,o).href,form:{platform:`www`,collection_id:l},mapData:e=>({title:e.name,description:e.summary,image:e.head_img||(e.icon?new URL(e.icon,i).href:void 0),titlePrefix:a(s.name)})})}}export{s as route};