import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{n}from"./types-CgHs3Dg6.mjs";import{n as r}from"./utils-V17BGZ_G.mjs";const i={path:`/event/:slug`,categories:[`finance`],example:`/polymarket/event/presidential-election-winner-2024`,parameters:{slug:`Event slug from the URL (e.g. presidential-election-winner-2024)`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`polymarket.com/event/:slug`],target:`/event/:slug`}],name:`Event`,url:`polymarket.com`,maintainers:[`heqi201255`],handler:a};async function a(i){let a=await e(`${n}/events/slug/${i.req.param(`slug`)}`);if(!a)throw Error(`Event not found`);let o=a.markets.map(e=>({title:e.question,description:`
            <p><strong>Odds:</strong> ${r(e)}</p>
            <p><strong>Volume:</strong> $${Number(e.volume||0).toLocaleString()}</p>
            ${e.oneDayPriceChange?`<p><strong>24h Change:</strong> ${(e.oneDayPriceChange*100).toFixed(1)}%</p>`:``}
            ${e.image?`<img src="${e.image}" alt="${e.question}" style="max-width: 100%;">`:``}
        `,link:`https://polymarket.com/event/${a.slug}`,pubDate:e.startDate||a.startDate?t(e.startDate||a.startDate):void 0,category:a.tags?.map(e=>e.label).filter(Boolean)}));return{title:a.title,link:`https://polymarket.com/event/${a.slug}`,item:o,description:a.description}}export{i as route};