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