import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{load as n}from"cheerio";const r={path:`/magazine/:id`,categories:[`anime`],example:`/comic-fuz/magazine/27860`,parameters:{id:`ComicFuz中对应的杂志id`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`comic-fuz.com/magazine/:id`],target:`/magazine/:id`}],name:`杂志详情`,maintainers:[`xiaobailoves`],handler:async r=>{let{id:i}=r.req.param(),a=`https://comic-fuz.com`,o=`${a}/magazine/${i}`,s=n(await e(o,{headers:{Referer:`https://comic-fuz.com/`,"Accept-Language":`ja,en-US;q=0.9,en;q=0.8`}}))(`#__NEXT_DATA__`).text();if(!s)throw Error(`无法解析页面数据，请检查杂志 ID 是否正确或页面结构是否变动`);let c=JSON.parse(s).props?.pageProps;if(!c)throw Error(`无法解析页面 Props 数据`);let l=c.magazineName||``,u=c.pickupMagazineIssue?.longDescription||``,d=(c.magazineIssues||[]).map(e=>{let n=e.paidPoint||0,r=n>0?`付费`:`无料`,i=e.thumbnailUrl;i&&i.startsWith(`/`)&&(i=`https://img.comic-fuz.com${i}`);let o=e.updatedDate?e.updatedDate.replace(/\s*発売/,``).trim():``;return{title:`${l} - ${e.magazineIssueName}`,link:`${a}/magazine/viewer/${e.magazineIssueId}`,description:`
                ${i?`<img src="${i}" style="max-width: 100%;"><br>`:``}
                <p>价格: ${n} 金币/银币</p>
                <p>发售日期: ${e.updatedDate}</p>
                <p>截止日期: ${e.endDate||`无`}</p>
                ${e.longDescription?`<p>${e.longDescription}</p>`:``}
                `,pubDate:o?t(o,`YYYY/MM/DD`):void 0,guid:`comicfuz-magazine-id-${e.magazineIssueId}`,category:[r]}});return{title:`COMIC FUZ - ${l}`,link:o,description:u,item:d,language:`ja`}}};export{r as route};