"use strict";(()=>{var e={};e.id=5998,e.ids=[5998],e.modules={30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},71017:e=>{e.exports=require("path")},54970:(e,r,a)=>{a.r(r),a.d(r,{headerHooks:()=>A,originalPathname:()=>v,requestAsyncStorage:()=>P,routeModule:()=>l,serverHooks:()=>f,staticGenerationAsyncStorage:()=>c,staticGenerationBailout:()=>m});var o={};a.r(o),a.d(o,{POST:()=>p}),a(95655);var t=a(83323),u=a(54647),n=a(66886);let i=require("fs/promises");var s=a(71017);async function p(e){try{let r=await e.formData(),a=r.get("file");if(!a)return n.Z.json({error:"No file uploaded"},{status:400});let o=await a.arrayBuffer(),t=Buffer.from(o),u=`${Date.now()}-${Math.round(1e9*Math.random())}`,p=`${u}-${a.name.replace(/[^a-zA-Z0-9.-]/g,"")}`,d=(0,s.join)(process.cwd(),"public","uploads"),l=(0,s.join)(d,p);await (0,i.writeFile)(l,t);let P=`/uploads/${p}`;return n.Z.json({url:P})}catch(e){return console.error("Upload error:",e),n.Z.json({error:"Upload failed"},{status:500})}}let d=t.AppRouteRouteModule,l=new d({definition:{kind:u.x.APP_ROUTE,page:"/api/upload/route",pathname:"/api/upload",filename:"route",bundlePath:"app/api/upload/route"},resolvedPagePath:".\\app\\api\\upload\\route.ts",nextConfigOutput:"standalone",userland:o}),{requestAsyncStorage:P,staticGenerationAsyncStorage:c,serverHooks:f,headerHooks:A,staticGenerationBailout:m}=l,v="/api/upload/route"},54647:(e,r)=>{var a;Object.defineProperty(r,"x",{enumerable:!0,get:function(){return a}}),function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE"}(a||(a={}))}};var r=require("../../../webpack-runtime.js");r.C(e);var a=e=>r(r.s=e),o=r.X(0,[9727,3497,6886],()=>a(54970));module.exports=o})();