"use strict";(()=>{var e={};e.id=6315,e.ids=[6315],e.modules={72934:e=>{e.exports=require("next/dist/client/components/action-async-storage.external.js")},54580:e=>{e.exports=require("next/dist/client/components/request-async-storage.external.js")},45869:e=>{e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},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")},78893:e=>{e.exports=require("buffer")},84770:e=>{e.exports=require("crypto")},76162:e=>{e.exports=require("stream")},21764:e=>{e.exports=require("util")},32626:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>m,patchFetch:()=>x,requestAsyncStorage:()=>p,routeModule:()=>c,serverHooks:()=>d,staticGenerationAsyncStorage:()=>f});var a={};r.r(a),r.d(a,{GET:()=>l});var n=r(49303),i=r(88716),s=r(60670),o=r(87070),u=r(39655);async function l(){try{let e=await (0,u.No)();if(!e)return o.NextResponse.json({affiliate:null},{status:401});return o.NextResponse.json({affiliate:{id:e.id,name:e.name,email:e.email,phone:e.phone,referralCode:e.referralCode,bankName:e.bankName,bankAccount:e.bankAccount,bankHolder:e.bankHolder,isActive:e.isActive}})}catch{return o.NextResponse.json({error:"Server error"},{status:500})}}let c=new n.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/affiliate/auth/me/route",pathname:"/api/affiliate/auth/me",filename:"route",bundlePath:"app/api/affiliate/auth/me/route"},resolvedPagePath:"D:\\PROJECT\\resto-saas\\src\\app\\api\\affiliate\\auth\\me\\route.ts",nextConfigOutput:"",userland:a}),{requestAsyncStorage:p,staticGenerationAsyncStorage:f,serverHooks:d}=c,m="/api/affiliate/auth/me/route";function x(){return(0,s.patchFetch)({serverHooks:d,staticGenerationAsyncStorage:f})}},39655:(e,t,r)=>{r.d(t,{No:()=>l,Of:()=>c,PX:()=>u});var a=r(41482),n=r.n(a),i=r(71615),s=r(8194);let o=process.env.JWT_SECRET||"fallback-secret-change-me";function u(e){return n().sign({...e,isAffiliate:!0},o,{expiresIn:"7d"})}async function l(){let e=await (0,i.cookies)(),t=e.get("aff_token")?.value;if(!t)return null;let r=function(e){try{let t=n().verify(e,o);if(!t.isAffiliate)return null;return t}catch{return null}}(t);return r&&await s._.affiliate.findUnique({where:{id:r.affiliateId}})||null}async function c(){return await l()||null}},8194:(e,t,r)=>{r.d(t,{_:()=>n});let a=require("@prisma/client"),n=globalThis.prisma??new a.PrismaClient}};var t=require("../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[8948,5972,4261],()=>r(32626));module.exports=a})();