module.exports=[50640,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"InvariantError",{enumerable:!0,get:function(){return d}});class d extends Error{constructor(a,b){super(`Invariant: ${a.endsWith(".")?a:a+"."} This is a bug in Next.js.`,b),this.name="InvariantError"}}},27699,(a,b,c)=>{b.exports=a.x("events",()=>require("events"))},874,(a,b,c)=>{b.exports=a.x("buffer",()=>require("buffer"))},6461,(a,b,c)=>{b.exports=a.x("zlib",()=>require("zlib"))},54799,(a,b,c)=>{b.exports=a.x("crypto",()=>require("crypto"))},63021,(a,b,c)=>{b.exports=a.x("@prisma/client-2c3a283f134fdcb6",()=>require("@prisma/client-2c3a283f134fdcb6"))},4446,(a,b,c)=>{b.exports=a.x("net",()=>require("net"))},99348,(a,b,c)=>{b.exports=a.x("string_decoder",()=>require("string_decoder"))},88947,(a,b,c)=>{b.exports=a.x("stream",()=>require("stream"))},55004,(a,b,c)=>{b.exports=a.x("tls",()=>require("tls"))},46786,(a,b,c)=>{b.exports=a.x("os",()=>require("os"))},22734,(a,b,c)=>{b.exports=a.x("fs",()=>require("fs"))},37936,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"registerServerReference",{enumerable:!0,get:function(){return d.registerServerReference}});let d=a.r(11857)},13095,(a,b,c)=>{"use strict";function d(a){for(let b=0;b<a.length;b++){let c=a[b];if("function"!=typeof c)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof c}.
Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"ensureServerEntryExports",{enumerable:!0,get:function(){return d}})},26050,a=>{"use strict";var b=a.i(37936),c=a.i(1241),d=a.i(45017),e=a.i(18558);async function f(){return c.prisma.message.findMany({orderBy:{createdAt:"desc"}})}async function g(){return c.prisma.message.count({where:{isRead:!1}})}async function h(a){let b={name:a.get("name"),email:a.get("email"),subject:a.get("subject")||void 0,content:a.get("content")},f=d.messageSchema.parse(b);return await c.prisma.message.create({data:f}),(0,e.revalidatePath)("/admin/messages"),{success:!0}}async function i(a){let b=await c.prisma.message.findUnique({where:{id:a}});b&&(await c.prisma.message.update({where:{id:a},data:{isRead:!b.isRead}}),(0,e.revalidatePath)("/admin/messages"))}async function j(a){await c.prisma.message.delete({where:{id:a}}),(0,e.revalidatePath)("/admin/messages")}(0,a.i(13095).ensureServerEntryExports)([f,g,h,i,j]),(0,b.registerServerReference)(f,"00edf76ed91df99091fbb17144a82ee0d3cf4665fa",null),(0,b.registerServerReference)(g,"003e4795a62c97dd3e70039dd7e429bdb17eb2eb70",null),(0,b.registerServerReference)(h,"40a3db6de0e53c2cdf49f4df6d60075df4778d7908",null),(0,b.registerServerReference)(i,"4026ff26cb668af2ccf1cbfbdf532f39655c668e80",null),(0,b.registerServerReference)(j,"408f8de1f4a5bb538c5ed0f1aec27d99b5c7d2a8b8",null),a.s(["createMessage",0,h,"deleteMessage",0,j,"getMessages",0,f,"getUnreadCount",0,g,"toggleMessageRead",0,i])},92426,a=>{"use strict";var b=a.i(26050);a.s([],30015),a.i(30015),a.s(["003e4795a62c97dd3e70039dd7e429bdb17eb2eb70",()=>b.getUnreadCount,"00edf76ed91df99091fbb17144a82ee0d3cf4665fa",()=>b.getMessages,"4026ff26cb668af2ccf1cbfbdf532f39655c668e80",()=>b.toggleMessageRead,"408f8de1f4a5bb538c5ed0f1aec27d99b5c7d2a8b8",()=>b.deleteMessage,"40a3db6de0e53c2cdf49f4df6d60075df4778d7908",()=>b.createMessage],92426)}];

//# sourceMappingURL=%5Broot-of-the-server%5D__00p7zzo._.js.map