"use strict";(()=>{var e={};e.id=3002,e.ids=[3002],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")},6005:e=>{e.exports=require("node:crypto")},12114:(e,t,s)=>{s.r(t),s.d(t,{originalPathname:()=>y,patchFetch:()=>f,requestAsyncStorage:()=>d,routeModule:()=>l,serverHooks:()=>m,staticGenerationAsyncStorage:()=>g});var n={};s.r(n),s.d(n,{POST:()=>p});var o=s(49303),r=s(88716),a=s(60670),i=s(87070),u=s(19191),c=s(90455);async function p(e){let{name:t,surname:s,email:n,password:o,phone:r,phonePrefix:a}=await e.json();if(!t||!n||!o||!r)return i.NextResponse.json({error:"Missing required fields"},{status:400});let p=t.trim().split(/\s+/),l=p[0]||"",d=p.slice(1),g=s||d.join(" ")||"";try{let e=await (0,u.q)("/customers/v1/mobile",{apiBase:"mobile",method:"POST",token:(0,c.I2)(),body:{city:{id:1,active:1},name:l,surname:g,email:n,password:o,phone:r,phonePrefix:a||"+355"},cache:"no-store"});if(200===e.statusMessage.status)return i.NextResponse.json({success:!0,data:e.data});return i.NextResponse.json({error:e.statusMessage.message||"Registration failed"},{status:e.statusMessage.status})}catch{return i.NextResponse.json({error:"Registration failed. Please try again."},{status:500})}}let l=new o.AppRouteRouteModule({definition:{kind:r.x.APP_ROUTE,page:"/api/auth/register/route",pathname:"/api/auth/register",filename:"route",bundlePath:"app/api/auth/register/route"},resolvedPagePath:"/Users/ferlando/Desktop/baboon-nextjs/app/api/auth/register/route.ts",nextConfigOutput:"standalone",userland:n}),{requestAsyncStorage:d,staticGenerationAsyncStorage:g,serverHooks:m}=l,y="/api/auth/register/route";function f(){return(0,a.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:g})}},19191:(e,t,s)=>{s.d(t,{F:()=>a,q:()=>r});var n=s(47090),o=s(70446);async function r(e,t={}){let{apiBase:s="mobile",method:r="GET",body:a,token:i,langCode:u,notificationToken:c,headers:p={},revalidate:l,cache:d}=t,g=n.Y8[s],m=`${g}${e.startsWith("/")?e:"/"+e}`,y={"Content-Type":"application/json","User-Agent":"BaboonWeb",...p};i&&(y.Authorization=i),u&&(y.langCode=u);let f=c;if(!f)try{f=(await (0,o.Gg)()).fcmToken}catch{}f&&(y.notificationToken=f);let h={method:r,headers:y};a&&"GET"!==r&&(h.body=JSON.stringify(a)),void 0!==l&&(h.next={revalidate:l}),d&&(h.cache=d);let x=await fetch(m,h);if(!x.ok)throw Error(`API request failed: ${x.status} ${x.statusText}`);return x.json()}async function a(e,t={}){let{apiBase:s="mobile",method:r="GET",body:a,token:i,langCode:u,notificationToken:c,headers:p={}}=t,l=n.Y8[s],d=`${l}${e.startsWith("/")?e:"/"+e}`,g={"Content-Type":"application/json","User-Agent":"BaboonWeb",...p};i&&(g.Authorization=i),u&&(g.langCode=u);let m=c;if(!m)try{m=(await (0,o.Gg)()).fcmToken}catch{}m&&(g.notificationToken=m);let y={method:r,headers:g};return a&&"GET"!==r&&(y.body=JSON.stringify(a)),fetch(d,y)}},90455:(e,t,s)=>{function n(e){return e.token?e.token:e.user?.token?e.user.token:process.env.BABOON_APP_BUSINESS_TOKEN||""}function o(){return process.env.BABOON_APP_BUSINESS_TOKEN||""}s.d(t,{I2:()=>o,LP:()=>n})},47090:(e,t,s)=>{s.d(t,{RF:()=>n,Y8:()=>r,pH:()=>o});let n=["al","en","it"],o={AL:{latitude:41.327546,longitude:19.818698,cityId:1,countryId:1},XK:{latitude:42.662914,longitude:21.165503,cityId:2,countryId:2}},r={mobile:process.env.BABOON_API_MOBILE_URL,legacy:process.env.BABOON_API_URL,sysadmin:process.env.BABOON_API_SYSADMIN_URL,payment:process.env.BABOON_API_PAYMENT_URL}},70446:(e,t,s)=>{s.d(t,{Gg:()=>i,dx:()=>r,l7:()=>a,yK:()=>u});var n=s(78632),o=s(71615);let r={password:process.env.SESSION_SECRET,cookieName:"baboon-session",cookieOptions:{secure:!0,httpOnly:!0,sameSite:"lax",maxAge:604800}},a={...r,cookieName:"baboon-admin-session"};async function i(){let e=await (0,o.cookies)();return(0,n.iW)(e,r)}async function u(){let e=await (0,o.cookies)();return(0,n.iW)(e,a)}}};var t=require("../../../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),n=t.X(0,[8948,3314,8632,5972],()=>s(12114));module.exports=n})();