module.exports=[70406,(e,t,s)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},44950,e=>e.a(async(t,s)=>{try{let t=await e.y("bcryptjs-ee66c2bdc904f2cf");e.n(t),s()}catch(e){s(e)}},!0),81972,e=>e.a(async(t,s)=>{try{var r=e.i(24977),a=e.i(44950),i=t([a]);async function n(e,t){let s,i;if(s="TTWQW222rs#@#@!@",i=e.headers.authorization||"",(!s||i!==`Bearer ${s}`)&&(t.status(401).json({success:!1,message:"Unauthorized"}),1))return;let n=Number(e.query.id);if(!Number.isFinite(n))return t.status(400).json({success:!1,message:"Invalid id"});try{if("PUT"===e.method||"PATCH"===e.method){let{name:s,pass:i,role:o}=e.body||{},u={};if(void 0!==s&&(u.name=String(s).trim()),void 0!==o&&(u.role=Number(o)),void 0!==i&&String(i).trim().length>0&&(u.pass=await a.default.hash(String(i),10)),0===Object.keys(u).length)return t.status(400).json({success:!1,message:"No fields to update"});let d=await r.default.user.update({where:{id:n},data:u,select:{id:!0,name:!0,role:!0,createdAt:!0,updatedAt:!0}});return t.status(200).json({success:!0,user:d})}if("DELETE"===e.method)return await r.default.user.delete({where:{id:n}}),t.status(200).json({success:!0});if("GET"===e.method){let e=await r.default.user.findUnique({where:{id:n},select:{id:!0,name:!0,role:!0,createdAt:!0,updatedAt:!0}});if(!e)return t.status(404).json({success:!1,message:"Not Found"});return t.status(200).json({success:!0,user:e})}return t.status(405).json({success:!1,message:"Method Not Allowed"})}catch(e){if(e?.code==="P2025")return t.status(404).json({success:!1,message:"Not Found"});return console.error(e),t.status(500).json({success:!1,message:"Server Error"})}}[a]=i.then?(await i)():i,e.s(["default",()=>n]),s()}catch(e){s(e)}},!1),41080,e=>e.a(async(t,s)=>{try{var r=e.i(26747),a=e.i(90406),i=e.i(44898),n=e.i(62950),o=e.i(81972),u=e.i(7031),d=e.i(81927),l=e.i(46432),c=t([o]);[o]=c.then?(await c)():c;let h=(0,n.hoist)(o,"default"),m=(0,n.hoist)(o,"config"),f=new i.PagesAPIRouteModule({definition:{kind:a.RouteKind.PAGES_API,page:"/api/Users/[id]",pathname:"/api/Users/[id]",bundlePath:"",filename:""},userland:o,distDir:".next",relativeProjectDir:""});async function p(e,t,s){f.isDev&&(0,l.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/Users/[id]";a=a.replace(/\/index$/,"")||"/";let i=await f.prepare(e,t,{srcPage:a});if(!i){t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve());return}let{query:n,params:o,prerenderManifest:c,routerServerContext:p}=i;try{let s=e.method||"GET",r=(0,u.getTracer)(),i=r.getActiveScopeSpan(),l=f.instrumentationOnRequestError.bind(f),h=async i=>f.render(e,t,{query:{...n,...o},params:o,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:c.preview,propagateError:!1,dev:f.isDev,page:"/api/Users/[id]",internalRevalidate:null==p?void 0:p.revalidate,onError:(...t)=>l(e,...t)}).finally(()=>{if(!i)return;i.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let e=r.getRootSpanAttributes();if(!e)return;if(e.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${e.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=e.get("next.route");if(n){let e=`${s} ${n}`;i.setAttributes({"next.route":n,"http.route":n,"next.span_name":e}),i.updateName(e)}else i.updateName(`${s} ${a}`)});i?await h(i):await r.withPropagatedContext(e.headers,()=>r.trace(d.BaseServerSpan.handleRequest,{spanName:`${s} ${a}`,kind:u.SpanKind.SERVER,attributes:{"http.method":s,"http.target":e.url}},h))}catch(e){if(f.isDev)throw e;(0,r.sendError)(t,500,"Internal Server Error")}finally{null==s.waitUntil||s.waitUntil.call(s,Promise.resolve())}}e.s(["config",0,m,"default",0,h,"handler",()=>p]),s()}catch(e){s(e)}},!1)];

//# sourceMappingURL=%5Broot-of-the-server%5D__6cbddcc6._.js.map