import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{i as n}from"./common-utils-B6fqqa3X.mjs";import{t as r}from"./got-BBDj7u1e.mjs";import{t as i}from"./timezone-keeL11Io.mjs";import{load as a}from"cheerio";import o from"iconv-lite";const s={path:`/nopss/*`,name:`Unknown`,maintainers:[],handler:c};async function c(s){let c=n(s)===`/nopss`?`/GB/219469`:n(s).replace(/^\/nopss/,``),l=`http://www.nopss.gov.cn`,u=`${l}${c}`,d=await r({method:`get`,url:u,responseType:`buffer`}),f=a(o.decode(d.data,`gbk`)),p=f(`.p2j_list_con .clearfix li a`).slice(0,s.req.query(`limit`)?Number.parseInt(s.req.query(`limit`)):40).toArray().map(e=>(e=f(e),{title:e.text(),link:`${l}${e.attr(`href`)}`,pubDate:i(t(e.next().text(),`[YYYY-MM-DD HH:mm]`),8)}));return p=await Promise.all(p.map(t=>e.tryGet(t.link,async()=>{let e=await r({method:`get`,url:t.link,responseType:`buffer`});return t.description=a(o.decode(e.data,`gbk`))(`.text_con`).html(),t}))),{title:f(`title`).text(),link:u,item:p}}export{s as route};