"use strict";(()=>{var e={};e.id=762,e.ids=[762],e.modules={3524:e=>{e.exports=require("@prisma/client")},7096:e=>{e.exports=require("bcrypt")},9344:e=>{e.exports=require("jsonwebtoken")},145:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},1991:(e,r,t)=>{t.r(r),t.d(r,{config:()=>p,default:()=>l,routeModule:()=>c});var s={};t.r(s),t.d(s,{default:()=>d});var a=t(1802),i=t(7153),o=t(6249),u=t(8103),n=t(432);async function d(e,r){if("GET"!==e.method)return r.status(405).json({success:!1,error:"Method not allowed"});try{if(!await (0,u.m)(e,r))return;let t=parseInt(e.query.page||"1",10)||1,s=parseInt(e.query.limit||"20",10)||20,{items:a,total:i}=await n.U.getFavoritedMaterialsByUser(e.user.id,t,s),o=t*s<i;return r.status(200).json({success:!0,data:{items:a,total:i,page:t,limit:s,hasNext:o},timestamp:new Date().toISOString()})}catch(e){return console.error("Get user favorites error:",e),r.status(500).json({success:!1,error:e.message||"Failed to get favorites"})}}let l=(0,o.l)(s,"default"),p=(0,o.l)(s,"config"),c=new a.PagesAPIRouteModule({definition:{kind:i.x.PAGES_API,page:"/api/v1/users/me/favorites",pathname:"/api/v1/users/me/favorites",bundlePath:"",filename:""},userland:s})}};var r=require("../../../../../webpack-api-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[876],()=>t(1991));module.exports=s})();