"use strict";(()=>{var e={};e.id=2640,e.ids=[2640],e.modules={53524:e=>{e.exports=require("@prisma/client")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},27790:e=>{e.exports=require("assert")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},32615:e=>{e.exports=require("http")},32694:e=>{e.exports=require("http2")},35240:e=>{e.exports=require("https")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},74175:e=>{e.exports=require("tty")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},10019:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>f,patchFetch:()=>m,requestAsyncStorage:()=>l,routeModule:()=>d,serverHooks:()=>c,staticGenerationAsyncStorage:()=>x});var s={};t.r(s),t.d(s,{GET:()=>u});var o=t(49303),i=t(88716),n=t(60670),p=t(87070),a=t(89840);async function u(e,{params:r}){let t=r.source,s=e.nextUrl.searchParams,o=s.get("type")||"detail",i=s.get("id");try{let e=(0,a.DS)(t);if("list"===o){let r=await e.fetchList();return p.NextResponse.json(r)}if("detail"===o){if(!i)return p.NextResponse.json({error:"ID is required for detail"},{status:400});let r=await e.fetchDetail(i);return p.NextResponse.json(r)}if("episode"===o){if(!i)return p.NextResponse.json({error:"ID is required for episode"},{status:400});let r=s.get("ep");if(!r||!e.fetchEpisode)return p.NextResponse.json({error:"Episode number required or handler does not support fetchEpisode"},{status:400});let t=await e.fetchEpisode(i,parseInt(r));if(!t)return p.NextResponse.json({error:"Episode not found or no stream available"},{status:404});return p.NextResponse.json(t)}return p.NextResponse.json({error:"Invalid type"},{status:400})}catch(e){if(console.error(`[Proxy Error] Source: ${t}, Type: ${o}, ID: ${i}`,e),e.message&&e.message.includes("not found"))return p.NextResponse.json({error:e.message},{status:404});return p.NextResponse.json({error:e.message||"Internal Server Error"},{status:500})}}let d=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/proxy/[source]/route",pathname:"/api/proxy/[source]",filename:"route",bundlePath:"app/api/proxy/[source]/route"},resolvedPagePath:"C:\\Users\\MSI\\Downloads\\film\\app\\api\\proxy\\[source]\\route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:l,staticGenerationAsyncStorage:x,serverHooks:c}=d,f="/api/proxy/[source]/route";function m(){return(0,n.patchFetch)({serverHooks:c,staticGenerationAsyncStorage:x})}},72331:(e,r,t)=>{t.d(r,{_:()=>o});var s=t(53524);let o=global.prisma||new s.PrismaClient}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[8948,5972,9092,4263,9840],()=>t(10019));module.exports=s})();