import{t as e}from"./parse-date-BdYTmLpo.mjs";import{i as t}from"./common-utils-B6fqqa3X.mjs";import{t as n}from"./got-BBDj7u1e.mjs";import{t as r}from"./timezone-keeL11Io.mjs";import{load as i}from"cheerio";const a={path:`*`,name:`Unknown`,maintainers:[],handler:o};async function o(a){let o=`https://bad.news${t(a)===`/`?``:t(a)}`,s=i((await n({method:`get`,url:o})).data);s(`.option, .pagination`).remove();let c=s(`.entry`).toArray().map(t=>{t=s(t);let n=t.find(`a.title`);return t.find(`img`).each(function(){s(this).attr(`src`,s(this).attr(`data-echo`)),s(this).removeClass(`lazy`),s(this).removeAttr(`data-echo`),s(this).removeAttr(`id`)}),t.find(`video`).each(function(){s(this).attr(`poster`,s(this).attr(`data-echo`)),s(this).removeAttr(`data-echo`),s(this).removeAttr(`onerror`),s(this).removeAttr(`id`)}),{title:n.text(),link:n.attr(`href`),description:t.find(`.coverdiv`).html(),author:t.find(`.author`).text().trim(),pubDate:r(e(t.find(`time`).attr(`datetime`)),8),category:t.find(`.label`).toArray().map(e=>s(e).text().trim())}});return{title:`Bad.news - ${s(`.active`).text()}${s(`.selected`).text()}`,link:o,item:c}}export{a as route};