"use strict";(()=>{var e={};e.id=6475,e.ids=[6475,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")},3437:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>v,patchFetch:()=>A,requestAsyncStorage:()=>d,routeModule:()=>m,serverHooks:()=>g,staticGenerationAsyncStorage:()=>l});var a={};t.r(a),t.d(a,{GET:()=>c,dynamic:()=>u});var s=t(49303),n=t(88716),o=t(60670),i=t(87070),p=t(72331);let u="force-dynamic";async function c(e){try{let{searchParams:r}=new URL(e.url),t=r.get("search")||"",a=await p.default.gameCategory.findMany({where:{isActive:!0,...t&&{name:{contains:t}}},include:{_count:{select:{products:{where:{isActive:!0,status:!0}}}}},orderBy:{sortOrder:"asc"}});return i.NextResponse.json({categories:a})}catch(e){return console.error("[GAMES GET]",e),i.NextResponse.json({error:"Gagal memuat kategori game"},{status:500})}}let m=new s.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/games/route",pathname:"/api/games",filename:"route",bundlePath:"app/api/games/route"},resolvedPagePath:"C:\\Users\\akmal\\OneDrive\\Documents\\AmaneNime Topup\\amanenime-topup\\app\\api\\games\\route.ts",nextConfigOutput:"standalone",userland:a}),{requestAsyncStorage:d,staticGenerationAsyncStorage:l,serverHooks:g}=m,v="/api/games/route";function A(){return(0,o.patchFetch)({serverHooks:g,staticGenerationAsyncStorage:l})}},72331:(e,r,t)=>{t.r(r),t.d(r,{default:()=>n,prisma:()=>s});var a=t(53524);let s=globalThis.prisma??new a.PrismaClient({datasources:{db:{url:(()=>{if(process.env.DATABASE_URL)return process.env.DATABASE_URL;let e=process.env.DB_USER||"root",r=process.env.DB_PASSWORD||"",t=process.env.DB_HOST||"127.0.0.1",a=process.env.DB_PORT||"3306",s=process.env.DB_NAME||"amanenime_topup";return`mysql://${e}:${r}@${t}:${a}/${s}`})()}},log:["error"]}),n=s}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),a=r.X(0,[8948,5972],()=>t(3437));module.exports=a})();