import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{t as n}from"./got-BBDj7u1e.mjs";import{load as r}from"cheerio";const i=async i=>{let a=i.req.query(`limit`)?Number.parseInt(i.req.query(`limit`),10):15,o=new URL(`web/dirlist.jsp`,`https://zfxxgk.ndrc.gov.cn`).href,{data:s}=await n(o),c=r(s),l=c(`html`).prop(`lang`);c(`th`).parent().remove();let u=c(`div.zwxxkg-result tr`).slice(0,a).toArray().map(e=>{e=c(e);let n=e.find(`a.xxgk_list1`);return{title:n.text(),pubDate:t(e.find(`td`).last().text()),link:new URL(n.prop(`href`),o).href,language:l}});u=await Promise.all(u.map(t=>e.tryGet(t.link,async()=>{let{data:e}=await n(t.link),i=r(e),a=i(`meta[name="ArticleTitle"]`).prop(`content`),s=i(`div.zwgkdetail`).html();return t.title=a,t.description=s,t.category=[...new Set([i(`meta[name="ContentSource"]`).prop(`content`),i(`meta[name="ColumnName"]`).prop(`content`),i(`meta[name="ColumnType"]`).prop(`content`)])].filter(Boolean),t.author=i(`meta[name="ContentSource"]`).prop(`content`),t.content={html:s,text:i(`div.article`).text()},t.language=l,t.enclosure_url=i(`table.enclosure a.xxgk_list1`).length===0?void 0:new URL(i(`table.enclosure a.xxgk_list1`).first().prop(`href`),o).href,t.enclosure_title=t.enclosure_url?i(`table.enclosure a.xxgk_list1`).first().text():void 0,t})));let d=new URL(c(`div.zwgklogo img`).prop(`src`),o).href;return{title:`${c(`meta[name="SiteName"]`).prop(`content`)} - ${c(`div.zwgktoptitle`).text()}`,description:c(`meta[name="ColumnDescription"]`).prop(`content`),link:o,item:u,allowEmpty:!0,image:d,author:c(`meta[name="SiteName"]`).prop(`content`),language:l}},a={path:[`/ndrc/zfxxgk`],name:`中华人民共和国国家发展和改革委员会政府信息公开`,url:`zfxxgk.ndrc.gov.cn`,maintainers:[`howfool`,`nczitzk`],handler:i,example:`/gov/ndrc/zfxxgk`,parameters:void 0,description:void 0,categories:[`government`],features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportRadar:!0,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`zfxxgk.ndrc.gov.cn/web/dirlist.jsp`],target:`/ndrc/zfxxgk`}]};export{i as handler,a as route};