"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.Default=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");class Default{static servicePrincipal(serviceFqn,region,urlSuffix){try{jsiiDeprecationWarnings().print("aws-cdk-lib.region_info.Default#servicePrincipal","- Service principals are now globally `<SERVICE>.amazonaws.com`, use iam.ServicePrincipal instead.")}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.servicePrincipal),error}const serviceName=extractSimpleName(serviceFqn);if(!serviceName)return serviceFqn;function determineConfiguration(service){function universal(s){return`${s}.amazonaws.com`}function partitional(s,_,u){return`${s}.${u}`}function regional(s,r){return`${s}.${r}.amazonaws.com`}function regionalPartitional(s,r,u){return`${s}.${r}.${u}`}const US_ISO_EXCEPTIONS=new Set(["cloudhsm","config","states","workspaces"]);if(region.startsWith("us-iso-")&&US_ISO_EXCEPTIONS.has(service))switch(service){case"states":return universal;default:return partitional}const US_ISOB_EXCEPTIONS=new Set(["dms","states"]);if(region.startsWith("us-isob-")&&US_ISOB_EXCEPTIONS.has(service))switch(service){case"states":return universal;default:return partitional}switch(service){case"codedeploy":return region.startsWith("cn-")?regionalPartitional:region.startsWith("us-iso")?universal:regional;case"logs":return regionalPartitional;case"states":return regional;case"elasticmapreduce":return region.startsWith("cn-")?partitional:universal;default:return universal}}return determineConfiguration(serviceName)(serviceName,region,urlSuffix)}constructor(){}}exports.Default=Default,_a=JSII_RTTI_SYMBOL_1,Default[_a]={fqn:"aws-cdk-lib.region_info.Default",version:"2.159.0"},Default.VPC_ENDPOINT_SERVICE_NAME_PREFIX="com.amazonaws.vpce";function extractSimpleName(serviceFqn){const matches=serviceFqn.match(/^([^.]+)(?:(?:\.amazonaws\.com(?:\.cn)?)|(?:\.c2s\.ic\.gov)|(?:\.sc2s\.sgov\.gov))?$/);return matches?matches[1]:void 0}
