"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(e,t)=>__defProp(e,"name",{value:t,configurable:!0}),__export=(e,t)=>{for(var r in t)__defProp(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of __getOwnPropNames(t))__hasOwnProp.call(e,o)||o===r||__defProp(e,o,{get:()=>t[o],enumerable:!(s=__getOwnPropDesc(t,o))||s.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__async=(e,t,r)=>new Promise((s,o)=>{var a=e=>{try{i(r.next(e))}catch(e){o(e)}},n=e=>{try{i(r.throw(e))}catch(e){o(e)}},i=e=>e.done?s(e.value):Promise.resolve(e.value).then(a,n);i((r=r.apply(e,t)).next())}),posts_exports={};__export(posts_exports,{getPosts:()=>getPosts,getSearchPosts:()=>getSearchPosts});var getPosts=__name(function(e){return __async(this,arguments,function*({filter:e,page:t,signal:r,providerContext:s}){const{getBaseUrl:o,axios:a,cheerio:n}=s,i=yield o("tokyoinsider");return posts({baseURL:i,url:`${i}/${e}&start=${t<2?0:20*(t-1)}`,signal:r,axios:a,cheerio:n})})},"getPosts"),getSearchPosts=__name(function(e){return __async(this,arguments,function*({searchQuery:e,page:t,signal:r,providerContext:s}){const{getBaseUrl:o,axios:a,cheerio:n}=s,i=yield o("tokyoinsider");return posts({baseURL:i,url:`${i}/anime/search?k=${e}&start=${t<2?0:20*(t-1)}`,signal:r,axios:a,cheerio:n})})},"getSearchPosts");function posts(e){return __async(this,arguments,function*({baseURL:e,url:t,signal:r,axios:s,cheerio:o}){try{const a=(yield s.get(t,{signal:r})).data,n=o.load(a),i=[];return n('td.c_h2[width="40"]').map((t,r)=>{var s;const o=null==(s=n(r).find(".a_img").attr("src"))?void 0:s.replace("small","default"),a=n(r).find("a").attr("title"),_=e+n(r).find("a").attr("href");a&&_&&o&&i.push({title:a,link:_,image:o})}),i}catch(e){return[]}})}__name(posts,"posts"),exports.getPosts=getPosts,exports.getSearchPosts=getSearchPosts;