const{getHandlebarTemplate:getHandlebarTemplate,safeString:safeString}=require("./handlebar-helpers"),{readFile:readFile,writeFile:writeFile,getAppVariablesFilePath:getAppVariablesFilePath,formatContents:formatContents,getCodegenPath:getCodegenPath}=require("./wm-utils"),{generatePageExpressions:generatePageExpressions}=require("./expr-parser-utils"),generateAppVariableExpressions=async(e,a,t)=>{const r=await readFile(`${getCodegenPath()}/dependencies/app.component.html`,"utf-8")||"",s=safeString(t?generatePageExpressions(r,e):""),n=getHandlebarTemplate("component-expressions")({expressions:s});await writeFile(`${a}/src/app/app.component.expressions.ts`,formatContents(n,"javascript"))},generateAppVariables=async(e,a,t)=>{const r=getHandlebarTemplate("component-variables");let s=await readFile(getAppVariablesFilePath(e),"utf8")||"{}";const n=r({variables:safeString(s)});await writeFile(`${a}/src/app/app.component.variables.ts`,n),await generateAppVariableExpressions(s,a,t)};module.exports={generateAppVariables:generateAppVariables};