function e(){return'Page with `dynamic = "error"` used a dynamic API. This page was expected to be fully static, but headers(), cookies(), or searchParams was accessed. Remove the dynamic API usage or change the dynamic config to "auto" or "force-dynamic".'}function t(e,t){return`Route ${e??`unknown route`} with \`dynamic = "error"\` couldn't be rendered statically because it used ${t??`a dynamic request API`}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`}function n(n){let r={headers:new Headers,cookies:new Map,draftModeEnabled:n.draftModeEnabled,draftModeSecret:n.draftModeSecret};return n.dynamicConfig===`force-static`&&(r.forceStatic=!0),n.dynamicConfig===`error`&&(r.accessError=Error(n.routeKind===`route`?t(n.routePattern):e())),r}export{n as createStaticGenerationHeadersContext,t as getAppRouteStaticGenerationErrorMessage};