"use strict";(()=>{var r={};r.id=6788,r.ids=[6788],r.modules={53524:r=>{r.exports=require("@prisma/client")},30517:r=>{r.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},2478:(r,e,t)=>{t.r(e),t.d(e,{headerHooks:()=>P,originalPathname:()=>v,requestAsyncStorage:()=>p,routeModule:()=>c,serverHooks:()=>l,staticGenerationAsyncStorage:()=>m,staticGenerationBailout:()=>A});var a={};t.r(a),t.d(a,{GET:()=>i}),t(95655);var o=t(83323),n=t(54647),u=t(66886),s=t(30953);async function i(r,{params:e}){try{let r=parseInt(e.orderNumber);if(isNaN(r))return u.Z.json({error:"Invalid order number"},{status:400});let t=await s._.order.findUnique({where:{orderNumber:r},include:{items:{include:{product:!0,variant:!0}}}});if(!t)return u.Z.json({error:"Order not found"},{status:404});return u.Z.json({orderNumber:t.orderNumber,status:t.status,customerName:t.customerName,address:t.address,country:t.country,phone:t.phone,email:t.email,notes:t.notes,createdAt:t.createdAt,updatedAt:t.updatedAt,items:t.items.map(r=>({quantity:r.quantity,price:r.price,product:{nameEn:r.product.nameEn,nameFr:r.product.nameFr,image:r.product.image,slug:r.product.slug},variant:r.variant?{size:r.variant.size,sku:r.variant.sku}:null}))})}catch(r){return console.error("Error fetching order:",r),u.Z.json({error:"Error fetching order"},{status:500})}}let d=o.AppRouteRouteModule,c=new d({definition:{kind:n.x.APP_ROUTE,page:"/api/orders/track/[orderNumber]/route",pathname:"/api/orders/track/[orderNumber]",filename:"route",bundlePath:"app/api/orders/track/[orderNumber]/route"},resolvedPagePath:"D:\\Code\\MusaFoods_New\\musafoods\\app\\api\\orders\\track\\[orderNumber]\\route.ts",nextConfigOutput:"standalone",userland:a}),{requestAsyncStorage:p,staticGenerationAsyncStorage:m,serverHooks:l,headerHooks:P,staticGenerationBailout:A}=c,v="/api/orders/track/[orderNumber]/route"},30953:(r,e,t)=>{t.d(e,{_:()=>n});var a=t(53524);let o=globalThis,n=o.prisma??new a.PrismaClient},54647:(r,e)=>{var t;Object.defineProperty(e,"x",{enumerable:!0,get:function(){return t}}),function(r){r.PAGES="PAGES",r.PAGES_API="PAGES_API",r.APP_PAGE="APP_PAGE",r.APP_ROUTE="APP_ROUTE"}(t||(t={}))}};var e=require("../../../../../webpack-runtime.js");e.C(r);var t=r=>e(e.s=r),a=e.X(0,[9727,3497,6886],()=>t(2478));module.exports=a})();