"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CloudFrontTarget=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),core_1=require("../../core");class CloudFrontTarget{constructor(distribution){this.distribution=distribution;try{jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudfront_IDistribution(distribution)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.constructor),error}}static getHostedZoneId(scope){var _b;const mappingName="AWSCloudFrontPartitionHostedZoneIdMap",scopeStack=core_1.Stack.of(scope);return((_b=scopeStack.node.tryFindChild(mappingName))!==null&&_b!==void 0?_b:new core_1.CfnMapping(scopeStack,mappingName,{mapping:{aws:{zoneId:"Z2FDTNDATAQYW2"},["aws-cn"]:{zoneId:"Z3RFFRIM2A3IF5"}}})).findInMap(core_1.Aws.PARTITION,"zoneId")}bind(_record,_zone){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_route53_IRecordSet(_record),jsiiDeprecationWarnings.aws_cdk_lib_aws_route53_IHostedZone(_zone)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return{hostedZoneId:CloudFrontTarget.getHostedZoneId(this.distribution),dnsName:this.distribution.distributionDomainName}}}exports.CloudFrontTarget=CloudFrontTarget,_a=JSII_RTTI_SYMBOL_1,CloudFrontTarget[_a]={fqn:"aws-cdk-lib.aws_route53_targets.CloudFrontTarget",version:"2.24.1"},CloudFrontTarget.CLOUDFRONT_ZONE_ID="Z2FDTNDATAQYW2";
//# sourceMappingURL=cloudfront-target.js.map
