import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{load as n}from"cheerio";const r=async r=>{let i=Number.parseInt(r.req.query(`limit`)??`10`,10),a=new URL(`news/`,`https://www.trendforce.com`).href,o=new URL(`wp-json/wp/v2/posts`,a).href,s=await e(o,{query:{_embed:`true`,per_page:i}}),c=n(await e(a)),l=c(`html`).attr(`lang`)??`en`,u=s.slice(0,i).map(e=>{let r=e.title?.rendered??e.title,i=n(e.content.rendered);i(`div.article_highlight-area-BG_wrap`).remove();let a=i.html(),o=e.date_gmt,s=e.link,c=(e._embedded?.[`wp:term`])?.flat().map(e=>e.name)??[],u=e._embedded?.author.map(e=>({name:e.name,url:e.url,avatar:void 0}))??[],d=e.guid?.rendered??e.guid,f=e._embedded?.[`wp:featuredmedia`]?.[0].source_url??void 0,p=e.modified_gmt??o;return{title:r,description:a,pubDate:o?t(o):void 0,link:s??d,category:c,author:u,guid:d,id:d,content:{html:a,text:a},image:f,banner:f,updated:p?t(p):void 0,language:l}});return{title:c(`title`).text(),description:c(`meta[property="og:description"]`).attr(`content`),link:a,item:u,allowEmpty:!0,image:c(`meta[property="og:image"]`).attr(`content`),author:c(`meta[property="og:site_name"]`).attr(`content`),language:l,id:a}},i={path:`/news`,name:`News`,url:`www.trendforce.com`,maintainers:[`nczitzk`],handler:r,example:`/trendforce/news`,parameters:void 0,description:void 0,categories:[`new-media`],features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportRadar:!0,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`www.trendforce.com/news/`],target:`/news`}],view:0};export{r as handler,i as route};