import s from"@markdoc/markdoc";import{getPublicEnvVariables as u}from"../../utils/envs/get-public-env-variables.js";import{transformMdAst as i}from"./runtime-transform";const v=async(A,o,t,e)=>{const{ast:n,frontmatter:r,props:l,editPage:f,lastModified:m}=o,{headings:d,renderableAst:p}=await i(s.Ast.fromJSON(n),{partials:t.partials,variables:{frontmatter:r,...t.variables,env:u()}},e.serverOutDir);return Array.isArray(r.banner)&&(r.banner=await Promise.all(r.banner.map(async a=>{if(a.ast){const{renderableAst:b}=await i(s.Ast.fromJSON(a.ast),{partials:{},variables:{}},e.serverOutDir);return{...a,ast:b}}return a}))),{...l,ast:p,headings:d,frontmatter:r,editPage:f,lastModified:m}};var P=v;export{P as default};
