"use strict";(()=>{var e={};e.id=8298,e.ids=[8298],e.modules={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")},85647:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>g,patchFetch:()=>x,requestAsyncStorage:()=>d,routeModule:()=>u,serverHooks:()=>v,staticGenerationAsyncStorage:()=>c});var n={};r.r(n),r.d(n,{POST:()=>p});var o=r(49303),s=r(88716),a=r(60670),i=r(87070);let l="https://api.onesignal.com";async function p(e){try{let{appId:t,restKey:r,externalId:n}=await e.json();if(!t||!r||!n)return i.NextResponse.json({error:"appId, restKey, and externalId are required"},{status:400});let o={Authorization:`Key ${r}`,"Content-Type":"application/json",Accept:"application/vnd.onesignal.v1+json"},s=await fetch(`${l}/apps/${t}/users/by/external_id/${encodeURIComponent(n)}`,{headers:o});if(404===s.status)return i.NextResponse.json({status:"not_found"});if(!s.ok){let e=await s.text();return console.error("[OneSignal resolve-identity] GET failed:",e),i.NextResponse.json({error:"Failed to fetch conflicting OneSignal user"},{status:502})}let a=await fetch(`${l}/apps/${t}/users/by/external_id/${encodeURIComponent(n)}`,{method:"DELETE",headers:o});if(!a.ok&&404!==a.status){let e=await a.text();return console.error("[OneSignal resolve-identity] DELETE failed:",e),i.NextResponse.json({error:"Failed to delete conflicting OneSignal user"},{status:502})}return i.NextResponse.json({status:"resolved"})}catch(e){return console.error("[OneSignal resolve-identity] Unexpected error:",e),i.NextResponse.json({error:"Internal server error"},{status:500})}}let u=new o.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/onesignal/resolve-identity/route",pathname:"/api/onesignal/resolve-identity",filename:"route",bundlePath:"app/api/onesignal/resolve-identity/route"},resolvedPagePath:"/Users/abhayraj/dev/Keyur/Doliplay/src/app/api/onesignal/resolve-identity/route.ts",nextConfigOutput:"",userland:n}),{requestAsyncStorage:d,staticGenerationAsyncStorage:c,serverHooks:v}=u,g="/api/onesignal/resolve-identity/route";function x(){return(0,a.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:c})}}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),n=t.X(0,[8948,5972],()=>r(85647));module.exports=n})();