"use strict";(()=>{var e={};e.id=707,e.ids=[707],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")},486:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>f,patchFetch:()=>m,requestAsyncStorage:()=>l,routeModule:()=>p,serverHooks:()=>h,staticGenerationAsyncStorage:()=>x});var s={};t.r(s),t.d(s,{GET:()=>d});var a=t(9303),n=t(8716),o=t(670),i=t(7070),u=t(728),c=t(5456);async function d(){if(!await (0,c.PR)())return i.NextResponse.json({error:"Unauthorized"},{status:401});let[e,r,t,s]=await Promise.all([u._.subscriptionTier.findMany({orderBy:{tierNumber:"asc"}}),u._.launchTask.findMany({orderBy:[{phase:"asc"},{sortOrder:"asc"}]}),u._.activityLog.findMany({orderBy:{createdAt:"desc"},take:5,include:{user:{select:{name:!0}}}}),u._.funnelMetric.findFirst({orderBy:{date:"desc"}})]),a=e.reduce((e,r)=>e+r.subscriberCount,0),n=e.reduce((e,r)=>e+r.subscriberCount*r.price,0),o=r.length,d=r.filter(e=>"done"===e.status).length,p=r.filter(e=>"done"!==e.status).slice(0,5);return i.NextResponse.json({mrr:n,totalSubscribers:a,launchProgress:o>0?Math.round(d/o*100):0,nextTasks:p,tiers:e,recentActivity:t,latestMetric:s})}let p=new a.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/dashboard/route",pathname:"/api/dashboard",filename:"route",bundlePath:"app/api/dashboard/route"},resolvedPagePath:"/Users/jakeshore/.clawdbot/workspace/oskv-dashboard/src/app/api/dashboard/route.ts",nextConfigOutput:"",userland:s}),{requestAsyncStorage:l,staticGenerationAsyncStorage:x,serverHooks:h}=p,f="/api/dashboard/route";function m(){return(0,o.patchFetch)({serverHooks:h,staticGenerationAsyncStorage:x})}},5456:(e,r,t)=>{t.d(r,{PR:()=>u,fT:()=>i});var s=t(1482),a=t.n(s),n=t(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,n.cookies)(),r=e.get("token")?.value;return r?function(e){try{return a().verify(e,o)}catch{return null}}(r):null}},728:(e,r,t)=>{t.d(r,{_:()=>a});let s=require("@prisma/client"),a=globalThis.prisma||new s.PrismaClient}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[276,972,261],()=>t(486));module.exports=s})();