"use strict";var _a,_b;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnRefElement=exports.CfnElement=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),cxschema=require("../../cloud-assembly-schema"),constructs_1=require("constructs"),lazy_1=require("./lazy"),CFN_ELEMENT_SYMBOL=Symbol.for("@aws-cdk/core.CfnElement");class CfnElement extends constructs_1.Construct{constructor(scope,id){super(scope,id),Object.defineProperty(this,CFN_ELEMENT_SYMBOL,{value:!0}),this.stack=stack_1.Stack.of(this),this.logicalId=lazy_1.Lazy.uncachedString({produce:()=>this.synthesizeLogicalId()},{displayHint:`${notTooLong(constructs_1.Node.of(this).path)}.LogicalID`}),this.node.addMetadata(cxschema.ArtifactMetadataEntryType.LOGICAL_ID,this.logicalId,{traceFromFunction:this.constructor})}static isCfnElement(x){return CFN_ELEMENT_SYMBOL in x}overrideLogicalId(newLogicalId){this._logicalIdOverride=newLogicalId}get creationStack(){const trace=constructs_1.Node.of(this).metadata.find(md=>md.type===cxschema.ArtifactMetadataEntryType.LOGICAL_ID).trace;if(!trace)return[];return filterStackTrace(trace);function filterStackTrace(stack){const result=Array.of(...stack);for(;result.length>0&&shouldFilter(result[result.length-1]);)result.pop();return result.length===0?stack:result}function shouldFilter(str){return str.match(/[^(]+\(internal\/.*/)!==null}}synthesizeLogicalId(){return this._logicalIdOverride?this._logicalIdOverride:this.stack.getLogicalId(this)}}exports.CfnElement=CfnElement,_a=JSII_RTTI_SYMBOL_1,CfnElement[_a]={fqn:"aws-cdk-lib.CfnElement",version:"2.24.1"};class CfnRefElement extends CfnElement{get ref(){return token_1.Token.asString(cfn_reference_1.CfnReference.for(this,"Ref"))}}exports.CfnRefElement=CfnRefElement,_b=JSII_RTTI_SYMBOL_1,CfnRefElement[_b]={fqn:"aws-cdk-lib.CfnRefElement",version:"2.24.1"};function notTooLong(x){return x.length<100?x:x.slice(0,47)+"..."+x.slice(-47)}const cfn_reference_1=require("./private/cfn-reference"),stack_1=require("./stack"),token_1=require("./token");
//# sourceMappingURL=cfn-element.js.map
