"use strict";(()=>{var e={};e.id=2827,e.ids=[2827,2331],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")},61577:(e,t,a)=>{a.r(t),a.d(t,{originalPathname:()=>g,patchFetch:()=>y,requestAsyncStorage:()=>c,routeModule:()=>p,serverHooks:()=>m,staticGenerationAsyncStorage:()=>l});var r={};a.r(r),a.d(r,{GET:()=>u});var i=a(49303),s=a(88716),n=a(60670),o=a(87070),d=a(72331);async function u(e){try{let{searchParams:t}=new URL(e.url),a=parseInt(t.get("page")??"1"),r=parseInt(t.get("limit")??"20"),i=t.get("action"),s=t.get("search")??"",n=(a-1)*r,u={};i&&(u.action=i),s&&(u.OR=[{action:{contains:s}},{entityType:{contains:s}}]);let[p,c]=await Promise.all([d.prisma.auditLog.findMany({where:u,include:{user:{select:{userId:!0}}},orderBy:{createdAt:"desc"},skip:n,take:r}),d.prisma.auditLog.count({where:u})]);return o.NextResponse.json({success:!0,data:p.map(e=>({id:e.id,user_id:e.user?.userId??"system",action:e.action,entity_type:e.entityType,entity_id:e.entityId,ip_address:e.ipAddress,metadata:e.metadata,created_at:e.createdAt})),pagination:{page:a,limit:r,total:c,total_pages:Math.ceil(c/r)}})}catch(e){return console.error("Admin audit GET error:",e),o.NextResponse.json({success:!1,message:"Gagal memuat log audit"},{status:500})}}let p=new i.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/admin/audit/route",pathname:"/api/admin/audit",filename:"route",bundlePath:"app/api/admin/audit/route"},resolvedPagePath:"C:\\xampp\\htdocs\\Bolafest\\app\\api\\admin\\audit\\route.ts",nextConfigOutput:"standalone",userland:r}),{requestAsyncStorage:c,staticGenerationAsyncStorage:l,serverHooks:m}=p,g="/api/admin/audit/route";function y(){return(0,n.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:l})}},72331:(e,t,a)=>{a.d(t,{prisma:()=>i});var r=a(53524);let i=globalThis.prisma??new r.PrismaClient({log:["error"]})}};var t=require("../../../../webpack-runtime.js");t.C(e);var a=e=>t(t.s=e),r=t.X(0,[9276,5972],()=>a(61577));module.exports=r})();