"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.attachCustomSynthesis=exports.App=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),cxapi=require("../../cx-api"),synthesis_1=require("./private/synthesis"),tree_metadata_1=require("./private/tree-metadata"),stage_1=require("./stage"),APP_SYMBOL=Symbol.for("@aws-cdk/core.App");class App extends stage_1.Stage{constructor(props={}){var _b,_c,_d;super(void 0,"",{outdir:(_b=props.outdir)!==null&&_b!==void 0?_b:process.env[cxapi.OUTDIR_ENV]});try{jsiiDeprecationWarnings.aws_cdk_lib_AppProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.constructor),error}Object.defineProperty(this,APP_SYMBOL,{value:!0}),this.loadContext(props.context),props.stackTraces===!1&&this.node.setContext(cxapi.DISABLE_METADATA_STACK_TRACE,!0);const analyticsReporting=(_c=props.analyticsReporting)!==null&&_c!==void 0?_c:props.runtimeInfo;analyticsReporting!==void 0&&this.node.setContext(cxapi.ANALYTICS_REPORTING_ENABLED_CONTEXT,analyticsReporting),((_d=props.autoSynth)!==null&&_d!==void 0?_d:cxapi.OUTDIR_ENV in process.env)&&process.once("beforeExit",()=>this.synth()),(props.treeMetadata===void 0||props.treeMetadata)&&new tree_metadata_1.TreeMetadata(this)}static isApp(obj){return APP_SYMBOL in obj}loadContext(defaults={}){for(const[k,v]of Object.entries(defaults))this.node.setContext(k,v);const contextJson=process.env[cxapi.CONTEXT_ENV],contextFromEnvironment=contextJson?JSON.parse(contextJson):{};for(const[k,v]of Object.entries(contextFromEnvironment))this.node.setContext(k,v)}}exports.App=App,_a=JSII_RTTI_SYMBOL_1,App[_a]={fqn:"aws-cdk-lib.App",version:"2.24.1"};function attachCustomSynthesis(construct,synthesis){synthesis_1.addCustomSynthesis(construct,synthesis)}exports.attachCustomSynthesis=attachCustomSynthesis;
//# sourceMappingURL=app.js.map
