import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import"./types-CgHs3Dg6.mjs";import{t as n}from"./utils-V17BGZ_G.mjs";const r={path:`/search/:query`,categories:[`finance`],example:`/polymarket/search/trump`,parameters:{query:`Search query`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`Search`,url:`polymarket.com`,maintainers:[`heqi201255`],handler:i};async function i(r){let i=r.req.param(`query`),a=((await e(`https://gamma-api.polymarket.com/public-search`,{query:{q:i,limit_per_type:30}})).events||[]).map(e=>({title:e.title,description:n(e),link:`https://polymarket.com/event/${e.slug}`,pubDate:e.startDate?t(e.startDate):void 0,category:e.tags?.map(e=>e.label).filter(Boolean)}));return{title:`Polymarket Search - ${i}`,link:`https://polymarket.com/search?q=${encodeURIComponent(i)}`,item:a}}export{r as route};