"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),episodes_exports={};__export(episodes_exports,{getEpisodes:()=>getEpisodes});var getEpisodes=__name(function(_0){return __async(this,arguments,function*({url:link,providerContext:providerContext}){var _a;const{getBaseUrl:getBaseUrl,axios:axios}=providerContext;try{const url=`${yield getBaseUrl("nfMirror")}/episodes.php?s=`+link+"&t="+Math.round((new Date).getTime()/1e3);console.log("nfEpisodesUrl",url);let page=1,hasMorePages=!0;const episodeList=[];for(;hasMorePages;){const data=(yield axios.get(url+`&page=${page}`,{headers:{"Content-Type":"application/json","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36","Accept-Language":"en-US,en;q=0.9"}})).data;null==(_a=null==data?void 0:data.episodes)||_a.map(episode=>{episodeList.push({title:"Episode "+(null==episode?void 0:episode.ep.replace("E","")),link:null==episode?void 0:episode.id})}),(null==data?void 0:data.nextPageShow)?page++:hasMorePages=!1}return episodeList.sort((a,b)=>parseInt(a.title.replace("Episode ",""))-parseInt(b.title.replace("Episode ","")))}catch(err){return console.error("nfGetEpisodes error",err),[]}})},"getEpisodes");exports.getEpisodes=getEpisodes;