"use strict";(()=>{var e={};e.id=5212,e.ids=[5212],e.modules={53524:e=>{e.exports=require("@prisma/client")},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")},61125:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>f,patchFetch:()=>x,requestAsyncStorage:()=>l,routeModule:()=>p,serverHooks:()=>m,staticGenerationAsyncStorage:()=>c});var a={};r.r(a),r.d(a,{POST:()=>u});var i=r(49303),n=r(88716),s=r(60670),o=r(87070),d=r(72331);async function u(e){try{let{userId:t,title:r,message:a,type:i}=await e.json();if(!r||!a)return o.NextResponse.json({error:"Title and message are required"},{status:400});let n=0;if("all"===t){let e=await d._.user.findMany({select:{id:!0}}),t=e.map(e=>({userId:e.id,title:r,message:a,type:i||"INFO",isRead:!1}));await d._.notification.createMany({data:t}),n=e.length}else{if(!t)return o.NextResponse.json({error:'UserId is required (or "all")'},{status:400});await d._.notification.create({data:{userId:t,title:r,message:a,type:i||"INFO",isRead:!1}}),n=1}return o.NextResponse.json({success:!0,count:n})}catch(e){return console.error("Failed to send notification:",e),o.NextResponse.json({error:"Internal Server Error"},{status:500})}}let p=new i.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/admin/notifications/route",pathname:"/api/admin/notifications",filename:"route",bundlePath:"app/api/admin/notifications/route"},resolvedPagePath:"C:\\Users\\MSI\\Downloads\\film\\app\\api\\admin\\notifications\\route.ts",nextConfigOutput:"standalone",userland:a}),{requestAsyncStorage:l,staticGenerationAsyncStorage:c,serverHooks:m}=p,f="/api/admin/notifications/route";function x(){return(0,s.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:c})}},72331:(e,t,r)=>{r.d(t,{_:()=>i});var a=r(53524);let i=global.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],()=>r(61125));module.exports=a})();