"use strict";(()=>{var e={};e.id=170,e.ids=[170],e.modules={2934:e=>{e.exports=require("next/dist/client/components/action-async-storage.external.js")},4580:e=>{e.exports=require("next/dist/client/components/request-async-storage.external.js")},5869:e=>{e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},8893:e=>{e.exports=require("buffer")},4770:e=>{e.exports=require("crypto")},6162:e=>{e.exports=require("stream")},1764:e=>{e.exports=require("util")},2061:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>m,patchFetch:()=>g,requestAsyncStorage:()=>w,routeModule:()=>x,serverHooks:()=>f,staticGenerationAsyncStorage:()=>y});var n={};r.r(n),r.d(n,{GET:()=>d,PATCH:()=>l,POST:()=>p});var a=r(9303),s=r(8716),o=r(670),i=r(7070),u=r(728),c=r(5456);async function d(){if(!await (0,c.PR)())return i.NextResponse.json({error:"Unauthorized"},{status:401});let e=await u._.contentSession.findMany({orderBy:[{weekStart:"desc"},{dayOfWeek:"asc"}]});return i.NextResponse.json({sessions:e})}async function p(e){let t=await (0,c.PR)();if(!t)return i.NextResponse.json({error:"Unauthorized"},{status:401});let r=await e.json(),n=await u._.contentSession.create({data:{...r,weekStart:new Date(r.weekStart)}});return await u._.activityLog.create({data:{userId:t.userId,action:"created",entity:"ContentSession",entityId:n.id,details:n.title}}),i.NextResponse.json({session:n})}async function l(e){let t=await (0,c.PR)();if(!t)return i.NextResponse.json({error:"Unauthorized"},{status:401});let{id:r,...n}=await e.json();n.weekStart&&(n.weekStart=new Date(n.weekStart));let a=await u._.contentSession.update({where:{id:r},data:n});return await u._.activityLog.create({data:{userId:t.userId,action:"updated",entity:"ContentSession",entityId:a.id,details:`${a.title} → ${n.status||"edited"}`}}),i.NextResponse.json({session:a})}let x=new a.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/content/route",pathname:"/api/content",filename:"route",bundlePath:"app/api/content/route"},resolvedPagePath:"/Users/jakeshore/.clawdbot/workspace/oskv-dashboard/src/app/api/content/route.ts",nextConfigOutput:"",userland:n}),{requestAsyncStorage:w,staticGenerationAsyncStorage:y,serverHooks:f}=x,m="/api/content/route";function g(){return(0,o.patchFetch)({serverHooks:f,staticGenerationAsyncStorage:y})}},5456:(e,t,r)=>{r.d(t,{PR:()=>u,fT:()=>i});var n=r(1482),a=r.n(n),s=r(1615);let o=process.env.JWT_SECRET||"fallback-secret";function i(e){return a().sign(e,o,{expiresIn:"7d"})}async function u(){let e=await (0,s.cookies)(),t=e.get("token")?.value;return t?function(e){try{return a().verify(e,o)}catch{return null}}(t):null}},728:(e,t,r)=>{r.d(t,{_:()=>a});let n=require("@prisma/client"),a=globalThis.prisma||new n.PrismaClient}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),n=t.X(0,[276,972,261],()=>r(2061));module.exports=n})();