import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./cache-DUthuMSu.mjs";import{t as n}from"./parse-date-BdYTmLpo.mjs";const r=`8KCosplay`,i=`https://www.8kcosplay.com`,a=async(t,r)=>(await e(`https://www.8kcosplay.com/wp-json/wp/v2/posts`,{query:{per_page:t,_embed:``,...r}})).map(e=>({title:e.title.rendered,description:e.content.rendered,link:e.link,pubDate:n(e.date_gmt),author:e._embedded?.author?.map(e=>e.name).join(`, `),category:e._embedded?.[`wp:term`]?.flatMap(e=>e.map(e=>e.name))})),o=n=>t.tryGet(`8kcosplay:category:${n}`,async()=>{let t=(await e(`https://www.8kcosplay.com/wp-json/wp/v2/categories`,{query:{slug:n}}))[0];if(!t)throw Error(`Category not found`);return{id:t.id,title:t.yoast_head_json.title,description:t.description,link:t.link}}),s=n=>t.tryGet(`8kcosplay:tag:${n}`,async()=>{let t=(await e(`https://www.8kcosplay.com/wp-json/wp/v2/tags`,{query:{slug:n}}))[0];if(!t)throw Error(`Tag not found`);return{id:t.id,title:t.yoast_head_json.title,description:t.description}});export{s as a,a as i,i as n,o as r,r as t};