"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:url,providerContext:providerContext}){var _a;try{if(!url.includes("luxelinks")||url.includes("cinemalux")){const encodedLink=null==(_a=(yield providerContext.axios.get(url,{headers:providerContext.commonHeaders})).data.match(/"link":"([^"]+)"/))?void 0:_a[1];if(encodedLink)url=encodedLink?atob(encodedLink):url;else{const redirectUrlRes=yield fetch("https://cm-decrypt.8man.workers.dev/cinemaluxe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:url})}),redirectUrl=yield redirectUrlRes.json();url=(null==redirectUrl?void 0:redirectUrl.redirectUrl)||url}}const episodeLinks=[];if(url.includes("luxedrive")||url.includes("drive.linkstore"))return episodeLinks.push({title:"Movie",link:url}),episodeLinks;const html=(yield providerContext.axios.get(url,{headers:providerContext.commonHeaders})).data;let $=providerContext.cheerio.load(html);return $("a.maxbutton-4,a.maxbutton,.maxbutton-hubcloud,.ep-simple-button").map((i,element)=>{var _a2;const title=null==(_a2=$(element).text())?void 0:_a2.trim(),link=$(element).attr("href");title&&link&&!title.includes("Batch")&&!title.toLowerCase().includes("zip")&&episodeLinks.push({title:title.replace(/\(\d{4}\)/,"").replace("Download","Movie").replace("⚡","").trim(),link:link})}),episodeLinks}catch(err){return console.error("cl episode links",err),[]}})},"getEpisodes");exports.getEpisodes=getEpisodes;