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{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=({images:e,intro:t,description:n})=>s(a(r,{children:[e?.length?e.map(e=>e?.src?i(`figure`,{children:e.alt?i(`img`,{src:e.src,alt:e.alt}):i(`img`,{src:e.src})}):null):null,t?i(`blockquote`,{children:t}):null,n?c(n):null]})),u=async r=>{let{category:i=`news`}=r.req.param(),a=Number.parseInt(r.req.query(`limit`)??`7`,10),s=`http://www.ccg.org.cn`,c=new URL(i,s).href,u=o(await e(c)),d=u(`html`).attr(`lang`)??`zh`,f=u(`ul.huodong-list li`).slice(0,a).toArray().map(e=>{let t=u(e),r=t.find(`h5`).text(),i=t.find(`div.huodong-img img`).attr(`src`),a=l({images:i?[{src:i,alt:r}]:void 0,intro:t.find(`p`).html()||void 0}),o=t.find(`span`).text(),s=t.find(`a`).attr(`href`),c=o;return{title:r,description:a,pubDate:o?n(o,`YYYY年M月D日`):void 0,link:s,content:{html:a,text:a},image:i,banner:i,updated:c?n(c,`YYYY年M月D日`):void 0,language:d}});f=await Promise.all(f.map(r=>r.link?t.tryGet(r.link,async()=>{let t=o(await e(r.link)),i=t(`div.pinpai-page h3`).text(),a=t(`span.time`).text();t(`div.pinpai-page h3`).remove(),t(`div.pinpai-page span.time`).remove();let s=l({description:t(`div.pinpai-page`).html()||void 0}),c=a,u={title:i,description:s,pubDate:a?n(a,`YYYY年M月D日`):r.pubDate,content:{html:s,text:s},updated:c?n(c,`YYYY年M月D日`):r.updated,language:d};return{...r,...u}}):r));let p=u(`h1.nav-logo`).first().text();return{title:`${p} - ${u(`title`).text()}`,link:c,item:f,allowEmpty:!0,image:new URL(`wp-content/themes/ccg/imgs/nav-logo.png`,s).href,author:p,language:d,id:c}},d={path:`/:category?`,name:`动态`,url:`www.ccg.org.cn`,maintainers:[`nczitzk`],handler:u,example:`/ccg/news`,parameters:{category:{description:"分类，默认为 `news`，即新闻动态，可在对应分类页 URL 中找到",options:[{label:`新闻动态`,value:`news`},{label:`媒体报道`,value:`mtbd`}]}},description:`::: tip
订阅 [新闻动态](http://www.ccg.org.cn/news)，其源网址为 \`http://www.ccg.org.cn/news\`，请参考该 URL 指定部分构成参数，此时路由为 [\`/ccg/news\`](https://rsshub.app/ccg/news)。
:::

| 分类                                   | ID                                  |
| -------------------------------------- | ----------------------------------- |
| [新闻动态](http://www.ccg.org.cn/news) | [news](https://rsshub.app/ccg/news) |
| [媒体报道](http://www.ccg.org.cn/mtbd) | [mtbd](https://rsshub.app/ccg/mtbd) |
`,categories:[`new-media`],features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportRadar:!0,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`www.ccg.org.cn/category`],target:`/:category`},{title:`新闻动态`,source:[`www.ccg.org.cn/news`],target:`/news`},{title:`媒体报道`,source:[`www.ccg.org.cn/mtbd`],target:`/mtbd`}],view:0};export{u as handler,d as route};