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{load as s}from"cheerio";import c from"dayjs";import{renderToString as l}from"hono/jsx/dom/server";import{raw as u}from"hono/html";const d=`811c18b08cf04e79be3b67d6902ee1a7`,f=`KJRB`,p=`https://epaper.stdaily.com/stdailynewspaperapi`,m={path:`/digitalpaper`,categories:[`traditional-media`],example:`/stdaily/digitalpaper`,name:`科技日报`,maintainers:[`lyqluis`,`KarasuShin`],handler:h,features:{supportRadar:!0},radar:[{source:[`epaper.stdaily.com/statics/technology-site/index.html`],target:`/digitalpaper`}]};async function h(){let m=(await e(`${p}/uv/article/period/date`,{method:`POST`,body:{code:f,date:c(new Date,`YYYY-MM-01`)},headers:{"X-Requested-With":`XMLHttpRequest`}})).obj.dateList.toSorted().at(-1),h=await e(`${p}/uv/article/period/periodTime`,{method:`POST`,body:{code:f,periodTime:m,siteId:d},headers:{"X-Requested-With":`XMLHttpRequest`}});return{title:`中国科技网 - 科技日报`,link:`https://epaper.stdaily.com`,item:(await Promise.all(h.obj.editionList.map(c=>t.tryGet(`stdaily:epaper:${c.id}`,async()=>{let{list:m}=await e(`${p}/uv/article/article/editionId`,{method:`POST`,body:{id:c.id,siteId:d},headers:{"X-Requested-With":`XMLHttpRequest`}});return await Promise.all(m.map(async m=>await t.tryGet(`stddaily:epaper:article:${m.id}`,async()=>{let{obj:{articleVo:t}}=await e(`${p}/uv/article/article/articleId`,{method:`POST`,body:{code:f,id:m.id,siteId:d},headers:{"X-Requested-With":`XMLHttpRequest`}});return{title:`${t.editionName.match(/：(.*)/)?.[1]} - ${s(t.title).text()}`,description:l(o(i,{children:[t.subtitle?a(`h3`,{children:t.subtitle}):null,t.picList?.length?t.picList.map(e=>o(`div`,{children:[a(`img`,{src:e.url}),e.picText?a(`p`,{children:e.picText}):null]})):null,t.content?u(t.content):null]})),pubDate:r(n(t.periodTime),8),author:t.author,link:`https://epaper.stdaily.com/statics/technology-site/index.html#/home?isDetail=1&currentNewsId=${m.id}&currentVersionName=${t.editionName}&currentVersion=${Number(c.editionCode)}&timeValue=${t.periodTime}`}})))})))).flat(),image:`https://www.stdaily.com/favicon.ico`}}export{m as route};