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"./timezone-keeL11Io.mjs";import{Fragment as i,jsx as a,jsxs as o}from"hono/jsx/jsx-runtime";import*as s from"cheerio";import{renderToString as c}from"hono/jsx/dom/server";import{raw as l}from"hono/html";const u=e=>c(a(p,{...e})),d={path:`/series/:name`,example:`/yenpress/series/alya-sometimes-hides-her-feelings-in-russian`,parameters:{name:`Series name`},name:`Series`,maintainers:[`TonyRL`],handler:f,radar:[{source:[`yenpress.com/series/:name`],target:`/series/:name`}]};async function f(i){let{name:a}=i.req.param(),o=`https://yenpress.com/series/${a}`,c=await e(o),l=s.load(c),d=l(`.show-more-container .inline_block`).toArray().map(e=>{let t=l(e);return{title:t.find(`span`).text().trim(),link:new URL(t.find(`a`).attr(`href`),`https://yenpress.com`).href}}),f=await Promise.all(d.map(i=>t.tryGet(i.link,async()=>{let t=await e(i.link),a=s.load(t);i.category=a(`.detail-labels.mobile-only`).eq(0).find(`a`).toArray().map(e=>a(e).text().trim()),a(`svg, .social-share, .desktop-only, .detail-labels`).remove();let o=a(`.book-info`).find(`.book-cover-img`).html(),c=a(`.buy-info .deliver`).toArray().map((e,t)=>({deliver:a(e).text().trim(),price:a(`.book-price`).eq(t).text().trim(),from:a(`.services`).eq(t).find(`.service`).toArray().map(e=>{let t=a(e).find(`a`);return{name:t.text().trim(),link:t.attr(`href`)}}),detail:a(`.detail-info`).eq(t).find(`div span`).toArray().map(e=>{let t=a(e);return{key:t.text().trim(),value:t.next().text().trim()}})})),l=a(`.book-info`);return l.find(`.buy-info, .series-cover`).remove(),i.description=u({cover:o+l.html(),bookInfo:c}),i.pubDate=r(n(c[0].detail.find(e=>e.key===`Release Date`).value),0),i})));return{title:l(`head title`).text().trim(),description:l(`.social-share p`).text().trim(),link:o,item:f}}const p=({cover:e,bookInfo:t})=>o(i,{children:[e?o(i,{children:[l(e),a(`br`,{})]}):null,t?.map(e=>o(i,{children:[o(`p`,{children:[e.deliver,`: `,e.price]}),`Buy from:`,a(`ul`,{children:e.from?.map(e=>a(`li`,{children:a(`a`,{href:e.link,children:e.name})}))}),a(`b`,{children:`FULL DETAILS`}),a(`table`,{children:e.detail?.map(e=>o(`tr`,{children:[a(`td`,{children:e.key}),a(`td`,{children:e.value})]}))}),a(`br`,{})]}))]});export{d as route};