"use strict";var _a,_b;Object.defineProperty(exports,"__esModule",{value:!0}),exports.FactName=exports.Fact=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),aws_entities_1=require("./aws-entities");class Fact{constructor(){throw new Error("Use the static methods of Fact instead!")}static get regions(){return Array.from(aws_entities_1.AWS_REGIONS)}static find(region,name){const regionFacts=this.database[region];return regionFacts&&regionFacts[name]}static requireFact(region,name){const foundFact=this.find(region,name);if(!foundFact)throw new Error(`No fact ${name} could be found for region: ${region} and name: ${name}`);return foundFact}static register(fact,allowReplacing=!1){try{jsiiDeprecationWarnings.aws_cdk_lib_region_info_IFact(fact)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.register),error}const regionFacts=this.database[fact.region]||(this.database[fact.region]={});if(fact.name in regionFacts&&regionFacts[fact.name]!==fact.value&&!allowReplacing)throw new Error(`Region ${fact.region} already has a fact ${fact.name}, with value ${regionFacts[fact.name]}`);fact.value!==void 0&&(regionFacts[fact.name]=fact.value)}static unregister(region,name,value){const regionFacts=this.database[region]||{};if(name in regionFacts&&value&&regionFacts[name]!==value)throw new Error(`Attempted to remove ${name} from ${region} with value ${value}, but the fact's value is ${regionFacts[name]}`);delete regionFacts[name]}}exports.Fact=Fact,_a=JSII_RTTI_SYMBOL_1,Fact[_a]={fqn:"aws-cdk-lib.region_info.Fact",version:"2.46.0"},Fact.database={};class FactName{static cloudwatchLambdaInsightsVersion(version,arch){return`cloudwatch-lambda-insights-version:${version.split(".").join("_")+`_${arch??"x86_64"}`}`}static servicePrincipal(service){return`service-principal:${service.replace(/\.amazonaws\.com(\.cn)?$/,"")}`}}exports.FactName=FactName,_b=JSII_RTTI_SYMBOL_1,FactName[_b]={fqn:"aws-cdk-lib.region_info.FactName",version:"2.46.0"},FactName.PARTITION="partition",FactName.DOMAIN_SUFFIX="domainSuffix",FactName.CDK_METADATA_RESOURCE_AVAILABLE="cdk:metadata-resource:available",FactName.S3_STATIC_WEBSITE_ENDPOINT="s3-static-website:endpoint",FactName.S3_STATIC_WEBSITE_ZONE_53_HOSTED_ZONE_ID="s3-static-website:route-53-hosted-zone-id",FactName.EBS_ENV_ENDPOINT_HOSTED_ZONE_ID="ebs-environment:route-53-hosted-zone-id",FactName.VPC_ENDPOINT_SERVICE_NAME_PREFIX="vpcEndpointServiceNamePrefix",FactName.ELBV2_ACCOUNT="elbv2Account",FactName.DLC_REPOSITORY_ACCOUNT="dlcRepositoryAccount",FactName.APPMESH_ECR_ACCOUNT="appMeshRepositoryAccount",FactName.FIREHOSE_CIDR_BLOCK="firehoseCidrBlock";
//# sourceMappingURL=fact.js.map
