"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())}),meta_exports={};__export(meta_exports,{getMeta:()=>getMeta});var getMeta=__name(function(_0){return __async(this,arguments,function*({link:link,providerContext:providerContext}){var _a,_b,_c,_d,_e,_f,_g,_h,_i;try{const{axios:axios,cheerio:cheerio,getBaseUrl:getBaseUrl}=providerContext,url=(yield getBaseUrl("showbox"))+link,data=(yield axios.get(url)).data,$=cheerio.load(data),type=url.includes("tv")?"series":"movie",imdbId="",title=$(".heading-name").text(),rating=(null==(_b=null==(_a=$(".btn-imdb").text())?void 0:_a.match(/\d+(\.\d+)?/g))?void 0:_b[0])||"",image=(null==(_d=null==(_c=$(".cover_follow").attr("style"))?void 0:_c.split("url(")[1])?void 0:_d.split(")")[0])||"",synopsis=null==(_f=null==(_e=$(".description").text())?void 0:_e.replace(/[\n\t]/g,""))?void 0:_f.trim(),febID=null==(_h=null==(_g=$(".heading-name").find("a").attr("href"))?void 0:_g.split("/"))?void 0:_h.pop(),indexUrl=`${url.split("/").slice(0,3).join("/")}/index/share_link?id=${febID}&type=${"movie"===type?"1":"2"}`,febKey=(yield axios.get(indexUrl)).data.data.link.split("/").pop(),febLink=`https://www.febbox.com/file/file_share_list?share_key=${febKey}&is_html=0`,febData=(yield axios.get(febLink)).data,fileList=null==(_i=null==febData?void 0:febData.data)?void 0:_i.file_list,links=[];return fileList&&fileList.map(file=>{const fileName=`${file.file_name} (${file.file_size})`,fileId=file.fid;links.push({title:fileName,episodesLink:file.is_dir?`${febKey}&${fileId}`:`${febKey}&`})}),{title:title,rating:rating,synopsis:synopsis,image:image,imdbId:imdbId,type:type,linkList:links}}catch(err){return console.error("Error fetching metadata:",err),{title:"",rating:"",synopsis:"",image:"",imdbId:"",type:"",linkList:[]}}})},"getMeta");exports.getMeta=getMeta;