/home/techb158/balavpn.abdallabala.com/.next/cache/webpack/server-production
NameSizeModeActions
0.pack75919080666editdlrm
1.pack13755910666editdlrm
2.pack2103570666editdlrm
3.pack435023240666editdlrm
4.pack8831030666editdlrm
5.pack2236720666editdlrm
6.pack124000666editdlrm
7.pack1863090666editdlrm
8.pack2143630666editdlrm
9.pack7358150666editdlrm
10.pack2358320666editdlrm
11.pack30785860666editdlrm
12.pack33078460666editdlrm
index.pack85782510666editdlrm
index.pack.old85783080666editdlrm
Edit: /home/techb158/balavpn.abdallabala.com/.next/cache/webpack/server-production/11.pack (3078586B)
wpc.webpack/lib/cache/PackFileCacheStrategyPackContentItems `Compilation/codeGeneration|javascript/auto|C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-flight-loader\index.js!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js??ruleSet[1].rules[16].oneOf[4].use[0]!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\src\services\sso-service.js|rsc|webpack-runtimeCompilation/codeGeneration|javascript/auto|C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-flight-loader\index.js!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js??ruleSet[1].rules[16].oneOf[4].use[0]!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\src\services\auth-service.js|rsc|webpack-runtimelCompilation/codeGeneration|javascript/auto|C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-app-loader\index.js?page=%2Fapi%2Fauth%2Fsignup%2Froute&name=app%2Fapi%2Fauth%2Fsignup%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsignup%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsignup%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=!|rsc|7ee1cbca0d42d1eb|webpack-runtimelCompilation/codeGeneration|javascript/auto|C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-app-loader\index.js?page=%2Fapi%2Fauth%2Flogout%2Froute&name=app%2Fapi%2Fauth%2Flogout%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogout%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogout%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=!|rsc|06a19f6da2ff9538|webpack-runtimepCompilation/codeGeneration|javascript/auto|C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-app-loader\index.js?page=%2Fapi%2Fauth%2Fsession%2Froute&name=app%2Fapi%2Fauth%2Fsession%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsession%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsession%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=!|rsc|f0dfe278f950a6a7|webpack-runtimehCompilation/codeGeneration|javascript/auto|C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-app-loader\index.js?page=%2Fapi%2Fauth%2Flogin%2Froute&name=app%2Fapi%2Fauth%2Flogin%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogin%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogin%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=!|rsc|b34c56d57c3bb82f|webpack-runtimeCompilation/codeGeneration|javascript/auto|C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-flight-loader\index.js!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js??ruleSet[1].rules[16].oneOf[4].use[0]!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\src\app\page.jsx|rsc|e284144fc59eac25|webpack-runtimeCompilation/assets|chunk8887Compilation/assets|chunk4310Compilation/assets|chunk8489Compilation/assets|chunk3745Compilation/assets|chunk7758Compilation/assets|chunk8974MinifierWebpackPlugin|../app/api/auth/signup/route.jsMinifierWebpackPlugin|../app/api/auth/sso/callback/route.jsMinifierWebpackPlugin|../app/api/auth/logout/route.jsMinifierWebpackPlugin|../app/api/auth/session/route.jsMinifierWebpackPlugin|../app/api/auth/login/route.jsMinifierWebpackPlugin|../app/page.jssourcesruntimeRequirementsdatajavascriptwebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource ]webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceu"use strict"; const { prisma } = require("../lib/prisma"); const { createSession } = require("./auth-service"); const { getOidcConfig, discoverProvider, generateNonce, decodeJwtPayload } = require("../lib/oidc"); async function exchangeCode(code, redirectUrl, clientId, clientSecret, tokenEndpoint) { const body = new URLSearchParams({ grant_type: "authorization_code", code, redirect_uri: redirectUrl, client_id: clientId, client_secret: clientSecret }); const res = await fetch(tokenEndpoint, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: body.toString() }); if (!res.ok) { const text = await res.text(); throw new Error(`Token exchange failed (${res.status}): ${text}`); } return res.json(); } async function handleSsoCallback(code) { const config = getOidcConfig(); if (!config) throw Object.assign(new Error("SSO not configured"), { status: 501 }); const disco = await discoverProvider(config.issuer); const tokens = await exchangeCode(code, config.redirectUrl, config.clientId, config.clientSecret, disco.token_endpoint); const idToken = tokens.id_token; if (!idToken) throw Object.assign(new Error("No id_token returned from provider"), { status: 400 }); const claims = decodeJwtPayload(idToken); const email = claims.email; if (!email) throw Object.assign(new Error("Email not provided by SSO provider"), { status: 400 }); const displayName = claims.name || claims.preferred_username || email.split("@")[0]; let user = await prisma.user.findUnique({ where: { email } }); if (!user) { user = await prisma.user.create({ data: { email, displayName, emailVerifiedAt: new Date() } }); const slug = displayName.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: `${displayName}'s Organization`, slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3 } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50 } }); } else { await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date(), displayName } }); } const session = await createSession(user.id); return { user, session }; } module.exports = { handleSsoCallback }; h !')7U[]lC__webpack_require__796485595617buffersourcesizemapshashl const { prisma } = __webpack_require__(7964); const { createSession } = __webpack_require__(8559); const { getOidcConfig, discoverProvider, generateNonce, decodeJwtPayload } = __webpack_require__(5617); async function exchangeCode(code, redirectUrl, clientId, clientSecret, tokenEndpoint) { const body = new URLSearchParams({ grant_type: "authorization_code", code, redirect_uri: redirectUrl, client_id: clientId, client_secret: clientSecret }); const res = await fetch(tokenEndpoint, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: body.toString() }); if (!res.ok) { const text = await res.text(); throw new Error(`Token exchange failed (${res.status}): ${text}`); } return res.json(); } async function handleSsoCallback(code) { const config = getOidcConfig(); if (!config) throw Object.assign(new Error("SSO not configured"), { status: 501 }); const disco = await discoverProvider(config.issuer); const tokens = await exchangeCode(code, config.redirectUrl, config.clientId, config.clientSecret, disco.token_endpoint); const idToken = tokens.id_token; if (!idToken) throw Object.assign(new Error("No id_token returned from provider"), { status: 400 }); const claims = decodeJwtPayload(idToken); const email = claims.email; if (!email) throw Object.assign(new Error("Email not provided by SSO provider"), { status: 400 }); const displayName = claims.name || claims.preferred_username || email.split("@")[0]; let user = await prisma.user.findUnique({ where: { email } }); if (!user) { user = await prisma.user.create({ data: { email, displayName, emailVerifiedAt: new Date() } }); const slug = displayName.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: `${displayName}'s Organization`, slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3 } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50 } }); } else { await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date(), displayName } }); } const session = await createSession(user.id); return { user, session }; } module.exports = { handleSsoCallback }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceu"use strict"; const { prisma } = require("../lib/prisma"); const { createSession } = require("./auth-service"); const { getOidcConfig, discoverProvider, generateNonce, decodeJwtPayload } = require("../lib/oidc"); async function exchangeCode(code, redirectUrl, clientId, clientSecret, tokenEndpoint) { const body = new URLSearchParams({ grant_type: "authorization_code", code, redirect_uri: redirectUrl, client_id: clientId, client_secret: clientSecret }); const res = await fetch(tokenEndpoint, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: body.toString() }); if (!res.ok) { const text = await res.text(); throw new Error(`Token exchange failed (${res.status}): ${text}`); } return res.json(); } async function handleSsoCallback(code) { const config = getOidcConfig(); if (!config) throw Object.assign(new Error("SSO not configured"), { status: 501 }); const disco = await discoverProvider(config.issuer); const tokens = await exchangeCode(code, config.redirectUrl, config.clientId, config.clientSecret, disco.token_endpoint); const idToken = tokens.id_token; if (!idToken) throw Object.assign(new Error("No id_token returned from provider"), { status: 400 }); const claims = decodeJwtPayload(idToken); const email = claims.email; if (!email) throw Object.assign(new Error("Email not provided by SSO provider"), { status: 400 }); const displayName = claims.name || claims.preferred_username || email.split("@")[0]; let user = await prisma.user.findUnique({ where: { email } }); if (!user) { user = await prisma.user.create({ data: { email, displayName, emailVerifiedAt: new Date() } }); const slug = displayName.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: `${displayName}'s Organization`, slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3 } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50 } }); } else { await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date(), displayName } }); } const session = await createSession(user.id); return { user, session }; } module.exports = { handleSsoCallback }; 012undefined3339__webpack_require__undefined41557964undefined8591__webpack_require__undefined931088559undefined189195__webpack_require__undefined1972095617undefinedmodule__webpack_require__ webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; k !')7SY[bu{}@__webpack_require__796455117082( const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS };  &"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; 012undefined3339__webpack_require__undefined41557964undefined8389__webpack_require__undefined91985511undefined117123__webpack_require__undefined1251347082undefined nwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource1 // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/signup/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/signup/route.js webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceconst { signup } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse, parseJson } = require("../../../../lib/http"); export async function POST(request) { try { const body = await parseJson(request); const { user, session } = await signup(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 201, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } f=tz|F__webpack_require__85592488 true0buffersourcesizemapshashYconst { signup } = __webpack_require__(8559); const { jsonResponse, errorResponse, parseJson } = __webpack_require__(2488); async function POST(request) { try { const body = await parseJson(request); const { user, session } = await signup(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 201, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${ true ? 'Secure; ' : 0}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } {"finalSource":false}mapbufferedMap ReplaceSourceRawSourceconst { signup } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse, parseJson } = require("../../../../lib/http"); export async function POST(request) { try { const body = await parseJson(request); const { user, session } = await signup(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 201, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } 1925__webpack_require__undefined27618559undefined116122__webpack_require__undefined1241452488undefined149155undefined677705 trueundefined7227230undefined ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsignup%2Froute&name=app%2Fapi%2Fauth%2Fsignup%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsignup%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsignup%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=!  Hwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource=import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/signup/route", pathname: "/api/auth/signup", filename: "route", bundlePath: "app/api/auth/signup/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/signup/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map c;^`_%'np "_abdm_e  T  B :BL_Z~n{MZ$%p%%&&''((*+--f/n/11t33(5RB5q5~5557)7f7q7]9j999::;;'=2=__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._".next"0 false: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._false{}__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__.__A // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new __WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._({ definition: { kind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, page: "/api/auth/signup/route", pathname: "/api/auth/signup", filename: "route", bundlePath: "app/api/auth/signup/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js", nextConfigOutput, userland: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._ }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return __WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/signup/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = __WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = __WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: __WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._(req); const nodeNextRes = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._(res); const nextReq = __WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._.fromNodeNextRequest(nodeNextReq, __WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== __WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = __WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(response.headers); if (cacheTags) { headers[__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = __WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(cacheEntry.value.headers); if (!(__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isIsr)) { headers.delete(__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', __WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._(cacheEntry.cacheControl)); } await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest, { spanName: `${method} ${req.url}`, kind: __WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map  =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/signup/route", pathname: "/api/auth/signup", filename: "route", bundlePath: "app/api/auth/signup/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/signup/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741494undefined16451663__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined16991707__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18931928".next"undefined193319340undefined19611999 falseundefined22602259: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25652575__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26442733undefined27352741undefined30513071falseundefined30743138{}undefined32843323falseundefined38493864__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43224336__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51785186__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56035616__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62206234__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62706285__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63136330__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63656386__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70227035__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80138026__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94629486__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95849605__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99579970__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1016010173__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1041310427__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1099911010__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1167911697__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1213412142__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1269212706__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1317213185__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1360813634__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1368113694__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1376013781__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1410114121__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1418214193__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1468514698__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1479714804__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1506015074__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1529515313__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1565515666__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined`"_ /s_= k i j#G@,zLH""!##_$I%&c&S'')=*,D-.=/c1133567666E788199z;;+<m<m==C>?h@@module_compiled.AppRouteRouteModuleroute_kind.RouteKindroute_namespaceObject(0,patch_fetch.patchFetch)(0,app_paths_.normalizeAppPath)no_fallback_error_external_.NoFallbackError(0,trace_tracer.getTracer)(0,request_meta.getRequestMeta)node.NodeNextRequestnode.NodeNextResponsenext_request.NextRequestAdapter(0,next_request.signalFromNodeResponse)constants.BaseServerSpan(0,web_utils.toNodeOutgoingHttpHeaders)lib_constants.NEXT_CACHE_TAGS_HEADERlib_constants.INFINITE_CACHEresponse_cache.CachedRouteKind(0,send_response/* sendResponse */.I)(0,utils/* getRevalidateReason */.c)(0,web_utils.fromNodeOutgoingHttpHeaders)(0,cache_control.getCacheControlHeader)trace_tracer.SpanKind1I// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/signup/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/signup/route.js const { signup } = __webpack_require__(8559); const { jsonResponse, errorResponse, parseJson } = __webpack_require__(2488); async function POST(request) { try { const body = await parseJson(request); const { user, session } = await signup(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 201, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${ true ? 'Secure; ' : 0}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsignup%2Froute&name=app%2Fapi%2Fauth%2Fsignup%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsignup%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsignup%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/signup/route", pathname: "/api/auth/signup", filename: "route", bundlePath: "app/api/auth/signup/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/signup/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map  ` ConcatSourceRawSource1 // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/signup/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/signup/route.js  ReplaceSourceconst { signup } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse, parseJson } = require("../../../../lib/http"); export async function POST(request) { try { const body = await parseJson(request); const { user, session } = await signup(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 201, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } 1925__webpack_require__undefined27618559undefined116122__webpack_require__undefined1241452488undefined149155undefined677705 trueundefined7227230undefined RawSource ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsignup%2Froute&name=app%2Fapi%2Fauth%2Fsignup%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsignup%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsignup%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/signup/route", pathname: "/api/auth/signup", filename: "route", bundlePath: "app/api/auth/signup/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/signup/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741494undefined16451663__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined16991707__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18931928".next"undefined193319340undefined19611999 falseundefined22602259: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25652575__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26442733undefined27352741undefined30513071falseundefined30743138{}undefined32843323falseundefined38493864__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43224336__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51785186__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56035616__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62206234__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62706285__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63136330__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63656386__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70227035__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80138026__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94629486__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95849605__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99579970__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1016010173__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1041310427__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1099911010__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1167911697__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1213412142__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1269212706__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1317213185__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1360813634__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1368113694__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1376013781__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1410114121__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1418214193__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1468514698__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1479714804__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1506015074__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1529515313__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1565515666__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined166267module_compiled.AppRouteRouteModuleundefined303371route_kind.RouteKindundefined863908route_namespaceObjectundefined12141302(0,patch_fetch.patchFetch)undefined23652465(0,app_paths_.normalizeAppPath)undefined29233017no_fallback_error_external_.NoFallbackErrorundefined38593945(0,trace_tracer.getTracer)undefined43624458(0,request_meta.getRequestMeta)undefined50625155node.NodeNextRequestundefined51915286node.NodeNextResponseundefined53145405next_request.NextRequestAdapterundefined54405552(0,next_request.signalFromNodeResponse)undefined61886266constants.BaseServerSpanundefined72447340(0,request_meta.getRequestMeta)undefined87768895(0,web_utils.toNodeOutgoingHttpHeaders)undefined89939101lib_constants.NEXT_CACHE_TAGS_HEADERundefined94539545lib_constants.INFINITE_CACHEundefined97359827lib_constants.INFINITE_CACHEundefined1006710148response_cache.CachedRouteKindundefined1072010813(0,send_response/* sendResponse */.I)undefined1148211588(0,utils/* getRevalidateReason */.c)undefined1202512093route_kind.RouteKindundefined1264312724response_cache.CachedRouteKindundefined1319013286(0,request_meta.getRequestMeta)undefined1370913832(0,web_utils.fromNodeOutgoingHttpHeaders)undefined1387913975(0,request_meta.getRequestMeta)undefined1404114149lib_constants.NEXT_CACHE_TAGS_HEADERundefined1446914580(0,cache_control.getCacheControlHeader)undefined1464114734(0,send_response/* sendResponse */.I)undefined1522615304constants.BaseServerSpanundefined1540315469trace_tracer.SpanKindundefined1572515819no_fallback_error_external_.NoFallbackErrorundefined1604016146(0,utils/* getRevalidateReason */.c)undefined1648816581(0,send_response/* sendResponse */.I)undefinedtopLevelDeclarations`:module_compiledmodule_compiled_namespaceObjectmodule_compiled_defaultroute_kindroute_kind_namespaceObjectpatch_fetchpatch_fetch_namespaceObjectpatch_fetch_defaultrequest_metarequest_meta_namespaceObjectrequest_meta_defaulttrace_tracertracer_namespaceObjecttracer_defaultapp_paths_app_paths_namespaceObjectapp_paths_defaultnodenode_namespaceObjectnode_defaultnext_requestnext_request_namespaceObjectnext_request_defaultconstantsconstants_namespaceObjectconstants_defaultutilsutils_namespaceObjectsend_responsesend_response_namespaceObjectweb_utilsweb_utils_namespaceObjectutils_defaultcache_controlcache_control_namespaceObjectlib_constantslib_constants_namespaceObjectlib_constants_defaultno_fallback_error_external_no_fallback_error_external_namespaceObjectno_fallback_error_external_defaultresponse_cacheresponse_cache_namespaceObjectresponse_cache_defaultsignupjsonResponseerrorResponseparseJsonPOSTroute_namespaceObjectnextConfigOutputrouteModuleworkAsyncStorageworkUnitAsyncStorageserverHookspatchFetchhandler\next_app_loaderpage_2Fapi_2Fauth_2Fsignup_2Froute_name_app_2Fapi_2Fauth_2Fsignup_2Froute_pagePath_private_next_app_dir_2Fapi_2Fauth_2Fsignup_2Froute_js_appDir_C_3A_5CUsers_5Cabd_b_5COneDrive_5CDesktop_5CCOSMIC_20AI_Risk_20Dashboard_5CStep_2012_20is_20complete_20Final_20QA_2C_20Demo_20Readiness_2C_20and_20Submission_20Freeze_5Capplication_5Csaas_app_5Csrc_5Capp_appPaths_2Fapi_2Fauth_2Fsignup_2Froute_pageExtensions_tsx_pageExtensions_ts_pageExtensions_jsx_pageExtensions_js_basePath_assetPrefix_nextConfigOutput_standalone_preferredRegion_middlewareConfig_e30_3D_isGlobalNotFoundEnabled_namespaceObject__webpack_exports____webpack_require__.d__webpack_require__.r webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource1 // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/logout/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/logout/route.js webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceconst { logout } = require("../../../../services/auth-service"); const { errorResponse } = require("../../../../lib/http"); export async function POST(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (match) await logout(match[1]); return new Response(JSON.stringify({ ok: true }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=0`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } h=[acx|DA]no__webpack_require__85592488 true0buffersourcesizemapshashconst { logout } = __webpack_require__(8559); const { errorResponse } = __webpack_require__(2488); async function POST(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (match) await logout(match[1]); return new Response(JSON.stringify({ ok: true }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=; HttpOnly; ${ true ? 'Secure; ' : 0}SameSite=Lax; Path=/; Max-Age=0`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } {"finalSource":false}mapbufferedMap ReplaceSourceRawSourceconst { logout } = require("../../../../services/auth-service"); const { errorResponse } = require("../../../../lib/http"); export async function POST(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (match) await logout(match[1]); return new Response(JSON.stringify({ ok: true }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=0`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } 1925__webpack_require__undefined27618559undefined9197__webpack_require__undefined991202488undefined124130undefined577605 trueundefined6226230undefined ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Flogout%2Froute&name=app%2Fapi%2Fauth%2Flogout%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogout%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogout%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=!  Hwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource=import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/logout/route", pathname: "/api/auth/logout", filename: "route", bundlePath: "app/api/auth/logout/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/logout/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map c;^`_%'np "_abdm_e  T  B :BL_Z~n{MZ$%p%%&&''((*+--f/n/11t33(5RB5q5~5557)7f7q7]9j999::;;'=2=__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._".next"0 false: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._false{}__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__.__A // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new __WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._({ definition: { kind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, page: "/api/auth/logout/route", pathname: "/api/auth/logout", filename: "route", bundlePath: "app/api/auth/logout/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js", nextConfigOutput, userland: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._ }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return __WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/logout/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = __WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = __WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: __WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._(req); const nodeNextRes = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._(res); const nextReq = __WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._.fromNodeNextRequest(nodeNextReq, __WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== __WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = __WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(response.headers); if (cacheTags) { headers[__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = __WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(cacheEntry.value.headers); if (!(__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isIsr)) { headers.delete(__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', __WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._(cacheEntry.cacheControl)); } await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest, { spanName: `${method} ${req.url}`, kind: __WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map  =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/logout/route", pathname: "/api/auth/logout", filename: "route", bundlePath: "app/api/auth/logout/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/logout/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741494undefined16451663__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined16991707__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18931928".next"undefined193319340undefined19611999 falseundefined22602259: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25652575__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26442733undefined27352741undefined30513071falseundefined30743138{}undefined32843323falseundefined38493864__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43224336__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51785186__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56035616__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62206234__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62706285__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63136330__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63656386__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70227035__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80138026__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94629486__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95849605__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99579970__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1016010173__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1041310427__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1099911010__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1167911697__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1213412142__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1269212706__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1317213185__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1360813634__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1368113694__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1376013781__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1410114121__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1418214193__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1468514698__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1479714804__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1506015074__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1529515313__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1565515666__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined`"_ /s_= k i j#G@,zLH""!##_$I%&c&S'')=*,D-.=/c1133567666E788199z;;+<m<m==C>?h@@module_compiled.AppRouteRouteModuleroute_kind.RouteKindroute_namespaceObject(0,patch_fetch.patchFetch)(0,app_paths_.normalizeAppPath)no_fallback_error_external_.NoFallbackError(0,trace_tracer.getTracer)(0,request_meta.getRequestMeta)node.NodeNextRequestnode.NodeNextResponsenext_request.NextRequestAdapter(0,next_request.signalFromNodeResponse)constants.BaseServerSpan(0,web_utils.toNodeOutgoingHttpHeaders)lib_constants.NEXT_CACHE_TAGS_HEADERlib_constants.INFINITE_CACHEresponse_cache.CachedRouteKind(0,send_response/* sendResponse */.I)(0,utils/* getRevalidateReason */.c)(0,web_utils.fromNodeOutgoingHttpHeaders)(0,cache_control.getCacheControlHeader)trace_tracer.SpanKindH// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/logout/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/logout/route.js const { logout } = __webpack_require__(8559); const { errorResponse } = __webpack_require__(2488); async function POST(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (match) await logout(match[1]); return new Response(JSON.stringify({ ok: true }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=; HttpOnly; ${ true ? 'Secure; ' : 0}SameSite=Lax; Path=/; Max-Age=0`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Flogout%2Froute&name=app%2Fapi%2Fauth%2Flogout%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogout%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogout%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/logout/route", pathname: "/api/auth/logout", filename: "route", bundlePath: "app/api/auth/logout/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/logout/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map  ` 1 // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/logout/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/logout/route.js const { logout } = require("../../../../services/auth-service"); const { errorResponse } = require("../../../../lib/http"); export async function POST(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (match) await logout(match[1]); return new Response(JSON.stringify({ ok: true }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=0`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } 1925__webpack_require__undefined27618559undefined9197__webpack_require__undefined991202488undefined124130undefined577605 trueundefined6226230undefined ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Flogout%2Froute&name=app%2Fapi%2Fauth%2Flogout%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogout%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogout%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/logout/route", pathname: "/api/auth/logout", filename: "route", bundlePath: "app/api/auth/logout/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/logout/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map `8ކlogout\next_app_loaderpage_2Fapi_2Fauth_2Flogout_2Froute_name_app_2Fapi_2Fauth_2Flogout_2Froute_pagePath_private_next_app_dir_2Fapi_2Fauth_2Flogout_2Froute_js_appDir_C_3A_5CUsers_5Cabd_b_5COneDrive_5CDesktop_5CCOSMIC_20AI_Risk_20Dashboard_5CStep_2012_20is_20complete_20Final_20QA_2C_20Demo_20Readiness_2C_20and_20Submission_20Freeze_5Capplication_5Csaas_app_5Csrc_5Capp_appPaths_2Fapi_2Fauth_2Flogout_2Froute_pageExtensions_tsx_pageExtensions_ts_pageExtensions_jsx_pageExtensions_js_basePath_assetPrefix_nextConfigOutput_standalone_preferredRegion_middlewareConfig_e30_3D_isGlobalNotFoundEnabled_namespaceObjectt %webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource1 // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/session/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { GET: () => (GET) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/session/route.js webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Wwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceconst { getSession } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse } = require("../../../../lib/http"); export async function GET(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (!match) return jsonResponse({ authenticated: false }); const session = await getSession(match[1]); if (!session) return jsonResponse({ authenticated: false }); return jsonResponse({ authenticated: true, user: { id: session.user.id, email: session.user.email, displayName: session.user.displayName }, memberships: session.user.memberships.map((item)=>({ organizationId: item.organizationId, organizationName: item.organization.name, role: item.role.code, permissions: item.role.permissions })) }); } catch (error) { return errorResponse(error); } } fAmsuB__webpack_require__85592488buffersourcesizemapshash_const { getSession } = __webpack_require__(8559); const { jsonResponse, errorResponse } = __webpack_require__(2488); async function GET(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (!match) return jsonResponse({ authenticated: false }); const session = await getSession(match[1]); if (!session) return jsonResponse({ authenticated: false }); return jsonResponse({ authenticated: true, user: { id: session.user.id, email: session.user.email, displayName: session.user.displayName }, memberships: session.user.memberships.map((item)=>({ organizationId: item.organizationId, organizationName: item.organization.name, role: item.role.code, permissions: item.role.permissions })) }); } catch (error) { return errorResponse(error); } } {"finalSource":false}mapbufferedMap ReplaceSourceRawSourceconst { getSession } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse } = require("../../../../lib/http"); export async function GET(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (!match) return jsonResponse({ authenticated: false }); const session = await getSession(match[1]); if (!session) return jsonResponse({ authenticated: false }); return jsonResponse({ authenticated: true, user: { id: session.user.id, email: session.user.email, displayName: session.user.displayName }, memberships: session.user.memberships.map((item)=>({ organizationId: item.organizationId, organizationName: item.organization.name, role: item.role.code, permissions: item.role.permissions })) }); } catch (error) { return errorResponse(error); } } u2329__webpack_require__undefined31658559undefined109115__webpack_require__undefined1171382488undefined142148undefined ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsession%2Froute&name=app%2Fapi%2Fauth%2Fsession%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsession%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsession%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=!  Hwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource=import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/session/route", pathname: "/api/auth/session", filename: "route", bundlePath: "app/api/auth/session/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/session/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map c;^`_%'np "_abdn_i  Y   H  @HR_`tS`$%v%%&&''((*+--l/t/11z33.5RH5w55557/7l7w7c9p999::;;-=8=__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._".next"0 false: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._false{}__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._dA // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new __WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._({ definition: { kind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, page: "/api/auth/session/route", pathname: "/api/auth/session", filename: "route", bundlePath: "app/api/auth/session/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js", nextConfigOutput, userland: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._ }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return __WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/session/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = __WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = __WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: __WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._(req); const nodeNextRes = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._(res); const nextReq = __WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._.fromNodeNextRequest(nodeNextReq, __WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== __WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = __WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(response.headers); if (cacheTags) { headers[__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = __WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(cacheEntry.value.headers); if (!(__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isIsr)) { headers.delete(__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', __WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._(cacheEntry.cacheControl)); } await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest, { spanName: `${method} ${req.url}`, kind: __WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map  =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/session/route", pathname: "/api/auth/session", filename: "route", bundlePath: "app/api/auth/session/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/session/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741495undefined16461664__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined17001708__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18971932".next"undefined193719380undefined19652003 falseundefined22652264: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25702580__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26492738undefined27402746undefined30573077falseundefined30803144{}undefined32903329falseundefined38553870__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43284342__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51845192__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56095622__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62266240__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62766291__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63196336__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63716392__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70287041__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80198032__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94689492__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95909611__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99639976__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1016610179__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1041910433__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1100511016__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1168511703__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1214012148__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1269812712__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1317813191__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1361413640__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1368713700__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1376613787__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1410714127__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1418814199__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1469114704__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1480314810__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1506615080__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1530115319__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1566115672__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined`"_ /scB p no(L"E1QM""&##_$N% &h&X'')B*,I-.B/h11335 6<666J788699;;0<r<r==C>?m@@module_compiled.AppRouteRouteModuleroute_kind.RouteKindroute_namespaceObject(0,patch_fetch.patchFetch)(0,app_paths_.normalizeAppPath)no_fallback_error_external_.NoFallbackError(0,trace_tracer.getTracer)(0,request_meta.getRequestMeta)node.NodeNextRequestnode.NodeNextResponsenext_request.NextRequestAdapter(0,next_request.signalFromNodeResponse)constants.BaseServerSpan(0,web_utils.toNodeOutgoingHttpHeaders)lib_constants.NEXT_CACHE_TAGS_HEADERlib_constants.INFINITE_CACHEresponse_cache.CachedRouteKind(0,send_response/* sendResponse */.I)(0,utils/* getRevalidateReason */.c)(0,web_utils.fromNodeOutgoingHttpHeaders)(0,cache_control.getCacheControlHeader)trace_tracer.SpanKindz@J// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/session/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { GET: () => (GET) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/session/route.js const { getSession } = __webpack_require__(8559); const { jsonResponse, errorResponse } = __webpack_require__(2488); async function GET(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (!match) return jsonResponse({ authenticated: false }); const session = await getSession(match[1]); if (!session) return jsonResponse({ authenticated: false }); return jsonResponse({ authenticated: true, user: { id: session.user.id, email: session.user.email, displayName: session.user.displayName }, memberships: session.user.memberships.map((item)=>({ organizationId: item.organizationId, organizationName: item.organization.name, role: item.role.code, permissions: item.role.permissions })) }); } catch (error) { return errorResponse(error); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsession%2Froute&name=app%2Fapi%2Fauth%2Fsession%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsession%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsession%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/session/route", pathname: "/api/auth/session", filename: "route", bundlePath: "app/api/auth/session/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/session/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map {~ ` 1 // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/session/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { GET: () => (GET) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/session/route.js ~const { getSession } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse } = require("../../../../lib/http"); export async function GET(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (!match) return jsonResponse({ authenticated: false }); const session = await getSession(match[1]); if (!session) return jsonResponse({ authenticated: false }); return jsonResponse({ authenticated: true, user: { id: session.user.id, email: session.user.email, displayName: session.user.displayName }, memberships: session.user.memberships.map((item)=>({ organizationId: item.organizationId, organizationName: item.organization.name, role: item.role.code, permissions: item.role.permissions })) }); } catch (error) { return errorResponse(error); } } u2329__webpack_require__undefined31658559undefined109115__webpack_require__undefined1171382488undefined142148undefined ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsession%2Froute&name=app%2Fapi%2Fauth%2Fsession%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsession%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsession%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! {=import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/session/route", pathname: "/api/auth/session", filename: "route", bundlePath: "app/api/auth/session/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/session/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741495undefined16461664__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined17001708__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18971932".next"undefined193719380undefined19652003 falseundefined22652264: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25702580__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26492738undefined27402746undefined30573077falseundefined30803144{}undefined32903329falseundefined38553870__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43284342__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51845192__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56095622__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62266240__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62766291__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63196336__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63716392__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70287041__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80198032__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94689492__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95909611__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99639976__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1016610179__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1041910433__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1100511016__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1168511703__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1214012148__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1269812712__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1317813191__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1361413640__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1368713700__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1376613787__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1410714127__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1418814199__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1469114704__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1480314810__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1506615080__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1530115319__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1566115672__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined166267module_compiled.AppRouteRouteModuleundefined303371route_kind.RouteKindundefined867912route_namespaceObjectundefined12181306(0,patch_fetch.patchFetch)undefined23702470(0,app_paths_.normalizeAppPath)undefined29283022no_fallback_error_external_.NoFallbackErrorundefined38643950(0,trace_tracer.getTracer)undefined43674463(0,request_meta.getRequestMeta)undefined50675160node.NodeNextRequestundefined51965291node.NodeNextResponseundefined53195410next_request.NextRequestAdapterundefined54455557(0,next_request.signalFromNodeResponse)undefined61936271constants.BaseServerSpanundefined72497345(0,request_meta.getRequestMeta)undefined87818900(0,web_utils.toNodeOutgoingHttpHeaders)undefined89989106lib_constants.NEXT_CACHE_TAGS_HEADERundefined94589550lib_constants.INFINITE_CACHEundefined97409832lib_constants.INFINITE_CACHEundefined1007210153response_cache.CachedRouteKindundefined1072510818(0,send_response/* sendResponse */.I)undefined1148711593(0,utils/* getRevalidateReason */.c)undefined1203012098route_kind.RouteKindundefined1264812729response_cache.CachedRouteKindundefined1319513291(0,request_meta.getRequestMeta)undefined1371413837(0,web_utils.fromNodeOutgoingHttpHeaders)undefined1388413980(0,request_meta.getRequestMeta)undefined1404614154lib_constants.NEXT_CACHE_TAGS_HEADERundefined1447414585(0,cache_control.getCacheControlHeader)undefined1464614739(0,send_response/* sendResponse */.I)undefined1523115309constants.BaseServerSpanundefined1540815474trace_tracer.SpanKindundefined1573015824no_fallback_error_external_.NoFallbackErrorundefined1604516151(0,utils/* getRevalidateReason */.c)undefined1649316586(0,send_response/* sendResponse */.I)undefined`9ʊgetSessioñGET`next_app_loaderpage_2Fapi_2Fauth_2Fsession_2Froute_name_app_2Fapi_2Fauth_2Fsession_2Froute_pagePath_private_next_app_dir_2Fapi_2Fauth_2Fsession_2Froute_js_appDir_C_3A_5CUsers_5Cabd_b_5COneDrive_5CDesktop_5CCOSMIC_20AI_Risk_20Dashboard_5CStep_2012_20is_20complete_20Final_20QA_2C_20Demo_20Readiness_2C_20and_20Submission_20Freeze_5Capplication_5Csaas_app_5Csrc_5Capp_appPaths_2Fapi_2Fauth_2Fsession_2Froute_pageExtensions_tsx_pageExtensions_ts_pageExtensions_jsx_pageExtensions_js_basePath_assetPrefix_nextConfigOutput_standalone_preferredRegion_middlewareConfig_e30_3D_isGlobalNotFoundEnabled_namespaceObjectw_ Qwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/ // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/login/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/login/route.js webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceconst { login } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse, parseJson } = require("../../../../lib/http"); export async function POST(request) { try { const body = await parseJson(request); const { user, session } = await login(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } f{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map c;^`_%'np "_abdl_~a O < 4<F_TxhuGT$%j%%&&''((**--`/h/11n3{3"5R<5k5x5557#7`7k7W9d999::;;!=,=__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._".next"0 false: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._false{}__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._ZA // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new __WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._({ definition: { kind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, page: "/api/auth/login/route", pathname: "/api/auth/login", filename: "route", bundlePath: "app/api/auth/login/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js", nextConfigOutput, userland: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._ }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return __WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/login/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = __WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = __WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: __WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._(req); const nodeNextRes = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._(res); const nextReq = __WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._.fromNodeNextRequest(nodeNextReq, __WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== __WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = __WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(response.headers); if (cacheTags) { headers[__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = __WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(cacheEntry.value.headers); if (!(__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isIsr)) { headers.delete(__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', __WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._(cacheEntry.cacheControl)); } await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest, { spanName: `${method} ${req.url}`, kind: __WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map  =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/login/route", pathname: "/api/auth/login", filename: "route", bundlePath: "app/api/auth/login/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/login/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741493undefined16441662__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined16981706__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18891924".next"undefined192919300undefined19571995 falseundefined22552254: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25602570__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26392728undefined27302736undefined30453065falseundefined30683132{}undefined32783317falseundefined38433858__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43164330__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51725180__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined55975610__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62146228__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62646279__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63076324__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63596380__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70167029__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80078020__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94569480__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95789599__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99519964__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1015410167__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1040710421__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1099311004__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1167311691__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1212812136__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1268612700__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1316613179__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1360213628__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1367513688__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1375413775__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1409514115__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1417614187__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1467914692__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1479114798__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1505415068__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1528915307__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1564915660__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined`"_ /s[8 f deB;'uGC""##_$D%&^&N'')8*,?-.8/^1133562666@788,99u;;&<h<h==C> ?c@@module_compiled.AppRouteRouteModuleroute_kind.RouteKindroute_namespaceObject(0,patch_fetch.patchFetch)(0,app_paths_.normalizeAppPath)no_fallback_error_external_.NoFallbackError(0,trace_tracer.getTracer)(0,request_meta.getRequestMeta)node.NodeNextRequestnode.NodeNextResponsenext_request.NextRequestAdapter(0,next_request.signalFromNodeResponse)constants.BaseServerSpan(0,web_utils.toNodeOutgoingHttpHeaders)lib_constants.NEXT_CACHE_TAGS_HEADERlib_constants.INFINITE_CACHEresponse_cache.CachedRouteKind(0,send_response/* sendResponse */.I)(0,utils/* getRevalidateReason */.c)(0,web_utils.fromNodeOutgoingHttpHeaders)(0,cache_control.getCacheControlHeader)trace_tracer.SpanKinde$I// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/login/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/login/route.js const { login } = __webpack_require__(8559); const { jsonResponse, errorResponse, parseJson } = __webpack_require__(2488); async function POST(request) { try { const body = await parseJson(request); const { user, session } = await login(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${ true ? 'Secure; ' : 0}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Flogin%2Froute&name=app%2Fapi%2Fauth%2Flogin%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogin%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogin%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/login/route", pathname: "/api/auth/login", filename: "route", bundlePath: "app/api/auth/login/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/login/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map fi ` / // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/login/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/login/route.js iconst { login } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse, parseJson } = require("../../../../lib/http"); export async function POST(request) { try { const body = await parseJson(request); const { user, session } = await login(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } 1824__webpack_require__undefined26608559undefined115121__webpack_require__undefined1231442488undefined148154undefined675703 trueundefined7207210undefined ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Flogin%2Froute&name=app%2Fapi%2Fauth%2Flogin%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogin%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogin%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! f=import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/login/route", pathname: "/api/auth/login", filename: "route", bundlePath: "app/api/auth/login/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/login/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741493undefined16441662__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined16981706__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18891924".next"undefined192919300undefined19571995 falseundefined22552254: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25602570__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26392728undefined27302736undefined30453065falseundefined30683132{}undefined32783317falseundefined38433858__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43164330__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51725180__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined55975610__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62146228__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62646279__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63076324__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63596380__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70167029__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80078020__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94569480__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95789599__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99519964__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1015410167__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1040710421__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1099311004__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1167311691__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1212812136__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1268612700__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1316613179__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1360213628__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1367513688__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1375413775__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1409514115__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1417614187__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1467914692__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1479114798__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1505415068__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1528915307__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1564915660__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined166267module_compiled.AppRouteRouteModuleundefined303371route_kind.RouteKindundefined859904route_namespaceObjectundefined12101298(0,patch_fetch.patchFetch)undefined23602460(0,app_paths_.normalizeAppPath)undefined29183012no_fallback_error_external_.NoFallbackErrorundefined38543940(0,trace_tracer.getTracer)undefined43574453(0,request_meta.getRequestMeta)undefined50575150node.NodeNextRequestundefined51865281node.NodeNextResponseundefined53095400next_request.NextRequestAdapterundefined54355547(0,next_request.signalFromNodeResponse)undefined61836261constants.BaseServerSpanundefined72397335(0,request_meta.getRequestMeta)undefined87718890(0,web_utils.toNodeOutgoingHttpHeaders)undefined89889096lib_constants.NEXT_CACHE_TAGS_HEADERundefined94489540lib_constants.INFINITE_CACHEundefined97309822lib_constants.INFINITE_CACHEundefined1006210143response_cache.CachedRouteKindundefined1071510808(0,send_response/* sendResponse */.I)undefined1147711583(0,utils/* getRevalidateReason */.c)undefined1202012088route_kind.RouteKindundefined1263812719response_cache.CachedRouteKindundefined1318513281(0,request_meta.getRequestMeta)undefined1370413827(0,web_utils.fromNodeOutgoingHttpHeaders)undefined1387413970(0,request_meta.getRequestMeta)undefined1403614144lib_constants.NEXT_CACHE_TAGS_HEADERundefined1446414575(0,cache_control.getCacheControlHeader)undefined1463614729(0,send_response/* sendResponse */.I)undefined1522115299constants.BaseServerSpanundefined1539815464trace_tracer.SpanKindundefined1572015814no_fallback_error_external_.NoFallbackErrorundefined1603516141(0,utils/* getRevalidateReason */.c)undefined1648316576(0,send_response/* sendResponse */.I)undefined`:loginXnext_app_loaderpage_2Fapi_2Fauth_2Flogin_2Froute_name_app_2Fapi_2Fauth_2Flogin_2Froute_pagePath_private_next_app_dir_2Fapi_2Fauth_2Flogin_2Froute_js_appDir_C_3A_5CUsers_5Cabd_b_5COneDrive_5CDesktop_5CCOSMIC_20AI_Risk_20Dashboard_5CStep_2012_20is_20complete_20Final_20QA_2C_20Demo_20Readiness_2C_20and_20Submission_20Freeze_5Capplication_5Csaas_app_5Csrc_5Capp_appPaths_2Fapi_2Fauth_2Flogin_2Froute_pageExtensions_tsx_pageExtensions_ts_pageExtensions_jsx_pageExtensions_js_basePath_assetPrefix_nextConfigOutput_standalone_preferredRegion_middlewareConfig_e30_3D_isGlobalNotFoundEnabled_namespaceObjectcqK webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ HomePage), dynamic: () => (/* binding */ dynamic) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5338); // EXTERNAL MODULE: ./src/services/auth-service.js var auth_service = __webpack_require__(8559); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/cookies.js var cookies = __webpack_require__(4230); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/headers.js var headers = __webpack_require__(4603); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/draft-mode.js var draft_mode = __webpack_require__(3535); ;// ./node_modules/next/dist/api/headers.js webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Vwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceexport * from '../server/request/cookies'; export * from '../server/request/headers'; export * from '../server/request/draft-mode'; //# sourceMappingURL=headers.js.map c)+TV@buffersourcesizemapshash' //# sourceMappingURL=headers.js.map {"finalSource":false}mapbufferedMap ReplaceSourceRawSourceexport * from '../server/request/cookies'; export * from '../server/request/headers'; export * from '../server/request/draft-mode'; //# sourceMappingURL=headers.js.map'041undefined4384undefined86130undefined| // EXTERNAL MODULE: ./src/components/LogoutButton.jsx var LogoutButton = __webpack_require__(4427); ;// ./src/app/page.jsx  $webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { getActorFromSession } from "../services/auth-service"; import { cookies } from "next/headers"; import LogoutButton from "../components/LogoutButton"; export const dynamic = 'force-dynamic'; export default async function HomePage() { const cookieStore = await cookies(); const token = cookieStore.get("cosmic_session")?.value; const actor = token ? await getActorFromSession(token) : null; return /*#__PURE__*/ _jsxs("main", { className: "shell", children: [ /*#__PURE__*/ _jsxs("header", { className: "topbar", children: [ /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx("div", { className: "brand", children: "COSMIC AI-Risk SaaS" }) }), /*#__PURE__*/ _jsx("nav", { className: "nav", "aria-label": "Main navigation", children: actor ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: actor.displayName }), /*#__PURE__*/ _jsx("a", { href: "/dashboard", children: "Dashboard" }), /*#__PURE__*/ _jsx(LogoutButton, { className: "logout-link", children: "Sign out" }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("a", { href: "/login", children: "Sign in" }), /*#__PURE__*/ _jsx("a", { href: "/signup", children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ _jsxs("section", { className: "hero", style: { textAlign: "center", padding: "80px 24px" }, children: [ /*#__PURE__*/ _jsx("h1", { style: { fontSize: 48, letterSpacing: "-0.05em", marginBottom: 16 }, children: "COSMIC AI-Risk SaaS" }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 20, maxWidth: 600, margin: "0 auto 32px" }, children: "Multi-tenant AI risk governance platform. Measure, mitigate, and govern AI project risks across your organization." }), /*#__PURE__*/ _jsx("div", { style: { display: "flex", gap: 12, justifyContent: "center" }, children: actor ? /*#__PURE__*/ _jsx("a", { href: "/dashboard", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Open dashboard" }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("a", { href: "/login", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Sign in" }), /*#__PURE__*/ _jsx("a", { href: "/signup", className: "button secondary", style: { padding: "12px 32px", fontSize: 16 }, children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ _jsx("section", { className: "content", children: /*#__PURE__*/ _jsxs("div", { className: "grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }, children: [ /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "Multi-tenant" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Organizations, workspaces, and role-based access control for enterprise teams." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "AI Risk Scoring" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "COSMIC risk engine with probability, impact, and detectability scoring across governance dimensions." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "Deployment Gates" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Nine-criteria gate evaluation with reviewer decisions and full audit trail." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "PM Integrations" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Trello, Jira, Asana, and Microsoft Planner sync with OAuth-ready live connectors." }) ] }) ] }) }) ] }); } c.UW_,gm dh_ 5 8   \X``dlo gktw__WEBPACK_MODULE_REFERENCE__5_5b22636f6f6b696573225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b226765744163746f7246726f6d53657373696f6e225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._* const dynamic = 'force-dynamic'; async function HomePage() { const cookieStore = await __WEBPACK_MODULE_REFERENCE__5_5b22636f6f6b696573225d_call_directImport_asiSafe1__._(); const token = cookieStore.get("cosmic_session")?.value; const actor = token ? await __WEBPACK_MODULE_REFERENCE__1_5b226765744163746f7246726f6d53657373696f6e225d_call_directImport_asiSafe1__._(token) : null; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("main", { className: "shell", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("header", { className: "topbar", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "brand", children: "COSMIC AI-Risk SaaS" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("nav", { className: "nav", "aria-label": "Main navigation", children: actor ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: actor.displayName }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/dashboard", children: "Dashboard" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._, { className: "logout-link", children: "Sign out" }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/login", children: "Sign in" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/signup", children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("section", { className: "hero", style: { textAlign: "center", padding: "80px 24px" }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h1", { style: { fontSize: 48, letterSpacing: "-0.05em", marginBottom: 16 }, children: "COSMIC AI-Risk SaaS" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", style: { fontSize: 20, maxWidth: 600, margin: "0 auto 32px" }, children: "Multi-tenant AI risk governance platform. Measure, mitigate, and govern AI project risks across your organization." }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { style: { display: "flex", gap: 12, justifyContent: "center" }, children: actor ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/dashboard", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Open dashboard" }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/login", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Sign in" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/signup", className: "button secondary", style: { padding: "12px 32px", fontSize: 16 }, children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("section", { className: "content", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "panel", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { children: "Multi-tenant" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", children: "Organizations, workspaces, and role-based access control for enterprise teams." }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "panel", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { children: "AI Risk Scoring" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", children: "COSMIC risk engine with probability, impact, and detectability scoring across governance dimensions." }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "panel", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { children: "Deployment Gates" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", children: "Nine-criteria gate evaluation with reviewer decisions and full audit trail." }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "panel", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { children: "PM Integrations" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", children: "Trello, Jira, Asana, and Microsoft Planner sync with OAuth-ready live connectors." }) ] }) ] }) }) ] }); }   import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { getActorFromSession } from "../services/auth-service"; import { cookies } from "next/headers"; import LogoutButton from "../components/LogoutButton"; export const dynamic = 'force-dynamic'; export default async function HomePage() { const cookieStore = await cookies(); const token = cookieStore.get("cosmic_session")?.value; const actor = token ? await getActorFromSession(token) : null; return /*#__PURE__*/ _jsxs("main", { className: "shell", children: [ /*#__PURE__*/ _jsxs("header", { className: "topbar", children: [ /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx("div", { className: "brand", children: "COSMIC AI-Risk SaaS" }) }), /*#__PURE__*/ _jsx("nav", { className: "nav", "aria-label": "Main navigation", children: actor ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: actor.displayName }), /*#__PURE__*/ _jsx("a", { href: "/dashboard", children: "Dashboard" }), /*#__PURE__*/ _jsx(LogoutButton, { className: "logout-link", children: "Sign out" }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("a", { href: "/login", children: "Sign in" }), /*#__PURE__*/ _jsx("a", { href: "/signup", children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ _jsxs("section", { className: "hero", style: { textAlign: "center", padding: "80px 24px" }, children: [ /*#__PURE__*/ _jsx("h1", { style: { fontSize: 48, letterSpacing: "-0.05em", marginBottom: 16 }, children: "COSMIC AI-Risk SaaS" }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 20, maxWidth: 600, margin: "0 auto 32px" }, children: "Multi-tenant AI risk governance platform. Measure, mitigate, and govern AI project risks across your organization." }), /*#__PURE__*/ _jsx("div", { style: { display: "flex", gap: 12, justifyContent: "center" }, children: actor ? /*#__PURE__*/ _jsx("a", { href: "/dashboard", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Open dashboard" }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("a", { href: "/login", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Sign in" }), /*#__PURE__*/ _jsx("a", { href: "/signup", className: "button secondary", style: { padding: "12px 32px", fontSize: 16 }, children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ _jsx("section", { className: "content", children: /*#__PURE__*/ _jsxs("div", { className: "grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }, children: [ /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "Multi-tenant" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Organizations, workspaces, and role-based access control for enterprise teams." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "AI Risk Scoring" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "COSMIC risk engine with probability, impact, and detectability scoring across governance dimensions." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "Deployment Gates" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Nine-criteria gate evaluation with reviewer decisions and full audit trail." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "PM Integrations" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Trello, Jira, Asana, and Microsoft Planner sync with OAuth-ready live connectors." }) ] }) ] }) }) ] }); } 085undefined87149undefined151189undefined191244undefined246252undefined286300undefined359365__WEBPACK_MODULE_REFERENCE__5_5b22636f6f6b696573225d_call_directImport_asiSafe1__._undefined462480__WEBPACK_MODULE_REFERENCE__1_5b226765744163746f7246726f6d53657373696f6e225d_call_directImport_asiSafe1__._undefined522526__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined612616__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined729732__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined791794__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9981001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined11671171__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined11731181__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined12721275__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined14891492__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined16971700__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined17021713__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined19451949__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined19511959__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined20502053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22522255__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined25552559__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined27972800__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31253128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined35853588__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined38503853__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined42324236__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined42384246__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined43374340__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48034806__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined53725375__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined54685472__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57285732__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined58775880__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined60336036__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined63596363__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined65086511__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined66676670__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined70157019__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71647167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73247327__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined76477651__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined77967799__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined79557958__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefineda(__|HO- X @ 8 I _ C5M A44[> ^!N!D""#3$$%%%5''(\((B)(0,cookies/* cookies */.U)(0,auth_service.getActorFromSession)(0,react_jsx_runtime.jsxs)(0,react_jsx_runtime.jsx)react_jsx_runtime.FragmentLogoutButton["default"]Q&// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ HomePage), dynamic: () => (/* binding */ dynamic) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5338); // EXTERNAL MODULE: ./src/services/auth-service.js var auth_service = __webpack_require__(8559); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/cookies.js var cookies = __webpack_require__(4230); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/headers.js var headers = __webpack_require__(4603); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/draft-mode.js var draft_mode = __webpack_require__(3535); ;// ./node_modules/next/dist/api/headers.js //# sourceMappingURL=headers.js.map // EXTERNAL MODULE: ./src/components/LogoutButton.jsx var LogoutButton = __webpack_require__(4427); ;// ./src/app/page.jsx const dynamic = 'force-dynamic'; async function HomePage() { const cookieStore = await (0,cookies/* cookies */.U)(); const token = cookieStore.get("cosmic_session")?.value; const actor = token ? await (0,auth_service.getActorFromSession)(token) : null; return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("main", { className: "shell", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("header", { className: "topbar", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "brand", children: "COSMIC AI-Risk SaaS" }) }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("nav", { className: "nav", "aria-label": "Main navigation", children: actor ? /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "muted", children: actor.displayName }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/dashboard", children: "Dashboard" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)(LogoutButton["default"], { className: "logout-link", children: "Sign out" }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/login", children: "Sign in" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/signup", children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("section", { className: "hero", style: { textAlign: "center", padding: "80px 24px" }, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h1", { style: { fontSize: 48, letterSpacing: "-0.05em", marginBottom: 16 }, children: "COSMIC AI-Risk SaaS" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", style: { fontSize: 20, maxWidth: 600, margin: "0 auto 32px" }, children: "Multi-tenant AI risk governance platform. Measure, mitigate, and govern AI project risks across your organization." }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { style: { display: "flex", gap: 12, justifyContent: "center" }, children: actor ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/dashboard", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Open dashboard" }) : /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/login", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Sign in" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/signup", className: "button secondary", style: { padding: "12px 32px", fontSize: 16 }, children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("section", { className: "content", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { children: "Multi-tenant" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", children: "Organizations, workspaces, and role-based access control for enterprise teams." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { children: "AI Risk Scoring" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", children: "COSMIC risk engine with probability, impact, and detectability scoring across governance dimensions." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { children: "Deployment Gates" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", children: "Nine-criteria gate evaluation with reviewer decisions and full audit trail." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { children: "PM Integrations" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", children: "Trello, Jira, Asana, and Microsoft Planner sync with OAuth-ready live connectors." }) ] }) ] }) }) ] }); } RU ` rV// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ HomePage), dynamic: () => (/* binding */ dynamic) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5338); // EXTERNAL MODULE: ./src/services/auth-service.js var auth_service = __webpack_require__(8559); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/cookies.js var cookies = __webpack_require__(4230); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/headers.js var headers = __webpack_require__(4603); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/draft-mode.js var draft_mode = __webpack_require__(3535); ;// ./node_modules/next/dist/api/headers.js sUexport * from '../server/request/cookies'; export * from '../server/request/headers'; export * from '../server/request/draft-mode'; //# sourceMappingURL=headers.js.map'041undefined4384undefined86130undefinedt| // EXTERNAL MODULE: ./src/components/LogoutButton.jsx var LogoutButton = __webpack_require__(4427); ;// ./src/app/page.jsx pR import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { getActorFromSession } from "../services/auth-service"; import { cookies } from "next/headers"; import LogoutButton from "../components/LogoutButton"; export const dynamic = 'force-dynamic'; export default async function HomePage() { const cookieStore = await cookies(); const token = cookieStore.get("cosmic_session")?.value; const actor = token ? await getActorFromSession(token) : null; return /*#__PURE__*/ _jsxs("main", { className: "shell", children: [ /*#__PURE__*/ _jsxs("header", { className: "topbar", children: [ /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx("div", { className: "brand", children: "COSMIC AI-Risk SaaS" }) }), /*#__PURE__*/ _jsx("nav", { className: "nav", "aria-label": "Main navigation", children: actor ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: actor.displayName }), /*#__PURE__*/ _jsx("a", { href: "/dashboard", children: "Dashboard" }), /*#__PURE__*/ _jsx(LogoutButton, { className: "logout-link", children: "Sign out" }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("a", { href: "/login", children: "Sign in" }), /*#__PURE__*/ _jsx("a", { href: "/signup", children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ _jsxs("section", { className: "hero", style: { textAlign: "center", padding: "80px 24px" }, children: [ /*#__PURE__*/ _jsx("h1", { style: { fontSize: 48, letterSpacing: "-0.05em", marginBottom: 16 }, children: "COSMIC AI-Risk SaaS" }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 20, maxWidth: 600, margin: "0 auto 32px" }, children: "Multi-tenant AI risk governance platform. Measure, mitigate, and govern AI project risks across your organization." }), /*#__PURE__*/ _jsx("div", { style: { display: "flex", gap: 12, justifyContent: "center" }, children: actor ? /*#__PURE__*/ _jsx("a", { href: "/dashboard", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Open dashboard" }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("a", { href: "/login", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Sign in" }), /*#__PURE__*/ _jsx("a", { href: "/signup", className: "button secondary", style: { padding: "12px 32px", fontSize: 16 }, children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ _jsx("section", { className: "content", children: /*#__PURE__*/ _jsxs("div", { className: "grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }, children: [ /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "Multi-tenant" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Organizations, workspaces, and role-based access control for enterprise teams." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "AI Risk Scoring" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "COSMIC risk engine with probability, impact, and detectability scoring across governance dimensions." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "Deployment Gates" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Nine-criteria gate evaluation with reviewer decisions and full audit trail." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "PM Integrations" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Trello, Jira, Asana, and Microsoft Planner sync with OAuth-ready live connectors." }) ] }) ] }) }) ] }); } 085undefined87149undefined151189undefined191244undefined246252undefined286300undefined359365__WEBPACK_MODULE_REFERENCE__5_5b22636f6f6b696573225d_call_directImport_asiSafe1__._undefined462480__WEBPACK_MODULE_REFERENCE__1_5b226765744163746f7246726f6d53657373696f6e225d_call_directImport_asiSafe1__._undefined522526__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined612616__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined729732__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined791794__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9981001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined11671171__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined11731181__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined12721275__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined14891492__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined16971700__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined17021713__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined19451949__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined19511959__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined20502053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22522255__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined25552559__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined27972800__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31253128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined35853588__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined38503853__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined42324236__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined42384246__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined43374340__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48034806__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined53725375__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined54685472__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57285732__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined58775880__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined60336036__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined63596363__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined65086511__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined66676670__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined70157019__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71647167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73247327__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined76477651__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined77967799__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined79557958__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined95177(0,cookies/* cookies */.U)undefined274380(0,auth_service.getActorFromSession)undefined422498(0,react_jsx_runtime.jsxs)undefined584660(0,react_jsx_runtime.jsxs)undefined773847(0,react_jsx_runtime.jsx)undefined906980(0,react_jsx_runtime.jsx)undefined11841258(0,react_jsx_runtime.jsx)undefined14241500(0,react_jsx_runtime.jsxs)undefined15021581react_jsx_runtime.Fragmentundefined16721746(0,react_jsx_runtime.jsx)undefined19602034(0,react_jsx_runtime.jsx)undefined22392313(0,react_jsx_runtime.jsx)undefined23152392LogoutButton["default"]undefined26242700(0,react_jsx_runtime.jsxs)undefined27022781react_jsx_runtime.Fragmentundefined28722946(0,react_jsx_runtime.jsx)undefined31453219(0,react_jsx_runtime.jsx)undefined35193595(0,react_jsx_runtime.jsxs)undefined38333907(0,react_jsx_runtime.jsx)undefined42324306(0,react_jsx_runtime.jsx)undefined47634837(0,react_jsx_runtime.jsx)undefined50995173(0,react_jsx_runtime.jsx)undefined55525628(0,react_jsx_runtime.jsxs)undefined56305709react_jsx_runtime.Fragmentundefined58005874(0,react_jsx_runtime.jsx)undefined63376411(0,react_jsx_runtime.jsx)undefined69777051(0,react_jsx_runtime.jsx)undefined71447220(0,react_jsx_runtime.jsxs)undefined74767552(0,react_jsx_runtime.jsxs)undefined76977771(0,react_jsx_runtime.jsx)undefined79247998(0,react_jsx_runtime.jsx)undefined83218397(0,react_jsx_runtime.jsxs)undefined85428616(0,react_jsx_runtime.jsx)undefined87728846(0,react_jsx_runtime.jsx)undefined91919267(0,react_jsx_runtime.jsxs)undefined94129486(0,react_jsx_runtime.jsx)undefined96439717(0,react_jsx_runtime.jsx)undefined1003710113(0,react_jsx_runtime.jsxs)undefined1025810332(0,react_jsx_runtime.jsx)undefined1048810562(0,react_jsx_runtime.jsx)undefinedu`react_jsx_runtimereact_jsx_runtime_namespaceObjectreact_jsx_runtime_defaultauth_serviceauth_service_namespaceObjectauth_service_defaultcookiescookies_namespaceObjectheadersheaders_namespaceObjectdraft_modedraft_mode_namespaceObjectapi_headers_namespaceObjectLogoutButtondynamicHomePagepage_namespaceObject@ %bwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`#webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourced(() => { var exports = {}; exports.id = 8887; exports.ids = [8887]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 2488:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcel"use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson }; ` buffersourcesizemapshash_ function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSourcel"use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson };  012undefined /***/ }) /***/ ((module) => { "use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson }; /***/ })  ReplaceSourceRawSourcel"use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson };  012undefined, /***/ 3033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ })  \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");, /***/ 3421:  (webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcevar __webpack_unused_export__; webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "sendResponse", { enumerable: true, get: function() { return sendResponse; } }); const _helpers = require("./base-http/helpers"); const _pipereadable = require("./pipe-readable"); const _utils = require("./web/utils"); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map h :NNQO"$4GMO[0R__webpack_unused_export__ = ()Object.defineProperty(exports, "I", ())__webpack_require__123750887679 truebuffersourcesizemapshash var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "I", ({ enumerable: true, get: function() { return sendResponse; } })); const _helpers = __webpack_require__(1237); const _pipereadable = __webpack_require__(5088); const _utils = __webpack_require__(7679); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. true && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSourcevar __webpack_unused_export__; ReplaceSourceRawSource "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "sendResponse", { enumerable: true, get: function() { return sendResponse; } }); const _helpers = require("./base-http/helpers"); const _pipereadable = require("./pipe-readable"); const _utils = require("./web/utils"); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map;012undefined1458__webpack_unused_export__ = (undefined7878)undefined81127Object.defineProperty(exports, "I", (undefined210210))undefined230236__webpack_require__undefined2382581237undefined284290__webpack_require__undefined2923085088undefined327333__webpack_require__undefined3353477679undefined560594 trueundefined /***/ }) . /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "I", ({ enumerable: true, get: function() { return sendResponse; } })); const _helpers = __webpack_require__(1237); const _pipereadable = __webpack_require__(5088); const _utils = __webpack_require__(7679); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. true && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map /***/ })   S/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__;  "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "sendResponse", { enumerable: true, get: function() { return sendResponse; } }); const _helpers = require("./base-http/helpers"); const _pipereadable = require("./pipe-readable"); const _utils = require("./web/utils"); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map;012undefined1458__webpack_unused_export__ = (undefined7878)undefined81127Object.defineProperty(exports, "I", (undefined210210))undefined230236__webpack_require__undefined2382581237undefined284290__webpack_require__undefined2923085088undefined327333__webpack_require__undefined3353477679undefined560594 trueundefined, /***/ 4870:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Umodule.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js"); /***/ })  Umodule.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");, /***/ 5511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ })  #module.exports = require("crypto");, /***/ 5736:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource }webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceR"use strict"; if (process.env.NEXT_RUNTIME === 'edge') { module.exports = require('next/dist/server/route-modules/app-route/module.js'); } else { if (process.env.__NEXT_EXPERIMENTAL_REACT) { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js'); } } } else { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js'); } } } } //# sourceMappingURL=module.compiled.js.map  c 47Nfalse{}module.exports = __webpack_require__(4870)buffersourcesizemapshash if (false) {} else { if (false) {} else { if (false) {} else { if (false) {} else { module.exports = __webpack_require__(4870); } } } } //# sourceMappingURL=module.compiled.js.map {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceR"use strict"; if (process.env.NEXT_RUNTIME === 'edge') { module.exports = require('next/dist/server/route-modules/app-route/module.js'); } else { if (process.env.__NEXT_EXPERIMENTAL_REACT) { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js'); } } } else { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js'); } } } } //# sourceMappingURL=module.compiled.js.map012undefined1852falseundefined55141{}undefined158194falseundefined197906{}undefined927964falseundefined9671261{}undefined12861306falseundefined13091431{}undefined14561539module.exports = __webpack_require__(4870)undefined /***/ }) R/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (false) {} else { if (false) {} else { if (false) {} else { if (false) {} else { module.exports = __webpack_require__(4870); } } } } //# sourceMappingURL=module.compiled.js.map /***/ })  S/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; R"use strict"; if (process.env.NEXT_RUNTIME === 'edge') { module.exports = require('next/dist/server/route-modules/app-route/module.js'); } else { if (process.env.__NEXT_EXPERIMENTAL_REACT) { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js'); } } } else { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js'); } } } } //# sourceMappingURL=module.compiled.js.map012undefined1852falseundefined55141{}undefined158194falseundefined197906{}undefined927964falseundefined9671261{}undefined12861306falseundefined13091431{}undefined14561539module.exports = __webpack_require__(4870)undefined, /***/ 5741:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource nwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource1 // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/signup/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/signup/route.js webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceconst { signup } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse, parseJson } = require("../../../../lib/http"); export async function POST(request) { try { const body = await parseJson(request); const { user, session } = await signup(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 201, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } f=tz|F__webpack_require__85592488 true0buffersourcesizemapshashYconst { signup } = __webpack_require__(8559); const { jsonResponse, errorResponse, parseJson } = __webpack_require__(2488); async function POST(request) { try { const body = await parseJson(request); const { user, session } = await signup(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 201, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${ true ? 'Secure; ' : 0}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } {"finalSource":false}mapbufferedMap ReplaceSourceRawSourceconst { signup } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse, parseJson } = require("../../../../lib/http"); export async function POST(request) { try { const body = await parseJson(request); const { user, session } = await signup(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 201, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } 1925__webpack_require__undefined27618559undefined116122__webpack_require__undefined1241452488undefined149155undefined677705 trueundefined7227230undefined ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsignup%2Froute&name=app%2Fapi%2Fauth%2Fsignup%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsignup%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsignup%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=!  Hwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource=import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/signup/route", pathname: "/api/auth/signup", filename: "route", bundlePath: "app/api/auth/signup/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/signup/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map c;^`_%'np "_abdm_e  T  B :BL_Z~n{MZ$%p%%&&''((*+--f/n/11t33(5RB5q5~5557)7f7q7]9j999::;;'=2=__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._".next"0 false: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._false{}__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__.__A // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new __WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._({ definition: { kind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, page: "/api/auth/signup/route", pathname: "/api/auth/signup", filename: "route", bundlePath: "app/api/auth/signup/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js", nextConfigOutput, userland: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._ }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return __WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/signup/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = __WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = __WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: __WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._(req); const nodeNextRes = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._(res); const nextReq = __WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._.fromNodeNextRequest(nodeNextReq, __WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== __WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = __WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(response.headers); if (cacheTags) { headers[__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = __WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(cacheEntry.value.headers); if (!(__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isIsr)) { headers.delete(__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', __WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._(cacheEntry.cacheControl)); } await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest, { spanName: `${method} ${req.url}`, kind: __WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map  =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/signup/route", pathname: "/api/auth/signup", filename: "route", bundlePath: "app/api/auth/signup/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/signup/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741494undefined16451663__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined16991707__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18931928".next"undefined193319340undefined19611999 falseundefined22602259: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25652575__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26442733undefined27352741undefined30513071falseundefined30743138{}undefined32843323falseundefined38493864__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43224336__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51785186__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56035616__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62206234__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62706285__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63136330__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63656386__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70227035__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80138026__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94629486__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95849605__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99579970__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1016010173__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1041310427__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1099911010__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1167911697__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1213412142__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1269212706__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1317213185__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1360813634__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1368113694__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1376013781__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1410114121__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1418214193__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1468514698__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1479714804__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1506015074__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1529515313__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1565515666__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined`"_ /s_= k i j#G@,zLH""!##_$I%&c&S'')=*,D-.=/c1133567666E788199z;;+<m<m==C>?h@@module_compiled.AppRouteRouteModuleroute_kind.RouteKindroute_namespaceObject(0,patch_fetch.patchFetch)(0,app_paths_.normalizeAppPath)no_fallback_error_external_.NoFallbackError(0,trace_tracer.getTracer)(0,request_meta.getRequestMeta)node.NodeNextRequestnode.NodeNextResponsenext_request.NextRequestAdapter(0,next_request.signalFromNodeResponse)constants.BaseServerSpan(0,web_utils.toNodeOutgoingHttpHeaders)lib_constants.NEXT_CACHE_TAGS_HEADERlib_constants.INFINITE_CACHEresponse_cache.CachedRouteKind(0,send_response/* sendResponse */.I)(0,utils/* getRevalidateReason */.c)(0,web_utils.fromNodeOutgoingHttpHeaders)(0,cache_control.getCacheControlHeader)trace_tracer.SpanKindbuffersourcesizemapshash1I// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/signup/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/signup/route.js const { signup } = __webpack_require__(8559); const { jsonResponse, errorResponse, parseJson } = __webpack_require__(2488); async function POST(request) { try { const body = await parseJson(request); const { user, session } = await signup(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 201, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${ true ? 'Secure; ' : 0}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsignup%2Froute&name=app%2Fapi%2Fauth%2Fsignup%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsignup%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsignup%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/signup/route", pathname: "/api/auth/signup", filename: "route", bundlePath: "app/api/auth/signup/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/signup/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map {"finalSource":true}mapbufferedMap ` ConcatSourceRawSource1 // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/signup/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/signup/route.js  ReplaceSourceReplaceSourceRawSourceconst { signup } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse, parseJson } = require("../../../../lib/http"); export async function POST(request) { try { const body = await parseJson(request); const { user, session } = await signup(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 201, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } 1925__webpack_require__undefined27618559undefined116122__webpack_require__undefined1241452488undefined149155undefined677705 trueundefined7227230undefined RawSource ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsignup%2Froute&name=app%2Fapi%2Fauth%2Fsignup%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsignup%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsignup%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/signup/route", pathname: "/api/auth/signup", filename: "route", bundlePath: "app/api/auth/signup/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/signup/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741494undefined16451663__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined16991707__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18931928".next"undefined193319340undefined19611999 falseundefined22602259: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25652575__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26442733undefined27352741undefined30513071falseundefined30743138{}undefined32843323falseundefined38493864__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43224336__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51785186__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56035616__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62206234__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62706285__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63136330__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63656386__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70227035__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80138026__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94629486__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95849605__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99579970__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1016010173__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1041310427__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1099911010__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1167911697__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1213412142__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1269212706__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1317213185__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1360813634__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1368113694__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1376013781__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1410114121__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1418214193__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1468514698__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1479714804__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1506015074__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1529515313__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1565515666__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined166267module_compiled.AppRouteRouteModuleundefined303371route_kind.RouteKindundefined863908route_namespaceObjectundefined12141302(0,patch_fetch.patchFetch)undefined23652465(0,app_paths_.normalizeAppPath)undefined29233017no_fallback_error_external_.NoFallbackErrorundefined38593945(0,trace_tracer.getTracer)undefined43624458(0,request_meta.getRequestMeta)undefined50625155node.NodeNextRequestundefined51915286node.NodeNextResponseundefined53145405next_request.NextRequestAdapterundefined54405552(0,next_request.signalFromNodeResponse)undefined61886266constants.BaseServerSpanundefined72447340(0,request_meta.getRequestMeta)undefined87768895(0,web_utils.toNodeOutgoingHttpHeaders)undefined89939101lib_constants.NEXT_CACHE_TAGS_HEADERundefined94539545lib_constants.INFINITE_CACHEundefined97359827lib_constants.INFINITE_CACHEundefined1006710148response_cache.CachedRouteKindundefined1072010813(0,send_response/* sendResponse */.I)undefined1148211588(0,utils/* getRevalidateReason */.c)undefined1202512093route_kind.RouteKindundefined1264312724response_cache.CachedRouteKindundefined1319013286(0,request_meta.getRequestMeta)undefined1370913832(0,web_utils.fromNodeOutgoingHttpHeaders)undefined1387913975(0,request_meta.getRequestMeta)undefined1404114149lib_constants.NEXT_CACHE_TAGS_HEADERundefined1446914580(0,cache_control.getCacheControlHeader)undefined1464114734(0,send_response/* sendResponse */.I)undefined1522615304constants.BaseServerSpanundefined1540315469trace_tracer.SpanKindundefined1572515819no_fallback_error_external_.NoFallbackErrorundefined1604016146(0,utils/* getRevalidateReason */.c)undefined1648816581(0,send_response/* sendResponse */.I)undefined /***/ }) I/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/signup/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/signup/route.js const { signup } = __webpack_require__(8559); const { jsonResponse, errorResponse, parseJson } = __webpack_require__(2488); async function POST(request) { try { const body = await parseJson(request); const { user, session } = await signup(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 201, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${ true ? 'Secure; ' : 0}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsignup%2Froute&name=app%2Fapi%2Fauth%2Fsignup%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsignup%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsignup%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/signup/route", pathname: "/api/auth/signup", filename: "route", bundlePath: "app/api/auth/signup/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/signup/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map /***/ })  `_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; 1 // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/signup/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/signup/route.js  ReplaceSourceconst { signup } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse, parseJson } = require("../../../../lib/http"); export async function POST(request) { try { const body = await parseJson(request); const { user, session } = await signup(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 201, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } 1925__webpack_require__undefined27618559undefined116122__webpack_require__undefined1241452488undefined149155undefined677705 trueundefined7227230undefined ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsignup%2Froute&name=app%2Fapi%2Fauth%2Fsignup%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsignup%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsignup%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/signup/route", pathname: "/api/auth/signup", filename: "route", bundlePath: "app/api/auth/signup/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/signup/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741494undefined16451663__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined16991707__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18931928".next"undefined193319340undefined19611999 falseundefined22602259: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25652575__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26442733undefined27352741undefined30513071falseundefined30743138{}undefined32843323falseundefined38493864__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43224336__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51785186__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56035616__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62206234__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62706285__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63136330__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63656386__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70227035__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80138026__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94629486__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95849605__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99579970__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1016010173__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1041310427__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1099911010__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1167911697__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1213412142__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1269212706__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1317213185__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1360813634__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1368113694__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1376013781__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1410114121__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1418214193__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1468514698__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1479714804__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1506015074__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1529515313__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1565515666__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined166267module_compiled.AppRouteRouteModuleundefined303371route_kind.RouteKindundefined863908route_namespaceObjectundefined12141302(0,patch_fetch.patchFetch)undefined23652465(0,app_paths_.normalizeAppPath)undefined29233017no_fallback_error_external_.NoFallbackErrorundefined38593945(0,trace_tracer.getTracer)undefined43624458(0,request_meta.getRequestMeta)undefined50625155node.NodeNextRequestundefined51915286node.NodeNextResponseundefined53145405next_request.NextRequestAdapterundefined54405552(0,next_request.signalFromNodeResponse)undefined61886266constants.BaseServerSpanundefined72447340(0,request_meta.getRequestMeta)undefined87768895(0,web_utils.toNodeOutgoingHttpHeaders)undefined89939101lib_constants.NEXT_CACHE_TAGS_HEADERundefined94539545lib_constants.INFINITE_CACHEundefined97359827lib_constants.INFINITE_CACHEundefined1006710148response_cache.CachedRouteKindundefined1072010813(0,send_response/* sendResponse */.I)undefined1148211588(0,utils/* getRevalidateReason */.c)undefined1202512093route_kind.RouteKindundefined1264312724response_cache.CachedRouteKindundefined1319013286(0,request_meta.getRequestMeta)undefined1370913832(0,web_utils.fromNodeOutgoingHttpHeaders)undefined1387913975(0,request_meta.getRequestMeta)undefined1404114149lib_constants.NEXT_CACHE_TAGS_HEADERundefined1446914580(0,cache_control.getCacheControlHeader)undefined1464114734(0,send_response/* sendResponse */.I)undefined1522615304constants.BaseServerSpanundefined1540315469trace_tracer.SpanKindundefined1572515819no_fallback_error_external_.NoFallbackErrorundefined1604016146(0,utils/* getRevalidateReason */.c)undefined1648816581(0,send_response/* sendResponse */.I)undefined, /***/ 6330:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; +module.exports = require("@prisma/client");  /***/ }) Y/***/ ((module) => { "use strict"; module.exports = require("@prisma/client"); /***/ })  +module.exports = require("@prisma/client");, /***/ 6439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ }) z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ })  Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");, /***/ 6487:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/***/ (() => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource buffersourcesizemapshash {"finalSource":true}mapbufferedMap ReplaceSourceRawSource /***/ }) /***/ (() => { /***/ })  /***/ (() => { , /***/ 7964:  -webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; d '-/>C__webpack_require__6330false{}buffersourcesizemapshash const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSource "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; b012undefined3945__webpack_require__undefined47626330undefined175203falseundefined206253{}undefined /***/ }) {*/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; /***/ }) | S/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict";  "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; b012undefined3945__webpack_require__undefined47626330undefined175203falseundefined206253{}undefined, /***/ 8335:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/***/ (() => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource buffersourcesizemapshash {"finalSource":true}mapbufferedMap ReplaceSourceRawSource /***/ }) p ru vxz, /***/ 8559:  Hwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; k !')7SY[bu{}@__webpack_require__796455117082buffersourcesizemapshash( const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSource&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; 012undefined3339__webpack_require__undefined41557964undefined8389__webpack_require__undefined91985511undefined117123__webpack_require__undefined1251347082undefined /***/ }) i/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; /***/ }) jm n&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; 012undefined3339__webpack_require__undefined41557964undefined8389__webpack_require__undefined91985511undefined117123__webpack_require__undefined1251347082undefinednp, /***/ 9294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) _/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ }) `c defWmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");eg} }; ; // load runtime var __webpack_require__ = require("../../../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082], () => (__webpack_exec__(5741))); ,module.exports = __webpack_exports__; })(); .x(() => { var exports = {}; exports.id = 8887; exports.ids = [8887]; exports.modules = { /***/ 261: /***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 846: /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ }), /***/ 2488: /***/ ((module) => { "use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson }; /***/ }), /***/ 3033: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }), /***/ 3421: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "I", ({ enumerable: true, get: function() { return sendResponse; } })); const _helpers = __webpack_require__(1237); const _pipereadable = __webpack_require__(5088); const _utils = __webpack_require__(7679); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. true && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map /***/ }), /***/ 4870: /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js"); /***/ }), /***/ 5511: /***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }), /***/ 5736: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (false) {} else { if (false) {} else { if (false) {} else { if (false) {} else { module.exports = __webpack_require__(4870); } } } } //# sourceMappingURL=module.compiled.js.map /***/ }), /***/ 5741: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/signup/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/signup/route.js const { signup } = __webpack_require__(8559); const { jsonResponse, errorResponse, parseJson } = __webpack_require__(2488); async function POST(request) { try { const body = await parseJson(request); const { user, session } = await signup(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 201, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${ true ? 'Secure; ' : 0}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsignup%2Froute&name=app%2Fapi%2Fauth%2Fsignup%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsignup%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsignup%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/signup/route", pathname: "/api/auth/signup", filename: "route", bundlePath: "app/api/auth/signup/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/signup/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map /***/ }), /***/ 6330: /***/ ((module) => { "use strict"; module.exports = require("@prisma/client"); /***/ }), /***/ 6439: /***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ }), /***/ 6487: /***/ (() => { /***/ }), /***/ 7964: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; /***/ }), /***/ 8335: /***/ (() => { /***/ }), /***/ 8559: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; /***/ }), /***/ 9294: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ }) }; ; // load runtime var __webpack_require__ = require("../../../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082], () => (__webpack_exec__(5741))); module.exports = __webpack_exports__; })(); {}1 @Nd(() => { var exports = {}; exports.id = 8887; exports.ids = [8887]; exports.modules = { /***/ 261: M$/***/ ((module) => { "use strict"; QHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");P /***/ })O, /***/ 846: INTmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");MM, /***/ 2488: G+l"use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson };  012undefinedJJ, /***/ 3033: DI\module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");HH, /***/ 3421: BS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Avar __webpack_unused_export__; $ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "sendResponse", { enumerable: true, get: function() { return sendResponse; } }); const _helpers = require("./base-http/helpers"); const _pipereadable = require("./pipe-readable"); const _utils = require("./web/utils"); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map;012undefined1458__webpack_unused_export__ = (undefined7878)undefined81127Object.defineProperty(exports, "I", (undefined210210))undefined230236__webpack_require__undefined2382581237undefined284290__webpack_require__undefined2923085088undefined327333__webpack_require__undefined3353477679undefined560594 trueundefinedCC, /***/ 4870: =BUmodule.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");AA, /***/ 5511: ;@#module.exports = require("crypto");??, /***/ 5736: 9S/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; R"use strict"; if (process.env.NEXT_RUNTIME === 'edge') { module.exports = require('next/dist/server/route-modules/app-route/module.js'); } else { if (process.env.__NEXT_EXPERIMENTAL_REACT) { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js'); } } } else { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js'); } } } } //# sourceMappingURL=module.compiled.js.map012undefined1852falseundefined55141{}undefined158194falseundefined197906{}undefined927964falseundefined9671261{}undefined12861306falseundefined13091431{}undefined14561539module.exports = __webpack_require__(4870)undefined;;, /***/ 5741: 5_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; 456789:6;<=99, /***/ 6330: 38+module.exports = require("@prisma/client");77, /***/ 6439: 16Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");55, /***/ 6487: //***/ (() => { 22, /***/ 7964: ,S/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict";  "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; b012undefined3945__webpack_require__undefined47626330undefined175203falseundefined206253{}undefined.., /***/ 8335: ( --, /***/ 8559: ' ,,, /***/ 9294: &+Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");**} }; ; // load runtime var __webpack_require__ = require("../../../../webpack-runtime.js"); __webpack_require__.C(exports); )var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082], () => (__webpack_exec__(5741))); (,module.exports = __webpack_exports__; })();  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`%webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourced(() => { var exports = {}; exports.id = 4310; exports.ids = [4310]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 2842:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/sso/callback/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { GET: () => (GET) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/sso/callback/route.js webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource const { handleSsoCallback } = require("../../../../../services/sso-service"); const { getOidcConfig, stateCookieName } = require("../../../../../lib/oidc"); const SESSION_MAX_AGE = 60 * 60 * 24 * 7; function getCookie(name, header) { const match = header?.match(new RegExp(`(?:^|;)\\s*${name}=([^;]+)`)); return match ? decodeURIComponent(match[1]) : null; } function setCookie(name, value, maxAge) { return `${name}=${value}; HttpOnly; ${"production" === "production" ? "Secure; " : ""}SameSite=Lax; Path=/; Max-Age=${maxAge}`; } export async function GET(request) { try { const { searchParams } = new URL(request.url); const code = searchParams.get("code"); const returnedState = searchParams.get("state"); const error = searchParams.get("error"); if (error) { return new Response(JSON.stringify({ error: `SSO provider returned: ${error}` }), { status: 400, headers: { "Content-Type": "application/json" } }); } if (!code) { return new Response(JSON.stringify({ error: "Missing authorization code" }), { status: 400, headers: { "Content-Type": "application/json" } }); } const cookieHeader = request.headers.get("cookie") || ""; const storedState = getCookie(stateCookieName(), cookieHeader); if (returnedState && storedState && returnedState !== storedState) { return new Response(JSON.stringify({ error: "State mismatch — possible CSRF" }), { status: 403, headers: { "Content-Type": "application/json" } }); } const { session } = await handleSsoCallback(code); const stateClear = `${stateCookieName()}=; HttpOnly; SameSite=Lax; Path=/; Max-Age=0`; const sessionCookie = setCookie("cosmic_session", session.token, SESSION_MAX_AGE); const config = getOidcConfig(); const baseUrl = config?.redirectUrl ? new URL(config.redirectUrl).origin : process.env.NEXT_PUBLIC_APP_URL || "http://localhost:8090"; return new Response(null, { status: 302, headers: { Location: `${baseUrl}/dashboard`, "Set-Cookie": `${sessionCookie}, ${stateClear}`, "Cache-Control": "no-store" } }); } catch (error) { const msg = error.message || "SSO callback failed"; const status = error.status || 500; return new Response(`

SSO Error

${msg}

Back to login`, { status, headers: { "Content-Type": "text/html" } }); } }  e$&JyK% __webpack_require__99705617 true0"http://localhost:8090"0buffersourcesizemapshash1 const { handleSsoCallback } = __webpack_require__(9970); const { getOidcConfig, stateCookieName } = __webpack_require__(5617); const SESSION_MAX_AGE = 60 * 60 * 24 * 7; function getCookie(name, header) { const match = header?.match(new RegExp(`(?:^|;)\\s*${name}=([^;]+)`)); return match ? decodeURIComponent(match[1]) : null; } function setCookie(name, value, maxAge) { return `${name}=${value}; HttpOnly; ${ true ? "Secure; " : 0}SameSite=Lax; Path=/; Max-Age=${maxAge}`; } async function GET(request) { try { const { searchParams } = new URL(request.url); const code = searchParams.get("code"); const returnedState = searchParams.get("state"); const error = searchParams.get("error"); if (error) { return new Response(JSON.stringify({ error: `SSO provider returned: ${error}` }), { status: 400, headers: { "Content-Type": "application/json" } }); } if (!code) { return new Response(JSON.stringify({ error: "Missing authorization code" }), { status: 400, headers: { "Content-Type": "application/json" } }); } const cookieHeader = request.headers.get("cookie") || ""; const storedState = getCookie(stateCookieName(), cookieHeader); if (returnedState && storedState && returnedState !== storedState) { return new Response(JSON.stringify({ error: "State mismatch — possible CSRF" }), { status: 403, headers: { "Content-Type": "application/json" } }); } const { session } = await handleSsoCallback(code); const stateClear = `${stateCookieName()}=; HttpOnly; SameSite=Lax; Path=/; Max-Age=0`; const sessionCookie = setCookie("cosmic_session", session.token, SESSION_MAX_AGE); const config = getOidcConfig(); const baseUrl = config?.redirectUrl ? new URL(config.redirectUrl).origin : "http://localhost:8090" || 0; return new Response(null, { status: 302, headers: { Location: `${baseUrl}/dashboard`, "Set-Cookie": `${sessionCookie}, ${stateClear}`, "Cache-Control": "no-store" } }); } catch (error) { const msg = error.message || "SSO callback failed"; const status = error.status || 500; return new Response(`

SSO Error

${msg}

Back to login`, { status, headers: { "Content-Type": "text/html" } }); } } {"finalSource":false}mapbufferedMap ReplaceSourceRawSource const { handleSsoCallback } = require("../../../../../services/sso-service"); const { getOidcConfig, stateCookieName } = require("../../../../../lib/oidc"); const SESSION_MAX_AGE = 60 * 60 * 24 * 7; function getCookie(name, header) { const match = header?.match(new RegExp(`(?:^|;)\\s*${name}=([^;]+)`)); return match ? decodeURIComponent(match[1]) : null; } function setCookie(name, value, maxAge) { return `${name}=${value}; HttpOnly; ${"production" === "production" ? "Secure; " : ""}SameSite=Lax; Path=/; Max-Age=${maxAge}`; } export async function GET(request) { try { const { searchParams } = new URL(request.url); const code = searchParams.get("code"); const returnedState = searchParams.get("state"); const error = searchParams.get("error"); if (error) { return new Response(JSON.stringify({ error: `SSO provider returned: ${error}` }), { status: 400, headers: { "Content-Type": "application/json" } }); } if (!code) { return new Response(JSON.stringify({ error: "Missing authorization code" }), { status: 400, headers: { "Content-Type": "application/json" } }); } const cookieHeader = request.headers.get("cookie") || ""; const storedState = getCookie(stateCookieName(), cookieHeader); if (returnedState && storedState && returnedState !== storedState) { return new Response(JSON.stringify({ error: "State mismatch — possible CSRF" }), { status: 403, headers: { "Content-Type": "application/json" } }); } const { session } = await handleSsoCallback(code); const stateClear = `${stateCookieName()}=; HttpOnly; SameSite=Lax; Path=/; Max-Age=0`; const sessionCookie = setCookie("cosmic_session", session.token, SESSION_MAX_AGE); const config = getOidcConfig(); const baseUrl = config?.redirectUrl ? new URL(config.redirectUrl).origin : process.env.NEXT_PUBLIC_APP_URL || "http://localhost:8090"; return new Response(null, { status: 302, headers: { Location: `${baseUrl}/dashboard`, "Set-Cookie": `${sessionCookie}, ${stateClear}`, "Cache-Control": "no-store" } }); } catch (error) { const msg = error.message || "SSO callback failed"; const status = error.status || 500; return new Response(`

SSO Error

${msg}

Back to login`, { status, headers: { "Content-Type": "text/html" } }); } } 3036__webpack_require__undefined38749970undefined121127__webpack_require__undefined1291535617undefined451479 trueundefined4964970undefined543549undefined22542284"http://localhost:8090"undefined228923110undefined ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&name=app%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=!  Iwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource=import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\sso\\callback\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/sso/callback/route", pathname: "/api/auth/sso/callback", filename: "route", bundlePath: "app/api/auth/sso/callback/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\sso\\callback\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/sso/callback/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map c;^`_%'np "_abdt_~% / t  % ( h ! />`h r_s%4%%% ''''((+(+--//1133N5Rh55555;7O7779999:;;;M=X=__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._".next"0 false: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._false{}__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._~A // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new __WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._({ definition: { kind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, page: "/api/auth/sso/callback/route", pathname: "/api/auth/sso/callback", filename: "route", bundlePath: "app/api/auth/sso/callback/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\sso\\callback\\route.js", nextConfigOutput, userland: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._ }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return __WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/sso/callback/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = __WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = __WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: __WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._(req); const nodeNextRes = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._(res); const nextReq = __WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._.fromNodeNextRequest(nodeNextReq, __WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== __WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = __WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(response.headers); if (cacheTags) { headers[__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = __WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(cacheEntry.value.headers); if (!(__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isIsr)) { headers.delete(__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', __WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._(cacheEntry.cacheControl)); } await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest, { spanName: `${method} ${req.url}`, kind: __WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map  =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\sso\\callback\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/sso/callback/route", pathname: "/api/auth/sso/callback", filename: "route", bundlePath: "app/api/auth/sso/callback/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\sso\\callback\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/sso/callback/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map z094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741501undefined16521670__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined17061714__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined19181953".next"undefined195819590undefined19862024 falseundefined22922291: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25972607__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26762765undefined27672773undefined30893109falseundefined31123176{}undefined33223361falseundefined38873902__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43604374__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined52165224__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56415654__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62586272__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined63086323__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63516368__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined64036424__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70607073__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80518064__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined95009524__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined96229643__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined999510008__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1019810211__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1045110465__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1103711048__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1171711735__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1217212180__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1273012744__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1321013223__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1364613672__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1371913732__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1379813819__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1413914159__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1422014231__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1472314736__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1483514842__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1509815112__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1533315351__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1569315704__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined`"_ /sx/\ 2)Bf<_Kkg""@##_ %h%&&&r'')\*,c-/\/11345'6V666d789P99;;J<<==C>1?@@module_compiled.AppRouteRouteModuleroute_kind.RouteKindroute_namespaceObject(0,patch_fetch.patchFetch)(0,app_paths_.normalizeAppPath)no_fallback_error_external_.NoFallbackError(0,trace_tracer.getTracer)(0,request_meta.getRequestMeta)node.NodeNextRequestnode.NodeNextResponsenext_request.NextRequestAdapter(0,next_request.signalFromNodeResponse)constants.BaseServerSpan(0,web_utils.toNodeOutgoingHttpHeaders)lib_constants.NEXT_CACHE_TAGS_HEADERlib_constants.INFINITE_CACHEresponse_cache.CachedRouteKind(0,send_response/* sendResponse */.I)(0,utils/* getRevalidateReason */.c)(0,web_utils.fromNodeOutgoingHttpHeaders)(0,cache_control.getCacheControlHeader)trace_tracer.SpanKindbuffersourcesizemapshashRQ// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/sso/callback/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { GET: () => (GET) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/sso/callback/route.js const { handleSsoCallback } = __webpack_require__(9970); const { getOidcConfig, stateCookieName } = __webpack_require__(5617); const SESSION_MAX_AGE = 60 * 60 * 24 * 7; function getCookie(name, header) { const match = header?.match(new RegExp(`(?:^|;)\\s*${name}=([^;]+)`)); return match ? decodeURIComponent(match[1]) : null; } function setCookie(name, value, maxAge) { return `${name}=${value}; HttpOnly; ${ true ? "Secure; " : 0}SameSite=Lax; Path=/; Max-Age=${maxAge}`; } async function GET(request) { try { const { searchParams } = new URL(request.url); const code = searchParams.get("code"); const returnedState = searchParams.get("state"); const error = searchParams.get("error"); if (error) { return new Response(JSON.stringify({ error: `SSO provider returned: ${error}` }), { status: 400, headers: { "Content-Type": "application/json" } }); } if (!code) { return new Response(JSON.stringify({ error: "Missing authorization code" }), { status: 400, headers: { "Content-Type": "application/json" } }); } const cookieHeader = request.headers.get("cookie") || ""; const storedState = getCookie(stateCookieName(), cookieHeader); if (returnedState && storedState && returnedState !== storedState) { return new Response(JSON.stringify({ error: "State mismatch — possible CSRF" }), { status: 403, headers: { "Content-Type": "application/json" } }); } const { session } = await handleSsoCallback(code); const stateClear = `${stateCookieName()}=; HttpOnly; SameSite=Lax; Path=/; Max-Age=0`; const sessionCookie = setCookie("cosmic_session", session.token, SESSION_MAX_AGE); const config = getOidcConfig(); const baseUrl = config?.redirectUrl ? new URL(config.redirectUrl).origin : "http://localhost:8090" || 0; return new Response(null, { status: 302, headers: { Location: `${baseUrl}/dashboard`, "Set-Cookie": `${sessionCookie}, ${stateClear}`, "Cache-Control": "no-store" } }); } catch (error) { const msg = error.message || "SSO callback failed"; const status = error.status || 500; return new Response(`

SSO Error

${msg}

Back to login`, { status, headers: { "Content-Type": "text/html" } }); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&name=app%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/sso/callback/route", pathname: "/api/auth/sso/callback", filename: "route", bundlePath: "app/api/auth/sso/callback/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\sso\\callback\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/sso/callback/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map {"finalSource":true}mapbufferedMap ` ConcatSourceRawSource; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/sso/callback/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { GET: () => (GET) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/sso/callback/route.js  ReplaceSourceReplaceSourceRawSource const { handleSsoCallback } = require("../../../../../services/sso-service"); const { getOidcConfig, stateCookieName } = require("../../../../../lib/oidc"); const SESSION_MAX_AGE = 60 * 60 * 24 * 7; function getCookie(name, header) { const match = header?.match(new RegExp(`(?:^|;)\\s*${name}=([^;]+)`)); return match ? decodeURIComponent(match[1]) : null; } function setCookie(name, value, maxAge) { return `${name}=${value}; HttpOnly; ${"production" === "production" ? "Secure; " : ""}SameSite=Lax; Path=/; Max-Age=${maxAge}`; } export async function GET(request) { try { const { searchParams } = new URL(request.url); const code = searchParams.get("code"); const returnedState = searchParams.get("state"); const error = searchParams.get("error"); if (error) { return new Response(JSON.stringify({ error: `SSO provider returned: ${error}` }), { status: 400, headers: { "Content-Type": "application/json" } }); } if (!code) { return new Response(JSON.stringify({ error: "Missing authorization code" }), { status: 400, headers: { "Content-Type": "application/json" } }); } const cookieHeader = request.headers.get("cookie") || ""; const storedState = getCookie(stateCookieName(), cookieHeader); if (returnedState && storedState && returnedState !== storedState) { return new Response(JSON.stringify({ error: "State mismatch — possible CSRF" }), { status: 403, headers: { "Content-Type": "application/json" } }); } const { session } = await handleSsoCallback(code); const stateClear = `${stateCookieName()}=; HttpOnly; SameSite=Lax; Path=/; Max-Age=0`; const sessionCookie = setCookie("cosmic_session", session.token, SESSION_MAX_AGE); const config = getOidcConfig(); const baseUrl = config?.redirectUrl ? new URL(config.redirectUrl).origin : process.env.NEXT_PUBLIC_APP_URL || "http://localhost:8090"; return new Response(null, { status: 302, headers: { Location: `${baseUrl}/dashboard`, "Set-Cookie": `${sessionCookie}, ${stateClear}`, "Cache-Control": "no-store" } }); } catch (error) { const msg = error.message || "SSO callback failed"; const status = error.status || 500; return new Response(`

SSO Error

${msg}

Back to login`, { status, headers: { "Content-Type": "text/html" } }); } } 3036__webpack_require__undefined38749970undefined121127__webpack_require__undefined1291535617undefined451479 trueundefined4964970undefined543549undefined22542284"http://localhost:8090"undefined228923110undefined RawSource ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&name=app%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\sso\\callback\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/sso/callback/route", pathname: "/api/auth/sso/callback", filename: "route", bundlePath: "app/api/auth/sso/callback/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\sso\\callback\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/sso/callback/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map z094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741501undefined16521670__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined17061714__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined19181953".next"undefined195819590undefined19862024 falseundefined22922291: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25972607__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26762765undefined27672773undefined30893109falseundefined31123176{}undefined33223361falseundefined38873902__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43604374__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined52165224__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56415654__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62586272__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined63086323__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63516368__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined64036424__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70607073__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80518064__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined95009524__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined96229643__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined999510008__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1019810211__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1045110465__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1103711048__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1171711735__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1217212180__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1273012744__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1321013223__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1364613672__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1371913732__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1379813819__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1413914159__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1422014231__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1472314736__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1483514842__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1509815112__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1533315351__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1569315704__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined166267module_compiled.AppRouteRouteModuleundefined303371route_kind.RouteKindundefined888933route_namespaceObjectundefined12391327(0,patch_fetch.patchFetch)undefined23962496(0,app_paths_.normalizeAppPath)undefined29543048no_fallback_error_external_.NoFallbackErrorundefined38903976(0,trace_tracer.getTracer)undefined43934489(0,request_meta.getRequestMeta)undefined50935186node.NodeNextRequestundefined52225317node.NodeNextResponseundefined53455436next_request.NextRequestAdapterundefined54715583(0,next_request.signalFromNodeResponse)undefined62196297constants.BaseServerSpanundefined72757371(0,request_meta.getRequestMeta)undefined88078926(0,web_utils.toNodeOutgoingHttpHeaders)undefined90249132lib_constants.NEXT_CACHE_TAGS_HEADERundefined94849576lib_constants.INFINITE_CACHEundefined97669858lib_constants.INFINITE_CACHEundefined1009810179response_cache.CachedRouteKindundefined1075110844(0,send_response/* sendResponse */.I)undefined1151311619(0,utils/* getRevalidateReason */.c)undefined1205612124route_kind.RouteKindundefined1267412755response_cache.CachedRouteKindundefined1322113317(0,request_meta.getRequestMeta)undefined1374013863(0,web_utils.fromNodeOutgoingHttpHeaders)undefined1391014006(0,request_meta.getRequestMeta)undefined1407214180lib_constants.NEXT_CACHE_TAGS_HEADERundefined1450014611(0,cache_control.getCacheControlHeader)undefined1467214765(0,send_response/* sendResponse */.I)undefined1525715335constants.BaseServerSpanundefined1543415500trace_tracer.SpanKindundefined1575615850no_fallback_error_external_.NoFallbackErrorundefined1607116177(0,utils/* getRevalidateReason */.c)undefined1651916612(0,send_response/* sendResponse */.I)undefined /***/ }) Q/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/sso/callback/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { GET: () => (GET) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/sso/callback/route.js const { handleSsoCallback } = __webpack_require__(9970); const { getOidcConfig, stateCookieName } = __webpack_require__(5617); const SESSION_MAX_AGE = 60 * 60 * 24 * 7; function getCookie(name, header) { const match = header?.match(new RegExp(`(?:^|;)\\s*${name}=([^;]+)`)); return match ? decodeURIComponent(match[1]) : null; } function setCookie(name, value, maxAge) { return `${name}=${value}; HttpOnly; ${ true ? "Secure; " : 0}SameSite=Lax; Path=/; Max-Age=${maxAge}`; } async function GET(request) { try { const { searchParams } = new URL(request.url); const code = searchParams.get("code"); const returnedState = searchParams.get("state"); const error = searchParams.get("error"); if (error) { return new Response(JSON.stringify({ error: `SSO provider returned: ${error}` }), { status: 400, headers: { "Content-Type": "application/json" } }); } if (!code) { return new Response(JSON.stringify({ error: "Missing authorization code" }), { status: 400, headers: { "Content-Type": "application/json" } }); } const cookieHeader = request.headers.get("cookie") || ""; const storedState = getCookie(stateCookieName(), cookieHeader); if (returnedState && storedState && returnedState !== storedState) { return new Response(JSON.stringify({ error: "State mismatch — possible CSRF" }), { status: 403, headers: { "Content-Type": "application/json" } }); } const { session } = await handleSsoCallback(code); const stateClear = `${stateCookieName()}=; HttpOnly; SameSite=Lax; Path=/; Max-Age=0`; const sessionCookie = setCookie("cosmic_session", session.token, SESSION_MAX_AGE); const config = getOidcConfig(); const baseUrl = config?.redirectUrl ? new URL(config.redirectUrl).origin : "http://localhost:8090" || 0; return new Response(null, { status: 302, headers: { Location: `${baseUrl}/dashboard`, "Set-Cookie": `${sessionCookie}, ${stateClear}`, "Cache-Control": "no-store" } }); } catch (error) { const msg = error.message || "SSO callback failed"; const status = error.status || 500; return new Response(`

SSO Error

${msg}

Back to login`, { status, headers: { "Content-Type": "text/html" } }); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&name=app%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/sso/callback/route", pathname: "/api/auth/sso/callback", filename: "route", bundlePath: "app/api/auth/sso/callback/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\sso\\callback\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/sso/callback/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map /***/ })  `_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; ; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/sso/callback/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { GET: () => (GET) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/sso/callback/route.js  ReplaceSourceReplaceSourceRawSource const { handleSsoCallback } = require("../../../../../services/sso-service"); const { getOidcConfig, stateCookieName } = require("../../../../../lib/oidc"); const SESSION_MAX_AGE = 60 * 60 * 24 * 7; function getCookie(name, header) { const match = header?.match(new RegExp(`(?:^|;)\\s*${name}=([^;]+)`)); return match ? decodeURIComponent(match[1]) : null; } function setCookie(name, value, maxAge) { return `${name}=${value}; HttpOnly; ${"production" === "production" ? "Secure; " : ""}SameSite=Lax; Path=/; Max-Age=${maxAge}`; } export async function GET(request) { try { const { searchParams } = new URL(request.url); const code = searchParams.get("code"); const returnedState = searchParams.get("state"); const error = searchParams.get("error"); if (error) { return new Response(JSON.stringify({ error: `SSO provider returned: ${error}` }), { status: 400, headers: { "Content-Type": "application/json" } }); } if (!code) { return new Response(JSON.stringify({ error: "Missing authorization code" }), { status: 400, headers: { "Content-Type": "application/json" } }); } const cookieHeader = request.headers.get("cookie") || ""; const storedState = getCookie(stateCookieName(), cookieHeader); if (returnedState && storedState && returnedState !== storedState) { return new Response(JSON.stringify({ error: "State mismatch — possible CSRF" }), { status: 403, headers: { "Content-Type": "application/json" } }); } const { session } = await handleSsoCallback(code); const stateClear = `${stateCookieName()}=; HttpOnly; SameSite=Lax; Path=/; Max-Age=0`; const sessionCookie = setCookie("cosmic_session", session.token, SESSION_MAX_AGE); const config = getOidcConfig(); const baseUrl = config?.redirectUrl ? new URL(config.redirectUrl).origin : process.env.NEXT_PUBLIC_APP_URL || "http://localhost:8090"; return new Response(null, { status: 302, headers: { Location: `${baseUrl}/dashboard`, "Set-Cookie": `${sessionCookie}, ${stateClear}`, "Cache-Control": "no-store" } }); } catch (error) { const msg = error.message || "SSO callback failed"; const status = error.status || 500; return new Response(`

SSO Error

${msg}

Back to login`, { status, headers: { "Content-Type": "text/html" } }); } } 3036__webpack_require__undefined38749970undefined121127__webpack_require__undefined1291535617undefined451479 trueundefined4964970undefined543549undefined22542284"http://localhost:8090"undefined228923110undefined ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&name=app%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\sso\\callback\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/sso/callback/route", pathname: "/api/auth/sso/callback", filename: "route", bundlePath: "app/api/auth/sso/callback/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\sso\\callback\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/sso/callback/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map z094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741501undefined16521670__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined17061714__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined19181953".next"undefined195819590undefined19862024 falseundefined22922291: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25972607__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26762765undefined27672773undefined30893109falseundefined31123176{}undefined33223361falseundefined38873902__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43604374__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined52165224__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56415654__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62586272__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined63086323__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63516368__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined64036424__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70607073__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80518064__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined95009524__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined96229643__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined999510008__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1019810211__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1045110465__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1103711048__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1171711735__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1217212180__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1273012744__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1321013223__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1364613672__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1371913732__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1379813819__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1413914159__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1422014231__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1472314736__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1483514842__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1509815112__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1533315351__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1569315704__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined166267module_compiled.AppRouteRouteModuleundefined303371route_kind.RouteKindundefined888933route_namespaceObjectundefined12391327(0,patch_fetch.patchFetch)undefined23962496(0,app_paths_.normalizeAppPath)undefined29543048no_fallback_error_external_.NoFallbackErrorundefined38903976(0,trace_tracer.getTracer)undefined43934489(0,request_meta.getRequestMeta)undefined50935186node.NodeNextRequestundefined52225317node.NodeNextResponseundefined53455436next_request.NextRequestAdapterundefined54715583(0,next_request.signalFromNodeResponse)undefined62196297constants.BaseServerSpanundefined72757371(0,request_meta.getRequestMeta)undefined88078926(0,web_utils.toNodeOutgoingHttpHeaders)undefined90249132lib_constants.NEXT_CACHE_TAGS_HEADERundefined94849576lib_constants.INFINITE_CACHEundefined97669858lib_constants.INFINITE_CACHEundefined1009810179response_cache.CachedRouteKindundefined1075110844(0,send_response/* sendResponse */.I)undefined1151311619(0,utils/* getRevalidateReason */.c)undefined1205612124route_kind.RouteKindundefined1267412755response_cache.CachedRouteKindundefined1322113317(0,request_meta.getRequestMeta)undefined1374013863(0,web_utils.fromNodeOutgoingHttpHeaders)undefined1391014006(0,request_meta.getRequestMeta)undefined1407214180lib_constants.NEXT_CACHE_TAGS_HEADERundefined1450014611(0,cache_control.getCacheControlHeader)undefined1467214765(0,send_response/* sendResponse */.I)undefined1525715335constants.BaseServerSpanundefined1543415500trace_tracer.SpanKindundefined1575615850no_fallback_error_external_.NoFallbackErrorundefined1607116177(0,utils/* getRevalidateReason */.c)undefined1651916612(0,send_response/* sendResponse */.I)undefined, /***/ 3033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ })  \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");, /***/ 3421:  (webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcevar __webpack_unused_export__; webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "sendResponse", { enumerable: true, get: function() { return sendResponse; } }); const _helpers = require("./base-http/helpers"); const _pipereadable = require("./pipe-readable"); const _utils = require("./web/utils"); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map h :NNQO"$4GMO[0R__webpack_unused_export__ = ()Object.defineProperty(exports, "I", ())__webpack_require__123750887679 truebuffersourcesizemapshash var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "I", ({ enumerable: true, get: function() { return sendResponse; } })); const _helpers = __webpack_require__(1237); const _pipereadable = __webpack_require__(5088); const _utils = __webpack_require__(7679); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. true && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSourcevar __webpack_unused_export__; ReplaceSourceRawSource "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "sendResponse", { enumerable: true, get: function() { return sendResponse; } }); const _helpers = require("./base-http/helpers"); const _pipereadable = require("./pipe-readable"); const _utils = require("./web/utils"); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map;012undefined1458__webpack_unused_export__ = (undefined7878)undefined81127Object.defineProperty(exports, "I", (undefined210210))undefined230236__webpack_require__undefined2382581237undefined284290__webpack_require__undefined2923085088undefined327333__webpack_require__undefined3353477679undefined560594 trueundefined /***/ }) . /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "I", ({ enumerable: true, get: function() { return sendResponse; } })); const _helpers = __webpack_require__(1237); const _pipereadable = __webpack_require__(5088); const _utils = __webpack_require__(7679); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. true && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map /***/ })   S/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__;  "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "sendResponse", { enumerable: true, get: function() { return sendResponse; } }); const _helpers = require("./base-http/helpers"); const _pipereadable = require("./pipe-readable"); const _utils = require("./web/utils"); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map;012undefined1458__webpack_unused_export__ = (undefined7878)undefined81127Object.defineProperty(exports, "I", (undefined210210))undefined230236__webpack_require__undefined2382581237undefined284290__webpack_require__undefined2923085088undefined327333__webpack_require__undefined3353477679undefined560594 trueundefined, /***/ 4870:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Umodule.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js"); /***/ })  Umodule.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");, /***/ 5511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ })  #module.exports = require("crypto");, /***/ 5617:  gwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource"use strict"; const { randomBytes } = require("crypto"); function getOidcConfig() { if (process.env.COSMIC_SSO_ENABLED !== "true") return null; const issuer = process.env.COSMIC_OIDC_ISSUER; const clientId = process.env.COSMIC_OIDC_CLIENT_ID; const clientSecret = process.env.COSMIC_OIDC_CLIENT_SECRET; if (!issuer || !clientId || !clientSecret) return null; const redirectUrl = process.env.COSMIC_OIDC_REDIRECT_URL || (process.env.NEXT_PUBLIC_APP_URL || "http://localhost:8090") + "/api/auth/sso/callback"; return { issuer, clientId, clientSecret, redirectUrl }; } async function discoverProvider(issuer) { const discoUrl = process.env.COSMIC_OIDC_DISCOVERY_URL || issuer.replace(/\/+$/, "") + "/.well-known/openid-configuration"; const res = await fetch(discoUrl); if (!res.ok) throw new Error(`OIDC discovery failed (${res.status}) for ${discoUrl}`); return res.json(); } function base64UrlEncode(buf) { return buf.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); } function generateNonce() { return base64UrlEncode(randomBytes(32)); } function generateState() { return base64UrlEncode(randomBytes(32)); } function decodeJwtPayload(jwt) { const parts = jwt.split("."); if (parts.length !== 3) throw new Error("Invalid JWT format"); const payload = Buffer.from(parts[1], "base64url").toString("utf8"); return JSON.parse(payload); } function getCookieExpires() { return new Date(Date.now() + 10 * 60 * 1000).toUTCString(); } function stateCookieName() { return "cosmic_sso_state"; } module.exports = { getOidcConfig, discoverProvider, generateState, generateNonce, decodeJwtPayload, base64UrlEncode, stateCookieName, getCookieExpires }; d &,.5C__webpack_require__5511"http://localhost:8090"0buffersourcesizemapshash const { randomBytes } = __webpack_require__(5511); function getOidcConfig() { if (process.env.COSMIC_SSO_ENABLED !== "true") return null; const issuer = process.env.COSMIC_OIDC_ISSUER; const clientId = process.env.COSMIC_OIDC_CLIENT_ID; const clientSecret = process.env.COSMIC_OIDC_CLIENT_SECRET; if (!issuer || !clientId || !clientSecret) return null; const redirectUrl = process.env.COSMIC_OIDC_REDIRECT_URL || ("http://localhost:8090" || 0) + "/api/auth/sso/callback"; return { issuer, clientId, clientSecret, redirectUrl }; } async function discoverProvider(issuer) { const discoUrl = process.env.COSMIC_OIDC_DISCOVERY_URL || issuer.replace(/\/+$/, "") + "/.well-known/openid-configuration"; const res = await fetch(discoUrl); if (!res.ok) throw new Error(`OIDC discovery failed (${res.status}) for ${discoUrl}`); return res.json(); } function base64UrlEncode(buf) { return buf.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); } function generateNonce() { return base64UrlEncode(randomBytes(32)); } function generateState() { return base64UrlEncode(randomBytes(32)); } function decodeJwtPayload(jwt) { const parts = jwt.split("."); if (parts.length !== 3) throw new Error("Invalid JWT format"); const payload = Buffer.from(parts[1], "base64url").toString("utf8"); return JSON.parse(payload); } function getCookieExpires() { return new Date(Date.now() + 10 * 60 * 1000).toUTCString(); } function stateCookieName() { return "cosmic_sso_state"; } module.exports = { getOidcConfig, discoverProvider, generateState, generateNonce, decodeJwtPayload, base64UrlEncode, stateCookieName, getCookieExpires }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSource"use strict"; const { randomBytes } = require("crypto"); function getOidcConfig() { if (process.env.COSMIC_SSO_ENABLED !== "true") return null; const issuer = process.env.COSMIC_OIDC_ISSUER; const clientId = process.env.COSMIC_OIDC_CLIENT_ID; const clientSecret = process.env.COSMIC_OIDC_CLIENT_SECRET; if (!issuer || !clientId || !clientSecret) return null; const redirectUrl = process.env.COSMIC_OIDC_REDIRECT_URL || (process.env.NEXT_PUBLIC_APP_URL || "http://localhost:8090") + "/api/auth/sso/callback"; return { issuer, clientId, clientSecret, redirectUrl }; } async function discoverProvider(issuer) { const discoUrl = process.env.COSMIC_OIDC_DISCOVERY_URL || issuer.replace(/\/+$/, "") + "/.well-known/openid-configuration"; const res = await fetch(discoUrl); if (!res.ok) throw new Error(`OIDC discovery failed (${res.status}) for ${discoUrl}`); return res.json(); } function base64UrlEncode(buf) { return buf.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); } function generateNonce() { return base64UrlEncode(randomBytes(32)); } function generateState() { return base64UrlEncode(randomBytes(32)); } function decodeJwtPayload(jwt) { const parts = jwt.split("."); if (parts.length !== 3) throw new Error("Invalid JWT format"); const payload = Buffer.from(parts[1], "base64url").toString("utf8"); return JSON.parse(payload); } function getCookieExpires() { return new Date(Date.now() + 10 * 60 * 1000).toUTCString(); } function stateCookieName() { return "cosmic_sso_state"; } module.exports = { getOidcConfig, discoverProvider, generateState, generateNonce, decodeJwtPayload, base64UrlEncode, stateCookieName, getCookieExpires }; s012undefined3844__webpack_require__undefined46535511undefined444474"http://localhost:8090"undefined4795010undefined /***/ }) R/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { randomBytes } = __webpack_require__(5511); function getOidcConfig() { if (process.env.COSMIC_SSO_ENABLED !== "true") return null; const issuer = process.env.COSMIC_OIDC_ISSUER; const clientId = process.env.COSMIC_OIDC_CLIENT_ID; const clientSecret = process.env.COSMIC_OIDC_CLIENT_SECRET; if (!issuer || !clientId || !clientSecret) return null; const redirectUrl = process.env.COSMIC_OIDC_REDIRECT_URL || ("http://localhost:8090" || 0) + "/api/auth/sso/callback"; return { issuer, clientId, clientSecret, redirectUrl }; } async function discoverProvider(issuer) { const discoUrl = process.env.COSMIC_OIDC_DISCOVERY_URL || issuer.replace(/\/+$/, "") + "/.well-known/openid-configuration"; const res = await fetch(discoUrl); if (!res.ok) throw new Error(`OIDC discovery failed (${res.status}) for ${discoUrl}`); return res.json(); } function base64UrlEncode(buf) { return buf.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); } function generateNonce() { return base64UrlEncode(randomBytes(32)); } function generateState() { return base64UrlEncode(randomBytes(32)); } function decodeJwtPayload(jwt) { const parts = jwt.split("."); if (parts.length !== 3) throw new Error("Invalid JWT format"); const payload = Buffer.from(parts[1], "base64url").toString("utf8"); return JSON.parse(payload); } function getCookieExpires() { return new Date(Date.now() + 10 * 60 * 1000).toUTCString(); } function stateCookieName() { return "cosmic_sso_state"; } module.exports = { getOidcConfig, discoverProvider, generateState, generateNonce, decodeJwtPayload, base64UrlEncode, stateCookieName, getCookieExpires }; /***/ })  S/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; "use strict"; const { randomBytes } = require("crypto"); function getOidcConfig() { if (process.env.COSMIC_SSO_ENABLED !== "true") return null; const issuer = process.env.COSMIC_OIDC_ISSUER; const clientId = process.env.COSMIC_OIDC_CLIENT_ID; const clientSecret = process.env.COSMIC_OIDC_CLIENT_SECRET; if (!issuer || !clientId || !clientSecret) return null; const redirectUrl = process.env.COSMIC_OIDC_REDIRECT_URL || (process.env.NEXT_PUBLIC_APP_URL || "http://localhost:8090") + "/api/auth/sso/callback"; return { issuer, clientId, clientSecret, redirectUrl }; } async function discoverProvider(issuer) { const discoUrl = process.env.COSMIC_OIDC_DISCOVERY_URL || issuer.replace(/\/+$/, "") + "/.well-known/openid-configuration"; const res = await fetch(discoUrl); if (!res.ok) throw new Error(`OIDC discovery failed (${res.status}) for ${discoUrl}`); return res.json(); } function base64UrlEncode(buf) { return buf.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); } function generateNonce() { return base64UrlEncode(randomBytes(32)); } function generateState() { return base64UrlEncode(randomBytes(32)); } function decodeJwtPayload(jwt) { const parts = jwt.split("."); if (parts.length !== 3) throw new Error("Invalid JWT format"); const payload = Buffer.from(parts[1], "base64url").toString("utf8"); return JSON.parse(payload); } function getCookieExpires() { return new Date(Date.now() + 10 * 60 * 1000).toUTCString(); } function stateCookieName() { return "cosmic_sso_state"; } module.exports = { getOidcConfig, discoverProvider, generateState, generateNonce, decodeJwtPayload, base64UrlEncode, stateCookieName, getCookieExpires }; s012undefined3844__webpack_require__undefined46535511undefined444474"http://localhost:8090"undefined4795010undefined, /***/ 5736:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource }webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceR"use strict"; if (process.env.NEXT_RUNTIME === 'edge') { module.exports = require('next/dist/server/route-modules/app-route/module.js'); } else { if (process.env.__NEXT_EXPERIMENTAL_REACT) { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js'); } } } else { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js'); } } } } //# sourceMappingURL=module.compiled.js.map  c 47Nfalse{}module.exports = __webpack_require__(4870)buffersourcesizemapshash if (false) {} else { if (false) {} else { if (false) {} else { if (false) {} else { module.exports = __webpack_require__(4870); } } } } //# sourceMappingURL=module.compiled.js.map {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceR"use strict"; if (process.env.NEXT_RUNTIME === 'edge') { module.exports = require('next/dist/server/route-modules/app-route/module.js'); } else { if (process.env.__NEXT_EXPERIMENTAL_REACT) { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js'); } } } else { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js'); } } } } //# sourceMappingURL=module.compiled.js.map012undefined1852falseundefined55141{}undefined158194falseundefined197906{}undefined927964falseundefined9671261{}undefined12861306falseundefined13091431{}undefined14561539module.exports = __webpack_require__(4870)undefined /***/ }) R/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (false) {} else { if (false) {} else { if (false) {} else { if (false) {} else { module.exports = __webpack_require__(4870); } } } } //# sourceMappingURL=module.compiled.js.map /***/ })  S/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; R"use strict"; if (process.env.NEXT_RUNTIME === 'edge') { module.exports = require('next/dist/server/route-modules/app-route/module.js'); } else { if (process.env.__NEXT_EXPERIMENTAL_REACT) { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js'); } } } else { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js'); } } } } //# sourceMappingURL=module.compiled.js.map012undefined1852falseundefined55141{}undefined158194falseundefined197906{}undefined927964falseundefined9671261{}undefined12861306falseundefined13091431{}undefined14561539module.exports = __webpack_require__(4870)undefined, /***/ 6330:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; +module.exports = require("@prisma/client");  /***/ }) Y/***/ ((module) => { "use strict"; module.exports = require("@prisma/client"); /***/ })  +module.exports = require("@prisma/client");, /***/ 6439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ }) z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ })  Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");, /***/ 6487:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/***/ (() => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource buffersourcesizemapshash {"finalSource":true}mapbufferedMap ReplaceSourceRawSource /***/ }) /***/ (() => { /***/ })  /***/ (() => { , /***/ 7964:  -webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; d '-/>C__webpack_require__6330false{}buffersourcesizemapshash const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSource "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; b012undefined3945__webpack_require__undefined47626330undefined175203falseundefined206253{}undefined /***/ }) z*/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; /***/ }) {~  "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; b012undefined3945__webpack_require__undefined47626330undefined175203falseundefined206253{}undefined, /***/ 8335:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/***/ (() => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource buffersourcesizemapshash {"finalSource":true}mapbufferedMap ReplaceSourceRawSource /***/ }) p ru vxz, /***/ 8559:  Hwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; k !')7SY[bu{}@__webpack_require__796455117082buffersourcesizemapshash( const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSource&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; 012undefined3339__webpack_require__undefined41557964undefined8389__webpack_require__undefined91985511undefined117123__webpack_require__undefined1251347082undefined /***/ }) i/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; /***/ }) jm n&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; 012undefined3339__webpack_require__undefined41557964undefined8389__webpack_require__undefined91985511undefined117123__webpack_require__undefined1251347082undefinednp, /***/ 9294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) _/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ }) `c defWmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");eg, /***/ 9970:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource ]webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceu"use strict"; const { prisma } = require("../lib/prisma"); const { createSession } = require("./auth-service"); const { getOidcConfig, discoverProvider, generateNonce, decodeJwtPayload } = require("../lib/oidc"); async function exchangeCode(code, redirectUrl, clientId, clientSecret, tokenEndpoint) { const body = new URLSearchParams({ grant_type: "authorization_code", code, redirect_uri: redirectUrl, client_id: clientId, client_secret: clientSecret }); const res = await fetch(tokenEndpoint, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: body.toString() }); if (!res.ok) { const text = await res.text(); throw new Error(`Token exchange failed (${res.status}): ${text}`); } return res.json(); } async function handleSsoCallback(code) { const config = getOidcConfig(); if (!config) throw Object.assign(new Error("SSO not configured"), { status: 501 }); const disco = await discoverProvider(config.issuer); const tokens = await exchangeCode(code, config.redirectUrl, config.clientId, config.clientSecret, disco.token_endpoint); const idToken = tokens.id_token; if (!idToken) throw Object.assign(new Error("No id_token returned from provider"), { status: 400 }); const claims = decodeJwtPayload(idToken); const email = claims.email; if (!email) throw Object.assign(new Error("Email not provided by SSO provider"), { status: 400 }); const displayName = claims.name || claims.preferred_username || email.split("@")[0]; let user = await prisma.user.findUnique({ where: { email } }); if (!user) { user = await prisma.user.create({ data: { email, displayName, emailVerifiedAt: new Date() } }); const slug = displayName.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: `${displayName}'s Organization`, slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3 } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50 } }); } else { await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date(), displayName } }); } const session = await createSession(user.id); return { user, session }; } module.exports = { handleSsoCallback }; h !')7U[]lC__webpack_require__796485595617buffersourcesizemapshashl const { prisma } = __webpack_require__(7964); const { createSession } = __webpack_require__(8559); const { getOidcConfig, discoverProvider, generateNonce, decodeJwtPayload } = __webpack_require__(5617); async function exchangeCode(code, redirectUrl, clientId, clientSecret, tokenEndpoint) { const body = new URLSearchParams({ grant_type: "authorization_code", code, redirect_uri: redirectUrl, client_id: clientId, client_secret: clientSecret }); const res = await fetch(tokenEndpoint, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: body.toString() }); if (!res.ok) { const text = await res.text(); throw new Error(`Token exchange failed (${res.status}): ${text}`); } return res.json(); } async function handleSsoCallback(code) { const config = getOidcConfig(); if (!config) throw Object.assign(new Error("SSO not configured"), { status: 501 }); const disco = await discoverProvider(config.issuer); const tokens = await exchangeCode(code, config.redirectUrl, config.clientId, config.clientSecret, disco.token_endpoint); const idToken = tokens.id_token; if (!idToken) throw Object.assign(new Error("No id_token returned from provider"), { status: 400 }); const claims = decodeJwtPayload(idToken); const email = claims.email; if (!email) throw Object.assign(new Error("Email not provided by SSO provider"), { status: 400 }); const displayName = claims.name || claims.preferred_username || email.split("@")[0]; let user = await prisma.user.findUnique({ where: { email } }); if (!user) { user = await prisma.user.create({ data: { email, displayName, emailVerifiedAt: new Date() } }); const slug = displayName.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: `${displayName}'s Organization`, slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3 } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50 } }); } else { await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date(), displayName } }); } const session = await createSession(user.id); return { user, session }; } module.exports = { handleSsoCallback }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceu"use strict"; const { prisma } = require("../lib/prisma"); const { createSession } = require("./auth-service"); const { getOidcConfig, discoverProvider, generateNonce, decodeJwtPayload } = require("../lib/oidc"); async function exchangeCode(code, redirectUrl, clientId, clientSecret, tokenEndpoint) { const body = new URLSearchParams({ grant_type: "authorization_code", code, redirect_uri: redirectUrl, client_id: clientId, client_secret: clientSecret }); const res = await fetch(tokenEndpoint, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: body.toString() }); if (!res.ok) { const text = await res.text(); throw new Error(`Token exchange failed (${res.status}): ${text}`); } return res.json(); } async function handleSsoCallback(code) { const config = getOidcConfig(); if (!config) throw Object.assign(new Error("SSO not configured"), { status: 501 }); const disco = await discoverProvider(config.issuer); const tokens = await exchangeCode(code, config.redirectUrl, config.clientId, config.clientSecret, disco.token_endpoint); const idToken = tokens.id_token; if (!idToken) throw Object.assign(new Error("No id_token returned from provider"), { status: 400 }); const claims = decodeJwtPayload(idToken); const email = claims.email; if (!email) throw Object.assign(new Error("Email not provided by SSO provider"), { status: 400 }); const displayName = claims.name || claims.preferred_username || email.split("@")[0]; let user = await prisma.user.findUnique({ where: { email } }); if (!user) { user = await prisma.user.create({ data: { email, displayName, emailVerifiedAt: new Date() } }); const slug = displayName.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: `${displayName}'s Organization`, slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3 } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50 } }); } else { await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date(), displayName } }); } const session = await createSession(user.id); return { user, session }; } module.exports = { handleSsoCallback }; 012undefined3339__webpack_require__undefined41557964undefined8591__webpack_require__undefined931088559undefined189195__webpack_require__undefined1972095617undefined /***/ }) V/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { prisma } = __webpack_require__(7964); const { createSession } = __webpack_require__(8559); const { getOidcConfig, discoverProvider, generateNonce, decodeJwtPayload } = __webpack_require__(5617); async function exchangeCode(code, redirectUrl, clientId, clientSecret, tokenEndpoint) { const body = new URLSearchParams({ grant_type: "authorization_code", code, redirect_uri: redirectUrl, client_id: clientId, client_secret: clientSecret }); const res = await fetch(tokenEndpoint, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: body.toString() }); if (!res.ok) { const text = await res.text(); throw new Error(`Token exchange failed (${res.status}): ${text}`); } return res.json(); } async function handleSsoCallback(code) { const config = getOidcConfig(); if (!config) throw Object.assign(new Error("SSO not configured"), { status: 501 }); const disco = await discoverProvider(config.issuer); const tokens = await exchangeCode(code, config.redirectUrl, config.clientId, config.clientSecret, disco.token_endpoint); const idToken = tokens.id_token; if (!idToken) throw Object.assign(new Error("No id_token returned from provider"), { status: 400 }); const claims = decodeJwtPayload(idToken); const email = claims.email; if (!email) throw Object.assign(new Error("Email not provided by SSO provider"), { status: 400 }); const displayName = claims.name || claims.preferred_username || email.split("@")[0]; let user = await prisma.user.findUnique({ where: { email } }); if (!user) { user = await prisma.user.create({ data: { email, displayName, emailVerifiedAt: new Date() } }); const slug = displayName.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: `${displayName}'s Organization`, slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3 } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50 } }); } else { await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date(), displayName } }); } const session = await createSession(user.id); return { user, session }; } module.exports = { handleSsoCallback }; /***/ }) WZ [tu"use strict"; const { prisma } = require("../lib/prisma"); const { createSession } = require("./auth-service"); const { getOidcConfig, discoverProvider, generateNonce, decodeJwtPayload } = require("../lib/oidc"); async function exchangeCode(code, redirectUrl, clientId, clientSecret, tokenEndpoint) { const body = new URLSearchParams({ grant_type: "authorization_code", code, redirect_uri: redirectUrl, client_id: clientId, client_secret: clientSecret }); const res = await fetch(tokenEndpoint, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: body.toString() }); if (!res.ok) { const text = await res.text(); throw new Error(`Token exchange failed (${res.status}): ${text}`); } return res.json(); } async function handleSsoCallback(code) { const config = getOidcConfig(); if (!config) throw Object.assign(new Error("SSO not configured"), { status: 501 }); const disco = await discoverProvider(config.issuer); const tokens = await exchangeCode(code, config.redirectUrl, config.clientId, config.clientSecret, disco.token_endpoint); const idToken = tokens.id_token; if (!idToken) throw Object.assign(new Error("No id_token returned from provider"), { status: 400 }); const claims = decodeJwtPayload(idToken); const email = claims.email; if (!email) throw Object.assign(new Error("Email not provided by SSO provider"), { status: 400 }); const displayName = claims.name || claims.preferred_username || email.split("@")[0]; let user = await prisma.user.findUnique({ where: { email } }); if (!user) { user = await prisma.user.create({ data: { email, displayName, emailVerifiedAt: new Date() } }); const slug = displayName.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: `${displayName}'s Organization`, slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3 } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50 } }); } else { await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date(), displayName } }); } const session = await createSession(user.id); return { user, session }; } module.exports = { handleSsoCallback }; 012undefined3339__webpack_require__undefined41557964undefined8591__webpack_require__undefined931088559undefined189195__webpack_require__undefined1972095617undefined[] }; ; // load runtime var __webpack_require__ = require("../../../../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082], () => (__webpack_exec__(2842))); ,module.exports = __webpack_exports__; })(); (() => { var exports = {}; exports.id = 4310; exports.ids = [4310]; exports.modules = { /***/ 261: /***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 846: /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ }), /***/ 2842: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/sso/callback/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { GET: () => (GET) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/sso/callback/route.js const { handleSsoCallback } = __webpack_require__(9970); const { getOidcConfig, stateCookieName } = __webpack_require__(5617); const SESSION_MAX_AGE = 60 * 60 * 24 * 7; function getCookie(name, header) { const match = header?.match(new RegExp(`(?:^|;)\\s*${name}=([^;]+)`)); return match ? decodeURIComponent(match[1]) : null; } function setCookie(name, value, maxAge) { return `${name}=${value}; HttpOnly; ${ true ? "Secure; " : 0}SameSite=Lax; Path=/; Max-Age=${maxAge}`; } async function GET(request) { try { const { searchParams } = new URL(request.url); const code = searchParams.get("code"); const returnedState = searchParams.get("state"); const error = searchParams.get("error"); if (error) { return new Response(JSON.stringify({ error: `SSO provider returned: ${error}` }), { status: 400, headers: { "Content-Type": "application/json" } }); } if (!code) { return new Response(JSON.stringify({ error: "Missing authorization code" }), { status: 400, headers: { "Content-Type": "application/json" } }); } const cookieHeader = request.headers.get("cookie") || ""; const storedState = getCookie(stateCookieName(), cookieHeader); if (returnedState && storedState && returnedState !== storedState) { return new Response(JSON.stringify({ error: "State mismatch — possible CSRF" }), { status: 403, headers: { "Content-Type": "application/json" } }); } const { session } = await handleSsoCallback(code); const stateClear = `${stateCookieName()}=; HttpOnly; SameSite=Lax; Path=/; Max-Age=0`; const sessionCookie = setCookie("cosmic_session", session.token, SESSION_MAX_AGE); const config = getOidcConfig(); const baseUrl = config?.redirectUrl ? new URL(config.redirectUrl).origin : "http://localhost:8090" || 0; return new Response(null, { status: 302, headers: { Location: `${baseUrl}/dashboard`, "Set-Cookie": `${sessionCookie}, ${stateClear}`, "Cache-Control": "no-store" } }); } catch (error) { const msg = error.message || "SSO callback failed"; const status = error.status || 500; return new Response(`

SSO Error

${msg}

Back to login`, { status, headers: { "Content-Type": "text/html" } }); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&name=app%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/sso/callback/route", pathname: "/api/auth/sso/callback", filename: "route", bundlePath: "app/api/auth/sso/callback/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\sso\\callback\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/sso/callback/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map /***/ }), /***/ 3033: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }), /***/ 3421: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "I", ({ enumerable: true, get: function() { return sendResponse; } })); const _helpers = __webpack_require__(1237); const _pipereadable = __webpack_require__(5088); const _utils = __webpack_require__(7679); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. true && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map /***/ }), /***/ 4870: /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js"); /***/ }), /***/ 5511: /***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }), /***/ 5617: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { randomBytes } = __webpack_require__(5511); function getOidcConfig() { if (process.env.COSMIC_SSO_ENABLED !== "true") return null; const issuer = process.env.COSMIC_OIDC_ISSUER; const clientId = process.env.COSMIC_OIDC_CLIENT_ID; const clientSecret = process.env.COSMIC_OIDC_CLIENT_SECRET; if (!issuer || !clientId || !clientSecret) return null; const redirectUrl = process.env.COSMIC_OIDC_REDIRECT_URL || ("http://localhost:8090" || 0) + "/api/auth/sso/callback"; return { issuer, clientId, clientSecret, redirectUrl }; } async function discoverProvider(issuer) { const discoUrl = process.env.COSMIC_OIDC_DISCOVERY_URL || issuer.replace(/\/+$/, "") + "/.well-known/openid-configuration"; const res = await fetch(discoUrl); if (!res.ok) throw new Error(`OIDC discovery failed (${res.status}) for ${discoUrl}`); return res.json(); } function base64UrlEncode(buf) { return buf.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); } function generateNonce() { return base64UrlEncode(randomBytes(32)); } function generateState() { return base64UrlEncode(randomBytes(32)); } function decodeJwtPayload(jwt) { const parts = jwt.split("."); if (parts.length !== 3) throw new Error("Invalid JWT format"); const payload = Buffer.from(parts[1], "base64url").toString("utf8"); return JSON.parse(payload); } function getCookieExpires() { return new Date(Date.now() + 10 * 60 * 1000).toUTCString(); } function stateCookieName() { return "cosmic_sso_state"; } module.exports = { getOidcConfig, discoverProvider, generateState, generateNonce, decodeJwtPayload, base64UrlEncode, stateCookieName, getCookieExpires }; /***/ }), /***/ 5736: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (false) {} else { if (false) {} else { if (false) {} else { if (false) {} else { module.exports = __webpack_require__(4870); } } } } //# sourceMappingURL=module.compiled.js.map /***/ }), /***/ 6330: /***/ ((module) => { "use strict"; module.exports = require("@prisma/client"); /***/ }), /***/ 6439: /***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ }), /***/ 6487: /***/ (() => { /***/ }), /***/ 7964: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; /***/ }), /***/ 8335: /***/ (() => { /***/ }), /***/ 8559: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; /***/ }), /***/ 9294: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ }), /***/ 9970: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { prisma } = __webpack_require__(7964); const { createSession } = __webpack_require__(8559); const { getOidcConfig, discoverProvider, generateNonce, decodeJwtPayload } = __webpack_require__(5617); async function exchangeCode(code, redirectUrl, clientId, clientSecret, tokenEndpoint) { const body = new URLSearchParams({ grant_type: "authorization_code", code, redirect_uri: redirectUrl, client_id: clientId, client_secret: clientSecret }); const res = await fetch(tokenEndpoint, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: body.toString() }); if (!res.ok) { const text = await res.text(); throw new Error(`Token exchange failed (${res.status}): ${text}`); } return res.json(); } async function handleSsoCallback(code) { const config = getOidcConfig(); if (!config) throw Object.assign(new Error("SSO not configured"), { status: 501 }); const disco = await discoverProvider(config.issuer); const tokens = await exchangeCode(code, config.redirectUrl, config.clientId, config.clientSecret, disco.token_endpoint); const idToken = tokens.id_token; if (!idToken) throw Object.assign(new Error("No id_token returned from provider"), { status: 400 }); const claims = decodeJwtPayload(idToken); const email = claims.email; if (!email) throw Object.assign(new Error("Email not provided by SSO provider"), { status: 400 }); const displayName = claims.name || claims.preferred_username || email.split("@")[0]; let user = await prisma.user.findUnique({ where: { email } }); if (!user) { user = await prisma.user.create({ data: { email, displayName, emailVerifiedAt: new Date() } }); const slug = displayName.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: `${displayName}'s Organization`, slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3 } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50 } }); } else { await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date(), displayName } }); } const session = await createSession(user.id); return { user, session }; } module.exports = { handleSsoCallback }; /***/ }) }; ; // load runtime var __webpack_require__ = require("../../../../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082], () => (__webpack_exec__(2842))); module.exports = __webpack_exports__; })();  @d(() => { var exports = {}; exports.id = 4310; exports.ids = [4310]; exports.modules = { /***/ 261:       , /***/ 2842: ; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/sso/callback/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { GET: () => (GET) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/sso/callback/route.js  const { handleSsoCallback } = require("../../../../../services/sso-service"); const { getOidcConfig, stateCookieName } = require("../../../../../lib/oidc"); const SESSION_MAX_AGE = 60 * 60 * 24 * 7; function getCookie(name, header) { const match = header?.match(new RegExp(`(?:^|;)\\s*${name}=([^;]+)`)); return match ? decodeURIComponent(match[1]) : null; } function setCookie(name, value, maxAge) { return `${name}=${value}; HttpOnly; ${"production" === "production" ? "Secure; " : ""}SameSite=Lax; Path=/; Max-Age=${maxAge}`; } export async function GET(request) { try { const { searchParams } = new URL(request.url); const code = searchParams.get("code"); const returnedState = searchParams.get("state"); const error = searchParams.get("error"); if (error) { return new Response(JSON.stringify({ error: `SSO provider returned: ${error}` }), { status: 400, headers: { "Content-Type": "application/json" } }); } if (!code) { return new Response(JSON.stringify({ error: "Missing authorization code" }), { status: 400, headers: { "Content-Type": "application/json" } }); } const cookieHeader = request.headers.get("cookie") || ""; const storedState = getCookie(stateCookieName(), cookieHeader); if (returnedState && storedState && returnedState !== storedState) { return new Response(JSON.stringify({ error: "State mismatch — possible CSRF" }), { status: 403, headers: { "Content-Type": "application/json" } }); } const { session } = await handleSsoCallback(code); const stateClear = `${stateCookieName()}=; HttpOnly; SameSite=Lax; Path=/; Max-Age=0`; const sessionCookie = setCookie("cosmic_session", session.token, SESSION_MAX_AGE); const config = getOidcConfig(); const baseUrl = config?.redirectUrl ? new URL(config.redirectUrl).origin : process.env.NEXT_PUBLIC_APP_URL || "http://localhost:8090"; return new Response(null, { status: 302, headers: { Location: `${baseUrl}/dashboard`, "Set-Cookie": `${sessionCookie}, ${stateClear}`, "Cache-Control": "no-store" } }); } catch (error) { const msg = error.message || "SSO callback failed"; const status = error.status || 500; return new Response(`

SSO Error

${msg}

Back to login`, { status, headers: { "Content-Type": "text/html" } }); } } 3036__webpack_require__undefined38749970undefined121127__webpack_require__undefined1291535617undefined451479 trueundefined4964970undefined543549undefined22542284"http://localhost:8090"undefined228923110undefined ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&name=app%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsso%2Fcallback%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\sso\\callback\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/sso/callback/route", pathname: "/api/auth/sso/callback", filename: "route", bundlePath: "app/api/auth/sso/callback/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\sso\\callback\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/sso/callback/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map z094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741501undefined16521670__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined17061714__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined19181953".next"undefined195819590undefined19862024 falseundefined22922291: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25972607__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26762765undefined27672773undefined30893109falseundefined31123176{}undefined33223361falseundefined38873902__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43604374__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined52165224__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56415654__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62586272__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined63086323__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63516368__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined64036424__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70607073__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80518064__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined95009524__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined96229643__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined999510008__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1019810211__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1045110465__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1103711048__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1171711735__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1217212180__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1273012744__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1321013223__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1364613672__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1371913732__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1379813819__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1413914159__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1422014231__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1472314736__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1483514842__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1509815112__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1533315351__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1569315704__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined166267module_compiled.AppRouteRouteModuleundefined303371route_kind.RouteKindundefined888933route_namespaceObjectundefined12391327(0,patch_fetch.patchFetch)undefined23962496(0,app_paths_.normalizeAppPath)undefined29543048no_fallback_error_external_.NoFallbackErrorundefined38903976(0,trace_tracer.getTracer)undefined43934489(0,request_meta.getRequestMeta)undefined50935186node.NodeNextRequestundefined52225317node.NodeNextResponseundefined53455436next_request.NextRequestAdapterundefined54715583(0,next_request.signalFromNodeResponse)undefined62196297constants.BaseServerSpanundefined72757371(0,request_meta.getRequestMeta)undefined88078926(0,web_utils.toNodeOutgoingHttpHeaders)undefined90249132lib_constants.NEXT_CACHE_TAGS_HEADERundefined94849576lib_constants.INFINITE_CACHEundefined97669858lib_constants.INFINITE_CACHEundefined1009810179response_cache.CachedRouteKindundefined1075110844(0,send_response/* sendResponse */.I)undefined1151311619(0,utils/* getRevalidateReason */.c)undefined1205612124route_kind.RouteKindundefined1267412755response_cache.CachedRouteKindundefined1322113317(0,request_meta.getRequestMeta)undefined1374013863(0,web_utils.fromNodeOutgoingHttpHeaders)undefined1391014006(0,request_meta.getRequestMeta)undefined1407214180lib_constants.NEXT_CACHE_TAGS_HEADERundefined1450014611(0,cache_control.getCacheControlHeader)undefined1467214765(0,send_response/* sendResponse */.I)undefined1525715335constants.BaseServerSpanundefined1543415500trace_tracer.SpanKindundefined1575615850no_fallback_error_external_.NoFallbackErrorundefined1607116177(0,utils/* getRevalidateReason */.c)undefined1651916612(0,send_response/* sendResponse */.I)undefined, /***/ 5617: "use strict"; const { randomBytes } = require("crypto"); function getOidcConfig() { if (process.env.COSMIC_SSO_ENABLED !== "true") return null; const issuer = process.env.COSMIC_OIDC_ISSUER; const clientId = process.env.COSMIC_OIDC_CLIENT_ID; const clientSecret = process.env.COSMIC_OIDC_CLIENT_SECRET; if (!issuer || !clientId || !clientSecret) return null; const redirectUrl = process.env.COSMIC_OIDC_REDIRECT_URL || (process.env.NEXT_PUBLIC_APP_URL || "http://localhost:8090") + "/api/auth/sso/callback"; return { issuer, clientId, clientSecret, redirectUrl }; } async function discoverProvider(issuer) { const discoUrl = process.env.COSMIC_OIDC_DISCOVERY_URL || issuer.replace(/\/+$/, "") + "/.well-known/openid-configuration"; const res = await fetch(discoUrl); if (!res.ok) throw new Error(`OIDC discovery failed (${res.status}) for ${discoUrl}`); return res.json(); } function base64UrlEncode(buf) { return buf.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); } function generateNonce() { return base64UrlEncode(randomBytes(32)); } function generateState() { return base64UrlEncode(randomBytes(32)); } function decodeJwtPayload(jwt) { const parts = jwt.split("."); if (parts.length !== 3) throw new Error("Invalid JWT format"); const payload = Buffer.from(parts[1], "base64url").toString("utf8"); return JSON.parse(payload); } function getCookieExpires() { return new Date(Date.now() + 10 * 60 * 1000).toUTCString(); } function stateCookieName() { return "cosmic_sso_state"; } module.exports = { getOidcConfig, discoverProvider, generateState, generateNonce, decodeJwtPayload, base64UrlEncode, stateCookieName, getCookieExpires }; s012undefined3844__webpack_require__undefined46535511undefined444474"http://localhost:8090"undefined4795010undefined, /***/ 9970:  }; ; // load runtime var __webpack_require__ = require("../../../../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082], () => (__webpack_exec__(2842)));  ^webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`#webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourced(() => { var exports = {}; exports.id = 8489; exports.ids = [8489]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 2488:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcel"use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson }; ` buffersourcesizemapshash_ function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSourcel"use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson };  012undefined /***/ }) /***/ ((module) => { "use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson }; /***/ })  ReplaceSourceRawSourcel"use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson };  012undefined, /***/ 2515:  <webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource1 // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/logout/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/logout/route.js webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceconst { logout } = require("../../../../services/auth-service"); const { errorResponse } = require("../../../../lib/http"); export async function POST(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (match) await logout(match[1]); return new Response(JSON.stringify({ ok: true }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=0`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } h=[acx|DA]no__webpack_require__85592488 true0buffersourcesizemapshashconst { logout } = __webpack_require__(8559); const { errorResponse } = __webpack_require__(2488); async function POST(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (match) await logout(match[1]); return new Response(JSON.stringify({ ok: true }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=; HttpOnly; ${ true ? 'Secure; ' : 0}SameSite=Lax; Path=/; Max-Age=0`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } {"finalSource":false}mapbufferedMap ReplaceSourceRawSourceconst { logout } = require("../../../../services/auth-service"); const { errorResponse } = require("../../../../lib/http"); export async function POST(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (match) await logout(match[1]); return new Response(JSON.stringify({ ok: true }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=0`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } 1925__webpack_require__undefined27618559undefined9197__webpack_require__undefined991202488undefined124130undefined577605 trueundefined6226230undefined ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Flogout%2Froute&name=app%2Fapi%2Fauth%2Flogout%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogout%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogout%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=!  Hwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource=import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/logout/route", pathname: "/api/auth/logout", filename: "route", bundlePath: "app/api/auth/logout/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/logout/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map c;^`_%'np "_abdm_e  T  B :BL_Z~n{MZ$%p%%&&''((*+--f/n/11t33(5RB5q5~5557)7f7q7]9j999::;;'=2=__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._".next"0 false: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._false{}__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__.__A // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new __WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._({ definition: { kind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, page: "/api/auth/logout/route", pathname: "/api/auth/logout", filename: "route", bundlePath: "app/api/auth/logout/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js", nextConfigOutput, userland: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._ }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return __WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/logout/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = __WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = __WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: __WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._(req); const nodeNextRes = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._(res); const nextReq = __WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._.fromNodeNextRequest(nodeNextReq, __WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== __WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = __WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(response.headers); if (cacheTags) { headers[__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = __WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(cacheEntry.value.headers); if (!(__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isIsr)) { headers.delete(__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', __WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._(cacheEntry.cacheControl)); } await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest, { spanName: `${method} ${req.url}`, kind: __WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map  =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/logout/route", pathname: "/api/auth/logout", filename: "route", bundlePath: "app/api/auth/logout/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/logout/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741494undefined16451663__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined16991707__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18931928".next"undefined193319340undefined19611999 falseundefined22602259: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25652575__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26442733undefined27352741undefined30513071falseundefined30743138{}undefined32843323falseundefined38493864__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43224336__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51785186__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56035616__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62206234__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62706285__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63136330__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63656386__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70227035__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80138026__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94629486__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95849605__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99579970__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1016010173__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1041310427__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1099911010__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1167911697__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1213412142__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1269212706__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1317213185__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1360813634__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1368113694__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1376013781__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1410114121__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1418214193__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1468514698__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1479714804__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1506015074__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1529515313__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1565515666__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined`"_ /s_= k i j#G@,zLH""!##_$I%&c&S'')=*,D-.=/c1133567666E788199z;;+<m<m==C>?h@@module_compiled.AppRouteRouteModuleroute_kind.RouteKindroute_namespaceObject(0,patch_fetch.patchFetch)(0,app_paths_.normalizeAppPath)no_fallback_error_external_.NoFallbackError(0,trace_tracer.getTracer)(0,request_meta.getRequestMeta)node.NodeNextRequestnode.NodeNextResponsenext_request.NextRequestAdapter(0,next_request.signalFromNodeResponse)constants.BaseServerSpan(0,web_utils.toNodeOutgoingHttpHeaders)lib_constants.NEXT_CACHE_TAGS_HEADERlib_constants.INFINITE_CACHEresponse_cache.CachedRouteKind(0,send_response/* sendResponse */.I)(0,utils/* getRevalidateReason */.c)(0,web_utils.fromNodeOutgoingHttpHeaders)(0,cache_control.getCacheControlHeader)trace_tracer.SpanKindbuffersourcesizemapshashH// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/logout/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/logout/route.js const { logout } = __webpack_require__(8559); const { errorResponse } = __webpack_require__(2488); async function POST(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (match) await logout(match[1]); return new Response(JSON.stringify({ ok: true }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=; HttpOnly; ${ true ? 'Secure; ' : 0}SameSite=Lax; Path=/; Max-Age=0`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Flogout%2Froute&name=app%2Fapi%2Fauth%2Flogout%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogout%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogout%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/logout/route", pathname: "/api/auth/logout", filename: "route", bundlePath: "app/api/auth/logout/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/logout/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map {"finalSource":true}mapbufferedMap ` ConcatSourceRawSource1 // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/logout/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/logout/route.js  ReplaceSourceReplaceSourceRawSourceconst { logout } = require("../../../../services/auth-service"); const { errorResponse } = require("../../../../lib/http"); export async function POST(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (match) await logout(match[1]); return new Response(JSON.stringify({ ok: true }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=0`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } 1925__webpack_require__undefined27618559undefined9197__webpack_require__undefined991202488undefined124130undefined577605 trueundefined6226230undefined RawSource ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Flogout%2Froute&name=app%2Fapi%2Fauth%2Flogout%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogout%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogout%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/logout/route", pathname: "/api/auth/logout", filename: "route", bundlePath: "app/api/auth/logout/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/logout/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741494undefined16451663__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined16991707__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18931928".next"undefined193319340undefined19611999 falseundefined22602259: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25652575__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26442733undefined27352741undefined30513071falseundefined30743138{}undefined32843323falseundefined38493864__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43224336__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51785186__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56035616__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62206234__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62706285__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63136330__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63656386__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70227035__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80138026__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94629486__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95849605__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99579970__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1016010173__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1041310427__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1099911010__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1167911697__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1213412142__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1269212706__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1317213185__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1360813634__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1368113694__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1376013781__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1410114121__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1418214193__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1468514698__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1479714804__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1506015074__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1529515313__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1565515666__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined166267module_compiled.AppRouteRouteModuleundefined303371route_kind.RouteKindundefined863908route_namespaceObjectundefined12141302(0,patch_fetch.patchFetch)undefined23652465(0,app_paths_.normalizeAppPath)undefined29233017no_fallback_error_external_.NoFallbackErrorundefined38593945(0,trace_tracer.getTracer)undefined43624458(0,request_meta.getRequestMeta)undefined50625155node.NodeNextRequestundefined51915286node.NodeNextResponseundefined53145405next_request.NextRequestAdapterundefined54405552(0,next_request.signalFromNodeResponse)undefined61886266constants.BaseServerSpanundefined72447340(0,request_meta.getRequestMeta)undefined87768895(0,web_utils.toNodeOutgoingHttpHeaders)undefined89939101lib_constants.NEXT_CACHE_TAGS_HEADERundefined94539545lib_constants.INFINITE_CACHEundefined97359827lib_constants.INFINITE_CACHEundefined1006710148response_cache.CachedRouteKindundefined1072010813(0,send_response/* sendResponse */.I)undefined1148211588(0,utils/* getRevalidateReason */.c)undefined1202512093route_kind.RouteKindundefined1264312724response_cache.CachedRouteKindundefined1319013286(0,request_meta.getRequestMeta)undefined1370913832(0,web_utils.fromNodeOutgoingHttpHeaders)undefined1387913975(0,request_meta.getRequestMeta)undefined1404114149lib_constants.NEXT_CACHE_TAGS_HEADERundefined1446914580(0,cache_control.getCacheControlHeader)undefined1464114734(0,send_response/* sendResponse */.I)undefined1522615304constants.BaseServerSpanundefined1540315469trace_tracer.SpanKindundefined1572515819no_fallback_error_external_.NoFallbackErrorundefined1604016146(0,utils/* getRevalidateReason */.c)undefined1648816581(0,send_response/* sendResponse */.I)undefined /***/ }) $I/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/logout/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/logout/route.js const { logout } = __webpack_require__(8559); const { errorResponse } = __webpack_require__(2488); async function POST(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (match) await logout(match[1]); return new Response(JSON.stringify({ ok: true }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=; HttpOnly; ${ true ? 'Secure; ' : 0}SameSite=Lax; Path=/; Max-Age=0`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Flogout%2Froute&name=app%2Fapi%2Fauth%2Flogout%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogout%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogout%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/logout/route", pathname: "/api/auth/logout", filename: "route", bundlePath: "app/api/auth/logout/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/logout/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map /***/ })  `_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; 1 // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/logout/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/logout/route.js  ReplaceSourceconst { logout } = require("../../../../services/auth-service"); const { errorResponse } = require("../../../../lib/http"); export async function POST(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (match) await logout(match[1]); return new Response(JSON.stringify({ ok: true }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=0`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } 1925__webpack_require__undefined27618559undefined9197__webpack_require__undefined991202488undefined124130undefined577605 trueundefined6226230undefined ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Flogout%2Froute&name=app%2Fapi%2Fauth%2Flogout%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogout%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogout%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/logout/route", pathname: "/api/auth/logout", filename: "route", bundlePath: "app/api/auth/logout/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/logout/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741494undefined16451663__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined16991707__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18931928".next"undefined193319340undefined19611999 falseundefined22602259: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25652575__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26442733undefined27352741undefined30513071falseundefined30743138{}undefined32843323falseundefined38493864__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43224336__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51785186__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56035616__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62206234__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62706285__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63136330__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63656386__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70227035__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80138026__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94629486__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95849605__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99579970__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1016010173__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1041310427__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1099911010__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1167911697__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1213412142__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1269212706__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1317213185__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1360813634__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1368113694__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1376013781__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1410114121__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1418214193__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1468514698__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1479714804__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1506015074__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1529515313__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1565515666__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined166267module_compiled.AppRouteRouteModuleundefined303371route_kind.RouteKindundefined863908route_namespaceObjectundefined12141302(0,patch_fetch.patchFetch)undefined23652465(0,app_paths_.normalizeAppPath)undefined29233017no_fallback_error_external_.NoFallbackErrorundefined38593945(0,trace_tracer.getTracer)undefined43624458(0,request_meta.getRequestMeta)undefined50625155node.NodeNextRequestundefined51915286node.NodeNextResponseundefined53145405next_request.NextRequestAdapterundefined54405552(0,next_request.signalFromNodeResponse)undefined61886266constants.BaseServerSpanundefined72447340(0,request_meta.getRequestMeta)undefined87768895(0,web_utils.toNodeOutgoingHttpHeaders)undefined89939101lib_constants.NEXT_CACHE_TAGS_HEADERundefined94539545lib_constants.INFINITE_CACHEundefined97359827lib_constants.INFINITE_CACHEundefined1006710148response_cache.CachedRouteKindundefined1072010813(0,send_response/* sendResponse */.I)undefined1148211588(0,utils/* getRevalidateReason */.c)undefined1202512093route_kind.RouteKindundefined1264312724response_cache.CachedRouteKindundefined1319013286(0,request_meta.getRequestMeta)undefined1370913832(0,web_utils.fromNodeOutgoingHttpHeaders)undefined1387913975(0,request_meta.getRequestMeta)undefined1404114149lib_constants.NEXT_CACHE_TAGS_HEADERundefined1446914580(0,cache_control.getCacheControlHeader)undefined1464114734(0,send_response/* sendResponse */.I)undefined1522615304constants.BaseServerSpanundefined1540315469trace_tracer.SpanKindundefined1572515819no_fallback_error_external_.NoFallbackErrorundefined1604016146(0,utils/* getRevalidateReason */.c)undefined1648816581(0,send_response/* sendResponse */.I)undefined, /***/ 3033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ })  \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");, /***/ 3421:  (webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcevar __webpack_unused_export__; webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "sendResponse", { enumerable: true, get: function() { return sendResponse; } }); const _helpers = require("./base-http/helpers"); const _pipereadable = require("./pipe-readable"); const _utils = require("./web/utils"); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map h :NNQO"$4GMO[0R__webpack_unused_export__ = ()Object.defineProperty(exports, "I", ())__webpack_require__123750887679 truebuffersourcesizemapshash var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "I", ({ enumerable: true, get: function() { return sendResponse; } })); const _helpers = __webpack_require__(1237); const _pipereadable = __webpack_require__(5088); const _utils = __webpack_require__(7679); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. true && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSourcevar __webpack_unused_export__; ReplaceSourceRawSource "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "sendResponse", { enumerable: true, get: function() { return sendResponse; } }); const _helpers = require("./base-http/helpers"); const _pipereadable = require("./pipe-readable"); const _utils = require("./web/utils"); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map;012undefined1458__webpack_unused_export__ = (undefined7878)undefined81127Object.defineProperty(exports, "I", (undefined210210))undefined230236__webpack_require__undefined2382581237undefined284290__webpack_require__undefined2923085088undefined327333__webpack_require__undefined3353477679undefined560594 trueundefined /***/ }) . /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "I", ({ enumerable: true, get: function() { return sendResponse; } })); const _helpers = __webpack_require__(1237); const _pipereadable = __webpack_require__(5088); const _utils = __webpack_require__(7679); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. true && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map /***/ })   S/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__;  "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "sendResponse", { enumerable: true, get: function() { return sendResponse; } }); const _helpers = require("./base-http/helpers"); const _pipereadable = require("./pipe-readable"); const _utils = require("./web/utils"); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map;012undefined1458__webpack_unused_export__ = (undefined7878)undefined81127Object.defineProperty(exports, "I", (undefined210210))undefined230236__webpack_require__undefined2382581237undefined284290__webpack_require__undefined2923085088undefined327333__webpack_require__undefined3353477679undefined560594 trueundefined, /***/ 4870:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Umodule.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js"); /***/ })  Umodule.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");, /***/ 5511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ })  #module.exports = require("crypto");, /***/ 5736:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource }webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceR"use strict"; if (process.env.NEXT_RUNTIME === 'edge') { module.exports = require('next/dist/server/route-modules/app-route/module.js'); } else { if (process.env.__NEXT_EXPERIMENTAL_REACT) { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js'); } } } else { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js'); } } } } //# sourceMappingURL=module.compiled.js.map  c 47Nfalse{}module.exports = __webpack_require__(4870)buffersourcesizemapshash if (false) {} else { if (false) {} else { if (false) {} else { if (false) {} else { module.exports = __webpack_require__(4870); } } } } //# sourceMappingURL=module.compiled.js.map {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceR"use strict"; if (process.env.NEXT_RUNTIME === 'edge') { module.exports = require('next/dist/server/route-modules/app-route/module.js'); } else { if (process.env.__NEXT_EXPERIMENTAL_REACT) { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js'); } } } else { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js'); } } } } //# sourceMappingURL=module.compiled.js.map012undefined1852falseundefined55141{}undefined158194falseundefined197906{}undefined927964falseundefined9671261{}undefined12861306falseundefined13091431{}undefined14561539module.exports = __webpack_require__(4870)undefined /***/ }) R/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (false) {} else { if (false) {} else { if (false) {} else { if (false) {} else { module.exports = __webpack_require__(4870); } } } } //# sourceMappingURL=module.compiled.js.map /***/ })  S/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; R"use strict"; if (process.env.NEXT_RUNTIME === 'edge') { module.exports = require('next/dist/server/route-modules/app-route/module.js'); } else { if (process.env.__NEXT_EXPERIMENTAL_REACT) { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js'); } } } else { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js'); } } } } //# sourceMappingURL=module.compiled.js.map012undefined1852falseundefined55141{}undefined158194falseundefined197906{}undefined927964falseundefined9671261{}undefined12861306falseundefined13091431{}undefined14561539module.exports = __webpack_require__(4870)undefined, /***/ 6330:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; +module.exports = require("@prisma/client");  /***/ }) Y/***/ ((module) => { "use strict"; module.exports = require("@prisma/client"); /***/ })  +module.exports = require("@prisma/client");, /***/ 6439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ }) z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ })  Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");, /***/ 6487:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/***/ (() => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource buffersourcesizemapshash {"finalSource":true}mapbufferedMap ReplaceSourceRawSource /***/ }) /***/ (() => { /***/ })  /***/ (() => { , /***/ 7964:  -webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; d '-/>C__webpack_require__6330false{}buffersourcesizemapshash const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSource "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; b012undefined3945__webpack_require__undefined47626330undefined175203falseundefined206253{}undefined /***/ }) {*/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; /***/ }) | S/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict";  "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; b012undefined3945__webpack_require__undefined47626330undefined175203falseundefined206253{}undefined, /***/ 8335:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/***/ (() => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource buffersourcesizemapshash {"finalSource":true}mapbufferedMap ReplaceSourceRawSource /***/ }) p ru vxz, /***/ 8559:  Hwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; k !')7SY[bu{}@__webpack_require__796455117082buffersourcesizemapshash( const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSource&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; 012undefined3339__webpack_require__undefined41557964undefined8389__webpack_require__undefined91985511undefined117123__webpack_require__undefined1251347082undefined /***/ }) i/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; /***/ }) jm n&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; 012undefined3339__webpack_require__undefined41557964undefined8389__webpack_require__undefined91985511undefined117123__webpack_require__undefined1251347082undefinednp, /***/ 9294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) _/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ }) `c defWmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");eg} }; ; // load runtime var __webpack_require__ = require("../../../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082], () => (__webpack_exec__(2515))); ,module.exports = __webpack_exports__; })(); mx(() => { var exports = {}; exports.id = 8489; exports.ids = [8489]; exports.modules = { /***/ 261: /***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 846: /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ }), /***/ 2488: /***/ ((module) => { "use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson }; /***/ }), /***/ 2515: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/logout/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/logout/route.js const { logout } = __webpack_require__(8559); const { errorResponse } = __webpack_require__(2488); async function POST(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (match) await logout(match[1]); return new Response(JSON.stringify({ ok: true }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=; HttpOnly; ${ true ? 'Secure; ' : 0}SameSite=Lax; Path=/; Max-Age=0`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Flogout%2Froute&name=app%2Fapi%2Fauth%2Flogout%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogout%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogout%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/logout/route", pathname: "/api/auth/logout", filename: "route", bundlePath: "app/api/auth/logout/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/logout/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map /***/ }), /***/ 3033: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }), /***/ 3421: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "I", ({ enumerable: true, get: function() { return sendResponse; } })); const _helpers = __webpack_require__(1237); const _pipereadable = __webpack_require__(5088); const _utils = __webpack_require__(7679); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. true && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map /***/ }), /***/ 4870: /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js"); /***/ }), /***/ 5511: /***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }), /***/ 5736: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (false) {} else { if (false) {} else { if (false) {} else { if (false) {} else { module.exports = __webpack_require__(4870); } } } } //# sourceMappingURL=module.compiled.js.map /***/ }), /***/ 6330: /***/ ((module) => { "use strict"; module.exports = require("@prisma/client"); /***/ }), /***/ 6439: /***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ }), /***/ 6487: /***/ (() => { /***/ }), /***/ 7964: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; /***/ }), /***/ 8335: /***/ (() => { /***/ }), /***/ 8559: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; /***/ }), /***/ 9294: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ }) }; ; // load runtime var __webpack_require__ = require("../../../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082], () => (__webpack_exec__(2515))); module.exports = __webpack_exports__; })();  @d(() => { var exports = {}; exports.id = 8489; exports.ids = [8489]; exports.modules = { /***/ 261:         , /***/ 2515: XYZ [\                                  var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082], () => (__webpack_exec__(2515)));   hwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`#webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourced(() => { var exports = {}; exports.id = 3745; exports.ids = [3745]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 2488:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcel"use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson }; ` buffersourcesizemapshash_ function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSourcel"use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson };  012undefined /***/ }) /***/ ((module) => { "use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson }; /***/ })  ReplaceSourceRawSourcel"use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson };  012undefined, /***/ 3033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ })  \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");, /***/ 3421:  (webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcevar __webpack_unused_export__; webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "sendResponse", { enumerable: true, get: function() { return sendResponse; } }); const _helpers = require("./base-http/helpers"); const _pipereadable = require("./pipe-readable"); const _utils = require("./web/utils"); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map h :NNQO"$4GMO[0R__webpack_unused_export__ = ()Object.defineProperty(exports, "I", ())__webpack_require__123750887679 truebuffersourcesizemapshash var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "I", ({ enumerable: true, get: function() { return sendResponse; } })); const _helpers = __webpack_require__(1237); const _pipereadable = __webpack_require__(5088); const _utils = __webpack_require__(7679); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. true && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSourcevar __webpack_unused_export__; ReplaceSourceRawSource "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "sendResponse", { enumerable: true, get: function() { return sendResponse; } }); const _helpers = require("./base-http/helpers"); const _pipereadable = require("./pipe-readable"); const _utils = require("./web/utils"); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map;012undefined1458__webpack_unused_export__ = (undefined7878)undefined81127Object.defineProperty(exports, "I", (undefined210210))undefined230236__webpack_require__undefined2382581237undefined284290__webpack_require__undefined2923085088undefined327333__webpack_require__undefined3353477679undefined560594 trueundefined /***/ }) . /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "I", ({ enumerable: true, get: function() { return sendResponse; } })); const _helpers = __webpack_require__(1237); const _pipereadable = __webpack_require__(5088); const _utils = __webpack_require__(7679); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. true && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map /***/ })   S/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__;  "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "sendResponse", { enumerable: true, get: function() { return sendResponse; } }); const _helpers = require("./base-http/helpers"); const _pipereadable = require("./pipe-readable"); const _utils = require("./web/utils"); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map;012undefined1458__webpack_unused_export__ = (undefined7878)undefined81127Object.defineProperty(exports, "I", (undefined210210))undefined230236__webpack_require__undefined2382581237undefined284290__webpack_require__undefined2923085088undefined327333__webpack_require__undefined3353477679undefined560594 trueundefined, /***/ 4870:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Umodule.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js"); /***/ })  Umodule.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");, /***/ 5511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ })  #module.exports = require("crypto");, /***/ 5736:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource }webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceR"use strict"; if (process.env.NEXT_RUNTIME === 'edge') { module.exports = require('next/dist/server/route-modules/app-route/module.js'); } else { if (process.env.__NEXT_EXPERIMENTAL_REACT) { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js'); } } } else { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js'); } } } } //# sourceMappingURL=module.compiled.js.map  c 47Nfalse{}module.exports = __webpack_require__(4870)buffersourcesizemapshash if (false) {} else { if (false) {} else { if (false) {} else { if (false) {} else { module.exports = __webpack_require__(4870); } } } } //# sourceMappingURL=module.compiled.js.map {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceR"use strict"; if (process.env.NEXT_RUNTIME === 'edge') { module.exports = require('next/dist/server/route-modules/app-route/module.js'); } else { if (process.env.__NEXT_EXPERIMENTAL_REACT) { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js'); } } } else { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js'); } } } } //# sourceMappingURL=module.compiled.js.map012undefined1852falseundefined55141{}undefined158194falseundefined197906{}undefined927964falseundefined9671261{}undefined12861306falseundefined13091431{}undefined14561539module.exports = __webpack_require__(4870)undefined /***/ }) R/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (false) {} else { if (false) {} else { if (false) {} else { if (false) {} else { module.exports = __webpack_require__(4870); } } } } //# sourceMappingURL=module.compiled.js.map /***/ })  S/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; R"use strict"; if (process.env.NEXT_RUNTIME === 'edge') { module.exports = require('next/dist/server/route-modules/app-route/module.js'); } else { if (process.env.__NEXT_EXPERIMENTAL_REACT) { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js'); } } } else { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js'); } } } } //# sourceMappingURL=module.compiled.js.map012undefined1852falseundefined55141{}undefined158194falseundefined197906{}undefined927964falseundefined9671261{}undefined12861306falseundefined13091431{}undefined14561539module.exports = __webpack_require__(4870)undefined, /***/ 6330:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; +module.exports = require("@prisma/client");  /***/ }) Y/***/ ((module) => { "use strict"; module.exports = require("@prisma/client"); /***/ })  +module.exports = require("@prisma/client");, /***/ 6439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ }) z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ })  Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");, /***/ 6487:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/***/ (() => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource buffersourcesizemapshash {"finalSource":true}mapbufferedMap ReplaceSourceRawSource /***/ }) /***/ (() => { /***/ })  /***/ (() => { , /***/ 7964:  -webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; d '-/>C__webpack_require__6330false{}buffersourcesizemapshash const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSource "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; b012undefined3945__webpack_require__undefined47626330undefined175203falseundefined206253{}undefined /***/ }) */***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; /***/ })  S/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict";  "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; b012undefined3945__webpack_require__undefined47626330undefined175203falseundefined206253{}undefined, /***/ 8335:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/***/ (() => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource buffersourcesizemapshash {"finalSource":true}mapbufferedMap ReplaceSourceRawSource /***/ })   , /***/ 8559:  Hwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; k !')7SY[bu{}@__webpack_require__796455117082buffersourcesizemapshash( const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSource&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; 012undefined3339__webpack_require__undefined41557964undefined8389__webpack_require__undefined91985511undefined117123__webpack_require__undefined1251347082undefined /***/ }) z/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; /***/ }) {~ &"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; 012undefined3339__webpack_require__undefined41557964undefined8389__webpack_require__undefined91985511undefined117123__webpack_require__undefined1251347082undefined, /***/ 8837:  /webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource %webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource1 // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/session/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { GET: () => (GET) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/session/route.js webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Wwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceconst { getSession } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse } = require("../../../../lib/http"); export async function GET(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (!match) return jsonResponse({ authenticated: false }); const session = await getSession(match[1]); if (!session) return jsonResponse({ authenticated: false }); return jsonResponse({ authenticated: true, user: { id: session.user.id, email: session.user.email, displayName: session.user.displayName }, memberships: session.user.memberships.map((item)=>({ organizationId: item.organizationId, organizationName: item.organization.name, role: item.role.code, permissions: item.role.permissions })) }); } catch (error) { return errorResponse(error); } } fAmsuB__webpack_require__85592488buffersourcesizemapshash_const { getSession } = __webpack_require__(8559); const { jsonResponse, errorResponse } = __webpack_require__(2488); async function GET(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (!match) return jsonResponse({ authenticated: false }); const session = await getSession(match[1]); if (!session) return jsonResponse({ authenticated: false }); return jsonResponse({ authenticated: true, user: { id: session.user.id, email: session.user.email, displayName: session.user.displayName }, memberships: session.user.memberships.map((item)=>({ organizationId: item.organizationId, organizationName: item.organization.name, role: item.role.code, permissions: item.role.permissions })) }); } catch (error) { return errorResponse(error); } } {"finalSource":false}mapbufferedMap ReplaceSourceRawSourceconst { getSession } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse } = require("../../../../lib/http"); export async function GET(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (!match) return jsonResponse({ authenticated: false }); const session = await getSession(match[1]); if (!session) return jsonResponse({ authenticated: false }); return jsonResponse({ authenticated: true, user: { id: session.user.id, email: session.user.email, displayName: session.user.displayName }, memberships: session.user.memberships.map((item)=>({ organizationId: item.organizationId, organizationName: item.organization.name, role: item.role.code, permissions: item.role.permissions })) }); } catch (error) { return errorResponse(error); } } u2329__webpack_require__undefined31658559undefined109115__webpack_require__undefined1171382488undefined142148undefined ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsession%2Froute&name=app%2Fapi%2Fauth%2Fsession%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsession%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsession%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=!  Hwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource=import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/session/route", pathname: "/api/auth/session", filename: "route", bundlePath: "app/api/auth/session/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/session/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map c;^`_%'np "_abdn_i  Y   H  @HR_`tS`$%v%%&&''((*+--l/t/11z33.5RH5w55557/7l7w7c9p999::;;-=8=__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._".next"0 false: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._false{}__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._dA // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new __WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._({ definition: { kind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, page: "/api/auth/session/route", pathname: "/api/auth/session", filename: "route", bundlePath: "app/api/auth/session/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js", nextConfigOutput, userland: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._ }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return __WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/session/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = __WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = __WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: __WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._(req); const nodeNextRes = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._(res); const nextReq = __WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._.fromNodeNextRequest(nodeNextReq, __WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== __WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = __WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(response.headers); if (cacheTags) { headers[__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = __WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(cacheEntry.value.headers); if (!(__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isIsr)) { headers.delete(__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', __WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._(cacheEntry.cacheControl)); } await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest, { spanName: `${method} ${req.url}`, kind: __WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map  =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/session/route", pathname: "/api/auth/session", filename: "route", bundlePath: "app/api/auth/session/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/session/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741495undefined16461664__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined17001708__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18971932".next"undefined193719380undefined19652003 falseundefined22652264: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25702580__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26492738undefined27402746undefined30573077falseundefined30803144{}undefined32903329falseundefined38553870__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43284342__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51845192__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56095622__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62266240__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62766291__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63196336__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63716392__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70287041__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80198032__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94689492__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95909611__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99639976__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1016610179__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1041910433__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1100511016__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1168511703__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1214012148__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1269812712__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1317813191__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1361413640__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1368713700__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1376613787__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1410714127__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1418814199__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1469114704__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1480314810__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1506615080__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1530115319__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1566115672__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined`"_ /scB p no(L"E1QM""&##_$N% &h&X'')B*,I-.B/h11335 6<666J788699;;0<r<r==C>?m@@module_compiled.AppRouteRouteModuleroute_kind.RouteKindroute_namespaceObject(0,patch_fetch.patchFetch)(0,app_paths_.normalizeAppPath)no_fallback_error_external_.NoFallbackError(0,trace_tracer.getTracer)(0,request_meta.getRequestMeta)node.NodeNextRequestnode.NodeNextResponsenext_request.NextRequestAdapter(0,next_request.signalFromNodeResponse)constants.BaseServerSpan(0,web_utils.toNodeOutgoingHttpHeaders)lib_constants.NEXT_CACHE_TAGS_HEADERlib_constants.INFINITE_CACHEresponse_cache.CachedRouteKind(0,send_response/* sendResponse */.I)(0,utils/* getRevalidateReason */.c)(0,web_utils.fromNodeOutgoingHttpHeaders)(0,cache_control.getCacheControlHeader)trace_tracer.SpanKindbuffersourcesizemapshash@J// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/session/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { GET: () => (GET) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/session/route.js const { getSession } = __webpack_require__(8559); const { jsonResponse, errorResponse } = __webpack_require__(2488); async function GET(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (!match) return jsonResponse({ authenticated: false }); const session = await getSession(match[1]); if (!session) return jsonResponse({ authenticated: false }); return jsonResponse({ authenticated: true, user: { id: session.user.id, email: session.user.email, displayName: session.user.displayName }, memberships: session.user.memberships.map((item)=>({ organizationId: item.organizationId, organizationName: item.organization.name, role: item.role.code, permissions: item.role.permissions })) }); } catch (error) { return errorResponse(error); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsession%2Froute&name=app%2Fapi%2Fauth%2Fsession%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsession%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsession%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/session/route", pathname: "/api/auth/session", filename: "route", bundlePath: "app/api/auth/session/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/session/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map {"finalSource":true}mapbufferedMap ` ConcatSourceRawSource1 // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/session/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { GET: () => (GET) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/session/route.js  ReplaceSourceReplaceSourceRawSourceconst { getSession } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse } = require("../../../../lib/http"); export async function GET(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (!match) return jsonResponse({ authenticated: false }); const session = await getSession(match[1]); if (!session) return jsonResponse({ authenticated: false }); return jsonResponse({ authenticated: true, user: { id: session.user.id, email: session.user.email, displayName: session.user.displayName }, memberships: session.user.memberships.map((item)=>({ organizationId: item.organizationId, organizationName: item.organization.name, role: item.role.code, permissions: item.role.permissions })) }); } catch (error) { return errorResponse(error); } } u2329__webpack_require__undefined31658559undefined109115__webpack_require__undefined1171382488undefined142148undefined RawSource ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsession%2Froute&name=app%2Fapi%2Fauth%2Fsession%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsession%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsession%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/session/route", pathname: "/api/auth/session", filename: "route", bundlePath: "app/api/auth/session/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/session/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741495undefined16461664__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined17001708__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18971932".next"undefined193719380undefined19652003 falseundefined22652264: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25702580__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26492738undefined27402746undefined30573077falseundefined30803144{}undefined32903329falseundefined38553870__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43284342__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51845192__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56095622__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62266240__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62766291__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63196336__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63716392__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70287041__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80198032__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94689492__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95909611__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99639976__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1016610179__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1041910433__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1100511016__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1168511703__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1214012148__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1269812712__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1317813191__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1361413640__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1368713700__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1376613787__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1410714127__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1418814199__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1469114704__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1480314810__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1506615080__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1530115319__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1566115672__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined166267module_compiled.AppRouteRouteModuleundefined303371route_kind.RouteKindundefined867912route_namespaceObjectundefined12181306(0,patch_fetch.patchFetch)undefined23702470(0,app_paths_.normalizeAppPath)undefined29283022no_fallback_error_external_.NoFallbackErrorundefined38643950(0,trace_tracer.getTracer)undefined43674463(0,request_meta.getRequestMeta)undefined50675160node.NodeNextRequestundefined51965291node.NodeNextResponseundefined53195410next_request.NextRequestAdapterundefined54455557(0,next_request.signalFromNodeResponse)undefined61936271constants.BaseServerSpanundefined72497345(0,request_meta.getRequestMeta)undefined87818900(0,web_utils.toNodeOutgoingHttpHeaders)undefined89989106lib_constants.NEXT_CACHE_TAGS_HEADERundefined94589550lib_constants.INFINITE_CACHEundefined97409832lib_constants.INFINITE_CACHEundefined1007210153response_cache.CachedRouteKindundefined1072510818(0,send_response/* sendResponse */.I)undefined1148711593(0,utils/* getRevalidateReason */.c)undefined1203012098route_kind.RouteKindundefined1264812729response_cache.CachedRouteKindundefined1319513291(0,request_meta.getRequestMeta)undefined1371413837(0,web_utils.fromNodeOutgoingHttpHeaders)undefined1388413980(0,request_meta.getRequestMeta)undefined1404614154lib_constants.NEXT_CACHE_TAGS_HEADERundefined1447414585(0,cache_control.getCacheControlHeader)undefined1464614739(0,send_response/* sendResponse */.I)undefined1523115309constants.BaseServerSpanundefined1540815474trace_tracer.SpanKindundefined1573015824no_fallback_error_external_.NoFallbackErrorundefined1604516151(0,utils/* getRevalidateReason */.c)undefined1649316586(0,send_response/* sendResponse */.I)undefined /***/ }) pJ/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/session/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { GET: () => (GET) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/session/route.js const { getSession } = __webpack_require__(8559); const { jsonResponse, errorResponse } = __webpack_require__(2488); async function GET(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (!match) return jsonResponse({ authenticated: false }); const session = await getSession(match[1]); if (!session) return jsonResponse({ authenticated: false }); return jsonResponse({ authenticated: true, user: { id: session.user.id, email: session.user.email, displayName: session.user.displayName }, memberships: session.user.memberships.map((item)=>({ organizationId: item.organizationId, organizationName: item.organization.name, role: item.role.code, permissions: item.role.permissions })) }); } catch (error) { return errorResponse(error); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsession%2Froute&name=app%2Fapi%2Fauth%2Fsession%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsession%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsession%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/session/route", pathname: "/api/auth/session", filename: "route", bundlePath: "app/api/auth/session/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/session/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map /***/ }) qt `u_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; t1 // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/session/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { GET: () => (GET) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/session/route.js  ReplaceSourceconst { getSession } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse } = require("../../../../lib/http"); export async function GET(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (!match) return jsonResponse({ authenticated: false }); const session = await getSession(match[1]); if (!session) return jsonResponse({ authenticated: false }); return jsonResponse({ authenticated: true, user: { id: session.user.id, email: session.user.email, displayName: session.user.displayName }, memberships: session.user.memberships.map((item)=>({ organizationId: item.organizationId, organizationName: item.organization.name, role: item.role.code, permissions: item.role.permissions })) }); } catch (error) { return errorResponse(error); } } u2329__webpack_require__undefined31658559undefined109115__webpack_require__undefined1171382488undefined142148undefinedr ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsession%2Froute&name=app%2Fapi%2Fauth%2Fsession%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsession%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsession%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/session/route", pathname: "/api/auth/session", filename: "route", bundlePath: "app/api/auth/session/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/session/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741495undefined16461664__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined17001708__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18971932".next"undefined193719380undefined19652003 falseundefined22652264: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25702580__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26492738undefined27402746undefined30573077falseundefined30803144{}undefined32903329falseundefined38553870__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43284342__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51845192__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined56095622__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62266240__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62766291__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63196336__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63716392__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70287041__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80198032__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94689492__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95909611__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99639976__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1016610179__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1041910433__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1100511016__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1168511703__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1214012148__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1269812712__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1317813191__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1361413640__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1368713700__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1376613787__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1410714127__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1418814199__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1469114704__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1480314810__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1506615080__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1530115319__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1566115672__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined166267module_compiled.AppRouteRouteModuleundefined303371route_kind.RouteKindundefined867912route_namespaceObjectundefined12181306(0,patch_fetch.patchFetch)undefined23702470(0,app_paths_.normalizeAppPath)undefined29283022no_fallback_error_external_.NoFallbackErrorundefined38643950(0,trace_tracer.getTracer)undefined43674463(0,request_meta.getRequestMeta)undefined50675160node.NodeNextRequestundefined51965291node.NodeNextResponseundefined53195410next_request.NextRequestAdapterundefined54455557(0,next_request.signalFromNodeResponse)undefined61936271constants.BaseServerSpanundefined72497345(0,request_meta.getRequestMeta)undefined87818900(0,web_utils.toNodeOutgoingHttpHeaders)undefined89989106lib_constants.NEXT_CACHE_TAGS_HEADERundefined94589550lib_constants.INFINITE_CACHEundefined97409832lib_constants.INFINITE_CACHEundefined1007210153response_cache.CachedRouteKindundefined1072510818(0,send_response/* sendResponse */.I)undefined1148711593(0,utils/* getRevalidateReason */.c)undefined1203012098route_kind.RouteKindundefined1264812729response_cache.CachedRouteKindundefined1319513291(0,request_meta.getRequestMeta)undefined1371413837(0,web_utils.fromNodeOutgoingHttpHeaders)undefined1388413980(0,request_meta.getRequestMeta)undefined1404614154lib_constants.NEXT_CACHE_TAGS_HEADERundefined1447414585(0,cache_control.getCacheControlHeader)undefined1464614739(0,send_response/* sendResponse */.I)undefined1523115309constants.BaseServerSpanundefined1540815474trace_tracer.SpanKindundefined1573015824no_fallback_error_external_.NoFallbackErrorundefined1604516151(0,utils/* getRevalidateReason */.c)undefined1649316586(0,send_response/* sendResponse */.I)undefinednp, /***/ 9294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) _/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ }) `c defWmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");eg} }; ; // load runtime var __webpack_require__ = require("../../../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082], () => (__webpack_exec__(8837))); ,module.exports = __webpack_exports__; })(); y(() => { var exports = {}; exports.id = 3745; exports.ids = [3745]; exports.modules = { /***/ 261: /***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 846: /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ }), /***/ 2488: /***/ ((module) => { "use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson }; /***/ }), /***/ 3033: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }), /***/ 3421: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "I", ({ enumerable: true, get: function() { return sendResponse; } })); const _helpers = __webpack_require__(1237); const _pipereadable = __webpack_require__(5088); const _utils = __webpack_require__(7679); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. true && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map /***/ }), /***/ 4870: /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js"); /***/ }), /***/ 5511: /***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }), /***/ 5736: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (false) {} else { if (false) {} else { if (false) {} else { if (false) {} else { module.exports = __webpack_require__(4870); } } } } //# sourceMappingURL=module.compiled.js.map /***/ }), /***/ 6330: /***/ ((module) => { "use strict"; module.exports = require("@prisma/client"); /***/ }), /***/ 6439: /***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ }), /***/ 6487: /***/ (() => { /***/ }), /***/ 7964: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; /***/ }), /***/ 8335: /***/ (() => { /***/ }), /***/ 8559: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; /***/ }), /***/ 8837: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/session/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { GET: () => (GET) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/session/route.js const { getSession } = __webpack_require__(8559); const { jsonResponse, errorResponse } = __webpack_require__(2488); async function GET(request) { try { const cookie = request.headers.get("cookie") || ""; const match = cookie.match(/cosmic_session=([^;]+)/); if (!match) return jsonResponse({ authenticated: false }); const session = await getSession(match[1]); if (!session) return jsonResponse({ authenticated: false }); return jsonResponse({ authenticated: true, user: { id: session.user.id, email: session.user.email, displayName: session.user.displayName }, memberships: session.user.memberships.map((item)=>({ organizationId: item.organizationId, organizationName: item.organization.name, role: item.role.code, permissions: item.role.permissions })) }); } catch (error) { return errorResponse(error); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Fsession%2Froute&name=app%2Fapi%2Fauth%2Fsession%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Fsession%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Fsession%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/session/route", pathname: "/api/auth/session", filename: "route", bundlePath: "app/api/auth/session/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/session/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map /***/ }), /***/ 9294: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ }) }; ; // load runtime var __webpack_require__ = require("../../../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082], () => (__webpack_exec__(8837))); module.exports = __webpack_exports__; })();  @d(() => { var exports = {}; exports.id = 3745; exports.ids = [3745]; exports.modules = { /***/ 261: , /***/ 8837: abcdefgvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082], () => (__webpack_exec__(8837)));  awebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`#webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourced(() => { var exports = {}; exports.id = 7758; exports.ids = [7758]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 940:  ^webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Qwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/ // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/login/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/login/route.js webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceconst { login } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse, parseJson } = require("../../../../lib/http"); export async function POST(request) { try { const body = await parseJson(request); const { user, session } = await login(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } f{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map c;^`_%'np "_abdl_~a O < 4<F_TxhuGT$%j%%&&''((**--`/h/11n3{3"5R<5k5x5557#7`7k7W9d999::;;!=,=__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._".next"0 false: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._false{}__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__.___WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__.___WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._ZA // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new __WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._({ definition: { kind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, page: "/api/auth/login/route", pathname: "/api/auth/login", filename: "route", bundlePath: "app/api/auth/login/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js", nextConfigOutput, userland: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._ }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return __WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/login/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = __WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = __WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: __WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._(req); const nodeNextRes = new __WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._(res); const nextReq = __WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._.fromNodeNextRequest(nodeNextReq, __WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== __WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = __WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(response.headers); if (cacheTags) { headers[__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= __WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._ ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: __WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== __WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = __WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._(cacheEntry.value.headers); if (!(__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._(req, 'minimalMode') && isIsr)) { headers.delete(__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', __WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._(cacheEntry.cacheControl)); } await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._.handleRequest, { spanName: `${method} ${req.url}`, kind: __WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof __WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: __WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await __WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map  =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/login/route", pathname: "/api/auth/login", filename: "route", bundlePath: "app/api/auth/login/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/login/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741493undefined16441662__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined16981706__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18891924".next"undefined192919300undefined19571995 falseundefined22552254: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25602570__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26392728undefined27302736undefined30453065falseundefined30683132{}undefined32783317falseundefined38433858__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43164330__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51725180__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined55975610__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62146228__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62646279__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63076324__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63596380__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70167029__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80078020__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94569480__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95789599__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99519964__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1015410167__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1040710421__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1099311004__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1167311691__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1212812136__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1268612700__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1316613179__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1360213628__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1367513688__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1375413775__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1409514115__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1417614187__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1467914692__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1479114798__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1505415068__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1528915307__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1564915660__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined`"_ /s[8 f deB;'uGC""##_$D%&^&N'')8*,?-.8/^1133562666@788,99u;;&<h<h==C> ?c@@module_compiled.AppRouteRouteModuleroute_kind.RouteKindroute_namespaceObject(0,patch_fetch.patchFetch)(0,app_paths_.normalizeAppPath)no_fallback_error_external_.NoFallbackError(0,trace_tracer.getTracer)(0,request_meta.getRequestMeta)node.NodeNextRequestnode.NodeNextResponsenext_request.NextRequestAdapter(0,next_request.signalFromNodeResponse)constants.BaseServerSpan(0,web_utils.toNodeOutgoingHttpHeaders)lib_constants.NEXT_CACHE_TAGS_HEADERlib_constants.INFINITE_CACHEresponse_cache.CachedRouteKind(0,send_response/* sendResponse */.I)(0,utils/* getRevalidateReason */.c)(0,web_utils.fromNodeOutgoingHttpHeaders)(0,cache_control.getCacheControlHeader)trace_tracer.SpanKindbuffersourcesizemapshash$I// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/login/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/login/route.js const { login } = __webpack_require__(8559); const { jsonResponse, errorResponse, parseJson } = __webpack_require__(2488); async function POST(request) { try { const body = await parseJson(request); const { user, session } = await login(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${ true ? 'Secure; ' : 0}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Flogin%2Froute&name=app%2Fapi%2Fauth%2Flogin%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogin%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogin%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/login/route", pathname: "/api/auth/login", filename: "route", bundlePath: "app/api/auth/login/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/login/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map {"finalSource":true}mapbufferedMap ` ConcatSourceRawSource/ // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/login/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/login/route.js  ReplaceSourceReplaceSourceRawSourceconst { login } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse, parseJson } = require("../../../../lib/http"); export async function POST(request) { try { const body = await parseJson(request); const { user, session } = await login(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } 1824__webpack_require__undefined26608559undefined115121__webpack_require__undefined1231442488undefined148154undefined675703 trueundefined7207210undefined RawSource ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Flogin%2Froute&name=app%2Fapi%2Fauth%2Flogin%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogin%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogin%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/login/route", pathname: "/api/auth/login", filename: "route", bundlePath: "app/api/auth/login/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/login/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741493undefined16441662__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined16981706__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18891924".next"undefined192919300undefined19571995 falseundefined22552254: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25602570__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26392728undefined27302736undefined30453065falseundefined30683132{}undefined32783317falseundefined38433858__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43164330__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51725180__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined55975610__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62146228__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62646279__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63076324__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63596380__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70167029__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80078020__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94569480__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95789599__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99519964__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1015410167__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1040710421__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1099311004__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1167311691__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1212812136__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1268612700__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1316613179__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1360213628__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1367513688__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1375413775__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1409514115__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1417614187__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1467914692__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1479114798__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1505415068__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1528915307__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1564915660__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined166267module_compiled.AppRouteRouteModuleundefined303371route_kind.RouteKindundefined859904route_namespaceObjectundefined12101298(0,patch_fetch.patchFetch)undefined23602460(0,app_paths_.normalizeAppPath)undefined29183012no_fallback_error_external_.NoFallbackErrorundefined38543940(0,trace_tracer.getTracer)undefined43574453(0,request_meta.getRequestMeta)undefined50575150node.NodeNextRequestundefined51865281node.NodeNextResponseundefined53095400next_request.NextRequestAdapterundefined54355547(0,next_request.signalFromNodeResponse)undefined61836261constants.BaseServerSpanundefined72397335(0,request_meta.getRequestMeta)undefined87718890(0,web_utils.toNodeOutgoingHttpHeaders)undefined89889096lib_constants.NEXT_CACHE_TAGS_HEADERundefined94489540lib_constants.INFINITE_CACHEundefined97309822lib_constants.INFINITE_CACHEundefined1006210143response_cache.CachedRouteKindundefined1071510808(0,send_response/* sendResponse */.I)undefined1147711583(0,utils/* getRevalidateReason */.c)undefined1202012088route_kind.RouteKindundefined1263812719response_cache.CachedRouteKindundefined1318513281(0,request_meta.getRequestMeta)undefined1370413827(0,web_utils.fromNodeOutgoingHttpHeaders)undefined1387413970(0,request_meta.getRequestMeta)undefined1403614144lib_constants.NEXT_CACHE_TAGS_HEADERundefined1446414575(0,cache_control.getCacheControlHeader)undefined1463614729(0,send_response/* sendResponse */.I)undefined1522115299constants.BaseServerSpanundefined1539815464trace_tracer.SpanKindundefined1572015814no_fallback_error_external_.NoFallbackErrorundefined1603516141(0,utils/* getRevalidateReason */.c)undefined1648316576(0,send_response/* sendResponse */.I)undefined /***/ }) I/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/login/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/login/route.js const { login } = __webpack_require__(8559); const { jsonResponse, errorResponse, parseJson } = __webpack_require__(2488); async function POST(request) { try { const body = await parseJson(request); const { user, session } = await login(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${ true ? 'Secure; ' : 0}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Flogin%2Froute&name=app%2Fapi%2Fauth%2Flogin%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogin%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogin%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/login/route", pathname: "/api/auth/login", filename: "route", bundlePath: "app/api/auth/login/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/login/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map /***/ })  `_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; / // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/login/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/login/route.js  ReplaceSourceReplaceSourceRawSourceconst { login } = require("../../../../services/auth-service"); const { jsonResponse, errorResponse, parseJson } = require("../../../../lib/http"); export async function POST(request) { try { const body = await parseJson(request); const { user, session } = await login(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${"production" === 'production' ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } 1824__webpack_require__undefined26608559undefined115121__webpack_require__undefined1231442488undefined148154undefined675703 trueundefined7207210undefined ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Flogin%2Froute&name=app%2Fapi%2Fauth%2Flogin%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogin%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogin%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! =import { AppRouteRouteModule } from "next/dist/server/route-modules/app-route/module.compiled"; import { RouteKind } from "next/dist/server/route-kind"; import { patchFetch as _patchFetch } from "next/dist/server/lib/patch-fetch"; import { getRequestMeta } from "next/dist/server/request-meta"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { NextRequestAdapter, signalFromNodeResponse } from "next/dist/server/web/spec-extension/adapters/next-request"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { sendResponse } from "next/dist/server/send-response"; import { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from "next/dist/server/web/utils"; import { getCacheControlHeader } from "next/dist/server/lib/cache-control"; import { INFINITE_CACHE, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; import { CachedRouteKind } from "next/dist/server/response-cache"; import * as userland from "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js"; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new AppRouteRouteModule({ definition: { kind: RouteKind.APP_ROUTE, page: "/api/auth/login/route", pathname: "/api/auth/login", filename: "route", bundlePath: "app/api/auth/login/route" }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js", nextConfigOutput, userland }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return _patchFetch({ workAsyncStorage, workUnitAsyncStorage }); } export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, }; export async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/login/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = normalizeAppPath(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new NodeNextRequest(req); const nodeNextRes = new NodeNextResponse(res); const nextReq = NextRequestAdapter.fromNodeNextRequest(nodeNextReq, signalFromNodeResponse(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!getRequestMeta(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = toNodeOutgoingHttpHeaders(response.headers); if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await sendResponse(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!getRequestMeta(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = fromNodeOutgoingHttpHeaders(cacheEntry.value.headers); if (!(getRequestMeta(req, 'minimalMode') && isIsr)) { headers.delete(NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', getCacheControlHeader(cacheEntry.cacheControl)); } await sendResponse(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: getRevalidateReason({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await sendResponse(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map y094undefined96151undefined153229undefined231293undefined295366undefined368446undefined448531undefined533651undefined653722undefined724800undefined802863undefined865964undefined9661040undefined10421122undefined11241205undefined12071272undefined12741493undefined16441662__WEBPACK_MODULE_REFERENCE__0_5b22417070526f757465526f7574654d6f64756c65225d_directImport_asiSafe1__._undefined16981706__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined18891924".next"undefined192919300undefined19571995 falseundefined22552254: __WEBPACK_MODULE_REFERENCE__16_ns_asiSafe1__._undefined25602570__WEBPACK_MODULE_REFERENCE__2_5b2270617463684665746368225d_call_directImport_asiSafe1__._undefined26392728undefined27302736undefined30453065falseundefined30683132{}undefined32783317falseundefined38433858__WEBPACK_MODULE_REFERENCE__5_5b226e6f726d616c697a6541707050617468225d_call_directImport_asiSafe1__._undefined43164330__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined51725180__WEBPACK_MODULE_REFERENCE__4_5b22676574547261636572225d_call_directImport_asiSafe1__._undefined55975610__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined62146228__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e65787452657175657374225d_directImport_asiSafe1__._undefined62646279__WEBPACK_MODULE_REFERENCE__6_5b224e6f64654e657874526573706f6e7365225d_directImport_asiSafe1__._undefined63076324__WEBPACK_MODULE_REFERENCE__7_5b224e6578745265717565737441646170746572225d_call_asiSafe1__._undefined63596380__WEBPACK_MODULE_REFERENCE__7_5b227369676e616c46726f6d4e6f6465526573706f6e7365225d_call_directImport_asiSafe1__._undefined70167029__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined80078020__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined94569480__WEBPACK_MODULE_REFERENCE__11_5b22746f4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined95789599__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined99519964__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1015410167__WEBPACK_MODULE_REFERENCE__13_5b22494e46494e4954455f4341434845225d_directImport_asiSafe1__._undefined1040710421__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1099311004__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1167311691__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1212812136__WEBPACK_MODULE_REFERENCE__1_5b22526f7574654b696e64225d_asiSafe1__._undefined1268612700__WEBPACK_MODULE_REFERENCE__15_5b22436163686564526f7574654b696e64225d_asiSafe1__._undefined1316613179__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1360213628__WEBPACK_MODULE_REFERENCE__11_5b2266726f6d4e6f64654f7574676f696e674874747048656164657273225d_call_directImport_asiSafe1__._undefined1367513688__WEBPACK_MODULE_REFERENCE__3_5b22676574526571756573744d657461225d_call_directImport_asiSafe1__._undefined1375413775__WEBPACK_MODULE_REFERENCE__13_5b224e4558545f43414348455f544147535f484541444552225d_directImport_asiSafe1__._undefined1409514115__WEBPACK_MODULE_REFERENCE__12_5b226765744361636865436f6e74726f6c486561646572225d_call_directImport_asiSafe1__._undefined1417614187__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined1467914692__WEBPACK_MODULE_REFERENCE__8_5b22426173655365727665725370616e225d_asiSafe1__._undefined1479114798__WEBPACK_MODULE_REFERENCE__4_5b225370616e4b696e64225d_asiSafe1__._undefined1505415068__WEBPACK_MODULE_REFERENCE__14_5b224e6f46616c6c6261636b4572726f72225d_directImport_asiSafe1__._undefined1528915307__WEBPACK_MODULE_REFERENCE__9_5b22676574526576616c6964617465526561736f6e225d_call_directImport_asiSafe1__._undefined1564915660__WEBPACK_MODULE_REFERENCE__10_5b2273656e64526573706f6e7365225d_call_directImport_asiSafe1__._undefined166267module_compiled.AppRouteRouteModuleundefined303371route_kind.RouteKindundefined859904route_namespaceObjectundefined12101298(0,patch_fetch.patchFetch)undefined23602460(0,app_paths_.normalizeAppPath)undefined29183012no_fallback_error_external_.NoFallbackErrorundefined38543940(0,trace_tracer.getTracer)undefined43574453(0,request_meta.getRequestMeta)undefined50575150node.NodeNextRequestundefined51865281node.NodeNextResponseundefined53095400next_request.NextRequestAdapterundefined54355547(0,next_request.signalFromNodeResponse)undefined61836261constants.BaseServerSpanundefined72397335(0,request_meta.getRequestMeta)undefined87718890(0,web_utils.toNodeOutgoingHttpHeaders)undefined89889096lib_constants.NEXT_CACHE_TAGS_HEADERundefined94489540lib_constants.INFINITE_CACHEundefined97309822lib_constants.INFINITE_CACHEundefined1006210143response_cache.CachedRouteKindundefined1071510808(0,send_response/* sendResponse */.I)undefined1147711583(0,utils/* getRevalidateReason */.c)undefined1202012088route_kind.RouteKindundefined1263812719response_cache.CachedRouteKindundefined1318513281(0,request_meta.getRequestMeta)undefined1370413827(0,web_utils.fromNodeOutgoingHttpHeaders)undefined1387413970(0,request_meta.getRequestMeta)undefined1403614144lib_constants.NEXT_CACHE_TAGS_HEADERundefined1446414575(0,cache_control.getCacheControlHeader)undefined1463614729(0,send_response/* sendResponse */.I)undefined1522115299constants.BaseServerSpanundefined1539815464trace_tracer.SpanKindundefined1572015814no_fallback_error_external_.NoFallbackErrorundefined1603516141(0,utils/* getRevalidateReason */.c)undefined1648316576(0,send_response/* sendResponse */.I)undefined, /***/ 2488:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcel"use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson }; ` buffersourcesizemapshash_ function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSourcel"use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson };  012undefined /***/ }) /***/ ((module) => { "use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson }; /***/ })  l"use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson };  012undefined, /***/ 3033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ })  \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");, /***/ 3421:  (webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcevar __webpack_unused_export__; webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "sendResponse", { enumerable: true, get: function() { return sendResponse; } }); const _helpers = require("./base-http/helpers"); const _pipereadable = require("./pipe-readable"); const _utils = require("./web/utils"); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map h :NNQO"$4GMO[0R__webpack_unused_export__ = ()Object.defineProperty(exports, "I", ())__webpack_require__123750887679 truebuffersourcesizemapshash var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "I", ({ enumerable: true, get: function() { return sendResponse; } })); const _helpers = __webpack_require__(1237); const _pipereadable = __webpack_require__(5088); const _utils = __webpack_require__(7679); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. true && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSourcevar __webpack_unused_export__; ReplaceSourceRawSource "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "sendResponse", { enumerable: true, get: function() { return sendResponse; } }); const _helpers = require("./base-http/helpers"); const _pipereadable = require("./pipe-readable"); const _utils = require("./web/utils"); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map;012undefined1458__webpack_unused_export__ = (undefined7878)undefined81127Object.defineProperty(exports, "I", (undefined210210))undefined230236__webpack_require__undefined2382581237undefined284290__webpack_require__undefined2923085088undefined327333__webpack_require__undefined3353477679undefined560594 trueundefined /***/ }) . /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "I", ({ enumerable: true, get: function() { return sendResponse; } })); const _helpers = __webpack_require__(1237); const _pipereadable = __webpack_require__(5088); const _utils = __webpack_require__(7679); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. true && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map /***/ })   S/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__;  "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "sendResponse", { enumerable: true, get: function() { return sendResponse; } }); const _helpers = require("./base-http/helpers"); const _pipereadable = require("./pipe-readable"); const _utils = require("./web/utils"); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map;012undefined1458__webpack_unused_export__ = (undefined7878)undefined81127Object.defineProperty(exports, "I", (undefined210210))undefined230236__webpack_require__undefined2382581237undefined284290__webpack_require__undefined2923085088undefined327333__webpack_require__undefined3353477679undefined560594 trueundefined, /***/ 4870:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Umodule.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js"); /***/ })  Umodule.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");, /***/ 5511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) Q/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ })  #module.exports = require("crypto");, /***/ 5736:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource }webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceR"use strict"; if (process.env.NEXT_RUNTIME === 'edge') { module.exports = require('next/dist/server/route-modules/app-route/module.js'); } else { if (process.env.__NEXT_EXPERIMENTAL_REACT) { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js'); } } } else { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js'); } } } } //# sourceMappingURL=module.compiled.js.map  c 47Nfalse{}module.exports = __webpack_require__(4870)buffersourcesizemapshash if (false) {} else { if (false) {} else { if (false) {} else { if (false) {} else { module.exports = __webpack_require__(4870); } } } } //# sourceMappingURL=module.compiled.js.map {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceR"use strict"; if (process.env.NEXT_RUNTIME === 'edge') { module.exports = require('next/dist/server/route-modules/app-route/module.js'); } else { if (process.env.__NEXT_EXPERIMENTAL_REACT) { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js'); } } } else { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js'); } } } } //# sourceMappingURL=module.compiled.js.map012undefined1852falseundefined55141{}undefined158194falseundefined197906{}undefined927964falseundefined9671261{}undefined12861306falseundefined13091431{}undefined14561539module.exports = __webpack_require__(4870)undefined /***/ }) R/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (false) {} else { if (false) {} else { if (false) {} else { if (false) {} else { module.exports = __webpack_require__(4870); } } } } //# sourceMappingURL=module.compiled.js.map /***/ })  S/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; R"use strict"; if (process.env.NEXT_RUNTIME === 'edge') { module.exports = require('next/dist/server/route-modules/app-route/module.js'); } else { if (process.env.__NEXT_EXPERIMENTAL_REACT) { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo-experimental.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route-experimental.runtime.prod.js'); } } } else { if (process.env.NODE_ENV === 'development') { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.dev.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js'); } } else { if (process.env.TURBOPACK) { module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js'); } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js'); } } } } //# sourceMappingURL=module.compiled.js.map012undefined1852falseundefined55141{}undefined158194falseundefined197906{}undefined927964falseundefined9671261{}undefined12861306falseundefined13091431{}undefined14561539module.exports = __webpack_require__(4870)undefined, /***/ 6330:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; +module.exports = require("@prisma/client");  /***/ }) Y/***/ ((module) => { "use strict"; module.exports = require("@prisma/client"); /***/ })  +module.exports = require("@prisma/client");, /***/ 6439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ }) z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ })  Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");, /***/ 6487:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/***/ (() => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource buffersourcesizemapshash {"finalSource":true}mapbufferedMap ReplaceSourceRawSource /***/ }) /***/ (() => { /***/ })  /***/ (() => { , /***/ 7964:  -webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; d '-/>C__webpack_require__6330false{}buffersourcesizemapshash const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSource "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; b012undefined3945__webpack_require__undefined47626330undefined175203falseundefined206253{}undefined /***/ }) {*/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; /***/ }) | S/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict";  "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; b012undefined3945__webpack_require__undefined47626330undefined175203falseundefined206253{}undefined, /***/ 8335:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/***/ (() => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource buffersourcesizemapshash {"finalSource":true}mapbufferedMap ReplaceSourceRawSource /***/ }) p ru vxz, /***/ 8559:  Hwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; k !')7SY[bu{}@__webpack_require__796455117082buffersourcesizemapshash( const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSource&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; 012undefined3339__webpack_require__undefined41557964undefined8389__webpack_require__undefined91985511undefined117123__webpack_require__undefined1251347082undefined /***/ }) i/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; /***/ }) jm n&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; 012undefined3339__webpack_require__undefined41557964undefined8389__webpack_require__undefined91985511undefined117123__webpack_require__undefined1251347082undefinednp, /***/ 9294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) _/***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ }) `c defWmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");eg} }; ; // load runtime var __webpack_require__ = require("../../../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082], () => (__webpack_exec__(940))); ,module.exports = __webpack_exports__; })(); x(() => { var exports = {}; exports.id = 7758; exports.ids = [7758]; exports.modules = { /***/ 261: /***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 846: /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ }), /***/ 940: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { handler: () => (/* binding */ handler), patchFetch: () => (/* binding */ patchFetch), routeModule: () => (/* binding */ routeModule), serverHooks: () => (/* binding */ serverHooks), workAsyncStorage: () => (/* binding */ workAsyncStorage), workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage) }); // NAMESPACE OBJECT: ./src/app/api/auth/login/route.js var route_namespaceObject = {}; __webpack_require__.r(route_namespaceObject); __webpack_require__.d(route_namespaceObject, { POST: () => (POST) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-route/module.compiled.js var module_compiled = __webpack_require__(5736); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-kind.js var route_kind = __webpack_require__(9117); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/patch-fetch.js var patch_fetch = __webpack_require__(4044); // EXTERNAL MODULE: ./node_modules/next/dist/server/request-meta.js var request_meta = __webpack_require__(9326); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/tracer.js var trace_tracer = __webpack_require__(2324); // EXTERNAL MODULE: external "next/dist/shared/lib/router/utils/app-paths" var app_paths_ = __webpack_require__(261); // EXTERNAL MODULE: ./node_modules/next/dist/server/base-http/node.js var node = __webpack_require__(4290); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/spec-extension/adapters/next-request.js var next_request = __webpack_require__(5328); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/trace/constants.js var constants = __webpack_require__(8928); // EXTERNAL MODULE: ./node_modules/next/dist/server/instrumentation/utils.js var utils = __webpack_require__(6595); // EXTERNAL MODULE: ./node_modules/next/dist/server/send-response.js var send_response = __webpack_require__(3421); // EXTERNAL MODULE: ./node_modules/next/dist/server/web/utils.js var web_utils = __webpack_require__(7679); // EXTERNAL MODULE: ./node_modules/next/dist/server/lib/cache-control.js var cache_control = __webpack_require__(1681); // EXTERNAL MODULE: ./node_modules/next/dist/lib/constants.js var lib_constants = __webpack_require__(3446); // EXTERNAL MODULE: external "next/dist/shared/lib/no-fallback-error.external" var no_fallback_error_external_ = __webpack_require__(6439); // EXTERNAL MODULE: ./node_modules/next/dist/server/response-cache/index.js var response_cache = __webpack_require__(1356); ;// ./src/app/api/auth/login/route.js const { login } = __webpack_require__(8559); const { jsonResponse, errorResponse, parseJson } = __webpack_require__(2488); async function POST(request) { try { const body = await parseJson(request); const { user, session } = await login(body); return new Response(JSON.stringify({ user: { id: user.id, email: user.email, displayName: user.displayName } }), { status: 200, headers: { "Content-Type": "application/json", "Set-Cookie": `cosmic_session=${session.token}; HttpOnly; ${ true ? 'Secure; ' : 0}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 7}`, "Cache-Control": "no-store" } }); } catch (error) { return errorResponse(error); } } ;// ./node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js?page=%2Fapi%2Fauth%2Flogin%2Froute&name=app%2Fapi%2Fauth%2Flogin%2Froute&pagePath=private-next-app-dir%2Fapi%2Fauth%2Flogin%2Froute.js&appDir=C%3A%5CUsers%5Cabd_b%5COneDrive%5CDesktop%5CCOSMIC%20AI-Risk%20Dashboard%5CStep%2012%20is%20complete%20Final%20QA%2C%20Demo%20Readiness%2C%20and%20Submission%20Freeze%5Capplication%5Csaas-app%5Csrc%5Capp&appPaths=%2Fapi%2Fauth%2Flogin%2Froute&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&basePath=&assetPrefix=&nextConfigOutput=standalone&preferredRegion=&middlewareConfig=e30%3D&isGlobalNotFoundEnabled=! // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = "standalone" const routeModule = new module_compiled.AppRouteRouteModule({ definition: { kind: route_kind.RouteKind.APP_ROUTE, page: "/api/auth/login/route", pathname: "/api/auth/login", filename: "route", bundlePath: "app/api/auth/login/route" }, distDir: ".next" || 0, relativeProjectDir: false || '', resolvedPagePath: "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js", nextConfigOutput, userland: route_namespaceObject }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0,patch_fetch.patchFetch)({ workAsyncStorage, workUnitAsyncStorage }); } async function handler(req, res, ctx) { var _nextConfig_experimental; let srcPage = "/api/auth/login/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, params, nextConfig, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname } = prepareResult; const normalizedSrcPage = (0,app_paths_.normalizeAppPath)(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { throw new no_fallback_error_external_.NoFallbackError(); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = // If we're in development, we always support dynamic HTML routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isRevalidate = isIsr && !supportsDynamicResponse; const method = req.method || 'GET'; const tracer = (0,trace_tracer.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); const context = { params, prerenderManifest, renderOpts: { experimental: { cacheComponents: Boolean(nextConfig.experimental.cacheComponents), authInterrupts: Boolean(nextConfig.experimental.authInterrupts) }, supportsDynamicResponse, incrementalCache: (0,request_meta.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: (_nextConfig_experimental = nextConfig.experimental) == null ? void 0 : _nextConfig_experimental.cacheLife, isRevalidate, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext) }, sharedContext: { buildId } }; const nodeNextReq = new node.NodeNextRequest(req); const nodeNextRes = new node.NodeNextResponse(res); const nextReq = next_request.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_request.signalFromNodeResponse)(res)); try { const invokeRouteModule = async (span)=>{ return routeModule.handle(nextReq, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== constants.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const handleResponse = async (currentSpan)=>{ var _cacheEntry_value; const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!(0,request_meta.getRequestMeta)(req, 'minimalMode') && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await invokeRouteModule(currentSpan); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0,web_utils.toNodeOutgoingHttpHeaders)(response.headers); if (cacheTags) { headers[lib_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= lib_constants.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= lib_constants.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: response_cache.CachedRouteKind.APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }, routerServerContext); } throw err; } }; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: route_kind.RouteKind.APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil }); // we don't create a cacheEntry for ISR if (!isIsr) { return null; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== response_cache.CachedRouteKind.APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!(0,request_meta.getRequestMeta)(req, 'minimalMode')) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0,web_utils.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers); if (!((0,request_meta.getRequestMeta)(req, 'minimalMode') && isIsr)) { headers.delete(lib_constants.NEXT_CACHE_TAGS_HEADER); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0,cache_control.getCacheControlHeader)(cacheEntry.cacheControl)); } await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return null; }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(constants.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: trace_tracer.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof no_fallback_error_external_.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0,utils/* getRevalidateReason */.c)({ isRevalidate, isOnDemandRevalidate }) }); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0,send_response/* sendResponse */.I)(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return null; } } //# sourceMappingURL=app-route.js.map /***/ }), /***/ 2488: /***/ ((module) => { "use strict"; function jsonResponse(payload, status = 200, headers = {}) { return Response.json(payload, { status, headers: Object.assign({ "Cache-Control": "no-store" }, headers) }); } function errorResponse(error) { return jsonResponse({ error: error.message || "Unexpected error", details: error.details || undefined }, error.status || 500); } async function parseJson(request) { const text = await request.text(); if (!text) return {}; return JSON.parse(text); } module.exports = { jsonResponse, errorResponse, parseJson }; /***/ }), /***/ 3033: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }), /***/ 3421: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "I", ({ enumerable: true, get: function() { return sendResponse; } })); const _helpers = __webpack_require__(1237); const _pipereadable = __webpack_require__(5088); const _utils = __webpack_require__(7679); async function sendResponse(req, res, response, waitUntil) { if (// The type check here ensures that `req` is correctly typed, and the // environment variable check provides dead code elimination. true && (0, _helpers.isNodeNextResponse)(res)) { var // Copy over the response headers. _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, _utils.splitCookiesString)(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, _pipereadable.pipeToNodeResponse)(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } //# sourceMappingURL=send-response.js.map /***/ }), /***/ 4870: /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js"); /***/ }), /***/ 5511: /***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }), /***/ 5736: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (false) {} else { if (false) {} else { if (false) {} else { if (false) {} else { module.exports = __webpack_require__(4870); } } } } //# sourceMappingURL=module.compiled.js.map /***/ }), /***/ 6330: /***/ ((module) => { "use strict"; module.exports = require("@prisma/client"); /***/ }), /***/ 6439: /***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ }), /***/ 6487: /***/ (() => { /***/ }), /***/ 7964: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; /***/ }), /***/ 8335: /***/ (() => { /***/ }), /***/ 8559: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; /***/ }), /***/ 9294: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ }) }; ; // load runtime var __webpack_require__ = require("../../../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082], () => (__webpack_exec__(940))); module.exports = __webpack_exports__; })();  @d(() => { var exports = {}; exports.id = 7758; exports.ids = [7758]; exports.modules = { /***/ 261: , /***/ 940: mnopqrsvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082], () => (__webpack_exec__(940)));  Ef webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource`Awebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourced(() => { var exports = {}; exports.id = 8974; exports.ids = [8974]; exports.modules = { /***/ 261: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 'webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Hmodule.exports = require("next/dist/shared/lib/router/utils/app-paths");  /***/ }) buffersourcesizemapshashv/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }) {"finalSource":true}mapbufferedMap ConcatSourceRawSource$/***/ ((module) => { "use strict";  RawSourceHmodule.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 345:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ LogoutButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1124); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx } from "react/jsx-runtime"; export default function LogoutButton({ className, children }) { return /*#__PURE__*/ _jsx("form", { action: "/api/auth/logout", method: "POST", onSubmit: async (e)=>{ e.preventDefault(); await fetch('/api/auth/logout', { method: 'POST' }); window.location.href = '/'; }, children: /*#__PURE__*/ _jsx("button", { type: "submit", className: className, children: children || 'Sign out' }) }); } c=ln|C(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)buffersourcesizemapshashb/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ LogoutButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1124); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* __next_internal_client_entry_do_not_use__ default auto */ function LogoutButton({ className, children }) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("form", { action: "/api/auth/logout", method: "POST", onSubmit: async (e)=>{ e.preventDefault(); await fetch('/api/auth/logout', { method: 'POST' }); window.location.href = '/'; }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", className: className, children: children || 'Sign out' }) }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ LogoutButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1124); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx } from "react/jsx-runtime"; export default function LogoutButton({ className, children }) { return /*#__PURE__*/ _jsx("form", { action: "/api/auth/logout", method: "POST", onSubmit: async (e)=>{ e.preventDefault(); await fetch('/api/auth/logout', { method: 'POST' }); window.location.href = '/'; }, children: /*#__PURE__*/ _jsx("button", { type: "submit", className: className, children: children || 'Sign out' }) }); } 61108undefined110124undefined199202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ LogoutButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1124); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* __next_internal_client_entry_do_not_use__ default auto */ function LogoutButton({ className, children }) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("form", { action: "/api/auth/logout", method: "POST", onSubmit: async (e)=>{ e.preventDefault(); await fetch('/api/auth/logout', { method: 'POST' }); window.location.href = '/'; }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", className: className, children: children || 'Sign out' }) }); } /***/ })   _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ LogoutButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1124); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSource/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx } from "react/jsx-runtime"; export default function LogoutButton({ className, children }) { return /*#__PURE__*/ _jsx("form", { action: "/api/auth/logout", method: "POST", onSubmit: async (e)=>{ e.preventDefault(); await fetch('/api/auth/logout', { method: 'POST' }); window.location.href = '/'; }, children: /*#__PURE__*/ _jsx("button", { type: "submit", className: className, children: children || 'Sign out' }) }); } 61108undefined110124undefined199202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 846:  3webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ })  Tmodule.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");, /***/ 1025:  @webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js"); /***/ })  amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");, /***/ 1135:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/***/ (() => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource buffersourcesizemapshash {"finalSource":true}mapbufferedMap ReplaceSourceRawSource /***/ }) /***/ (() => { /***/ })  /***/ (() => { , /***/ 1459:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/***/ (() => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource buffersourcesizemapshash {"finalSource":true}mapbufferedMap ReplaceSourceRawSource /***/ })   , /***/ 1619:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceK import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\builtin\\global-error.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\client-page.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\client-segment.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\http-access-fallback\\error-boundary.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\layout-router.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\metadata\\async-metadata.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\render-from-template-context.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\lib\\framework\\boundary-components.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\lib\\metadata\\generate\\icon-mark.js");  P   !&#(05AFEJH Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1170, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3597, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 6893, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9748, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 6060, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7184, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9576, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3041, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1384, 23))buffersourcesizemapshashPromise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1170, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3597, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 6893, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9748, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 6060, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7184, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9576, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3041, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1384, 23)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceK import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\builtin\\global-error.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\client-page.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\client-segment.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\http-access-fallback\\error-boundary.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\layout-router.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\metadata\\async-metadata.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\render-from-template-context.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\lib\\framework\\boundary-components.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\lib\\metadata\\generate\\icon-mark.js"); 0261Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1170, 23))undefined266517Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3597, 23))undefined522776Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 6893, 23))undefined7811057Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9748, 23))undefined10621315Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 6060, 23))undefined13201584Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7184, 23))undefined15891857Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9576, 23))undefined18622117Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3041, 23))undefined21222376Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1384, 23))undefined /***/ }) /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1170, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3597, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 6893, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9748, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 6060, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7184, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9576, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3041, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1384, 23)); /***/ })  V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { K import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\builtin\\global-error.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\client-page.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\client-segment.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\http-access-fallback\\error-boundary.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\layout-router.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\metadata\\async-metadata.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\render-from-template-context.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\lib\\framework\\boundary-components.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\lib\\metadata\\generate\\icon-mark.js"); 0261Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1170, 23))undefined266517Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3597, 23))undefined522776Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 6893, 23))undefined7811057Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9748, 23))undefined10621315Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 6060, 23))undefined13201584Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7184, 23))undefined15891857Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9576, 23))undefined18622117Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3041, 23))undefined21222376Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1384, 23))undefined, /***/ 1662:  Ywebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ RootLayout), /* harmony export */ metadata: () => (/* binding */ metadata) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5338); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _globals_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1135); /* harmony import */ var _globals_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_globals_css__WEBPACK_IMPORTED_MODULE_1__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceimport { jsx as _jsx } from "react/jsx-runtime"; import "./globals.css"; export const metadata = { title: "COSMIC AI-Risk SaaS", description: "Commercial multi-tenant COSMIC AI-Risk governance platform" }; export default function RootLayout({ children }) { return /*#__PURE__*/ _jsx("html", { lang: "en", children: /*#__PURE__*/ _jsx("body", { children: children }) }); } d/1GIOE"%eh(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)buffersourcesizemapshash__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ RootLayout), /* harmony export */ metadata: () => (/* binding */ metadata) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5338); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _globals_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1135); /* harmony import */ var _globals_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_globals_css__WEBPACK_IMPORTED_MODULE_1__); const metadata = { title: "COSMIC AI-Risk SaaS", description: "Commercial multi-tenant COSMIC AI-Risk governance platform" }; function RootLayout({ children }) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("html", { lang: "en", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("body", { children: children }) }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ RootLayout), /* harmony export */ metadata: () => (/* binding */ metadata) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5338); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _globals_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1135); /* harmony import */ var _globals_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_globals_css__WEBPACK_IMPORTED_MODULE_1__); ReplaceSourceRawSourceimport { jsx as _jsx } from "react/jsx-runtime"; import "./globals.css"; export const metadata = { title: "COSMIC AI-Risk SaaS", description: "Commercial multi-tenant COSMIC AI-Risk governance platform" }; export default function RootLayout({ children }) { return /*#__PURE__*/ _jsx("html", { lang: "en", children: /*#__PURE__*/ _jsx("body", { children: children }) }); } 047undefined4971undefined7379undefined214228undefined290293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined357360(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) */***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ RootLayout), /* harmony export */ metadata: () => (/* binding */ metadata) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5338); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _globals_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1135); /* harmony import */ var _globals_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_globals_css__WEBPACK_IMPORTED_MODULE_1__); const metadata = { title: "COSMIC AI-Risk SaaS", description: "Commercial multi-tenant COSMIC AI-Risk governance platform" }; function RootLayout({ children }) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("html", { lang: "en", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("body", { children: children }) }); } /***/ })   __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ RootLayout), /* harmony export */ metadata: () => (/* binding */ metadata) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5338); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _globals_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1135); /* harmony import */ var _globals_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_globals_css__WEBPACK_IMPORTED_MODULE_1__); import { jsx as _jsx } from "react/jsx-runtime"; import "./globals.css"; export const metadata = { title: "COSMIC AI-Risk SaaS", description: "Commercial multi-tenant COSMIC AI-Risk governance platform" }; export default function RootLayout({ children }) { return /*#__PURE__*/ _jsx("html", { lang: "en", children: /*#__PURE__*/ _jsx("body", { children: children }) }); } 047undefined4971undefined7379undefined214228undefined290293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined357360(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 2381:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceimport(/* webpackMode: "eager", webpackExports: ["default"] */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\components\\LogoutButton.jsx"); @Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 345))buffersourcesizemapshash`Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 345)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceimport(/* webpackMode: "eager", webpackExports: ["default"] */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\components\\LogoutButton.jsx"); k0253Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 345))undefined /***/ }) /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 345)); /***/ })  import(/* webpackMode: "eager", webpackExports: ["default"] */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\components\\LogoutButton.jsx"); k0253Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 345))undefined, /***/ 2964:  v webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9754); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9117); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6595); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2324); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9326); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8928); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(175); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(12); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4290); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2696); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_lib_is_rsc_request__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2574); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(2802); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7533); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(5229); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2822); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(6453); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(2474); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(6713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(1356); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(2685); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(6225); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(3446); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(2762); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(5742); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(6439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(1170); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(2506); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(1203); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceQconst module0 = () => import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\layout.jsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/not-found.js"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { isRSCRequestHeader } from "next/dist/server/lib/is-rsc-request"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: ['__PAGE__', {}, { page: [page5, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"], }] }, { 'layout': [module0, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\layout.jsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "next/dist/client/components/builtin/not-found.js"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], } ] }.children; const pages = ["C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/page", pathname: "/", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? isRSCRequestHeader(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map @`_Yr3L%'egQS_>@Z\Y [   ^ ` ' ) " s _)+6<!vx(.GX|y_^7D<Eix D^8IW`T g '!!!!*_*+,F,?3P3333375T555r6z677778886;x==AABBEEE_ENFFBJOJQQ5SJSXX]]__!_%___LaWaaab b d+dXdfdffi_ioo&p1p'r4rmrrttzzԊUl|3Ô_Ҕ x9J-Ϫ˫!WRb[vyۼ ovvXjPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1662))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1170, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7028, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 461, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 2768, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9458))__webpack_require__next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModulenext_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind".next"0 falsefalse{}(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__.normalizeAppPath)(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__.getBotType)(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__.isHtmlBotRequest)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_ROUTER_PREFETCH_HEADER(0,next_dist_server_lib_is_rsc_request__WEBPACK_IMPORTED_MODULE_10__/* .isRSCRequestHeader */ .f)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_HEADER(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__.getIsPossibleServerAction)(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)0(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__.shouldServeStreamingMetadata)(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default())(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__.setReferenceManifestsSingleton)(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__.createServerModuleMap)(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestnext_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponsenext_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T) true(__webpack_require__(9902).join)0next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERnext_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKind(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.parseFallbackField)next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__.isBot)next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__.NoFallbackError(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__/* .getFallbackRouteParams */ .u)next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"]next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_IS_PRERENDER_HEADERnext_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.CACHE_ONE_YEARnext_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_DID_POSTPONE_HEADER(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_CONTENT_TYPE_HEADERnext_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__.RedirectStatusCodenext_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_23__.ENCODED_TAGSnext_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)buffersourcesizemapshashY__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9754); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9117); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6595); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2324); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9326); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8928); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(175); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(12); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4290); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2696); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_lib_is_rsc_request__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2574); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(2802); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7533); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(5229); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2822); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(6453); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(2474); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(6713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(1356); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(2685); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(6225); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(3446); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(2762); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(5742); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(6439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(1170); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(2506); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(1203); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1662)); const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1170, 23)); const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7028, 23)); const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 461, 23)); const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 2768, 23)); const page5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9458)); // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: ['__PAGE__', {}, { page: [page5, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"], }] }, { 'layout': [module0, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\layout.jsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "next/dist/client/components/builtin/not-found.js"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], } ] }.children; const pages = ["C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"]; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; // Create and export the route module that will be consumed. const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({ definition: { kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, page: "/page", pathname: "/", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: ".next" || 0, relativeProjectDir: false || '' }); async function handler(req, res, ctx) { var _this; let srcPage = "/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__.normalizeAppPath)(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__.getBotType)(userAgent); const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__.isHtmlBotRequest)(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? (0,next_dist_server_lib_is_rsc_request__WEBPACK_IMPORTED_MODULE_10__/* .isRSCRequestHeader */ .f)(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_HEADER]); const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__.getIsPossibleServerAction)(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = false && 0; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers); } const ComponentMod = { ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__, tree, pages, GlobalError: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default()), handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__.setReferenceManifestsSingleton)({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__.createServerModuleMap)({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req); const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (false) {} return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: true ? (__webpack_require__(9902).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.parseFallbackField)(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__.isBot)(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.NOT_FOUND) { throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__.NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKind.PAGES, html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"].EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__/* .getFallbackRouteParams */ .u)(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"].EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__.RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_23__.ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSource#__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9754); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9117); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6595); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2324); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9326); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8928); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(175); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(12); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4290); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2696); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_lib_is_rsc_request__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2574); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(2802); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7533); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(5229); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2822); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(6453); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(2474); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(6713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(1356); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(2685); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(6225); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(3446); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(2762); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(5742); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(6439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(1170); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(2506); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(1203); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); ReplaceSourceRawSourceQconst module0 = () => import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\layout.jsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/not-found.js"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { isRSCRequestHeader } from "next/dist/server/lib/is-rsc-request"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: ['__PAGE__', {}, { page: [page5, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"], }] }, { 'layout': [module0, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\layout.jsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "next/dist/client/components/builtin/not-found.js"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], } ] }.children; const pages = ["C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/page", pathname: "/", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? isRSCRequestHeader(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %22233Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1662))undefined258345Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1170, 23))undefined370454Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7028, 23))undefined479563Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 461, 23))undefined588675Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 2768, 23))undefined698907Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9458))undefined9101050undefined10521166undefined11681244undefined12461317undefined13191381undefined13831452undefined14541530undefined15321617undefined16191702undefined17041780undefined17821854undefined18561937undefined19392032undefined20342138undefined21402220undefined22222300undefined23022393undefined23952576undefined25782654undefined26562721undefined27232796undefined27982855undefined28572963undefined29653038undefined30403104undefined31063187undefined43714393undefined43954531undefined45334555undefined45864604__webpack_require__undefined46624668undefined47694895undefined48974982undefined49845097undefined51605166undefined51915208next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined52445252next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined54975532".next"undefined553755380undefined55655603 falseundefined56155621undefined58955915falseundefined59185982{}undefined61286167falseundefined61996212(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined63036316(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70827097(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__.normalizeAppPath)undefined74847493(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__.getBotType)undefined75297544(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__.isHtmlBotRequest)undefined76897702(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77487774next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_ROUTER_PREFETCH_HEADERundefined79537966(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined79928009(0,next_dist_server_lib_is_rsc_request__WEBPACK_IMPORTED_MODULE_10__/* .isRSCRequestHeader */ .f)undefined80238032next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_HEADERundefined80728096(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__.getIsPossibleServerAction)undefined82768295(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined84878594 falseundefined859986130undefined1090910922(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1130711334(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__.shouldServeStreamingMetadata)undefined1311913136(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1319613204next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__undefined1325513254: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default())undefined1362313652(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__.setReferenceManifestsSingleton)undefined1378413804(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__.createServerModuleMap)undefined1393813946(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1424614260next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1430014315next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1454314580falseundefined1458315158{}undefined1573615749next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1683616849(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1712817141(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1786017896 trueundefined1790017919(__webpack_require__(9902).join)undefined17998180490undefined1901019023(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2086420877(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2130121322next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined2276122775next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKindundefined2402124038(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.parseFallbackField)undefined2432724338next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2435324357(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__.isBot)undefined2446324474next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2490824919next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2498824999next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2508825099next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2563225643next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2568825702next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__.NoFallbackErrorundefined2635426362next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2710827129(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__/* .getFallbackRouteParams */ .u)undefined2865728671next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKindundefined2871028721next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"]undefined2922329236(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2929329314(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__/* .getFallbackRouteParams */ .u)undefined2988929897next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3137631390next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKindundefined3274232765next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_IS_PRERENDER_HEADERundefined3523235245next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.CACHE_ONE_YEARundefined3554035554next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKindundefined3643736460next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_DID_POSTPONE_HEADERundefined3673236753next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined3687136892next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined3712237137(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined3736537376next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"]undefined3740537427next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_CONTENT_TYPE_HEADERundefined3808338098(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined3830638317next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"]undefined3858038593(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3904139054(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3992439945next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined4082440845next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined4095540976next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined4152941546next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__.RedirectStatusCodeundefined4175041773next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_DID_POSTPONE_HEADERundefined4266942684(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined4371243727(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined4393543946next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"]undefined4397944001next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_CONTENT_TYPE_HEADERundefined4471844830falseundefined4483345183{}undefined4520845223(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined4616746178next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_23__.ENCODED_TAGSundefined4631346328(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined4693946966falseundefined4696947039{}undefined4834748361next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKindundefined4928549300(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined5017550188next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5028750294next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5055050564next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__.NoFallbackErrorundefined5077650794(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined /***/ }) /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9754); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9117); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6595); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2324); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9326); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8928); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(175); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(12); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4290); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2696); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_lib_is_rsc_request__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2574); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(2802); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7533); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(5229); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2822); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(6453); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(2474); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(6713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(1356); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(2685); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(6225); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(3446); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(2762); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(5742); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(6439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(1170); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(2506); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(1203); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1662)); const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1170, 23)); const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7028, 23)); const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 461, 23)); const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 2768, 23)); const page5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9458)); // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: ['__PAGE__', {}, { page: [page5, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"], }] }, { 'layout': [module0, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\layout.jsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "next/dist/client/components/builtin/not-found.js"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], } ] }.children; const pages = ["C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"]; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; // Create and export the route module that will be consumed. const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({ definition: { kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, page: "/page", pathname: "/", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: ".next" || 0, relativeProjectDir: false || '' }); async function handler(req, res, ctx) { var _this; let srcPage = "/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__.normalizeAppPath)(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__.getBotType)(userAgent); const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__.isHtmlBotRequest)(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? (0,next_dist_server_lib_is_rsc_request__WEBPACK_IMPORTED_MODULE_10__/* .isRSCRequestHeader */ .f)(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_HEADER]); const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__.getIsPossibleServerAction)(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = false && 0; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers); } const ComponentMod = { ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__, tree, pages, GlobalError: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default()), handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__.setReferenceManifestsSingleton)({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__.createServerModuleMap)({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req); const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (false) {} return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: true ? (__webpack_require__(9902).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.parseFallbackField)(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__.isBot)(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.NOT_FOUND) { throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__.NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKind.PAGES, html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"].EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__/* .getFallbackRouteParams */ .u)(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"].EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__.RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_23__.ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map /***/ })   #__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9754); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9117); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6595); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2324); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9326); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8928); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(175); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(12); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4290); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2696); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_lib_is_rsc_request__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2574); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(2802); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7533); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(5229); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2822); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(6453); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(2474); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(6713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(1356); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(2685); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(6225); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(3446); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(2762); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(5742); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(6439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(1170); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(2506); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(1203); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); Qconst module0 = () => import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\layout.jsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/not-found.js"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { isRSCRequestHeader } from "next/dist/server/lib/is-rsc-request"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: ['__PAGE__', {}, { page: [page5, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"], }] }, { 'layout': [module0, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\layout.jsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "next/dist/client/components/builtin/not-found.js"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], } ] }.children; const pages = ["C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/page", pathname: "/", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? isRSCRequestHeader(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %22233Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1662))undefined258345Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1170, 23))undefined370454Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7028, 23))undefined479563Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 461, 23))undefined588675Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 2768, 23))undefined698907Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9458))undefined9101050undefined10521166undefined11681244undefined12461317undefined13191381undefined13831452undefined14541530undefined15321617undefined16191702undefined17041780undefined17821854undefined18561937undefined19392032undefined20342138undefined21402220undefined22222300undefined23022393undefined23952576undefined25782654undefined26562721undefined27232796undefined27982855undefined28572963undefined29653038undefined30403104undefined31063187undefined43714393undefined43954531undefined45334555undefined45864604__webpack_require__undefined46624668undefined47694895undefined48974982undefined49845097undefined51605166undefined51915208next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined52445252next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined54975532".next"undefined553755380undefined55655603 falseundefined56155621undefined58955915falseundefined59185982{}undefined61286167falseundefined61996212(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined63036316(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70827097(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__.normalizeAppPath)undefined74847493(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__.getBotType)undefined75297544(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__.isHtmlBotRequest)undefined76897702(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77487774next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_ROUTER_PREFETCH_HEADERundefined79537966(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined79928009(0,next_dist_server_lib_is_rsc_request__WEBPACK_IMPORTED_MODULE_10__/* .isRSCRequestHeader */ .f)undefined80238032next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_HEADERundefined80728096(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__.getIsPossibleServerAction)undefined82768295(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined84878594 falseundefined859986130undefined1090910922(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1130711334(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__.shouldServeStreamingMetadata)undefined1311913136(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1319613204next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__undefined1325513254: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default())undefined1362313652(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__.setReferenceManifestsSingleton)undefined1378413804(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__.createServerModuleMap)undefined1393813946(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1424614260next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1430014315next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1454314580falseundefined1458315158{}undefined1573615749next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1683616849(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1712817141(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1786017896 trueundefined1790017919(__webpack_require__(9902).join)undefined17998180490undefined1901019023(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2086420877(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2130121322next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined2276122775next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKindundefined2402124038(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.parseFallbackField)undefined2432724338next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2435324357(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__.isBot)undefined2446324474next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2490824919next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2498824999next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2508825099next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2563225643next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2568825702next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__.NoFallbackErrorundefined2635426362next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2710827129(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__/* .getFallbackRouteParams */ .u)undefined2865728671next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKindundefined2871028721next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"]undefined2922329236(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2929329314(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__/* .getFallbackRouteParams */ .u)undefined2988929897next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3137631390next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKindundefined3274232765next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_IS_PRERENDER_HEADERundefined3523235245next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.CACHE_ONE_YEARundefined3554035554next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKindundefined3643736460next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_DID_POSTPONE_HEADERundefined3673236753next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined3687136892next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined3712237137(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined3736537376next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"]undefined3740537427next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_CONTENT_TYPE_HEADERundefined3808338098(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined3830638317next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"]undefined3858038593(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3904139054(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3992439945next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined4082440845next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined4095540976next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined4152941546next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__.RedirectStatusCodeundefined4175041773next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_DID_POSTPONE_HEADERundefined4266942684(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined4371243727(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined4393543946next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"]undefined4397944001next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_CONTENT_TYPE_HEADERundefined4471844830falseundefined4483345183{}undefined4520845223(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined4616746178next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_23__.ENCODED_TAGSundefined4631346328(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined4693946966falseundefined4696947039{}undefined4834748361next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKindundefined4928549300(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined5017550188next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5028750294next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5055050564next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__.NoFallbackErrorundefined5077650794(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined, /***/ 3033:  ;webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ })  \module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");, /***/ 3295:  <webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); /***/ })  ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");, /***/ 3535:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource }8webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcevar __webpack_unused_export__; webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource!6"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "draftMode", { enumerable: true, get: function() { return draftMode; } }); const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external"); const _workasyncstorageexternal = require("../app-render/work-async-storage.external"); const _dynamicrendering = require("../app-render/dynamic-rendering"); const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger"); const _staticgenerationbailout = require("../../client/components/static-generation-bailout"); const _hooksservercontext = require("../../client/components/hooks-server-context"); const _invarianterror = require("../../shared/lib/invariant-error"); const _reflect = require("../web/spec-extension/adapters/reflect"); function draftMode() { const callingExpression = 'draftMode'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (!workStore || !workUnitStore) { (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } switch(workUnitStore.type){ case 'prerender-runtime': // TODO(runtime-ppr): does it make sense to delay this? normally it's always microtasky return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, createOrGetCachedDraftMode(workUnitStore.draftMode, workStore)); case 'request': return createOrGetCachedDraftMode(workUnitStore.draftMode, workStore); case 'cache': case 'private-cache': case 'unstable-cache': // Inside of `"use cache"` or `unstable_cache`, draft mode is available if // the outmost work unit store is a request store (or a runtime prerender), // and if draft mode is enabled. const draftModeProvider = (0, _workunitasyncstorageexternal.getDraftModeProviderForCacheScope)(workStore, workUnitStore); if (draftModeProvider) { return createOrGetCachedDraftMode(draftModeProvider, workStore); } // Otherwise, we fall through to providing an empty draft mode. // eslint-disable-next-line no-fallthrough case 'prerender': case 'prerender-client': case 'prerender-ppr': case 'prerender-legacy': // Return empty draft mode return createOrGetCachedDraftMode(null, workStore); default: return workUnitStore; } } function createOrGetCachedDraftMode(draftModeProvider, workStore) { const cacheKey = draftModeProvider ?? NullDraftMode; const cachedDraftMode = CachedDraftModes.get(cacheKey); if (cachedDraftMode) { return cachedDraftMode; } let promise; if ("production" === 'development' && !(workStore == null ? void 0 : workStore.isPrefetchRequest)) { const route = workStore == null ? void 0 : workStore.route; if (process.env.__NEXT_CACHE_COMPONENTS) { return createDraftModeWithDevWarnings(draftModeProvider, route); } promise = createExoticDraftModeWithDevWarnings(draftModeProvider, route); } else { if (process.env.__NEXT_CACHE_COMPONENTS) { return Promise.resolve(new DraftMode(draftModeProvider)); } promise = createExoticDraftMode(draftModeProvider); } CachedDraftModes.set(cacheKey, promise); return promise; } const NullDraftMode = {}; const CachedDraftModes = new WeakMap(); function createExoticDraftMode(underlyingProvider) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); Object.defineProperty(promise, 'isEnabled', { get () { return instance.isEnabled; }, enumerable: true, configurable: true }); promise.enable = instance.enable.bind(instance); promise.disable = instance.disable.bind(instance); return promise; } function createExoticDraftModeWithDevWarnings(underlyingProvider, route) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); Object.defineProperty(promise, 'isEnabled', { get () { const expression = '`draftMode().isEnabled`'; syncIODev(route, expression); return instance.isEnabled; }, enumerable: true, configurable: true }); Object.defineProperty(promise, 'enable', { value: function get() { const expression = '`draftMode().enable()`'; syncIODev(route, expression); return instance.enable.apply(instance, arguments); } }); Object.defineProperty(promise, 'disable', { value: function get() { const expression = '`draftMode().disable()`'; syncIODev(route, expression); return instance.disable.apply(instance, arguments); } }); return promise; } // Similar to `createExoticDraftModeWithDevWarnings`, but just logging the sync // access without actually defining the draftMode properties on the promise. function createDraftModeWithDevWarnings(underlyingProvider, route) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case 'isEnabled': warnForSyncAccess(route, `\`draftMode().${prop}\``); break; case 'enable': case 'disable': { warnForSyncAccess(route, `\`draftMode().${prop}()\``); break; } default: { // We only warn for well-defined properties of the draftMode object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); return proxiedPromise; } class DraftMode { constructor(provider){ this._provider = provider; } get isEnabled() { if (this._provider !== null) { return this._provider.isEnabled; } return false; } enable() { // We have a store we want to track dynamic data access to ensure we // don't statically generate routes that manipulate draft mode. trackDynamicDraftMode('draftMode().enable()', this.enable); if (this._provider !== null) { this._provider.enable(); } } disable() { trackDynamicDraftMode('draftMode().disable()', this.disable); if (this._provider !== null) { this._provider.disable(); } } } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createDraftModeAccessError); function createDraftModeAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`draftMode()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E377", enumerable: false, configurable: true }); } function trackDynamicDraftMode(expression, constructorOpt) { const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { // We have a store we want to track dynamic data access to ensure we // don't statically generate routes that manipulate draft mode. if ((workUnitStore == null ? void 0 : workUnitStore.phase) === 'after') { throw Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside \`after\`. The enabled status of draftMode can be read inside \`after\` but you cannot enable or disable draftMode. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E348", enumerable: false, configurable: true }); } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E553", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': case 'private-cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside "use cache". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E246", enumerable: false, configurable: true }); Error.captureStackTrace(error, constructorOpt); workStore.invalidDynamicUsageError ??= error; throw error; } case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside a function cached with "unstable_cache(...)". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E259", enumerable: false, configurable: true }); case 'prerender': case 'prerender-runtime': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used ${expression} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`), "__NEXT_ERROR_CODE", { value: "E126", enumerable: false, configurable: true }); return (0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(workStore.route, expression, error, workUnitStore); } case 'prerender-client': const exportName = '`draftMode`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': return (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, workUnitStore.dynamicTracking); case 'prerender-legacy': workUnitStore.revalidate = 0; const err = Object.defineProperty(new _hooksservercontext.DynamicServerError(`Route ${workStore.route} couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", { value: "E558", enumerable: false, configurable: true }); workStore.dynamicUsageDescription = expression; workStore.dynamicUsageStack = err.stack; throw err; case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); break; default: workUnitStore; } } } } //# sourceMappingURL=draft-mode.js.map h :NNQ|_,RXZ:_eg 3HNIPwq - 0 __webpack_unused_export__ = ())__webpack_require__3033929469067871938916892903036false{}buffersourcesizemapshashO3var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); __webpack_unused_export__ = ({ enumerable: true, get: function() { return draftMode; } }); const _workunitasyncstorageexternal = __webpack_require__(3033); const _workasyncstorageexternal = __webpack_require__(9294); const _dynamicrendering = __webpack_require__(6906); const _creatededupedbycallsiteservererrorlogger = __webpack_require__(787); const _staticgenerationbailout = __webpack_require__(1938); const _hooksservercontext = __webpack_require__(9168); const _invarianterror = __webpack_require__(9290); const _reflect = __webpack_require__(3036); function draftMode() { const callingExpression = 'draftMode'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (!workStore || !workUnitStore) { (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } switch(workUnitStore.type){ case 'prerender-runtime': // TODO(runtime-ppr): does it make sense to delay this? normally it's always microtasky return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, createOrGetCachedDraftMode(workUnitStore.draftMode, workStore)); case 'request': return createOrGetCachedDraftMode(workUnitStore.draftMode, workStore); case 'cache': case 'private-cache': case 'unstable-cache': // Inside of `"use cache"` or `unstable_cache`, draft mode is available if // the outmost work unit store is a request store (or a runtime prerender), // and if draft mode is enabled. const draftModeProvider = (0, _workunitasyncstorageexternal.getDraftModeProviderForCacheScope)(workStore, workUnitStore); if (draftModeProvider) { return createOrGetCachedDraftMode(draftModeProvider, workStore); } // Otherwise, we fall through to providing an empty draft mode. // eslint-disable-next-line no-fallthrough case 'prerender': case 'prerender-client': case 'prerender-ppr': case 'prerender-legacy': // Return empty draft mode return createOrGetCachedDraftMode(null, workStore); default: return workUnitStore; } } function createOrGetCachedDraftMode(draftModeProvider, workStore) { const cacheKey = draftModeProvider ?? NullDraftMode; const cachedDraftMode = CachedDraftModes.get(cacheKey); if (cachedDraftMode) { return cachedDraftMode; } let promise; if (false) {} else { if (false) {} promise = createExoticDraftMode(draftModeProvider); } CachedDraftModes.set(cacheKey, promise); return promise; } const NullDraftMode = {}; const CachedDraftModes = new WeakMap(); function createExoticDraftMode(underlyingProvider) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); Object.defineProperty(promise, 'isEnabled', { get () { return instance.isEnabled; }, enumerable: true, configurable: true }); promise.enable = instance.enable.bind(instance); promise.disable = instance.disable.bind(instance); return promise; } function createExoticDraftModeWithDevWarnings(underlyingProvider, route) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); Object.defineProperty(promise, 'isEnabled', { get () { const expression = '`draftMode().isEnabled`'; syncIODev(route, expression); return instance.isEnabled; }, enumerable: true, configurable: true }); Object.defineProperty(promise, 'enable', { value: function get() { const expression = '`draftMode().enable()`'; syncIODev(route, expression); return instance.enable.apply(instance, arguments); } }); Object.defineProperty(promise, 'disable', { value: function get() { const expression = '`draftMode().disable()`'; syncIODev(route, expression); return instance.disable.apply(instance, arguments); } }); return promise; } // Similar to `createExoticDraftModeWithDevWarnings`, but just logging the sync // access without actually defining the draftMode properties on the promise. function createDraftModeWithDevWarnings(underlyingProvider, route) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case 'isEnabled': warnForSyncAccess(route, `\`draftMode().${prop}\``); break; case 'enable': case 'disable': { warnForSyncAccess(route, `\`draftMode().${prop}()\``); break; } default: { // We only warn for well-defined properties of the draftMode object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); return proxiedPromise; } class DraftMode { constructor(provider){ this._provider = provider; } get isEnabled() { if (this._provider !== null) { return this._provider.isEnabled; } return false; } enable() { // We have a store we want to track dynamic data access to ensure we // don't statically generate routes that manipulate draft mode. trackDynamicDraftMode('draftMode().enable()', this.enable); if (this._provider !== null) { this._provider.enable(); } } disable() { trackDynamicDraftMode('draftMode().disable()', this.disable); if (this._provider !== null) { this._provider.disable(); } } } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createDraftModeAccessError); function createDraftModeAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`draftMode()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E377", enumerable: false, configurable: true }); } function trackDynamicDraftMode(expression, constructorOpt) { const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { // We have a store we want to track dynamic data access to ensure we // don't statically generate routes that manipulate draft mode. if ((workUnitStore == null ? void 0 : workUnitStore.phase) === 'after') { throw Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside \`after\`. The enabled status of draftMode can be read inside \`after\` but you cannot enable or disable draftMode. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E348", enumerable: false, configurable: true }); } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E553", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': case 'private-cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside "use cache". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E246", enumerable: false, configurable: true }); Error.captureStackTrace(error, constructorOpt); workStore.invalidDynamicUsageError ??= error; throw error; } case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside a function cached with "unstable_cache(...)". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E259", enumerable: false, configurable: true }); case 'prerender': case 'prerender-runtime': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used ${expression} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`), "__NEXT_ERROR_CODE", { value: "E126", enumerable: false, configurable: true }); return (0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(workStore.route, expression, error, workUnitStore); } case 'prerender-client': const exportName = '`draftMode`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': return (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, workUnitStore.dynamicTracking); case 'prerender-legacy': workUnitStore.revalidate = 0; const err = Object.defineProperty(new _hooksservercontext.DynamicServerError(`Route ${workStore.route} couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", { value: "E558", enumerable: false, configurable: true }); workStore.dynamicUsageDescription = expression; workStore.dynamicUsageStack = err.stack; throw err; case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); break; default: workUnitStore; } } } } //# sourceMappingURL=draft-mode.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSourcevar __webpack_unused_export__; ReplaceSourceRawSource!6"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "draftMode", { enumerable: true, get: function() { return draftMode; } }); const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external"); const _workasyncstorageexternal = require("../app-render/work-async-storage.external"); const _dynamicrendering = require("../app-render/dynamic-rendering"); const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger"); const _staticgenerationbailout = require("../../client/components/static-generation-bailout"); const _hooksservercontext = require("../../client/components/hooks-server-context"); const _invarianterror = require("../../shared/lib/invariant-error"); const _reflect = require("../web/spec-extension/adapters/reflect"); function draftMode() { const callingExpression = 'draftMode'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (!workStore || !workUnitStore) { (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } switch(workUnitStore.type){ case 'prerender-runtime': // TODO(runtime-ppr): does it make sense to delay this? normally it's always microtasky return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, createOrGetCachedDraftMode(workUnitStore.draftMode, workStore)); case 'request': return createOrGetCachedDraftMode(workUnitStore.draftMode, workStore); case 'cache': case 'private-cache': case 'unstable-cache': // Inside of `"use cache"` or `unstable_cache`, draft mode is available if // the outmost work unit store is a request store (or a runtime prerender), // and if draft mode is enabled. const draftModeProvider = (0, _workunitasyncstorageexternal.getDraftModeProviderForCacheScope)(workStore, workUnitStore); if (draftModeProvider) { return createOrGetCachedDraftMode(draftModeProvider, workStore); } // Otherwise, we fall through to providing an empty draft mode. // eslint-disable-next-line no-fallthrough case 'prerender': case 'prerender-client': case 'prerender-ppr': case 'prerender-legacy': // Return empty draft mode return createOrGetCachedDraftMode(null, workStore); default: return workUnitStore; } } function createOrGetCachedDraftMode(draftModeProvider, workStore) { const cacheKey = draftModeProvider ?? NullDraftMode; const cachedDraftMode = CachedDraftModes.get(cacheKey); if (cachedDraftMode) { return cachedDraftMode; } let promise; if ("production" === 'development' && !(workStore == null ? void 0 : workStore.isPrefetchRequest)) { const route = workStore == null ? void 0 : workStore.route; if (process.env.__NEXT_CACHE_COMPONENTS) { return createDraftModeWithDevWarnings(draftModeProvider, route); } promise = createExoticDraftModeWithDevWarnings(draftModeProvider, route); } else { if (process.env.__NEXT_CACHE_COMPONENTS) { return Promise.resolve(new DraftMode(draftModeProvider)); } promise = createExoticDraftMode(draftModeProvider); } CachedDraftModes.set(cacheKey, promise); return promise; } const NullDraftMode = {}; const CachedDraftModes = new WeakMap(); function createExoticDraftMode(underlyingProvider) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); Object.defineProperty(promise, 'isEnabled', { get () { return instance.isEnabled; }, enumerable: true, configurable: true }); promise.enable = instance.enable.bind(instance); promise.disable = instance.disable.bind(instance); return promise; } function createExoticDraftModeWithDevWarnings(underlyingProvider, route) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); Object.defineProperty(promise, 'isEnabled', { get () { const expression = '`draftMode().isEnabled`'; syncIODev(route, expression); return instance.isEnabled; }, enumerable: true, configurable: true }); Object.defineProperty(promise, 'enable', { value: function get() { const expression = '`draftMode().enable()`'; syncIODev(route, expression); return instance.enable.apply(instance, arguments); } }); Object.defineProperty(promise, 'disable', { value: function get() { const expression = '`draftMode().disable()`'; syncIODev(route, expression); return instance.disable.apply(instance, arguments); } }); return promise; } // Similar to `createExoticDraftModeWithDevWarnings`, but just logging the sync // access without actually defining the draftMode properties on the promise. function createDraftModeWithDevWarnings(underlyingProvider, route) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case 'isEnabled': warnForSyncAccess(route, `\`draftMode().${prop}\``); break; case 'enable': case 'disable': { warnForSyncAccess(route, `\`draftMode().${prop}()\``); break; } default: { // We only warn for well-defined properties of the draftMode object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); return proxiedPromise; } class DraftMode { constructor(provider){ this._provider = provider; } get isEnabled() { if (this._provider !== null) { return this._provider.isEnabled; } return false; } enable() { // We have a store we want to track dynamic data access to ensure we // don't statically generate routes that manipulate draft mode. trackDynamicDraftMode('draftMode().enable()', this.enable); if (this._provider !== null) { this._provider.enable(); } } disable() { trackDynamicDraftMode('draftMode().disable()', this.disable); if (this._provider !== null) { this._provider.disable(); } } } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createDraftModeAccessError); function createDraftModeAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`draftMode()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E377", enumerable: false, configurable: true }); } function trackDynamicDraftMode(expression, constructorOpt) { const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { // We have a store we want to track dynamic data access to ensure we // don't statically generate routes that manipulate draft mode. if ((workUnitStore == null ? void 0 : workUnitStore.phase) === 'after') { throw Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside \`after\`. The enabled status of draftMode can be read inside \`after\` but you cannot enable or disable draftMode. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E348", enumerable: false, configurable: true }); } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E553", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': case 'private-cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside "use cache". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E246", enumerable: false, configurable: true }); Error.captureStackTrace(error, constructorOpt); workStore.invalidDynamicUsageError ??= error; throw error; } case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside a function cached with "unstable_cache(...)". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E259", enumerable: false, configurable: true }); case 'prerender': case 'prerender-runtime': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used ${expression} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`), "__NEXT_ERROR_CODE", { value: "E126", enumerable: false, configurable: true }); return (0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(workStore.route, expression, error, workUnitStore); } case 'prerender-client': const exportName = '`draftMode`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': return (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, workUnitStore.dynamicTracking); case 'prerender-legacy': workUnitStore.revalidate = 0; const err = Object.defineProperty(new _hooksservercontext.DynamicServerError(`Route ${workStore.route} couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", { value: "E558", enumerable: false, configurable: true }); workStore.dynamicUsageDescription = expression; workStore.dynamicUsageStack = err.stack; throw err; case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); break; default: workUnitStore; } } } } //# sourceMappingURL=draft-mode.js.map x012undefined1458__webpack_unused_export__ = (undefined7878)undefined81124__webpack_unused_export__ = (undefined204204)undefined245251__webpack_require__undefined2533003033undefined338344__webpack_require__undefined3463889294undefined418424__webpack_require__undefined4264586906undefined512518__webpack_require__undefined520570787undefined607613__webpack_require__undefined6156651938undefined697703__webpack_require__undefined7057509168undefined778784__webpack_require__undefined7868199290undefined840846__webpack_require__undefined8488873036undefined29293021falseundefined30243318{}undefined33393373falseundefined33763456{}undefined /***/ }) 3/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); __webpack_unused_export__ = ({ enumerable: true, get: function() { return draftMode; } }); const _workunitasyncstorageexternal = __webpack_require__(3033); const _workasyncstorageexternal = __webpack_require__(9294); const _dynamicrendering = __webpack_require__(6906); const _creatededupedbycallsiteservererrorlogger = __webpack_require__(787); const _staticgenerationbailout = __webpack_require__(1938); const _hooksservercontext = __webpack_require__(9168); const _invarianterror = __webpack_require__(9290); const _reflect = __webpack_require__(3036); function draftMode() { const callingExpression = 'draftMode'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (!workStore || !workUnitStore) { (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } switch(workUnitStore.type){ case 'prerender-runtime': // TODO(runtime-ppr): does it make sense to delay this? normally it's always microtasky return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, createOrGetCachedDraftMode(workUnitStore.draftMode, workStore)); case 'request': return createOrGetCachedDraftMode(workUnitStore.draftMode, workStore); case 'cache': case 'private-cache': case 'unstable-cache': // Inside of `"use cache"` or `unstable_cache`, draft mode is available if // the outmost work unit store is a request store (or a runtime prerender), // and if draft mode is enabled. const draftModeProvider = (0, _workunitasyncstorageexternal.getDraftModeProviderForCacheScope)(workStore, workUnitStore); if (draftModeProvider) { return createOrGetCachedDraftMode(draftModeProvider, workStore); } // Otherwise, we fall through to providing an empty draft mode. // eslint-disable-next-line no-fallthrough case 'prerender': case 'prerender-client': case 'prerender-ppr': case 'prerender-legacy': // Return empty draft mode return createOrGetCachedDraftMode(null, workStore); default: return workUnitStore; } } function createOrGetCachedDraftMode(draftModeProvider, workStore) { const cacheKey = draftModeProvider ?? NullDraftMode; const cachedDraftMode = CachedDraftModes.get(cacheKey); if (cachedDraftMode) { return cachedDraftMode; } let promise; if (false) {} else { if (false) {} promise = createExoticDraftMode(draftModeProvider); } CachedDraftModes.set(cacheKey, promise); return promise; } const NullDraftMode = {}; const CachedDraftModes = new WeakMap(); function createExoticDraftMode(underlyingProvider) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); Object.defineProperty(promise, 'isEnabled', { get () { return instance.isEnabled; }, enumerable: true, configurable: true }); promise.enable = instance.enable.bind(instance); promise.disable = instance.disable.bind(instance); return promise; } function createExoticDraftModeWithDevWarnings(underlyingProvider, route) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); Object.defineProperty(promise, 'isEnabled', { get () { const expression = '`draftMode().isEnabled`'; syncIODev(route, expression); return instance.isEnabled; }, enumerable: true, configurable: true }); Object.defineProperty(promise, 'enable', { value: function get() { const expression = '`draftMode().enable()`'; syncIODev(route, expression); return instance.enable.apply(instance, arguments); } }); Object.defineProperty(promise, 'disable', { value: function get() { const expression = '`draftMode().disable()`'; syncIODev(route, expression); return instance.disable.apply(instance, arguments); } }); return promise; } // Similar to `createExoticDraftModeWithDevWarnings`, but just logging the sync // access without actually defining the draftMode properties on the promise. function createDraftModeWithDevWarnings(underlyingProvider, route) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case 'isEnabled': warnForSyncAccess(route, `\`draftMode().${prop}\``); break; case 'enable': case 'disable': { warnForSyncAccess(route, `\`draftMode().${prop}()\``); break; } default: { // We only warn for well-defined properties of the draftMode object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); return proxiedPromise; } class DraftMode { constructor(provider){ this._provider = provider; } get isEnabled() { if (this._provider !== null) { return this._provider.isEnabled; } return false; } enable() { // We have a store we want to track dynamic data access to ensure we // don't statically generate routes that manipulate draft mode. trackDynamicDraftMode('draftMode().enable()', this.enable); if (this._provider !== null) { this._provider.enable(); } } disable() { trackDynamicDraftMode('draftMode().disable()', this.disable); if (this._provider !== null) { this._provider.disable(); } } } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createDraftModeAccessError); function createDraftModeAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`draftMode()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E377", enumerable: false, configurable: true }); } function trackDynamicDraftMode(expression, constructorOpt) { const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { // We have a store we want to track dynamic data access to ensure we // don't statically generate routes that manipulate draft mode. if ((workUnitStore == null ? void 0 : workUnitStore.phase) === 'after') { throw Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside \`after\`. The enabled status of draftMode can be read inside \`after\` but you cannot enable or disable draftMode. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E348", enumerable: false, configurable: true }); } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E553", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': case 'private-cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside "use cache". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E246", enumerable: false, configurable: true }); Error.captureStackTrace(error, constructorOpt); workStore.invalidDynamicUsageError ??= error; throw error; } case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside a function cached with "unstable_cache(...)". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E259", enumerable: false, configurable: true }); case 'prerender': case 'prerender-runtime': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used ${expression} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`), "__NEXT_ERROR_CODE", { value: "E126", enumerable: false, configurable: true }); return (0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(workStore.route, expression, error, workUnitStore); } case 'prerender-client': const exportName = '`draftMode`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': return (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, workUnitStore.dynamicTracking); case 'prerender-legacy': workUnitStore.revalidate = 0; const err = Object.defineProperty(new _hooksservercontext.DynamicServerError(`Route ${workStore.route} couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", { value: "E558", enumerable: false, configurable: true }); workStore.dynamicUsageDescription = expression; workStore.dynamicUsageStack = err.stack; throw err; case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); break; default: workUnitStore; } } } } //# sourceMappingURL=draft-mode.js.map /***/ })   S/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; !6"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "draftMode", { enumerable: true, get: function() { return draftMode; } }); const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external"); const _workasyncstorageexternal = require("../app-render/work-async-storage.external"); const _dynamicrendering = require("../app-render/dynamic-rendering"); const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger"); const _staticgenerationbailout = require("../../client/components/static-generation-bailout"); const _hooksservercontext = require("../../client/components/hooks-server-context"); const _invarianterror = require("../../shared/lib/invariant-error"); const _reflect = require("../web/spec-extension/adapters/reflect"); function draftMode() { const callingExpression = 'draftMode'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (!workStore || !workUnitStore) { (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } switch(workUnitStore.type){ case 'prerender-runtime': // TODO(runtime-ppr): does it make sense to delay this? normally it's always microtasky return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, createOrGetCachedDraftMode(workUnitStore.draftMode, workStore)); case 'request': return createOrGetCachedDraftMode(workUnitStore.draftMode, workStore); case 'cache': case 'private-cache': case 'unstable-cache': // Inside of `"use cache"` or `unstable_cache`, draft mode is available if // the outmost work unit store is a request store (or a runtime prerender), // and if draft mode is enabled. const draftModeProvider = (0, _workunitasyncstorageexternal.getDraftModeProviderForCacheScope)(workStore, workUnitStore); if (draftModeProvider) { return createOrGetCachedDraftMode(draftModeProvider, workStore); } // Otherwise, we fall through to providing an empty draft mode. // eslint-disable-next-line no-fallthrough case 'prerender': case 'prerender-client': case 'prerender-ppr': case 'prerender-legacy': // Return empty draft mode return createOrGetCachedDraftMode(null, workStore); default: return workUnitStore; } } function createOrGetCachedDraftMode(draftModeProvider, workStore) { const cacheKey = draftModeProvider ?? NullDraftMode; const cachedDraftMode = CachedDraftModes.get(cacheKey); if (cachedDraftMode) { return cachedDraftMode; } let promise; if ("production" === 'development' && !(workStore == null ? void 0 : workStore.isPrefetchRequest)) { const route = workStore == null ? void 0 : workStore.route; if (process.env.__NEXT_CACHE_COMPONENTS) { return createDraftModeWithDevWarnings(draftModeProvider, route); } promise = createExoticDraftModeWithDevWarnings(draftModeProvider, route); } else { if (process.env.__NEXT_CACHE_COMPONENTS) { return Promise.resolve(new DraftMode(draftModeProvider)); } promise = createExoticDraftMode(draftModeProvider); } CachedDraftModes.set(cacheKey, promise); return promise; } const NullDraftMode = {}; const CachedDraftModes = new WeakMap(); function createExoticDraftMode(underlyingProvider) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); Object.defineProperty(promise, 'isEnabled', { get () { return instance.isEnabled; }, enumerable: true, configurable: true }); promise.enable = instance.enable.bind(instance); promise.disable = instance.disable.bind(instance); return promise; } function createExoticDraftModeWithDevWarnings(underlyingProvider, route) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); Object.defineProperty(promise, 'isEnabled', { get () { const expression = '`draftMode().isEnabled`'; syncIODev(route, expression); return instance.isEnabled; }, enumerable: true, configurable: true }); Object.defineProperty(promise, 'enable', { value: function get() { const expression = '`draftMode().enable()`'; syncIODev(route, expression); return instance.enable.apply(instance, arguments); } }); Object.defineProperty(promise, 'disable', { value: function get() { const expression = '`draftMode().disable()`'; syncIODev(route, expression); return instance.disable.apply(instance, arguments); } }); return promise; } // Similar to `createExoticDraftModeWithDevWarnings`, but just logging the sync // access without actually defining the draftMode properties on the promise. function createDraftModeWithDevWarnings(underlyingProvider, route) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case 'isEnabled': warnForSyncAccess(route, `\`draftMode().${prop}\``); break; case 'enable': case 'disable': { warnForSyncAccess(route, `\`draftMode().${prop}()\``); break; } default: { // We only warn for well-defined properties of the draftMode object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); return proxiedPromise; } class DraftMode { constructor(provider){ this._provider = provider; } get isEnabled() { if (this._provider !== null) { return this._provider.isEnabled; } return false; } enable() { // We have a store we want to track dynamic data access to ensure we // don't statically generate routes that manipulate draft mode. trackDynamicDraftMode('draftMode().enable()', this.enable); if (this._provider !== null) { this._provider.enable(); } } disable() { trackDynamicDraftMode('draftMode().disable()', this.disable); if (this._provider !== null) { this._provider.disable(); } } } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createDraftModeAccessError); function createDraftModeAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`draftMode()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E377", enumerable: false, configurable: true }); } function trackDynamicDraftMode(expression, constructorOpt) { const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { // We have a store we want to track dynamic data access to ensure we // don't statically generate routes that manipulate draft mode. if ((workUnitStore == null ? void 0 : workUnitStore.phase) === 'after') { throw Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside \`after\`. The enabled status of draftMode can be read inside \`after\` but you cannot enable or disable draftMode. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E348", enumerable: false, configurable: true }); } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E553", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': case 'private-cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside "use cache". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E246", enumerable: false, configurable: true }); Error.captureStackTrace(error, constructorOpt); workStore.invalidDynamicUsageError ??= error; throw error; } case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside a function cached with "unstable_cache(...)". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E259", enumerable: false, configurable: true }); case 'prerender': case 'prerender-runtime': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used ${expression} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`), "__NEXT_ERROR_CODE", { value: "E126", enumerable: false, configurable: true }); return (0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(workStore.route, expression, error, workUnitStore); } case 'prerender-client': const exportName = '`draftMode`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': return (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, workUnitStore.dynamicTracking); case 'prerender-legacy': workUnitStore.revalidate = 0; const err = Object.defineProperty(new _hooksservercontext.DynamicServerError(`Route ${workStore.route} couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", { value: "E558", enumerable: false, configurable: true }); workStore.dynamicUsageDescription = expression; workStore.dynamicUsageStack = err.stack; throw err; case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); break; default: workUnitStore; } } } } //# sourceMappingURL=draft-mode.js.map x012undefined1458__webpack_unused_export__ = (undefined7878)undefined81124__webpack_unused_export__ = (undefined204204)undefined245251__webpack_require__undefined2533003033undefined338344__webpack_require__undefined3463889294undefined418424__webpack_require__undefined4264586906undefined512518__webpack_require__undefined520570787undefined607613__webpack_require__undefined6156651938undefined697703__webpack_require__undefined7057509168undefined778784__webpack_require__undefined7868199290undefined840846__webpack_require__undefined8488873036undefined29293021falseundefined30243318{}undefined33393373falseundefined33763456{}undefined, /***/ 4230:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Pwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcevar __webpack_unused_export__; webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceN"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "cookies", { enumerable: true, get: function() { return cookies; } }); const _requestcookies = require("../web/spec-extension/adapters/request-cookies"); const _cookies = require("../web/spec-extension/cookies"); const _workasyncstorageexternal = require("../app-render/work-async-storage.external"); const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external"); const _dynamicrendering = require("../app-render/dynamic-rendering"); const _staticgenerationbailout = require("../../client/components/static-generation-bailout"); const _dynamicrenderingutils = require("../dynamic-rendering-utils"); const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger"); const _utils = require("./utils"); const _invarianterror = require("../../shared/lib/invariant-error"); const _reflect = require("../web/spec-extension/adapters/reflect"); function cookies() { const callingExpression = 'cookies'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E88", enumerable: false, configurable: true }); } if (workStore.forceStatic) { // When using forceStatic we override all other logic and always just return an empty // cookies object without tracking const underlyingCookies = createEmptyCookies(); return makeUntrackedExoticCookies(underlyingCookies); } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E549", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': const error = Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E398", enumerable: false, configurable: true }); Error.captureStackTrace(error, cookies); workStore.invalidDynamicUsageError ??= error; throw error; case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E157", enumerable: false, configurable: true }); case 'prerender': return makeHangingCookies(workStore, workUnitStore); case 'prerender-client': const exportName = '`cookies`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': // We need track dynamic access here eagerly to keep continuity with // how cookies has worked in PPR without cacheComponents. return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking); case 'prerender-legacy': // We track dynamic access here so we don't need to wrap the cookies // in individual property access tracking. return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore); case 'prerender-runtime': return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, makeUntrackedCookies(workUnitStore.cookies)); case 'private-cache': if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedCookies(workUnitStore.cookies); } return makeUntrackedExoticCookies(workUnitStore.cookies); case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); let underlyingCookies; if ((0, _requestcookies.areCookiesMutableInCurrentPhase)(workUnitStore)) { // We can't conditionally return different types here based on the context. // To avoid confusion, we always return the readonly type here. underlyingCookies = workUnitStore.userspaceMutableCookies; } else { underlyingCookies = workUnitStore.cookies; } if ("production" === 'development') { // Semantically we only need the dev tracking when running in `next dev` // but since you would never use next dev with production NODE_ENV we use this // as a proxy so we can statically exclude this code from production builds. if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedCookiesWithDevWarnings(underlyingCookies, workStore == null ? void 0 : workStore.route); } return makeUntrackedExoticCookiesWithDevWarnings(underlyingCookies, workStore == null ? void 0 : workStore.route); } else { if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedCookies(underlyingCookies); } return makeUntrackedExoticCookies(underlyingCookies); } default: workUnitStore; } } } // If we end up here, there was no work store or work unit store present. (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } function createEmptyCookies() { return _requestcookies.RequestCookiesAdapter.seal(new _cookies.RequestCookies(new Headers({}))); } const CachedCookies = new WeakMap(); function makeHangingCookies(workStore, prerenderStore) { const cachedPromise = CachedCookies.get(prerenderStore); if (cachedPromise) { return cachedPromise; } const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, '`cookies()`'); CachedCookies.set(prerenderStore, promise); return promise; } function makeUntrackedCookies(underlyingCookies) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = Promise.resolve(underlyingCookies); CachedCookies.set(underlyingCookies, promise); return promise; } function makeUntrackedExoticCookies(underlyingCookies) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = Promise.resolve(underlyingCookies); CachedCookies.set(underlyingCookies, promise); Object.defineProperties(promise, { [Symbol.iterator]: { value: underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].bind(underlyingCookies) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesIterator.bind(underlyingCookies) }, size: { get () { return underlyingCookies.size; } }, get: { value: underlyingCookies.get.bind(underlyingCookies) }, getAll: { value: underlyingCookies.getAll.bind(underlyingCookies) }, has: { value: underlyingCookies.has.bind(underlyingCookies) }, set: { value: underlyingCookies.set.bind(underlyingCookies) }, delete: { value: underlyingCookies.delete.bind(underlyingCookies) }, clear: { value: typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.bind(underlyingCookies) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesClear.bind(underlyingCookies, promise) }, toString: { value: underlyingCookies.toString.bind(underlyingCookies) } }); return promise; } function makeUntrackedExoticCookiesWithDevWarnings(underlyingCookies, route) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies); CachedCookies.set(underlyingCookies, promise); Object.defineProperties(promise, { [Symbol.iterator]: { value: function() { const expression = '`...cookies()` or similar iteration'; syncIODev(route, expression); return underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].apply(underlyingCookies, arguments) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesIterator.call(underlyingCookies); }, writable: false }, size: { get () { const expression = '`cookies().size`'; syncIODev(route, expression); return underlyingCookies.size; } }, get: { value: function get() { let expression; if (arguments.length === 0) { expression = '`cookies().get()`'; } else { expression = `\`cookies().get(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.get.apply(underlyingCookies, arguments); }, writable: false }, getAll: { value: function getAll() { let expression; if (arguments.length === 0) { expression = '`cookies().getAll()`'; } else { expression = `\`cookies().getAll(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.getAll.apply(underlyingCookies, arguments); }, writable: false }, has: { value: function get() { let expression; if (arguments.length === 0) { expression = '`cookies().has()`'; } else { expression = `\`cookies().has(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.has.apply(underlyingCookies, arguments); }, writable: false }, set: { value: function set() { let expression; if (arguments.length === 0) { expression = '`cookies().set()`'; } else { const arg = arguments[0]; if (arg) { expression = `\`cookies().set(${describeNameArg(arg)}, ...)\``; } else { expression = '`cookies().set(...)`'; } } syncIODev(route, expression); return underlyingCookies.set.apply(underlyingCookies, arguments); }, writable: false }, delete: { value: function() { let expression; if (arguments.length === 0) { expression = '`cookies().delete()`'; } else if (arguments.length === 1) { expression = `\`cookies().delete(${describeNameArg(arguments[0])})\``; } else { expression = `\`cookies().delete(${describeNameArg(arguments[0])}, ...)\``; } syncIODev(route, expression); return underlyingCookies.delete.apply(underlyingCookies, arguments); }, writable: false }, clear: { value: function clear() { const expression = '`cookies().clear()`'; syncIODev(route, expression); // @ts-ignore clear is defined in RequestCookies implementation but not in the type return typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.apply(underlyingCookies, arguments) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesClear.call(underlyingCookies, promise); }, writable: false }, toString: { value: function toString() { const expression = '`cookies().toString()` or implicit casting'; syncIODev(route, expression); return underlyingCookies.toString.apply(underlyingCookies, arguments); }, writable: false } }); return promise; } // Similar to `makeUntrackedExoticCookiesWithDevWarnings`, but just logging the // sync access without actually defining the cookies properties on the promise. function makeUntrackedCookiesWithDevWarnings(underlyingCookies, route) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case Symbol.iterator: { warnForSyncAccess(route, '`...cookies()` or similar iteration'); break; } case 'size': case 'get': case 'getAll': case 'has': case 'set': case 'delete': case 'clear': case 'toString': { warnForSyncAccess(route, `\`cookies().${prop}\``); break; } default: { // We only warn for well-defined properties of the cookies object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); CachedCookies.set(underlyingCookies, proxiedPromise); return proxiedPromise; } function describeNameArg(arg) { return typeof arg === 'object' && arg !== null && typeof arg.name === 'string' ? `'${arg.name}'` : typeof arg === 'string' ? `'${arg}'` : '...'; } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createCookiesAccessError); function createCookiesAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`cookies()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E223", enumerable: false, configurable: true }); } function polyfilledResponseCookiesIterator() { return this.getAll().map((c)=>[ c.name, c ]).values(); } function polyfilledResponseCookiesClear(returnable) { for (const cookie of this.getAll()){ this.delete(cookie.name); } return returnable; } //# sourceMappingURL=cookies.js.map h! :NNQz_/57U{,24Ty/5Y7i|,/*-__webpack_unused_export__ = ()Object.defineProperty(exports, "U", ())__webpack_require__8706367592943033690619382831787171692903036false{}buffersourcesizemapshashGIvar __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "U", ({ enumerable: true, get: function() { return cookies; } })); const _requestcookies = __webpack_require__(8706); const _cookies = __webpack_require__(3675); const _workasyncstorageexternal = __webpack_require__(9294); const _workunitasyncstorageexternal = __webpack_require__(3033); const _dynamicrendering = __webpack_require__(6906); const _staticgenerationbailout = __webpack_require__(1938); const _dynamicrenderingutils = __webpack_require__(2831); const _creatededupedbycallsiteservererrorlogger = __webpack_require__(787); const _utils = __webpack_require__(1716); const _invarianterror = __webpack_require__(9290); const _reflect = __webpack_require__(3036); function cookies() { const callingExpression = 'cookies'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E88", enumerable: false, configurable: true }); } if (workStore.forceStatic) { // When using forceStatic we override all other logic and always just return an empty // cookies object without tracking const underlyingCookies = createEmptyCookies(); return makeUntrackedExoticCookies(underlyingCookies); } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E549", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': const error = Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E398", enumerable: false, configurable: true }); Error.captureStackTrace(error, cookies); workStore.invalidDynamicUsageError ??= error; throw error; case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E157", enumerable: false, configurable: true }); case 'prerender': return makeHangingCookies(workStore, workUnitStore); case 'prerender-client': const exportName = '`cookies`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': // We need track dynamic access here eagerly to keep continuity with // how cookies has worked in PPR without cacheComponents. return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking); case 'prerender-legacy': // We track dynamic access here so we don't need to wrap the cookies // in individual property access tracking. return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore); case 'prerender-runtime': return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, makeUntrackedCookies(workUnitStore.cookies)); case 'private-cache': if (false) {} return makeUntrackedExoticCookies(workUnitStore.cookies); case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); let underlyingCookies; if ((0, _requestcookies.areCookiesMutableInCurrentPhase)(workUnitStore)) { // We can't conditionally return different types here based on the context. // To avoid confusion, we always return the readonly type here. underlyingCookies = workUnitStore.userspaceMutableCookies; } else { underlyingCookies = workUnitStore.cookies; } if (false) {} else { if (false) {} return makeUntrackedExoticCookies(underlyingCookies); } default: workUnitStore; } } } // If we end up here, there was no work store or work unit store present. (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } function createEmptyCookies() { return _requestcookies.RequestCookiesAdapter.seal(new _cookies.RequestCookies(new Headers({}))); } const CachedCookies = new WeakMap(); function makeHangingCookies(workStore, prerenderStore) { const cachedPromise = CachedCookies.get(prerenderStore); if (cachedPromise) { return cachedPromise; } const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, '`cookies()`'); CachedCookies.set(prerenderStore, promise); return promise; } function makeUntrackedCookies(underlyingCookies) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = Promise.resolve(underlyingCookies); CachedCookies.set(underlyingCookies, promise); return promise; } function makeUntrackedExoticCookies(underlyingCookies) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = Promise.resolve(underlyingCookies); CachedCookies.set(underlyingCookies, promise); Object.defineProperties(promise, { [Symbol.iterator]: { value: underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].bind(underlyingCookies) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesIterator.bind(underlyingCookies) }, size: { get () { return underlyingCookies.size; } }, get: { value: underlyingCookies.get.bind(underlyingCookies) }, getAll: { value: underlyingCookies.getAll.bind(underlyingCookies) }, has: { value: underlyingCookies.has.bind(underlyingCookies) }, set: { value: underlyingCookies.set.bind(underlyingCookies) }, delete: { value: underlyingCookies.delete.bind(underlyingCookies) }, clear: { value: typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.bind(underlyingCookies) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesClear.bind(underlyingCookies, promise) }, toString: { value: underlyingCookies.toString.bind(underlyingCookies) } }); return promise; } function makeUntrackedExoticCookiesWithDevWarnings(underlyingCookies, route) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies); CachedCookies.set(underlyingCookies, promise); Object.defineProperties(promise, { [Symbol.iterator]: { value: function() { const expression = '`...cookies()` or similar iteration'; syncIODev(route, expression); return underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].apply(underlyingCookies, arguments) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesIterator.call(underlyingCookies); }, writable: false }, size: { get () { const expression = '`cookies().size`'; syncIODev(route, expression); return underlyingCookies.size; } }, get: { value: function get() { let expression; if (arguments.length === 0) { expression = '`cookies().get()`'; } else { expression = `\`cookies().get(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.get.apply(underlyingCookies, arguments); }, writable: false }, getAll: { value: function getAll() { let expression; if (arguments.length === 0) { expression = '`cookies().getAll()`'; } else { expression = `\`cookies().getAll(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.getAll.apply(underlyingCookies, arguments); }, writable: false }, has: { value: function get() { let expression; if (arguments.length === 0) { expression = '`cookies().has()`'; } else { expression = `\`cookies().has(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.has.apply(underlyingCookies, arguments); }, writable: false }, set: { value: function set() { let expression; if (arguments.length === 0) { expression = '`cookies().set()`'; } else { const arg = arguments[0]; if (arg) { expression = `\`cookies().set(${describeNameArg(arg)}, ...)\``; } else { expression = '`cookies().set(...)`'; } } syncIODev(route, expression); return underlyingCookies.set.apply(underlyingCookies, arguments); }, writable: false }, delete: { value: function() { let expression; if (arguments.length === 0) { expression = '`cookies().delete()`'; } else if (arguments.length === 1) { expression = `\`cookies().delete(${describeNameArg(arguments[0])})\``; } else { expression = `\`cookies().delete(${describeNameArg(arguments[0])}, ...)\``; } syncIODev(route, expression); return underlyingCookies.delete.apply(underlyingCookies, arguments); }, writable: false }, clear: { value: function clear() { const expression = '`cookies().clear()`'; syncIODev(route, expression); // @ts-ignore clear is defined in RequestCookies implementation but not in the type return typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.apply(underlyingCookies, arguments) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesClear.call(underlyingCookies, promise); }, writable: false }, toString: { value: function toString() { const expression = '`cookies().toString()` or implicit casting'; syncIODev(route, expression); return underlyingCookies.toString.apply(underlyingCookies, arguments); }, writable: false } }); return promise; } // Similar to `makeUntrackedExoticCookiesWithDevWarnings`, but just logging the // sync access without actually defining the cookies properties on the promise. function makeUntrackedCookiesWithDevWarnings(underlyingCookies, route) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case Symbol.iterator: { warnForSyncAccess(route, '`...cookies()` or similar iteration'); break; } case 'size': case 'get': case 'getAll': case 'has': case 'set': case 'delete': case 'clear': case 'toString': { warnForSyncAccess(route, `\`cookies().${prop}\``); break; } default: { // We only warn for well-defined properties of the cookies object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); CachedCookies.set(underlyingCookies, proxiedPromise); return proxiedPromise; } function describeNameArg(arg) { return typeof arg === 'object' && arg !== null && typeof arg.name === 'string' ? `'${arg.name}'` : typeof arg === 'string' ? `'${arg}'` : '...'; } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createCookiesAccessError); function createCookiesAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`cookies()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E223", enumerable: false, configurable: true }); } function polyfilledResponseCookiesIterator() { return this.getAll().map((c)=>[ c.name, c ]).values(); } function polyfilledResponseCookiesClear(returnable) { for (const cookie of this.getAll()){ this.delete(cookie.name); } return returnable; } //# sourceMappingURL=cookies.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSourcevar __webpack_unused_export__; ReplaceSourceRawSourceN"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "cookies", { enumerable: true, get: function() { return cookies; } }); const _requestcookies = require("../web/spec-extension/adapters/request-cookies"); const _cookies = require("../web/spec-extension/cookies"); const _workasyncstorageexternal = require("../app-render/work-async-storage.external"); const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external"); const _dynamicrendering = require("../app-render/dynamic-rendering"); const _staticgenerationbailout = require("../../client/components/static-generation-bailout"); const _dynamicrenderingutils = require("../dynamic-rendering-utils"); const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger"); const _utils = require("./utils"); const _invarianterror = require("../../shared/lib/invariant-error"); const _reflect = require("../web/spec-extension/adapters/reflect"); function cookies() { const callingExpression = 'cookies'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E88", enumerable: false, configurable: true }); } if (workStore.forceStatic) { // When using forceStatic we override all other logic and always just return an empty // cookies object without tracking const underlyingCookies = createEmptyCookies(); return makeUntrackedExoticCookies(underlyingCookies); } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E549", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': const error = Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E398", enumerable: false, configurable: true }); Error.captureStackTrace(error, cookies); workStore.invalidDynamicUsageError ??= error; throw error; case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E157", enumerable: false, configurable: true }); case 'prerender': return makeHangingCookies(workStore, workUnitStore); case 'prerender-client': const exportName = '`cookies`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': // We need track dynamic access here eagerly to keep continuity with // how cookies has worked in PPR without cacheComponents. return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking); case 'prerender-legacy': // We track dynamic access here so we don't need to wrap the cookies // in individual property access tracking. return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore); case 'prerender-runtime': return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, makeUntrackedCookies(workUnitStore.cookies)); case 'private-cache': if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedCookies(workUnitStore.cookies); } return makeUntrackedExoticCookies(workUnitStore.cookies); case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); let underlyingCookies; if ((0, _requestcookies.areCookiesMutableInCurrentPhase)(workUnitStore)) { // We can't conditionally return different types here based on the context. // To avoid confusion, we always return the readonly type here. underlyingCookies = workUnitStore.userspaceMutableCookies; } else { underlyingCookies = workUnitStore.cookies; } if ("production" === 'development') { // Semantically we only need the dev tracking when running in `next dev` // but since you would never use next dev with production NODE_ENV we use this // as a proxy so we can statically exclude this code from production builds. if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedCookiesWithDevWarnings(underlyingCookies, workStore == null ? void 0 : workStore.route); } return makeUntrackedExoticCookiesWithDevWarnings(underlyingCookies, workStore == null ? void 0 : workStore.route); } else { if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedCookies(underlyingCookies); } return makeUntrackedExoticCookies(underlyingCookies); } default: workUnitStore; } } } // If we end up here, there was no work store or work unit store present. (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } function createEmptyCookies() { return _requestcookies.RequestCookiesAdapter.seal(new _cookies.RequestCookies(new Headers({}))); } const CachedCookies = new WeakMap(); function makeHangingCookies(workStore, prerenderStore) { const cachedPromise = CachedCookies.get(prerenderStore); if (cachedPromise) { return cachedPromise; } const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, '`cookies()`'); CachedCookies.set(prerenderStore, promise); return promise; } function makeUntrackedCookies(underlyingCookies) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = Promise.resolve(underlyingCookies); CachedCookies.set(underlyingCookies, promise); return promise; } function makeUntrackedExoticCookies(underlyingCookies) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = Promise.resolve(underlyingCookies); CachedCookies.set(underlyingCookies, promise); Object.defineProperties(promise, { [Symbol.iterator]: { value: underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].bind(underlyingCookies) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesIterator.bind(underlyingCookies) }, size: { get () { return underlyingCookies.size; } }, get: { value: underlyingCookies.get.bind(underlyingCookies) }, getAll: { value: underlyingCookies.getAll.bind(underlyingCookies) }, has: { value: underlyingCookies.has.bind(underlyingCookies) }, set: { value: underlyingCookies.set.bind(underlyingCookies) }, delete: { value: underlyingCookies.delete.bind(underlyingCookies) }, clear: { value: typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.bind(underlyingCookies) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesClear.bind(underlyingCookies, promise) }, toString: { value: underlyingCookies.toString.bind(underlyingCookies) } }); return promise; } function makeUntrackedExoticCookiesWithDevWarnings(underlyingCookies, route) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies); CachedCookies.set(underlyingCookies, promise); Object.defineProperties(promise, { [Symbol.iterator]: { value: function() { const expression = '`...cookies()` or similar iteration'; syncIODev(route, expression); return underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].apply(underlyingCookies, arguments) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesIterator.call(underlyingCookies); }, writable: false }, size: { get () { const expression = '`cookies().size`'; syncIODev(route, expression); return underlyingCookies.size; } }, get: { value: function get() { let expression; if (arguments.length === 0) { expression = '`cookies().get()`'; } else { expression = `\`cookies().get(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.get.apply(underlyingCookies, arguments); }, writable: false }, getAll: { value: function getAll() { let expression; if (arguments.length === 0) { expression = '`cookies().getAll()`'; } else { expression = `\`cookies().getAll(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.getAll.apply(underlyingCookies, arguments); }, writable: false }, has: { value: function get() { let expression; if (arguments.length === 0) { expression = '`cookies().has()`'; } else { expression = `\`cookies().has(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.has.apply(underlyingCookies, arguments); }, writable: false }, set: { value: function set() { let expression; if (arguments.length === 0) { expression = '`cookies().set()`'; } else { const arg = arguments[0]; if (arg) { expression = `\`cookies().set(${describeNameArg(arg)}, ...)\``; } else { expression = '`cookies().set(...)`'; } } syncIODev(route, expression); return underlyingCookies.set.apply(underlyingCookies, arguments); }, writable: false }, delete: { value: function() { let expression; if (arguments.length === 0) { expression = '`cookies().delete()`'; } else if (arguments.length === 1) { expression = `\`cookies().delete(${describeNameArg(arguments[0])})\``; } else { expression = `\`cookies().delete(${describeNameArg(arguments[0])}, ...)\``; } syncIODev(route, expression); return underlyingCookies.delete.apply(underlyingCookies, arguments); }, writable: false }, clear: { value: function clear() { const expression = '`cookies().clear()`'; syncIODev(route, expression); // @ts-ignore clear is defined in RequestCookies implementation but not in the type return typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.apply(underlyingCookies, arguments) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesClear.call(underlyingCookies, promise); }, writable: false }, toString: { value: function toString() { const expression = '`cookies().toString()` or implicit casting'; syncIODev(route, expression); return underlyingCookies.toString.apply(underlyingCookies, arguments); }, writable: false } }); return promise; } // Similar to `makeUntrackedExoticCookiesWithDevWarnings`, but just logging the // sync access without actually defining the cookies properties on the promise. function makeUntrackedCookiesWithDevWarnings(underlyingCookies, route) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case Symbol.iterator: { warnForSyncAccess(route, '`...cookies()` or similar iteration'); break; } case 'size': case 'get': case 'getAll': case 'has': case 'set': case 'delete': case 'clear': case 'toString': { warnForSyncAccess(route, `\`cookies().${prop}\``); break; } default: { // We only warn for well-defined properties of the cookies object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); CachedCookies.set(underlyingCookies, proxiedPromise); return proxiedPromise; } function describeNameArg(arg) { return typeof arg === 'object' && arg !== null && typeof arg.name === 'string' ? `'${arg.name}'` : typeof arg === 'string' ? `'${arg}'` : '...'; } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createCookiesAccessError); function createCookiesAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`cookies()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E223", enumerable: false, configurable: true }); } function polyfilledResponseCookiesIterator() { return this.getAll().map((c)=>[ c.name, c ]).values(); } function polyfilledResponseCookiesClear(returnable) { for (const cookie of this.getAll()){ this.delete(cookie.name); } return returnable; } //# sourceMappingURL=cookies.js.map L012undefined1458__webpack_unused_export__ = (undefined7878)undefined81122Object.defineProperty(exports, "U", (undefined200200))undefined227233__webpack_require__undefined2352828706undefined303309__webpack_require__undefined3113413675undefined379385__webpack_require__undefined3874299294undefined471477__webpack_require__undefined4795263033undefined556562__webpack_require__undefined5645966906undefined633639__webpack_require__undefined6416911938undefined726732__webpack_require__undefined7347612831undefined815821__webpack_require__undefined823873787undefined892898__webpack_require__undefined9009081716undefined936942__webpack_require__undefined9449779290undefined9981004__webpack_require__undefined100610453036undefined57825816falseundefined58195917{}undefined66716700falseundefined67037395{}undefined74327466falseundefined74697571{}undefined /***/ }) uI/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "U", ({ enumerable: true, get: function() { return cookies; } })); const _requestcookies = __webpack_require__(8706); const _cookies = __webpack_require__(3675); const _workasyncstorageexternal = __webpack_require__(9294); const _workunitasyncstorageexternal = __webpack_require__(3033); const _dynamicrendering = __webpack_require__(6906); const _staticgenerationbailout = __webpack_require__(1938); const _dynamicrenderingutils = __webpack_require__(2831); const _creatededupedbycallsiteservererrorlogger = __webpack_require__(787); const _utils = __webpack_require__(1716); const _invarianterror = __webpack_require__(9290); const _reflect = __webpack_require__(3036); function cookies() { const callingExpression = 'cookies'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E88", enumerable: false, configurable: true }); } if (workStore.forceStatic) { // When using forceStatic we override all other logic and always just return an empty // cookies object without tracking const underlyingCookies = createEmptyCookies(); return makeUntrackedExoticCookies(underlyingCookies); } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E549", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': const error = Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E398", enumerable: false, configurable: true }); Error.captureStackTrace(error, cookies); workStore.invalidDynamicUsageError ??= error; throw error; case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E157", enumerable: false, configurable: true }); case 'prerender': return makeHangingCookies(workStore, workUnitStore); case 'prerender-client': const exportName = '`cookies`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': // We need track dynamic access here eagerly to keep continuity with // how cookies has worked in PPR without cacheComponents. return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking); case 'prerender-legacy': // We track dynamic access here so we don't need to wrap the cookies // in individual property access tracking. return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore); case 'prerender-runtime': return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, makeUntrackedCookies(workUnitStore.cookies)); case 'private-cache': if (false) {} return makeUntrackedExoticCookies(workUnitStore.cookies); case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); let underlyingCookies; if ((0, _requestcookies.areCookiesMutableInCurrentPhase)(workUnitStore)) { // We can't conditionally return different types here based on the context. // To avoid confusion, we always return the readonly type here. underlyingCookies = workUnitStore.userspaceMutableCookies; } else { underlyingCookies = workUnitStore.cookies; } if (false) {} else { if (false) {} return makeUntrackedExoticCookies(underlyingCookies); } default: workUnitStore; } } } // If we end up here, there was no work store or work unit store present. (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } function createEmptyCookies() { return _requestcookies.RequestCookiesAdapter.seal(new _cookies.RequestCookies(new Headers({}))); } const CachedCookies = new WeakMap(); function makeHangingCookies(workStore, prerenderStore) { const cachedPromise = CachedCookies.get(prerenderStore); if (cachedPromise) { return cachedPromise; } const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, '`cookies()`'); CachedCookies.set(prerenderStore, promise); return promise; } function makeUntrackedCookies(underlyingCookies) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = Promise.resolve(underlyingCookies); CachedCookies.set(underlyingCookies, promise); return promise; } function makeUntrackedExoticCookies(underlyingCookies) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = Promise.resolve(underlyingCookies); CachedCookies.set(underlyingCookies, promise); Object.defineProperties(promise, { [Symbol.iterator]: { value: underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].bind(underlyingCookies) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesIterator.bind(underlyingCookies) }, size: { get () { return underlyingCookies.size; } }, get: { value: underlyingCookies.get.bind(underlyingCookies) }, getAll: { value: underlyingCookies.getAll.bind(underlyingCookies) }, has: { value: underlyingCookies.has.bind(underlyingCookies) }, set: { value: underlyingCookies.set.bind(underlyingCookies) }, delete: { value: underlyingCookies.delete.bind(underlyingCookies) }, clear: { value: typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.bind(underlyingCookies) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesClear.bind(underlyingCookies, promise) }, toString: { value: underlyingCookies.toString.bind(underlyingCookies) } }); return promise; } function makeUntrackedExoticCookiesWithDevWarnings(underlyingCookies, route) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies); CachedCookies.set(underlyingCookies, promise); Object.defineProperties(promise, { [Symbol.iterator]: { value: function() { const expression = '`...cookies()` or similar iteration'; syncIODev(route, expression); return underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].apply(underlyingCookies, arguments) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesIterator.call(underlyingCookies); }, writable: false }, size: { get () { const expression = '`cookies().size`'; syncIODev(route, expression); return underlyingCookies.size; } }, get: { value: function get() { let expression; if (arguments.length === 0) { expression = '`cookies().get()`'; } else { expression = `\`cookies().get(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.get.apply(underlyingCookies, arguments); }, writable: false }, getAll: { value: function getAll() { let expression; if (arguments.length === 0) { expression = '`cookies().getAll()`'; } else { expression = `\`cookies().getAll(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.getAll.apply(underlyingCookies, arguments); }, writable: false }, has: { value: function get() { let expression; if (arguments.length === 0) { expression = '`cookies().has()`'; } else { expression = `\`cookies().has(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.has.apply(underlyingCookies, arguments); }, writable: false }, set: { value: function set() { let expression; if (arguments.length === 0) { expression = '`cookies().set()`'; } else { const arg = arguments[0]; if (arg) { expression = `\`cookies().set(${describeNameArg(arg)}, ...)\``; } else { expression = '`cookies().set(...)`'; } } syncIODev(route, expression); return underlyingCookies.set.apply(underlyingCookies, arguments); }, writable: false }, delete: { value: function() { let expression; if (arguments.length === 0) { expression = '`cookies().delete()`'; } else if (arguments.length === 1) { expression = `\`cookies().delete(${describeNameArg(arguments[0])})\``; } else { expression = `\`cookies().delete(${describeNameArg(arguments[0])}, ...)\``; } syncIODev(route, expression); return underlyingCookies.delete.apply(underlyingCookies, arguments); }, writable: false }, clear: { value: function clear() { const expression = '`cookies().clear()`'; syncIODev(route, expression); // @ts-ignore clear is defined in RequestCookies implementation but not in the type return typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.apply(underlyingCookies, arguments) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesClear.call(underlyingCookies, promise); }, writable: false }, toString: { value: function toString() { const expression = '`cookies().toString()` or implicit casting'; syncIODev(route, expression); return underlyingCookies.toString.apply(underlyingCookies, arguments); }, writable: false } }); return promise; } // Similar to `makeUntrackedExoticCookiesWithDevWarnings`, but just logging the // sync access without actually defining the cookies properties on the promise. function makeUntrackedCookiesWithDevWarnings(underlyingCookies, route) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case Symbol.iterator: { warnForSyncAccess(route, '`...cookies()` or similar iteration'); break; } case 'size': case 'get': case 'getAll': case 'has': case 'set': case 'delete': case 'clear': case 'toString': { warnForSyncAccess(route, `\`cookies().${prop}\``); break; } default: { // We only warn for well-defined properties of the cookies object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); CachedCookies.set(underlyingCookies, proxiedPromise); return proxiedPromise; } function describeNameArg(arg) { return typeof arg === 'object' && arg !== null && typeof arg.name === 'string' ? `'${arg.name}'` : typeof arg === 'string' ? `'${arg}'` : '...'; } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createCookiesAccessError); function createCookiesAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`cookies()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E223", enumerable: false, configurable: true }); } function polyfilledResponseCookiesIterator() { return this.getAll().map((c)=>[ c.name, c ]).values(); } function polyfilledResponseCookiesClear(returnable) { for (const cookie of this.getAll()){ this.delete(cookie.name); } return returnable; } //# sourceMappingURL=cookies.js.map /***/ }) vy  zzN"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "cookies", { enumerable: true, get: function() { return cookies; } }); const _requestcookies = require("../web/spec-extension/adapters/request-cookies"); const _cookies = require("../web/spec-extension/cookies"); const _workasyncstorageexternal = require("../app-render/work-async-storage.external"); const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external"); const _dynamicrendering = require("../app-render/dynamic-rendering"); const _staticgenerationbailout = require("../../client/components/static-generation-bailout"); const _dynamicrenderingutils = require("../dynamic-rendering-utils"); const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger"); const _utils = require("./utils"); const _invarianterror = require("../../shared/lib/invariant-error"); const _reflect = require("../web/spec-extension/adapters/reflect"); function cookies() { const callingExpression = 'cookies'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E88", enumerable: false, configurable: true }); } if (workStore.forceStatic) { // When using forceStatic we override all other logic and always just return an empty // cookies object without tracking const underlyingCookies = createEmptyCookies(); return makeUntrackedExoticCookies(underlyingCookies); } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E549", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': const error = Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E398", enumerable: false, configurable: true }); Error.captureStackTrace(error, cookies); workStore.invalidDynamicUsageError ??= error; throw error; case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E157", enumerable: false, configurable: true }); case 'prerender': return makeHangingCookies(workStore, workUnitStore); case 'prerender-client': const exportName = '`cookies`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': // We need track dynamic access here eagerly to keep continuity with // how cookies has worked in PPR without cacheComponents. return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking); case 'prerender-legacy': // We track dynamic access here so we don't need to wrap the cookies // in individual property access tracking. return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore); case 'prerender-runtime': return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, makeUntrackedCookies(workUnitStore.cookies)); case 'private-cache': if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedCookies(workUnitStore.cookies); } return makeUntrackedExoticCookies(workUnitStore.cookies); case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); let underlyingCookies; if ((0, _requestcookies.areCookiesMutableInCurrentPhase)(workUnitStore)) { // We can't conditionally return different types here based on the context. // To avoid confusion, we always return the readonly type here. underlyingCookies = workUnitStore.userspaceMutableCookies; } else { underlyingCookies = workUnitStore.cookies; } if ("production" === 'development') { // Semantically we only need the dev tracking when running in `next dev` // but since you would never use next dev with production NODE_ENV we use this // as a proxy so we can statically exclude this code from production builds. if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedCookiesWithDevWarnings(underlyingCookies, workStore == null ? void 0 : workStore.route); } return makeUntrackedExoticCookiesWithDevWarnings(underlyingCookies, workStore == null ? void 0 : workStore.route); } else { if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedCookies(underlyingCookies); } return makeUntrackedExoticCookies(underlyingCookies); } default: workUnitStore; } } } // If we end up here, there was no work store or work unit store present. (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } function createEmptyCookies() { return _requestcookies.RequestCookiesAdapter.seal(new _cookies.RequestCookies(new Headers({}))); } const CachedCookies = new WeakMap(); function makeHangingCookies(workStore, prerenderStore) { const cachedPromise = CachedCookies.get(prerenderStore); if (cachedPromise) { return cachedPromise; } const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, '`cookies()`'); CachedCookies.set(prerenderStore, promise); return promise; } function makeUntrackedCookies(underlyingCookies) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = Promise.resolve(underlyingCookies); CachedCookies.set(underlyingCookies, promise); return promise; } function makeUntrackedExoticCookies(underlyingCookies) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = Promise.resolve(underlyingCookies); CachedCookies.set(underlyingCookies, promise); Object.defineProperties(promise, { [Symbol.iterator]: { value: underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].bind(underlyingCookies) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesIterator.bind(underlyingCookies) }, size: { get () { return underlyingCookies.size; } }, get: { value: underlyingCookies.get.bind(underlyingCookies) }, getAll: { value: underlyingCookies.getAll.bind(underlyingCookies) }, has: { value: underlyingCookies.has.bind(underlyingCookies) }, set: { value: underlyingCookies.set.bind(underlyingCookies) }, delete: { value: underlyingCookies.delete.bind(underlyingCookies) }, clear: { value: typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.bind(underlyingCookies) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesClear.bind(underlyingCookies, promise) }, toString: { value: underlyingCookies.toString.bind(underlyingCookies) } }); return promise; } function makeUntrackedExoticCookiesWithDevWarnings(underlyingCookies, route) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies); CachedCookies.set(underlyingCookies, promise); Object.defineProperties(promise, { [Symbol.iterator]: { value: function() { const expression = '`...cookies()` or similar iteration'; syncIODev(route, expression); return underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].apply(underlyingCookies, arguments) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesIterator.call(underlyingCookies); }, writable: false }, size: { get () { const expression = '`cookies().size`'; syncIODev(route, expression); return underlyingCookies.size; } }, get: { value: function get() { let expression; if (arguments.length === 0) { expression = '`cookies().get()`'; } else { expression = `\`cookies().get(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.get.apply(underlyingCookies, arguments); }, writable: false }, getAll: { value: function getAll() { let expression; if (arguments.length === 0) { expression = '`cookies().getAll()`'; } else { expression = `\`cookies().getAll(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.getAll.apply(underlyingCookies, arguments); }, writable: false }, has: { value: function get() { let expression; if (arguments.length === 0) { expression = '`cookies().has()`'; } else { expression = `\`cookies().has(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.has.apply(underlyingCookies, arguments); }, writable: false }, set: { value: function set() { let expression; if (arguments.length === 0) { expression = '`cookies().set()`'; } else { const arg = arguments[0]; if (arg) { expression = `\`cookies().set(${describeNameArg(arg)}, ...)\``; } else { expression = '`cookies().set(...)`'; } } syncIODev(route, expression); return underlyingCookies.set.apply(underlyingCookies, arguments); }, writable: false }, delete: { value: function() { let expression; if (arguments.length === 0) { expression = '`cookies().delete()`'; } else if (arguments.length === 1) { expression = `\`cookies().delete(${describeNameArg(arguments[0])})\``; } else { expression = `\`cookies().delete(${describeNameArg(arguments[0])}, ...)\``; } syncIODev(route, expression); return underlyingCookies.delete.apply(underlyingCookies, arguments); }, writable: false }, clear: { value: function clear() { const expression = '`cookies().clear()`'; syncIODev(route, expression); // @ts-ignore clear is defined in RequestCookies implementation but not in the type return typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.apply(underlyingCookies, arguments) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesClear.call(underlyingCookies, promise); }, writable: false }, toString: { value: function toString() { const expression = '`cookies().toString()` or implicit casting'; syncIODev(route, expression); return underlyingCookies.toString.apply(underlyingCookies, arguments); }, writable: false } }); return promise; } // Similar to `makeUntrackedExoticCookiesWithDevWarnings`, but just logging the // sync access without actually defining the cookies properties on the promise. function makeUntrackedCookiesWithDevWarnings(underlyingCookies, route) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case Symbol.iterator: { warnForSyncAccess(route, '`...cookies()` or similar iteration'); break; } case 'size': case 'get': case 'getAll': case 'has': case 'set': case 'delete': case 'clear': case 'toString': { warnForSyncAccess(route, `\`cookies().${prop}\``); break; } default: { // We only warn for well-defined properties of the cookies object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); CachedCookies.set(underlyingCookies, proxiedPromise); return proxiedPromise; } function describeNameArg(arg) { return typeof arg === 'object' && arg !== null && typeof arg.name === 'string' ? `'${arg.name}'` : typeof arg === 'string' ? `'${arg}'` : '...'; } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createCookiesAccessError); function createCookiesAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`cookies()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E223", enumerable: false, configurable: true }); } function polyfilledResponseCookiesIterator() { return this.getAll().map((c)=>[ c.name, c ]).values(); } function polyfilledResponseCookiesClear(returnable) { for (const cookie of this.getAll()){ this.delete(cookie.name); } return returnable; } //# sourceMappingURL=cookies.js.map L012undefined1458__webpack_unused_export__ = (undefined7878)undefined81122Object.defineProperty(exports, "U", (undefined200200))undefined227233__webpack_require__undefined2352828706undefined303309__webpack_require__undefined3113413675undefined379385__webpack_require__undefined3874299294undefined471477__webpack_require__undefined4795263033undefined556562__webpack_require__undefined5645966906undefined633639__webpack_require__undefined6416911938undefined726732__webpack_require__undefined7347612831undefined815821__webpack_require__undefined823873787undefined892898__webpack_require__undefined9009081716undefined936942__webpack_require__undefined9449779290undefined9981004__webpack_require__undefined100610453036undefined57825816falseundefined58195917{}undefined66716700falseundefined67037395{}undefined74327466falseundefined74697571{}undefinedz|, /***/ 4427:  qwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7954); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceZ// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"C:\\\\Users\\\\abd_b\\\\OneDrive\\\\Desktop\\\\COSMIC AI-Risk Dashboard\\\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\\\application\\\\saas-app\\\\src\\\\components\\\\LogoutButton.jsx\" from the server, but it's 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."); }, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\components\\LogoutButton.jsx", "default", ); `=GX Ċ@/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference));buffersourcesizemapshashY/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7954); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call the default export of \"C:\\\\Users\\\\abd_b\\\\OneDrive\\\\Desktop\\\\COSMIC AI-Risk Dashboard\\\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\\\application\\\\saas-app\\\\src\\\\components\\\\LogoutButton.jsx\" from the server, but it's 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."); }, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\components\\LogoutButton.jsx", "default", )); {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7954); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSourceZ// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"C:\\\\Users\\\\abd_b\\\\OneDrive\\\\Desktop\\\\COSMIC AI-Risk Dashboard\\\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\\\application\\\\saas-app\\\\src\\\\components\\\\LogoutButton.jsx\" from the server, but it's 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."); }, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\components\\LogoutButton.jsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined856856.5);undefined /***/ }) k/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7954); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call the default export of \"C:\\\\Users\\\\abd_b\\\\OneDrive\\\\Desktop\\\\COSMIC AI-Risk Dashboard\\\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\\\application\\\\saas-app\\\\src\\\\components\\\\LogoutButton.jsx\" from the server, but it's 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."); }, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\components\\LogoutButton.jsx", "default", )); /***/ }) lo  p}p/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7954); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); ~Z// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"C:\\\\Users\\\\abd_b\\\\OneDrive\\\\Desktop\\\\COSMIC AI-Risk Dashboard\\\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\\\application\\\\saas-app\\\\src\\\\components\\\\LogoutButton.jsx\" from the server, but it's 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."); }, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\components\\LogoutButton.jsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined856856.5);undefinedoq, /***/ 4589:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceimport(/* webpackMode: "eager", webpackExports: ["default"] */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\components\\LogoutButton.jsx"); @Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4427))buffersourcesizemapshashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4427)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceimport(/* webpackMode: "eager", webpackExports: ["default"] */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\components\\LogoutButton.jsx"); l0253Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4427))undefined /***/ }) `/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4427)); /***/ }) ad etl0253Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4427))undefinedfh, /***/ 4603:  ?webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Gwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcevar __webpack_unused_export__; webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcePE"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "headers", { enumerable: true, get: function() { return headers; } }); const _headers = require("../web/spec-extension/adapters/headers"); const _workasyncstorageexternal = require("../app-render/work-async-storage.external"); const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external"); const _dynamicrendering = require("../app-render/dynamic-rendering"); const _staticgenerationbailout = require("../../client/components/static-generation-bailout"); const _dynamicrenderingutils = require("../dynamic-rendering-utils"); const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger"); const _utils = require("./utils"); const _invarianterror = require("../../shared/lib/invariant-error"); const _reflect = require("../web/spec-extension/adapters/reflect"); function headers() { const callingExpression = 'headers'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "headers" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E367", enumerable: false, configurable: true }); } if (workStore.forceStatic) { // When using forceStatic we override all other logic and always just return an empty // headers object without tracking const underlyingHeaders = _headers.HeadersAdapter.seal(new Headers({})); return makeUntrackedExoticHeaders(underlyingHeaders); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E304", enumerable: false, configurable: true }); Error.captureStackTrace(error, headers); workStore.invalidDynamicUsageError ??= error; throw error; } case 'private-cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache: private". Accessing "headers" inside a private cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E742", enumerable: false, configurable: true }); Error.captureStackTrace(error, headers); workStore.invalidDynamicUsageError ??= error; throw error; } case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E127", enumerable: false, configurable: true }); case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'request': break; default: workUnitStore; } } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E525", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'prerender': case 'prerender-runtime': return makeHangingHeaders(workStore, workUnitStore); case 'prerender-client': const exportName = '`headers`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': // PPR Prerender (no cacheComponents) // We are prerendering with PPR. We need track dynamic access here eagerly // to keep continuity with how headers has worked in PPR without cacheComponents. // TODO consider switching the semantic to throw on property access instead return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking); case 'prerender-legacy': // Legacy Prerender // We are in a legacy static generation mode while prerendering // We track dynamic access here so we don't need to wrap the headers in // individual property access tracking. return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore); case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); if ("production" === 'development') { // Semantically we only need the dev tracking when running in `next dev` // but since you would never use next dev with production NODE_ENV we use this // as a proxy so we can statically exclude this code from production builds. if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedHeadersWithDevWarnings(workUnitStore.headers, workStore == null ? void 0 : workStore.route); } return makeUntrackedExoticHeadersWithDevWarnings(workUnitStore.headers, workStore == null ? void 0 : workStore.route); } else { if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedHeaders(workUnitStore.headers); } return makeUntrackedExoticHeaders(workUnitStore.headers); } break; default: workUnitStore; } } } // If we end up here, there was no work store or work unit store present. (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } const CachedHeaders = new WeakMap(); function makeHangingHeaders(workStore, prerenderStore) { const cachedHeaders = CachedHeaders.get(prerenderStore); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, '`headers()`'); CachedHeaders.set(prerenderStore, promise); return promise; } function makeUntrackedHeaders(underlyingHeaders) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = Promise.resolve(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); return promise; } function makeUntrackedExoticHeaders(underlyingHeaders) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = Promise.resolve(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); Object.defineProperties(promise, { append: { value: underlyingHeaders.append.bind(underlyingHeaders) }, delete: { value: underlyingHeaders.delete.bind(underlyingHeaders) }, get: { value: underlyingHeaders.get.bind(underlyingHeaders) }, has: { value: underlyingHeaders.has.bind(underlyingHeaders) }, set: { value: underlyingHeaders.set.bind(underlyingHeaders) }, getSetCookie: { value: underlyingHeaders.getSetCookie.bind(underlyingHeaders) }, forEach: { value: underlyingHeaders.forEach.bind(underlyingHeaders) }, keys: { value: underlyingHeaders.keys.bind(underlyingHeaders) }, values: { value: underlyingHeaders.values.bind(underlyingHeaders) }, entries: { value: underlyingHeaders.entries.bind(underlyingHeaders) }, [Symbol.iterator]: { value: underlyingHeaders[Symbol.iterator].bind(underlyingHeaders) } }); return promise; } function makeUntrackedExoticHeadersWithDevWarnings(underlyingHeaders, route) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); Object.defineProperties(promise, { append: { value: function append() { const expression = `\`headers().append(${describeNameArg(arguments[0])}, ...)\``; syncIODev(route, expression); return underlyingHeaders.append.apply(underlyingHeaders, arguments); } }, delete: { value: function _delete() { const expression = `\`headers().delete(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.delete.apply(underlyingHeaders, arguments); } }, get: { value: function get() { const expression = `\`headers().get(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.get.apply(underlyingHeaders, arguments); } }, has: { value: function has() { const expression = `\`headers().has(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.has.apply(underlyingHeaders, arguments); } }, set: { value: function set() { const expression = `\`headers().set(${describeNameArg(arguments[0])}, ...)\``; syncIODev(route, expression); return underlyingHeaders.set.apply(underlyingHeaders, arguments); } }, getSetCookie: { value: function getSetCookie() { const expression = '`headers().getSetCookie()`'; syncIODev(route, expression); return underlyingHeaders.getSetCookie.apply(underlyingHeaders, arguments); } }, forEach: { value: function forEach() { const expression = '`headers().forEach(...)`'; syncIODev(route, expression); return underlyingHeaders.forEach.apply(underlyingHeaders, arguments); } }, keys: { value: function keys() { const expression = '`headers().keys()`'; syncIODev(route, expression); return underlyingHeaders.keys.apply(underlyingHeaders, arguments); } }, values: { value: function values() { const expression = '`headers().values()`'; syncIODev(route, expression); return underlyingHeaders.values.apply(underlyingHeaders, arguments); } }, entries: { value: function entries() { const expression = '`headers().entries()`'; syncIODev(route, expression); return underlyingHeaders.entries.apply(underlyingHeaders, arguments); } }, [Symbol.iterator]: { value: function() { const expression = '`...headers()` or similar iteration'; syncIODev(route, expression); return underlyingHeaders[Symbol.iterator].apply(underlyingHeaders, arguments); } } }); return promise; } // Similar to `makeUntrackedExoticHeadersWithDevWarnings`, but just logging the // sync access without actually defining the headers properties on the promise. function makeUntrackedHeadersWithDevWarnings(underlyingHeaders, route) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingHeaders); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case Symbol.iterator: { warnForSyncAccess(route, '`...headers()` or similar iteration'); break; } case 'append': case 'delete': case 'get': case 'has': case 'set': case 'getSetCookie': case 'forEach': case 'keys': case 'values': case 'entries': { warnForSyncAccess(route, `\`headers().${prop}\``); break; } default: { // We only warn for well-defined properties of the headers object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); CachedHeaders.set(underlyingHeaders, proxiedPromise); return proxiedPromise; } function describeNameArg(arg) { return typeof arg === 'string' ? `'${arg}'` : '...'; } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createHeadersAccessError); function createHeadersAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`headers()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E277", enumerable: false, configurable: true }); } //# sourceMappingURL=headers.js.map h :NNQz_ 179c /57i28Q:B^dfJ __webpack_unused_export__ = ())__webpack_require__767592943033690619382831787171692903036false{}buffersourcesizemapshashAvar __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); __webpack_unused_export__ = ({ enumerable: true, get: function() { return headers; } }); const _headers = __webpack_require__(7675); const _workasyncstorageexternal = __webpack_require__(9294); const _workunitasyncstorageexternal = __webpack_require__(3033); const _dynamicrendering = __webpack_require__(6906); const _staticgenerationbailout = __webpack_require__(1938); const _dynamicrenderingutils = __webpack_require__(2831); const _creatededupedbycallsiteservererrorlogger = __webpack_require__(787); const _utils = __webpack_require__(1716); const _invarianterror = __webpack_require__(9290); const _reflect = __webpack_require__(3036); function headers() { const callingExpression = 'headers'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "headers" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E367", enumerable: false, configurable: true }); } if (workStore.forceStatic) { // When using forceStatic we override all other logic and always just return an empty // headers object without tracking const underlyingHeaders = _headers.HeadersAdapter.seal(new Headers({})); return makeUntrackedExoticHeaders(underlyingHeaders); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E304", enumerable: false, configurable: true }); Error.captureStackTrace(error, headers); workStore.invalidDynamicUsageError ??= error; throw error; } case 'private-cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache: private". Accessing "headers" inside a private cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E742", enumerable: false, configurable: true }); Error.captureStackTrace(error, headers); workStore.invalidDynamicUsageError ??= error; throw error; } case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E127", enumerable: false, configurable: true }); case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'request': break; default: workUnitStore; } } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E525", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'prerender': case 'prerender-runtime': return makeHangingHeaders(workStore, workUnitStore); case 'prerender-client': const exportName = '`headers`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': // PPR Prerender (no cacheComponents) // We are prerendering with PPR. We need track dynamic access here eagerly // to keep continuity with how headers has worked in PPR without cacheComponents. // TODO consider switching the semantic to throw on property access instead return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking); case 'prerender-legacy': // Legacy Prerender // We are in a legacy static generation mode while prerendering // We track dynamic access here so we don't need to wrap the headers in // individual property access tracking. return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore); case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); if (false) {} else { if (false) {} return makeUntrackedExoticHeaders(workUnitStore.headers); } break; default: workUnitStore; } } } // If we end up here, there was no work store or work unit store present. (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } const CachedHeaders = new WeakMap(); function makeHangingHeaders(workStore, prerenderStore) { const cachedHeaders = CachedHeaders.get(prerenderStore); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, '`headers()`'); CachedHeaders.set(prerenderStore, promise); return promise; } function makeUntrackedHeaders(underlyingHeaders) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = Promise.resolve(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); return promise; } function makeUntrackedExoticHeaders(underlyingHeaders) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = Promise.resolve(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); Object.defineProperties(promise, { append: { value: underlyingHeaders.append.bind(underlyingHeaders) }, delete: { value: underlyingHeaders.delete.bind(underlyingHeaders) }, get: { value: underlyingHeaders.get.bind(underlyingHeaders) }, has: { value: underlyingHeaders.has.bind(underlyingHeaders) }, set: { value: underlyingHeaders.set.bind(underlyingHeaders) }, getSetCookie: { value: underlyingHeaders.getSetCookie.bind(underlyingHeaders) }, forEach: { value: underlyingHeaders.forEach.bind(underlyingHeaders) }, keys: { value: underlyingHeaders.keys.bind(underlyingHeaders) }, values: { value: underlyingHeaders.values.bind(underlyingHeaders) }, entries: { value: underlyingHeaders.entries.bind(underlyingHeaders) }, [Symbol.iterator]: { value: underlyingHeaders[Symbol.iterator].bind(underlyingHeaders) } }); return promise; } function makeUntrackedExoticHeadersWithDevWarnings(underlyingHeaders, route) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); Object.defineProperties(promise, { append: { value: function append() { const expression = `\`headers().append(${describeNameArg(arguments[0])}, ...)\``; syncIODev(route, expression); return underlyingHeaders.append.apply(underlyingHeaders, arguments); } }, delete: { value: function _delete() { const expression = `\`headers().delete(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.delete.apply(underlyingHeaders, arguments); } }, get: { value: function get() { const expression = `\`headers().get(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.get.apply(underlyingHeaders, arguments); } }, has: { value: function has() { const expression = `\`headers().has(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.has.apply(underlyingHeaders, arguments); } }, set: { value: function set() { const expression = `\`headers().set(${describeNameArg(arguments[0])}, ...)\``; syncIODev(route, expression); return underlyingHeaders.set.apply(underlyingHeaders, arguments); } }, getSetCookie: { value: function getSetCookie() { const expression = '`headers().getSetCookie()`'; syncIODev(route, expression); return underlyingHeaders.getSetCookie.apply(underlyingHeaders, arguments); } }, forEach: { value: function forEach() { const expression = '`headers().forEach(...)`'; syncIODev(route, expression); return underlyingHeaders.forEach.apply(underlyingHeaders, arguments); } }, keys: { value: function keys() { const expression = '`headers().keys()`'; syncIODev(route, expression); return underlyingHeaders.keys.apply(underlyingHeaders, arguments); } }, values: { value: function values() { const expression = '`headers().values()`'; syncIODev(route, expression); return underlyingHeaders.values.apply(underlyingHeaders, arguments); } }, entries: { value: function entries() { const expression = '`headers().entries()`'; syncIODev(route, expression); return underlyingHeaders.entries.apply(underlyingHeaders, arguments); } }, [Symbol.iterator]: { value: function() { const expression = '`...headers()` or similar iteration'; syncIODev(route, expression); return underlyingHeaders[Symbol.iterator].apply(underlyingHeaders, arguments); } } }); return promise; } // Similar to `makeUntrackedExoticHeadersWithDevWarnings`, but just logging the // sync access without actually defining the headers properties on the promise. function makeUntrackedHeadersWithDevWarnings(underlyingHeaders, route) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingHeaders); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case Symbol.iterator: { warnForSyncAccess(route, '`...headers()` or similar iteration'); break; } case 'append': case 'delete': case 'get': case 'has': case 'set': case 'getSetCookie': case 'forEach': case 'keys': case 'values': case 'entries': { warnForSyncAccess(route, `\`headers().${prop}\``); break; } default: { // We only warn for well-defined properties of the headers object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); CachedHeaders.set(underlyingHeaders, proxiedPromise); return proxiedPromise; } function describeNameArg(arg) { return typeof arg === 'string' ? `'${arg}'` : '...'; } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createHeadersAccessError); function createHeadersAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`headers()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E277", enumerable: false, configurable: true }); } //# sourceMappingURL=headers.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSourcevar __webpack_unused_export__; ReplaceSourceRawSourcePE"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "headers", { enumerable: true, get: function() { return headers; } }); const _headers = require("../web/spec-extension/adapters/headers"); const _workasyncstorageexternal = require("../app-render/work-async-storage.external"); const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external"); const _dynamicrendering = require("../app-render/dynamic-rendering"); const _staticgenerationbailout = require("../../client/components/static-generation-bailout"); const _dynamicrenderingutils = require("../dynamic-rendering-utils"); const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger"); const _utils = require("./utils"); const _invarianterror = require("../../shared/lib/invariant-error"); const _reflect = require("../web/spec-extension/adapters/reflect"); function headers() { const callingExpression = 'headers'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "headers" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E367", enumerable: false, configurable: true }); } if (workStore.forceStatic) { // When using forceStatic we override all other logic and always just return an empty // headers object without tracking const underlyingHeaders = _headers.HeadersAdapter.seal(new Headers({})); return makeUntrackedExoticHeaders(underlyingHeaders); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E304", enumerable: false, configurable: true }); Error.captureStackTrace(error, headers); workStore.invalidDynamicUsageError ??= error; throw error; } case 'private-cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache: private". Accessing "headers" inside a private cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E742", enumerable: false, configurable: true }); Error.captureStackTrace(error, headers); workStore.invalidDynamicUsageError ??= error; throw error; } case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E127", enumerable: false, configurable: true }); case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'request': break; default: workUnitStore; } } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E525", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'prerender': case 'prerender-runtime': return makeHangingHeaders(workStore, workUnitStore); case 'prerender-client': const exportName = '`headers`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': // PPR Prerender (no cacheComponents) // We are prerendering with PPR. We need track dynamic access here eagerly // to keep continuity with how headers has worked in PPR without cacheComponents. // TODO consider switching the semantic to throw on property access instead return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking); case 'prerender-legacy': // Legacy Prerender // We are in a legacy static generation mode while prerendering // We track dynamic access here so we don't need to wrap the headers in // individual property access tracking. return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore); case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); if ("production" === 'development') { // Semantically we only need the dev tracking when running in `next dev` // but since you would never use next dev with production NODE_ENV we use this // as a proxy so we can statically exclude this code from production builds. if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedHeadersWithDevWarnings(workUnitStore.headers, workStore == null ? void 0 : workStore.route); } return makeUntrackedExoticHeadersWithDevWarnings(workUnitStore.headers, workStore == null ? void 0 : workStore.route); } else { if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedHeaders(workUnitStore.headers); } return makeUntrackedExoticHeaders(workUnitStore.headers); } break; default: workUnitStore; } } } // If we end up here, there was no work store or work unit store present. (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } const CachedHeaders = new WeakMap(); function makeHangingHeaders(workStore, prerenderStore) { const cachedHeaders = CachedHeaders.get(prerenderStore); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, '`headers()`'); CachedHeaders.set(prerenderStore, promise); return promise; } function makeUntrackedHeaders(underlyingHeaders) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = Promise.resolve(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); return promise; } function makeUntrackedExoticHeaders(underlyingHeaders) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = Promise.resolve(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); Object.defineProperties(promise, { append: { value: underlyingHeaders.append.bind(underlyingHeaders) }, delete: { value: underlyingHeaders.delete.bind(underlyingHeaders) }, get: { value: underlyingHeaders.get.bind(underlyingHeaders) }, has: { value: underlyingHeaders.has.bind(underlyingHeaders) }, set: { value: underlyingHeaders.set.bind(underlyingHeaders) }, getSetCookie: { value: underlyingHeaders.getSetCookie.bind(underlyingHeaders) }, forEach: { value: underlyingHeaders.forEach.bind(underlyingHeaders) }, keys: { value: underlyingHeaders.keys.bind(underlyingHeaders) }, values: { value: underlyingHeaders.values.bind(underlyingHeaders) }, entries: { value: underlyingHeaders.entries.bind(underlyingHeaders) }, [Symbol.iterator]: { value: underlyingHeaders[Symbol.iterator].bind(underlyingHeaders) } }); return promise; } function makeUntrackedExoticHeadersWithDevWarnings(underlyingHeaders, route) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); Object.defineProperties(promise, { append: { value: function append() { const expression = `\`headers().append(${describeNameArg(arguments[0])}, ...)\``; syncIODev(route, expression); return underlyingHeaders.append.apply(underlyingHeaders, arguments); } }, delete: { value: function _delete() { const expression = `\`headers().delete(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.delete.apply(underlyingHeaders, arguments); } }, get: { value: function get() { const expression = `\`headers().get(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.get.apply(underlyingHeaders, arguments); } }, has: { value: function has() { const expression = `\`headers().has(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.has.apply(underlyingHeaders, arguments); } }, set: { value: function set() { const expression = `\`headers().set(${describeNameArg(arguments[0])}, ...)\``; syncIODev(route, expression); return underlyingHeaders.set.apply(underlyingHeaders, arguments); } }, getSetCookie: { value: function getSetCookie() { const expression = '`headers().getSetCookie()`'; syncIODev(route, expression); return underlyingHeaders.getSetCookie.apply(underlyingHeaders, arguments); } }, forEach: { value: function forEach() { const expression = '`headers().forEach(...)`'; syncIODev(route, expression); return underlyingHeaders.forEach.apply(underlyingHeaders, arguments); } }, keys: { value: function keys() { const expression = '`headers().keys()`'; syncIODev(route, expression); return underlyingHeaders.keys.apply(underlyingHeaders, arguments); } }, values: { value: function values() { const expression = '`headers().values()`'; syncIODev(route, expression); return underlyingHeaders.values.apply(underlyingHeaders, arguments); } }, entries: { value: function entries() { const expression = '`headers().entries()`'; syncIODev(route, expression); return underlyingHeaders.entries.apply(underlyingHeaders, arguments); } }, [Symbol.iterator]: { value: function() { const expression = '`...headers()` or similar iteration'; syncIODev(route, expression); return underlyingHeaders[Symbol.iterator].apply(underlyingHeaders, arguments); } } }); return promise; } // Similar to `makeUntrackedExoticHeadersWithDevWarnings`, but just logging the // sync access without actually defining the headers properties on the promise. function makeUntrackedHeadersWithDevWarnings(underlyingHeaders, route) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingHeaders); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case Symbol.iterator: { warnForSyncAccess(route, '`...headers()` or similar iteration'); break; } case 'append': case 'delete': case 'get': case 'has': case 'set': case 'getSetCookie': case 'forEach': case 'keys': case 'values': case 'entries': { warnForSyncAccess(route, `\`headers().${prop}\``); break; } default: { // We only warn for well-defined properties of the headers object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); CachedHeaders.set(underlyingHeaders, proxiedPromise); return proxiedPromise; } function describeNameArg(arg) { return typeof arg === 'string' ? `'${arg}'` : '...'; } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createHeadersAccessError); function createHeadersAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`headers()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E277", enumerable: false, configurable: true }); } //# sourceMappingURL=headers.js.map 012undefined1458__webpack_unused_export__ = (undefined7878)undefined81122__webpack_unused_export__ = (undefined200200)undefined220226__webpack_require__undefined2282677675undefined305311__webpack_require__undefined3133559294undefined397403__webpack_require__undefined4054523033undefined482488__webpack_require__undefined4905226906undefined559565__webpack_require__undefined5676171938undefined652658__webpack_require__undefined6606872831undefined741747__webpack_require__undefined749799787undefined818824__webpack_require__undefined8268341716undefined862868__webpack_require__undefined8709039290undefined924930__webpack_require__undefined9329713036undefined73547383falseundefined73868086{}undefined81238157falseundefined81608266{}undefined /***/ }) WmA/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); __webpack_unused_export__ = ({ enumerable: true, get: function() { return headers; } }); const _headers = __webpack_require__(7675); const _workasyncstorageexternal = __webpack_require__(9294); const _workunitasyncstorageexternal = __webpack_require__(3033); const _dynamicrendering = __webpack_require__(6906); const _staticgenerationbailout = __webpack_require__(1938); const _dynamicrenderingutils = __webpack_require__(2831); const _creatededupedbycallsiteservererrorlogger = __webpack_require__(787); const _utils = __webpack_require__(1716); const _invarianterror = __webpack_require__(9290); const _reflect = __webpack_require__(3036); function headers() { const callingExpression = 'headers'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "headers" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E367", enumerable: false, configurable: true }); } if (workStore.forceStatic) { // When using forceStatic we override all other logic and always just return an empty // headers object without tracking const underlyingHeaders = _headers.HeadersAdapter.seal(new Headers({})); return makeUntrackedExoticHeaders(underlyingHeaders); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E304", enumerable: false, configurable: true }); Error.captureStackTrace(error, headers); workStore.invalidDynamicUsageError ??= error; throw error; } case 'private-cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache: private". Accessing "headers" inside a private cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E742", enumerable: false, configurable: true }); Error.captureStackTrace(error, headers); workStore.invalidDynamicUsageError ??= error; throw error; } case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E127", enumerable: false, configurable: true }); case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'request': break; default: workUnitStore; } } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E525", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'prerender': case 'prerender-runtime': return makeHangingHeaders(workStore, workUnitStore); case 'prerender-client': const exportName = '`headers`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': // PPR Prerender (no cacheComponents) // We are prerendering with PPR. We need track dynamic access here eagerly // to keep continuity with how headers has worked in PPR without cacheComponents. // TODO consider switching the semantic to throw on property access instead return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking); case 'prerender-legacy': // Legacy Prerender // We are in a legacy static generation mode while prerendering // We track dynamic access here so we don't need to wrap the headers in // individual property access tracking. return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore); case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); if (false) {} else { if (false) {} return makeUntrackedExoticHeaders(workUnitStore.headers); } break; default: workUnitStore; } } } // If we end up here, there was no work store or work unit store present. (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } const CachedHeaders = new WeakMap(); function makeHangingHeaders(workStore, prerenderStore) { const cachedHeaders = CachedHeaders.get(prerenderStore); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, '`headers()`'); CachedHeaders.set(prerenderStore, promise); return promise; } function makeUntrackedHeaders(underlyingHeaders) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = Promise.resolve(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); return promise; } function makeUntrackedExoticHeaders(underlyingHeaders) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = Promise.resolve(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); Object.defineProperties(promise, { append: { value: underlyingHeaders.append.bind(underlyingHeaders) }, delete: { value: underlyingHeaders.delete.bind(underlyingHeaders) }, get: { value: underlyingHeaders.get.bind(underlyingHeaders) }, has: { value: underlyingHeaders.has.bind(underlyingHeaders) }, set: { value: underlyingHeaders.set.bind(underlyingHeaders) }, getSetCookie: { value: underlyingHeaders.getSetCookie.bind(underlyingHeaders) }, forEach: { value: underlyingHeaders.forEach.bind(underlyingHeaders) }, keys: { value: underlyingHeaders.keys.bind(underlyingHeaders) }, values: { value: underlyingHeaders.values.bind(underlyingHeaders) }, entries: { value: underlyingHeaders.entries.bind(underlyingHeaders) }, [Symbol.iterator]: { value: underlyingHeaders[Symbol.iterator].bind(underlyingHeaders) } }); return promise; } function makeUntrackedExoticHeadersWithDevWarnings(underlyingHeaders, route) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); Object.defineProperties(promise, { append: { value: function append() { const expression = `\`headers().append(${describeNameArg(arguments[0])}, ...)\``; syncIODev(route, expression); return underlyingHeaders.append.apply(underlyingHeaders, arguments); } }, delete: { value: function _delete() { const expression = `\`headers().delete(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.delete.apply(underlyingHeaders, arguments); } }, get: { value: function get() { const expression = `\`headers().get(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.get.apply(underlyingHeaders, arguments); } }, has: { value: function has() { const expression = `\`headers().has(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.has.apply(underlyingHeaders, arguments); } }, set: { value: function set() { const expression = `\`headers().set(${describeNameArg(arguments[0])}, ...)\``; syncIODev(route, expression); return underlyingHeaders.set.apply(underlyingHeaders, arguments); } }, getSetCookie: { value: function getSetCookie() { const expression = '`headers().getSetCookie()`'; syncIODev(route, expression); return underlyingHeaders.getSetCookie.apply(underlyingHeaders, arguments); } }, forEach: { value: function forEach() { const expression = '`headers().forEach(...)`'; syncIODev(route, expression); return underlyingHeaders.forEach.apply(underlyingHeaders, arguments); } }, keys: { value: function keys() { const expression = '`headers().keys()`'; syncIODev(route, expression); return underlyingHeaders.keys.apply(underlyingHeaders, arguments); } }, values: { value: function values() { const expression = '`headers().values()`'; syncIODev(route, expression); return underlyingHeaders.values.apply(underlyingHeaders, arguments); } }, entries: { value: function entries() { const expression = '`headers().entries()`'; syncIODev(route, expression); return underlyingHeaders.entries.apply(underlyingHeaders, arguments); } }, [Symbol.iterator]: { value: function() { const expression = '`...headers()` or similar iteration'; syncIODev(route, expression); return underlyingHeaders[Symbol.iterator].apply(underlyingHeaders, arguments); } } }); return promise; } // Similar to `makeUntrackedExoticHeadersWithDevWarnings`, but just logging the // sync access without actually defining the headers properties on the promise. function makeUntrackedHeadersWithDevWarnings(underlyingHeaders, route) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingHeaders); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case Symbol.iterator: { warnForSyncAccess(route, '`...headers()` or similar iteration'); break; } case 'append': case 'delete': case 'get': case 'has': case 'set': case 'getSetCookie': case 'forEach': case 'keys': case 'values': case 'entries': { warnForSyncAccess(route, `\`headers().${prop}\``); break; } default: { // We only warn for well-defined properties of the headers object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); CachedHeaders.set(underlyingHeaders, proxiedPromise); return proxiedPromise; } function describeNameArg(arg) { return typeof arg === 'string' ? `'${arg}'` : '...'; } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createHeadersAccessError); function createHeadersAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`headers()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E277", enumerable: false, configurable: true }); } //# sourceMappingURL=headers.js.map /***/ }) X[  \\kPE"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "headers", { enumerable: true, get: function() { return headers; } }); const _headers = require("../web/spec-extension/adapters/headers"); const _workasyncstorageexternal = require("../app-render/work-async-storage.external"); const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external"); const _dynamicrendering = require("../app-render/dynamic-rendering"); const _staticgenerationbailout = require("../../client/components/static-generation-bailout"); const _dynamicrenderingutils = require("../dynamic-rendering-utils"); const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger"); const _utils = require("./utils"); const _invarianterror = require("../../shared/lib/invariant-error"); const _reflect = require("../web/spec-extension/adapters/reflect"); function headers() { const callingExpression = 'headers'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "headers" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E367", enumerable: false, configurable: true }); } if (workStore.forceStatic) { // When using forceStatic we override all other logic and always just return an empty // headers object without tracking const underlyingHeaders = _headers.HeadersAdapter.seal(new Headers({})); return makeUntrackedExoticHeaders(underlyingHeaders); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E304", enumerable: false, configurable: true }); Error.captureStackTrace(error, headers); workStore.invalidDynamicUsageError ??= error; throw error; } case 'private-cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache: private". Accessing "headers" inside a private cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E742", enumerable: false, configurable: true }); Error.captureStackTrace(error, headers); workStore.invalidDynamicUsageError ??= error; throw error; } case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E127", enumerable: false, configurable: true }); case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'request': break; default: workUnitStore; } } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E525", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'prerender': case 'prerender-runtime': return makeHangingHeaders(workStore, workUnitStore); case 'prerender-client': const exportName = '`headers`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': // PPR Prerender (no cacheComponents) // We are prerendering with PPR. We need track dynamic access here eagerly // to keep continuity with how headers has worked in PPR without cacheComponents. // TODO consider switching the semantic to throw on property access instead return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking); case 'prerender-legacy': // Legacy Prerender // We are in a legacy static generation mode while prerendering // We track dynamic access here so we don't need to wrap the headers in // individual property access tracking. return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore); case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); if ("production" === 'development') { // Semantically we only need the dev tracking when running in `next dev` // but since you would never use next dev with production NODE_ENV we use this // as a proxy so we can statically exclude this code from production builds. if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedHeadersWithDevWarnings(workUnitStore.headers, workStore == null ? void 0 : workStore.route); } return makeUntrackedExoticHeadersWithDevWarnings(workUnitStore.headers, workStore == null ? void 0 : workStore.route); } else { if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedHeaders(workUnitStore.headers); } return makeUntrackedExoticHeaders(workUnitStore.headers); } break; default: workUnitStore; } } } // If we end up here, there was no work store or work unit store present. (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } const CachedHeaders = new WeakMap(); function makeHangingHeaders(workStore, prerenderStore) { const cachedHeaders = CachedHeaders.get(prerenderStore); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, '`headers()`'); CachedHeaders.set(prerenderStore, promise); return promise; } function makeUntrackedHeaders(underlyingHeaders) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = Promise.resolve(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); return promise; } function makeUntrackedExoticHeaders(underlyingHeaders) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = Promise.resolve(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); Object.defineProperties(promise, { append: { value: underlyingHeaders.append.bind(underlyingHeaders) }, delete: { value: underlyingHeaders.delete.bind(underlyingHeaders) }, get: { value: underlyingHeaders.get.bind(underlyingHeaders) }, has: { value: underlyingHeaders.has.bind(underlyingHeaders) }, set: { value: underlyingHeaders.set.bind(underlyingHeaders) }, getSetCookie: { value: underlyingHeaders.getSetCookie.bind(underlyingHeaders) }, forEach: { value: underlyingHeaders.forEach.bind(underlyingHeaders) }, keys: { value: underlyingHeaders.keys.bind(underlyingHeaders) }, values: { value: underlyingHeaders.values.bind(underlyingHeaders) }, entries: { value: underlyingHeaders.entries.bind(underlyingHeaders) }, [Symbol.iterator]: { value: underlyingHeaders[Symbol.iterator].bind(underlyingHeaders) } }); return promise; } function makeUntrackedExoticHeadersWithDevWarnings(underlyingHeaders, route) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); Object.defineProperties(promise, { append: { value: function append() { const expression = `\`headers().append(${describeNameArg(arguments[0])}, ...)\``; syncIODev(route, expression); return underlyingHeaders.append.apply(underlyingHeaders, arguments); } }, delete: { value: function _delete() { const expression = `\`headers().delete(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.delete.apply(underlyingHeaders, arguments); } }, get: { value: function get() { const expression = `\`headers().get(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.get.apply(underlyingHeaders, arguments); } }, has: { value: function has() { const expression = `\`headers().has(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.has.apply(underlyingHeaders, arguments); } }, set: { value: function set() { const expression = `\`headers().set(${describeNameArg(arguments[0])}, ...)\``; syncIODev(route, expression); return underlyingHeaders.set.apply(underlyingHeaders, arguments); } }, getSetCookie: { value: function getSetCookie() { const expression = '`headers().getSetCookie()`'; syncIODev(route, expression); return underlyingHeaders.getSetCookie.apply(underlyingHeaders, arguments); } }, forEach: { value: function forEach() { const expression = '`headers().forEach(...)`'; syncIODev(route, expression); return underlyingHeaders.forEach.apply(underlyingHeaders, arguments); } }, keys: { value: function keys() { const expression = '`headers().keys()`'; syncIODev(route, expression); return underlyingHeaders.keys.apply(underlyingHeaders, arguments); } }, values: { value: function values() { const expression = '`headers().values()`'; syncIODev(route, expression); return underlyingHeaders.values.apply(underlyingHeaders, arguments); } }, entries: { value: function entries() { const expression = '`headers().entries()`'; syncIODev(route, expression); return underlyingHeaders.entries.apply(underlyingHeaders, arguments); } }, [Symbol.iterator]: { value: function() { const expression = '`...headers()` or similar iteration'; syncIODev(route, expression); return underlyingHeaders[Symbol.iterator].apply(underlyingHeaders, arguments); } } }); return promise; } // Similar to `makeUntrackedExoticHeadersWithDevWarnings`, but just logging the // sync access without actually defining the headers properties on the promise. function makeUntrackedHeadersWithDevWarnings(underlyingHeaders, route) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingHeaders); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case Symbol.iterator: { warnForSyncAccess(route, '`...headers()` or similar iteration'); break; } case 'append': case 'delete': case 'get': case 'has': case 'set': case 'getSetCookie': case 'forEach': case 'keys': case 'values': case 'entries': { warnForSyncAccess(route, `\`headers().${prop}\``); break; } default: { // We only warn for well-defined properties of the headers object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); CachedHeaders.set(underlyingHeaders, proxiedPromise); return proxiedPromise; } function describeNameArg(arg) { return typeof arg === 'string' ? `'${arg}'` : '...'; } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createHeadersAccessError); function createHeadersAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`headers()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E277", enumerable: false, configurable: true }); } //# sourceMappingURL=headers.js.map 012undefined1458__webpack_unused_export__ = (undefined7878)undefined81122__webpack_unused_export__ = (undefined200200)undefined220226__webpack_require__undefined2282677675undefined305311__webpack_require__undefined3133559294undefined397403__webpack_require__undefined4054523033undefined482488__webpack_require__undefined4905226906undefined559565__webpack_require__undefined5676171938undefined652658__webpack_require__undefined6606872831undefined741747__webpack_require__undefined749799787undefined818824__webpack_require__undefined8268341716undefined862868__webpack_require__undefined8709039290undefined924930__webpack_require__undefined9329713036undefined73547383falseundefined73868086{}undefined81238157falseundefined81608266{}undefined\^, /***/ 5511:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; #module.exports = require("crypto");  /***/ }) MQ/***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }) NQ RST#module.exports = require("crypto");SU, /***/ 5883:  4webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/***/ (() => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource buffersourcesizemapshash {"finalSource":true}mapbufferedMap ReplaceSourceRawSource /***/ }) Du FI JvYwwLN, /***/ 6330:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; +module.exports = require("@prisma/client");  /***/ }) =Y/***/ ((module) => { "use strict"; module.exports = require("@prisma/client"); /***/ }) >A BCD+module.exports = require("@prisma/client");CE, /***/ 6439:  +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");  /***/ }) 4z/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ }) 58 9:;Lmodule.exports = require("next/dist/shared/lib/no-fallback-error.external");:<, /***/ 6713:  $webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");  /***/ }) +s/***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/is-bot"); /***/ }) ,/ 012Emodule.exports = require("next/dist/shared/lib/router/utils/is-bot");13, /***/ 7275:   webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceK import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\builtin\\global-error.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\client-page.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\client-segment.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\http-access-fallback\\error-boundary.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\layout-router.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\metadata\\async-metadata.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\render-from-template-context.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\lib\\framework\\boundary-components.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\lib\\metadata\\generate\\icon-mark.js");  P   !&#(05AFEJH Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 4160, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1603, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8495, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 5170, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7526, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8922, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9234, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 2263, 23))Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2146))buffersourcesizemapshashPromise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 4160, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1603, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8495, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 5170, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7526, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8922, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9234, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 2263, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2146)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceK import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\builtin\\global-error.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\client-page.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\client-segment.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\http-access-fallback\\error-boundary.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\layout-router.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\metadata\\async-metadata.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\render-from-template-context.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\lib\\framework\\boundary-components.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\lib\\metadata\\generate\\icon-mark.js"); 0261Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 4160, 23))undefined266517Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1603, 23))undefined522776Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8495, 23))undefined7811057Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 5170, 23))undefined10621315Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7526, 23))undefined13201584Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8922, 23))undefined15891857Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9234, 23))undefined18622117Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 2263, 23))undefined21222376Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2146))undefined /***/ }) " /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 4160, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1603, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8495, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 5170, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7526, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8922, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9234, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 2263, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2146)); /***/ }) #& 'd6e0261Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 4160, 23))undefined266517Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1603, 23))undefined522776Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8495, 23))undefined7811057Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 5170, 23))undefined10621315Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7526, 23))undefined13201584Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8922, 23))undefined15891857Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9234, 23))undefined18622117Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 2263, 23))undefined21222376Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2146))undefined(*, /***/ 7964:  -webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; d '-/>C__webpack_require__6330false{}buffersourcesizemapshash const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSource "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; b012undefined3945__webpack_require__undefined47626330undefined175203falseundefined206253{}undefined /***/ }) */***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; /***/ })  S/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; , "use strict"; const { PrismaClient } = require("@prisma/client"); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if ("production" !== "production") { globalForPrisma.__cosmicPrisma = prisma; } module.exports = { prisma }; b012undefined3945__webpack_require__undefined47626330undefined175203falseundefined206253{}undefined, /***/ 8354:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("util");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("util"); /***/ })  !module.exports = require("util");, /***/ 8559:  Hwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; k !')7SY[bu{}@__webpack_require__796455117082buffersourcesizemapshash( const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; {"finalSource":true}mapbufferedMap ReplaceSourceRawSource&"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; 012undefined3339__webpack_require__undefined41557964undefined8389__webpack_require__undefined91985511undefined117123__webpack_require__undefined1251347082undefined /***/ }) /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; /***/ })    &"use strict"; const { prisma } = require("../lib/prisma"); const { randomBytes } = require("crypto"); const bcrypt = require("bcryptjs"); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; 012undefined3339__webpack_require__undefined41557964undefined8389__webpack_require__undefined91985511undefined117123__webpack_require__undefined1251347082undefined  , /***/ 8706:  ~`webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource ~ webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource>"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { MutableRequestCookiesAdapter: null, ReadonlyRequestCookiesError: null, RequestCookiesAdapter: null, appendMutableCookies: null, areCookiesMutableInCurrentPhase: null, createCookiesWithMutableAccessCheck: null, getModifiedCookieValues: null, responseCookiesToRequestCookies: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { MutableRequestCookiesAdapter: function() { return MutableRequestCookiesAdapter; }, ReadonlyRequestCookiesError: function() { return ReadonlyRequestCookiesError; }, RequestCookiesAdapter: function() { return RequestCookiesAdapter; }, appendMutableCookies: function() { return appendMutableCookies; }, areCookiesMutableInCurrentPhase: function() { return areCookiesMutableInCurrentPhase; }, createCookiesWithMutableAccessCheck: function() { return createCookiesWithMutableAccessCheck; }, getModifiedCookieValues: function() { return getModifiedCookieValues; }, responseCookiesToRequestCookies: function() { return responseCookiesToRequestCookies; } }); const _cookies = require("../cookies"); const _reflect = require("./reflect"); const _workasyncstorageexternal = require("../../../app-render/work-async-storage.external"); class ReadonlyRequestCookiesError extends Error { constructor(){ super('Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options'); } static callable() { throw new ReadonlyRequestCookiesError(); } } class RequestCookiesAdapter { static seal(cookies) { return new Proxy(cookies, { get (target, prop, receiver) { switch(prop){ case 'clear': case 'delete': case 'set': return ReadonlyRequestCookiesError.callable; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); } } const SYMBOL_MODIFY_COOKIE_VALUES = Symbol.for('next.mutated.cookies'); function getModifiedCookieValues(cookies) { const modified = cookies[SYMBOL_MODIFY_COOKIE_VALUES]; if (!modified || !Array.isArray(modified) || modified.length === 0) { return []; } return modified; } function appendMutableCookies(headers, mutableCookies) { const modifiedCookieValues = getModifiedCookieValues(mutableCookies); if (modifiedCookieValues.length === 0) { return false; } // Return a new response that extends the response with // the modified cookies as fallbacks. `res` cookies // will still take precedence. const resCookies = new _cookies.ResponseCookies(headers); const returnedCookies = resCookies.getAll(); // Set the modified cookies as fallbacks. for (const cookie of modifiedCookieValues){ resCookies.set(cookie); } // Set the original cookies as the final values. for (const cookie of returnedCookies){ resCookies.set(cookie); } return true; } class MutableRequestCookiesAdapter { static wrap(cookies, onUpdateCookies) { const responseCookies = new _cookies.ResponseCookies(new Headers()); for (const cookie of cookies.getAll()){ responseCookies.set(cookie); } let modifiedValues = []; const modifiedCookies = new Set(); const updateResponseCookies = ()=>{ // TODO-APP: change method of getting workStore const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); if (workStore) { workStore.pathWasRevalidated = true; } const allCookies = responseCookies.getAll(); modifiedValues = allCookies.filter((c)=>modifiedCookies.has(c.name)); if (onUpdateCookies) { const serializedCookies = []; for (const cookie of modifiedValues){ const tempCookies = new _cookies.ResponseCookies(new Headers()); tempCookies.set(cookie); serializedCookies.push(tempCookies.toString()); } onUpdateCookies(serializedCookies); } }; const wrappedCookies = new Proxy(responseCookies, { get (target, prop, receiver) { switch(prop){ // A special symbol to get the modified cookie values case SYMBOL_MODIFY_COOKIE_VALUES: return modifiedValues; // TODO: Throw error if trying to set a cookie after the response // headers have been set. case 'delete': return function(...args) { modifiedCookies.add(typeof args[0] === 'string' ? args[0] : args[0].name); try { target.delete(...args); return wrappedCookies; } finally{ updateResponseCookies(); } }; case 'set': return function(...args) { modifiedCookies.add(typeof args[0] === 'string' ? args[0] : args[0].name); try { target.set(...args); return wrappedCookies; } finally{ updateResponseCookies(); } }; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); return wrappedCookies; } } function createCookiesWithMutableAccessCheck(requestStore) { const wrappedCookies = new Proxy(requestStore.mutableCookies, { get (target, prop, receiver) { switch(prop){ case 'delete': return function(...args) { ensureCookiesAreStillMutable(requestStore, 'cookies().delete'); target.delete(...args); return wrappedCookies; }; case 'set': return function(...args) { ensureCookiesAreStillMutable(requestStore, 'cookies().set'); target.set(...args); return wrappedCookies; }; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); return wrappedCookies; } function areCookiesMutableInCurrentPhase(requestStore) { return requestStore.phase === 'action'; } /** Ensure that cookies() starts throwing on mutation * if we changed phases and can no longer mutate. * * This can happen when going: * 'render' -> 'after' * 'action' -> 'render' * */ function ensureCookiesAreStillMutable(requestStore, _callingExpression) { if (!areCookiesMutableInCurrentPhase(requestStore)) { // TODO: maybe we can give a more precise error message based on callingExpression? throw new ReadonlyRequestCookiesError(); } } function responseCookiesToRequestCookies(responseCookies) { const requestCookies = new _cookies.RequestCookies(new Headers()); for (const cookie of responseCookies.getAll()){ requestCookies.set(cookie); } return requestCookies; } //# sourceMappingURL=request-cookies.js.map  e :NNWLmsuObject.defineProperty(exports, "__esModule", ())0__webpack_require__367530369294buffersourcesizemapshash Object.defineProperty(exports, "__esModule", ({ value: true })); 0 && (0); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { MutableRequestCookiesAdapter: function() { return MutableRequestCookiesAdapter; }, ReadonlyRequestCookiesError: function() { return ReadonlyRequestCookiesError; }, RequestCookiesAdapter: function() { return RequestCookiesAdapter; }, appendMutableCookies: function() { return appendMutableCookies; }, areCookiesMutableInCurrentPhase: function() { return areCookiesMutableInCurrentPhase; }, createCookiesWithMutableAccessCheck: function() { return createCookiesWithMutableAccessCheck; }, getModifiedCookieValues: function() { return getModifiedCookieValues; }, responseCookiesToRequestCookies: function() { return responseCookiesToRequestCookies; } }); const _cookies = __webpack_require__(3675); const _reflect = __webpack_require__(3036); const _workasyncstorageexternal = __webpack_require__(9294); class ReadonlyRequestCookiesError extends Error { constructor(){ super('Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options'); } static callable() { throw new ReadonlyRequestCookiesError(); } } class RequestCookiesAdapter { static seal(cookies) { return new Proxy(cookies, { get (target, prop, receiver) { switch(prop){ case 'clear': case 'delete': case 'set': return ReadonlyRequestCookiesError.callable; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); } } const SYMBOL_MODIFY_COOKIE_VALUES = Symbol.for('next.mutated.cookies'); function getModifiedCookieValues(cookies) { const modified = cookies[SYMBOL_MODIFY_COOKIE_VALUES]; if (!modified || !Array.isArray(modified) || modified.length === 0) { return []; } return modified; } function appendMutableCookies(headers, mutableCookies) { const modifiedCookieValues = getModifiedCookieValues(mutableCookies); if (modifiedCookieValues.length === 0) { return false; } // Return a new response that extends the response with // the modified cookies as fallbacks. `res` cookies // will still take precedence. const resCookies = new _cookies.ResponseCookies(headers); const returnedCookies = resCookies.getAll(); // Set the modified cookies as fallbacks. for (const cookie of modifiedCookieValues){ resCookies.set(cookie); } // Set the original cookies as the final values. for (const cookie of returnedCookies){ resCookies.set(cookie); } return true; } class MutableRequestCookiesAdapter { static wrap(cookies, onUpdateCookies) { const responseCookies = new _cookies.ResponseCookies(new Headers()); for (const cookie of cookies.getAll()){ responseCookies.set(cookie); } let modifiedValues = []; const modifiedCookies = new Set(); const updateResponseCookies = ()=>{ // TODO-APP: change method of getting workStore const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); if (workStore) { workStore.pathWasRevalidated = true; } const allCookies = responseCookies.getAll(); modifiedValues = allCookies.filter((c)=>modifiedCookies.has(c.name)); if (onUpdateCookies) { const serializedCookies = []; for (const cookie of modifiedValues){ const tempCookies = new _cookies.ResponseCookies(new Headers()); tempCookies.set(cookie); serializedCookies.push(tempCookies.toString()); } onUpdateCookies(serializedCookies); } }; const wrappedCookies = new Proxy(responseCookies, { get (target, prop, receiver) { switch(prop){ // A special symbol to get the modified cookie values case SYMBOL_MODIFY_COOKIE_VALUES: return modifiedValues; // TODO: Throw error if trying to set a cookie after the response // headers have been set. case 'delete': return function(...args) { modifiedCookies.add(typeof args[0] === 'string' ? args[0] : args[0].name); try { target.delete(...args); return wrappedCookies; } finally{ updateResponseCookies(); } }; case 'set': return function(...args) { modifiedCookies.add(typeof args[0] === 'string' ? args[0] : args[0].name); try { target.set(...args); return wrappedCookies; } finally{ updateResponseCookies(); } }; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); return wrappedCookies; } } function createCookiesWithMutableAccessCheck(requestStore) { const wrappedCookies = new Proxy(requestStore.mutableCookies, { get (target, prop, receiver) { switch(prop){ case 'delete': return function(...args) { ensureCookiesAreStillMutable(requestStore, 'cookies().delete'); target.delete(...args); return wrappedCookies; }; case 'set': return function(...args) { ensureCookiesAreStillMutable(requestStore, 'cookies().set'); target.set(...args); return wrappedCookies; }; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); return wrappedCookies; } function areCookiesMutableInCurrentPhase(requestStore) { return requestStore.phase === 'action'; } /** Ensure that cookies() starts throwing on mutation * if we changed phases and can no longer mutate. * * This can happen when going: * 'render' -> 'after' * 'action' -> 'render' * */ function ensureCookiesAreStillMutable(requestStore, _callingExpression) { if (!areCookiesMutableInCurrentPhase(requestStore)) { // TODO: maybe we can give a more precise error message based on callingExpression? throw new ReadonlyRequestCookiesError(); } } function responseCookiesToRequestCookies(responseCookies) { const requestCookies = new _cookies.RequestCookies(new Headers()); for (const cookie of responseCookies.getAll()){ requestCookies.set(cookie); } return requestCookies; } //# sourceMappingURL=request-cookies.js.map {"finalSource":true}mapbufferedMap ReplaceSourceRawSource>"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { MutableRequestCookiesAdapter: null, ReadonlyRequestCookiesError: null, RequestCookiesAdapter: null, appendMutableCookies: null, areCookiesMutableInCurrentPhase: null, createCookiesWithMutableAccessCheck: null, getModifiedCookieValues: null, responseCookiesToRequestCookies: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { MutableRequestCookiesAdapter: function() { return MutableRequestCookiesAdapter; }, ReadonlyRequestCookiesError: function() { return ReadonlyRequestCookiesError; }, RequestCookiesAdapter: function() { return RequestCookiesAdapter; }, appendMutableCookies: function() { return appendMutableCookies; }, areCookiesMutableInCurrentPhase: function() { return areCookiesMutableInCurrentPhase; }, createCookiesWithMutableAccessCheck: function() { return createCookiesWithMutableAccessCheck; }, getModifiedCookieValues: function() { return getModifiedCookieValues; }, responseCookiesToRequestCookies: function() { return responseCookiesToRequestCookies; } }); const _cookies = require("../cookies"); const _reflect = require("./reflect"); const _workasyncstorageexternal = require("../../../app-render/work-async-storage.external"); class ReadonlyRequestCookiesError extends Error { constructor(){ super('Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options'); } static callable() { throw new ReadonlyRequestCookiesError(); } } class RequestCookiesAdapter { static seal(cookies) { return new Proxy(cookies, { get (target, prop, receiver) { switch(prop){ case 'clear': case 'delete': case 'set': return ReadonlyRequestCookiesError.callable; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); } } const SYMBOL_MODIFY_COOKIE_VALUES = Symbol.for('next.mutated.cookies'); function getModifiedCookieValues(cookies) { const modified = cookies[SYMBOL_MODIFY_COOKIE_VALUES]; if (!modified || !Array.isArray(modified) || modified.length === 0) { return []; } return modified; } function appendMutableCookies(headers, mutableCookies) { const modifiedCookieValues = getModifiedCookieValues(mutableCookies); if (modifiedCookieValues.length === 0) { return false; } // Return a new response that extends the response with // the modified cookies as fallbacks. `res` cookies // will still take precedence. const resCookies = new _cookies.ResponseCookies(headers); const returnedCookies = resCookies.getAll(); // Set the modified cookies as fallbacks. for (const cookie of modifiedCookieValues){ resCookies.set(cookie); } // Set the original cookies as the final values. for (const cookie of returnedCookies){ resCookies.set(cookie); } return true; } class MutableRequestCookiesAdapter { static wrap(cookies, onUpdateCookies) { const responseCookies = new _cookies.ResponseCookies(new Headers()); for (const cookie of cookies.getAll()){ responseCookies.set(cookie); } let modifiedValues = []; const modifiedCookies = new Set(); const updateResponseCookies = ()=>{ // TODO-APP: change method of getting workStore const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); if (workStore) { workStore.pathWasRevalidated = true; } const allCookies = responseCookies.getAll(); modifiedValues = allCookies.filter((c)=>modifiedCookies.has(c.name)); if (onUpdateCookies) { const serializedCookies = []; for (const cookie of modifiedValues){ const tempCookies = new _cookies.ResponseCookies(new Headers()); tempCookies.set(cookie); serializedCookies.push(tempCookies.toString()); } onUpdateCookies(serializedCookies); } }; const wrappedCookies = new Proxy(responseCookies, { get (target, prop, receiver) { switch(prop){ // A special symbol to get the modified cookie values case SYMBOL_MODIFY_COOKIE_VALUES: return modifiedValues; // TODO: Throw error if trying to set a cookie after the response // headers have been set. case 'delete': return function(...args) { modifiedCookies.add(typeof args[0] === 'string' ? args[0] : args[0].name); try { target.delete(...args); return wrappedCookies; } finally{ updateResponseCookies(); } }; case 'set': return function(...args) { modifiedCookies.add(typeof args[0] === 'string' ? args[0] : args[0].name); try { target.set(...args); return wrappedCookies; } finally{ updateResponseCookies(); } }; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); return wrappedCookies; } } function createCookiesWithMutableAccessCheck(requestStore) { const wrappedCookies = new Proxy(requestStore.mutableCookies, { get (target, prop, receiver) { switch(prop){ case 'delete': return function(...args) { ensureCookiesAreStillMutable(requestStore, 'cookies().delete'); target.delete(...args); return wrappedCookies; }; case 'set': return function(...args) { ensureCookiesAreStillMutable(requestStore, 'cookies().set'); target.set(...args); return wrappedCookies; }; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); return wrappedCookies; } function areCookiesMutableInCurrentPhase(requestStore) { return requestStore.phase === 'action'; } /** Ensure that cookies() starts throwing on mutation * if we changed phases and can no longer mutate. * * This can happen when going: * 'render' -> 'after' * 'action' -> 'render' * */ function ensureCookiesAreStillMutable(requestStore, _callingExpression) { if (!areCookiesMutableInCurrentPhase(requestStore)) { // TODO: maybe we can give a more precise error message based on callingExpression? throw new ReadonlyRequestCookiesError(); } } function responseCookiesToRequestCookies(responseCookies) { const requestCookies = new _cookies.RequestCookies(new Headers()); for (const cookie of responseCookies.getAll()){ requestCookies.set(cookie); } return requestCookies; } //# sourceMappingURL=request-cookies.js.map012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined874170undefined13891395__webpack_require__undefined139714083675undefined14291435__webpack_require__undefined143714473036undefined14851491__webpack_require__undefined149315419294undefined /***/ }) ./***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); 0 && (0); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { MutableRequestCookiesAdapter: function() { return MutableRequestCookiesAdapter; }, ReadonlyRequestCookiesError: function() { return ReadonlyRequestCookiesError; }, RequestCookiesAdapter: function() { return RequestCookiesAdapter; }, appendMutableCookies: function() { return appendMutableCookies; }, areCookiesMutableInCurrentPhase: function() { return areCookiesMutableInCurrentPhase; }, createCookiesWithMutableAccessCheck: function() { return createCookiesWithMutableAccessCheck; }, getModifiedCookieValues: function() { return getModifiedCookieValues; }, responseCookiesToRequestCookies: function() { return responseCookiesToRequestCookies; } }); const _cookies = __webpack_require__(3675); const _reflect = __webpack_require__(3036); const _workasyncstorageexternal = __webpack_require__(9294); class ReadonlyRequestCookiesError extends Error { constructor(){ super('Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options'); } static callable() { throw new ReadonlyRequestCookiesError(); } } class RequestCookiesAdapter { static seal(cookies) { return new Proxy(cookies, { get (target, prop, receiver) { switch(prop){ case 'clear': case 'delete': case 'set': return ReadonlyRequestCookiesError.callable; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); } } const SYMBOL_MODIFY_COOKIE_VALUES = Symbol.for('next.mutated.cookies'); function getModifiedCookieValues(cookies) { const modified = cookies[SYMBOL_MODIFY_COOKIE_VALUES]; if (!modified || !Array.isArray(modified) || modified.length === 0) { return []; } return modified; } function appendMutableCookies(headers, mutableCookies) { const modifiedCookieValues = getModifiedCookieValues(mutableCookies); if (modifiedCookieValues.length === 0) { return false; } // Return a new response that extends the response with // the modified cookies as fallbacks. `res` cookies // will still take precedence. const resCookies = new _cookies.ResponseCookies(headers); const returnedCookies = resCookies.getAll(); // Set the modified cookies as fallbacks. for (const cookie of modifiedCookieValues){ resCookies.set(cookie); } // Set the original cookies as the final values. for (const cookie of returnedCookies){ resCookies.set(cookie); } return true; } class MutableRequestCookiesAdapter { static wrap(cookies, onUpdateCookies) { const responseCookies = new _cookies.ResponseCookies(new Headers()); for (const cookie of cookies.getAll()){ responseCookies.set(cookie); } let modifiedValues = []; const modifiedCookies = new Set(); const updateResponseCookies = ()=>{ // TODO-APP: change method of getting workStore const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); if (workStore) { workStore.pathWasRevalidated = true; } const allCookies = responseCookies.getAll(); modifiedValues = allCookies.filter((c)=>modifiedCookies.has(c.name)); if (onUpdateCookies) { const serializedCookies = []; for (const cookie of modifiedValues){ const tempCookies = new _cookies.ResponseCookies(new Headers()); tempCookies.set(cookie); serializedCookies.push(tempCookies.toString()); } onUpdateCookies(serializedCookies); } }; const wrappedCookies = new Proxy(responseCookies, { get (target, prop, receiver) { switch(prop){ // A special symbol to get the modified cookie values case SYMBOL_MODIFY_COOKIE_VALUES: return modifiedValues; // TODO: Throw error if trying to set a cookie after the response // headers have been set. case 'delete': return function(...args) { modifiedCookies.add(typeof args[0] === 'string' ? args[0] : args[0].name); try { target.delete(...args); return wrappedCookies; } finally{ updateResponseCookies(); } }; case 'set': return function(...args) { modifiedCookies.add(typeof args[0] === 'string' ? args[0] : args[0].name); try { target.set(...args); return wrappedCookies; } finally{ updateResponseCookies(); } }; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); return wrappedCookies; } } function createCookiesWithMutableAccessCheck(requestStore) { const wrappedCookies = new Proxy(requestStore.mutableCookies, { get (target, prop, receiver) { switch(prop){ case 'delete': return function(...args) { ensureCookiesAreStillMutable(requestStore, 'cookies().delete'); target.delete(...args); return wrappedCookies; }; case 'set': return function(...args) { ensureCookiesAreStillMutable(requestStore, 'cookies().set'); target.set(...args); return wrappedCookies; }; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); return wrappedCookies; } function areCookiesMutableInCurrentPhase(requestStore) { return requestStore.phase === 'action'; } /** Ensure that cookies() starts throwing on mutation * if we changed phases and can no longer mutate. * * This can happen when going: * 'render' -> 'after' * 'action' -> 'render' * */ function ensureCookiesAreStillMutable(requestStore, _callingExpression) { if (!areCookiesMutableInCurrentPhase(requestStore)) { // TODO: maybe we can give a more precise error message based on callingExpression? throw new ReadonlyRequestCookiesError(); } } function responseCookiesToRequestCookies(responseCookies) { const requestCookies = new _cookies.RequestCookies(new Headers()); for (const cookie of responseCookies.getAll()){ requestCookies.set(cookie); } return requestCookies; } //# sourceMappingURL=request-cookies.js.map /***/ })  z>"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { MutableRequestCookiesAdapter: null, ReadonlyRequestCookiesError: null, RequestCookiesAdapter: null, appendMutableCookies: null, areCookiesMutableInCurrentPhase: null, createCookiesWithMutableAccessCheck: null, getModifiedCookieValues: null, responseCookiesToRequestCookies: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { MutableRequestCookiesAdapter: function() { return MutableRequestCookiesAdapter; }, ReadonlyRequestCookiesError: function() { return ReadonlyRequestCookiesError; }, RequestCookiesAdapter: function() { return RequestCookiesAdapter; }, appendMutableCookies: function() { return appendMutableCookies; }, areCookiesMutableInCurrentPhase: function() { return areCookiesMutableInCurrentPhase; }, createCookiesWithMutableAccessCheck: function() { return createCookiesWithMutableAccessCheck; }, getModifiedCookieValues: function() { return getModifiedCookieValues; }, responseCookiesToRequestCookies: function() { return responseCookiesToRequestCookies; } }); const _cookies = require("../cookies"); const _reflect = require("./reflect"); const _workasyncstorageexternal = require("../../../app-render/work-async-storage.external"); class ReadonlyRequestCookiesError extends Error { constructor(){ super('Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options'); } static callable() { throw new ReadonlyRequestCookiesError(); } } class RequestCookiesAdapter { static seal(cookies) { return new Proxy(cookies, { get (target, prop, receiver) { switch(prop){ case 'clear': case 'delete': case 'set': return ReadonlyRequestCookiesError.callable; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); } } const SYMBOL_MODIFY_COOKIE_VALUES = Symbol.for('next.mutated.cookies'); function getModifiedCookieValues(cookies) { const modified = cookies[SYMBOL_MODIFY_COOKIE_VALUES]; if (!modified || !Array.isArray(modified) || modified.length === 0) { return []; } return modified; } function appendMutableCookies(headers, mutableCookies) { const modifiedCookieValues = getModifiedCookieValues(mutableCookies); if (modifiedCookieValues.length === 0) { return false; } // Return a new response that extends the response with // the modified cookies as fallbacks. `res` cookies // will still take precedence. const resCookies = new _cookies.ResponseCookies(headers); const returnedCookies = resCookies.getAll(); // Set the modified cookies as fallbacks. for (const cookie of modifiedCookieValues){ resCookies.set(cookie); } // Set the original cookies as the final values. for (const cookie of returnedCookies){ resCookies.set(cookie); } return true; } class MutableRequestCookiesAdapter { static wrap(cookies, onUpdateCookies) { const responseCookies = new _cookies.ResponseCookies(new Headers()); for (const cookie of cookies.getAll()){ responseCookies.set(cookie); } let modifiedValues = []; const modifiedCookies = new Set(); const updateResponseCookies = ()=>{ // TODO-APP: change method of getting workStore const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); if (workStore) { workStore.pathWasRevalidated = true; } const allCookies = responseCookies.getAll(); modifiedValues = allCookies.filter((c)=>modifiedCookies.has(c.name)); if (onUpdateCookies) { const serializedCookies = []; for (const cookie of modifiedValues){ const tempCookies = new _cookies.ResponseCookies(new Headers()); tempCookies.set(cookie); serializedCookies.push(tempCookies.toString()); } onUpdateCookies(serializedCookies); } }; const wrappedCookies = new Proxy(responseCookies, { get (target, prop, receiver) { switch(prop){ // A special symbol to get the modified cookie values case SYMBOL_MODIFY_COOKIE_VALUES: return modifiedValues; // TODO: Throw error if trying to set a cookie after the response // headers have been set. case 'delete': return function(...args) { modifiedCookies.add(typeof args[0] === 'string' ? args[0] : args[0].name); try { target.delete(...args); return wrappedCookies; } finally{ updateResponseCookies(); } }; case 'set': return function(...args) { modifiedCookies.add(typeof args[0] === 'string' ? args[0] : args[0].name); try { target.set(...args); return wrappedCookies; } finally{ updateResponseCookies(); } }; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); return wrappedCookies; } } function createCookiesWithMutableAccessCheck(requestStore) { const wrappedCookies = new Proxy(requestStore.mutableCookies, { get (target, prop, receiver) { switch(prop){ case 'delete': return function(...args) { ensureCookiesAreStillMutable(requestStore, 'cookies().delete'); target.delete(...args); return wrappedCookies; }; case 'set': return function(...args) { ensureCookiesAreStillMutable(requestStore, 'cookies().set'); target.set(...args); return wrappedCookies; }; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); return wrappedCookies; } function areCookiesMutableInCurrentPhase(requestStore) { return requestStore.phase === 'action'; } /** Ensure that cookies() starts throwing on mutation * if we changed phases and can no longer mutate. * * This can happen when going: * 'render' -> 'after' * 'action' -> 'render' * */ function ensureCookiesAreStillMutable(requestStore, _callingExpression) { if (!areCookiesMutableInCurrentPhase(requestStore)) { // TODO: maybe we can give a more precise error message based on callingExpression? throw new ReadonlyRequestCookiesError(); } } function responseCookiesToRequestCookies(responseCookies) { const requestCookies = new _cookies.RequestCookies(new Headers()); for (const cookie of responseCookies.getAll()){ requestCookies.set(cookie); } return requestCookies; } //# sourceMappingURL=request-cookies.js.map012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined874170undefined13891395__webpack_require__undefined139714083675undefined14291435__webpack_require__undefined143714473036undefined14851491__webpack_require__undefined149315419294undefined, /***/ 9121:  8webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/action-async-storage.external.js"); /***/ })  Ymodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");, /***/ 9294:  6webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");  /***/ }) /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ })  Wmodule.exports = require("next/dist/server/app-render/work-async-storage.external.js");, /***/ 9458:  Awebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ HomePage), dynamic: () => (/* binding */ dynamic) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5338); // EXTERNAL MODULE: ./src/services/auth-service.js var auth_service = __webpack_require__(8559); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/cookies.js var cookies = __webpack_require__(4230); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/headers.js var headers = __webpack_require__(4603); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/draft-mode.js var draft_mode = __webpack_require__(3535); ;// ./node_modules/next/dist/api/headers.js webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Vwebpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceexport * from '../server/request/cookies'; export * from '../server/request/headers'; export * from '../server/request/draft-mode'; //# sourceMappingURL=headers.js.map c)+TV@buffersourcesizemapshash' //# sourceMappingURL=headers.js.map {"finalSource":false}mapbufferedMap ReplaceSourceRawSourceexport * from '../server/request/cookies'; export * from '../server/request/headers'; export * from '../server/request/draft-mode'; //# sourceMappingURL=headers.js.map'041undefined4384undefined86130undefined| // EXTERNAL MODULE: ./src/components/LogoutButton.jsx var LogoutButton = __webpack_require__(4427); ;// ./src/app/page.jsx  $webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { getActorFromSession } from "../services/auth-service"; import { cookies } from "next/headers"; import LogoutButton from "../components/LogoutButton"; export const dynamic = 'force-dynamic'; export default async function HomePage() { const cookieStore = await cookies(); const token = cookieStore.get("cosmic_session")?.value; const actor = token ? await getActorFromSession(token) : null; return /*#__PURE__*/ _jsxs("main", { className: "shell", children: [ /*#__PURE__*/ _jsxs("header", { className: "topbar", children: [ /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx("div", { className: "brand", children: "COSMIC AI-Risk SaaS" }) }), /*#__PURE__*/ _jsx("nav", { className: "nav", "aria-label": "Main navigation", children: actor ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: actor.displayName }), /*#__PURE__*/ _jsx("a", { href: "/dashboard", children: "Dashboard" }), /*#__PURE__*/ _jsx(LogoutButton, { className: "logout-link", children: "Sign out" }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("a", { href: "/login", children: "Sign in" }), /*#__PURE__*/ _jsx("a", { href: "/signup", children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ _jsxs("section", { className: "hero", style: { textAlign: "center", padding: "80px 24px" }, children: [ /*#__PURE__*/ _jsx("h1", { style: { fontSize: 48, letterSpacing: "-0.05em", marginBottom: 16 }, children: "COSMIC AI-Risk SaaS" }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 20, maxWidth: 600, margin: "0 auto 32px" }, children: "Multi-tenant AI risk governance platform. Measure, mitigate, and govern AI project risks across your organization." }), /*#__PURE__*/ _jsx("div", { style: { display: "flex", gap: 12, justifyContent: "center" }, children: actor ? /*#__PURE__*/ _jsx("a", { href: "/dashboard", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Open dashboard" }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("a", { href: "/login", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Sign in" }), /*#__PURE__*/ _jsx("a", { href: "/signup", className: "button secondary", style: { padding: "12px 32px", fontSize: 16 }, children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ _jsx("section", { className: "content", children: /*#__PURE__*/ _jsxs("div", { className: "grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }, children: [ /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "Multi-tenant" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Organizations, workspaces, and role-based access control for enterprise teams." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "AI Risk Scoring" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "COSMIC risk engine with probability, impact, and detectability scoring across governance dimensions." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "Deployment Gates" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Nine-criteria gate evaluation with reviewer decisions and full audit trail." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "PM Integrations" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Trello, Jira, Asana, and Microsoft Planner sync with OAuth-ready live connectors." }) ] }) ] }) }) ] }); } c.UW_,gm dh_ 5 8   \X``dlo gktw__WEBPACK_MODULE_REFERENCE__5_5b22636f6f6b696573225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b226765744163746f7246726f6d53657373696f6e225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._* const dynamic = 'force-dynamic'; async function HomePage() { const cookieStore = await __WEBPACK_MODULE_REFERENCE__5_5b22636f6f6b696573225d_call_directImport_asiSafe1__._(); const token = cookieStore.get("cosmic_session")?.value; const actor = token ? await __WEBPACK_MODULE_REFERENCE__1_5b226765744163746f7246726f6d53657373696f6e225d_call_directImport_asiSafe1__._(token) : null; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("main", { className: "shell", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("header", { className: "topbar", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "brand", children: "COSMIC AI-Risk SaaS" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("nav", { className: "nav", "aria-label": "Main navigation", children: actor ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: actor.displayName }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/dashboard", children: "Dashboard" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._, { className: "logout-link", children: "Sign out" }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/login", children: "Sign in" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/signup", children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("section", { className: "hero", style: { textAlign: "center", padding: "80px 24px" }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h1", { style: { fontSize: 48, letterSpacing: "-0.05em", marginBottom: 16 }, children: "COSMIC AI-Risk SaaS" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", style: { fontSize: 20, maxWidth: 600, margin: "0 auto 32px" }, children: "Multi-tenant AI risk governance platform. Measure, mitigate, and govern AI project risks across your organization." }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { style: { display: "flex", gap: 12, justifyContent: "center" }, children: actor ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/dashboard", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Open dashboard" }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/login", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Sign in" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/signup", className: "button secondary", style: { padding: "12px 32px", fontSize: 16 }, children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("section", { className: "content", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "panel", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { children: "Multi-tenant" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", children: "Organizations, workspaces, and role-based access control for enterprise teams." }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "panel", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { children: "AI Risk Scoring" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", children: "COSMIC risk engine with probability, impact, and detectability scoring across governance dimensions." }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "panel", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { children: "Deployment Gates" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", children: "Nine-criteria gate evaluation with reviewer decisions and full audit trail." }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "panel", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { children: "PM Integrations" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", children: "Trello, Jira, Asana, and Microsoft Planner sync with OAuth-ready live connectors." }) ] }) ] }) }) ] }); }   import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { getActorFromSession } from "../services/auth-service"; import { cookies } from "next/headers"; import LogoutButton from "../components/LogoutButton"; export const dynamic = 'force-dynamic'; export default async function HomePage() { const cookieStore = await cookies(); const token = cookieStore.get("cosmic_session")?.value; const actor = token ? await getActorFromSession(token) : null; return /*#__PURE__*/ _jsxs("main", { className: "shell", children: [ /*#__PURE__*/ _jsxs("header", { className: "topbar", children: [ /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx("div", { className: "brand", children: "COSMIC AI-Risk SaaS" }) }), /*#__PURE__*/ _jsx("nav", { className: "nav", "aria-label": "Main navigation", children: actor ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: actor.displayName }), /*#__PURE__*/ _jsx("a", { href: "/dashboard", children: "Dashboard" }), /*#__PURE__*/ _jsx(LogoutButton, { className: "logout-link", children: "Sign out" }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("a", { href: "/login", children: "Sign in" }), /*#__PURE__*/ _jsx("a", { href: "/signup", children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ _jsxs("section", { className: "hero", style: { textAlign: "center", padding: "80px 24px" }, children: [ /*#__PURE__*/ _jsx("h1", { style: { fontSize: 48, letterSpacing: "-0.05em", marginBottom: 16 }, children: "COSMIC AI-Risk SaaS" }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 20, maxWidth: 600, margin: "0 auto 32px" }, children: "Multi-tenant AI risk governance platform. Measure, mitigate, and govern AI project risks across your organization." }), /*#__PURE__*/ _jsx("div", { style: { display: "flex", gap: 12, justifyContent: "center" }, children: actor ? /*#__PURE__*/ _jsx("a", { href: "/dashboard", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Open dashboard" }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("a", { href: "/login", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Sign in" }), /*#__PURE__*/ _jsx("a", { href: "/signup", className: "button secondary", style: { padding: "12px 32px", fontSize: 16 }, children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ _jsx("section", { className: "content", children: /*#__PURE__*/ _jsxs("div", { className: "grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }, children: [ /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "Multi-tenant" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Organizations, workspaces, and role-based access control for enterprise teams." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "AI Risk Scoring" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "COSMIC risk engine with probability, impact, and detectability scoring across governance dimensions." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "Deployment Gates" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Nine-criteria gate evaluation with reviewer decisions and full audit trail." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "PM Integrations" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Trello, Jira, Asana, and Microsoft Planner sync with OAuth-ready live connectors." }) ] }) ] }) }) ] }); } 085undefined87149undefined151189undefined191244undefined246252undefined286300undefined359365__WEBPACK_MODULE_REFERENCE__5_5b22636f6f6b696573225d_call_directImport_asiSafe1__._undefined462480__WEBPACK_MODULE_REFERENCE__1_5b226765744163746f7246726f6d53657373696f6e225d_call_directImport_asiSafe1__._undefined522526__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined612616__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined729732__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined791794__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9981001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined11671171__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined11731181__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined12721275__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined14891492__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined16971700__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined17021713__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined19451949__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined19511959__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined20502053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22522255__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined25552559__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined27972800__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31253128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined35853588__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined38503853__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined42324236__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined42384246__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined43374340__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48034806__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined53725375__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined54685472__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57285732__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined58775880__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined60336036__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined63596363__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined65086511__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined66676670__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined70157019__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71647167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73247327__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined76477651__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined77967799__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined79557958__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefineda(__|HO- X @ 8 I _ C5M A44[> ^!N!D""#3$$%%%5''(\((B)(0,cookies/* cookies */.U)(0,auth_service.getActorFromSession)(0,react_jsx_runtime.jsxs)(0,react_jsx_runtime.jsx)react_jsx_runtime.FragmentLogoutButton["default"]buffersourcesizemapshash&// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ HomePage), dynamic: () => (/* binding */ dynamic) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5338); // EXTERNAL MODULE: ./src/services/auth-service.js var auth_service = __webpack_require__(8559); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/cookies.js var cookies = __webpack_require__(4230); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/headers.js var headers = __webpack_require__(4603); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/draft-mode.js var draft_mode = __webpack_require__(3535); ;// ./node_modules/next/dist/api/headers.js //# sourceMappingURL=headers.js.map // EXTERNAL MODULE: ./src/components/LogoutButton.jsx var LogoutButton = __webpack_require__(4427); ;// ./src/app/page.jsx const dynamic = 'force-dynamic'; async function HomePage() { const cookieStore = await (0,cookies/* cookies */.U)(); const token = cookieStore.get("cosmic_session")?.value; const actor = token ? await (0,auth_service.getActorFromSession)(token) : null; return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("main", { className: "shell", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("header", { className: "topbar", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "brand", children: "COSMIC AI-Risk SaaS" }) }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("nav", { className: "nav", "aria-label": "Main navigation", children: actor ? /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "muted", children: actor.displayName }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/dashboard", children: "Dashboard" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)(LogoutButton["default"], { className: "logout-link", children: "Sign out" }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/login", children: "Sign in" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/signup", children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("section", { className: "hero", style: { textAlign: "center", padding: "80px 24px" }, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h1", { style: { fontSize: 48, letterSpacing: "-0.05em", marginBottom: 16 }, children: "COSMIC AI-Risk SaaS" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", style: { fontSize: 20, maxWidth: 600, margin: "0 auto 32px" }, children: "Multi-tenant AI risk governance platform. Measure, mitigate, and govern AI project risks across your organization." }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { style: { display: "flex", gap: 12, justifyContent: "center" }, children: actor ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/dashboard", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Open dashboard" }) : /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/login", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Sign in" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/signup", className: "button secondary", style: { padding: "12px 32px", fontSize: 16 }, children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("section", { className: "content", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { children: "Multi-tenant" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", children: "Organizations, workspaces, and role-based access control for enterprise teams." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { children: "AI Risk Scoring" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", children: "COSMIC risk engine with probability, impact, and detectability scoring across governance dimensions." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { children: "Deployment Gates" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", children: "Nine-criteria gate evaluation with reviewer decisions and full audit trail." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { children: "PM Integrations" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", children: "Trello, Jira, Asana, and Microsoft Planner sync with OAuth-ready live connectors." }) ] }) ] }) }) ] }); } {"finalSource":true}mapbufferedMap ` ConcatSourceRawSourceV// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ HomePage), dynamic: () => (/* binding */ dynamic) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5338); // EXTERNAL MODULE: ./src/services/auth-service.js var auth_service = __webpack_require__(8559); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/cookies.js var cookies = __webpack_require__(4230); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/headers.js var headers = __webpack_require__(4603); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/draft-mode.js var draft_mode = __webpack_require__(3535); ;// ./node_modules/next/dist/api/headers.js  ReplaceSourceReplaceSourceRawSourceexport * from '../server/request/cookies'; export * from '../server/request/headers'; export * from '../server/request/draft-mode'; //# sourceMappingURL=headers.js.map'041undefined4384undefined86130undefined RawSource| // EXTERNAL MODULE: ./src/components/LogoutButton.jsx var LogoutButton = __webpack_require__(4427); ;// ./src/app/page.jsx  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { getActorFromSession } from "../services/auth-service"; import { cookies } from "next/headers"; import LogoutButton from "../components/LogoutButton"; export const dynamic = 'force-dynamic'; export default async function HomePage() { const cookieStore = await cookies(); const token = cookieStore.get("cosmic_session")?.value; const actor = token ? await getActorFromSession(token) : null; return /*#__PURE__*/ _jsxs("main", { className: "shell", children: [ /*#__PURE__*/ _jsxs("header", { className: "topbar", children: [ /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx("div", { className: "brand", children: "COSMIC AI-Risk SaaS" }) }), /*#__PURE__*/ _jsx("nav", { className: "nav", "aria-label": "Main navigation", children: actor ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: actor.displayName }), /*#__PURE__*/ _jsx("a", { href: "/dashboard", children: "Dashboard" }), /*#__PURE__*/ _jsx(LogoutButton, { className: "logout-link", children: "Sign out" }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("a", { href: "/login", children: "Sign in" }), /*#__PURE__*/ _jsx("a", { href: "/signup", children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ _jsxs("section", { className: "hero", style: { textAlign: "center", padding: "80px 24px" }, children: [ /*#__PURE__*/ _jsx("h1", { style: { fontSize: 48, letterSpacing: "-0.05em", marginBottom: 16 }, children: "COSMIC AI-Risk SaaS" }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 20, maxWidth: 600, margin: "0 auto 32px" }, children: "Multi-tenant AI risk governance platform. Measure, mitigate, and govern AI project risks across your organization." }), /*#__PURE__*/ _jsx("div", { style: { display: "flex", gap: 12, justifyContent: "center" }, children: actor ? /*#__PURE__*/ _jsx("a", { href: "/dashboard", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Open dashboard" }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("a", { href: "/login", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Sign in" }), /*#__PURE__*/ _jsx("a", { href: "/signup", className: "button secondary", style: { padding: "12px 32px", fontSize: 16 }, children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ _jsx("section", { className: "content", children: /*#__PURE__*/ _jsxs("div", { className: "grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }, children: [ /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "Multi-tenant" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Organizations, workspaces, and role-based access control for enterprise teams." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "AI Risk Scoring" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "COSMIC risk engine with probability, impact, and detectability scoring across governance dimensions." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "Deployment Gates" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Nine-criteria gate evaluation with reviewer decisions and full audit trail." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "PM Integrations" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Trello, Jira, Asana, and Microsoft Planner sync with OAuth-ready live connectors." }) ] }) ] }) }) ] }); } 085undefined87149undefined151189undefined191244undefined246252undefined286300undefined359365__WEBPACK_MODULE_REFERENCE__5_5b22636f6f6b696573225d_call_directImport_asiSafe1__._undefined462480__WEBPACK_MODULE_REFERENCE__1_5b226765744163746f7246726f6d53657373696f6e225d_call_directImport_asiSafe1__._undefined522526__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined612616__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined729732__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined791794__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9981001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined11671171__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined11731181__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined12721275__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined14891492__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined16971700__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined17021713__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined19451949__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined19511959__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined20502053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22522255__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined25552559__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined27972800__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31253128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined35853588__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined38503853__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined42324236__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined42384246__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined43374340__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48034806__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined53725375__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined54685472__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57285732__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined58775880__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined60336036__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined63596363__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined65086511__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined66676670__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined70157019__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71647167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73247327__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined76477651__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined77967799__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined79557958__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined95177(0,cookies/* cookies */.U)undefined274380(0,auth_service.getActorFromSession)undefined422498(0,react_jsx_runtime.jsxs)undefined584660(0,react_jsx_runtime.jsxs)undefined773847(0,react_jsx_runtime.jsx)undefined906980(0,react_jsx_runtime.jsx)undefined11841258(0,react_jsx_runtime.jsx)undefined14241500(0,react_jsx_runtime.jsxs)undefined15021581react_jsx_runtime.Fragmentundefined16721746(0,react_jsx_runtime.jsx)undefined19602034(0,react_jsx_runtime.jsx)undefined22392313(0,react_jsx_runtime.jsx)undefined23152392LogoutButton["default"]undefined26242700(0,react_jsx_runtime.jsxs)undefined27022781react_jsx_runtime.Fragmentundefined28722946(0,react_jsx_runtime.jsx)undefined31453219(0,react_jsx_runtime.jsx)undefined35193595(0,react_jsx_runtime.jsxs)undefined38333907(0,react_jsx_runtime.jsx)undefined42324306(0,react_jsx_runtime.jsx)undefined47634837(0,react_jsx_runtime.jsx)undefined50995173(0,react_jsx_runtime.jsx)undefined55525628(0,react_jsx_runtime.jsxs)undefined56305709react_jsx_runtime.Fragmentundefined58005874(0,react_jsx_runtime.jsx)undefined63376411(0,react_jsx_runtime.jsx)undefined69777051(0,react_jsx_runtime.jsx)undefined71447220(0,react_jsx_runtime.jsxs)undefined74767552(0,react_jsx_runtime.jsxs)undefined76977771(0,react_jsx_runtime.jsx)undefined79247998(0,react_jsx_runtime.jsx)undefined83218397(0,react_jsx_runtime.jsxs)undefined85428616(0,react_jsx_runtime.jsx)undefined87728846(0,react_jsx_runtime.jsx)undefined91919267(0,react_jsx_runtime.jsxs)undefined94129486(0,react_jsx_runtime.jsx)undefined96439717(0,react_jsx_runtime.jsx)undefined1003710113(0,react_jsx_runtime.jsxs)undefined1025810332(0,react_jsx_runtime.jsx)undefined1048810562(0,react_jsx_runtime.jsx)undefined /***/ }) '/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ HomePage), dynamic: () => (/* binding */ dynamic) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5338); // EXTERNAL MODULE: ./src/services/auth-service.js var auth_service = __webpack_require__(8559); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/cookies.js var cookies = __webpack_require__(4230); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/headers.js var headers = __webpack_require__(4603); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/draft-mode.js var draft_mode = __webpack_require__(3535); ;// ./node_modules/next/dist/api/headers.js //# sourceMappingURL=headers.js.map // EXTERNAL MODULE: ./src/components/LogoutButton.jsx var LogoutButton = __webpack_require__(4427); ;// ./src/app/page.jsx const dynamic = 'force-dynamic'; async function HomePage() { const cookieStore = await (0,cookies/* cookies */.U)(); const token = cookieStore.get("cosmic_session")?.value; const actor = token ? await (0,auth_service.getActorFromSession)(token) : null; return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("main", { className: "shell", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("header", { className: "topbar", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "brand", children: "COSMIC AI-Risk SaaS" }) }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("nav", { className: "nav", "aria-label": "Main navigation", children: actor ? /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "muted", children: actor.displayName }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/dashboard", children: "Dashboard" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)(LogoutButton["default"], { className: "logout-link", children: "Sign out" }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/login", children: "Sign in" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/signup", children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("section", { className: "hero", style: { textAlign: "center", padding: "80px 24px" }, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h1", { style: { fontSize: 48, letterSpacing: "-0.05em", marginBottom: 16 }, children: "COSMIC AI-Risk SaaS" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", style: { fontSize: 20, maxWidth: 600, margin: "0 auto 32px" }, children: "Multi-tenant AI risk governance platform. Measure, mitigate, and govern AI project risks across your organization." }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { style: { display: "flex", gap: 12, justifyContent: "center" }, children: actor ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/dashboard", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Open dashboard" }) : /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/login", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Sign in" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/signup", className: "button secondary", style: { padding: "12px 32px", fontSize: 16 }, children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("section", { className: "content", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { children: "Multi-tenant" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", children: "Organizations, workspaces, and role-based access control for enterprise teams." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { children: "AI Risk Scoring" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", children: "COSMIC risk engine with probability, impact, and detectability scoring across governance dimensions." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { children: "Deployment Gates" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", children: "Nine-criteria gate evaluation with reviewer decisions and full audit trail." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { children: "PM Integrations" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", children: "Trello, Jira, Asana, and Microsoft Planner sync with OAuth-ready live connectors." }) ] }) ] }) }) ] }); } /***/ })  `V// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ HomePage), dynamic: () => (/* binding */ dynamic) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5338); // EXTERNAL MODULE: ./src/services/auth-service.js var auth_service = __webpack_require__(8559); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/cookies.js var cookies = __webpack_require__(4230); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/headers.js var headers = __webpack_require__(4603); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/draft-mode.js var draft_mode = __webpack_require__(3535); ;// ./node_modules/next/dist/api/headers.js  ReplaceSourceexport * from '../server/request/cookies'; export * from '../server/request/headers'; export * from '../server/request/draft-mode'; //# sourceMappingURL=headers.js.map'041undefined4384undefined86130undefined| // EXTERNAL MODULE: ./src/components/LogoutButton.jsx var LogoutButton = __webpack_require__(4427); ;// ./src/app/page.jsx  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { getActorFromSession } from "../services/auth-service"; import { cookies } from "next/headers"; import LogoutButton from "../components/LogoutButton"; export const dynamic = 'force-dynamic'; export default async function HomePage() { const cookieStore = await cookies(); const token = cookieStore.get("cosmic_session")?.value; const actor = token ? await getActorFromSession(token) : null; return /*#__PURE__*/ _jsxs("main", { className: "shell", children: [ /*#__PURE__*/ _jsxs("header", { className: "topbar", children: [ /*#__PURE__*/ _jsx("div", { children: /*#__PURE__*/ _jsx("div", { className: "brand", children: "COSMIC AI-Risk SaaS" }) }), /*#__PURE__*/ _jsx("nav", { className: "nav", "aria-label": "Main navigation", children: actor ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: actor.displayName }), /*#__PURE__*/ _jsx("a", { href: "/dashboard", children: "Dashboard" }), /*#__PURE__*/ _jsx(LogoutButton, { className: "logout-link", children: "Sign out" }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("a", { href: "/login", children: "Sign in" }), /*#__PURE__*/ _jsx("a", { href: "/signup", children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ _jsxs("section", { className: "hero", style: { textAlign: "center", padding: "80px 24px" }, children: [ /*#__PURE__*/ _jsx("h1", { style: { fontSize: 48, letterSpacing: "-0.05em", marginBottom: 16 }, children: "COSMIC AI-Risk SaaS" }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 20, maxWidth: 600, margin: "0 auto 32px" }, children: "Multi-tenant AI risk governance platform. Measure, mitigate, and govern AI project risks across your organization." }), /*#__PURE__*/ _jsx("div", { style: { display: "flex", gap: 12, justifyContent: "center" }, children: actor ? /*#__PURE__*/ _jsx("a", { href: "/dashboard", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Open dashboard" }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("a", { href: "/login", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Sign in" }), /*#__PURE__*/ _jsx("a", { href: "/signup", className: "button secondary", style: { padding: "12px 32px", fontSize: 16 }, children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ _jsx("section", { className: "content", children: /*#__PURE__*/ _jsxs("div", { className: "grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }, children: [ /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "Multi-tenant" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Organizations, workspaces, and role-based access control for enterprise teams." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "AI Risk Scoring" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "COSMIC risk engine with probability, impact, and detectability scoring across governance dimensions." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "Deployment Gates" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Nine-criteria gate evaluation with reviewer decisions and full audit trail." }) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h3", { children: "PM Integrations" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Trello, Jira, Asana, and Microsoft Planner sync with OAuth-ready live connectors." }) ] }) ] }) }) ] }); } 085undefined87149undefined151189undefined191244undefined246252undefined286300undefined359365__WEBPACK_MODULE_REFERENCE__5_5b22636f6f6b696573225d_call_directImport_asiSafe1__._undefined462480__WEBPACK_MODULE_REFERENCE__1_5b226765744163746f7246726f6d53657373696f6e225d_call_directImport_asiSafe1__._undefined522526__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined612616__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined729732__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined791794__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9981001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined11671171__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined11731181__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined12721275__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined14891492__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined16971700__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined17021713__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined19451949__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined19511959__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined20502053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22522255__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined25552559__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined27972800__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31253128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined35853588__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined38503853__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined42324236__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined42384246__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined43374340__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48034806__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined53725375__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined54685472__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57285732__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined58775880__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined60336036__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined63596363__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined65086511__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined66676670__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined70157019__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71647167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73247327__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined76477651__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined77967799__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined79557958__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined95177(0,cookies/* cookies */.U)undefined274380(0,auth_service.getActorFromSession)undefined422498(0,react_jsx_runtime.jsxs)undefined584660(0,react_jsx_runtime.jsxs)undefined773847(0,react_jsx_runtime.jsx)undefined906980(0,react_jsx_runtime.jsx)undefined11841258(0,react_jsx_runtime.jsx)undefined14241500(0,react_jsx_runtime.jsxs)undefined15021581react_jsx_runtime.Fragmentundefined16721746(0,react_jsx_runtime.jsx)undefined19602034(0,react_jsx_runtime.jsx)undefined22392313(0,react_jsx_runtime.jsx)undefined23152392LogoutButton["default"]undefined26242700(0,react_jsx_runtime.jsxs)undefined27022781react_jsx_runtime.Fragmentundefined28722946(0,react_jsx_runtime.jsx)undefined31453219(0,react_jsx_runtime.jsx)undefined35193595(0,react_jsx_runtime.jsxs)undefined38333907(0,react_jsx_runtime.jsx)undefined42324306(0,react_jsx_runtime.jsx)undefined47634837(0,react_jsx_runtime.jsx)undefined50995173(0,react_jsx_runtime.jsx)undefined55525628(0,react_jsx_runtime.jsxs)undefined56305709react_jsx_runtime.Fragmentundefined58005874(0,react_jsx_runtime.jsx)undefined63376411(0,react_jsx_runtime.jsx)undefined69777051(0,react_jsx_runtime.jsx)undefined71447220(0,react_jsx_runtime.jsxs)undefined74767552(0,react_jsx_runtime.jsxs)undefined76977771(0,react_jsx_runtime.jsx)undefined79247998(0,react_jsx_runtime.jsx)undefined83218397(0,react_jsx_runtime.jsxs)undefined85428616(0,react_jsx_runtime.jsx)undefined87728846(0,react_jsx_runtime.jsx)undefined91919267(0,react_jsx_runtime.jsxs)undefined94129486(0,react_jsx_runtime.jsx)undefined96439717(0,react_jsx_runtime.jsx)undefined1003710113(0,react_jsx_runtime.jsxs)undefined1025810332(0,react_jsx_runtime.jsx)undefined1048810562(0,react_jsx_runtime.jsx)undefined, /***/ 9902:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource$/***/ ((module) => { "use strict"; !module.exports = require("path");  /***/ }) O/***/ ((module) => { "use strict"; module.exports = require("path"); /***/ })  !module.exports = require("path");t }; ; // load runtime var __webpack_require__ = require("../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082,4792], () => (__webpack_exec__(2964))); ,module.exports = __webpack_exports__; })(); e0(() => { var exports = {}; exports.id = 8974; exports.ids = [8974]; exports.modules = { /***/ 261: /***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/app-paths"); /***/ }), /***/ 345: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ LogoutButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1124); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* __next_internal_client_entry_do_not_use__ default auto */ function LogoutButton({ className, children }) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("form", { action: "/api/auth/logout", method: "POST", onSubmit: async (e)=>{ e.preventDefault(); await fetch('/api/auth/logout', { method: 'POST' }); window.location.href = '/'; }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", className: className, children: children || 'Sign out' }) }); } /***/ }), /***/ 846: /***/ ((module) => { "use strict"; module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js"); /***/ }), /***/ 1025: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js"); /***/ }), /***/ 1135: /***/ (() => { /***/ }), /***/ 1459: /***/ (() => { /***/ }), /***/ 1619: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1170, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3597, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 6893, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9748, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 6060, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7184, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9576, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3041, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1384, 23)); /***/ }), /***/ 1662: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ RootLayout), /* harmony export */ metadata: () => (/* binding */ metadata) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5338); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _globals_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1135); /* harmony import */ var _globals_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_globals_css__WEBPACK_IMPORTED_MODULE_1__); const metadata = { title: "COSMIC AI-Risk SaaS", description: "Commercial multi-tenant COSMIC AI-Risk governance platform" }; function RootLayout({ children }) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("html", { lang: "en", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("body", { children: children }) }); } /***/ }), /***/ 2381: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 345)); /***/ }), /***/ 2964: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9754); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9117); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6595); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2324); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9326); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8928); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(175); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(12); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4290); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2696); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_lib_is_rsc_request__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2574); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(2802); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7533); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(5229); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2822); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(6453); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(2474); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(6713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(1356); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(2685); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(6225); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(3446); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(2762); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(5742); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(6439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(1170); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(2506); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(1203); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1662)); const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1170, 23)); const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7028, 23)); const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 461, 23)); const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 2768, 23)); const page5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9458)); // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: ['__PAGE__', {}, { page: [page5, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"], }] }, { 'layout': [module0, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\layout.jsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "next/dist/client/components/builtin/not-found.js"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], } ] }.children; const pages = ["C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"]; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; // Create and export the route module that will be consumed. const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({ definition: { kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, page: "/page", pathname: "/", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: ".next" || 0, relativeProjectDir: false || '' }); async function handler(req, res, ctx) { var _this; let srcPage = "/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (false) {} else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = false; const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__.normalizeAppPath)(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__.getBotType)(userAgent); const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__.isHtmlBotRequest)(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? (0,next_dist_server_lib_is_rsc_request__WEBPACK_IMPORTED_MODULE_10__/* .isRSCRequestHeader */ .f)(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_HEADER]); const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__.getIsPossibleServerAction)(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = false && 0; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers); } const ComponentMod = { ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__, tree, pages, GlobalError: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default()), handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__.setReferenceManifestsSingleton)({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__.createServerModuleMap)({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req); const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (false) {} return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: true ? (__webpack_require__(9902).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.parseFallbackField)(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__.isBot)(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackMode.NOT_FOUND) { throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__.NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKind.PAGES, html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"].EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__/* .getFallbackRouteParams */ .u)(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"].EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__.RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_23__.ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (false) {} // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__.NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map /***/ }), /***/ 3033: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js"); /***/ }), /***/ 3295: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js"); /***/ }), /***/ 3535: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); __webpack_unused_export__ = ({ enumerable: true, get: function() { return draftMode; } }); const _workunitasyncstorageexternal = __webpack_require__(3033); const _workasyncstorageexternal = __webpack_require__(9294); const _dynamicrendering = __webpack_require__(6906); const _creatededupedbycallsiteservererrorlogger = __webpack_require__(787); const _staticgenerationbailout = __webpack_require__(1938); const _hooksservercontext = __webpack_require__(9168); const _invarianterror = __webpack_require__(9290); const _reflect = __webpack_require__(3036); function draftMode() { const callingExpression = 'draftMode'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (!workStore || !workUnitStore) { (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } switch(workUnitStore.type){ case 'prerender-runtime': // TODO(runtime-ppr): does it make sense to delay this? normally it's always microtasky return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, createOrGetCachedDraftMode(workUnitStore.draftMode, workStore)); case 'request': return createOrGetCachedDraftMode(workUnitStore.draftMode, workStore); case 'cache': case 'private-cache': case 'unstable-cache': // Inside of `"use cache"` or `unstable_cache`, draft mode is available if // the outmost work unit store is a request store (or a runtime prerender), // and if draft mode is enabled. const draftModeProvider = (0, _workunitasyncstorageexternal.getDraftModeProviderForCacheScope)(workStore, workUnitStore); if (draftModeProvider) { return createOrGetCachedDraftMode(draftModeProvider, workStore); } // Otherwise, we fall through to providing an empty draft mode. // eslint-disable-next-line no-fallthrough case 'prerender': case 'prerender-client': case 'prerender-ppr': case 'prerender-legacy': // Return empty draft mode return createOrGetCachedDraftMode(null, workStore); default: return workUnitStore; } } function createOrGetCachedDraftMode(draftModeProvider, workStore) { const cacheKey = draftModeProvider ?? NullDraftMode; const cachedDraftMode = CachedDraftModes.get(cacheKey); if (cachedDraftMode) { return cachedDraftMode; } let promise; if (false) {} else { if (false) {} promise = createExoticDraftMode(draftModeProvider); } CachedDraftModes.set(cacheKey, promise); return promise; } const NullDraftMode = {}; const CachedDraftModes = new WeakMap(); function createExoticDraftMode(underlyingProvider) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); Object.defineProperty(promise, 'isEnabled', { get () { return instance.isEnabled; }, enumerable: true, configurable: true }); promise.enable = instance.enable.bind(instance); promise.disable = instance.disable.bind(instance); return promise; } function createExoticDraftModeWithDevWarnings(underlyingProvider, route) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); Object.defineProperty(promise, 'isEnabled', { get () { const expression = '`draftMode().isEnabled`'; syncIODev(route, expression); return instance.isEnabled; }, enumerable: true, configurable: true }); Object.defineProperty(promise, 'enable', { value: function get() { const expression = '`draftMode().enable()`'; syncIODev(route, expression); return instance.enable.apply(instance, arguments); } }); Object.defineProperty(promise, 'disable', { value: function get() { const expression = '`draftMode().disable()`'; syncIODev(route, expression); return instance.disable.apply(instance, arguments); } }); return promise; } // Similar to `createExoticDraftModeWithDevWarnings`, but just logging the sync // access without actually defining the draftMode properties on the promise. function createDraftModeWithDevWarnings(underlyingProvider, route) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case 'isEnabled': warnForSyncAccess(route, `\`draftMode().${prop}\``); break; case 'enable': case 'disable': { warnForSyncAccess(route, `\`draftMode().${prop}()\``); break; } default: { // We only warn for well-defined properties of the draftMode object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); return proxiedPromise; } class DraftMode { constructor(provider){ this._provider = provider; } get isEnabled() { if (this._provider !== null) { return this._provider.isEnabled; } return false; } enable() { // We have a store we want to track dynamic data access to ensure we // don't statically generate routes that manipulate draft mode. trackDynamicDraftMode('draftMode().enable()', this.enable); if (this._provider !== null) { this._provider.enable(); } } disable() { trackDynamicDraftMode('draftMode().disable()', this.disable); if (this._provider !== null) { this._provider.disable(); } } } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createDraftModeAccessError); function createDraftModeAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`draftMode()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E377", enumerable: false, configurable: true }); } function trackDynamicDraftMode(expression, constructorOpt) { const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { // We have a store we want to track dynamic data access to ensure we // don't statically generate routes that manipulate draft mode. if ((workUnitStore == null ? void 0 : workUnitStore.phase) === 'after') { throw Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside \`after\`. The enabled status of draftMode can be read inside \`after\` but you cannot enable or disable draftMode. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E348", enumerable: false, configurable: true }); } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E553", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': case 'private-cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside "use cache". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E246", enumerable: false, configurable: true }); Error.captureStackTrace(error, constructorOpt); workStore.invalidDynamicUsageError ??= error; throw error; } case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside a function cached with "unstable_cache(...)". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E259", enumerable: false, configurable: true }); case 'prerender': case 'prerender-runtime': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used ${expression} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`), "__NEXT_ERROR_CODE", { value: "E126", enumerable: false, configurable: true }); return (0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(workStore.route, expression, error, workUnitStore); } case 'prerender-client': const exportName = '`draftMode`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': return (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, workUnitStore.dynamicTracking); case 'prerender-legacy': workUnitStore.revalidate = 0; const err = Object.defineProperty(new _hooksservercontext.DynamicServerError(`Route ${workStore.route} couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", { value: "E558", enumerable: false, configurable: true }); workStore.dynamicUsageDescription = expression; workStore.dynamicUsageStack = err.stack; throw err; case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); break; default: workUnitStore; } } } } //# sourceMappingURL=draft-mode.js.map /***/ }), /***/ 4230: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); Object.defineProperty(exports, "U", ({ enumerable: true, get: function() { return cookies; } })); const _requestcookies = __webpack_require__(8706); const _cookies = __webpack_require__(3675); const _workasyncstorageexternal = __webpack_require__(9294); const _workunitasyncstorageexternal = __webpack_require__(3033); const _dynamicrendering = __webpack_require__(6906); const _staticgenerationbailout = __webpack_require__(1938); const _dynamicrenderingutils = __webpack_require__(2831); const _creatededupedbycallsiteservererrorlogger = __webpack_require__(787); const _utils = __webpack_require__(1716); const _invarianterror = __webpack_require__(9290); const _reflect = __webpack_require__(3036); function cookies() { const callingExpression = 'cookies'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E88", enumerable: false, configurable: true }); } if (workStore.forceStatic) { // When using forceStatic we override all other logic and always just return an empty // cookies object without tracking const underlyingCookies = createEmptyCookies(); return makeUntrackedExoticCookies(underlyingCookies); } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E549", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': const error = Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E398", enumerable: false, configurable: true }); Error.captureStackTrace(error, cookies); workStore.invalidDynamicUsageError ??= error; throw error; case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E157", enumerable: false, configurable: true }); case 'prerender': return makeHangingCookies(workStore, workUnitStore); case 'prerender-client': const exportName = '`cookies`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': // We need track dynamic access here eagerly to keep continuity with // how cookies has worked in PPR without cacheComponents. return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking); case 'prerender-legacy': // We track dynamic access here so we don't need to wrap the cookies // in individual property access tracking. return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore); case 'prerender-runtime': return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, makeUntrackedCookies(workUnitStore.cookies)); case 'private-cache': if (false) {} return makeUntrackedExoticCookies(workUnitStore.cookies); case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); let underlyingCookies; if ((0, _requestcookies.areCookiesMutableInCurrentPhase)(workUnitStore)) { // We can't conditionally return different types here based on the context. // To avoid confusion, we always return the readonly type here. underlyingCookies = workUnitStore.userspaceMutableCookies; } else { underlyingCookies = workUnitStore.cookies; } if (false) {} else { if (false) {} return makeUntrackedExoticCookies(underlyingCookies); } default: workUnitStore; } } } // If we end up here, there was no work store or work unit store present. (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } function createEmptyCookies() { return _requestcookies.RequestCookiesAdapter.seal(new _cookies.RequestCookies(new Headers({}))); } const CachedCookies = new WeakMap(); function makeHangingCookies(workStore, prerenderStore) { const cachedPromise = CachedCookies.get(prerenderStore); if (cachedPromise) { return cachedPromise; } const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, '`cookies()`'); CachedCookies.set(prerenderStore, promise); return promise; } function makeUntrackedCookies(underlyingCookies) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = Promise.resolve(underlyingCookies); CachedCookies.set(underlyingCookies, promise); return promise; } function makeUntrackedExoticCookies(underlyingCookies) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = Promise.resolve(underlyingCookies); CachedCookies.set(underlyingCookies, promise); Object.defineProperties(promise, { [Symbol.iterator]: { value: underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].bind(underlyingCookies) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesIterator.bind(underlyingCookies) }, size: { get () { return underlyingCookies.size; } }, get: { value: underlyingCookies.get.bind(underlyingCookies) }, getAll: { value: underlyingCookies.getAll.bind(underlyingCookies) }, has: { value: underlyingCookies.has.bind(underlyingCookies) }, set: { value: underlyingCookies.set.bind(underlyingCookies) }, delete: { value: underlyingCookies.delete.bind(underlyingCookies) }, clear: { value: typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.bind(underlyingCookies) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesClear.bind(underlyingCookies, promise) }, toString: { value: underlyingCookies.toString.bind(underlyingCookies) } }); return promise; } function makeUntrackedExoticCookiesWithDevWarnings(underlyingCookies, route) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies); CachedCookies.set(underlyingCookies, promise); Object.defineProperties(promise, { [Symbol.iterator]: { value: function() { const expression = '`...cookies()` or similar iteration'; syncIODev(route, expression); return underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].apply(underlyingCookies, arguments) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesIterator.call(underlyingCookies); }, writable: false }, size: { get () { const expression = '`cookies().size`'; syncIODev(route, expression); return underlyingCookies.size; } }, get: { value: function get() { let expression; if (arguments.length === 0) { expression = '`cookies().get()`'; } else { expression = `\`cookies().get(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.get.apply(underlyingCookies, arguments); }, writable: false }, getAll: { value: function getAll() { let expression; if (arguments.length === 0) { expression = '`cookies().getAll()`'; } else { expression = `\`cookies().getAll(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.getAll.apply(underlyingCookies, arguments); }, writable: false }, has: { value: function get() { let expression; if (arguments.length === 0) { expression = '`cookies().has()`'; } else { expression = `\`cookies().has(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.has.apply(underlyingCookies, arguments); }, writable: false }, set: { value: function set() { let expression; if (arguments.length === 0) { expression = '`cookies().set()`'; } else { const arg = arguments[0]; if (arg) { expression = `\`cookies().set(${describeNameArg(arg)}, ...)\``; } else { expression = '`cookies().set(...)`'; } } syncIODev(route, expression); return underlyingCookies.set.apply(underlyingCookies, arguments); }, writable: false }, delete: { value: function() { let expression; if (arguments.length === 0) { expression = '`cookies().delete()`'; } else if (arguments.length === 1) { expression = `\`cookies().delete(${describeNameArg(arguments[0])})\``; } else { expression = `\`cookies().delete(${describeNameArg(arguments[0])}, ...)\``; } syncIODev(route, expression); return underlyingCookies.delete.apply(underlyingCookies, arguments); }, writable: false }, clear: { value: function clear() { const expression = '`cookies().clear()`'; syncIODev(route, expression); // @ts-ignore clear is defined in RequestCookies implementation but not in the type return typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.apply(underlyingCookies, arguments) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesClear.call(underlyingCookies, promise); }, writable: false }, toString: { value: function toString() { const expression = '`cookies().toString()` or implicit casting'; syncIODev(route, expression); return underlyingCookies.toString.apply(underlyingCookies, arguments); }, writable: false } }); return promise; } // Similar to `makeUntrackedExoticCookiesWithDevWarnings`, but just logging the // sync access without actually defining the cookies properties on the promise. function makeUntrackedCookiesWithDevWarnings(underlyingCookies, route) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case Symbol.iterator: { warnForSyncAccess(route, '`...cookies()` or similar iteration'); break; } case 'size': case 'get': case 'getAll': case 'has': case 'set': case 'delete': case 'clear': case 'toString': { warnForSyncAccess(route, `\`cookies().${prop}\``); break; } default: { // We only warn for well-defined properties of the cookies object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); CachedCookies.set(underlyingCookies, proxiedPromise); return proxiedPromise; } function describeNameArg(arg) { return typeof arg === 'object' && arg !== null && typeof arg.name === 'string' ? `'${arg.name}'` : typeof arg === 'string' ? `'${arg}'` : '...'; } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createCookiesAccessError); function createCookiesAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`cookies()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E223", enumerable: false, configurable: true }); } function polyfilledResponseCookiesIterator() { return this.getAll().map((c)=>[ c.name, c ]).values(); } function polyfilledResponseCookiesClear(returnable) { for (const cookie of this.getAll()){ this.delete(cookie.name); } return returnable; } //# sourceMappingURL=cookies.js.map /***/ }), /***/ 4427: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7954); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); // This file is generated by the Webpack next-flight-loader. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)( function() { throw new Error("Attempted to call the default export of \"C:\\\\Users\\\\abd_b\\\\OneDrive\\\\Desktop\\\\COSMIC AI-Risk Dashboard\\\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\\\application\\\\saas-app\\\\src\\\\components\\\\LogoutButton.jsx\" from the server, but it's 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."); }, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\components\\LogoutButton.jsx", "default", )); /***/ }), /***/ 4589: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4427)); /***/ }), /***/ 4603: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = ({ value: true }); __webpack_unused_export__ = ({ enumerable: true, get: function() { return headers; } }); const _headers = __webpack_require__(7675); const _workasyncstorageexternal = __webpack_require__(9294); const _workunitasyncstorageexternal = __webpack_require__(3033); const _dynamicrendering = __webpack_require__(6906); const _staticgenerationbailout = __webpack_require__(1938); const _dynamicrenderingutils = __webpack_require__(2831); const _creatededupedbycallsiteservererrorlogger = __webpack_require__(787); const _utils = __webpack_require__(1716); const _invarianterror = __webpack_require__(9290); const _reflect = __webpack_require__(3036); function headers() { const callingExpression = 'headers'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "headers" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E367", enumerable: false, configurable: true }); } if (workStore.forceStatic) { // When using forceStatic we override all other logic and always just return an empty // headers object without tracking const underlyingHeaders = _headers.HeadersAdapter.seal(new Headers({})); return makeUntrackedExoticHeaders(underlyingHeaders); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E304", enumerable: false, configurable: true }); Error.captureStackTrace(error, headers); workStore.invalidDynamicUsageError ??= error; throw error; } case 'private-cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache: private". Accessing "headers" inside a private cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E742", enumerable: false, configurable: true }); Error.captureStackTrace(error, headers); workStore.invalidDynamicUsageError ??= error; throw error; } case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E127", enumerable: false, configurable: true }); case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'request': break; default: workUnitStore; } } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E525", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'prerender': case 'prerender-runtime': return makeHangingHeaders(workStore, workUnitStore); case 'prerender-client': const exportName = '`headers`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': // PPR Prerender (no cacheComponents) // We are prerendering with PPR. We need track dynamic access here eagerly // to keep continuity with how headers has worked in PPR without cacheComponents. // TODO consider switching the semantic to throw on property access instead return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking); case 'prerender-legacy': // Legacy Prerender // We are in a legacy static generation mode while prerendering // We track dynamic access here so we don't need to wrap the headers in // individual property access tracking. return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore); case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); if (false) {} else { if (false) {} return makeUntrackedExoticHeaders(workUnitStore.headers); } break; default: workUnitStore; } } } // If we end up here, there was no work store or work unit store present. (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } const CachedHeaders = new WeakMap(); function makeHangingHeaders(workStore, prerenderStore) { const cachedHeaders = CachedHeaders.get(prerenderStore); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, '`headers()`'); CachedHeaders.set(prerenderStore, promise); return promise; } function makeUntrackedHeaders(underlyingHeaders) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = Promise.resolve(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); return promise; } function makeUntrackedExoticHeaders(underlyingHeaders) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = Promise.resolve(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); Object.defineProperties(promise, { append: { value: underlyingHeaders.append.bind(underlyingHeaders) }, delete: { value: underlyingHeaders.delete.bind(underlyingHeaders) }, get: { value: underlyingHeaders.get.bind(underlyingHeaders) }, has: { value: underlyingHeaders.has.bind(underlyingHeaders) }, set: { value: underlyingHeaders.set.bind(underlyingHeaders) }, getSetCookie: { value: underlyingHeaders.getSetCookie.bind(underlyingHeaders) }, forEach: { value: underlyingHeaders.forEach.bind(underlyingHeaders) }, keys: { value: underlyingHeaders.keys.bind(underlyingHeaders) }, values: { value: underlyingHeaders.values.bind(underlyingHeaders) }, entries: { value: underlyingHeaders.entries.bind(underlyingHeaders) }, [Symbol.iterator]: { value: underlyingHeaders[Symbol.iterator].bind(underlyingHeaders) } }); return promise; } function makeUntrackedExoticHeadersWithDevWarnings(underlyingHeaders, route) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); Object.defineProperties(promise, { append: { value: function append() { const expression = `\`headers().append(${describeNameArg(arguments[0])}, ...)\``; syncIODev(route, expression); return underlyingHeaders.append.apply(underlyingHeaders, arguments); } }, delete: { value: function _delete() { const expression = `\`headers().delete(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.delete.apply(underlyingHeaders, arguments); } }, get: { value: function get() { const expression = `\`headers().get(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.get.apply(underlyingHeaders, arguments); } }, has: { value: function has() { const expression = `\`headers().has(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.has.apply(underlyingHeaders, arguments); } }, set: { value: function set() { const expression = `\`headers().set(${describeNameArg(arguments[0])}, ...)\``; syncIODev(route, expression); return underlyingHeaders.set.apply(underlyingHeaders, arguments); } }, getSetCookie: { value: function getSetCookie() { const expression = '`headers().getSetCookie()`'; syncIODev(route, expression); return underlyingHeaders.getSetCookie.apply(underlyingHeaders, arguments); } }, forEach: { value: function forEach() { const expression = '`headers().forEach(...)`'; syncIODev(route, expression); return underlyingHeaders.forEach.apply(underlyingHeaders, arguments); } }, keys: { value: function keys() { const expression = '`headers().keys()`'; syncIODev(route, expression); return underlyingHeaders.keys.apply(underlyingHeaders, arguments); } }, values: { value: function values() { const expression = '`headers().values()`'; syncIODev(route, expression); return underlyingHeaders.values.apply(underlyingHeaders, arguments); } }, entries: { value: function entries() { const expression = '`headers().entries()`'; syncIODev(route, expression); return underlyingHeaders.entries.apply(underlyingHeaders, arguments); } }, [Symbol.iterator]: { value: function() { const expression = '`...headers()` or similar iteration'; syncIODev(route, expression); return underlyingHeaders[Symbol.iterator].apply(underlyingHeaders, arguments); } } }); return promise; } // Similar to `makeUntrackedExoticHeadersWithDevWarnings`, but just logging the // sync access without actually defining the headers properties on the promise. function makeUntrackedHeadersWithDevWarnings(underlyingHeaders, route) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingHeaders); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case Symbol.iterator: { warnForSyncAccess(route, '`...headers()` or similar iteration'); break; } case 'append': case 'delete': case 'get': case 'has': case 'set': case 'getSetCookie': case 'forEach': case 'keys': case 'values': case 'entries': { warnForSyncAccess(route, `\`headers().${prop}\``); break; } default: { // We only warn for well-defined properties of the headers object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); CachedHeaders.set(underlyingHeaders, proxiedPromise); return proxiedPromise; } function describeNameArg(arg) { return typeof arg === 'string' ? `'${arg}'` : '...'; } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createHeadersAccessError); function createHeadersAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`headers()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E277", enumerable: false, configurable: true }); } //# sourceMappingURL=headers.js.map /***/ }), /***/ 5511: /***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }), /***/ 5883: /***/ (() => { /***/ }), /***/ 6330: /***/ ((module) => { "use strict"; module.exports = require("@prisma/client"); /***/ }), /***/ 6439: /***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/no-fallback-error.external"); /***/ }), /***/ 6713: /***/ ((module) => { "use strict"; module.exports = require("next/dist/shared/lib/router/utils/is-bot"); /***/ }), /***/ 7275: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 4160, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1603, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8495, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 5170, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7526, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8922, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9234, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 2263, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2146)); /***/ }), /***/ 7964: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { PrismaClient } = __webpack_require__(6330); const globalForPrisma = globalThis; const prisma = globalForPrisma.__cosmicPrisma || new PrismaClient(); if (false) {} module.exports = { prisma }; /***/ }), /***/ 8354: /***/ ((module) => { "use strict"; module.exports = require("util"); /***/ }), /***/ 8559: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { prisma } = __webpack_require__(7964); const { randomBytes } = __webpack_require__(5511); const bcrypt = __webpack_require__(7082); const SESSION_DURATION_MS = 1000 * 60 * 60 * 24 * 7; function generateSessionToken() { return randomBytes(48).toString("hex"); } async function hashPassword(password) { return bcrypt.hash(password, 12); } async function verifyPassword(password, hash) { if (!hash) return false; return bcrypt.compare(password, hash); } async function createSession(userId) { const token = generateSessionToken(); const session = await prisma.session.create({ data: { userId, token, expiresAt: new Date(Date.now() + SESSION_DURATION_MS) } }); return session; } async function getSession(token) { if (!token) return null; const session = await prisma.session.findUnique({ where: { token }, include: { user: { include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } } } }); if (!session || session.expiresAt < new Date()) { if (session) { await prisma.session.delete({ where: { id: session.id } }).catch(()=>{}); } return null; } return session; } async function signup({ email, displayName, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const existing = await prisma.user.findUnique({ where: { email } }); if (existing) { const error = new Error("Email already registered"); error.status = 409; throw error; } const passwordHash = await hashPassword(password); const user = await prisma.user.create({ data: { email, displayName: displayName || email.split("@")[0], passwordHash, emailVerifiedAt: new Date() } }); const slug = (displayName || email.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") + "-" + Date.now().toString(36); const role = await prisma.role.upsert({ where: { code: "owner" }, update: {}, create: { code: "owner", name: "Owner", permissions: [ "*" ], system: true } }); const org = await prisma.organization.create({ data: { name: (displayName || email.split("@")[0]) + "'s Organization", slug, status: "TRIAL", planCode: "pilot", manualBilling: true } }); await prisma.membership.create({ data: { organizationId: org.id, userId: user.id, roleId: role.id, status: "ACTIVE" } }); await prisma.subscription.create({ data: { organizationId: org.id, source: "MANUAL", status: "TRIALING", planCode: "pilot", userLimit: 5, projectLimit: 3, reportLimitMonthly: 25, integrationLimit: 2, adminOverride: false } }).catch(()=>{}); const workspace = await prisma.workspace.create({ data: { organizationId: org.id, name: "Default Workspace", slug: "default-workspace", type: "B2B_TEAM", status: "TRIAL" } }); await prisma.project.create({ data: { workspaceId: workspace.id, name: "My Project", projectType: "AI-Enabler", status: "Active", riskAppetite: 50, description: "Project created during signup" } }); const session = await createSession(user.id); return { user, session }; } async function login({ email, password }) { if (!email || !password) { const error = new Error("Email and password are required"); error.status = 400; throw error; } const user = await prisma.user.findUnique({ where: { email }, include: { memberships: { where: { status: "ACTIVE" }, include: { organization: true, role: true } } } }); if (!user) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } const valid = await verifyPassword(password, user.passwordHash); if (!valid) { const error = new Error("Invalid email or password"); error.status = 401; throw error; } await prisma.user.update({ where: { id: user.id }, data: { lastLoginAt: new Date() } }); const session = await createSession(user.id); return { user, session }; } async function logout(token) { if (!token) return; await prisma.session.deleteMany({ where: { token } }).catch(()=>{}); } async function getActorFromSession(token) { const session = await getSession(token); if (!session) return null; return session.user; } module.exports = { signup, login, logout, getSession, getActorFromSession, createSession, SESSION_DURATION_MS }; /***/ }), /***/ 8706: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); 0 && (0); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { MutableRequestCookiesAdapter: function() { return MutableRequestCookiesAdapter; }, ReadonlyRequestCookiesError: function() { return ReadonlyRequestCookiesError; }, RequestCookiesAdapter: function() { return RequestCookiesAdapter; }, appendMutableCookies: function() { return appendMutableCookies; }, areCookiesMutableInCurrentPhase: function() { return areCookiesMutableInCurrentPhase; }, createCookiesWithMutableAccessCheck: function() { return createCookiesWithMutableAccessCheck; }, getModifiedCookieValues: function() { return getModifiedCookieValues; }, responseCookiesToRequestCookies: function() { return responseCookiesToRequestCookies; } }); const _cookies = __webpack_require__(3675); const _reflect = __webpack_require__(3036); const _workasyncstorageexternal = __webpack_require__(9294); class ReadonlyRequestCookiesError extends Error { constructor(){ super('Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options'); } static callable() { throw new ReadonlyRequestCookiesError(); } } class RequestCookiesAdapter { static seal(cookies) { return new Proxy(cookies, { get (target, prop, receiver) { switch(prop){ case 'clear': case 'delete': case 'set': return ReadonlyRequestCookiesError.callable; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); } } const SYMBOL_MODIFY_COOKIE_VALUES = Symbol.for('next.mutated.cookies'); function getModifiedCookieValues(cookies) { const modified = cookies[SYMBOL_MODIFY_COOKIE_VALUES]; if (!modified || !Array.isArray(modified) || modified.length === 0) { return []; } return modified; } function appendMutableCookies(headers, mutableCookies) { const modifiedCookieValues = getModifiedCookieValues(mutableCookies); if (modifiedCookieValues.length === 0) { return false; } // Return a new response that extends the response with // the modified cookies as fallbacks. `res` cookies // will still take precedence. const resCookies = new _cookies.ResponseCookies(headers); const returnedCookies = resCookies.getAll(); // Set the modified cookies as fallbacks. for (const cookie of modifiedCookieValues){ resCookies.set(cookie); } // Set the original cookies as the final values. for (const cookie of returnedCookies){ resCookies.set(cookie); } return true; } class MutableRequestCookiesAdapter { static wrap(cookies, onUpdateCookies) { const responseCookies = new _cookies.ResponseCookies(new Headers()); for (const cookie of cookies.getAll()){ responseCookies.set(cookie); } let modifiedValues = []; const modifiedCookies = new Set(); const updateResponseCookies = ()=>{ // TODO-APP: change method of getting workStore const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); if (workStore) { workStore.pathWasRevalidated = true; } const allCookies = responseCookies.getAll(); modifiedValues = allCookies.filter((c)=>modifiedCookies.has(c.name)); if (onUpdateCookies) { const serializedCookies = []; for (const cookie of modifiedValues){ const tempCookies = new _cookies.ResponseCookies(new Headers()); tempCookies.set(cookie); serializedCookies.push(tempCookies.toString()); } onUpdateCookies(serializedCookies); } }; const wrappedCookies = new Proxy(responseCookies, { get (target, prop, receiver) { switch(prop){ // A special symbol to get the modified cookie values case SYMBOL_MODIFY_COOKIE_VALUES: return modifiedValues; // TODO: Throw error if trying to set a cookie after the response // headers have been set. case 'delete': return function(...args) { modifiedCookies.add(typeof args[0] === 'string' ? args[0] : args[0].name); try { target.delete(...args); return wrappedCookies; } finally{ updateResponseCookies(); } }; case 'set': return function(...args) { modifiedCookies.add(typeof args[0] === 'string' ? args[0] : args[0].name); try { target.set(...args); return wrappedCookies; } finally{ updateResponseCookies(); } }; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); return wrappedCookies; } } function createCookiesWithMutableAccessCheck(requestStore) { const wrappedCookies = new Proxy(requestStore.mutableCookies, { get (target, prop, receiver) { switch(prop){ case 'delete': return function(...args) { ensureCookiesAreStillMutable(requestStore, 'cookies().delete'); target.delete(...args); return wrappedCookies; }; case 'set': return function(...args) { ensureCookiesAreStillMutable(requestStore, 'cookies().set'); target.set(...args); return wrappedCookies; }; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); return wrappedCookies; } function areCookiesMutableInCurrentPhase(requestStore) { return requestStore.phase === 'action'; } /** Ensure that cookies() starts throwing on mutation * if we changed phases and can no longer mutate. * * This can happen when going: * 'render' -> 'after' * 'action' -> 'render' * */ function ensureCookiesAreStillMutable(requestStore, _callingExpression) { if (!areCookiesMutableInCurrentPhase(requestStore)) { // TODO: maybe we can give a more precise error message based on callingExpression? throw new ReadonlyRequestCookiesError(); } } function responseCookiesToRequestCookies(responseCookies) { const requestCookies = new _cookies.RequestCookies(new Headers()); for (const cookie of responseCookies.getAll()){ requestCookies.set(cookie); } return requestCookies; } //# sourceMappingURL=request-cookies.js.map /***/ }), /***/ 9121: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/action-async-storage.external.js"); /***/ }), /***/ 9294: /***/ ((module) => { "use strict"; module.exports = require("next/dist/server/app-render/work-async-storage.external.js"); /***/ }), /***/ 9458: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ HomePage), dynamic: () => (/* binding */ dynamic) }); // EXTERNAL MODULE: ./node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js var react_jsx_runtime = __webpack_require__(5338); // EXTERNAL MODULE: ./src/services/auth-service.js var auth_service = __webpack_require__(8559); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/cookies.js var cookies = __webpack_require__(4230); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/headers.js var headers = __webpack_require__(4603); // EXTERNAL MODULE: ./node_modules/next/dist/server/request/draft-mode.js var draft_mode = __webpack_require__(3535); ;// ./node_modules/next/dist/api/headers.js //# sourceMappingURL=headers.js.map // EXTERNAL MODULE: ./src/components/LogoutButton.jsx var LogoutButton = __webpack_require__(4427); ;// ./src/app/page.jsx const dynamic = 'force-dynamic'; async function HomePage() { const cookieStore = await (0,cookies/* cookies */.U)(); const token = cookieStore.get("cosmic_session")?.value; const actor = token ? await (0,auth_service.getActorFromSession)(token) : null; return /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("main", { className: "shell", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("header", { className: "topbar", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { className: "brand", children: "COSMIC AI-Risk SaaS" }) }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("nav", { className: "nav", "aria-label": "Main navigation", children: actor ? /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", { className: "muted", children: actor.displayName }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/dashboard", children: "Dashboard" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)(LogoutButton["default"], { className: "logout-link", children: "Sign out" }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/login", children: "Sign in" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/signup", children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("section", { className: "hero", style: { textAlign: "center", padding: "80px 24px" }, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h1", { style: { fontSize: 48, letterSpacing: "-0.05em", marginBottom: 16 }, children: "COSMIC AI-Risk SaaS" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", style: { fontSize: 20, maxWidth: 600, margin: "0 auto 32px" }, children: "Multi-tenant AI risk governance platform. Measure, mitigate, and govern AI project risks across your organization." }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", { style: { display: "flex", gap: 12, justifyContent: "center" }, children: actor ? /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/dashboard", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Open dashboard" }) : /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/login", className: "button primary", style: { padding: "12px 32px", fontSize: 16 }, children: "Sign in" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("a", { href: "/signup", className: "button secondary", style: { padding: "12px 32px", fontSize: 16 }, children: "Create account" }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("section", { className: "content", children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "grid", style: { gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }, children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { children: "Multi-tenant" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", children: "Organizations, workspaces, and role-based access control for enterprise teams." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { children: "AI Risk Scoring" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", children: "COSMIC risk engine with probability, impact, and detectability scoring across governance dimensions." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { children: "Deployment Gates" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", children: "Nine-criteria gate evaluation with reviewer decisions and full audit trail." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("h3", { children: "PM Integrations" }), /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", { className: "muted", children: "Trello, Jira, Asana, and Microsoft Planner sync with OAuth-ready live connectors." }) ] }) ] }) }) ] }); } /***/ }), /***/ 9902: /***/ ((module) => { "use strict"; module.exports = require("path"); /***/ }) }; ; // load runtime var __webpack_require__ = require("../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082,4792], () => (__webpack_exec__(2964))); module.exports = __webpack_exports__; })();  @(d(() => { var exports = {}; exports.id = 8974; exports.ids = [8974]; exports.modules = { /***/ 261: , /***/ 345: /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ LogoutButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1124); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx } from "react/jsx-runtime"; export default function LogoutButton({ className, children }) { return /*#__PURE__*/ _jsx("form", { action: "/api/auth/logout", method: "POST", onSubmit: async (e)=>{ e.preventDefault(); await fetch('/api/auth/logout', { method: 'POST' }); window.location.href = '/'; }, children: /*#__PURE__*/ _jsx("button", { type: "submit", className: className, children: children || 'Sign out' }) }); } 61108undefined110124undefined199202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 1025: amodule.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");, /***/ 1135: , /***/ 1459: , /***/ 1619: V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { K import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\builtin\\global-error.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\client-page.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\client-segment.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\http-access-fallback\\error-boundary.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\layout-router.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\metadata\\async-metadata.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\client\\components\\render-from-template-context.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\lib\\framework\\boundary-components.js"); ; import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\node_modules\\next\\dist\\lib\\metadata\\generate\\icon-mark.js"); 0261Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1170, 23))undefined266517Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3597, 23))undefined522776Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 6893, 23))undefined7811057Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9748, 23))undefined10621315Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 6060, 23))undefined13201584Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7184, 23))undefined15891857Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9576, 23))undefined18622117Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 3041, 23))undefined21222376Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1384, 23))undefined, /***/ 1662: __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ RootLayout), /* harmony export */ metadata: () => (/* binding */ metadata) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5338); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _globals_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1135); /* harmony import */ var _globals_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_globals_css__WEBPACK_IMPORTED_MODULE_1__); import { jsx as _jsx } from "react/jsx-runtime"; import "./globals.css"; export const metadata = { title: "COSMIC AI-Risk SaaS", description: "Commercial multi-tenant COSMIC AI-Risk governance platform" }; export default function RootLayout({ children }) { return /*#__PURE__*/ _jsx("html", { lang: "en", children: /*#__PURE__*/ _jsx("body", { children: children }) }); } 047undefined4971undefined7379undefined214228undefined290293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined357360(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined, /***/ 2381: import(/* webpackMode: "eager", webpackExports: ["default"] */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\components\\LogoutButton.jsx"); k0253Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 345))undefined, /***/ 2964: #__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GlobalError: () => (/* reexport default from dynamic */ next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default.a), /* harmony export */ __next_app__: () => (/* binding */ __next_app__), /* harmony export */ handler: () => (/* binding */ handler), /* harmony export */ pages: () => (/* binding */ pages), /* harmony export */ routeModule: () => (/* binding */ routeModule), /* harmony export */ tree: () => (/* binding */ tree) /* harmony export */ }); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9754); /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9117); /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6595); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2324); /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9326); /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8928); /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(175); /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(12); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4290); /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2696); /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__); /* harmony import */ var next_dist_server_lib_is_rsc_request__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(2574); /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(2802); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7533); /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(5229); /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2822); /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(261); /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(6453); /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(2474); /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(6713); /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(1356); /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(2685); /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__); /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(6225); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(3446); /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__); /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(2762); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(5742); /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(6439); /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(1170); /* harmony import */ var next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26__); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(2506); /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(1203); /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); Qconst module0 = () => import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\layout.jsx"); const module1 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/global-error.js"); const module2 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/not-found.js"); const module3 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/forbidden.js"); const module4 = () => import(/* webpackMode: "eager" */ "next/dist/client/components/builtin/unauthorized.js"); const page5 = () => import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"); import { AppPageRouteModule } from "next/dist/server/route-modules/app-page/module.compiled" with { 'turbopack-transition': 'next-ssr' }; import { RouteKind } from "next/dist/server/route-kind" with { 'turbopack-transition': 'next-server-utility' }; import { getRevalidateReason } from "next/dist/server/instrumentation/utils"; import { getTracer, SpanKind } from "next/dist/server/lib/trace/tracer"; import { getRequestMeta } from "next/dist/server/request-meta"; import { BaseServerSpan } from "next/dist/server/lib/trace/constants"; import { interopDefault } from "next/dist/server/app-render/interop-default"; import { stripFlightHeaders } from "next/dist/server/app-render/strip-flight-headers"; import { NodeNextRequest, NodeNextResponse } from "next/dist/server/base-http/node"; import { checkIsAppPPREnabled } from "next/dist/server/lib/experimental/ppr"; import { isRSCRequestHeader } from "next/dist/server/lib/is-rsc-request"; import { getFallbackRouteParams } from "next/dist/server/request/fallback-params"; import { setReferenceManifestsSingleton } from "next/dist/server/app-render/encryption-utils"; import { isHtmlBotRequest, shouldServeStreamingMetadata } from "next/dist/server/lib/streaming-metadata"; import { createServerModuleMap } from "next/dist/server/app-render/action-utils"; import { normalizeAppPath } from "next/dist/shared/lib/router/utils/app-paths"; import { getIsPossibleServerAction } from "next/dist/server/lib/server-action-request-meta"; import { RSC_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_DID_POSTPONE_HEADER, RSC_CONTENT_TYPE_HEADER } from "next/dist/client/components/app-router-headers"; import { getBotType, isBot } from "next/dist/shared/lib/router/utils/is-bot"; import { CachedRouteKind } from "next/dist/server/response-cache"; import { FallbackMode, parseFallbackField } from "next/dist/lib/fallback"; import RenderResult from "next/dist/server/render-result"; import { CACHE_ONE_YEAR, HTML_CONTENT_TYPE_HEADER, NEXT_CACHE_TAGS_HEADER } from "next/dist/lib/constants"; import { ENCODED_TAGS } from "next/dist/server/stream-utils/encoded-tags"; import { sendRenderResult } from "next/dist/server/send-payload"; import { NoFallbackError } from "next/dist/shared/lib/no-fallback-error.external"; // We inject the tree and pages here so that we can use them in the route // module. const tree = { children: [ '', { children: ['__PAGE__', {}, { page: [page5, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"], }] }, { 'layout': [module0, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\layout.jsx"], 'global-error': [module1, "next/dist/client/components/builtin/global-error.js"], 'not-found': [module2, "next/dist/client/components/builtin/not-found.js"], 'forbidden': [module3, "next/dist/client/components/builtin/forbidden.js"], 'unauthorized': [module4, "next/dist/client/components/builtin/unauthorized.js"], } ] }.children; const pages = ["C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"]; export { tree, pages }; import GlobalError from "next/dist/client/components/builtin/global-error.js" with { 'turbopack-transition': 'next-server-utility' }; export { GlobalError }; const __next_app_require__ = __webpack_require__ const __next_app_load_chunk__ = () => Promise.resolve() export const __next_app__ = { require: __next_app_require__, loadChunk: __next_app_load_chunk__ }; import * as entryBase from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; import { RedirectStatusCode } from "next/dist/client/components/redirect-status-code"; export * from "next/dist/server/app-render/entry-base" with { 'turbopack-transition': 'next-server-utility' }; // Create and export the route module that will be consumed. export const routeModule = new AppPageRouteModule({ definition: { kind: RouteKind.APP_PAGE, page: "/page", pathname: "/", // The following aren't used in production. bundlePath: '', filename: '', appPaths: [] }, userland: { loaderTree: tree }, distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '', relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '' }); export async function handler(req, res, ctx) { var _this; let srcPage = "/page"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if (process.env.TURBOPACK) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE; const initialPostponed = getRequestMeta(req, 'postponed'); // TODO: replace with more specific flags const minimalMode = getRequestMeta(req, 'minimalMode'); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult; const pathname = parsedUrl.pathname || '/'; const normalizedSrcPage = normalizeAppPath(srcPage); let { isOnDemandRevalidate } = prepareResult; const prerenderInfo = routeModule.match(pathname, prerenderManifest); const isPrerendered = !!prerenderManifest.routes[resolvedPathname]; let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]); const userAgent = req.headers['user-agent'] || ''; const botType = getBotType(userAgent); const isHtmlBot = isHtmlBotRequest(req); /** * If true, this indicates that the request being made is for an app * prefetch request. */ const isPrefetchRSCRequest = getRequestMeta(req, 'isPrefetchRSCRequest') ?? req.headers[NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2' ; // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later const isRSCRequest = getRequestMeta(req, 'isRSCRequest') ?? isRSCRequestHeader(req.headers[RSC_HEADER]); const isPossibleServerAction = getIsPossibleServerAction(req); /** * If the route being rendered is an app page, and the ppr feature has been * enabled, then the given route _could_ support PPR. */ const couldSupportPPR = checkIsAppPPREnabled(nextConfig.experimental.ppr); // When enabled, this will allow the use of the `?__nextppronly` query to // enable debugging of the static shell. const hasDebugStaticShellQuery = process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING === '1' && typeof query.__nextppronly !== 'undefined' && couldSupportPPR; // When enabled, this will allow the use of the `?__nextppronly` query // to enable debugging of the fallback shell. const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback'; // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the // prerender manifest and this is an app page. const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR // enabled or not, but that would require plumbing the appConfig through // to the server during development. We assume that the page supports it // but only during development. hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true)); const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled; // We should enable debugging dynamic accesses when the static shell // debugging has been enabled and we're also in development mode. const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true; const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled; // If we're in minimal mode, then try to get the postponed information from // the request metadata. If available, use it for resuming the postponed // render. const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined; // If PPR is enabled, and this is a RSC request (but not a prefetch), then // we can use this fact to only generate the flight data for the request // because we can't cache the HTML (as it's also dynamic). const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest; // Need to read this before it's stripped by stripFlightHeaders. We don't // need to transfer it to the request meta because it's only read // within this function; the static segment data should have already been // generated, so we will always either return a static response or a 404. const segmentPrefetchHeader = getRequestMeta(req, 'segmentPrefetchRSCRequest'); // TODO: investigate existing bug with shouldServeStreamingMetadata always // being true for a revalidate due to modifying the base-server this.renderOpts // when fixing this to correct logic it causes hydration issue since we set // serveStreamingMetadata to true during export let serveStreamingMetadata = !userAgent ? true : shouldServeStreamingMetadata(userAgent, nextConfig.htmlLimitedBots); if (isHtmlBot && isRoutePPREnabled) { isSSG = false; serveStreamingMetadata = false; } // In development, we always want to generate dynamic HTML. let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's // a data request, in which case we only produce static HTML. routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isSSG || // If this request has provided postponed data, it supports dynamic // HTML. typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic // HTML (it's dynamic). isDynamicRSCRequest; // When html bots request PPR page, perform the full dynamic rendering. const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled; let ssgCacheKey = null; if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) { ssgCacheKey = resolvedPathname; } // the staticPathKey differs from ssgCacheKey since // ssgCacheKey is null in dev since we're always in "dynamic" // mode in dev to bypass the cache, but we still need to honor // dynamicParams = false in dev mode let staticPathKey = ssgCacheKey; if (!staticPathKey && routeModule.isDev) { staticPathKey = resolvedPathname; } // If this is a request for an app path that should be statically generated // and we aren't in the edge runtime, strip the flight headers so it will // generate the static response. if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) { stripFlightHeaders(req.headers); } const ComponentMod = { ...entryBase, tree, pages, GlobalError, handler, routeModule, __next_app__ }; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { setReferenceManifestsSingleton({ page: srcPage, clientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap({ serverActionsManifest }) }); } const method = req.method || 'GET'; const tracer = getTracer(); const activeSpan = tracer.getActiveScopeSpan(); try { const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns); res.setHeader('Vary', varyHeader); const invokeRouteModule = async (span, context)=>{ const nextReq = new NodeNextRequest(req); const nextRes = new NodeNextResponse(res); // TODO: adapt for putting the RDC inside the postponed data // If we're in dev, and this isn't a prefetch or a server action, // we should seed the resume data cache. if (process.env.NODE_ENV === 'development') { if (nextConfig.experimental.cacheComponents && !isPrefetchRSCRequest && !context.renderOpts.isPossibleServerAction) { const warmup = await routeModule.warmup(nextReq, nextRes, context); // If the warmup is successful, we should use the resume data // cache from the warmup. if (warmup.metadata.renderResumeDataCache) { context.renderOpts.renderResumeDataCache = warmup.metadata.renderResumeDataCache; } } } return routeModule.render(nextReq, nextRes, context).finally(()=>{ if (!span) return; span.setAttributes({ 'http.status_code': res.statusCode, 'next.rsc': false }); const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== BaseServerSpan.handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route'); if (route) { const name = `${method} ${route}`; span.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); span.updateName(name); } else { span.updateName(`${method} ${req.url}`); } }); }; const doRender = async ({ span, postponed, fallbackRouteParams })=>{ const context = { query, params, page: normalizedSrcPage, sharedContext: { buildId }, serverComponentsHmrCache: getRequestMeta(req, 'serverComponentsHmrCache'), fallbackRouteParams, renderOpts: { App: ()=>null, Document: ()=>null, pageConfig: {}, ComponentMod, Component: interopDefault(ComponentMod), params, routeModule, page: srcPage, postponed, shouldWaitOnAllReady, serveStreamingMetadata, supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse, buildManifest, nextFontManifest, reactLoadableManifest, subresourceIntegrityManifest, serverActionsManifest, clientReferenceManifest, setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus, dir: process.env.NEXT_RUNTIME === 'nodejs' ? require('path').join(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : `${process.cwd()}/${routeModule.relativeProjectDir}`, isDraftMode, isRevalidate: isSSG && !postponed && !isDynamicRSCRequest, botType, isOnDemandRevalidate, isPossibleServerAction, assetPrefix: nextConfig.assetPrefix, nextConfigOutput: nextConfig.output, crossOrigin: nextConfig.crossOrigin, trailingSlash: nextConfig.trailingSlash, previewProps: prerenderManifest.preview, deploymentId: nextConfig.deploymentId, enableTainting: nextConfig.experimental.taint, htmlLimitedBots: nextConfig.htmlLimitedBots, devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer, reactMaxHeadersLength: nextConfig.reactMaxHeadersLength, multiZoneDraftMode, incrementalCache: getRequestMeta(req, 'incrementalCache'), cacheLifeProfiles: nextConfig.experimental.cacheLife, basePath: nextConfig.basePath, serverActions: nextConfig.experimental.serverActions, ...isDebugStaticShell || isDebugDynamicAccesses ? { nextExport: true, supportsDynamicResponse: false, isStaticGeneration: true, isRevalidate: true, isDebugDynamicAccesses: isDebugDynamicAccesses } : {}, experimental: { isRoutePPREnabled, expireTime: nextConfig.expireTime, staleTimes: nextConfig.experimental.staleTimes, cacheComponents: Boolean(nextConfig.experimental.cacheComponents), clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache), clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing), dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover), inlineCss: Boolean(nextConfig.experimental.inlineCss), authInterrupts: Boolean(nextConfig.experimental.authInterrupts), clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [] }, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: ()=>{}, onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext), err: getRequestMeta(req, 'invokeError'), dev: routeModule.isDev } }; const result = await invokeRouteModule(span, context); const { metadata } = result; const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers. fetchTags: cacheTags } = metadata; if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags; } // Pull any fetch metrics from the render onto the request. ; req.fetchMetrics = metadata.fetchMetrics; // we don't throw static to dynamic errors in dev as isSSG // is a best guess in dev since we don't have the prerender pass // to know whether the path is actually static or not if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) { const staticBailoutInfo = metadata.staticBailoutInfo; const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", { value: "E132", enumerable: false, configurable: true }); if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) { const stack = staticBailoutInfo.stack; err.stack = err.message + stack.substring(stack.indexOf('\n')); } throw err; } return { value: { kind: CachedRouteKind.APP_PAGE, html: result, headers, rscData: metadata.flightData, postponed: metadata.postponed, status: metadata.statusCode, segmentData: metadata.segmentData }, cacheControl }; }; const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{ const isProduction = routeModule.isDev === false; const didRespond = hasResolved || res.writableEnded; // skip on-demand revalidate if cache is not present and // revalidate-if-generated is set if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) { if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res); } else { res.statusCode = 404; res.end('This page could not be found'); } return null; } let fallbackMode; if (prerenderInfo) { fallbackMode = parseFallbackField(prerenderInfo.fallback); } // When serving a HTML bot request, we want to serve a blocking render and // not the prerendered page. This ensures that the correct content is served // to the bot in the head. if (fallbackMode === FallbackMode.PRERENDER && isBot(userAgent)) { if (!isRoutePPREnabled || isHtmlBot) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } } if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) { isOnDemandRevalidate = true; } // TODO: adapt for PPR // only allow on-demand revalidate for fallback: true/blocking // or for prerendered fallback: false paths if (isOnDemandRevalidate && (fallbackMode !== FallbackMode.NOT_FOUND || previousCacheEntry)) { fallbackMode = FallbackMode.BLOCKING_STATIC_RENDER; } if (!minimalMode && fallbackMode !== FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) { // if the page has dynamicParams: false and this pathname wasn't // prerendered trigger the no fallback handling if (// In development, fall through to render to handle missing // getStaticPaths. (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404 fallbackMode === FallbackMode.NOT_FOUND) { throw new NoFallbackError(); } let fallbackResponse; if (isRoutePPREnabled && !isRSCRequest) { const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null; // We use the response cache here to handle the revalidation and // management of the fallback shell. fallbackResponse = await routeModule.handleResponse({ cacheKey, req, nextConfig, routeKind: RouteKind.APP_PAGE, isFallback: true, prerenderManifest, isRoutePPREnabled, responseGenerator: async ()=>doRender({ span, // We pass `undefined` as rendering a fallback isn't resumed // here. postponed: undefined, fallbackRouteParams: // If we're in production or we're debugging the fallback // shell then we should postpone when dynamic params are // accessed. isProduction || isDebugFallbackShell ? getFallbackRouteParams(normalizedSrcPage) : null }), waitUntil: ctx.waitUntil }); // If the fallback response was set to null, then we should return null. if (fallbackResponse === null) return null; // Otherwise, if we did get a fallback response, we should return it. if (fallbackResponse) { // Remove the cache control from the response to prevent it from being // used in the surrounding cache. delete fallbackResponse.cacheControl; return fallbackResponse; } } } // Only requests that aren't revalidating can be resumed. If we have the // minimal postponed data, then we should resume the render with it. const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined; // When we're in minimal mode, if we're trying to debug the static shell, // we should just return nothing instead of resuming the dynamic render. if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') { return { cacheControl: { revalidate: 1, expire: undefined }, value: { kind: CachedRouteKind.PAGES, html: RenderResult.EMPTY, pageData: {}, headers: undefined, status: undefined } }; } // If this is a dynamic route with PPR enabled and the default route // matches were set, then we should pass the fallback route params to // the renderer as this is a fallback revalidation request. const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && (getRequestMeta(req, 'renderFallbackShell') || isDebugFallbackShell) ? getFallbackRouteParams(pathname) : null; // Perform the render. return doRender({ span, postponed, fallbackRouteParams }); }; const handleResponse = async (span)=>{ var _cacheEntry_value, _cachedData_headers; const cacheEntry = await routeModule.handleResponse({ cacheKey: ssgCacheKey, responseGenerator: (c)=>responseGenerator({ span, ...c }), routeKind: RouteKind.APP_PAGE, isOnDemandRevalidate, isRoutePPREnabled, req, nextConfig, prerenderManifest, waitUntil: ctx.waitUntil }); if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } // In dev, we should not cache pages for any reason. if (routeModule.isDev) { res.setHeader('Cache-Control', 'no-store, must-revalidate'); } if (!cacheEntry) { if (ssgCacheKey) { // A cache entry might not be generated if a response is written // in `getInitialProps` or `getServerSideProps`, but those shouldn't // have a cache key. If we do have a cache key but we don't end up // with a cache entry, then either Next.js or the application has a // bug that needs fixing. throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", { value: "E62", enumerable: false, configurable: true }); } return null; } if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== CachedRouteKind.APP_PAGE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E707", enumerable: false, configurable: true }); } const didPostpone = typeof cacheEntry.value.postponed === 'string'; if (isSSG && // We don't want to send a cache header for requests that contain dynamic // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC // request, then we should set the cache header. !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) { if (!minimalMode) { // set x-nextjs-cache header to match the header // we set for the image-optimizer res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Set a header used by the client router to signal the response is static // and should respect the `static` cache staleTime value. res.setHeader(NEXT_IS_PRERENDER_HEADER, '1'); } const { value: cachedData } = cacheEntry; // Coerce the cache control parameter from the render. let cacheControl; // If this is a resume request in minimal mode it is streamed with dynamic // content and should not be cached. if (minimalPostponed) { cacheControl = { revalidate: 0, expire: undefined }; } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!routeModule.isDev) { // If this is a preview mode request, we shouldn't cache it if (isDraftMode) { cacheControl = { revalidate: 0, expire: undefined }; } else if (!isSSG) { if (!res.getHeader('Cache-Control')) { cacheControl = { revalidate: 0, expire: undefined }; } } else if (cacheEntry.cacheControl) { // If the cache entry has a cache control with a revalidate value that's // a number, use it. if (typeof cacheEntry.cacheControl.revalidate === 'number') { var _cacheEntry_cacheControl; if (cacheEntry.cacheControl.revalidate < 1) { throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", { value: "E22", enumerable: false, configurable: true }); } cacheControl = { revalidate: cacheEntry.cacheControl.revalidate, expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime }; } else { cacheControl = { revalidate: CACHE_ONE_YEAR, expire: undefined }; } } } cacheEntry.cacheControl = cacheControl; if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === CachedRouteKind.APP_PAGE && cachedData.segmentData) { var _cachedData_headers1; // This is a prefetch request issued by the client Segment Cache. These // should never reach the application layer (lambda). We should either // respond from the cache (HIT) or respond with 204 No Content (MISS). // Set a header to indicate that PPR is enabled for this route. This // lets the client distinguish between a regular cache miss and a cache // miss due to PPR being disabled. In other contexts this header is used // to indicate that the response contains dynamic data, but here we're // only using it to indicate that the feature is enabled — the segment // response itself contains whether the data is dynamic. res.setHeader(NEXT_DID_POSTPONE_HEADER, '2'); // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader); if (matchedSegment !== undefined) { // Cache hit return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(matchedSegment, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // Cache miss. Either a cache entry for this route has not been generated // (which technically should not be possible when PPR is enabled, because // at a minimum there should always be a fallback entry) or there's no // match for the requested segment. Respond with a 204 No Content. We // don't bother to respond with 404, because these requests are only // issued as part of a prefetch. res.statusCode = 204; return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.EMPTY, cacheControl: cacheEntry.cacheControl }); } // If there's a callback for `onCacheEntry`, call it with the cache entry // and the revalidate options. const onCacheEntry = getRequestMeta(req, 'onCacheEntry'); if (onCacheEntry) { const finished = await onCacheEntry({ ...cacheEntry, // TODO: remove this when upstream doesn't // always expect this value to be "PAGE" value: { ...cacheEntry.value, kind: 'PAGE' } }, { url: getRequestMeta(req, 'initURL') }); if (finished) { // TODO: maybe we have to end the request? return null; } } // If the request has a postponed state and it's a resume request we // should error. if (didPostpone && minimalPostponed) { throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", { value: "E396", enumerable: false, configurable: true }); } if (cachedData.headers) { const headers = { ...cachedData.headers }; if (!minimalMode || !isSSG) { delete headers[NEXT_CACHE_TAGS_HEADER]; } for (let [key, value] of Object.entries(headers)){ if (typeof value === 'undefined') continue; if (Array.isArray(value)) { for (const v of value){ res.appendHeader(key, v); } } else if (typeof value === 'number') { value = value.toString(); res.appendHeader(key, value); } else { res.appendHeader(key, value); } } } // Add the cache tags header to the response if it exists and we're in // minimal mode while rendering a static page. const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER]; if (minimalMode && isSSG && tags && typeof tags === 'string') { res.setHeader(NEXT_CACHE_TAGS_HEADER, tags); } // If the request is a data request, then we shouldn't set the status code // from the response because it should always be 200. This should be gated // behind the experimental PPR flag. if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) { res.statusCode = cachedData.status; } // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes if (!minimalMode && cachedData.status && RedirectStatusCode[cachedData.status] && isRSCRequest) { res.statusCode = 200; } // Mark that the request did postpone. if (didPostpone) { res.setHeader(NEXT_DID_POSTPONE_HEADER, '1'); } // we don't go through this block when preview mode is true // as preview mode is a dynamic request (bypasses cache) and doesn't // generate both HTML and payloads in the same request so continue to just // return the generated payload if (isRSCRequest && !isDraftMode) { // If this is a dynamic RSC request, then stream the response. if (typeof cachedData.rscData === 'undefined') { if (cachedData.postponed) { throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", { value: "E372", enumerable: false, configurable: true }); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: cachedData.html, // Dynamic RSC responses cannot be cached, even if they're // configured with `force-static` because we have no way of // distinguishing between `force-static` and pages that have no // postponed state. // TODO: distinguish `force-static` from pages with no postponed state (static) cacheControl: isDynamicRSCRequest ? { revalidate: 0, expire: undefined } : cacheEntry.cacheControl }); } // As this isn't a prefetch request, we should serve the static flight // data. return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: RenderResult.fromStatic(cachedData.rscData, RSC_CONTENT_TYPE_HEADER), cacheControl: cacheEntry.cacheControl }); } // This is a request for HTML data. let body = cachedData.html; // If there's no postponed state, we should just serve the HTML. This // should also be the case for a resume request because it's completed // as a server render (rather than a static render). if (!didPostpone || minimalMode || isRSCRequest) { // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE && minimalMode && isRoutePPREnabled && body.contentType === HTML_CONTENT_TYPE_HEADER) { // As we're in minimal mode, the static part would have already been // streamed first. The only part that this streams is the dynamic part // so we should FIRST stream the sentinel and THEN the dynamic part. body.unshift(createPPRBoundarySentinel()); } return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: cacheEntry.cacheControl }); } // If we're debugging the static shell or the dynamic API accesses, we // should just serve the HTML without resuming the render. The returned // HTML will be the static shell so all the Dynamic API's will be used // during static generation. if (isDebugStaticShell || isDebugDynamicAccesses) { // Since we're not resuming the render, we need to at least add the // closing body and html tags to create valid HTML. body.push(new ReadableStream({ start (controller) { controller.enqueue(ENCODED_TAGS.CLOSED.BODY_AND_HTML); controller.close(); } })); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, cacheControl: { revalidate: 0, expire: undefined } }); } // If we're in test mode, we should add a sentinel chunk to the response // that's between the static and dynamic parts so we can compare the // chunks and add assertions. if (process.env.__NEXT_TEST_MODE) { body.push(createPPRBoundarySentinel()); } // This request has postponed, so let's create a new transformer that the // dynamic data can pipe to that will attach the dynamic data to the end // of the response. const transformer = new TransformStream(); body.push(transformer.readable); // Perform the render again, but this time, provide the postponed state. // We don't await because we want the result to start streaming now, and // we've already chained the transformer's readable to the render result. doRender({ span, postponed: cachedData.postponed, // This is a resume render, not a fallback render, so we don't need to // set this. fallbackRouteParams: null }).then(async (result)=>{ var _result_value; if (!result) { throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", { value: "E463", enumerable: false, configurable: true }); } if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== CachedRouteKind.APP_PAGE) { var _result_value1; throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E305", enumerable: false, configurable: true }); } // Pipe the resume result to the transformer. await result.value.html.pipeTo(transformer.writable); }).catch((err)=>{ // An error occurred during piping or preparing the render, abort // the transformers writer so we can terminate the stream. transformer.writable.abort(err).catch((e)=>{ console.error("couldn't abort transformer", e); }); }); return sendRenderResult({ req, res, generateEtags: nextConfig.generateEtags, poweredByHeader: nextConfig.poweredByHeader, result: body, // We don't want to cache the response if it has postponed data because // the response being sent to the client it's dynamic parts are streamed // to the client on the same request. cacheControl: { revalidate: 0, expire: undefined } }); }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (activeSpan) { await handleResponse(activeSpan); } else { return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(BaseServerSpan.handleRequest, { spanName: `${method} ${req.url}`, kind: SpanKind.SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, handleResponse)); } } catch (err) { if (!(err instanceof NoFallbackError)) { await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'render', revalidateReason: getRevalidateReason({ isRevalidate: isSSG, isOnDemandRevalidate }) }, routerServerContext); } // rethrow so that we can handle serving error page throw err; } } // TODO: omit this from production builds, only test builds should include it /** * Creates a readable stream that emits a PPR boundary sentinel. * * @returns A readable stream that emits a PPR boundary sentinel. */ function createPPRBoundarySentinel() { return new ReadableStream({ start (controller) { controller.enqueue(new TextEncoder().encode('')); controller.close(); } }); } //# sourceMappingURL=app-page.js.map %22233Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1662))undefined258345Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1170, 23))undefined370454Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7028, 23))undefined479563Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 461, 23))undefined588675Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 2768, 23))undefined698907Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9458))undefined9101050undefined10521166undefined11681244undefined12461317undefined13191381undefined13831452undefined14541530undefined15321617undefined16191702undefined17041780undefined17821854undefined18561937undefined19392032undefined20342138undefined21402220undefined22222300undefined23022393undefined23952576undefined25782654undefined26562721undefined27232796undefined27982855undefined28572963undefined29653038undefined30403104undefined31063187undefined43714393undefined43954531undefined45334555undefined45864604__webpack_require__undefined46624668undefined47694895undefined48974982undefined49845097undefined51605166undefined51915208next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModuleundefined52445252next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined54975532".next"undefined553755380undefined55655603 falseundefined56155621undefined58955915falseundefined59185982{}undefined61286167falseundefined61996212(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined63036316(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined70827097(0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_15__.normalizeAppPath)undefined74847493(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__.getBotType)undefined75297544(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__.isHtmlBotRequest)undefined76897702(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined77487774next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_ROUTER_PREFETCH_HEADERundefined79537966(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined79928009(0,next_dist_server_lib_is_rsc_request__WEBPACK_IMPORTED_MODULE_10__/* .isRSCRequestHeader */ .f)undefined80238032next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_HEADERundefined80728096(0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_16__.getIsPossibleServerAction)undefined82768295(0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)undefined84878594 falseundefined859986130undefined1090910922(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1130711334(0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_13__.shouldServeStreamingMetadata)undefined1311913136(0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)undefined1319613204next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_27__undefined1325513254: (next_dist_client_components_builtin_global_error_js__WEBPACK_IMPORTED_MODULE_26___default())undefined1362313652(0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_12__.setReferenceManifestsSingleton)undefined1378413804(0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_14__.createServerModuleMap)undefined1393813946(0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)undefined1424614260next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequestundefined1430014315next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponseundefined1454314580falseundefined1458315158{}undefined1573615749next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined1683616849(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined1712817141(0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)undefined1786017896 trueundefined1790017919(__webpack_require__(9902).join)undefined17998180490undefined1901019023(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2086420877(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2130121322next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined2276122775next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKindundefined2402124038(0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.parseFallbackField)undefined2432724338next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2435324357(0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_18__.isBot)undefined2446324474next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2490824919next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2498824999next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2508825099next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2563225643next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_20__.FallbackModeundefined2568825702next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__.NoFallbackErrorundefined2635426362next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined2710827129(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__/* .getFallbackRouteParams */ .u)undefined2865728671next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKindundefined2871028721next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"]undefined2922329236(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined2929329314(0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_11__/* .getFallbackRouteParams */ .u)undefined2988929897next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKindundefined3137631390next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKindundefined3274232765next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_IS_PRERENDER_HEADERundefined3523235245next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.CACHE_ONE_YEARundefined3554035554next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKindundefined3643736460next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_DID_POSTPONE_HEADERundefined3673236753next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined3687136892next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined3712237137(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined3736537376next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"]undefined3740537427next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_CONTENT_TYPE_HEADERundefined3808338098(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined3830638317next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"]undefined3858038593(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3904139054(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)undefined3992439945next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined4082440845next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined4095540976next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_22__.NEXT_CACHE_TAGS_HEADERundefined4152941546next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_28__.RedirectStatusCodeundefined4175041773next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.NEXT_DID_POSTPONE_HEADERundefined4266942684(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined4371243727(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined4393543946next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_21__["default"]undefined4397944001next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_17__.RSC_CONTENT_TYPE_HEADERundefined4471844830falseundefined4483345183{}undefined4520845223(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined4616746178next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_23__.ENCODED_TAGSundefined4631346328(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined4693946966falseundefined4696947039{}undefined4834748361next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_19__.CachedRouteKindundefined4928549300(0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_24__.sendRenderResult)undefined5017550188next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpanundefined5028750294next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKindundefined5055050564next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_25__.NoFallbackErrorundefined5077650794(0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)undefined, /***/ 3295: ]module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");, /***/ 3535: !6"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "draftMode", { enumerable: true, get: function() { return draftMode; } }); const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external"); const _workasyncstorageexternal = require("../app-render/work-async-storage.external"); const _dynamicrendering = require("../app-render/dynamic-rendering"); const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger"); const _staticgenerationbailout = require("../../client/components/static-generation-bailout"); const _hooksservercontext = require("../../client/components/hooks-server-context"); const _invarianterror = require("../../shared/lib/invariant-error"); const _reflect = require("../web/spec-extension/adapters/reflect"); function draftMode() { const callingExpression = 'draftMode'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (!workStore || !workUnitStore) { (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } switch(workUnitStore.type){ case 'prerender-runtime': // TODO(runtime-ppr): does it make sense to delay this? normally it's always microtasky return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, createOrGetCachedDraftMode(workUnitStore.draftMode, workStore)); case 'request': return createOrGetCachedDraftMode(workUnitStore.draftMode, workStore); case 'cache': case 'private-cache': case 'unstable-cache': // Inside of `"use cache"` or `unstable_cache`, draft mode is available if // the outmost work unit store is a request store (or a runtime prerender), // and if draft mode is enabled. const draftModeProvider = (0, _workunitasyncstorageexternal.getDraftModeProviderForCacheScope)(workStore, workUnitStore); if (draftModeProvider) { return createOrGetCachedDraftMode(draftModeProvider, workStore); } // Otherwise, we fall through to providing an empty draft mode. // eslint-disable-next-line no-fallthrough case 'prerender': case 'prerender-client': case 'prerender-ppr': case 'prerender-legacy': // Return empty draft mode return createOrGetCachedDraftMode(null, workStore); default: return workUnitStore; } } function createOrGetCachedDraftMode(draftModeProvider, workStore) { const cacheKey = draftModeProvider ?? NullDraftMode; const cachedDraftMode = CachedDraftModes.get(cacheKey); if (cachedDraftMode) { return cachedDraftMode; } let promise; if ("production" === 'development' && !(workStore == null ? void 0 : workStore.isPrefetchRequest)) { const route = workStore == null ? void 0 : workStore.route; if (process.env.__NEXT_CACHE_COMPONENTS) { return createDraftModeWithDevWarnings(draftModeProvider, route); } promise = createExoticDraftModeWithDevWarnings(draftModeProvider, route); } else { if (process.env.__NEXT_CACHE_COMPONENTS) { return Promise.resolve(new DraftMode(draftModeProvider)); } promise = createExoticDraftMode(draftModeProvider); } CachedDraftModes.set(cacheKey, promise); return promise; } const NullDraftMode = {}; const CachedDraftModes = new WeakMap(); function createExoticDraftMode(underlyingProvider) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); Object.defineProperty(promise, 'isEnabled', { get () { return instance.isEnabled; }, enumerable: true, configurable: true }); promise.enable = instance.enable.bind(instance); promise.disable = instance.disable.bind(instance); return promise; } function createExoticDraftModeWithDevWarnings(underlyingProvider, route) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); Object.defineProperty(promise, 'isEnabled', { get () { const expression = '`draftMode().isEnabled`'; syncIODev(route, expression); return instance.isEnabled; }, enumerable: true, configurable: true }); Object.defineProperty(promise, 'enable', { value: function get() { const expression = '`draftMode().enable()`'; syncIODev(route, expression); return instance.enable.apply(instance, arguments); } }); Object.defineProperty(promise, 'disable', { value: function get() { const expression = '`draftMode().disable()`'; syncIODev(route, expression); return instance.disable.apply(instance, arguments); } }); return promise; } // Similar to `createExoticDraftModeWithDevWarnings`, but just logging the sync // access without actually defining the draftMode properties on the promise. function createDraftModeWithDevWarnings(underlyingProvider, route) { const instance = new DraftMode(underlyingProvider); const promise = Promise.resolve(instance); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case 'isEnabled': warnForSyncAccess(route, `\`draftMode().${prop}\``); break; case 'enable': case 'disable': { warnForSyncAccess(route, `\`draftMode().${prop}()\``); break; } default: { // We only warn for well-defined properties of the draftMode object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); return proxiedPromise; } class DraftMode { constructor(provider){ this._provider = provider; } get isEnabled() { if (this._provider !== null) { return this._provider.isEnabled; } return false; } enable() { // We have a store we want to track dynamic data access to ensure we // don't statically generate routes that manipulate draft mode. trackDynamicDraftMode('draftMode().enable()', this.enable); if (this._provider !== null) { this._provider.enable(); } } disable() { trackDynamicDraftMode('draftMode().disable()', this.disable); if (this._provider !== null) { this._provider.disable(); } } } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createDraftModeAccessError); function createDraftModeAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`draftMode()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E377", enumerable: false, configurable: true }); } function trackDynamicDraftMode(expression, constructorOpt) { const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { // We have a store we want to track dynamic data access to ensure we // don't statically generate routes that manipulate draft mode. if ((workUnitStore == null ? void 0 : workUnitStore.phase) === 'after') { throw Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside \`after\`. The enabled status of draftMode can be read inside \`after\` but you cannot enable or disable draftMode. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E348", enumerable: false, configurable: true }); } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E553", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': case 'private-cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside "use cache". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E246", enumerable: false, configurable: true }); Error.captureStackTrace(error, constructorOpt); workStore.invalidDynamicUsageError ??= error; throw error; } case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "${expression}" inside a function cached with "unstable_cache(...)". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E259", enumerable: false, configurable: true }); case 'prerender': case 'prerender-runtime': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used ${expression} without first calling \`await connection()\`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers`), "__NEXT_ERROR_CODE", { value: "E126", enumerable: false, configurable: true }); return (0, _dynamicrendering.abortAndThrowOnSynchronousRequestDataAccess)(workStore.route, expression, error, workUnitStore); } case 'prerender-client': const exportName = '`draftMode`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': return (0, _dynamicrendering.postponeWithTracking)(workStore.route, expression, workUnitStore.dynamicTracking); case 'prerender-legacy': workUnitStore.revalidate = 0; const err = Object.defineProperty(new _hooksservercontext.DynamicServerError(`Route ${workStore.route} couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", { value: "E558", enumerable: false, configurable: true }); workStore.dynamicUsageDescription = expression; workStore.dynamicUsageStack = err.stack; throw err; case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); break; default: workUnitStore; } } } } //# sourceMappingURL=draft-mode.js.map x012undefined1458__webpack_unused_export__ = (undefined7878)undefined81124__webpack_unused_export__ = (undefined204204)undefined245251__webpack_require__undefined2533003033undefined338344__webpack_require__undefined3463889294undefined418424__webpack_require__undefined4264586906undefined512518__webpack_require__undefined520570787undefined607613__webpack_require__undefined6156651938undefined697703__webpack_require__undefined7057509168undefined778784__webpack_require__undefined7868199290undefined840846__webpack_require__undefined8488873036undefined29293021falseundefined30243318{}undefined33393373falseundefined33763456{}undefined, /***/ 4230: N"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "cookies", { enumerable: true, get: function() { return cookies; } }); const _requestcookies = require("../web/spec-extension/adapters/request-cookies"); const _cookies = require("../web/spec-extension/cookies"); const _workasyncstorageexternal = require("../app-render/work-async-storage.external"); const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external"); const _dynamicrendering = require("../app-render/dynamic-rendering"); const _staticgenerationbailout = require("../../client/components/static-generation-bailout"); const _dynamicrenderingutils = require("../dynamic-rendering-utils"); const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger"); const _utils = require("./utils"); const _invarianterror = require("../../shared/lib/invariant-error"); const _reflect = require("../web/spec-extension/adapters/reflect"); function cookies() { const callingExpression = 'cookies'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E88", enumerable: false, configurable: true }); } if (workStore.forceStatic) { // When using forceStatic we override all other logic and always just return an empty // cookies object without tracking const underlyingCookies = createEmptyCookies(); return makeUntrackedExoticCookies(underlyingCookies); } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E549", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': const error = Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E398", enumerable: false, configurable: true }); Error.captureStackTrace(error, cookies); workStore.invalidDynamicUsageError ??= error; throw error; case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "cookies" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E157", enumerable: false, configurable: true }); case 'prerender': return makeHangingCookies(workStore, workUnitStore); case 'prerender-client': const exportName = '`cookies`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': // We need track dynamic access here eagerly to keep continuity with // how cookies has worked in PPR without cacheComponents. return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking); case 'prerender-legacy': // We track dynamic access here so we don't need to wrap the cookies // in individual property access tracking. return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore); case 'prerender-runtime': return (0, _dynamicrendering.delayUntilRuntimeStage)(workUnitStore, makeUntrackedCookies(workUnitStore.cookies)); case 'private-cache': if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedCookies(workUnitStore.cookies); } return makeUntrackedExoticCookies(workUnitStore.cookies); case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); let underlyingCookies; if ((0, _requestcookies.areCookiesMutableInCurrentPhase)(workUnitStore)) { // We can't conditionally return different types here based on the context. // To avoid confusion, we always return the readonly type here. underlyingCookies = workUnitStore.userspaceMutableCookies; } else { underlyingCookies = workUnitStore.cookies; } if ("production" === 'development') { // Semantically we only need the dev tracking when running in `next dev` // but since you would never use next dev with production NODE_ENV we use this // as a proxy so we can statically exclude this code from production builds. if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedCookiesWithDevWarnings(underlyingCookies, workStore == null ? void 0 : workStore.route); } return makeUntrackedExoticCookiesWithDevWarnings(underlyingCookies, workStore == null ? void 0 : workStore.route); } else { if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedCookies(underlyingCookies); } return makeUntrackedExoticCookies(underlyingCookies); } default: workUnitStore; } } } // If we end up here, there was no work store or work unit store present. (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } function createEmptyCookies() { return _requestcookies.RequestCookiesAdapter.seal(new _cookies.RequestCookies(new Headers({}))); } const CachedCookies = new WeakMap(); function makeHangingCookies(workStore, prerenderStore) { const cachedPromise = CachedCookies.get(prerenderStore); if (cachedPromise) { return cachedPromise; } const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, '`cookies()`'); CachedCookies.set(prerenderStore, promise); return promise; } function makeUntrackedCookies(underlyingCookies) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = Promise.resolve(underlyingCookies); CachedCookies.set(underlyingCookies, promise); return promise; } function makeUntrackedExoticCookies(underlyingCookies) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = Promise.resolve(underlyingCookies); CachedCookies.set(underlyingCookies, promise); Object.defineProperties(promise, { [Symbol.iterator]: { value: underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].bind(underlyingCookies) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesIterator.bind(underlyingCookies) }, size: { get () { return underlyingCookies.size; } }, get: { value: underlyingCookies.get.bind(underlyingCookies) }, getAll: { value: underlyingCookies.getAll.bind(underlyingCookies) }, has: { value: underlyingCookies.has.bind(underlyingCookies) }, set: { value: underlyingCookies.set.bind(underlyingCookies) }, delete: { value: underlyingCookies.delete.bind(underlyingCookies) }, clear: { value: typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.bind(underlyingCookies) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesClear.bind(underlyingCookies, promise) }, toString: { value: underlyingCookies.toString.bind(underlyingCookies) } }); return promise; } function makeUntrackedExoticCookiesWithDevWarnings(underlyingCookies, route) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies); CachedCookies.set(underlyingCookies, promise); Object.defineProperties(promise, { [Symbol.iterator]: { value: function() { const expression = '`...cookies()` or similar iteration'; syncIODev(route, expression); return underlyingCookies[Symbol.iterator] ? underlyingCookies[Symbol.iterator].apply(underlyingCookies, arguments) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesIterator.call(underlyingCookies); }, writable: false }, size: { get () { const expression = '`cookies().size`'; syncIODev(route, expression); return underlyingCookies.size; } }, get: { value: function get() { let expression; if (arguments.length === 0) { expression = '`cookies().get()`'; } else { expression = `\`cookies().get(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.get.apply(underlyingCookies, arguments); }, writable: false }, getAll: { value: function getAll() { let expression; if (arguments.length === 0) { expression = '`cookies().getAll()`'; } else { expression = `\`cookies().getAll(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.getAll.apply(underlyingCookies, arguments); }, writable: false }, has: { value: function get() { let expression; if (arguments.length === 0) { expression = '`cookies().has()`'; } else { expression = `\`cookies().has(${describeNameArg(arguments[0])})\``; } syncIODev(route, expression); return underlyingCookies.has.apply(underlyingCookies, arguments); }, writable: false }, set: { value: function set() { let expression; if (arguments.length === 0) { expression = '`cookies().set()`'; } else { const arg = arguments[0]; if (arg) { expression = `\`cookies().set(${describeNameArg(arg)}, ...)\``; } else { expression = '`cookies().set(...)`'; } } syncIODev(route, expression); return underlyingCookies.set.apply(underlyingCookies, arguments); }, writable: false }, delete: { value: function() { let expression; if (arguments.length === 0) { expression = '`cookies().delete()`'; } else if (arguments.length === 1) { expression = `\`cookies().delete(${describeNameArg(arguments[0])})\``; } else { expression = `\`cookies().delete(${describeNameArg(arguments[0])}, ...)\``; } syncIODev(route, expression); return underlyingCookies.delete.apply(underlyingCookies, arguments); }, writable: false }, clear: { value: function clear() { const expression = '`cookies().clear()`'; syncIODev(route, expression); // @ts-ignore clear is defined in RequestCookies implementation but not in the type return typeof underlyingCookies.clear === 'function' ? underlyingCookies.clear.apply(underlyingCookies, arguments) : // but that's already a hard thing to debug so we may as well implement it consistently. The biggest problem with // implementing this in this way is the underlying cookie type is a ResponseCookie and not a RequestCookie and so it // has extra properties not available on RequestCookie instances. polyfilledResponseCookiesClear.call(underlyingCookies, promise); }, writable: false }, toString: { value: function toString() { const expression = '`cookies().toString()` or implicit casting'; syncIODev(route, expression); return underlyingCookies.toString.apply(underlyingCookies, arguments); }, writable: false } }); return promise; } // Similar to `makeUntrackedExoticCookiesWithDevWarnings`, but just logging the // sync access without actually defining the cookies properties on the promise. function makeUntrackedCookiesWithDevWarnings(underlyingCookies, route) { const cachedCookies = CachedCookies.get(underlyingCookies); if (cachedCookies) { return cachedCookies; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingCookies); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case Symbol.iterator: { warnForSyncAccess(route, '`...cookies()` or similar iteration'); break; } case 'size': case 'get': case 'getAll': case 'has': case 'set': case 'delete': case 'clear': case 'toString': { warnForSyncAccess(route, `\`cookies().${prop}\``); break; } default: { // We only warn for well-defined properties of the cookies object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); CachedCookies.set(underlyingCookies, proxiedPromise); return proxiedPromise; } function describeNameArg(arg) { return typeof arg === 'object' && arg !== null && typeof arg.name === 'string' ? `'${arg.name}'` : typeof arg === 'string' ? `'${arg}'` : '...'; } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createCookiesAccessError); function createCookiesAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`cookies()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E223", enumerable: false, configurable: true }); } function polyfilledResponseCookiesIterator() { return this.getAll().map((c)=>[ c.name, c ]).values(); } function polyfilledResponseCookiesClear(returnable) { for (const cookie of this.getAll()){ this.delete(cookie.name); } return returnable; } //# sourceMappingURL=cookies.js.map L012undefined1458__webpack_unused_export__ = (undefined7878)undefined81122Object.defineProperty(exports, "U", (undefined200200))undefined227233__webpack_require__undefined2352828706undefined303309__webpack_require__undefined3113413675undefined379385__webpack_require__undefined3874299294undefined471477__webpack_require__undefined4795263033undefined556562__webpack_require__undefined5645966906undefined633639__webpack_require__undefined6416911938undefined726732__webpack_require__undefined7347612831undefined815821__webpack_require__undefined823873787undefined892898__webpack_require__undefined9009081716undefined936942__webpack_require__undefined9449779290undefined9981004__webpack_require__undefined100610453036undefined57825816falseundefined58195917{}undefined66716700falseundefined67037395{}undefined74327466falseundefined74697571{}undefined, /***/ 4427: /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7954); /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__); Z// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"C:\\\\Users\\\\abd_b\\\\OneDrive\\\\Desktop\\\\COSMIC AI-Risk Dashboard\\\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\\\application\\\\saas-app\\\\src\\\\components\\\\LogoutButton.jsx\" from the server, but it's 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."); }, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\components\\LogoutButton.jsx", "default", ); 61134undefined136150/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (undefined136150undefined151173(0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)undefined856856.5);undefined}, /***/ 4589: l0253Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4427))undefined{, /***/ 4603: PE"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "headers", { enumerable: true, get: function() { return headers; } }); const _headers = require("../web/spec-extension/adapters/headers"); const _workasyncstorageexternal = require("../app-render/work-async-storage.external"); const _workunitasyncstorageexternal = require("../app-render/work-unit-async-storage.external"); const _dynamicrendering = require("../app-render/dynamic-rendering"); const _staticgenerationbailout = require("../../client/components/static-generation-bailout"); const _dynamicrenderingutils = require("../dynamic-rendering-utils"); const _creatededupedbycallsiteservererrorlogger = require("../create-deduped-by-callsite-server-error-logger"); const _utils = require("./utils"); const _invarianterror = require("../../shared/lib/invariant-error"); const _reflect = require("../web/spec-extension/adapters/reflect"); function headers() { const callingExpression = 'headers'; const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workStore) { if (workUnitStore && workUnitStore.phase === 'after' && !(0, _utils.isRequestAPICallableInsideAfter)()) { throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "headers" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", { value: "E367", enumerable: false, configurable: true }); } if (workStore.forceStatic) { // When using forceStatic we override all other logic and always just return an empty // headers object without tracking const underlyingHeaders = _headers.HeadersAdapter.seal(new Headers({})); return makeUntrackedExoticHeaders(underlyingHeaders); } if (workUnitStore) { switch(workUnitStore.type){ case 'cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E304", enumerable: false, configurable: true }); Error.captureStackTrace(error, headers); workStore.invalidDynamicUsageError ??= error; throw error; } case 'private-cache': { const error = Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside "use cache: private". Accessing "headers" inside a private cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", { value: "E742", enumerable: false, configurable: true }); Error.captureStackTrace(error, headers); workStore.invalidDynamicUsageError ??= error; throw error; } case 'unstable-cache': throw Object.defineProperty(new Error(`Route ${workStore.route} used "headers" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", { value: "E127", enumerable: false, configurable: true }); case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'request': break; default: workUnitStore; } } if (workStore.dynamicShouldError) { throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`headers\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E525", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'prerender': case 'prerender-runtime': return makeHangingHeaders(workStore, workUnitStore); case 'prerender-client': const exportName = '`headers`'; throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a client component. Next.js should be preventing ${exportName} from being included in client components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E693", enumerable: false, configurable: true }); case 'prerender-ppr': // PPR Prerender (no cacheComponents) // We are prerendering with PPR. We need track dynamic access here eagerly // to keep continuity with how headers has worked in PPR without cacheComponents. // TODO consider switching the semantic to throw on property access instead return (0, _dynamicrendering.postponeWithTracking)(workStore.route, callingExpression, workUnitStore.dynamicTracking); case 'prerender-legacy': // Legacy Prerender // We are in a legacy static generation mode while prerendering // We track dynamic access here so we don't need to wrap the headers in // individual property access tracking. return (0, _dynamicrendering.throwToInterruptStaticGeneration)(callingExpression, workStore, workUnitStore); case 'request': (0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore); if ("production" === 'development') { // Semantically we only need the dev tracking when running in `next dev` // but since you would never use next dev with production NODE_ENV we use this // as a proxy so we can statically exclude this code from production builds. if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedHeadersWithDevWarnings(workUnitStore.headers, workStore == null ? void 0 : workStore.route); } return makeUntrackedExoticHeadersWithDevWarnings(workUnitStore.headers, workStore == null ? void 0 : workStore.route); } else { if (process.env.__NEXT_CACHE_COMPONENTS) { return makeUntrackedHeaders(workUnitStore.headers); } return makeUntrackedExoticHeaders(workUnitStore.headers); } break; default: workUnitStore; } } } // If we end up here, there was no work store or work unit store present. (0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression); } const CachedHeaders = new WeakMap(); function makeHangingHeaders(workStore, prerenderStore) { const cachedHeaders = CachedHeaders.get(prerenderStore); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeHangingPromise)(prerenderStore.renderSignal, workStore.route, '`headers()`'); CachedHeaders.set(prerenderStore, promise); return promise; } function makeUntrackedHeaders(underlyingHeaders) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = Promise.resolve(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); return promise; } function makeUntrackedExoticHeaders(underlyingHeaders) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = Promise.resolve(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); Object.defineProperties(promise, { append: { value: underlyingHeaders.append.bind(underlyingHeaders) }, delete: { value: underlyingHeaders.delete.bind(underlyingHeaders) }, get: { value: underlyingHeaders.get.bind(underlyingHeaders) }, has: { value: underlyingHeaders.has.bind(underlyingHeaders) }, set: { value: underlyingHeaders.set.bind(underlyingHeaders) }, getSetCookie: { value: underlyingHeaders.getSetCookie.bind(underlyingHeaders) }, forEach: { value: underlyingHeaders.forEach.bind(underlyingHeaders) }, keys: { value: underlyingHeaders.keys.bind(underlyingHeaders) }, values: { value: underlyingHeaders.values.bind(underlyingHeaders) }, entries: { value: underlyingHeaders.entries.bind(underlyingHeaders) }, [Symbol.iterator]: { value: underlyingHeaders[Symbol.iterator].bind(underlyingHeaders) } }); return promise; } function makeUntrackedExoticHeadersWithDevWarnings(underlyingHeaders, route) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingHeaders); CachedHeaders.set(underlyingHeaders, promise); Object.defineProperties(promise, { append: { value: function append() { const expression = `\`headers().append(${describeNameArg(arguments[0])}, ...)\``; syncIODev(route, expression); return underlyingHeaders.append.apply(underlyingHeaders, arguments); } }, delete: { value: function _delete() { const expression = `\`headers().delete(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.delete.apply(underlyingHeaders, arguments); } }, get: { value: function get() { const expression = `\`headers().get(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.get.apply(underlyingHeaders, arguments); } }, has: { value: function has() { const expression = `\`headers().has(${describeNameArg(arguments[0])})\``; syncIODev(route, expression); return underlyingHeaders.has.apply(underlyingHeaders, arguments); } }, set: { value: function set() { const expression = `\`headers().set(${describeNameArg(arguments[0])}, ...)\``; syncIODev(route, expression); return underlyingHeaders.set.apply(underlyingHeaders, arguments); } }, getSetCookie: { value: function getSetCookie() { const expression = '`headers().getSetCookie()`'; syncIODev(route, expression); return underlyingHeaders.getSetCookie.apply(underlyingHeaders, arguments); } }, forEach: { value: function forEach() { const expression = '`headers().forEach(...)`'; syncIODev(route, expression); return underlyingHeaders.forEach.apply(underlyingHeaders, arguments); } }, keys: { value: function keys() { const expression = '`headers().keys()`'; syncIODev(route, expression); return underlyingHeaders.keys.apply(underlyingHeaders, arguments); } }, values: { value: function values() { const expression = '`headers().values()`'; syncIODev(route, expression); return underlyingHeaders.values.apply(underlyingHeaders, arguments); } }, entries: { value: function entries() { const expression = '`headers().entries()`'; syncIODev(route, expression); return underlyingHeaders.entries.apply(underlyingHeaders, arguments); } }, [Symbol.iterator]: { value: function() { const expression = '`...headers()` or similar iteration'; syncIODev(route, expression); return underlyingHeaders[Symbol.iterator].apply(underlyingHeaders, arguments); } } }); return promise; } // Similar to `makeUntrackedExoticHeadersWithDevWarnings`, but just logging the // sync access without actually defining the headers properties on the promise. function makeUntrackedHeadersWithDevWarnings(underlyingHeaders, route) { const cachedHeaders = CachedHeaders.get(underlyingHeaders); if (cachedHeaders) { return cachedHeaders; } const promise = (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(underlyingHeaders); const proxiedPromise = new Proxy(promise, { get (target, prop, receiver) { switch(prop){ case Symbol.iterator: { warnForSyncAccess(route, '`...headers()` or similar iteration'); break; } case 'append': case 'delete': case 'get': case 'has': case 'set': case 'getSetCookie': case 'forEach': case 'keys': case 'values': case 'entries': { warnForSyncAccess(route, `\`headers().${prop}\``); break; } default: { // We only warn for well-defined properties of the headers object. } } return _reflect.ReflectAdapter.get(target, prop, receiver); } }); CachedHeaders.set(underlyingHeaders, proxiedPromise); return proxiedPromise; } function describeNameArg(arg) { return typeof arg === 'string' ? `'${arg}'` : '...'; } function syncIODev(route, expression) { const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore(); if (workUnitStore) { switch(workUnitStore.type){ case 'request': if (workUnitStore.prerenderPhase === true) { // When we're rendering dynamically in dev, we need to advance out of // the Prerender environment when we read Request data synchronously. (0, _dynamicrendering.trackSynchronousRequestDataAccessInDev)(workUnitStore); } break; case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': break; default: workUnitStore; } } // In all cases we warn normally warnForSyncAccess(route, expression); } const warnForSyncAccess = (0, _creatededupedbycallsiteservererrorlogger.createDedupedByCallsiteServerErrorLoggerDev)(createHeadersAccessError); function createHeadersAccessError(route, expression) { const prefix = route ? `Route "${route}" ` : 'This route '; return Object.defineProperty(new Error(`${prefix}used ${expression}. ` + `\`headers()\` should be awaited before using its value. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`), "__NEXT_ERROR_CODE", { value: "E277", enumerable: false, configurable: true }); } //# sourceMappingURL=headers.js.map 012undefined1458__webpack_unused_export__ = (undefined7878)undefined81122__webpack_unused_export__ = (undefined200200)undefined220226__webpack_require__undefined2282677675undefined305311__webpack_require__undefined3133559294undefined397403__webpack_require__undefined4054523033undefined482488__webpack_require__undefined4905226906undefined559565__webpack_require__undefined5676171938undefined652658__webpack_require__undefined6606872831undefined741747__webpack_require__undefined749799787undefined818824__webpack_require__undefined8268341716undefined862868__webpack_require__undefined8709039290undefined924930__webpack_require__undefined9329713036undefined73547383falseundefined73868086{}undefined81238157falseundefined81608266{}undefinedxvx, /***/ 5883: wuwuw, /***/ 6713: tEmodule.exports = require("next/dist/shared/lib/router/utils/is-bot");u, /***/ 7275: 0261Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 4160, 23))undefined266517Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 1603, 23))undefined522776Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8495, 23))undefined7811057Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 5170, 23))undefined10621315Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 7526, 23))undefined13201584Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8922, 23))undefined15891857Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 9234, 23))undefined18622117Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 2263, 23))undefined21222376Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2146))undefinedss, /***/ 8354: p!module.exports = require("util");qq, /***/ 8706: y>"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { MutableRequestCookiesAdapter: null, ReadonlyRequestCookiesError: null, RequestCookiesAdapter: null, appendMutableCookies: null, areCookiesMutableInCurrentPhase: null, createCookiesWithMutableAccessCheck: null, getModifiedCookieValues: null, responseCookiesToRequestCookies: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { MutableRequestCookiesAdapter: function() { return MutableRequestCookiesAdapter; }, ReadonlyRequestCookiesError: function() { return ReadonlyRequestCookiesError; }, RequestCookiesAdapter: function() { return RequestCookiesAdapter; }, appendMutableCookies: function() { return appendMutableCookies; }, areCookiesMutableInCurrentPhase: function() { return areCookiesMutableInCurrentPhase; }, createCookiesWithMutableAccessCheck: function() { return createCookiesWithMutableAccessCheck; }, getModifiedCookieValues: function() { return getModifiedCookieValues; }, responseCookiesToRequestCookies: function() { return responseCookiesToRequestCookies; } }); const _cookies = require("../cookies"); const _reflect = require("./reflect"); const _workasyncstorageexternal = require("../../../app-render/work-async-storage.external"); class ReadonlyRequestCookiesError extends Error { constructor(){ super('Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options'); } static callable() { throw new ReadonlyRequestCookiesError(); } } class RequestCookiesAdapter { static seal(cookies) { return new Proxy(cookies, { get (target, prop, receiver) { switch(prop){ case 'clear': case 'delete': case 'set': return ReadonlyRequestCookiesError.callable; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); } } const SYMBOL_MODIFY_COOKIE_VALUES = Symbol.for('next.mutated.cookies'); function getModifiedCookieValues(cookies) { const modified = cookies[SYMBOL_MODIFY_COOKIE_VALUES]; if (!modified || !Array.isArray(modified) || modified.length === 0) { return []; } return modified; } function appendMutableCookies(headers, mutableCookies) { const modifiedCookieValues = getModifiedCookieValues(mutableCookies); if (modifiedCookieValues.length === 0) { return false; } // Return a new response that extends the response with // the modified cookies as fallbacks. `res` cookies // will still take precedence. const resCookies = new _cookies.ResponseCookies(headers); const returnedCookies = resCookies.getAll(); // Set the modified cookies as fallbacks. for (const cookie of modifiedCookieValues){ resCookies.set(cookie); } // Set the original cookies as the final values. for (const cookie of returnedCookies){ resCookies.set(cookie); } return true; } class MutableRequestCookiesAdapter { static wrap(cookies, onUpdateCookies) { const responseCookies = new _cookies.ResponseCookies(new Headers()); for (const cookie of cookies.getAll()){ responseCookies.set(cookie); } let modifiedValues = []; const modifiedCookies = new Set(); const updateResponseCookies = ()=>{ // TODO-APP: change method of getting workStore const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); if (workStore) { workStore.pathWasRevalidated = true; } const allCookies = responseCookies.getAll(); modifiedValues = allCookies.filter((c)=>modifiedCookies.has(c.name)); if (onUpdateCookies) { const serializedCookies = []; for (const cookie of modifiedValues){ const tempCookies = new _cookies.ResponseCookies(new Headers()); tempCookies.set(cookie); serializedCookies.push(tempCookies.toString()); } onUpdateCookies(serializedCookies); } }; const wrappedCookies = new Proxy(responseCookies, { get (target, prop, receiver) { switch(prop){ // A special symbol to get the modified cookie values case SYMBOL_MODIFY_COOKIE_VALUES: return modifiedValues; // TODO: Throw error if trying to set a cookie after the response // headers have been set. case 'delete': return function(...args) { modifiedCookies.add(typeof args[0] === 'string' ? args[0] : args[0].name); try { target.delete(...args); return wrappedCookies; } finally{ updateResponseCookies(); } }; case 'set': return function(...args) { modifiedCookies.add(typeof args[0] === 'string' ? args[0] : args[0].name); try { target.set(...args); return wrappedCookies; } finally{ updateResponseCookies(); } }; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); return wrappedCookies; } } function createCookiesWithMutableAccessCheck(requestStore) { const wrappedCookies = new Proxy(requestStore.mutableCookies, { get (target, prop, receiver) { switch(prop){ case 'delete': return function(...args) { ensureCookiesAreStillMutable(requestStore, 'cookies().delete'); target.delete(...args); return wrappedCookies; }; case 'set': return function(...args) { ensureCookiesAreStillMutable(requestStore, 'cookies().set'); target.set(...args); return wrappedCookies; }; default: return _reflect.ReflectAdapter.get(target, prop, receiver); } } }); return wrappedCookies; } function areCookiesMutableInCurrentPhase(requestStore) { return requestStore.phase === 'action'; } /** Ensure that cookies() starts throwing on mutation * if we changed phases and can no longer mutate. * * This can happen when going: * 'render' -> 'after' * 'action' -> 'render' * */ function ensureCookiesAreStillMutable(requestStore, _callingExpression) { if (!areCookiesMutableInCurrentPhase(requestStore)) { // TODO: maybe we can give a more precise error message based on callingExpression? throw new ReadonlyRequestCookiesError(); } } function responseCookiesToRequestCookies(responseCookies) { const requestCookies = new _cookies.RequestCookies(new Headers()); for (const cookie of responseCookies.getAll()){ requestCookies.set(cookie); } return requestCookies; } //# sourceMappingURL=request-cookies.js.map012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined874170undefined13891395__webpack_require__undefined139714083675undefined14291435__webpack_require__undefined143714473036undefined14851491__webpack_require__undefined149315419294undefinedn, /***/ 9121: kYmodule.exports = require("next/dist/server/app-render/action-async-storage.external.js");ljl, /***/ 9458: DEFGHIJk, /***/ 9902: h!module.exports = require("path");it }; ; // load runtime var __webpack_require__ = require("../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) var __webpack_exports__ = __webpack_require__.X(0, [5873,7082,4792], () => (__webpack_exec__(2964))); webpack/lib/util/registerExternalSerializerwebpack-sources/RawSource*(()=>{var a={};a.id=8887,a.ids=[8887],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},2488:a=>{"use strict";function b(a,c=200,d={}){return Response.json(a,{status:c,headers:Object.assign({"Cache-Control":"no-store"},d)})}a.exports={jsonResponse:b,errorResponse:function(a){return b({error:a.message||"Unexpected error",details:a.details||void 0},a.status||500)},parseJson:async function(a){let b=await a.text();return b?JSON.parse(b):{}}}},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3421:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(1237),e=c(5088),f=c(7679);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},4870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},5511:a=>{"use strict";a.exports=require("crypto")},5736:(a,b,c)=>{"use strict";a.exports=c(4870)},5741:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{POST:()=>y});var e=c(5736),f=c(9117),g=c(4044),h=c(9326),i=c(2324),j=c(261),k=c(4290),l=c(5328),m=c(8928),n=c(6595),o=c(3421),p=c(7679),q=c(1681),r=c(3446),s=c(6439),t=c(1356);let{signup:u}=c(8559),{jsonResponse:v,errorResponse:w,parseJson:x}=c(2488);async function y(a){try{let b=await x(a),{user:c,session:d}=await u(b);return new Response(JSON.stringify({user:{id:c.id,email:c.email,displayName:c.displayName}}),{status:201,headers:{"Content-Type":"application/json","Set-Cookie":`cosmic_session=${d.token}; HttpOnly; Secure; SameSite=Lax; Path=/; Max-Age=604800`,"Cache-Control":"no-store"}})}catch(a){return w(a)}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/signup/route",pathname:"/api/auth/signup",filename:"route",bundlePath:"app/api/auth/signup/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\signup\\route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){var d;let e="/api/auth/signup/route";"/index"===e&&(e="/");let g=await z.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(y.dynamicRoutes[E]||y.routes[D]);if(F&&!x){let a=!!y.routes[D],b=y.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||z.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===z.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>z.onRequestError(a,b,d,A)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>z.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})},A),b}},l=await z.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},6330:a=>{"use strict";a.exports=require("@prisma/client")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},7964:(a,b,c)=>{"use strict";let{PrismaClient:d}=c(6330);a.exports={prisma:globalThis.__cosmicPrisma||new d}},8335:()=>{},8559:(a,b,c)=>{"use strict";let{prisma:d}=c(7964),{randomBytes:e}=c(5511),f=c(7082);async function g(a){return f.hash(a,12)}async function h(a,b){return!!b&&f.compare(a,b)}async function i(a){let b=e(48).toString("hex");return await d.session.create({data:{userId:a,token:b,expiresAt:new Date(Date.now()+6048e5)}})}async function j(a){if(!a)return null;let b=await d.session.findUnique({where:{token:a},include:{user:{include:{memberships:{where:{status:"ACTIVE"},include:{organization:!0,role:!0}}}}}});return!b||b.expiresAt{}),null):b}async function k(a){let b=await j(a);return b?b.user:null}a.exports={signup:async function({email:a,displayName:b,password:c}){if(!a||!c){let a=Error("Email and password are required");throw a.status=400,a}if(await d.user.findUnique({where:{email:a}})){let a=Error("Email already registered");throw a.status=409,a}let e=await g(c),f=await d.user.create({data:{email:a,displayName:b||a.split("@")[0],passwordHash:e,emailVerifiedAt:new Date}}),h=(b||a.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")+"-"+Date.now().toString(36),j=await d.role.upsert({where:{code:"owner"},update:{},create:{code:"owner",name:"Owner",permissions:["*"],system:!0}}),k=await d.organization.create({data:{name:(b||a.split("@")[0])+"'s Organization",slug:h,status:"TRIAL",planCode:"pilot",manualBilling:!0}});await d.membership.create({data:{organizationId:k.id,userId:f.id,roleId:j.id,status:"ACTIVE"}}),await d.subscription.create({data:{organizationId:k.id,source:"MANUAL",status:"TRIALING",planCode:"pilot",userLimit:5,projectLimit:3,reportLimitMonthly:25,integrationLimit:2,adminOverride:!1}}).catch(()=>{});let l=await d.workspace.create({data:{organizationId:k.id,name:"Default Workspace",slug:"default-workspace",type:"B2B_TEAM",status:"TRIAL"}});await d.project.create({data:{workspaceId:l.id,name:"My Project",projectType:"AI-Enabler",status:"Active",riskAppetite:50,description:"Project created during signup"}});let m=await i(f.id);return{user:f,session:m}},login:async function({email:a,password:b}){if(!a||!b){let a=Error("Email and password are required");throw a.status=400,a}let c=await d.user.findUnique({where:{email:a},include:{memberships:{where:{status:"ACTIVE"},include:{organization:!0,role:!0}}}});if(!c||!await h(b,c.passwordHash)){let a=Error("Invalid email or password");throw a.status=401,a}await d.user.update({where:{id:c.id},data:{lastLoginAt:new Date}});let e=await i(c.id);return{user:c,session:e}},logout:async function(a){a&&await d.session.deleteMany({where:{token:a}}).catch(()=>{})},getSession:j,getActorFromSession:k,createSession:i,SESSION_DURATION_MS:6048e5}},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[5873,7082],()=>b(b.s=5741));module.exports=c})(); 9(()=>{var a={};a.id=4310,a.ids=[4310],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},2842:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>D,patchFetch:()=>C,routeModule:()=>y,serverHooks:()=>B,workAsyncStorage:()=>z,workUnitAsyncStorage:()=>A});var d={};c.r(d),c.d(d,{GET:()=>x});var e=c(5736),f=c(9117),g=c(4044),h=c(9326),i=c(2324),j=c(261),k=c(4290),l=c(5328),m=c(8928),n=c(6595),o=c(3421),p=c(7679),q=c(1681),r=c(3446),s=c(6439),t=c(1356);let{handleSsoCallback:u}=c(9970),{getOidcConfig:v,stateCookieName:w}=c(5617);async function x(a){try{var b;let{searchParams:c}=new URL(a.url),d=c.get("code"),e=c.get("state"),f=c.get("error");if(f)return new Response(JSON.stringify({error:`SSO provider returned: ${f}`}),{status:400,headers:{"Content-Type":"application/json"}});if(!d)return new Response(JSON.stringify({error:"Missing authorization code"}),{status:400,headers:{"Content-Type":"application/json"}});let g=a.headers.get("cookie")||"",h=function(a,b){let c=b?.match(RegExp(`(?:^|;)\\s*${a}=([^;]+)`));return c?decodeURIComponent(c[1]):null}(w(),g);if(e&&h&&e!==h)return new Response(JSON.stringify({error:"State mismatch — possible CSRF"}),{status:403,headers:{"Content-Type":"application/json"}});let{session:i}=await u(d),j=`${w()}=; HttpOnly; SameSite=Lax; Path=/; Max-Age=0`,k=(b=i.token,`cosmic_session=${b}; HttpOnly; Secure; SameSite=Lax; Path=/; Max-Age=604800`),l=v(),m=l?.redirectUrl?new URL(l.redirectUrl).origin:"http://localhost:8090";return new Response(null,{status:302,headers:{Location:`${m}/dashboard`,"Set-Cookie":`${k}, ${j}`,"Cache-Control":"no-store"}})}catch(b){let a=b.message||"SSO callback failed";return new Response(`

SSO Error

${a}

Back to login`,{status:b.status||500,headers:{"Content-Type":"text/html"}})}}let y=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/sso/callback/route",pathname:"/api/auth/sso/callback",filename:"route",bundlePath:"app/api/auth/sso/callback/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\sso\\callback\\route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:z,workUnitAsyncStorage:A,serverHooks:B}=y;function C(){return(0,g.patchFetch)({workAsyncStorage:z,workUnitAsyncStorage:A})}async function D(a,b,c){var d;let e="/api/auth/sso/callback/route";"/index"===e&&(e="/");let g=await y.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(z.dynamicRoutes[E]||z.routes[D]);if(F&&!x){let a=!!z.routes[D],b=z.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||y.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===y.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:z,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>y.onRequestError(a,b,d,A)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>y.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await y.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})},A),b}},l=await y.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await y.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3421:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(1237),e=c(5088),f=c(7679);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},4870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},5511:a=>{"use strict";a.exports=require("crypto")},5617:(a,b,c)=>{"use strict";let{randomBytes:d}=c(5511);function e(a){return a.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}a.exports={getOidcConfig:function(){if("true"!==process.env.COSMIC_SSO_ENABLED)return null;let a=process.env.COSMIC_OIDC_ISSUER,b=process.env.COSMIC_OIDC_CLIENT_ID,c=process.env.COSMIC_OIDC_CLIENT_SECRET;return a&&b&&c?{issuer:a,clientId:b,clientSecret:c,redirectUrl:process.env.COSMIC_OIDC_REDIRECT_URL||"http://localhost:8090/api/auth/sso/callback"}:null},discoverProvider:async function a(a){let b=process.env.COSMIC_OIDC_DISCOVERY_URL||a.replace(/\/+$/,"")+"/.well-known/openid-configuration",c=await fetch(b);if(!c.ok)throw Error(`OIDC discovery failed (${c.status}) for ${b}`);return c.json()},generateState:function(){return e(d(32))},generateNonce:function(){return e(d(32))},decodeJwtPayload:function(a){let b=a.split(".");if(3!==b.length)throw Error("Invalid JWT format");return JSON.parse(Buffer.from(b[1],"base64url").toString("utf8"))},base64UrlEncode:e,stateCookieName:function(){return"cosmic_sso_state"},getCookieExpires:function(){return new Date(Date.now()+6e5).toUTCString()}}},5736:(a,b,c)=>{"use strict";a.exports=c(4870)},6330:a=>{"use strict";a.exports=require("@prisma/client")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},7964:(a,b,c)=>{"use strict";let{PrismaClient:d}=c(6330);a.exports={prisma:globalThis.__cosmicPrisma||new d}},8335:()=>{},8559:(a,b,c)=>{"use strict";let{prisma:d}=c(7964),{randomBytes:e}=c(5511),f=c(7082);async function g(a){return f.hash(a,12)}async function h(a,b){return!!b&&f.compare(a,b)}async function i(a){let b=e(48).toString("hex");return await d.session.create({data:{userId:a,token:b,expiresAt:new Date(Date.now()+6048e5)}})}async function j(a){if(!a)return null;let b=await d.session.findUnique({where:{token:a},include:{user:{include:{memberships:{where:{status:"ACTIVE"},include:{organization:!0,role:!0}}}}}});return!b||b.expiresAt{}),null):b}async function k(a){let b=await j(a);return b?b.user:null}a.exports={signup:async function({email:a,displayName:b,password:c}){if(!a||!c){let a=Error("Email and password are required");throw a.status=400,a}if(await d.user.findUnique({where:{email:a}})){let a=Error("Email already registered");throw a.status=409,a}let e=await g(c),f=await d.user.create({data:{email:a,displayName:b||a.split("@")[0],passwordHash:e,emailVerifiedAt:new Date}}),h=(b||a.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")+"-"+Date.now().toString(36),j=await d.role.upsert({where:{code:"owner"},update:{},create:{code:"owner",name:"Owner",permissions:["*"],system:!0}}),k=await d.organization.create({data:{name:(b||a.split("@")[0])+"'s Organization",slug:h,status:"TRIAL",planCode:"pilot",manualBilling:!0}});await d.membership.create({data:{organizationId:k.id,userId:f.id,roleId:j.id,status:"ACTIVE"}}),await d.subscription.create({data:{organizationId:k.id,source:"MANUAL",status:"TRIALING",planCode:"pilot",userLimit:5,projectLimit:3,reportLimitMonthly:25,integrationLimit:2,adminOverride:!1}}).catch(()=>{});let l=await d.workspace.create({data:{organizationId:k.id,name:"Default Workspace",slug:"default-workspace",type:"B2B_TEAM",status:"TRIAL"}});await d.project.create({data:{workspaceId:l.id,name:"My Project",projectType:"AI-Enabler",status:"Active",riskAppetite:50,description:"Project created during signup"}});let m=await i(f.id);return{user:f,session:m}},login:async function({email:a,password:b}){if(!a||!b){let a=Error("Email and password are required");throw a.status=400,a}let c=await d.user.findUnique({where:{email:a},include:{memberships:{where:{status:"ACTIVE"},include:{organization:!0,role:!0}}}});if(!c||!await h(b,c.passwordHash)){let a=Error("Invalid email or password");throw a.status=401,a}await d.user.update({where:{id:c.id},data:{lastLoginAt:new Date}});let e=await i(c.id);return{user:c,session:e}},logout:async function(a){a&&await d.session.deleteMany({where:{token:a}}).catch(()=>{})},getSession:j,getActorFromSession:k,createSession:i,SESSION_DURATION_MS:6048e5}},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9970:(a,b,c)=>{"use strict";let{prisma:d}=c(7964),{createSession:e}=c(8559),{getOidcConfig:f,discoverProvider:g,generateNonce:h,decodeJwtPayload:i}=c(5617);async function j(a,b,c,d,e){let f=new URLSearchParams({grant_type:"authorization_code",code:a,redirect_uri:b,client_id:c,client_secret:d}),g=await fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:f.toString()});if(!g.ok){let a=await g.text();throw Error(`Token exchange failed (${g.status}): ${a}`)}return g.json()}a.exports={handleSsoCallback:async function(a){let b=f();if(!b)throw Object.assign(Error("SSO not configured"),{status:501});let c=await g(b.issuer),h=(await j(a,b.redirectUrl,b.clientId,b.clientSecret,c.token_endpoint)).id_token;if(!h)throw Object.assign(Error("No id_token returned from provider"),{status:400});let k=i(h),l=k.email;if(!l)throw Object.assign(Error("Email not provided by SSO provider"),{status:400});let m=k.name||k.preferred_username||l.split("@")[0],n=await d.user.findUnique({where:{email:l}});if(n)await d.user.update({where:{id:n.id},data:{lastLoginAt:new Date,displayName:m}});else{n=await d.user.create({data:{email:l,displayName:m,emailVerifiedAt:new Date}});let a=m.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")+"-"+Date.now().toString(36),b=await d.role.upsert({where:{code:"owner"},update:{},create:{code:"owner",name:"Owner",permissions:["*"],system:!0}}),c=await d.organization.create({data:{name:`${m}'s Organization`,slug:a,status:"TRIAL",planCode:"pilot",manualBilling:!0}});await d.membership.create({data:{organizationId:c.id,userId:n.id,roleId:b.id,status:"ACTIVE"}}),await d.subscription.create({data:{organizationId:c.id,source:"MANUAL",status:"TRIALING",planCode:"pilot",userLimit:5,projectLimit:3}}).catch(()=>{});let e=await d.workspace.create({data:{organizationId:c.id,name:"Default Workspace",slug:"default-workspace",type:"B2B_TEAM",status:"TRIAL"}});await d.project.create({data:{workspaceId:e.id,name:"My Project",projectType:"AI-Enabler",status:"Active",riskAppetite:50}})}let o=await e(n.id);return{user:n,session:o}}}}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[5873,7082],()=>b(b.s=2842));module.exports=c})(); *(()=>{var a={};a.id=8489,a.ids=[8489],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},2488:a=>{"use strict";function b(a,c=200,d={}){return Response.json(a,{status:c,headers:Object.assign({"Cache-Control":"no-store"},d)})}a.exports={jsonResponse:b,errorResponse:function(a){return b({error:a.message||"Unexpected error",details:a.details||void 0},a.status||500)},parseJson:async function(a){let b=await a.text();return b?JSON.parse(b):{}}}},2515:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>C,patchFetch:()=>B,routeModule:()=>x,serverHooks:()=>A,workAsyncStorage:()=>y,workUnitAsyncStorage:()=>z});var d={};c.r(d),c.d(d,{POST:()=>w});var e=c(5736),f=c(9117),g=c(4044),h=c(9326),i=c(2324),j=c(261),k=c(4290),l=c(5328),m=c(8928),n=c(6595),o=c(3421),p=c(7679),q=c(1681),r=c(3446),s=c(6439),t=c(1356);let{logout:u}=c(8559),{errorResponse:v}=c(2488);async function w(a){try{let b=(a.headers.get("cookie")||"").match(/cosmic_session=([^;]+)/);return b&&await u(b[1]),new Response(JSON.stringify({ok:!0}),{status:200,headers:{"Content-Type":"application/json","Set-Cookie":"cosmic_session=; HttpOnly; Secure; SameSite=Lax; Path=/; Max-Age=0","Cache-Control":"no-store"}})}catch(a){return v(a)}}let x=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/logout/route",pathname:"/api/auth/logout",filename:"route",bundlePath:"app/api/auth/logout/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\logout\\route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:y,workUnitAsyncStorage:z,serverHooks:A}=x;function B(){return(0,g.patchFetch)({workAsyncStorage:y,workUnitAsyncStorage:z})}async function C(a,b,c){var d;let e="/api/auth/logout/route";"/index"===e&&(e="/");let g=await x.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(z.dynamicRoutes[E]||z.routes[D]);if(F&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||x.isDev||y||(G="/index"===(G=D)?"/":G);let H=!0===x.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:z,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>x.onRequestError(a,b,d,A)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>x.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await x.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})},A),b}},l=await x.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await x.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3421:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(1237),e=c(5088),f=c(7679);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},4870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},5511:a=>{"use strict";a.exports=require("crypto")},5736:(a,b,c)=>{"use strict";a.exports=c(4870)},6330:a=>{"use strict";a.exports=require("@prisma/client")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},7964:(a,b,c)=>{"use strict";let{PrismaClient:d}=c(6330);a.exports={prisma:globalThis.__cosmicPrisma||new d}},8335:()=>{},8559:(a,b,c)=>{"use strict";let{prisma:d}=c(7964),{randomBytes:e}=c(5511),f=c(7082);async function g(a){return f.hash(a,12)}async function h(a,b){return!!b&&f.compare(a,b)}async function i(a){let b=e(48).toString("hex");return await d.session.create({data:{userId:a,token:b,expiresAt:new Date(Date.now()+6048e5)}})}async function j(a){if(!a)return null;let b=await d.session.findUnique({where:{token:a},include:{user:{include:{memberships:{where:{status:"ACTIVE"},include:{organization:!0,role:!0}}}}}});return!b||b.expiresAt{}),null):b}async function k(a){let b=await j(a);return b?b.user:null}a.exports={signup:async function({email:a,displayName:b,password:c}){if(!a||!c){let a=Error("Email and password are required");throw a.status=400,a}if(await d.user.findUnique({where:{email:a}})){let a=Error("Email already registered");throw a.status=409,a}let e=await g(c),f=await d.user.create({data:{email:a,displayName:b||a.split("@")[0],passwordHash:e,emailVerifiedAt:new Date}}),h=(b||a.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")+"-"+Date.now().toString(36),j=await d.role.upsert({where:{code:"owner"},update:{},create:{code:"owner",name:"Owner",permissions:["*"],system:!0}}),k=await d.organization.create({data:{name:(b||a.split("@")[0])+"'s Organization",slug:h,status:"TRIAL",planCode:"pilot",manualBilling:!0}});await d.membership.create({data:{organizationId:k.id,userId:f.id,roleId:j.id,status:"ACTIVE"}}),await d.subscription.create({data:{organizationId:k.id,source:"MANUAL",status:"TRIALING",planCode:"pilot",userLimit:5,projectLimit:3,reportLimitMonthly:25,integrationLimit:2,adminOverride:!1}}).catch(()=>{});let l=await d.workspace.create({data:{organizationId:k.id,name:"Default Workspace",slug:"default-workspace",type:"B2B_TEAM",status:"TRIAL"}});await d.project.create({data:{workspaceId:l.id,name:"My Project",projectType:"AI-Enabler",status:"Active",riskAppetite:50,description:"Project created during signup"}});let m=await i(f.id);return{user:f,session:m}},login:async function({email:a,password:b}){if(!a||!b){let a=Error("Email and password are required");throw a.status=400,a}let c=await d.user.findUnique({where:{email:a},include:{memberships:{where:{status:"ACTIVE"},include:{organization:!0,role:!0}}}});if(!c||!await h(b,c.passwordHash)){let a=Error("Invalid email or password");throw a.status=401,a}await d.user.update({where:{id:c.id},data:{lastLoginAt:new Date}});let e=await i(c.id);return{user:c,session:e}},logout:async function(a){a&&await d.session.deleteMany({where:{token:a}}).catch(()=>{})},getSession:j,getActorFromSession:k,createSession:i,SESSION_DURATION_MS:6048e5}},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[5873,7082],()=>b(b.s=2515));module.exports=c})(); ~$+(()=>{var a={};a.id=3745,a.ids=[3745],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},2488:a=>{"use strict";function b(a,c=200,d={}){return Response.json(a,{status:c,headers:Object.assign({"Cache-Control":"no-store"},d)})}a.exports={jsonResponse:b,errorResponse:function(a){return b({error:a.message||"Unexpected error",details:a.details||void 0},a.status||500)},parseJson:async function(a){let b=await a.text();return b?JSON.parse(b):{}}}},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3421:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(1237),e=c(5088),f=c(7679);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},4870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},5511:a=>{"use strict";a.exports=require("crypto")},5736:(a,b,c)=>{"use strict";a.exports=c(4870)},6330:a=>{"use strict";a.exports=require("@prisma/client")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},7964:(a,b,c)=>{"use strict";let{PrismaClient:d}=c(6330);a.exports={prisma:globalThis.__cosmicPrisma||new d}},8335:()=>{},8559:(a,b,c)=>{"use strict";let{prisma:d}=c(7964),{randomBytes:e}=c(5511),f=c(7082);async function g(a){return f.hash(a,12)}async function h(a,b){return!!b&&f.compare(a,b)}async function i(a){let b=e(48).toString("hex");return await d.session.create({data:{userId:a,token:b,expiresAt:new Date(Date.now()+6048e5)}})}async function j(a){if(!a)return null;let b=await d.session.findUnique({where:{token:a},include:{user:{include:{memberships:{where:{status:"ACTIVE"},include:{organization:!0,role:!0}}}}}});return!b||b.expiresAt{}),null):b}async function k(a){let b=await j(a);return b?b.user:null}a.exports={signup:async function({email:a,displayName:b,password:c}){if(!a||!c){let a=Error("Email and password are required");throw a.status=400,a}if(await d.user.findUnique({where:{email:a}})){let a=Error("Email already registered");throw a.status=409,a}let e=await g(c),f=await d.user.create({data:{email:a,displayName:b||a.split("@")[0],passwordHash:e,emailVerifiedAt:new Date}}),h=(b||a.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")+"-"+Date.now().toString(36),j=await d.role.upsert({where:{code:"owner"},update:{},create:{code:"owner",name:"Owner",permissions:["*"],system:!0}}),k=await d.organization.create({data:{name:(b||a.split("@")[0])+"'s Organization",slug:h,status:"TRIAL",planCode:"pilot",manualBilling:!0}});await d.membership.create({data:{organizationId:k.id,userId:f.id,roleId:j.id,status:"ACTIVE"}}),await d.subscription.create({data:{organizationId:k.id,source:"MANUAL",status:"TRIALING",planCode:"pilot",userLimit:5,projectLimit:3,reportLimitMonthly:25,integrationLimit:2,adminOverride:!1}}).catch(()=>{});let l=await d.workspace.create({data:{organizationId:k.id,name:"Default Workspace",slug:"default-workspace",type:"B2B_TEAM",status:"TRIAL"}});await d.project.create({data:{workspaceId:l.id,name:"My Project",projectType:"AI-Enabler",status:"Active",riskAppetite:50,description:"Project created during signup"}});let m=await i(f.id);return{user:f,session:m}},login:async function({email:a,password:b}){if(!a||!b){let a=Error("Email and password are required");throw a.status=400,a}let c=await d.user.findUnique({where:{email:a},include:{memberships:{where:{status:"ACTIVE"},include:{organization:!0,role:!0}}}});if(!c||!await h(b,c.passwordHash)){let a=Error("Invalid email or password");throw a.status=401,a}await d.user.update({where:{id:c.id},data:{lastLoginAt:new Date}});let e=await i(c.id);return{user:c,session:e}},logout:async function(a){a&&await d.session.deleteMany({where:{token:a}}).catch(()=>{})},getSession:j,getActorFromSession:k,createSession:i,SESSION_DURATION_MS:6048e5}},8837:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>D,patchFetch:()=>C,routeModule:()=>y,serverHooks:()=>B,workAsyncStorage:()=>z,workUnitAsyncStorage:()=>A});var d={};c.r(d),c.d(d,{GET:()=>x});var e=c(5736),f=c(9117),g=c(4044),h=c(9326),i=c(2324),j=c(261),k=c(4290),l=c(5328),m=c(8928),n=c(6595),o=c(3421),p=c(7679),q=c(1681),r=c(3446),s=c(6439),t=c(1356);let{getSession:u}=c(8559),{jsonResponse:v,errorResponse:w}=c(2488);async function x(a){try{let b=(a.headers.get("cookie")||"").match(/cosmic_session=([^;]+)/);if(!b)return v({authenticated:!1});let c=await u(b[1]);if(!c)return v({authenticated:!1});return v({authenticated:!0,user:{id:c.user.id,email:c.user.email,displayName:c.user.displayName},memberships:c.user.memberships.map(a=>({organizationId:a.organizationId,organizationName:a.organization.name,role:a.role.code,permissions:a.role.permissions}))})}catch(a){return w(a)}}let y=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/session/route",pathname:"/api/auth/session",filename:"route",bundlePath:"app/api/auth/session/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\session\\route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:z,workUnitAsyncStorage:A,serverHooks:B}=y;function C(){return(0,g.patchFetch)({workAsyncStorage:z,workUnitAsyncStorage:A})}async function D(a,b,c){var d;let e="/api/auth/session/route";"/index"===e&&(e="/");let g=await y.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(z.dynamicRoutes[E]||z.routes[D]);if(F&&!x){let a=!!z.routes[D],b=z.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||y.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===y.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:z,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>y.onRequestError(a,b,d,A)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>y.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await y.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})},A),b}},l=await y.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await y.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[5873,7082],()=>b(b.s=8837));module.exports=c})(); {*(()=>{var a={};a.id=7758,a.ids=[7758],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},940:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{POST:()=>y});var e=c(5736),f=c(9117),g=c(4044),h=c(9326),i=c(2324),j=c(261),k=c(4290),l=c(5328),m=c(8928),n=c(6595),o=c(3421),p=c(7679),q=c(1681),r=c(3446),s=c(6439),t=c(1356);let{login:u}=c(8559),{jsonResponse:v,errorResponse:w,parseJson:x}=c(2488);async function y(a){try{let b=await x(a),{user:c,session:d}=await u(b);return new Response(JSON.stringify({user:{id:c.id,email:c.email,displayName:c.displayName}}),{status:200,headers:{"Content-Type":"application/json","Set-Cookie":`cosmic_session=${d.token}; HttpOnly; Secure; SameSite=Lax; Path=/; Max-Age=604800`,"Cache-Control":"no-store"}})}catch(a){return w(a)}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/auth/login/route",pathname:"/api/auth/login",filename:"route",bundlePath:"app/api/auth/login/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\api\\auth\\login\\route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){var d;let e="/api/auth/login/route";"/index"===e&&(e="/");let g=await z.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(y.dynamicRoutes[E]||y.routes[D]);if(F&&!x){let a=!!y.routes[D],b=y.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||z.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===z.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>z.onRequestError(a,b,d,A)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>z.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})},A),b}},l=await z.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},2488:a=>{"use strict";function b(a,c=200,d={}){return Response.json(a,{status:c,headers:Object.assign({"Cache-Control":"no-store"},d)})}a.exports={jsonResponse:b,errorResponse:function(a){return b({error:a.message||"Unexpected error",details:a.details||void 0},a.status||500)},parseJson:async function(a){let b=await a.text();return b?JSON.parse(b):{}}}},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3421:(a,b,c)=>{"use strict";Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(1237),e=c(5088),f=c(7679);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},4870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},5511:a=>{"use strict";a.exports=require("crypto")},5736:(a,b,c)=>{"use strict";a.exports=c(4870)},6330:a=>{"use strict";a.exports=require("@prisma/client")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},7964:(a,b,c)=>{"use strict";let{PrismaClient:d}=c(6330);a.exports={prisma:globalThis.__cosmicPrisma||new d}},8335:()=>{},8559:(a,b,c)=>{"use strict";let{prisma:d}=c(7964),{randomBytes:e}=c(5511),f=c(7082);async function g(a){return f.hash(a,12)}async function h(a,b){return!!b&&f.compare(a,b)}async function i(a){let b=e(48).toString("hex");return await d.session.create({data:{userId:a,token:b,expiresAt:new Date(Date.now()+6048e5)}})}async function j(a){if(!a)return null;let b=await d.session.findUnique({where:{token:a},include:{user:{include:{memberships:{where:{status:"ACTIVE"},include:{organization:!0,role:!0}}}}}});return!b||b.expiresAt{}),null):b}async function k(a){let b=await j(a);return b?b.user:null}a.exports={signup:async function({email:a,displayName:b,password:c}){if(!a||!c){let a=Error("Email and password are required");throw a.status=400,a}if(await d.user.findUnique({where:{email:a}})){let a=Error("Email already registered");throw a.status=409,a}let e=await g(c),f=await d.user.create({data:{email:a,displayName:b||a.split("@")[0],passwordHash:e,emailVerifiedAt:new Date}}),h=(b||a.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")+"-"+Date.now().toString(36),j=await d.role.upsert({where:{code:"owner"},update:{},create:{code:"owner",name:"Owner",permissions:["*"],system:!0}}),k=await d.organization.create({data:{name:(b||a.split("@")[0])+"'s Organization",slug:h,status:"TRIAL",planCode:"pilot",manualBilling:!0}});await d.membership.create({data:{organizationId:k.id,userId:f.id,roleId:j.id,status:"ACTIVE"}}),await d.subscription.create({data:{organizationId:k.id,source:"MANUAL",status:"TRIALING",planCode:"pilot",userLimit:5,projectLimit:3,reportLimitMonthly:25,integrationLimit:2,adminOverride:!1}}).catch(()=>{});let l=await d.workspace.create({data:{organizationId:k.id,name:"Default Workspace",slug:"default-workspace",type:"B2B_TEAM",status:"TRIAL"}});await d.project.create({data:{workspaceId:l.id,name:"My Project",projectType:"AI-Enabler",status:"Active",riskAppetite:50,description:"Project created during signup"}});let m=await i(f.id);return{user:f,session:m}},login:async function({email:a,password:b}){if(!a||!b){let a=Error("Email and password are required");throw a.status=400,a}let c=await d.user.findUnique({where:{email:a},include:{memberships:{where:{status:"ACTIVE"},include:{organization:!0,role:!0}}}});if(!c||!await h(b,c.passwordHash)){let a=Error("Invalid email or password");throw a.status=401,a}await d.user.update({where:{id:c.id},data:{lastLoginAt:new Date}});let e=await i(c.id);return{user:c,session:e}},logout:async function(a){a&&await d.session.deleteMany({where:{token:a}}).catch(()=>{})},getSession:j,getActorFromSession:k,createSession:i,SESSION_DURATION_MS:6048e5}},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[5873,7082],()=>b(b.s=940));module.exports=c})(); xdz(()=>{var a={};a.id=8974,a.ids=[8974],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},345:(a,b,c)=>{"use strict";c.d(b,{default:()=>e});var d=c(1124);function e({className:a,children:b}){return(0,d.jsx)("form",{action:"/api/auth/logout",method:"POST",onSubmit:async a=>{a.preventDefault(),await fetch("/api/auth/logout",{method:"POST"}),window.location.href="/"},children:(0,d.jsx)("button",{type:"submit",className:a,children:b||"Sign out"})})}},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},1135:()=>{},1459:()=>{},1619:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,1170,23)),Promise.resolve().then(c.t.bind(c,3597,23)),Promise.resolve().then(c.t.bind(c,6893,23)),Promise.resolve().then(c.t.bind(c,9748,23)),Promise.resolve().then(c.t.bind(c,6060,23)),Promise.resolve().then(c.t.bind(c,7184,23)),Promise.resolve().then(c.t.bind(c,9576,23)),Promise.resolve().then(c.t.bind(c,3041,23)),Promise.resolve().then(c.t.bind(c,1384,23))},1662:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f,metadata:()=>e});var d=c(5338);c(1135);let e={title:"COSMIC AI-Risk SaaS",description:"Commercial multi-tenant COSMIC AI-Risk governance platform"};function f({children:a}){return(0,d.jsx)("html",{lang:"en",children:(0,d.jsx)("body",{children:a})})}},2381:(a,b,c)=>{Promise.resolve().then(c.bind(c,345))},2964:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>E.a,__next_app__:()=>K,handler:()=>M,pages:()=>J,routeModule:()=>L,tree:()=>I});var d=c(9754),e=c(9117),f=c(6595),g=c(2324),h=c(9326),i=c(8928),j=c(175),k=c(12),l=c(4290),m=c(2696),n=c(2574),o=c(2802),p=c(7533),q=c(5229),r=c(2822),s=c(261),t=c(6453),u=c(2474),v=c(6713),w=c(1356),x=c(2685),y=c(6225),z=c(3446),A=c(2762),B=c(5742),C=c(6439),D=c(1170),E=c.n(D),F=c(2506),G=c(1203),H={};for(let a in F)0>["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(H[a]=()=>F[a]);c.d(b,H);let I=["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,9458)),"C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"]}]},{layout:[()=>Promise.resolve().then(c.bind(c,1662)),"C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\layout.jsx"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,1170,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,7028,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,461,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,2768,23)),"next/dist/client/components/builtin/unauthorized.js"]}],J=["C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\page.jsx"],K={require:c,loadChunk:()=>Promise.resolve()},L=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:I},distDir:".next",relativeProjectDir:""});async function M(a,b,d){var D;let H="/page";"/index"===H&&(H="/");let N=(0,h.getRequestMeta)(a,"postponed"),O=(0,h.getRequestMeta)(a,"minimalMode"),P=await L.prepare(a,b,{srcPage:H,multiZoneDraftMode:!1});if(!P)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:Q,query:R,params:S,parsedUrl:T,pageIsDynamic:U,buildManifest:V,nextFontManifest:W,reactLoadableManifest:X,serverActionsManifest:Y,clientReferenceManifest:Z,subresourceIntegrityManifest:$,prerenderManifest:_,isDraftMode:aa,resolvedPathname:ab,revalidateOnlyGenerated:ac,routerServerContext:ad,nextConfig:ae,interceptionRoutePatterns:af}=P,ag=T.pathname||"/",ah=(0,s.normalizeAppPath)(H),{isOnDemandRevalidate:ai}=P,aj=L.match(ag,_),ak=!!_.routes[ab],al=!!(aj||ak||_.routes[ah]),am=a.headers["user-agent"]||"",an=(0,v.getBotType)(am),ao=(0,q.isHtmlBotRequest)(a),ap=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[u.NEXT_ROUTER_PREFETCH_HEADER],aq=(0,h.getRequestMeta)(a,"isRSCRequest")??(0,n.f)(a.headers[u.RSC_HEADER]),ar=(0,t.getIsPossibleServerAction)(a),as=(0,m.checkIsAppPPREnabled)(ae.experimental.ppr)&&(null==(D=_.routes[ah]??_.dynamicRoutes[ah])?void 0:D.renderingMode)==="PARTIALLY_STATIC",at=!1,au=!1,av=as?N:void 0,aw=as&&aq&&!ap,ax=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),ay=!am||(0,q.shouldServeStreamingMetadata)(am,ae.htmlLimitedBots);ao&&as&&(al=!1,ay=!1);let az=!0===L.isDev||!al||"string"==typeof N||aw,aA=ao&&as,aB=null;aa||!al||az||ar||av||aw||(aB=ab);let aC=aB;!aC&&L.isDev&&(aC=ab),L.isDev||aa||!al||!aq||aw||(0,k.d)(a.headers);let aD={...F,tree:I,pages:J,GlobalError:E(),handler:M,routeModule:L,__next_app__:K};Y&&Z&&(0,p.setReferenceManifestsSingleton)({page:H,clientReferenceManifest:Z,serverActionsManifest:Y,serverModuleMap:(0,r.createServerModuleMap)({serverActionsManifest:Y})});let aE=a.method||"GET",aF=(0,g.getTracer)(),aG=aF.getActiveScopeSpan();try{let f=L.getVaryHeader(ab,af);b.setHeader("Vary",f);let k=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return L.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=aF.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${aE} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aE} ${a.url}`)})},m=async({span:e,postponed:f,fallbackRouteParams:g})=>{let i={query:R,params:S,page:ah,sharedContext:{buildId:Q},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aD,Component:(0,j.T)(aD),params:S,routeModule:L,page:H,postponed:f,shouldWaitOnAllReady:aA,serveStreamingMetadata:ay,supportsDynamicResponse:"string"==typeof f||az,buildManifest:V,nextFontManifest:W,reactLoadableManifest:X,subresourceIntegrityManifest:$,serverActionsManifest:Y,clientReferenceManifest:Z,setIsrStatus:null==ad?void 0:ad.setIsrStatus,dir:c(9902).join(process.cwd(),L.relativeProjectDir),isDraftMode:aa,isRevalidate:al&&!f&&!aw,botType:an,isOnDemandRevalidate:ai,isPossibleServerAction:ar,assetPrefix:ae.assetPrefix,nextConfigOutput:ae.output,crossOrigin:ae.crossOrigin,trailingSlash:ae.trailingSlash,previewProps:_.preview,deploymentId:ae.deploymentId,enableTainting:ae.experimental.taint,htmlLimitedBots:ae.htmlLimitedBots,devtoolSegmentExplorer:ae.experimental.devtoolSegmentExplorer,reactMaxHeadersLength:ae.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:ae.experimental.cacheLife,basePath:ae.basePath,serverActions:ae.experimental.serverActions,...at?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isRevalidate:!0,isDebugDynamicAccesses:at}:{},experimental:{isRoutePPREnabled:as,expireTime:ae.expireTime,staleTimes:ae.experimental.staleTimes,cacheComponents:!!ae.experimental.cacheComponents,clientSegmentCache:!!ae.experimental.clientSegmentCache,clientParamParsing:!!ae.experimental.clientParamParsing,dynamicOnHover:!!ae.experimental.dynamicOnHover,inlineCss:!!ae.experimental.inlineCss,authInterrupts:!!ae.experimental.authInterrupts,clientTraceMetadata:ae.experimental.clientTraceMetadata||[]},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d)=>L.onRequestError(a,b,d,ad),err:(0,h.getRequestMeta)(a,"invokeError"),dev:L.isDev}},l=await k(e,i),{metadata:m}=l,{cacheControl:n,headers:o={},fetchTags:p}=m;if(p&&(o[z.NEXT_CACHE_TAGS_HEADER]=p),a.fetchMetrics=m.fetchMetrics,al&&(null==n?void 0:n.revalidate)===0&&!L.isDev&&!as){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ab}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""} see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:w.CachedRouteKind.APP_PAGE,html:l,headers:o,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:n}},n=async({hasResolved:c,previousCacheEntry:f,isRevalidating:g,span:i})=>{let j,k=!1===L.isDev,l=c||b.writableEnded;if(ai&&ac&&!f&&!O)return(null==ad?void 0:ad.render404)?await ad.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(aj&&(j=(0,x.parseFallbackField)(aj.fallback)),j===x.FallbackMode.PRERENDER&&(0,v.isBot)(am)&&(!as||ao)&&(j=x.FallbackMode.BLOCKING_STATIC_RENDER),(null==f?void 0:f.isStale)===-1&&(ai=!0),ai&&(j!==x.FallbackMode.NOT_FOUND||f)&&(j=x.FallbackMode.BLOCKING_STATIC_RENDER),!O&&j!==x.FallbackMode.BLOCKING_STATIC_RENDER&&aC&&!l&&!aa&&U&&(k||!ak)){let b;if((k||aj)&&j===x.FallbackMode.NOT_FOUND)throw new C.NoFallbackError;if(as&&!aq){let c="string"==typeof(null==aj?void 0:aj.fallback)?aj.fallback:k?ah:null;if(b=await L.handleResponse({cacheKey:c,req:a,nextConfig:ae,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:_,isRoutePPREnabled:as,responseGenerator:async()=>m({span:i,postponed:void 0,fallbackRouteParams:k||au?(0,o.u)(ah):null}),waitUntil:d.waitUntil}),null===b)return null;if(b)return delete b.cacheControl,b}}let n=ai||g||!av?void 0:av;if(at&&void 0!==n)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:w.CachedRouteKind.PAGES,html:y.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let p=U&&as&&((0,h.getRequestMeta)(a,"renderFallbackShell")||au)?(0,o.u)(ag):null;return m({span:i,postponed:n,fallbackRouteParams:p})},p=async c=>{var f,g,i,j,k;let l,o=await L.handleResponse({cacheKey:aB,responseGenerator:a=>n({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ai,isRoutePPREnabled:as,req:a,nextConfig:ae,prerenderManifest:_,waitUntil:d.waitUntil});if(aa&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),L.isDev&&b.setHeader("Cache-Control","no-store, must-revalidate"),!o){if(aB)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=o.value)?void 0:f.kind)!==w.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=o.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let p="string"==typeof o.value.postponed;al&&!aw&&(!p||ap)&&(O||b.setHeader("x-nextjs-cache",ai?"REVALIDATED":o.isMiss?"MISS":o.isStale?"STALE":"HIT"),b.setHeader(u.NEXT_IS_PRERENDER_HEADER,"1"));let{value:q}=o;if(av)l={revalidate:0,expire:void 0};else if(O&&aq&&!ap&&as)l={revalidate:0,expire:void 0};else if(!L.isDev)if(aa)l={revalidate:0,expire:void 0};else if(al){if(o.cacheControl)if("number"==typeof o.cacheControl.revalidate){if(o.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${o.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:o.cacheControl.revalidate,expire:(null==(j=o.cacheControl)?void 0:j.expire)??ae.expireTime}}else l={revalidate:z.CACHE_ONE_YEAR,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(o.cacheControl=l,"string"==typeof ax&&(null==q?void 0:q.kind)===w.CachedRouteKind.APP_PAGE&&q.segmentData){b.setHeader(u.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=q.headers)?void 0:k[z.NEXT_CACHE_TAGS_HEADER];O&&al&&c&&"string"==typeof c&&b.setHeader(z.NEXT_CACHE_TAGS_HEADER,c);let d=q.segmentData.get(ax);return void 0!==d?(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:y.default.fromStatic(d,u.RSC_CONTENT_TYPE_HEADER),cacheControl:o.cacheControl}):(b.statusCode=204,(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:y.default.EMPTY,cacheControl:o.cacheControl}))}let r=(0,h.getRequestMeta)(a,"onCacheEntry");if(r&&await r({...o,value:{...o.value,kind:"PAGE"}},{url:(0,h.getRequestMeta)(a,"initURL")}))return null;if(p&&av)throw Object.defineProperty(Error("Invariant: postponed state should not be present on a resume request"),"__NEXT_ERROR_CODE",{value:"E396",enumerable:!1,configurable:!0});if(q.headers){let a={...q.headers};for(let[c,d]of(O&&al||delete a[z.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let s=null==(g=q.headers)?void 0:g[z.NEXT_CACHE_TAGS_HEADER];if(O&&al&&s&&"string"==typeof s&&b.setHeader(z.NEXT_CACHE_TAGS_HEADER,s),!q.status||aq&&as||(b.statusCode=q.status),!O&&q.status&&G.RedirectStatusCode[q.status]&&aq&&(b.statusCode=200),p&&b.setHeader(u.NEXT_DID_POSTPONE_HEADER,"1"),aq&&!aa){if(void 0===q.rscData){if(q.postponed)throw Object.defineProperty(Error("Invariant: Expected postponed to be undefined"),"__NEXT_ERROR_CODE",{value:"E372",enumerable:!1,configurable:!0});return(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:q.html,cacheControl:aw?{revalidate:0,expire:void 0}:o.cacheControl})}return(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:y.default.fromStatic(q.rscData,u.RSC_CONTENT_TYPE_HEADER),cacheControl:o.cacheControl})}let t=q.html;if(!p||O||aq)return(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:t,cacheControl:o.cacheControl});if(at)return t.push(new ReadableStream({start(a){a.enqueue(A.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:t,cacheControl:{revalidate:0,expire:void 0}});let v=new TransformStream;return t.push(v.readable),m({span:c,postponed:q.postponed,fallbackRouteParams:null}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==w.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(v.writable)}).catch(a=>{v.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:t,cacheControl:{revalidate:0,expire:void 0}})};if(!aG)return await aF.withPropagatedContext(a.headers,()=>aF.trace(i.BaseServerSpan.handleRequest,{spanName:`${aE} ${a.url}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aE,"http.target":a.url}},p));await p(aG)}catch(b){throw b instanceof C.NoFallbackError||await L.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"render",revalidateReason:(0,f.c)({isRevalidate:al,isOnDemandRevalidate:ai})},ad),b}}},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3535:(a,b,c)=>{"use strict";let d=c(3033),e=c(9294),f=c(6906),g=c(787),h=c(1938),i=c(9168),j=c(9290);c(3036);new WeakMap;(0,g.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`draftMode()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E377",enumerable:!1,configurable:!0})})},4230:(a,b,c)=>{"use strict";Object.defineProperty(b,"U",{enumerable:!0,get:function(){return n}});let d=c(8706),e=c(3675),f=c(9294),g=c(3033),h=c(6906),i=c(1938),j=c(2831),k=c(787),l=c(1716),m=c(9290);function n(){let a="cookies",b=f.workAsyncStorage.getStore(),c=g.workUnitAsyncStorage.getStore();if(b){if(c&&"after"===c.phase&&!(0,l.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${b.route} used "cookies" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E88",enumerable:!1,configurable:!0});if(b.forceStatic)return p(d.RequestCookiesAdapter.seal(new e.RequestCookies(new Headers({}))));if(b.dynamicShouldError)throw Object.defineProperty(new i.StaticGenBailoutError(`Route ${b.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`cookies\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E549",enumerable:!1,configurable:!0});if(c)switch(c.type){case"cache":let f=Object.defineProperty(Error(`Route ${b.route} used "cookies" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E398",enumerable:!1,configurable:!0});throw Error.captureStackTrace(f,n),b.invalidDynamicUsageError??=f,f;case"unstable-cache":throw Object.defineProperty(Error(`Route ${b.route} used "cookies" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E157",enumerable:!1,configurable:!0});case"prerender":var k=b,q=c;let g=o.get(q);if(g)return g;let r=(0,j.makeHangingPromise)(q.renderSignal,k.route,"`cookies()`");return o.set(q,r),r;case"prerender-client":let s="`cookies`";throw Object.defineProperty(new m.InvariantError(`${s} must not be used within a client component. Next.js should be preventing ${s} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,h.postponeWithTracking)(b.route,a,c.dynamicTracking);case"prerender-legacy":return(0,h.throwToInterruptStaticGeneration)(a,b,c);case"prerender-runtime":return(0,h.delayUntilRuntimeStage)(c,function(a){let b=o.get(a);if(b)return b;let c=Promise.resolve(a);return o.set(a,c),c}(c.cookies));case"private-cache":return p(c.cookies);case"request":return(0,h.trackDynamicDataInDynamicRender)(c),p((0,d.areCookiesMutableInCurrentPhase)(c)?c.userspaceMutableCookies:c.cookies)}}(0,g.throwForMissingRequestStore)(a)}c(3036);let o=new WeakMap;function p(a){let b=o.get(a);if(b)return b;let c=Promise.resolve(a);return o.set(a,c),Object.defineProperties(c,{[Symbol.iterator]:{value:a[Symbol.iterator]?a[Symbol.iterator].bind(a):q.bind(a)},size:{get:()=>a.size},get:{value:a.get.bind(a)},getAll:{value:a.getAll.bind(a)},has:{value:a.has.bind(a)},set:{value:a.set.bind(a)},delete:{value:a.delete.bind(a)},clear:{value:"function"==typeof a.clear?a.clear.bind(a):r.bind(a,c)},toString:{value:a.toString.bind(a)}}),c}function q(){return this.getAll().map(a=>[a.name,a]).values()}function r(a){for(let a of this.getAll())this.delete(a.name);return a}(0,k.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`cookies()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E223",enumerable:!1,configurable:!0})})},4427:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(7954).registerClientReference)(function(){throw Error("Attempted to call the default export of \"C:\\\\Users\\\\abd_b\\\\OneDrive\\\\Desktop\\\\COSMIC AI-Risk Dashboard\\\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\\\application\\\\saas-app\\\\src\\\\components\\\\LogoutButton.jsx\" from the server, but it's 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.")},"C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\components\\LogoutButton.jsx","default")},4589:(a,b,c)=>{Promise.resolve().then(c.bind(c,4427))},4603:(a,b,c)=>{"use strict";let d=c(7675),e=c(9294),f=c(3033),g=c(6906),h=c(1938),i=c(2831),j=c(787),k=c(1716),l=c(9290);c(3036);new WeakMap;(0,j.createDedupedByCallsiteServerErrorLoggerDev)(function(a,b){let c=a?`Route "${a}" `:"This route ";return Object.defineProperty(Error(`${c}used ${b}. \`headers()\` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`),"__NEXT_ERROR_CODE",{value:"E277",enumerable:!1,configurable:!0})})},5511:a=>{"use strict";a.exports=require("crypto")},5883:()=>{},6330:a=>{"use strict";a.exports=require("@prisma/client")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},7275:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,4160,23)),Promise.resolve().then(c.t.bind(c,1603,23)),Promise.resolve().then(c.t.bind(c,8495,23)),Promise.resolve().then(c.t.bind(c,5170,23)),Promise.resolve().then(c.t.bind(c,7526,23)),Promise.resolve().then(c.t.bind(c,8922,23)),Promise.resolve().then(c.t.bind(c,9234,23)),Promise.resolve().then(c.t.bind(c,2263,23)),Promise.resolve().then(c.bind(c,2146))},7964:(a,b,c)=>{"use strict";let{PrismaClient:d}=c(6330);a.exports={prisma:globalThis.__cosmicPrisma||new d}},8354:a=>{"use strict";a.exports=require("util")},8559:(a,b,c)=>{"use strict";let{prisma:d}=c(7964),{randomBytes:e}=c(5511),f=c(7082);async function g(a){return f.hash(a,12)}async function h(a,b){return!!b&&f.compare(a,b)}async function i(a){let b=e(48).toString("hex");return await d.session.create({data:{userId:a,token:b,expiresAt:new Date(Date.now()+6048e5)}})}async function j(a){if(!a)return null;let b=await d.session.findUnique({where:{token:a},include:{user:{include:{memberships:{where:{status:"ACTIVE"},include:{organization:!0,role:!0}}}}}});return!b||b.expiresAt{}),null):b}async function k(a){let b=await j(a);return b?b.user:null}a.exports={signup:async function({email:a,displayName:b,password:c}){if(!a||!c){let a=Error("Email and password are required");throw a.status=400,a}if(await d.user.findUnique({where:{email:a}})){let a=Error("Email already registered");throw a.status=409,a}let e=await g(c),f=await d.user.create({data:{email:a,displayName:b||a.split("@")[0],passwordHash:e,emailVerifiedAt:new Date}}),h=(b||a.split("@")[0]).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")+"-"+Date.now().toString(36),j=await d.role.upsert({where:{code:"owner"},update:{},create:{code:"owner",name:"Owner",permissions:["*"],system:!0}}),k=await d.organization.create({data:{name:(b||a.split("@")[0])+"'s Organization",slug:h,status:"TRIAL",planCode:"pilot",manualBilling:!0}});await d.membership.create({data:{organizationId:k.id,userId:f.id,roleId:j.id,status:"ACTIVE"}}),await d.subscription.create({data:{organizationId:k.id,source:"MANUAL",status:"TRIALING",planCode:"pilot",userLimit:5,projectLimit:3,reportLimitMonthly:25,integrationLimit:2,adminOverride:!1}}).catch(()=>{});let l=await d.workspace.create({data:{organizationId:k.id,name:"Default Workspace",slug:"default-workspace",type:"B2B_TEAM",status:"TRIAL"}});await d.project.create({data:{workspaceId:l.id,name:"My Project",projectType:"AI-Enabler",status:"Active",riskAppetite:50,description:"Project created during signup"}});let m=await i(f.id);return{user:f,session:m}},login:async function({email:a,password:b}){if(!a||!b){let a=Error("Email and password are required");throw a.status=400,a}let c=await d.user.findUnique({where:{email:a},include:{memberships:{where:{status:"ACTIVE"},include:{organization:!0,role:!0}}}});if(!c||!await h(b,c.passwordHash)){let a=Error("Invalid email or password");throw a.status=401,a}await d.user.update({where:{id:c.id},data:{lastLoginAt:new Date}});let e=await i(c.id);return{user:c,session:e}},logout:async function(a){a&&await d.session.deleteMany({where:{token:a}}).catch(()=>{})},getSession:j,getActorFromSession:k,createSession:i,SESSION_DURATION_MS:6048e5}},8706:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),!function(a,b){for(var c in b)Object.defineProperty(a,c,{enumerable:!0,get:b[c]})}(b,{MutableRequestCookiesAdapter:function(){return l},ReadonlyRequestCookiesError:function(){return g},RequestCookiesAdapter:function(){return h},appendMutableCookies:function(){return k},areCookiesMutableInCurrentPhase:function(){return n},createCookiesWithMutableAccessCheck:function(){return m},getModifiedCookieValues:function(){return j},responseCookiesToRequestCookies:function(){return p}});let d=c(3675),e=c(3036),f=c(9294);class g extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options")}static callable(){throw new g}}class h{static seal(a){return new Proxy(a,{get(a,b,c){switch(b){case"clear":case"delete":case"set":return g.callable;default:return e.ReflectAdapter.get(a,b,c)}}})}}let i=Symbol.for("next.mutated.cookies");function j(a){let b=a[i];return b&&Array.isArray(b)&&0!==b.length?b:[]}function k(a,b){let c=j(b);if(0===c.length)return!1;let e=new d.ResponseCookies(a),f=e.getAll();for(let a of c)e.set(a);for(let a of f)e.set(a);return!0}class l{static wrap(a,b){let c=new d.ResponseCookies(new Headers);for(let b of a.getAll())c.set(b);let g=[],h=new Set,j=()=>{let a=f.workAsyncStorage.getStore();if(a&&(a.pathWasRevalidated=!0),g=c.getAll().filter(a=>h.has(a.name)),b){let a=[];for(let b of g){let c=new d.ResponseCookies(new Headers);c.set(b),a.push(c.toString())}b(a)}},k=new Proxy(c,{get(a,b,c){switch(b){case i:return g;case"delete":return function(...b){h.add("string"==typeof b[0]?b[0]:b[0].name);try{return a.delete(...b),k}finally{j()}};case"set":return function(...b){h.add("string"==typeof b[0]?b[0]:b[0].name);try{return a.set(...b),k}finally{j()}};default:return e.ReflectAdapter.get(a,b,c)}}});return k}}function m(a){let b=new Proxy(a.mutableCookies,{get(c,d,f){switch(d){case"delete":return function(...d){return o(a,"cookies().delete"),c.delete(...d),b};case"set":return function(...d){return o(a,"cookies().set"),c.set(...d),b};default:return e.ReflectAdapter.get(c,d,f)}}});return b}function n(a){return"action"===a.phase}function o(a,b){if(!n(a))throw new g}function p(a){let b=new d.RequestCookies(new Headers);for(let c of a.getAll())b.set(c);return b}},9121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9458:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>i,dynamic:()=>h});var d=c(5338),e=c(8559),f=c(4230);c(4603),c(3535);var g=c(4427);let h="force-dynamic";async function i(){let a=await (0,f.U)(),b=a.get("cosmic_session")?.value,c=b?await (0,e.getActorFromSession)(b):null;return(0,d.jsxs)("main",{className:"shell",children:[(0,d.jsxs)("header",{className:"topbar",children:[(0,d.jsx)("div",{children:(0,d.jsx)("div",{className:"brand",children:"COSMIC AI-Risk SaaS"})}),(0,d.jsx)("nav",{className:"nav","aria-label":"Main navigation",children:c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"muted",children:c.displayName}),(0,d.jsx)("a",{href:"/dashboard",children:"Dashboard"}),(0,d.jsx)(g.default,{className:"logout-link",children:"Sign out"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("a",{href:"/login",children:"Sign in"}),(0,d.jsx)("a",{href:"/signup",children:"Create account"})]})})]}),(0,d.jsxs)("section",{className:"hero",style:{textAlign:"center",padding:"80px 24px"},children:[(0,d.jsx)("h1",{style:{fontSize:48,letterSpacing:"-0.05em",marginBottom:16},children:"COSMIC AI-Risk SaaS"}),(0,d.jsx)("p",{className:"muted",style:{fontSize:20,maxWidth:600,margin:"0 auto 32px"},children:"Multi-tenant AI risk governance platform. Measure, mitigate, and govern AI project risks across your organization."}),(0,d.jsx)("div",{style:{display:"flex",gap:12,justifyContent:"center"},children:c?(0,d.jsx)("a",{href:"/dashboard",className:"button primary",style:{padding:"12px 32px",fontSize:16},children:"Open dashboard"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("a",{href:"/login",className:"button primary",style:{padding:"12px 32px",fontSize:16},children:"Sign in"}),(0,d.jsx)("a",{href:"/signup",className:"button secondary",style:{padding:"12px 32px",fontSize:16},children:"Create account"})]})})]}),(0,d.jsx)("section",{className:"content",children:(0,d.jsxs)("div",{className:"grid",style:{gridTemplateColumns:"repeat(auto-fit, minmax(280px, 1fr))"},children:[(0,d.jsxs)("div",{className:"panel",children:[(0,d.jsx)("h3",{children:"Multi-tenant"}),(0,d.jsx)("p",{className:"muted",children:"Organizations, workspaces, and role-based access control for enterprise teams."})]}),(0,d.jsxs)("div",{className:"panel",children:[(0,d.jsx)("h3",{children:"AI Risk Scoring"}),(0,d.jsx)("p",{className:"muted",children:"COSMIC risk engine with probability, impact, and detectability scoring across governance dimensions."})]}),(0,d.jsxs)("div",{className:"panel",children:[(0,d.jsx)("h3",{children:"Deployment Gates"}),(0,d.jsx)("p",{className:"muted",children:"Nine-criteria gate evaluation with reviewer decisions and full audit trail."})]}),(0,d.jsxs)("div",{className:"panel",children:[(0,d.jsx)("h3",{children:"PM Integrations"}),(0,d.jsx)("p",{className:"muted",children:"Trello, Jira, Asana, and Microsoft Planner sync with OAuth-ready live connectors."})]})]})})]})}},9902:a=>{"use strict";a.exports=require("path")}};var b=require("../webpack-runtime.js");b.C(a);var c=b.X(0,[5873,7082,4792],()=>b(b.s=2964));module.exports=c})();