import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{t as n}from"./got-BBDj7u1e.mjs";import{Fragment as r,jsx as i,jsxs as a}from"hono/jsx/jsx-runtime";import{load as o}from"cheerio";import{renderToString as s}from"hono/jsx/dom/server";import{raw as c}from"hono/html";const l={path:`/:bookName/book-series/:bookId`,radar:[{source:[`routledge.com/:bookName/book-series/:bookId`]}],name:`Unknown`,maintainers:[`TonyRL`],handler:u};async function u(r){let{bookName:i,bookId:a}=r.req.param(),s=`https://www.routledge.com/${i}/book-series/${a}`,{data:c}=await n(s,{headers:{accept:`text/html, */*; q=0.01`},searchParams:{publishedFilter:`alltitles`,pd:`published,forthcoming`,pg:1,pp:12,so:`pub`,view:`list`}}),l=o(c),u=l(`.row.book`).toArray().map(e=>{e=l(e);let n=e.find(`h3 a`),r=e.find(`p.description`),i=e.find(`p.description`).prev().text().split(`
`);return{title:n.text(),link:n.attr(`href`),description:r.text(),pubDate:t(i.pop().trim(),`MMMM DD, YYYY`),author:i.map(e=>e.trim()).filter(Boolean).join(`, `)}}),f=await Promise.all(u.map(t=>e.tryGet(t.link,async()=>{let{data:e}=await n(t.link),r=o(e),{data:i}=await n(`https://productimages.routledge.com`,{searchParams:{isbn:r(`meta[property="books:isbn"]`).attr(`content`),size:`amazon`,ext:`jpg`}}),a=r(`.sticky-div`);return a.find(`button.accordion-button`).contents().unwrap(),a.find(`.fa-shopping-cart`).parent().parent().remove(),t.description=d(i,a.html()),t})));return{title:l(`head title`).text(),description:l(`head meta[name="description"]`).attr(`content`),link:s,item:f}}const d=(e,t)=>s(a(r,{children:[e?a(r,{children:[i(`img`,{src:e}),i(`br`,{})]}):null,t?c(t):null]}));export{l as route};