"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,n)=>{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:!(n=__getOwnPropDesc(t,o))||n.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__async=(e,t,r)=>new Promise((n,o)=>{var s=e=>{try{i(r.next(e))}catch(e){o(e)}},a=e=>{try{i(r.throw(e))}catch(e){o(e)}},i=e=>e.done?n(e.value):Promise.resolve(e.value).then(s,a);i((r=r.apply(e,t)).next())}),episodes_exports={};__export(episodes_exports,{extractKmhdLink:()=>extractKmhdLink,getEpisodes:()=>getEpisodes});var getEpisodes=__name(function(e){return __async(this,arguments,function*({url:e,providerContext:t}){var r;const{axios:n,cheerio:o}=t,s=[];try{if(e.includes("gdflix")){const t=null==(r=e.split("/pack"))?void 0:r[0],a=(yield n.get(e)).data,i=o.load(a),c=i(".list-group-item");if(null==c||c.map((e,r)=>{s.push({title:i(r).text()||"",link:t+i(r).find("a").attr("href")||""})}),s.length>0)return s}if(e.includes("/pack")){const r=yield extractKmhdEpisodes(e,t);null==r||r.forEach((t,r)=>{s.push({title:`Episode ${r+1}`,link:e.split("/pack")[0]+"/file/"+t})})}const a=(yield n.get(e,{headers:{Cookie:"_ga_GNR438JY8N=GS1.1.1722240350.5.0.1722240350.0.0.0; _ga=GA1.1.372196696.1722150754; unlocked=true"}})).data,i=o.load(a),c=i(".autohyperlink");return null==c||c.map((e,t)=>{s.push({title:i(t).parent().children().remove().end().text()||"",link:i(t).attr("href")||""})}),s}catch(e){return[]}})},"getEpisodes");function extractKmhdLink(e,t){return __async(this,null,function*(){const{axios:r}=t,n=(yield r.get(e)).data,o=n.match(/hubdrive_res:\s*"([^"]+)"/)[1];return n.match(/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/)[1]+o})}function extractKmhdEpisodes(e,t){return __async(this,null,function*(){const{axios:r}=t;return(yield r.get(e)).data.match(/[\w]+_[a-f0-9]{8}/g)})}__name(extractKmhdLink,"extractKmhdLink"),__name(extractKmhdEpisodes,"extractKmhdEpisodes"),exports.extractKmhdLink=extractKmhdLink,exports.getEpisodes=getEpisodes;