module.exports=[18622,(e,r,t)=>{r.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},20635,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},24725,(e,r,t)=>{r.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},70406,(e,r,t)=>{r.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},93695,(e,r,t)=>{r.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},54799,(e,r,t)=>{r.exports=e.x("crypto",()=>require("crypto"))},63021,(e,r,t)=>{r.exports=e.x("@prisma/client-2c3a283f134fdcb6",()=>require("@prisma/client-2c3a283f134fdcb6"))},23862,e=>e.a(async(r,t)=>{try{let r=await e.y("pg-587764f78a6c7a9c");e.n(r),t()}catch(e){t(e)}},!0),68571,e=>{"use strict";let r={"system:settings":["SUPER_ADMIN"],"users:manage":["SUPER_ADMIN","ADMIN"],"kpis:write":["SUPER_ADMIN","ADMIN","MANAGER"],"kpis:read":["SUPER_ADMIN","ADMIN","MANAGER","STAFF"],"companies:write":["SUPER_ADMIN","ADMIN","MANAGER"],"departments:write":["SUPER_ADMIN","ADMIN","MANAGER"],"financials:write":["SUPER_ADMIN","ADMIN","MANAGER"],"channels:write":["SUPER_ADMIN","ADMIN","MANAGER"],"platforms:write":["SUPER_ADMIN","ADMIN","MANAGER"],"tasks:manageAll":["SUPER_ADMIN","ADMIN","MANAGER"],"tasks:logOwn":["SUPER_ADMIN","ADMIN","MANAGER","STAFF"],"posts:read":["SUPER_ADMIN","ADMIN","MANAGER","STAFF"],"posts:author":["SUPER_ADMIN","ADMIN","MANAGER","STAFF"],"posts:approve":["SUPER_ADMIN","ADMIN","MANAGER"],"appraisals:manage":["SUPER_ADMIN","ADMIN","MANAGER"],"appraisals:read":["SUPER_ADMIN","ADMIN","MANAGER","STAFF"],"dashboard:viewTeam":["SUPER_ADMIN","ADMIN","MANAGER"],"dashboard:viewOwn":["SUPER_ADMIN","ADMIN","MANAGER","STAFF"]};e.s(["can",0,function(e,t){return!!e&&r[t].includes(e)},"isManagerTier",0,function(e){return!!e&&["SUPER_ADMIN","ADMIN","MANAGER"].includes(e)}])},18958,e=>e.a(async(r,t)=>{try{var s=e.i(98902),a=e.i(89171),n=e.i(68571),i=r([s]);[s]=i.then?(await i)():i;class p extends Error{status;constructor(e,r){super(r),this.status=e}}async function o(){let e=await (0,s.auth)();if(!e?.user)throw new p(401,"Not authenticated");return e.user}async function A(e){let r=await o();if(!(0,n.can)(r.role,e))throw new p(403,"Forbidden");return r}e.s(["HttpError",0,p,"requirePermission",0,A,"requireUser",0,o,"withGuard",0,function(e){return async(...r)=>{try{return await e(...r)}catch(e){if(e instanceof p)return a.NextResponse.json({error:e.message},{status:e.status});return console.error("[api] unhandled error",e),a.NextResponse.json({error:"Internal server error"},{status:500})}}}]),t()}catch(e){t(e)}},!1),96608,e=>e.a(async(r,t)=>{try{var s=e.i(89171),a=e.i(18958),n=r([a]);async function i(e,r){let t;try{t=await e.json()}catch{throw new a.HttpError(400,"Invalid JSON body")}let s=r.safeParse(t);if(!s.success){let e=s.error.issues.map(e=>`${e.path.join(".")||"_"}: ${e.message}`).join("; ");throw new a.HttpError(400,e)}return s.data}[a]=n.then?(await n)():n,e.s(["ok",0,function(e,r=200){return s.NextResponse.json(e,{status:r})},"parseBody",0,i]),t()}catch(e){t(e)}},!1),81183,e=>{"use strict";e.s(["progressPct",0,function(e,r){return r?Math.min(Math.max(Math.round(e/r*100),0),100):0}])}];

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