module.exports=[63021,(a,b,c)=>{b.exports=a.x("@prisma/client-2c3a283f134fdcb6",()=>require("@prisma/client-2c3a283f134fdcb6"))},66518,a=>{"use strict";var b=a.i(63021);let c=globalThis.prisma??new b.PrismaClient({log:["error"]});a.s(["prisma",0,c])},93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},50645,a=>{a.n(a.i(27572))},43619,a=>{a.n(a.i(79962))},13718,a=>{a.n(a.i(85523))},18198,a=>{a.n(a.i(45518))},62212,a=>{a.n(a.i(66114))},70844,a=>{a.n(a.i(92359))},58962,a=>{a.n(a.i(83287))},78240,a=>{"use strict";a.s(["AnalyticsClient",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call AnalyticsClient() from the server but AnalyticsClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/app/(dashboard)/analytics/analytics-client.tsx <module evaluation>","AnalyticsClient")},50758,a=>{"use strict";a.s(["AnalyticsClient",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call AnalyticsClient() from the server but AnalyticsClient is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/src/app/(dashboard)/analytics/analytics-client.tsx","AnalyticsClient")},61272,a=>{"use strict";a.i(78240);var b=a.i(50758);a.n(b)},16171,a=>{"use strict";var b=a.i(7997),c=a.i(66518),d=a.i(61272);async function e(a){let b=new Date,c=new Date(b.getFullYear(),b.getMonth()-a,1);return{start:c,end:new Date(b.getFullYear(),b.getMonth()-a+1,0,23,59,59),label:c.toLocaleDateString("id-ID",{month:"short"})}}async function f(){let a=await Promise.all(Array.from({length:6},(a,b)=>e(5-b))),[...f]=await Promise.all([...a.map(a=>c.prisma.contentItem.count({where:{status:"POSTED",postedDate:{gte:a.start,lte:a.end}}})),...a.map(a=>c.prisma.task.count({where:{status:"DONE",updatedAt:{gte:a.start,lte:a.end}}})),...a.map(a=>c.prisma.task.count({where:{status:{not:"DONE"},createdAt:{gte:a.start,lte:a.end}}})),...a.map(a=>c.prisma.event.count({where:{startDate:{gte:a.start,lte:a.end}}})),c.prisma.task.count(),c.prisma.task.count({where:{status:"DONE"}}),c.prisma.contentItem.count(),c.prisma.event.count(),c.prisma.contact.count(),c.prisma.tag.findMany({include:{_count:{select:{tasks:!0,notes:!0,contacts:!0,events:!0,contentItems:!0}}}})]),g=a.map((a,b)=>({month:a.label,count:f[b]})),h=a.map((a,b)=>f[6+b]),i=a.map((a,b)=>f[12+b]),j=a.map((a,b)=>({month:a.label,done:h[b],open:i[b]})),k=a.map((a,b)=>({month:a.label,count:f[18+b]})),l=f[24],m=f[25],n=f[26],o=f[27],p=f[28],q=f[29].map(a=>({name:a.name,color:a.color,count:a._count.tasks+a._count.notes+a._count.contacts+a._count.events+a._count.contentItems})).sort((a,b)=>b.count-a.count).slice(0,8);return(0,b.jsx)(d.AnalyticsClient,{contentByMonth:g,tasksByMonth:j,eventsByMonth:k,topTags:q,stats:{totalTasks:l,totalDone:m,totalContent:n,totalEvents:o,totalContacts:p}})}a.s(["default",()=>f,"dynamic",0,"force-dynamic"])}];

//# sourceMappingURL=%5Broot-of-the-server%5D__5a516e22._.js.map