fjall 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/.bundled CHANGED
@@ -1,3 +1,3 @@
1
- bundled at 2026-05-26T03:12:15.932Z
1
+ bundled at 2026-05-26T22:02:00.294Z
2
2
  bundle size: 3067198 bytes
3
- cli version: 2.4.0
3
+ cli version: 2.4.1
@@ -35945,7 +35945,7 @@
35945
35945
  "imports": [],
35946
35946
  "exports": [],
35947
35947
  "inputs": {},
35948
- "bytes": 9069939
35948
+ "bytes": 9069940
35949
35949
  },
35950
35950
  "bin/fjall.bundle.js": {
35951
35951
  "imports": [
@@ -112,7 +112,7 @@ ${t}`,AI=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),$I=Objec
112
112
  `)}}initialiseDebugStream(){if(!this.debugLogStream)try{qg(this.config.debugLogDir)||Xg(this.config.debugLogDir,{recursive:!0}),this.fileRotator.rotateIfNeeded(this.debugLogPath,this.config.maxFileSize),this.debugLogStream=Uc(this.debugLogPath,{flags:"a"})}catch(t){process.stderr.write(`[fjall] Debug log init failed: ${t instanceof Error?t.message:String(t)}
113
113
  `)}}setDebugEnabled(t){this.debugEnabled=t}write(t,n){this.isClosing||(this.initialised||this.initialise(),this.buffer.push(t),this.debugEnabled&&n&&this.debugBuffer.push(t),this.buffer.length>=this.config.maxBufferSize&&this.flush())}flushBuffer(t,n,i){if(t.length===0||!n)return{buffer:t,stream:n};let r=n;this.fileRotator.needsRotation(i,this.config.maxFileSize)&&(r.end(),this.fileRotator.rotate(i),r=Uc(i,{flags:"a"}));for(let o of t)r.write(JSON.stringify(o)+`
114
114
  `);return{buffer:[],stream:r}}flush(){let t=this.flushBuffer(this.buffer,this.mainLogStream,this.mainLogPath);this.buffer=t.buffer,this.mainLogStream=t.stream;let n=this.flushBuffer(this.debugBuffer,this.debugLogStream,this.debugLogPath);this.debugBuffer=n.buffer,this.debugLogStream=n.stream}close(){this.isClosing=!0,this.flush(),this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.mainLogStream&&(this.mainLogStream.end(),this.mainLogStream=null),this.debugLogStream&&(this.debugLogStream.end(),this.debugLogStream=null),this.buffer=[],this.debugBuffer=[],this.initialised=!1,this.isClosing=!1}};import{createWriteStream as gT,existsSync as vT,mkdirSync as bT}from"fs";import{join as Yg}from"path";var er={trace:0,debug:1,info:2,warn:3,error:4},Ke={MAX_FILE_SIZE:10*1024*1024,MAX_FILES:5,MAX_BUFFER_SIZE:100,FLUSH_INTERVAL_MS:500,LOG_FILENAME:"fjall.jsonl",DEBUG_LOG_FILENAME:"fjall-debug.jsonl"};import{join as fT}from"path";import{homedir as hT}from"os";function $r(){let e=process.env.FJALL_LOG_DIR;return e!==void 0&&e!==""?e:fT(hT(),".fjall","logs")}var Bn=class{mainLogger;appName;operationType;logStream=null;logPath;deploymentId;buffer=[];flushInterval=null;isClosing=!1;maxBufferSize=Ke.MAX_BUFFER_SIZE;constructor(t,n,i){this.mainLogger=t,this.appName=n,this.operationType=i,this.deploymentId=`${i}-${Date.now()}`;let r=$r(),o=Yg(r,"deployments",n);vT(o)||bT(o,{recursive:!0});let a=new Date().toISOString().replace(/[:.]/g,"-"),s=`${i}-${a}.jsonl`;this.logPath=Yg(o,s);try{this.logStream=gT(this.logPath,{flags:"a"}),this.flushInterval=setInterval(()=>this.flush(),Ke.FLUSH_INTERVAL_MS),this.info("DeploymentLogger","Deployment logging initialised",{appName:n,operationType:i,deploymentId:this.deploymentId,logPath:this.logPath})}catch{}}log(t,n,i,r,o,a){if(this.isClosing)return;let s={timestamp:new Date().toISOString(),level:t,component:n,message:i,correlationId:this.deploymentId,...r&&Object.keys(r).length>0&&{data:r},...o&&{stackName:o},...a&&{phase:a}};this.buffer.push(s),this.mainLogger.logWithCorrelation(t,n,i,this.deploymentId,r,o,a),this.buffer.length>=this.maxBufferSize&&this.flush()}flush(){if(!(this.buffer.length===0||!this.logStream)){for(let t of this.buffer)this.logStream.write(JSON.stringify(t)+`
115
- `);this.buffer=[]}}info(t,n,i){this.log("info",t,n,i)}warn(t,n,i){this.log("warn",t,n,i)}error(t,n,i){this.log("error",t,n,i)}debug(t,n,i){this.log("debug",t,n,i)}stackEvent(t,n,i,r){this.log("info","StackDeployment",i,r,t,n)}dockerEvent(t,n){this.log("info","DockerOperation",t,{percentage:n})}ecsEvent(t,n,i){this.log("info","ECSDeployment",t,{percentage:n,taskCount:i})}close(){this.isClosing=!0,this.flush(),this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.logStream&&(this.logStream.end(),this.logStream=null),this.buffer=[],this.isClosing=!1}getLogPath(){return this.logPath}getDeploymentId(){return this.deploymentId}};var So=class e{static instance=null;config;debugEnabled;traceEnabled;minLevel;fileWriter;mainLogPath;debugLogPath;constructor(){let t=$r(),n=Fc(t,"debug"),i=this.parseEnvInt("FJALL_LOG_MAX_SIZE",Ke.MAX_FILE_SIZE),r=this.parseEnvInt("FJALL_LOG_MAX_FILES",Ke.MAX_FILES);this.config={logDir:t,debugLogDir:n,maxFileSize:i,maxFiles:r,maxBufferSize:Ke.MAX_BUFFER_SIZE,flushIntervalMs:Ke.FLUSH_INTERVAL_MS},this.mainLogPath=Fc(t,Ke.LOG_FILENAME),this.debugLogPath=Fc(n,Ke.DEBUG_LOG_FILENAME),this.debugEnabled=process.env.FJALL_DEBUG==="true"||process.env.FJALL_TRACE==="true"||process.argv.includes("--verbose")||process.argv.includes("-v"),this.traceEnabled=process.env.FJALL_TRACE==="true";let o=process.env.FJALL_LOG_LEVEL?.toLowerCase();o&&o in er?this.minLevel=o:this.traceEnabled?this.minLevel="trace":this.debugEnabled?this.minLevel="debug":this.minLevel="info",this.fileWriter=new yo(this.config,this.mainLogPath,this.debugLogPath,this.debugEnabled)}parseEnvInt(t,n){let i=process.env[t];if(i){let r=parseInt(i,10);if(!isNaN(r)&&r>0)return r}return n}static getInstance(){return e.instance||(e.instance=new e),e.instance}shouldLog(t){return er[t]>=er[this.minLevel]}createEntry(t,n,i,r,o,a,s){return{timestamp:new Date().toISOString(),level:t,component:n,message:i,...o&&{correlationId:o},...r&&Object.keys(r).length>0&&{data:r},...a&&{stackName:a},...s&&{phase:s}}}log(t,n,i,r,o,a,s){if(!this.shouldLog(t))return;let u=this.createEntry(t,n,i,r,o,a,s),l=t==="debug"||t==="trace";this.fileWriter.write(u,l),this.writeConsole(u)}writeConsole(t){if(Me.shouldSuppressOutput||Me.isNonInteractive)return;let n=this.getConsolePrefix(t.level),i=`[${t.component}]`,r=`${n} ${i} ${t.message}`;t.level==="error"?console.error(r):t.level==="warn"?console.warn(r):console.log(r)}getConsolePrefix(t){switch(t){case"error":return"[ERROR]";case"warn":return"[WARN]";case"info":return"[INFO]";case"debug":return"[DEBUG]";case"trace":return"[TRACE]"}}error(t,n,i){this.log("error",t,n,i)}warn(t,n,i){this.log("warn",t,n,i)}info(t,n,i){this.log("info",t,n,i)}debug(t,n,i){this.log("debug",t,n,i)}trace(t,n,i){this.log("trace",t,n,i)}isDebugEnabled(){return this.debugEnabled}isTraceEnabled(){return this.traceEnabled}enableDebug(){this.debugEnabled=!0,er[this.minLevel]>er.debug&&(this.minLevel="debug"),this.fileWriter.setDebugEnabled(!0),this.fileWriter.isInitialised&&this.fileWriter.initialiseDebugStream()}withCorrelation(t){return new Ar(this,t)}forDeployment(t,n="deploy"){return new Bn(this,t,n)}close(){this.fileWriter.close()}getLogPath(){return this.mainLogPath}getDebugLogPath(){return this.debugLogPath}getLogDir(){return this.config.logDir}logWithCorrelation(t,n,i,r,o,a,s){this.log(t,n,i,o,r,a,s)}static reset(){e.instance&&(e.instance.close(),e.instance=null)}};var bo=So.getInstance();function pt(e){return e.replace(/[-_](.)/g,(t,n)=>n.toUpperCase()).replace(/^./,t=>t.toUpperCase())}function Ir(e){return e instanceof Error?e.message:typeof e=="string"?e:e&&typeof e=="object"&&"message"in e?String(e.message):"An unknown error occurred"}var Jg=["production","staging","development","platform","compliance"];var Qg={ROOT:"root",PLATFORM:"platform"},yT=[...Jg,Qg.ROOT];var PL=Object.freeze({"AWS::IAM::Role":"security","AWS::IAM::Policy":"security","AWS::IAM::OIDCProvider":"security","AWS::EC2::SecurityGroup":"security","AWS::KMS::Key":"security","AWS::KMS::Alias":"security","AWS::EC2::VPC":"network","AWS::EC2::Subnet":"network","AWS::EC2::InternetGateway":"network","AWS::EC2::NatGateway":"network","AWS::EC2::RouteTable":"network","AWS::EC2::Route":"network","AWS::EC2::VPCGatewayAttachment":"network","AWS::EC2::SubnetRouteTableAssociation":"network","AWS::EC2::EIP":"network","AWS::ECS::Cluster":"compute","AWS::ECS::Service":"compute","AWS::ECS::TaskDefinition":"compute","AWS::Lambda::Function":"compute","AWS::ElasticLoadBalancingV2::LoadBalancer":"compute","AWS::ElasticLoadBalancingV2::TargetGroup":"compute","AWS::ElasticLoadBalancingV2::Listener":"compute","AWS::ElasticLoadBalancingV2::ListenerRule":"compute","AWS::RDS::DBInstance":"database","AWS::RDS::DBCluster":"database","AWS::SecretsManager::Secret":"database","AWS::S3::Bucket":"storage","AWS::S3::BucketPolicy":"storage","AWS::CloudTrail::Trail":"monitoring","AWS::CloudWatch::Alarm":"monitoring","AWS::Logs::LogGroup":"monitoring","AWS::Events::EventBus":"events","AWS::Events::Rule":"events","AWS::ECR::Repository":"registry","AWS::CodeBuild::Project":"registry","AWS::Route53::RecordSet":"dns","AWS::CertificateManager::Certificate":"dns","AWS::CloudFront::Distribution":"dns","AWS::Backup::BackupVault":"backup","AWS::Backup::BackupPlan":"backup","AWS::Backup::BackupSelection":"backup","AWS::SSO::PermissionSet":"identity","AWS::SSO::Assignment":"identity","AWS::Organizations::Account":"identity","AWS::CDK::Metadata":"compute","AWS::CloudFormation::CustomResource":"compute","AWS::CloudFormation::WaitCondition":"compute","AWS::CloudFormation::WaitConditionHandle":"compute"});var OL=Object.freeze({"AWS::EC2::NatGateway":120,"AWS::RDS::DBInstance":300,"AWS::RDS::DBCluster":300,"AWS::CloudFront::Distribution":300,"AWS::ECS::Service":180,"AWS::ElasticLoadBalancingV2::LoadBalancer":60,"AWS::EC2::SecurityGroup":10,"AWS::IAM::Role":15,"AWS::IAM::Policy":15,"AWS::IAM::OIDCProvider":10,"AWS::S3::Bucket":10,"AWS::S3::BucketPolicy":5,"AWS::Lambda::Function":30,"AWS::EC2::VPC":15,"AWS::EC2::Subnet":15,"AWS::EC2::InternetGateway":10,"AWS::EC2::RouteTable":5,"AWS::EC2::Route":5,"AWS::EC2::VPCGatewayAttachment":10,"AWS::EC2::SubnetRouteTableAssociation":5,"AWS::EC2::EIP":10,"AWS::ECS::Cluster":15,"AWS::ECS::TaskDefinition":10,"AWS::ElasticLoadBalancingV2::TargetGroup":10,"AWS::ElasticLoadBalancingV2::Listener":10,"AWS::ElasticLoadBalancingV2::ListenerRule":5,"AWS::SecretsManager::Secret":10,"AWS::Logs::LogGroup":5,"AWS::CloudWatch::Alarm":10,"AWS::CloudTrail::Trail":15,"AWS::Events::EventBus":5,"AWS::Events::Rule":5,"AWS::ECR::Repository":10,"AWS::Route53::RecordSet":30,"AWS::CertificateManager::Certificate":60,"AWS::KMS::Key":15,"AWS::KMS::Alias":5,"AWS::Backup::BackupVault":10,"AWS::Backup::BackupPlan":10,"AWS::Backup::BackupSelection":10,"AWS::SSO::PermissionSet":15,"AWS::SSO::Assignment":10,"AWS::Organizations::Account":60});var DL=Object.freeze({"AWS::Lambda::Function":"Lambda Function","AWS::IAM::Role":"IAM Role","AWS::IAM::Policy":"IAM Policy","AWS::S3::Bucket":"S3 Bucket","AWS::DynamoDB::Table":"DynamoDB Table","AWS::EC2::Instance":"EC2 Instance","AWS::EC2::SecurityGroup":"Security Group","AWS::EC2::VPC":"VPC","AWS::EC2::Subnet":"Subnet","AWS::EC2::InternetGateway":"Internet Gateway","AWS::EC2::RouteTable":"Route Table","AWS::EC2::Route":"Route","AWS::ECS::Cluster":"ECS Cluster","AWS::ECS::Service":"ECS Service","AWS::ECS::TaskDefinition":"Task Definition","AWS::ElasticLoadBalancingV2::LoadBalancer":"Load Balancer","AWS::ElasticLoadBalancingV2::TargetGroup":"Target Group","AWS::ElasticLoadBalancingV2::Listener":"Listener","AWS::CloudFormation::Stack":"CloudFormation Stack","AWS::CDK::Metadata":"CDK Metadata","Custom::CDKBucketDeployment":"Bucket Deployment","AWS::SSM::Parameter":"SSM Parameter","AWS::CloudWatch::Alarm":"CloudWatch Alarm","AWS::Logs::LogGroup":"Log Group","AWS::ApiGateway::RestApi":"API Gateway","AWS::ApiGateway::Deployment":"API Deployment","AWS::ApiGateway::Stage":"API Stage","AWS::ApiGateway::Method":"API Method","AWS::ApiGateway::Resource":"API Resource","AWS::CloudFront::Distribution":"CloudFront Distribution","AWS::Route53::RecordSet":"Route53 Record","AWS::RDS::DBInstance":"RDS Instance","AWS::RDS::DBCluster":"RDS Cluster","AWS::SQS::Queue":"SQS Queue","AWS::SNS::Topic":"SNS Topic","AWS::Events::Rule":"EventBridge Rule","AWS::StepFunctions::StateMachine":"Step Function","AWS::EC2::NatGateway":"NAT Gateway","AWS::EC2::EIP":"Elastic IP","AWS::EC2::VPCGatewayAttachment":"Gateway Attachment","AWS::EC2::SubnetRouteTableAssociation":"Route Association","AWS::CloudTrail::Trail":"CloudTrail","AWS::IAM::OIDCProvider":"OIDC Provider","AWS::Events::EventBus":"Event Bus","AWS::Backup::BackupVault":"Backup Vault","AWS::Backup::BackupPlan":"Backup Plan","AWS::Backup::BackupSelection":"Backup Selection","AWS::SecretsManager::Secret":"Secret","AWS::KMS::Key":"KMS Key","AWS::KMS::Alias":"KMS Alias","AWS::ECR::Repository":"ECR Repository","AWS::CertificateManager::Certificate":"Certificate","AWS::ElasticLoadBalancingV2::ListenerRule":"Listener Rule","AWS::EC2::IPAM":"IPAM","AWS::EC2::IPAMPool":"IPAM Pool","AWS::EC2::IPAMPoolCidr":"IPAM Pool CIDR","Custom::ram":"RAM","Custom::ipamDelegateAdmin":"IPAM Delegate Admin","Custom::CostAllocationTags":"Cost Allocation Tags","Custom::ActivateOrganisationsAccess":"Activate Organisations Access","Custom::Organizations_TagResource":"Organisations Tag Resource","AWS::CloudFormation::CustomResource":"Custom Resource","AWS::CloudFormation::WaitCondition":"Wait Condition","AWS::CloudFormation::WaitConditionHandle":"Wait Condition Handle","AWS::SSO::PermissionSet":"SSO Permission Set","AWS::SSO::Assignment":"SSO Assignment","AWS::Organizations::Account":"Organisations Account","AWS::S3::BucketPolicy":"S3 Bucket Policy","AWS::CodeBuild::Project":"CodeBuild Project"});function Te(e){return{success:!0,data:e}}function Ce(e){return{success:!1,error:e}}var tv=/^[a-zA-Z][a-zA-Z0-9-]*$/,H=Object.freeze({IDENTIFIER:tv,RESOURCE_NAME:/^[a-zA-Z][a-zA-Z0-9]*$/,ECS_SERVICE_NAME:tv,BUCKET_NAME:/^[a-z][a-z0-9-]*[a-z0-9]$|^[a-z][a-z0-9]*$/,DATABASE_NAME:/^[a-zA-Z][a-zA-Z0-9_]*$/,RESOURCE_TYPE:/^[a-z]+(:[a-z]+)?$/,SSM_PATH:/^\/[a-zA-Z][a-zA-Z0-9-]*(\/[a-zA-Z][a-zA-Z0-9-]*)*$/,SECRET_NAME:/^[a-zA-Z_][a-zA-Z0-9._-]*$/,SSM_COMPONENT:/^[a-zA-Z][a-zA-Z0-9._-]*$/,EMAIL:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,DOCKER_IMAGE:/^[a-z0-9][a-z0-9._-]*[a-z0-9](:[a-z0-9._-]+)?$/,DOMAIN:/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i,PASCAL_CASE:/^[A-Z][A-Za-z0-9]*$/,AWS_ACCOUNT_ID:/^\d{12}$/,VPC_ID:/^vpc-[a-z0-9]+$/,ROLE_ARN:/^arn:aws[a-zA-Z-]*:iam::\d{12}:role\/.+$/,CIDR:/^((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\/(3[0-2]|[12]?\d)$/,SCHEDULE_EXPRESSION:/^(rate\(1 (?:minute|hour|day)\)|rate\((?:[2-9]|[1-9]\d+) (?:minutes|hours|days)\)|cron\([^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+\))$/,LAMBDA_RUNTIME_IDENTIFIER:/^[A-Za-z0-9._-]+$/,ENV_VAR_NAME:/^[A-Za-z_][A-Za-z0-9_]*$/});var d=Object.freeze({IDENTIFIER:"Must start with a letter, contain only letters, numbers, and hyphens",IDENTIFIER_MIN_LENGTH:"Must be at least 2 characters",IDENTIFIER_NO_TRAILING_HYPHEN:"Must not end with a hyphen",IDENTIFIER_NO_CONSECUTIVE_HYPHENS:"Must not contain consecutive hyphens",RESOURCE_NAME:"Must start with a letter and contain only letters and numbers (PascalCase recommended)",ECS_SERVICE_NAME:"Service name must start with a letter and contain only letters, numbers, and hyphens",BUCKET_NAME:"Bucket name must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",DATABASE_NAME:"Database name must start with a letter and contain only letters, numbers, and underscores",RESOURCE_TYPE:"Resource type must be in format 'category' or 'category:type'",SSM_PATH:"SSM path must start with / and contain valid namespace segments (e.g., /myapp/ApiCluster/service)",SECRET_NAME:"Secret name must start with a letter or underscore and contain only letters, numbers, underscores, hyphens, or periods",SSM_COMPONENT:"Must start with a letter and contain only letters, numbers, periods, hyphens, or underscores",EMAIL:"Please enter a valid email address",DOMAIN:"Please enter a valid domain (e.g., cms.example.com)",DOCKER_IMAGE:"Invalid Docker image name format",REQUIRED:{APP_NAME:"Application name is required",RESOURCE_NAME:"Resource name is required",BUCKET_NAME:"Bucket name is required",SERVICE_NAME:"Service name is required",NETWORK_NAME:"Network name is required",DATABASE_NAME:"Database name is required",ORGANISATION_NAME:"Organisation name is required",EMAIL:"Email is required",NAME:"Name is required",USERNAME:"Username is required",CONTAINER_NAME:"Container name is required",FIRST_NAME:"First name is required",LAST_NAME:"Last name is required",GROUP:"Group is required",PATTERN_NAME:"Pattern name is required",ROUTING_PATH:"Routing path is required",RESOURCE_REFERENCE:"Resource reference is required",RESOURCE_TYPE:"Resource type is required",VARIANT:"Variant is required",SUBTYPE:"Subtype is required",DEPLOY_TARGET:"Deploy target is required",DESTROY_TARGET:"Destroy target is required"},MAX_LENGTH:{APP_NAME:"Application name must be 50 characters or less",RESOURCE_NAME:"Resource name must be 63 characters or less",BUCKET_NAME:"Bucket name must be 63 characters or less",SERVICE_NAME:"Service name must be 255 characters or less",NETWORK_NAME:"Network name must be 50 characters or less",DATABASE_NAME:"Database name must be 63 characters or less",ORGANISATION_NAME:"Organisation name must be 50 characters or less"},PORT:{INTEGER:"Port must be an integer",MIN:"Port must be at least 1",MAX:"Port cannot exceed 65535"},USERNAME:{MAX_LENGTH:"Username cannot exceed 63 characters"},LAMBDA:{MEMORY:{INTEGER:"Lambda memory must be an integer",MIN:"Memory must be at least 128 MB",MAX:"Memory cannot exceed 10240 MB",MULTIPLE:"Memory must be 128 MB or a multiple of 64 MB"},TIMEOUT:{INTEGER:"Timeout must be an integer",MIN:"Timeout must be at least 1 second",MAX:"Timeout cannot exceed 900 seconds"},RUNTIME:"Lambda runtime must contain only letters, digits, dots, underscores, or dashes (e.g. 'NODEJS_20_X' or 'nodejs20.x')"},ENV_VAR_NAME:"Environment variable names must start with a letter or underscore and contain only letters, digits, and underscores",PRIORITY:{INTEGER:"Priority must be an integer",MIN:"Priority must be at least 1",MAX:"Priority cannot exceed 50000"},CAPACITY:{MIN:{INTEGER:"Minimum capacity must be an integer",MIN_0:"Minimum capacity must be at least 0",MIN_1:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 100"},MAX:{INTEGER:"Maximum capacity must be an integer",MIN_0:"Maximum capacity must be at least 0",MIN_1:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 100"},DESIRED:{INTEGER:"Desired count must be an integer",MIN:"Desired count must be at least 0",MAX:"Desired count cannot exceed 100"},WARM_POOL_REQUIRED:"minCapacity 0 requires a warmPool \u2014 without it, new tasks wait 60-90s for a cold instance launch",WARM_POOL:{MIN_SIZE:{INTEGER:"Warm pool minSize must be an integer",MIN:"Warm pool minSize must be at least 0",MAX:"Warm pool minSize cannot exceed 100"},MIN_SIZE_EXCEEDS_MAX_CAPACITY:"warmPool.minSize cannot exceed maxCapacity \u2014 the warm pool cannot hold more instances than the ASG allows"}},MEMORY_LIMIT:{INTEGER:"Memory limit must be an integer",MIN_512:"Memory limit must be at least 512 MiB",MIN_128:"Memory limit must be at least 128 MiB",MAX:"Memory limit cannot exceed 30720 MiB"},DATABASE:{PORT:{INTEGER:"Database port must be an integer",MIN:"Database port must be at least 1024",MAX:"Database port cannot exceed 65535"},NAME:{REQUIRED:"Database name is required",MAX_LENGTH:"Database name must be 63 characters or less"}},BACKUP_RETENTION:{INTEGER:"Backup retention must be an integer",MIN:"Backup retention must be at least 1 day",MAX:"Backup retention cannot exceed 35 days"},SQS:{VISIBILITY_TIMEOUT:{INTEGER:"Visibility timeout must be an integer",MIN:"Visibility timeout must be at least 0 seconds",MAX:"Visibility timeout cannot exceed 43200 seconds (12 hours)"},RETENTION_PERIOD:{INTEGER:"Retention period must be an integer",MIN:"Retention period must be at least 60 seconds",MAX:"Retention period cannot exceed 1209600 seconds (14 days)"}},READER:{COUNT:{INTEGER:"Reader count must be an integer",MIN:"Reader count must be at least 0",MAX:"Reader count cannot exceed 15"}},IDENTIFIER_SUFFIX:{REQUIRED:"Identifier suffix is required when specified",MAX_LENGTH:"Identifier suffix cannot exceed 50 characters"},ROTATION:{INTEGER:"Rotation days must be an integer",MIN:"Rotation interval must be at least 1 day",MAX:"Rotation interval cannot exceed 365 days"},MAX_CONNECTIONS:{INTEGER:"Max connections must be an integer",MIN:"Max connections must be at least 1",MAX:"Max connections cannot exceed 100"},MONITORING_INTERVAL:{INTEGER:"Monitoring interval must be an integer",MIN:"Monitoring interval must be at least 0",MAX:"Monitoring interval cannot exceed 60 seconds",VALUES:"Monitoring interval must be 0, 1, 5, 10, 15, 30, or 60 seconds"},RETENTION_DAYS:{INTEGER:"Retention days must be an integer",MIN:"Retention days must be at least 1",MAX:"Retention days cannot exceed 365"},BATCH_SIZE:{INTEGER:"Batch size must be an integer",MIN:"Batch size must be at least 1",MAX:"Batch size cannot exceed 10000"},SERVICE:{UNIQUE_WITHIN_CLUSTER:"Service names must be unique within a cluster",MIN_REQUIRED:"At least one service is required",ROUTING_REQUIRED:"Multiple services with ports require routing config (path or host)"},PROXY_CONFIG:{MAX_IDLE_CONNECTIONS:{INTEGER:"Max idle connections must be an integer",MIN:"Max idle connections must be at least 0",MAX:"Max idle connections cannot exceed 100"},BORROW_TIMEOUT:{INTEGER:"Connection borrow timeout must be an integer",MIN:"Connection borrow timeout must be at least 1 second",MAX:"Connection borrow timeout cannot exceed 3600 seconds"}},MAX_AZS:{INTEGER:"Max AZs must be an integer",MIN:"Max AZs must be at least 1",MAX:"Max AZs cannot exceed 3"},BATCHING_WINDOW:{INTEGER:"Max batching window must be an integer",MIN:"Max batching window must be at least 0",MAX:"Max batching window cannot exceed 300 seconds"},HEALTH_CHECK:{INTERVAL:{INTEGER:"Health check interval must be an integer",MIN:"Health check interval must be at least 5 seconds",MAX:"Health check interval cannot exceed 300 seconds"},TIMEOUT:{INTEGER:"Health check timeout must be an integer",MIN:"Health check timeout must be at least 2 seconds",MAX:"Health check timeout cannot exceed 60 seconds"},RETRIES:{INTEGER:"Health check retries must be an integer",MIN:"Health check retries must be at least 1",MAX:"Health check retries cannot exceed 10"},START_PERIOD:{INTEGER:"Health check start period must be an integer",MIN:"Health check start period must be at least 0 seconds",MAX:"Health check start period cannot exceed 300 seconds"}},EPHEMERAL_STORAGE:{INTEGER:"Ephemeral storage size must be an integer",MIN:"Ephemeral storage size must be at least 512 MB",MAX:"Ephemeral storage size cannot exceed 10240 MB"},MAX_MESSAGE_SIZE:{INTEGER:"Max message size must be an integer",MIN:"Max message size must be at least 1024 bytes",MAX:"Max message size cannot exceed 262144 bytes (256 KB)"},CAPACITY_CONSTRAINT:{MIN_LTE_MAX:"minCapacity must be less than or equal to maxCapacity"},DIRECT_ACCESS:{NO_DOMAIN:"directAccess cannot be used with domain (no ALB for HTTPS)",NO_LOAD_BALANCER:"directAccess cannot be used with loadBalancer (mutually exclusive)"},GLOBAL_AURORA:{PRIMARY_REGION_REQUIRED:"primaryRegion is required for GlobalAurora databases"},NAT_GATEWAY:{INTEGER:"NAT gateway count must be an integer",MIN:"NAT gateway count must be at least 0",MAX:"NAT gateway count cannot exceed 3"},CIDR_MASK:{INTEGER:"CIDR mask must be an integer",MIN:"CIDR mask must be at least 16",MAX:"CIDR mask cannot exceed 28"},CPU:{INTEGER:"CPU must be an integer",MIN:"CPU must be at least 256 units",MAX:"CPU cannot exceed 4096 units"},KMS:{KEY_REQUIRED:"KMS key ARN is required when using KMS encryption"},READER_INSTANCES:{MAX:"Cannot have more than 15 reader instances",COUNT_OR_INSTANCES:"Cannot specify both 'count' and 'instances' - use one or the other"},GENERATOR_CAPACITY:{MIN:{MIN:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 1000"},MAX:{MIN:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 1000"}},INSTANCE_TYPE:"Unknown instance type. Common types include: t4g.micro, t4g.small, m5.large",ARCHITECTURE_MISMATCH:"Architecture mismatch between instance type and AMI",ALLOCATED_STORAGE:{INTEGER:"Allocated storage must be an integer",MIN:"Allocated storage must be at least 20 GB",MAX:"Allocated storage cannot exceed 65536 GB"},DLQ:{MAX_RECEIVE_COUNT:{INTEGER:"Max receive count must be an integer",MIN:"Max receive count must be at least 1",MAX:"Max receive count cannot exceed 1000"}},ALARM:{PERCENTAGE:{MIN:"Threshold must be at least 1%",MAX:"Threshold must be at most 100%"},FREE_STORAGE_GIB:{MIN:"Free storage threshold must be at least 1 GiB"}},REGION:"Invalid AWS region",PASCAL_CASE:"Resource name must start with an uppercase letter and contain only alphanumerics (PascalCase).",IMAGE_DOCKER_MUTEX:"image and docker are mutually exclusive",AWS_ACCOUNT_ID:"AWS account id must be exactly 12 digits (no hyphens)",VPC_ID:"VPC id must look like vpc-abc12345",ROLE_ARN:"Role ARN must have the form arn:aws:iam::<account-id>:role/<name>",CIDR:"CIDR must be in dotted-quad/prefix-length form (e.g. 10.0.0.0/16)",VPC_PEER:{MIN_REQUESTER_ACCOUNTS:"At least one requester account id is required",REGION_REQUIRED:"Peer region is required when specified",ROUTE_TABLE_ID_REQUIRED:"Route table id must not be empty"},SCHEDULE_EXPRESSION:"Schedule expression must be 'rate(N minute|minutes|hour|hours|day|days)' with N>=1, or 'cron(<6-field AWS expression>)'"});var Vc=Object.freeze(["us-east-2","us-west-2","us-east-1","eu-west-1","eu-central-1","ap-southeast-1","ap-northeast-1","ap-southeast-2","us-west-1","ca-central-1","af-south-1","ap-east-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-south-2","ap-southeast-3","ap-southeast-4","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-2","eu-west-3","me-central-1","me-south-1","sa-east-1"]),CT=Object.freeze([{code:"us-east-2",name:"US East",city:"Ohio",country:"USA"},{code:"us-west-2",name:"US West",city:"Oregon",country:"USA"},{code:"us-east-1",name:"US East",city:"N. Virginia",country:"USA"},{code:"eu-west-1",name:"EU West",city:"Ireland",country:"Ireland"},{code:"eu-central-1",name:"EU Central",city:"Frankfurt",country:"Germany"},{code:"ap-southeast-1",name:"Asia Pacific",city:"Singapore",country:"Singapore"},{code:"ap-northeast-1",name:"Asia Pacific",city:"Tokyo",country:"Japan"},{code:"ap-southeast-2",name:"Asia Pacific",city:"Sydney",country:"Australia"},{code:"us-west-1",name:"US West",city:"N. California",country:"USA"},{code:"ca-central-1",name:"Canada",city:"Central",country:"Canada"},{code:"af-south-1",name:"Africa",city:"Cape Town",country:"South Africa"},{code:"ap-east-1",name:"Asia Pacific",city:"Hong Kong",country:"China"},{code:"ap-northeast-2",name:"Asia Pacific",city:"Seoul",country:"South Korea"},{code:"ap-northeast-3",name:"Asia Pacific",city:"Osaka",country:"Japan"},{code:"ap-south-1",name:"Asia Pacific",city:"Mumbai",country:"India"},{code:"ap-south-2",name:"Asia Pacific",city:"Hyderabad",country:"India"},{code:"ap-southeast-3",name:"Asia Pacific",city:"Jakarta",country:"Indonesia"},{code:"ap-southeast-4",name:"Asia Pacific",city:"Melbourne",country:"Australia"},{code:"eu-central-2",name:"EU Central",city:"Zurich",country:"Switzerland"},{code:"eu-north-1",name:"EU North",city:"Stockholm",country:"Sweden"},{code:"eu-south-1",name:"EU South",city:"Milan",country:"Italy"},{code:"eu-south-2",name:"EU South",city:"Spain",country:"Spain"},{code:"eu-west-2",name:"EU West",city:"London",country:"UK"},{code:"eu-west-3",name:"EU West",city:"Paris",country:"France"},{code:"me-central-1",name:"Middle East",city:"UAE",country:"UAE"},{code:"me-south-1",name:"Middle East",city:"Bahrain",country:"Bahrain"},{code:"sa-east-1",name:"South America",city:"S\xE3o Paulo",country:"Brazil"}]),wT=Object.freeze([{code:"us-east-2",name:"US East",city:"Ohio",country:"USA"},{code:"us-west-2",name:"US West",city:"Oregon",country:"USA"},{code:"us-east-1",name:"US East",city:"N. Virginia",country:"USA"},{code:"eu-west-1",name:"EU West",city:"Ireland",country:"Ireland"},{code:"eu-central-1",name:"EU Central",city:"Frankfurt",country:"Germany"},{code:"ap-southeast-1",name:"Asia Pacific",city:"Singapore",country:"Singapore"}]),NT=Object.freeze(["us-east-2","us-west-2","us-east-1","eu-west-1","ap-southeast-1"]);var c={};et(c,{$brand:()=>Wc,$input:()=>pd,$output:()=>md,NEVER:()=>Gc,TimePrecision:()=>vd,ZodAny:()=>ap,ZodArray:()=>lp,ZodBase64:()=>Ha,ZodBase64URL:()=>Ka,ZodBigInt:()=>nn,ZodBigIntFormat:()=>Ya,ZodBoolean:()=>rn,ZodCIDRv4:()=>Ga,ZodCIDRv6:()=>Wa,ZodCUID:()=>ja,ZodCUID2:()=>La,ZodCatch:()=>Rp,ZodCodec:()=>Si,ZodCustom:()=>_i,ZodCustomStringFormat:()=>en,ZodDate:()=>hi,ZodDefault:()=>Ip,ZodDiscriminatedUnion:()=>mp,ZodE164:()=>qa,ZodEmail:()=>Da,ZodEmoji:()=>Ma,ZodEnum:()=>Jr,ZodError:()=>sw,ZodExactOptional:()=>Ep,ZodFile:()=>_p,ZodFirstPartyTypeKind:()=>Gp,ZodFunction:()=>Bp,ZodGUID:()=>li,ZodIPv4:()=>Za,ZodIPv6:()=>Va,ZodISODate:()=>wa,ZodISODateTime:()=>Ca,ZodISODuration:()=>ka,ZodISOTime:()=>Na,ZodIntersection:()=>pp,ZodIssueCode:()=>uw,ZodJWT:()=>Xa,ZodKSUID:()=>Ba,ZodLazy:()=>Lp,ZodLiteral:()=>Sp,ZodMAC:()=>Qm,ZodMap:()=>bp,ZodNaN:()=>Op,ZodNanoID:()=>za,ZodNever:()=>cp,ZodNonOptional:()=>ns,ZodNull:()=>ip,ZodNullable:()=>$p,ZodNumber:()=>tn,ZodNumberFormat:()=>ur,ZodObject:()=>vi,ZodOptional:()=>rs,ZodPipe:()=>yi,ZodPrefault:()=>Cp,ZodPreprocess:()=>Dp,ZodPromise:()=>Fp,ZodReadonly:()=>Mp,ZodRealError:()=>ke,ZodRecord:()=>Yr,ZodSet:()=>yp,ZodString:()=>Qr,ZodStringFormat:()=>V,ZodSuccess:()=>kp,ZodSymbol:()=>rp,ZodTemplateLiteral:()=>jp,ZodTransform:()=>xp,ZodTuple:()=>hp,ZodType:()=>N,ZodULID:()=>Ua,ZodURL:()=>fi,ZodUUID:()=>it,ZodUndefined:()=>np,ZodUnion:()=>bi,ZodUnknown:()=>sp,ZodVoid:()=>up,ZodXID:()=>Fa,ZodXor:()=>dp,_ZodString:()=>Oa,_default:()=>Tp,_function:()=>Zy,any:()=>Sy,array:()=>gi,base64:()=>ny,base64url:()=>iy,bigint:()=>hy,boolean:()=>tp,catch:()=>Pp,check:()=>Vy,cidrv4:()=>ty,cidrv6:()=>ry,clone:()=>ye,codec:()=>Ly,coerce:()=>Wp,config:()=>ne,core:()=>gt,cuid:()=>Hb,cuid2:()=>Kb,custom:()=>Gy,date:()=>xy,decode:()=>Wm,decodeAsync:()=>Km,describe:()=>Wy,discriminatedUnion:()=>Cy,e164:()=>oy,email:()=>zb,emoji:()=>Gb,encode:()=>Gm,encodeAsync:()=>Hm,endsWith:()=>Fr,enum:()=>es,exactOptional:()=>Ap,file:()=>Dy,flattenError:()=>Xn,float32:()=>dy,float64:()=>my,formatError:()=>Yn,fromJSONSchema:()=>Qy,function:()=>Zy,getErrorMap:()=>dw,globalRegistry:()=>pe,gt:()=>rt,gte:()=>_e,guid:()=>jb,hash:()=>ly,hex:()=>uy,hostname:()=>cy,httpUrl:()=>Vb,includes:()=>Lr,instanceof:()=>Ky,int:()=>Ra,int32:()=>py,int64:()=>gy,intersection:()=>fp,invertCodec:()=>Uy,ipv4:()=>Jb,ipv6:()=>ey,iso:()=>Xr,json:()=>Xy,jwt:()=>ay,keyof:()=>Ey,ksuid:()=>Yb,lazy:()=>Up,length:()=>sr,literal:()=>Oy,locales:()=>oi,looseObject:()=>Iy,looseRecord:()=>Ny,lowercase:()=>zr,lt:()=>tt,lte:()=>je,mac:()=>Qb,map:()=>ky,maxLength:()=>ar,maxSize:()=>zt,meta:()=>Hy,mime:()=>Br,minLength:()=>ht,minSize:()=>nt,multipleOf:()=>Mt,nan:()=>jy,nanoid:()=>Wb,nativeEnum:()=>Py,negative:()=>ba,never:()=>Ja,nonnegative:()=>Sa,nonoptional:()=>Np,nonpositive:()=>ya,normalize:()=>Zr,null:()=>op,nullable:()=>mi,nullish:()=>My,number:()=>ep,object:()=>Ay,optional:()=>di,overwrite:()=>Xe,parse:()=>Fm,parseAsync:()=>Bm,partialRecord:()=>wy,pipe:()=>Pa,positive:()=>va,prefault:()=>wp,preprocess:()=>Yy,prettifyError:()=>ou,promise:()=>By,property:()=>_a,readonly:()=>zp,record:()=>vp,refine:()=>Zp,regex:()=>Mr,regexes:()=>ze,registry:()=>Xo,safeDecode:()=>Xm,safeDecodeAsync:()=>Jm,safeEncode:()=>qm,safeEncodeAsync:()=>Ym,safeParse:()=>Zm,safeParseAsync:()=>Vm,set:()=>Ry,setErrorMap:()=>lw,size:()=>or,slugify:()=>Hr,startsWith:()=>Ur,strictObject:()=>$y,string:()=>ui,stringFormat:()=>sy,stringbool:()=>qy,success:()=>zy,superRefine:()=>Vp,symbol:()=>by,templateLiteral:()=>Fy,toJSONSchema:()=>$a,toLowerCase:()=>Gr,toUpperCase:()=>Wr,transform:()=>ts,treeifyError:()=>iu,trim:()=>Vr,tuple:()=>gp,uint32:()=>fy,uint64:()=>vy,ulid:()=>qb,undefined:()=>yy,union:()=>Qa,unknown:()=>cr,uppercase:()=>jr,url:()=>Zb,util:()=>S,uuid:()=>Lb,uuidv4:()=>Ub,uuidv6:()=>Fb,uuidv7:()=>Bb,void:()=>_y,xid:()=>Xb,xor:()=>Ty});var gt={};et(gt,{$ZodAny:()=>Ol,$ZodArray:()=>Ll,$ZodAsyncError:()=>qe,$ZodBase64:()=>Al,$ZodBase64URL:()=>$l,$ZodBigInt:()=>Bo,$ZodBigIntFormat:()=>Nl,$ZodBoolean:()=>ti,$ZodCIDRv4:()=>_l,$ZodCIDRv6:()=>xl,$ZodCUID:()=>ul,$ZodCUID2:()=>ll,$ZodCatch:()=>nd,$ZodCheck:()=>K,$ZodCheckBigIntFormat:()=>Lu,$ZodCheckEndsWith:()=>Yu,$ZodCheckGreaterThan:()=>Mo,$ZodCheckIncludes:()=>qu,$ZodCheckLengthEquals:()=>Gu,$ZodCheckLessThan:()=>Do,$ZodCheckLowerCase:()=>Hu,$ZodCheckMaxLength:()=>Zu,$ZodCheckMaxSize:()=>Uu,$ZodCheckMimeType:()=>Qu,$ZodCheckMinLength:()=>Vu,$ZodCheckMinSize:()=>Fu,$ZodCheckMultipleOf:()=>zu,$ZodCheckNumberFormat:()=>ju,$ZodCheckOverwrite:()=>el,$ZodCheckProperty:()=>Ju,$ZodCheckRegex:()=>Wu,$ZodCheckSizeEquals:()=>Bu,$ZodCheckStartsWith:()=>Xu,$ZodCheckStringFormat:()=>Or,$ZodCheckUpperCase:()=>Ku,$ZodCodec:()=>ni,$ZodCustom:()=>dd,$ZodCustomStringFormat:()=>Cl,$ZodDate:()=>jl,$ZodDefault:()=>Ql,$ZodDiscriminatedUnion:()=>Bl,$ZodE164:()=>Il,$ZodEmail:()=>ol,$ZodEmoji:()=>sl,$ZodEncodeError:()=>kt,$ZodEnum:()=>Hl,$ZodError:()=>qn,$ZodExactOptional:()=>Yl,$ZodFile:()=>ql,$ZodFunction:()=>cd,$ZodGUID:()=>nl,$ZodIPv4:()=>bl,$ZodIPv6:()=>yl,$ZodISODate:()=>hl,$ZodISODateTime:()=>fl,$ZodISODuration:()=>vl,$ZodISOTime:()=>gl,$ZodIntersection:()=>Zl,$ZodJWT:()=>Tl,$ZodKSUID:()=>pl,$ZodLazy:()=>ld,$ZodLiteral:()=>Kl,$ZodMAC:()=>Sl,$ZodMap:()=>Gl,$ZodNaN:()=>id,$ZodNanoID:()=>cl,$ZodNever:()=>Ml,$ZodNonOptional:()=>td,$ZodNull:()=>Pl,$ZodNullable:()=>Jl,$ZodNumber:()=>Fo,$ZodNumberFormat:()=>wl,$ZodObject:()=>Rv,$ZodObjectJIT:()=>Ul,$ZodOptional:()=>Vo,$ZodPipe:()=>Go,$ZodPrefault:()=>ed,$ZodPreprocess:()=>od,$ZodPromise:()=>ud,$ZodReadonly:()=>ad,$ZodRealError:()=>Ne,$ZodRecord:()=>Vl,$ZodRegistry:()=>qo,$ZodSet:()=>Wl,$ZodString:()=>ir,$ZodStringFormat:()=>Z,$ZodSuccess:()=>rd,$ZodSymbol:()=>kl,$ZodTemplateLiteral:()=>sd,$ZodTransform:()=>Xl,$ZodTuple:()=>Zo,$ZodType:()=>w,$ZodULID:()=>dl,$ZodURL:()=>al,$ZodUUID:()=>il,$ZodUndefined:()=>Rl,$ZodUnion:()=>ri,$ZodUnknown:()=>Dl,$ZodVoid:()=>zl,$ZodXID:()=>ml,$ZodXor:()=>Fl,$brand:()=>Wc,$constructor:()=>p,$input:()=>pd,$output:()=>md,Doc:()=>ei,JSONSchema:()=>Ob,JSONSchemaGenerator:()=>Ia,NEVER:()=>Gc,TimePrecision:()=>vd,_any:()=>jd,_array:()=>Gd,_base64:()=>pa,_base64url:()=>fa,_bigint:()=>kd,_boolean:()=>wd,_catch:()=>QC,_check:()=>Pb,_cidrv4:()=>da,_cidrv6:()=>ma,_coercedBigint:()=>Rd,_coercedBoolean:()=>Nd,_coercedDate:()=>Zd,_coercedNumber:()=>Ed,_coercedString:()=>hd,_cuid:()=>ia,_cuid2:()=>oa,_custom:()=>Hd,_date:()=>Bd,_decode:()=>Io,_decodeAsync:()=>Co,_default:()=>XC,_discriminatedUnion:()=>jC,_e164:()=>ha,_email:()=>Yo,_emoji:()=>ra,_encode:()=>$o,_encodeAsync:()=>To,_endsWith:()=>Fr,_enum:()=>VC,_file:()=>Wd,_float32:()=>$d,_float64:()=>Id,_gt:()=>rt,_gte:()=>_e,_guid:()=>ai,_includes:()=>Lr,_int:()=>Ad,_int32:()=>Td,_int64:()=>Pd,_intersection:()=>LC,_ipv4:()=>ua,_ipv6:()=>la,_isoDate:()=>yd,_isoDateTime:()=>bd,_isoDuration:()=>_d,_isoTime:()=>Sd,_jwt:()=>ga,_ksuid:()=>ca,_lazy:()=>nw,_length:()=>sr,_literal:()=>WC,_lowercase:()=>zr,_lt:()=>tt,_lte:()=>je,_mac:()=>gd,_map:()=>BC,_max:()=>je,_maxLength:()=>ar,_maxSize:()=>zt,_mime:()=>Br,_min:()=>_e,_minLength:()=>ht,_minSize:()=>nt,_multipleOf:()=>Mt,_nan:()=>Vd,_nanoid:()=>na,_nativeEnum:()=>GC,_negative:()=>ba,_never:()=>Ud,_nonnegative:()=>Sa,_nonoptional:()=>YC,_nonpositive:()=>ya,_normalize:()=>Zr,_null:()=>zd,_nullable:()=>qC,_number:()=>xd,_optional:()=>KC,_overwrite:()=>Xe,_parse:()=>Nr,_parseAsync:()=>kr,_pipe:()=>ew,_positive:()=>va,_promise:()=>iw,_property:()=>_a,_readonly:()=>tw,_record:()=>FC,_refine:()=>Kd,_regex:()=>Mr,_safeDecode:()=>No,_safeDecodeAsync:()=>Ro,_safeEncode:()=>wo,_safeEncodeAsync:()=>ko,_safeParse:()=>Rr,_safeParseAsync:()=>Pr,_set:()=>ZC,_size:()=>or,_slugify:()=>Hr,_startsWith:()=>Ur,_string:()=>fd,_stringFormat:()=>Kr,_stringbool:()=>Jd,_success:()=>JC,_superRefine:()=>qd,_symbol:()=>Dd,_templateLiteral:()=>rw,_toLowerCase:()=>Gr,_toUpperCase:()=>Wr,_transform:()=>HC,_trim:()=>Vr,_tuple:()=>UC,_uint32:()=>Cd,_uint64:()=>Od,_ulid:()=>aa,_undefined:()=>Md,_union:()=>MC,_unknown:()=>Ld,_uppercase:()=>jr,_url:()=>si,_uuid:()=>Jo,_uuidv4:()=>Qo,_uuidv6:()=>ea,_uuidv7:()=>ta,_void:()=>Fd,_xid:()=>sa,_xor:()=>zC,clone:()=>ye,config:()=>ne,createStandardJSONSchemaMethod:()=>qr,createToJSONSchemaMethod:()=>Qd,decode:()=>i0,decodeAsync:()=>a0,describe:()=>Xd,encode:()=>n0,encodeAsync:()=>o0,extractDefs:()=>Lt,finalize:()=>Ut,flattenError:()=>Xn,formatError:()=>Yn,globalConfig:()=>tr,globalRegistry:()=>pe,initializeContext:()=>jt,isValidBase64:()=>El,isValidBase64URL:()=>Cv,isValidJWT:()=>wv,locales:()=>oi,meta:()=>Yd,parse:()=>Eo,parseAsync:()=>Ao,prettifyError:()=>ou,process:()=>j,regexes:()=>ze,registry:()=>Xo,safeDecode:()=>c0,safeDecodeAsync:()=>l0,safeEncode:()=>s0,safeEncodeAsync:()=>u0,safeParse:()=>au,safeParseAsync:()=>su,toDotPath:()=>sv,toJSONSchema:()=>$a,treeifyError:()=>iu,util:()=>S,version:()=>tl});var rv,Gc=Object.freeze({status:"aborted"});function p(e,t,n){function i(s,u){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,u);let l=a.prototype,m=Object.keys(l);for(let f=0;f<m.length;f++){let h=m[f];h in s||(s[h]=l[h].bind(s))}}let r=n?.Parent??Object;class o extends r{}Object.defineProperty(o,"name",{value:e});function a(s){var u;let l=n?.Parent?new o:this;i(l,s),(u=l._zod).deferred??(u.deferred=[]);for(let m of l._zod.deferred)m();return l}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var Wc=Symbol("zod_brand"),qe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},kt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(rv=globalThis).__zod_globalConfig??(rv.__zod_globalConfig={});var tr=globalThis.__zod_globalConfig;function ne(e){return e&&Object.assign(tr,e),tr}var S={};et(S,{BIGINT_FORMAT_RANGES:()=>ru,Class:()=>Kc,NUMBER_FORMAT_RANGES:()=>tu,aborted:()=>Dt,allowsEval:()=>Yc,assert:()=>DT,assertEqual:()=>kT,assertIs:()=>PT,assertNever:()=>OT,assertNotEqual:()=>RT,assignProp:()=>Pt,base64ToUint8Array:()=>iv,base64urlToUint8Array:()=>JT,cached:()=>Cr,captureStackTrace:()=>xo,cleanEnum:()=>YT,cleanRegex:()=>Gn,clone:()=>ye,cloneDef:()=>zT,createTransparentProxy:()=>ZT,defineLazy:()=>O,esc:()=>_o,escapeRegex:()=>Fe,explicitlyAborted:()=>nu,extend:()=>WT,finalizeIssue:()=>Se,floatSafeRemainder:()=>qc,getElementAtPath:()=>jT,getEnumValues:()=>Vn,getLengthableOrigin:()=>Kn,getParsedType:()=>BT,getSizableOrigin:()=>Hn,hexToUint8Array:()=>e0,isObject:()=>rr,isPlainObject:()=>Ot,issue:()=>wr,joinValues:()=>g,jsonStringifyReplacer:()=>Tr,merge:()=>KT,mergeDefs:()=>ft,normalizeParams:()=>_,nullish:()=>Rt,numKeys:()=>FT,objectClone:()=>MT,omit:()=>GT,optionalKeys:()=>eu,parsedType:()=>y,partial:()=>qT,pick:()=>VT,prefixIssues:()=>we,primitiveTypes:()=>Qc,promiseAllObject:()=>LT,propertyKeyTypes:()=>Wn,randomString:()=>UT,required:()=>XT,safeExtend:()=>HT,shallowClone:()=>Jc,slugify:()=>Xc,stringifyPrimitive:()=>b,uint8ArrayToBase64:()=>ov,uint8ArrayToBase64url:()=>QT,uint8ArrayToHex:()=>t0,unwrapMessage:()=>Zn});function kT(e){return e}function RT(e){return e}function PT(e){}function OT(e){throw new Error("Unexpected value in exhaustive check")}function DT(e){}function Vn(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function g(e,t="|"){return e.map(n=>b(n)).join(t)}function Tr(e,t){return typeof t=="bigint"?t.toString():t}function Cr(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function Rt(e){return e==null}function Gn(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function qc(e,t){let n=e/t,i=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}var nv=Symbol("evaluating");function O(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==nv)return i===void 0&&(i=nv,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function MT(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Pt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ft(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function zT(e){return ft(e._zod.def)}function jT(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function LT(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<t.length;o++)r[t[o]]=i[o];return r})}function UT(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function _o(e){return JSON.stringify(e)}function Xc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var xo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function rr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Yc=Cr(()=>{if(tr.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ot(e){if(rr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(rr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Jc(e){return Ot(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function FT(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var BT=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Wn=new Set(["string","number","symbol"]),Qc=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Fe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ye(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function _(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function ZT(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function b(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function eu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var tu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ru={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function VT(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=ft(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=n.shape[s])}return Pt(this,"shape",a),a},checks:[]});return ye(e,o)}function GT(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=ft(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return Pt(this,"shape",a),a},checks:[]});return ye(e,o)}function WT(e,t){if(!Ot(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let o=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=ft(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Pt(this,"shape",o),o}});return ye(e,r)}function HT(e,t){if(!Ot(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=ft(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Pt(this,"shape",i),i}});return ye(e,n)}function KT(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=ft(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return Pt(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ye(e,n)}function qT(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=ft(t._zod.def,{get shape(){let s=t._zod.def.shape,u={...s};if(n)for(let l in n){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=e?new e({type:"optional",innerType:s[l]}):s[l])}else for(let l in s)u[l]=e?new e({type:"optional",innerType:s[l]}):s[l];return Pt(this,"shape",u),u},checks:[]});return ye(t,a)}function XT(e,t,n){let i=ft(t._zod.def,{get shape(){let r=t._zod.def.shape,o={...r};if(n)for(let a in n){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(o[a]=new e({type:"nonoptional",innerType:r[a]}))}else for(let a in r)o[a]=new e({type:"nonoptional",innerType:r[a]});return Pt(this,"shape",o),o}});return ye(t,i)}function Dt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function nu(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function we(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Zn(e){return typeof e=="string"?e:e?.message}function Se(e,t,n){let i=e.message?e.message:Zn(e.inst?._zod.def?.error?.(e))??Zn(t?.error?.(e))??Zn(n.customError?.(e))??Zn(n.localeError?.(e))??"Invalid input",{inst:r,continue:o,input:a,...s}=e;return s.path??(s.path=[]),s.message=i,t?.reportInput&&(s.input=a),s}function Hn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Kn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function y(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function wr(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function YT(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function iv(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function ov(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function JT(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return iv(t+n)}function QT(e){return ov(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function e0(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}function t0(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Kc=class{constructor(...t){}};var av=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Tr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},qn=p("$ZodError",av),Ne=p("$ZodError",av,{Parent:Error});function Xn(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):i.push(t(r));return{formErrors:i,fieldErrors:n}}function Yn(e,t=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>i({issues:s},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let s=[...o,...a.path];if(s.length===0)n._errors.push(t(a));else{let u=n,l=0;for(;l<s.length;){let m=s[l];l===s.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(t(a))):u[m]=u[m]||{_errors:[]},u=u[m],l++}}}};return i(e),n}function iu(e,t=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var a,s;for(let u of r.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>i({issues:l},[...o,...u.path]));else if(u.code==="invalid_key")i({issues:u.issues},[...o,...u.path]);else if(u.code==="invalid_element")i({issues:u.issues},[...o,...u.path]);else{let l=[...o,...u.path];if(l.length===0){n.errors.push(t(u));continue}let m=n,f=0;for(;f<l.length;){let h=l[f],v=f===l.length-1;typeof h=="string"?(m.properties??(m.properties={}),(a=m.properties)[h]??(a[h]={errors:[]}),m=m.properties[h]):(m.items??(m.items=[]),(s=m.items)[h]??(s[h]={errors:[]}),m=m.items[h]),v&&m.errors.push(t(u)),f++}}};return i(e),n}function sv(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function ou(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${sv(i.path)}`);return t.join(`
115
+ `);this.buffer=[]}}info(t,n,i){this.log("info",t,n,i)}warn(t,n,i){this.log("warn",t,n,i)}error(t,n,i){this.log("error",t,n,i)}debug(t,n,i){this.log("debug",t,n,i)}stackEvent(t,n,i,r){this.log("info","StackDeployment",i,r,t,n)}dockerEvent(t,n){this.log("info","DockerOperation",t,{percentage:n})}ecsEvent(t,n,i){this.log("info","ECSDeployment",t,{percentage:n,taskCount:i})}close(){this.isClosing=!0,this.flush(),this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.logStream&&(this.logStream.end(),this.logStream=null),this.buffer=[],this.isClosing=!1}getLogPath(){return this.logPath}getDeploymentId(){return this.deploymentId}};var So=class e{static instance=null;config;debugEnabled;traceEnabled;minLevel;fileWriter;mainLogPath;debugLogPath;constructor(){let t=$r(),n=Fc(t,"debug"),i=this.parseEnvInt("FJALL_LOG_MAX_SIZE",Ke.MAX_FILE_SIZE),r=this.parseEnvInt("FJALL_LOG_MAX_FILES",Ke.MAX_FILES);this.config={logDir:t,debugLogDir:n,maxFileSize:i,maxFiles:r,maxBufferSize:Ke.MAX_BUFFER_SIZE,flushIntervalMs:Ke.FLUSH_INTERVAL_MS},this.mainLogPath=Fc(t,Ke.LOG_FILENAME),this.debugLogPath=Fc(n,Ke.DEBUG_LOG_FILENAME),this.debugEnabled=process.env.FJALL_DEBUG==="true"||process.env.FJALL_TRACE==="true"||process.argv.includes("--verbose")||process.argv.includes("-v"),this.traceEnabled=process.env.FJALL_TRACE==="true";let o=process.env.FJALL_LOG_LEVEL?.toLowerCase();o&&o in er?this.minLevel=o:this.traceEnabled?this.minLevel="trace":this.debugEnabled?this.minLevel="debug":this.minLevel="info",this.fileWriter=new yo(this.config,this.mainLogPath,this.debugLogPath,this.debugEnabled)}parseEnvInt(t,n){let i=process.env[t];if(i){let r=parseInt(i,10);if(!isNaN(r)&&r>0)return r}return n}static getInstance(){return e.instance||(e.instance=new e),e.instance}shouldLog(t){return er[t]>=er[this.minLevel]}createEntry(t,n,i,r,o,a,s){return{timestamp:new Date().toISOString(),level:t,component:n,message:i,...o&&{correlationId:o},...r&&Object.keys(r).length>0&&{data:r},...a&&{stackName:a},...s&&{phase:s}}}log(t,n,i,r,o,a,s){if(!this.shouldLog(t))return;let u=this.createEntry(t,n,i,r,o,a,s),l=t==="debug"||t==="trace";this.fileWriter.write(u,l),this.writeConsole(u)}writeConsole(t){if(Me.shouldSuppressOutput||Me.isNonInteractive)return;let n=this.getConsolePrefix(t.level),i=`[${t.component}]`,r=`${n} ${i} ${t.message}`;t.level==="error"?console.error(r):t.level==="warn"?console.warn(r):console.log(r)}getConsolePrefix(t){switch(t){case"error":return"[ERROR]";case"warn":return"[WARN]";case"info":return"[INFO]";case"debug":return"[DEBUG]";case"trace":return"[TRACE]"}}error(t,n,i){this.log("error",t,n,i)}warn(t,n,i){this.log("warn",t,n,i)}info(t,n,i){this.log("info",t,n,i)}debug(t,n,i){this.log("debug",t,n,i)}trace(t,n,i){this.log("trace",t,n,i)}isDebugEnabled(){return this.debugEnabled}isTraceEnabled(){return this.traceEnabled}enableDebug(){this.debugEnabled=!0,er[this.minLevel]>er.debug&&(this.minLevel="debug"),this.fileWriter.setDebugEnabled(!0),this.fileWriter.isInitialised&&this.fileWriter.initialiseDebugStream()}withCorrelation(t){return new Ar(this,t)}forDeployment(t,n="deploy"){return new Bn(this,t,n)}close(){this.fileWriter.close()}getLogPath(){return this.mainLogPath}getDebugLogPath(){return this.debugLogPath}getLogDir(){return this.config.logDir}logWithCorrelation(t,n,i,r,o,a,s){this.log(t,n,i,o,r,a,s)}static reset(){e.instance&&(e.instance.close(),e.instance=null)}};var bo=So.getInstance();function pt(e){return e.replace(/[-_](.)/g,(t,n)=>n.toUpperCase()).replace(/^./,t=>t.toUpperCase())}function Ir(e){return e instanceof Error?e.message:typeof e=="string"?e:e&&typeof e=="object"&&"message"in e?String(e.message):"An unknown error occurred"}var Jg=["production","staging","development","platform","compliance"];var Qg={ROOT:"root",PLATFORM:"platform"},yT=[...Jg,Qg.ROOT];var P4=Object.freeze({"AWS::IAM::Role":"security","AWS::IAM::Policy":"security","AWS::IAM::OIDCProvider":"security","AWS::EC2::SecurityGroup":"security","AWS::KMS::Key":"security","AWS::KMS::Alias":"security","AWS::EC2::VPC":"network","AWS::EC2::Subnet":"network","AWS::EC2::InternetGateway":"network","AWS::EC2::NatGateway":"network","AWS::EC2::RouteTable":"network","AWS::EC2::Route":"network","AWS::EC2::VPCGatewayAttachment":"network","AWS::EC2::SubnetRouteTableAssociation":"network","AWS::EC2::EIP":"network","AWS::ECS::Cluster":"compute","AWS::ECS::Service":"compute","AWS::ECS::TaskDefinition":"compute","AWS::Lambda::Function":"compute","AWS::ElasticLoadBalancingV2::LoadBalancer":"compute","AWS::ElasticLoadBalancingV2::TargetGroup":"compute","AWS::ElasticLoadBalancingV2::Listener":"compute","AWS::ElasticLoadBalancingV2::ListenerRule":"compute","AWS::RDS::DBInstance":"database","AWS::RDS::DBCluster":"database","AWS::SecretsManager::Secret":"database","AWS::S3::Bucket":"storage","AWS::S3::BucketPolicy":"storage","AWS::CloudTrail::Trail":"monitoring","AWS::CloudWatch::Alarm":"monitoring","AWS::Logs::LogGroup":"monitoring","AWS::Events::EventBus":"events","AWS::Events::Rule":"events","AWS::ECR::Repository":"registry","AWS::CodeBuild::Project":"registry","AWS::Route53::RecordSet":"dns","AWS::CertificateManager::Certificate":"dns","AWS::CloudFront::Distribution":"dns","AWS::Backup::BackupVault":"backup","AWS::Backup::BackupPlan":"backup","AWS::Backup::BackupSelection":"backup","AWS::SSO::PermissionSet":"identity","AWS::SSO::Assignment":"identity","AWS::Organizations::Account":"identity","AWS::CDK::Metadata":"compute","AWS::CloudFormation::CustomResource":"compute","AWS::CloudFormation::WaitCondition":"compute","AWS::CloudFormation::WaitConditionHandle":"compute"});var O4=Object.freeze({"AWS::EC2::NatGateway":120,"AWS::RDS::DBInstance":300,"AWS::RDS::DBCluster":300,"AWS::CloudFront::Distribution":300,"AWS::ECS::Service":180,"AWS::ElasticLoadBalancingV2::LoadBalancer":60,"AWS::EC2::SecurityGroup":10,"AWS::IAM::Role":15,"AWS::IAM::Policy":15,"AWS::IAM::OIDCProvider":10,"AWS::S3::Bucket":10,"AWS::S3::BucketPolicy":5,"AWS::Lambda::Function":30,"AWS::EC2::VPC":15,"AWS::EC2::Subnet":15,"AWS::EC2::InternetGateway":10,"AWS::EC2::RouteTable":5,"AWS::EC2::Route":5,"AWS::EC2::VPCGatewayAttachment":10,"AWS::EC2::SubnetRouteTableAssociation":5,"AWS::EC2::EIP":10,"AWS::ECS::Cluster":15,"AWS::ECS::TaskDefinition":10,"AWS::ElasticLoadBalancingV2::TargetGroup":10,"AWS::ElasticLoadBalancingV2::Listener":10,"AWS::ElasticLoadBalancingV2::ListenerRule":5,"AWS::SecretsManager::Secret":10,"AWS::Logs::LogGroup":5,"AWS::CloudWatch::Alarm":10,"AWS::CloudTrail::Trail":15,"AWS::Events::EventBus":5,"AWS::Events::Rule":5,"AWS::ECR::Repository":10,"AWS::Route53::RecordSet":30,"AWS::CertificateManager::Certificate":60,"AWS::KMS::Key":15,"AWS::KMS::Alias":5,"AWS::Backup::BackupVault":10,"AWS::Backup::BackupPlan":10,"AWS::Backup::BackupSelection":10,"AWS::SSO::PermissionSet":15,"AWS::SSO::Assignment":10,"AWS::Organizations::Account":60});var D4=Object.freeze({"AWS::Lambda::Function":"Lambda Function","AWS::IAM::Role":"IAM Role","AWS::IAM::Policy":"IAM Policy","AWS::S3::Bucket":"S3 Bucket","AWS::DynamoDB::Table":"DynamoDB Table","AWS::EC2::Instance":"EC2 Instance","AWS::EC2::SecurityGroup":"Security Group","AWS::EC2::VPC":"VPC","AWS::EC2::Subnet":"Subnet","AWS::EC2::InternetGateway":"Internet Gateway","AWS::EC2::RouteTable":"Route Table","AWS::EC2::Route":"Route","AWS::ECS::Cluster":"ECS Cluster","AWS::ECS::Service":"ECS Service","AWS::ECS::TaskDefinition":"Task Definition","AWS::ElasticLoadBalancingV2::LoadBalancer":"Load Balancer","AWS::ElasticLoadBalancingV2::TargetGroup":"Target Group","AWS::ElasticLoadBalancingV2::Listener":"Listener","AWS::CloudFormation::Stack":"CloudFormation Stack","AWS::CDK::Metadata":"CDK Metadata","Custom::CDKBucketDeployment":"Bucket Deployment","AWS::SSM::Parameter":"SSM Parameter","AWS::CloudWatch::Alarm":"CloudWatch Alarm","AWS::Logs::LogGroup":"Log Group","AWS::ApiGateway::RestApi":"API Gateway","AWS::ApiGateway::Deployment":"API Deployment","AWS::ApiGateway::Stage":"API Stage","AWS::ApiGateway::Method":"API Method","AWS::ApiGateway::Resource":"API Resource","AWS::CloudFront::Distribution":"CloudFront Distribution","AWS::Route53::RecordSet":"Route53 Record","AWS::RDS::DBInstance":"RDS Instance","AWS::RDS::DBCluster":"RDS Cluster","AWS::SQS::Queue":"SQS Queue","AWS::SNS::Topic":"SNS Topic","AWS::Events::Rule":"EventBridge Rule","AWS::StepFunctions::StateMachine":"Step Function","AWS::EC2::NatGateway":"NAT Gateway","AWS::EC2::EIP":"Elastic IP","AWS::EC2::VPCGatewayAttachment":"Gateway Attachment","AWS::EC2::SubnetRouteTableAssociation":"Route Association","AWS::CloudTrail::Trail":"CloudTrail","AWS::IAM::OIDCProvider":"OIDC Provider","AWS::Events::EventBus":"Event Bus","AWS::Backup::BackupVault":"Backup Vault","AWS::Backup::BackupPlan":"Backup Plan","AWS::Backup::BackupSelection":"Backup Selection","AWS::SecretsManager::Secret":"Secret","AWS::KMS::Key":"KMS Key","AWS::KMS::Alias":"KMS Alias","AWS::ECR::Repository":"ECR Repository","AWS::CertificateManager::Certificate":"Certificate","AWS::ElasticLoadBalancingV2::ListenerRule":"Listener Rule","AWS::EC2::IPAM":"IPAM","AWS::EC2::IPAMPool":"IPAM Pool","AWS::EC2::IPAMPoolCidr":"IPAM Pool CIDR","Custom::ram":"RAM","Custom::ipamDelegateAdmin":"IPAM Delegate Admin","Custom::CostAllocationTags":"Cost Allocation Tags","Custom::ActivateOrganisationsAccess":"Activate Organisations Access","Custom::Organizations_TagResource":"Organisations Tag Resource","AWS::CloudFormation::CustomResource":"Custom Resource","AWS::CloudFormation::WaitCondition":"Wait Condition","AWS::CloudFormation::WaitConditionHandle":"Wait Condition Handle","AWS::SSO::PermissionSet":"SSO Permission Set","AWS::SSO::Assignment":"SSO Assignment","AWS::Organizations::Account":"Organisations Account","AWS::S3::BucketPolicy":"S3 Bucket Policy","AWS::CodeBuild::Project":"CodeBuild Project"});function Te(e){return{success:!0,data:e}}function Ce(e){return{success:!1,error:e}}var tv=/^[a-zA-Z][a-zA-Z0-9-]*$/,H=Object.freeze({IDENTIFIER:tv,RESOURCE_NAME:/^[a-zA-Z][a-zA-Z0-9]*$/,ECS_SERVICE_NAME:tv,BUCKET_NAME:/^[a-z][a-z0-9-]*[a-z0-9]$|^[a-z][a-z0-9]*$/,DATABASE_NAME:/^[a-zA-Z][a-zA-Z0-9_]*$/,RESOURCE_TYPE:/^[a-z]+(:[a-z]+)?$/,SSM_PATH:/^\/[a-zA-Z][a-zA-Z0-9-]*(\/[a-zA-Z][a-zA-Z0-9-]*)*$/,SECRET_NAME:/^[a-zA-Z_][a-zA-Z0-9._-]*$/,SSM_COMPONENT:/^[a-zA-Z][a-zA-Z0-9._-]*$/,EMAIL:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,DOCKER_IMAGE:/^[a-z0-9][a-z0-9._-]*[a-z0-9](:[a-z0-9._-]+)?$/,DOMAIN:/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i,PASCAL_CASE:/^[A-Z][A-Za-z0-9]*$/,AWS_ACCOUNT_ID:/^\d{12}$/,VPC_ID:/^vpc-[a-z0-9]+$/,ROLE_ARN:/^arn:aws[a-zA-Z-]*:iam::\d{12}:role\/.+$/,CIDR:/^((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\/(3[0-2]|[12]?\d)$/,SCHEDULE_EXPRESSION:/^(rate\(1 (?:minute|hour|day)\)|rate\((?:[2-9]|[1-9]\d+) (?:minutes|hours|days)\)|cron\([^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+\))$/,LAMBDA_RUNTIME_IDENTIFIER:/^[A-Za-z0-9._-]+$/,ENV_VAR_NAME:/^[A-Za-z_][A-Za-z0-9_]*$/});var d=Object.freeze({IDENTIFIER:"Must start with a letter, contain only letters, numbers, and hyphens",IDENTIFIER_MIN_LENGTH:"Must be at least 2 characters",IDENTIFIER_NO_TRAILING_HYPHEN:"Must not end with a hyphen",IDENTIFIER_NO_CONSECUTIVE_HYPHENS:"Must not contain consecutive hyphens",RESOURCE_NAME:"Must start with a letter and contain only letters and numbers (PascalCase recommended)",ECS_SERVICE_NAME:"Service name must start with a letter and contain only letters, numbers, and hyphens",BUCKET_NAME:"Bucket name must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",DATABASE_NAME:"Database name must start with a letter and contain only letters, numbers, and underscores",RESOURCE_TYPE:"Resource type must be in format 'category' or 'category:type'",SSM_PATH:"SSM path must start with / and contain valid namespace segments (e.g., /myapp/ApiCluster/service)",SECRET_NAME:"Secret name must start with a letter or underscore and contain only letters, numbers, underscores, hyphens, or periods",SSM_COMPONENT:"Must start with a letter and contain only letters, numbers, periods, hyphens, or underscores",EMAIL:"Please enter a valid email address",DOMAIN:"Please enter a valid domain (e.g., cms.example.com)",DOCKER_IMAGE:"Invalid Docker image name format",REQUIRED:{APP_NAME:"Application name is required",RESOURCE_NAME:"Resource name is required",BUCKET_NAME:"Bucket name is required",SERVICE_NAME:"Service name is required",NETWORK_NAME:"Network name is required",DATABASE_NAME:"Database name is required",ORGANISATION_NAME:"Organisation name is required",EMAIL:"Email is required",NAME:"Name is required",USERNAME:"Username is required",CONTAINER_NAME:"Container name is required",FIRST_NAME:"First name is required",LAST_NAME:"Last name is required",GROUP:"Group is required",PATTERN_NAME:"Pattern name is required",ROUTING_PATH:"Routing path is required",RESOURCE_REFERENCE:"Resource reference is required",RESOURCE_TYPE:"Resource type is required",VARIANT:"Variant is required",SUBTYPE:"Subtype is required",DEPLOY_TARGET:"Deploy target is required",DESTROY_TARGET:"Destroy target is required"},MAX_LENGTH:{APP_NAME:"Application name must be 50 characters or less",RESOURCE_NAME:"Resource name must be 63 characters or less",BUCKET_NAME:"Bucket name must be 63 characters or less",SERVICE_NAME:"Service name must be 255 characters or less",NETWORK_NAME:"Network name must be 50 characters or less",DATABASE_NAME:"Database name must be 63 characters or less",ORGANISATION_NAME:"Organisation name must be 50 characters or less"},PORT:{INTEGER:"Port must be an integer",MIN:"Port must be at least 1",MAX:"Port cannot exceed 65535"},USERNAME:{MAX_LENGTH:"Username cannot exceed 63 characters"},LAMBDA:{MEMORY:{INTEGER:"Lambda memory must be an integer",MIN:"Memory must be at least 128 MB",MAX:"Memory cannot exceed 10240 MB",MULTIPLE:"Memory must be 128 MB or a multiple of 64 MB"},TIMEOUT:{INTEGER:"Timeout must be an integer",MIN:"Timeout must be at least 1 second",MAX:"Timeout cannot exceed 900 seconds"},RUNTIME:"Lambda runtime must contain only letters, digits, dots, underscores, or dashes (e.g. 'NODEJS_20_X' or 'nodejs20.x')"},ENV_VAR_NAME:"Environment variable names must start with a letter or underscore and contain only letters, digits, and underscores",PRIORITY:{INTEGER:"Priority must be an integer",MIN:"Priority must be at least 1",MAX:"Priority cannot exceed 50000"},CAPACITY:{MIN:{INTEGER:"Minimum capacity must be an integer",MIN_0:"Minimum capacity must be at least 0",MIN_1:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 100"},MAX:{INTEGER:"Maximum capacity must be an integer",MIN_0:"Maximum capacity must be at least 0",MIN_1:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 100"},DESIRED:{INTEGER:"Desired count must be an integer",MIN:"Desired count must be at least 0",MAX:"Desired count cannot exceed 100"},WARM_POOL_REQUIRED:"minCapacity 0 requires a warmPool \u2014 without it, new tasks wait 60-90s for a cold instance launch",WARM_POOL:{MIN_SIZE:{INTEGER:"Warm pool minSize must be an integer",MIN:"Warm pool minSize must be at least 0",MAX:"Warm pool minSize cannot exceed 100"},MIN_SIZE_EXCEEDS_MAX_CAPACITY:"warmPool.minSize cannot exceed maxCapacity \u2014 the warm pool cannot hold more instances than the ASG allows"}},MEMORY_LIMIT:{INTEGER:"Memory limit must be an integer",MIN_512:"Memory limit must be at least 512 MiB",MIN_128:"Memory limit must be at least 128 MiB",MAX:"Memory limit cannot exceed 30720 MiB"},DATABASE:{PORT:{INTEGER:"Database port must be an integer",MIN:"Database port must be at least 1024",MAX:"Database port cannot exceed 65535"},NAME:{REQUIRED:"Database name is required",MAX_LENGTH:"Database name must be 63 characters or less"}},BACKUP_RETENTION:{INTEGER:"Backup retention must be an integer",MIN:"Backup retention must be at least 1 day",MAX:"Backup retention cannot exceed 35 days"},SQS:{VISIBILITY_TIMEOUT:{INTEGER:"Visibility timeout must be an integer",MIN:"Visibility timeout must be at least 0 seconds",MAX:"Visibility timeout cannot exceed 43200 seconds (12 hours)"},RETENTION_PERIOD:{INTEGER:"Retention period must be an integer",MIN:"Retention period must be at least 60 seconds",MAX:"Retention period cannot exceed 1209600 seconds (14 days)"}},READER:{COUNT:{INTEGER:"Reader count must be an integer",MIN:"Reader count must be at least 0",MAX:"Reader count cannot exceed 15"}},IDENTIFIER_SUFFIX:{REQUIRED:"Identifier suffix is required when specified",MAX_LENGTH:"Identifier suffix cannot exceed 50 characters"},ROTATION:{INTEGER:"Rotation days must be an integer",MIN:"Rotation interval must be at least 1 day",MAX:"Rotation interval cannot exceed 365 days"},MAX_CONNECTIONS:{INTEGER:"Max connections must be an integer",MIN:"Max connections must be at least 1",MAX:"Max connections cannot exceed 100"},MONITORING_INTERVAL:{INTEGER:"Monitoring interval must be an integer",MIN:"Monitoring interval must be at least 0",MAX:"Monitoring interval cannot exceed 60 seconds",VALUES:"Monitoring interval must be 0, 1, 5, 10, 15, 30, or 60 seconds"},RETENTION_DAYS:{INTEGER:"Retention days must be an integer",MIN:"Retention days must be at least 1",MAX:"Retention days cannot exceed 365"},BATCH_SIZE:{INTEGER:"Batch size must be an integer",MIN:"Batch size must be at least 1",MAX:"Batch size cannot exceed 10000"},SERVICE:{UNIQUE_WITHIN_CLUSTER:"Service names must be unique within a cluster",MIN_REQUIRED:"At least one service is required",ROUTING_REQUIRED:"Multiple services with ports require routing config (path or host)"},PROXY_CONFIG:{MAX_IDLE_CONNECTIONS:{INTEGER:"Max idle connections must be an integer",MIN:"Max idle connections must be at least 0",MAX:"Max idle connections cannot exceed 100"},BORROW_TIMEOUT:{INTEGER:"Connection borrow timeout must be an integer",MIN:"Connection borrow timeout must be at least 1 second",MAX:"Connection borrow timeout cannot exceed 3600 seconds"}},MAX_AZS:{INTEGER:"Max AZs must be an integer",MIN:"Max AZs must be at least 1",MAX:"Max AZs cannot exceed 3"},BATCHING_WINDOW:{INTEGER:"Max batching window must be an integer",MIN:"Max batching window must be at least 0",MAX:"Max batching window cannot exceed 300 seconds"},HEALTH_CHECK:{INTERVAL:{INTEGER:"Health check interval must be an integer",MIN:"Health check interval must be at least 5 seconds",MAX:"Health check interval cannot exceed 300 seconds"},TIMEOUT:{INTEGER:"Health check timeout must be an integer",MIN:"Health check timeout must be at least 2 seconds",MAX:"Health check timeout cannot exceed 60 seconds"},RETRIES:{INTEGER:"Health check retries must be an integer",MIN:"Health check retries must be at least 1",MAX:"Health check retries cannot exceed 10"},START_PERIOD:{INTEGER:"Health check start period must be an integer",MIN:"Health check start period must be at least 0 seconds",MAX:"Health check start period cannot exceed 300 seconds"}},EPHEMERAL_STORAGE:{INTEGER:"Ephemeral storage size must be an integer",MIN:"Ephemeral storage size must be at least 512 MB",MAX:"Ephemeral storage size cannot exceed 10240 MB"},MAX_MESSAGE_SIZE:{INTEGER:"Max message size must be an integer",MIN:"Max message size must be at least 1024 bytes",MAX:"Max message size cannot exceed 262144 bytes (256 KB)"},CAPACITY_CONSTRAINT:{MIN_LTE_MAX:"minCapacity must be less than or equal to maxCapacity"},DIRECT_ACCESS:{NO_DOMAIN:"directAccess cannot be used with domain (no ALB for HTTPS)",NO_LOAD_BALANCER:"directAccess cannot be used with loadBalancer (mutually exclusive)"},GLOBAL_AURORA:{PRIMARY_REGION_REQUIRED:"primaryRegion is required for GlobalAurora databases"},NAT_GATEWAY:{INTEGER:"NAT gateway count must be an integer",MIN:"NAT gateway count must be at least 0",MAX:"NAT gateway count cannot exceed 3"},CIDR_MASK:{INTEGER:"CIDR mask must be an integer",MIN:"CIDR mask must be at least 16",MAX:"CIDR mask cannot exceed 28"},CPU:{INTEGER:"CPU must be an integer",MIN:"CPU must be at least 256 units",MAX:"CPU cannot exceed 4096 units"},KMS:{KEY_REQUIRED:"KMS key ARN is required when using KMS encryption"},READER_INSTANCES:{MAX:"Cannot have more than 15 reader instances",COUNT_OR_INSTANCES:"Cannot specify both 'count' and 'instances' - use one or the other"},GENERATOR_CAPACITY:{MIN:{MIN:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 1000"},MAX:{MIN:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 1000"}},INSTANCE_TYPE:"Unknown instance type. Common types include: t4g.micro, t4g.small, m5.large",ARCHITECTURE_MISMATCH:"Architecture mismatch between instance type and AMI",ALLOCATED_STORAGE:{INTEGER:"Allocated storage must be an integer",MIN:"Allocated storage must be at least 20 GB",MAX:"Allocated storage cannot exceed 65536 GB"},DLQ:{MAX_RECEIVE_COUNT:{INTEGER:"Max receive count must be an integer",MIN:"Max receive count must be at least 1",MAX:"Max receive count cannot exceed 1000"}},ALARM:{PERCENTAGE:{MIN:"Threshold must be at least 1%",MAX:"Threshold must be at most 100%"},FREE_STORAGE_GIB:{MIN:"Free storage threshold must be at least 1 GiB"}},REGION:"Invalid AWS region",PASCAL_CASE:"Resource name must start with an uppercase letter and contain only alphanumerics (PascalCase).",IMAGE_DOCKER_MUTEX:"image and docker are mutually exclusive",AWS_ACCOUNT_ID:"AWS account id must be exactly 12 digits (no hyphens)",VPC_ID:"VPC id must look like vpc-abc12345",ROLE_ARN:"Role ARN must have the form arn:aws:iam::<account-id>:role/<name>",CIDR:"CIDR must be in dotted-quad/prefix-length form (e.g. 10.0.0.0/16)",VPC_PEER:{MIN_REQUESTER_ACCOUNTS:"At least one requester account id is required",REGION_REQUIRED:"Peer region is required when specified",ROUTE_TABLE_ID_REQUIRED:"Route table id must not be empty"},SCHEDULE_EXPRESSION:"Schedule expression must be 'rate(N minute|minutes|hour|hours|day|days)' with N>=1, or 'cron(<6-field AWS expression>)'"});var Vc=Object.freeze(["us-east-2","us-west-2","us-east-1","eu-west-1","eu-central-1","ap-southeast-1","ap-northeast-1","ap-southeast-2","us-west-1","ca-central-1","af-south-1","ap-east-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-south-2","ap-southeast-3","ap-southeast-4","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-2","eu-west-3","me-central-1","me-south-1","sa-east-1"]),CT=Object.freeze([{code:"us-east-2",name:"US East",city:"Ohio",country:"USA"},{code:"us-west-2",name:"US West",city:"Oregon",country:"USA"},{code:"us-east-1",name:"US East",city:"N. Virginia",country:"USA"},{code:"eu-west-1",name:"EU West",city:"Ireland",country:"Ireland"},{code:"eu-central-1",name:"EU Central",city:"Frankfurt",country:"Germany"},{code:"ap-southeast-1",name:"Asia Pacific",city:"Singapore",country:"Singapore"},{code:"ap-northeast-1",name:"Asia Pacific",city:"Tokyo",country:"Japan"},{code:"ap-southeast-2",name:"Asia Pacific",city:"Sydney",country:"Australia"},{code:"us-west-1",name:"US West",city:"N. California",country:"USA"},{code:"ca-central-1",name:"Canada",city:"Central",country:"Canada"},{code:"af-south-1",name:"Africa",city:"Cape Town",country:"South Africa"},{code:"ap-east-1",name:"Asia Pacific",city:"Hong Kong",country:"China"},{code:"ap-northeast-2",name:"Asia Pacific",city:"Seoul",country:"South Korea"},{code:"ap-northeast-3",name:"Asia Pacific",city:"Osaka",country:"Japan"},{code:"ap-south-1",name:"Asia Pacific",city:"Mumbai",country:"India"},{code:"ap-south-2",name:"Asia Pacific",city:"Hyderabad",country:"India"},{code:"ap-southeast-3",name:"Asia Pacific",city:"Jakarta",country:"Indonesia"},{code:"ap-southeast-4",name:"Asia Pacific",city:"Melbourne",country:"Australia"},{code:"eu-central-2",name:"EU Central",city:"Zurich",country:"Switzerland"},{code:"eu-north-1",name:"EU North",city:"Stockholm",country:"Sweden"},{code:"eu-south-1",name:"EU South",city:"Milan",country:"Italy"},{code:"eu-south-2",name:"EU South",city:"Spain",country:"Spain"},{code:"eu-west-2",name:"EU West",city:"London",country:"UK"},{code:"eu-west-3",name:"EU West",city:"Paris",country:"France"},{code:"me-central-1",name:"Middle East",city:"UAE",country:"UAE"},{code:"me-south-1",name:"Middle East",city:"Bahrain",country:"Bahrain"},{code:"sa-east-1",name:"South America",city:"S\xE3o Paulo",country:"Brazil"}]),wT=Object.freeze([{code:"us-east-2",name:"US East",city:"Ohio",country:"USA"},{code:"us-west-2",name:"US West",city:"Oregon",country:"USA"},{code:"us-east-1",name:"US East",city:"N. Virginia",country:"USA"},{code:"eu-west-1",name:"EU West",city:"Ireland",country:"Ireland"},{code:"eu-central-1",name:"EU Central",city:"Frankfurt",country:"Germany"},{code:"ap-southeast-1",name:"Asia Pacific",city:"Singapore",country:"Singapore"}]),NT=Object.freeze(["us-east-2","us-west-2","us-east-1","eu-west-1","ap-southeast-1"]);var c={};et(c,{$brand:()=>Wc,$input:()=>pd,$output:()=>md,NEVER:()=>Gc,TimePrecision:()=>vd,ZodAny:()=>ap,ZodArray:()=>lp,ZodBase64:()=>Ha,ZodBase64URL:()=>Ka,ZodBigInt:()=>nn,ZodBigIntFormat:()=>Ya,ZodBoolean:()=>rn,ZodCIDRv4:()=>Ga,ZodCIDRv6:()=>Wa,ZodCUID:()=>ja,ZodCUID2:()=>La,ZodCatch:()=>Rp,ZodCodec:()=>Si,ZodCustom:()=>_i,ZodCustomStringFormat:()=>en,ZodDate:()=>hi,ZodDefault:()=>Ip,ZodDiscriminatedUnion:()=>mp,ZodE164:()=>qa,ZodEmail:()=>Da,ZodEmoji:()=>Ma,ZodEnum:()=>Jr,ZodError:()=>sw,ZodExactOptional:()=>Ep,ZodFile:()=>_p,ZodFirstPartyTypeKind:()=>Gp,ZodFunction:()=>Bp,ZodGUID:()=>li,ZodIPv4:()=>Za,ZodIPv6:()=>Va,ZodISODate:()=>wa,ZodISODateTime:()=>Ca,ZodISODuration:()=>ka,ZodISOTime:()=>Na,ZodIntersection:()=>pp,ZodIssueCode:()=>uw,ZodJWT:()=>Xa,ZodKSUID:()=>Ba,ZodLazy:()=>Lp,ZodLiteral:()=>Sp,ZodMAC:()=>Qm,ZodMap:()=>bp,ZodNaN:()=>Op,ZodNanoID:()=>za,ZodNever:()=>cp,ZodNonOptional:()=>ns,ZodNull:()=>ip,ZodNullable:()=>$p,ZodNumber:()=>tn,ZodNumberFormat:()=>ur,ZodObject:()=>vi,ZodOptional:()=>rs,ZodPipe:()=>yi,ZodPrefault:()=>Cp,ZodPreprocess:()=>Dp,ZodPromise:()=>Fp,ZodReadonly:()=>Mp,ZodRealError:()=>ke,ZodRecord:()=>Yr,ZodSet:()=>yp,ZodString:()=>Qr,ZodStringFormat:()=>V,ZodSuccess:()=>kp,ZodSymbol:()=>rp,ZodTemplateLiteral:()=>jp,ZodTransform:()=>xp,ZodTuple:()=>hp,ZodType:()=>N,ZodULID:()=>Ua,ZodURL:()=>fi,ZodUUID:()=>it,ZodUndefined:()=>np,ZodUnion:()=>bi,ZodUnknown:()=>sp,ZodVoid:()=>up,ZodXID:()=>Fa,ZodXor:()=>dp,_ZodString:()=>Oa,_default:()=>Tp,_function:()=>Zy,any:()=>Sy,array:()=>gi,base64:()=>ny,base64url:()=>iy,bigint:()=>hy,boolean:()=>tp,catch:()=>Pp,check:()=>Vy,cidrv4:()=>ty,cidrv6:()=>ry,clone:()=>ye,codec:()=>Ly,coerce:()=>Wp,config:()=>ne,core:()=>gt,cuid:()=>Hb,cuid2:()=>Kb,custom:()=>Gy,date:()=>xy,decode:()=>Wm,decodeAsync:()=>Km,describe:()=>Wy,discriminatedUnion:()=>Cy,e164:()=>oy,email:()=>zb,emoji:()=>Gb,encode:()=>Gm,encodeAsync:()=>Hm,endsWith:()=>Fr,enum:()=>es,exactOptional:()=>Ap,file:()=>Dy,flattenError:()=>Xn,float32:()=>dy,float64:()=>my,formatError:()=>Yn,fromJSONSchema:()=>Qy,function:()=>Zy,getErrorMap:()=>dw,globalRegistry:()=>pe,gt:()=>rt,gte:()=>_e,guid:()=>jb,hash:()=>ly,hex:()=>uy,hostname:()=>cy,httpUrl:()=>Vb,includes:()=>Lr,instanceof:()=>Ky,int:()=>Ra,int32:()=>py,int64:()=>gy,intersection:()=>fp,invertCodec:()=>Uy,ipv4:()=>Jb,ipv6:()=>ey,iso:()=>Xr,json:()=>Xy,jwt:()=>ay,keyof:()=>Ey,ksuid:()=>Yb,lazy:()=>Up,length:()=>sr,literal:()=>Oy,locales:()=>oi,looseObject:()=>Iy,looseRecord:()=>Ny,lowercase:()=>zr,lt:()=>tt,lte:()=>je,mac:()=>Qb,map:()=>ky,maxLength:()=>ar,maxSize:()=>zt,meta:()=>Hy,mime:()=>Br,minLength:()=>ht,minSize:()=>nt,multipleOf:()=>Mt,nan:()=>jy,nanoid:()=>Wb,nativeEnum:()=>Py,negative:()=>ba,never:()=>Ja,nonnegative:()=>Sa,nonoptional:()=>Np,nonpositive:()=>ya,normalize:()=>Zr,null:()=>op,nullable:()=>mi,nullish:()=>My,number:()=>ep,object:()=>Ay,optional:()=>di,overwrite:()=>Xe,parse:()=>Fm,parseAsync:()=>Bm,partialRecord:()=>wy,pipe:()=>Pa,positive:()=>va,prefault:()=>wp,preprocess:()=>Yy,prettifyError:()=>ou,promise:()=>By,property:()=>_a,readonly:()=>zp,record:()=>vp,refine:()=>Zp,regex:()=>Mr,regexes:()=>ze,registry:()=>Xo,safeDecode:()=>Xm,safeDecodeAsync:()=>Jm,safeEncode:()=>qm,safeEncodeAsync:()=>Ym,safeParse:()=>Zm,safeParseAsync:()=>Vm,set:()=>Ry,setErrorMap:()=>lw,size:()=>or,slugify:()=>Hr,startsWith:()=>Ur,strictObject:()=>$y,string:()=>ui,stringFormat:()=>sy,stringbool:()=>qy,success:()=>zy,superRefine:()=>Vp,symbol:()=>by,templateLiteral:()=>Fy,toJSONSchema:()=>$a,toLowerCase:()=>Gr,toUpperCase:()=>Wr,transform:()=>ts,treeifyError:()=>iu,trim:()=>Vr,tuple:()=>gp,uint32:()=>fy,uint64:()=>vy,ulid:()=>qb,undefined:()=>yy,union:()=>Qa,unknown:()=>cr,uppercase:()=>jr,url:()=>Zb,util:()=>S,uuid:()=>Lb,uuidv4:()=>Ub,uuidv6:()=>Fb,uuidv7:()=>Bb,void:()=>_y,xid:()=>Xb,xor:()=>Ty});var gt={};et(gt,{$ZodAny:()=>Ol,$ZodArray:()=>Ll,$ZodAsyncError:()=>qe,$ZodBase64:()=>Al,$ZodBase64URL:()=>$l,$ZodBigInt:()=>Bo,$ZodBigIntFormat:()=>Nl,$ZodBoolean:()=>ti,$ZodCIDRv4:()=>_l,$ZodCIDRv6:()=>xl,$ZodCUID:()=>ul,$ZodCUID2:()=>ll,$ZodCatch:()=>nd,$ZodCheck:()=>K,$ZodCheckBigIntFormat:()=>Lu,$ZodCheckEndsWith:()=>Yu,$ZodCheckGreaterThan:()=>Mo,$ZodCheckIncludes:()=>qu,$ZodCheckLengthEquals:()=>Gu,$ZodCheckLessThan:()=>Do,$ZodCheckLowerCase:()=>Hu,$ZodCheckMaxLength:()=>Zu,$ZodCheckMaxSize:()=>Uu,$ZodCheckMimeType:()=>Qu,$ZodCheckMinLength:()=>Vu,$ZodCheckMinSize:()=>Fu,$ZodCheckMultipleOf:()=>zu,$ZodCheckNumberFormat:()=>ju,$ZodCheckOverwrite:()=>el,$ZodCheckProperty:()=>Ju,$ZodCheckRegex:()=>Wu,$ZodCheckSizeEquals:()=>Bu,$ZodCheckStartsWith:()=>Xu,$ZodCheckStringFormat:()=>Or,$ZodCheckUpperCase:()=>Ku,$ZodCodec:()=>ni,$ZodCustom:()=>dd,$ZodCustomStringFormat:()=>Cl,$ZodDate:()=>jl,$ZodDefault:()=>Ql,$ZodDiscriminatedUnion:()=>Bl,$ZodE164:()=>Il,$ZodEmail:()=>ol,$ZodEmoji:()=>sl,$ZodEncodeError:()=>kt,$ZodEnum:()=>Hl,$ZodError:()=>qn,$ZodExactOptional:()=>Yl,$ZodFile:()=>ql,$ZodFunction:()=>cd,$ZodGUID:()=>nl,$ZodIPv4:()=>bl,$ZodIPv6:()=>yl,$ZodISODate:()=>hl,$ZodISODateTime:()=>fl,$ZodISODuration:()=>vl,$ZodISOTime:()=>gl,$ZodIntersection:()=>Zl,$ZodJWT:()=>Tl,$ZodKSUID:()=>pl,$ZodLazy:()=>ld,$ZodLiteral:()=>Kl,$ZodMAC:()=>Sl,$ZodMap:()=>Gl,$ZodNaN:()=>id,$ZodNanoID:()=>cl,$ZodNever:()=>Ml,$ZodNonOptional:()=>td,$ZodNull:()=>Pl,$ZodNullable:()=>Jl,$ZodNumber:()=>Fo,$ZodNumberFormat:()=>wl,$ZodObject:()=>Rv,$ZodObjectJIT:()=>Ul,$ZodOptional:()=>Vo,$ZodPipe:()=>Go,$ZodPrefault:()=>ed,$ZodPreprocess:()=>od,$ZodPromise:()=>ud,$ZodReadonly:()=>ad,$ZodRealError:()=>Ne,$ZodRecord:()=>Vl,$ZodRegistry:()=>qo,$ZodSet:()=>Wl,$ZodString:()=>ir,$ZodStringFormat:()=>Z,$ZodSuccess:()=>rd,$ZodSymbol:()=>kl,$ZodTemplateLiteral:()=>sd,$ZodTransform:()=>Xl,$ZodTuple:()=>Zo,$ZodType:()=>w,$ZodULID:()=>dl,$ZodURL:()=>al,$ZodUUID:()=>il,$ZodUndefined:()=>Rl,$ZodUnion:()=>ri,$ZodUnknown:()=>Dl,$ZodVoid:()=>zl,$ZodXID:()=>ml,$ZodXor:()=>Fl,$brand:()=>Wc,$constructor:()=>p,$input:()=>pd,$output:()=>md,Doc:()=>ei,JSONSchema:()=>Ob,JSONSchemaGenerator:()=>Ia,NEVER:()=>Gc,TimePrecision:()=>vd,_any:()=>jd,_array:()=>Gd,_base64:()=>pa,_base64url:()=>fa,_bigint:()=>kd,_boolean:()=>wd,_catch:()=>QC,_check:()=>Pb,_cidrv4:()=>da,_cidrv6:()=>ma,_coercedBigint:()=>Rd,_coercedBoolean:()=>Nd,_coercedDate:()=>Zd,_coercedNumber:()=>Ed,_coercedString:()=>hd,_cuid:()=>ia,_cuid2:()=>oa,_custom:()=>Hd,_date:()=>Bd,_decode:()=>Io,_decodeAsync:()=>Co,_default:()=>XC,_discriminatedUnion:()=>jC,_e164:()=>ha,_email:()=>Yo,_emoji:()=>ra,_encode:()=>$o,_encodeAsync:()=>To,_endsWith:()=>Fr,_enum:()=>VC,_file:()=>Wd,_float32:()=>$d,_float64:()=>Id,_gt:()=>rt,_gte:()=>_e,_guid:()=>ai,_includes:()=>Lr,_int:()=>Ad,_int32:()=>Td,_int64:()=>Pd,_intersection:()=>LC,_ipv4:()=>ua,_ipv6:()=>la,_isoDate:()=>yd,_isoDateTime:()=>bd,_isoDuration:()=>_d,_isoTime:()=>Sd,_jwt:()=>ga,_ksuid:()=>ca,_lazy:()=>nw,_length:()=>sr,_literal:()=>WC,_lowercase:()=>zr,_lt:()=>tt,_lte:()=>je,_mac:()=>gd,_map:()=>BC,_max:()=>je,_maxLength:()=>ar,_maxSize:()=>zt,_mime:()=>Br,_min:()=>_e,_minLength:()=>ht,_minSize:()=>nt,_multipleOf:()=>Mt,_nan:()=>Vd,_nanoid:()=>na,_nativeEnum:()=>GC,_negative:()=>ba,_never:()=>Ud,_nonnegative:()=>Sa,_nonoptional:()=>YC,_nonpositive:()=>ya,_normalize:()=>Zr,_null:()=>zd,_nullable:()=>qC,_number:()=>xd,_optional:()=>KC,_overwrite:()=>Xe,_parse:()=>Nr,_parseAsync:()=>kr,_pipe:()=>ew,_positive:()=>va,_promise:()=>iw,_property:()=>_a,_readonly:()=>tw,_record:()=>FC,_refine:()=>Kd,_regex:()=>Mr,_safeDecode:()=>No,_safeDecodeAsync:()=>Ro,_safeEncode:()=>wo,_safeEncodeAsync:()=>ko,_safeParse:()=>Rr,_safeParseAsync:()=>Pr,_set:()=>ZC,_size:()=>or,_slugify:()=>Hr,_startsWith:()=>Ur,_string:()=>fd,_stringFormat:()=>Kr,_stringbool:()=>Jd,_success:()=>JC,_superRefine:()=>qd,_symbol:()=>Dd,_templateLiteral:()=>rw,_toLowerCase:()=>Gr,_toUpperCase:()=>Wr,_transform:()=>HC,_trim:()=>Vr,_tuple:()=>UC,_uint32:()=>Cd,_uint64:()=>Od,_ulid:()=>aa,_undefined:()=>Md,_union:()=>MC,_unknown:()=>Ld,_uppercase:()=>jr,_url:()=>si,_uuid:()=>Jo,_uuidv4:()=>Qo,_uuidv6:()=>ea,_uuidv7:()=>ta,_void:()=>Fd,_xid:()=>sa,_xor:()=>zC,clone:()=>ye,config:()=>ne,createStandardJSONSchemaMethod:()=>qr,createToJSONSchemaMethod:()=>Qd,decode:()=>i0,decodeAsync:()=>a0,describe:()=>Xd,encode:()=>n0,encodeAsync:()=>o0,extractDefs:()=>Lt,finalize:()=>Ut,flattenError:()=>Xn,formatError:()=>Yn,globalConfig:()=>tr,globalRegistry:()=>pe,initializeContext:()=>jt,isValidBase64:()=>El,isValidBase64URL:()=>Cv,isValidJWT:()=>wv,locales:()=>oi,meta:()=>Yd,parse:()=>Eo,parseAsync:()=>Ao,prettifyError:()=>ou,process:()=>j,regexes:()=>ze,registry:()=>Xo,safeDecode:()=>c0,safeDecodeAsync:()=>l0,safeEncode:()=>s0,safeEncodeAsync:()=>u0,safeParse:()=>au,safeParseAsync:()=>su,toDotPath:()=>sv,toJSONSchema:()=>$a,treeifyError:()=>iu,util:()=>S,version:()=>tl});var rv,Gc=Object.freeze({status:"aborted"});function p(e,t,n){function i(s,u){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,u);let l=a.prototype,m=Object.keys(l);for(let f=0;f<m.length;f++){let h=m[f];h in s||(s[h]=l[h].bind(s))}}let r=n?.Parent??Object;class o extends r{}Object.defineProperty(o,"name",{value:e});function a(s){var u;let l=n?.Parent?new o:this;i(l,s),(u=l._zod).deferred??(u.deferred=[]);for(let m of l._zod.deferred)m();return l}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var Wc=Symbol("zod_brand"),qe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},kt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(rv=globalThis).__zod_globalConfig??(rv.__zod_globalConfig={});var tr=globalThis.__zod_globalConfig;function ne(e){return e&&Object.assign(tr,e),tr}var S={};et(S,{BIGINT_FORMAT_RANGES:()=>ru,Class:()=>Kc,NUMBER_FORMAT_RANGES:()=>tu,aborted:()=>Dt,allowsEval:()=>Yc,assert:()=>DT,assertEqual:()=>kT,assertIs:()=>PT,assertNever:()=>OT,assertNotEqual:()=>RT,assignProp:()=>Pt,base64ToUint8Array:()=>iv,base64urlToUint8Array:()=>JT,cached:()=>Cr,captureStackTrace:()=>xo,cleanEnum:()=>YT,cleanRegex:()=>Gn,clone:()=>ye,cloneDef:()=>zT,createTransparentProxy:()=>ZT,defineLazy:()=>O,esc:()=>_o,escapeRegex:()=>Fe,explicitlyAborted:()=>nu,extend:()=>WT,finalizeIssue:()=>Se,floatSafeRemainder:()=>qc,getElementAtPath:()=>jT,getEnumValues:()=>Vn,getLengthableOrigin:()=>Kn,getParsedType:()=>BT,getSizableOrigin:()=>Hn,hexToUint8Array:()=>e0,isObject:()=>rr,isPlainObject:()=>Ot,issue:()=>wr,joinValues:()=>g,jsonStringifyReplacer:()=>Tr,merge:()=>KT,mergeDefs:()=>ft,normalizeParams:()=>_,nullish:()=>Rt,numKeys:()=>FT,objectClone:()=>MT,omit:()=>GT,optionalKeys:()=>eu,parsedType:()=>y,partial:()=>qT,pick:()=>VT,prefixIssues:()=>we,primitiveTypes:()=>Qc,promiseAllObject:()=>LT,propertyKeyTypes:()=>Wn,randomString:()=>UT,required:()=>XT,safeExtend:()=>HT,shallowClone:()=>Jc,slugify:()=>Xc,stringifyPrimitive:()=>b,uint8ArrayToBase64:()=>ov,uint8ArrayToBase64url:()=>QT,uint8ArrayToHex:()=>t0,unwrapMessage:()=>Zn});function kT(e){return e}function RT(e){return e}function PT(e){}function OT(e){throw new Error("Unexpected value in exhaustive check")}function DT(e){}function Vn(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function g(e,t="|"){return e.map(n=>b(n)).join(t)}function Tr(e,t){return typeof t=="bigint"?t.toString():t}function Cr(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function Rt(e){return e==null}function Gn(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function qc(e,t){let n=e/t,i=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}var nv=Symbol("evaluating");function O(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==nv)return i===void 0&&(i=nv,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function MT(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Pt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ft(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function zT(e){return ft(e._zod.def)}function jT(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function LT(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<t.length;o++)r[t[o]]=i[o];return r})}function UT(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function _o(e){return JSON.stringify(e)}function Xc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var xo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function rr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Yc=Cr(()=>{if(tr.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ot(e){if(rr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(rr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Jc(e){return Ot(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function FT(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var BT=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Wn=new Set(["string","number","symbol"]),Qc=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Fe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ye(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function _(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function ZT(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function b(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function eu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var tu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ru={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function VT(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=ft(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=n.shape[s])}return Pt(this,"shape",a),a},checks:[]});return ye(e,o)}function GT(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=ft(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return Pt(this,"shape",a),a},checks:[]});return ye(e,o)}function WT(e,t){if(!Ot(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let o=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=ft(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Pt(this,"shape",o),o}});return ye(e,r)}function HT(e,t){if(!Ot(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=ft(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Pt(this,"shape",i),i}});return ye(e,n)}function KT(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=ft(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return Pt(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ye(e,n)}function qT(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=ft(t._zod.def,{get shape(){let s=t._zod.def.shape,u={...s};if(n)for(let l in n){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=e?new e({type:"optional",innerType:s[l]}):s[l])}else for(let l in s)u[l]=e?new e({type:"optional",innerType:s[l]}):s[l];return Pt(this,"shape",u),u},checks:[]});return ye(t,a)}function XT(e,t,n){let i=ft(t._zod.def,{get shape(){let r=t._zod.def.shape,o={...r};if(n)for(let a in n){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(o[a]=new e({type:"nonoptional",innerType:r[a]}))}else for(let a in r)o[a]=new e({type:"nonoptional",innerType:r[a]});return Pt(this,"shape",o),o}});return ye(t,i)}function Dt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function nu(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function we(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Zn(e){return typeof e=="string"?e:e?.message}function Se(e,t,n){let i=e.message?e.message:Zn(e.inst?._zod.def?.error?.(e))??Zn(t?.error?.(e))??Zn(n.customError?.(e))??Zn(n.localeError?.(e))??"Invalid input",{inst:r,continue:o,input:a,...s}=e;return s.path??(s.path=[]),s.message=i,t?.reportInput&&(s.input=a),s}function Hn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Kn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function y(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function wr(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function YT(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function iv(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function ov(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function JT(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return iv(t+n)}function QT(e){return ov(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function e0(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}function t0(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Kc=class{constructor(...t){}};var av=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Tr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},qn=p("$ZodError",av),Ne=p("$ZodError",av,{Parent:Error});function Xn(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):i.push(t(r));return{formErrors:i,fieldErrors:n}}function Yn(e,t=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>i({issues:s},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let s=[...o,...a.path];if(s.length===0)n._errors.push(t(a));else{let u=n,l=0;for(;l<s.length;){let m=s[l];l===s.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(t(a))):u[m]=u[m]||{_errors:[]},u=u[m],l++}}}};return i(e),n}function iu(e,t=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var a,s;for(let u of r.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>i({issues:l},[...o,...u.path]));else if(u.code==="invalid_key")i({issues:u.issues},[...o,...u.path]);else if(u.code==="invalid_element")i({issues:u.issues},[...o,...u.path]);else{let l=[...o,...u.path];if(l.length===0){n.errors.push(t(u));continue}let m=n,f=0;for(;f<l.length;){let h=l[f],v=f===l.length-1;typeof h=="string"?(m.properties??(m.properties={}),(a=m.properties)[h]??(a[h]={errors:[]}),m=m.properties[h]):(m.items??(m.items=[]),(s=m.items)[h]??(s[h]={errors:[]}),m=m.items[h]),v&&m.errors.push(t(u)),f++}}};return i(e),n}function sv(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function ou(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${sv(i.path)}`);return t.join(`
116
116
  `)}var Nr=e=>(t,n,i,r)=>{let o=i?{...i,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new qe;if(a.issues.length){let s=new(r?.Err??e)(a.issues.map(u=>Se(u,o,ne())));throw xo(s,r?.callee),s}return a.value},Eo=Nr(Ne),kr=e=>async(t,n,i,r)=>{let o=i?{...i,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(r?.Err??e)(a.issues.map(u=>Se(u,o,ne())));throw xo(s,r?.callee),s}return a.value},Ao=kr(Ne),Rr=e=>(t,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new qe;return o.issues.length?{success:!1,error:new(e??qn)(o.issues.map(a=>Se(a,r,ne())))}:{success:!0,data:o.value}},au=Rr(Ne),Pr=e=>async(t,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>Se(a,r,ne())))}:{success:!0,data:o.value}},su=Pr(Ne),$o=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Nr(e)(t,n,r)},n0=$o(Ne),Io=e=>(t,n,i)=>Nr(e)(t,n,i),i0=Io(Ne),To=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return kr(e)(t,n,r)},o0=To(Ne),Co=e=>async(t,n,i)=>kr(e)(t,n,i),a0=Co(Ne),wo=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Rr(e)(t,n,r)},s0=wo(Ne),No=e=>(t,n,i)=>Rr(e)(t,n,i),c0=No(Ne),ko=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Pr(e)(t,n,r)},u0=ko(Ne),Ro=e=>async(t,n,i)=>Pr(e)(t,n,i),l0=Ro(Ne);var ze={};et(ze,{base64:()=>Eu,base64url:()=>Po,bigint:()=>Nu,boolean:()=>Ru,browserEmail:()=>b0,cidrv4:()=>_u,cidrv6:()=>xu,cuid:()=>cu,cuid2:()=>uu,date:()=>Iu,datetime:()=>Cu,domain:()=>_0,duration:()=>fu,e164:()=>$u,email:()=>gu,emoji:()=>vu,extendedDuration:()=>d0,guid:()=>hu,hex:()=>x0,hostname:()=>S0,html5Email:()=>h0,httpProtocol:()=>Au,idnEmail:()=>v0,integer:()=>ku,ipv4:()=>bu,ipv6:()=>yu,ksuid:()=>mu,lowercase:()=>Du,mac:()=>Su,md5_base64:()=>A0,md5_base64url:()=>$0,md5_hex:()=>E0,nanoid:()=>pu,null:()=>Pu,number:()=>Oo,rfc5322Email:()=>g0,sha1_base64:()=>T0,sha1_base64url:()=>C0,sha1_hex:()=>I0,sha256_base64:()=>N0,sha256_base64url:()=>k0,sha256_hex:()=>w0,sha384_base64:()=>P0,sha384_base64url:()=>O0,sha384_hex:()=>R0,sha512_base64:()=>M0,sha512_base64url:()=>z0,sha512_hex:()=>D0,string:()=>wu,time:()=>Tu,ulid:()=>lu,undefined:()=>Ou,unicodeEmail:()=>cv,uppercase:()=>Mu,uuid:()=>nr,uuid4:()=>m0,uuid6:()=>p0,uuid7:()=>f0,xid:()=>du});var cu=/^[cC][0-9a-z]{6,}$/,uu=/^[0-9a-z]+$/,lu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,du=/^[0-9a-vA-V]{20}$/,mu=/^[A-Za-z0-9]{27}$/,pu=/^[a-zA-Z0-9_-]{21}$/,fu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,d0=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,hu=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,nr=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,m0=nr(4),p0=nr(6),f0=nr(7),gu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,h0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,g0=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,cv=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,v0=cv,b0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,y0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function vu(){return new RegExp(y0,"u")}var bu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,yu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Su=e=>{let t=Fe(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},_u=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,xu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Eu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Po=/^[A-Za-z0-9_-]*$/,S0=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,_0=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Au=/^https?$/,$u=/^\+[1-9]\d{6,14}$/,uv="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Iu=new RegExp(`^${uv}$`);function lv(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Tu(e){return new RegExp(`^${lv(e)}$`)}function Cu(e){let t=lv({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${t}(?:${n.join("|")})`;return new RegExp(`^${uv}T(?:${i})$`)}var wu=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Nu=/^-?\d+n?$/,ku=/^-?\d+$/,Oo=/^-?\d+(?:\.\d+)?$/,Ru=/^(?:true|false)$/i,Pu=/^null$/i;var Ou=/^undefined$/i;var Du=/^[^A-Z]*$/,Mu=/^[^a-z]*$/,x0=/^[0-9a-fA-F]*$/;function Jn(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Qn(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var E0=/^[0-9a-fA-F]{32}$/,A0=Jn(22,"=="),$0=Qn(22),I0=/^[0-9a-fA-F]{40}$/,T0=Jn(27,"="),C0=Qn(27),w0=/^[0-9a-fA-F]{64}$/,N0=Jn(43,"="),k0=Qn(43),R0=/^[0-9a-fA-F]{96}$/,P0=Jn(64,""),O0=Qn(64),D0=/^[0-9a-fA-F]{128}$/,M0=Jn(86,"=="),z0=Qn(86);var K=p("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),mv={number:"number",bigint:"bigint",object:"date"},Do=p("$ZodCheckLessThan",(e,t)=>{K.init(e,t);let n=mv[typeof t.value];e._zod.onattach.push(i=>{let r=i._zod.bag,o=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Mo=p("$ZodCheckGreaterThan",(e,t)=>{K.init(e,t);let n=mv[typeof t.value];e._zod.onattach.push(i=>{let r=i._zod.bag,o=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zu=p("$ZodCheckMultipleOf",(e,t)=>{K.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):qc(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ju=p("$ZodCheckNumberFormat",(e,t)=>{K.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,o]=tu[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=r,s.maximum=o,n&&(s.pattern=ku)}),e._zod.check=a=>{let s=a.value;if(n){if(!Number.isInteger(s)){a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}s<r&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Lu=p("$ZodCheckBigIntFormat",(e,t)=>{K.init(e,t);let[n,i]=ru[t.format];e._zod.onattach.push(r=>{let o=r._zod.bag;o.format=t.format,o.minimum=n,o.maximum=i}),e._zod.check=r=>{let o=r.value;o<n&&r.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),o>i&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Uu=p("$ZodCheckMaxSize",(e,t)=>{var n;K.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Rt(r)&&r.size!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:Hn(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Fu=p("$ZodCheckMinSize",(e,t)=>{var n;K.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Rt(r)&&r.size!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:Hn(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Bu=p("$ZodCheckSizeEquals",(e,t)=>{var n;K.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Rt(r)&&r.size!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=i=>{let r=i.value,o=r.size;if(o===t.size)return;let a=o>t.size;i.issues.push({origin:Hn(r),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Zu=p("$ZodCheckMaxLength",(e,t)=>{var n;K.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Rt(r)&&r.length!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let r=i.value;if(r.length<=t.maximum)return;let a=Kn(r);i.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Vu=p("$ZodCheckMinLength",(e,t)=>{var n;K.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Rt(r)&&r.length!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let r=i.value;if(r.length>=t.minimum)return;let a=Kn(r);i.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Gu=p("$ZodCheckLengthEquals",(e,t)=>{var n;K.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Rt(r)&&r.length!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=i=>{let r=i.value,o=r.length;if(o===t.length)return;let a=Kn(r),s=o>t.length;i.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Or=p("$ZodCheckStringFormat",(e,t)=>{var n,i;K.init(e,t),e._zod.onattach.push(r=>{let o=r._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Wu=p("$ZodCheckRegex",(e,t)=>{Or.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Hu=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Du),Or.init(e,t)}),Ku=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Mu),Or.init(e,t)}),qu=p("$ZodCheckIncludes",(e,t)=>{K.init(e,t);let n=Fe(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Xu=p("$ZodCheckStartsWith",(e,t)=>{K.init(e,t);let n=new RegExp(`^${Fe(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Yu=p("$ZodCheckEndsWith",(e,t)=>{K.init(e,t);let n=new RegExp(`.*${Fe(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function dv(e,t,n){e.issues.length&&t.issues.push(...we(n,e.issues))}var Ju=p("$ZodCheckProperty",(e,t)=>{K.init(e,t),e._zod.check=n=>{let i=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>dv(r,n,t.property));dv(i,n,t.property)}}),Qu=p("$ZodCheckMimeType",(e,t)=>{K.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=t.mime}),e._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),el=p("$ZodCheckOverwrite",(e,t)=>{K.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var ei=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
117
117
  `).filter(a=>a),r=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(r)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let t=Function,n=this?.args,r=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...n,r.join(`
118
118
  `))}};var tl={major:4,minor:4,patch:3};var w=p("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tl;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let r of i)for(let o of r._zod.onattach)o(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(a,s,u)=>{let l=Dt(a),m;for(let f of s){if(f._zod.def.when){if(nu(a)||!f._zod.def.when(a))continue}else if(l)continue;let h=a.issues.length,v=f._zod.check(a);if(v instanceof Promise&&u?.async===!1)throw new qe;if(m||v instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await v,a.issues.length!==h&&(l||(l=Dt(a,h)))});else{if(a.issues.length===h)continue;l||(l=Dt(a,h))}}return m?m.then(()=>a):a},o=(a,s,u)=>{if(Dt(a))return a.aborted=!0,a;let l=r(s,i,u);if(l instanceof Promise){if(u.async===!1)throw new qe;return l.then(m=>e._zod.parse(m,u))}return e._zod.parse(l,u)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return l instanceof Promise?l.then(m=>o(m,a,s)):o(l,a,s)}let u=e._zod.parse(a,s);if(u instanceof Promise){if(s.async===!1)throw new qe;return u.then(l=>r(l,i,s))}return r(u,i,s)}}O(e,"~standard",()=>({validate:r=>{try{let o=au(e,r);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return su(e,r).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),ir=p("$ZodString",(e,t)=>{w.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wu(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Z=p("$ZodStringFormat",(e,t)=>{Or.init(e,t),ir.init(e,t)}),nl=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=hu),Z.init(e,t)}),il=p("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=nr(i))}else t.pattern??(t.pattern=nr());Z.init(e,t)}),ol=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=gu),Z.init(e,t)}),al=p("$ZodURL",(e,t)=>{Z.init(e,t),e._zod.check=n=>{try{let i=n.value.trim();if(!t.normalize&&t.protocol?.source===Au.source&&!/^https?:\/\//i.test(i)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}let r=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=r.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),sl=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=vu()),Z.init(e,t)}),cl=p("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=pu),Z.init(e,t)}),ul=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=cu),Z.init(e,t)}),ll=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=uu),Z.init(e,t)}),dl=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=lu),Z.init(e,t)}),ml=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=du),Z.init(e,t)}),pl=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=mu),Z.init(e,t)}),fl=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Cu(t)),Z.init(e,t)}),hl=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Iu),Z.init(e,t)}),gl=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Tu(t)),Z.init(e,t)}),vl=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=fu),Z.init(e,t)}),bl=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=bu),Z.init(e,t),e._zod.bag.format="ipv4"}),yl=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=yu),Z.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Sl=p("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Su(t.delimiter)),Z.init(e,t),e._zod.bag.format="mac"}),_l=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=_u),Z.init(e,t)}),xl=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=xu),Z.init(e,t),e._zod.check=n=>{let i=n.value.split("/");try{if(i.length!==2)throw new Error;let[r,o]=i;if(!o)throw new Error;let a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function El(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Al=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Eu),Z.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{El(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Cv(e){if(!Po.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return El(n)}var $l=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Po),Z.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Cv(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Il=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=$u),Z.init(e,t)});function wv(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}var Tl=p("$ZodJWT",(e,t)=>{Z.init(e,t),e._zod.check=n=>{wv(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Cl=p("$ZodCustomStringFormat",(e,t)=>{Z.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Fo=p("$ZodNumber",(e,t)=>{w.init(e,t),e._zod.pattern=e._zod.bag.pattern??Oo,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let o=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...o?{received:o}:{}}),n}}),wl=p("$ZodNumberFormat",(e,t)=>{ju.init(e,t),Fo.init(e,t)}),ti=p("$ZodBoolean",(e,t)=>{w.init(e,t),e._zod.pattern=Ru,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),Bo=p("$ZodBigInt",(e,t)=>{w.init(e,t),e._zod.pattern=Nu,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),Nl=p("$ZodBigIntFormat",(e,t)=>{Lu.init(e,t),Bo.init(e,t)}),kl=p("$ZodSymbol",(e,t)=>{w.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),Rl=p("$ZodUndefined",(e,t)=>{w.init(e,t),e._zod.pattern=Ou,e._zod.values=new Set([void 0]),e._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),Pl=p("$ZodNull",(e,t)=>{w.init(e,t),e._zod.pattern=Pu,e._zod.values=new Set([null]),e._zod.parse=(n,i)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),Ol=p("$ZodAny",(e,t)=>{w.init(e,t),e._zod.parse=n=>n}),Dl=p("$ZodUnknown",(e,t)=>{w.init(e,t),e._zod.parse=n=>n}),Ml=p("$ZodNever",(e,t)=>{w.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),zl=p("$ZodVoid",(e,t)=>{w.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),jl=p("$ZodDate",(e,t)=>{w.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,o=r instanceof Date;return o&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...o?{received:"Invalid Date"}:{},inst:e}),n}});function fv(e,t,n){e.issues.length&&t.issues.push(...we(n,e.issues)),t.value[n]=e.value}var Ll=p("$ZodArray",(e,t)=>{w.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let o=[];for(let a=0;a<r.length;a++){let s=r[a],u=t.element._zod.run({value:s,issues:[]},i);u instanceof Promise?o.push(u.then(l=>fv(l,n,a))):fv(u,n,a)}return o.length?Promise.all(o).then(()=>n):n}});function Uo(e,t,n,i,r,o){let a=n in i;if(e.issues.length){if(r&&o&&!a)return;t.issues.push(...we(n,e.issues))}if(!a&&!r){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?a&&(t.value[n]=void 0):t.value[n]=e.value}function Nv(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let n=eu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function kv(e,t,n,i,r,o){let a=[],s=r.keySet,u=r.catchall._zod,l=u.def.type,m=u.optin==="optional",f=u.optout==="optional";for(let h in t){if(h==="__proto__"||s.has(h))continue;if(l==="never"){a.push(h);continue}let v=u.run({value:t[h],issues:[]},i);v instanceof Promise?e.push(v.then(A=>Uo(A,n,h,t,m,f))):Uo(v,n,h,t,m,f)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}var Rv=p("$ZodObject",(e,t)=>{if(w.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let u={...s};return Object.defineProperty(t,"shape",{value:u}),u}})}let i=Cr(()=>Nv(t));O(e._zod,"propValues",()=>{let s=t.shape,u={};for(let l in s){let m=s[l]._zod;if(m.values){u[l]??(u[l]=new Set);for(let f of m.values)u[l].add(f)}}return u});let r=rr,o=t.catchall,a;e._zod.parse=(s,u)=>{a??(a=i.value);let l=s.value;if(!r(l))return s.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),s;s.value={};let m=[],f=a.shape;for(let h of a.keys){let v=f[h],A=v._zod.optin==="optional",W=v._zod.optout==="optional",D=v._zod.run({value:l[h],issues:[]},u);D instanceof Promise?m.push(D.then(me=>Uo(me,s,h,l,A,W))):Uo(D,s,h,l,A,W)}return o?kv(m,l,s,u,i.value,e):m.length?Promise.all(m).then(()=>s):s}}),Ul=p("$ZodObjectJIT",(e,t)=>{Rv.init(e,t);let n=e._zod.parse,i=Cr(()=>Nv(t)),r=h=>{let v=new ei(["shape","payload","ctx"]),A=i.value,W=be=>{let J=_o(be);return`shape[${J}]._zod.run({ value: input[${J}], issues: [] }, ctx)`};v.write("const input = payload.value;");let D=Object.create(null),me=0;for(let be of A.keys)D[be]=`key_${me++}`;v.write("const newResult = {};");for(let be of A.keys){let J=D[be],ce=_o(be),Sr=h[be],rg=Sr?._zod?.optin==="optional",V$=Sr?._zod?.optout==="optional";v.write(`const ${J} = ${W(be)};`),rg&&V$?v.write(`
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "<%= packageName %>",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "type": "module",
5
5
  "scripts": {},
6
6
  "devDependencies": {
@@ -9,7 +9,7 @@
9
9
  "typescript": "~6.0.3"
10
10
  },
11
11
  "dependencies": {
12
- "@fjall/components-infrastructure": "^2.4.0",
12
+ "@fjall/components-infrastructure": "^2.4.1",
13
13
  "aws-cdk-lib": "^2.251.0",
14
14
  "constructs": "^10.6.0"
15
15
  }
@@ -33,7 +33,7 @@ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
33
33
  `),this.outputHelp({error:!0}));let n=r||{},a=n.exitCode||1,o=n.code||"commander.error";this._exit(a,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in en.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,en.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new e6e(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(a=>!r(a)).forEach(a=>{this.setOptionValueWithSource(a,n.implied[a],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let i=s.attributeName(),c=this.getOptionValue(i),l=this.options.find(p=>p.negate&&i===p.attributeName()),u=this.options.find(p=>!p.negate&&i===p.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:u||s},a=s=>{let i=n(s),c=i.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${i.envVar}'`:`option '${i.flags}'`},o=`error: ${a(e)} cannot be used with ${a(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let a=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(i=>i.long).map(i=>i.long);a=a.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=aoe(e,a)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let a=[];this.createHelp().visibleCommands(this).forEach(o=>{a.push(o.name()),o.alias()&&a.push(o.alias())}),r=aoe(e,a)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let a=this.createOption(r,n);return this._versionOptionName=a.attributeName(),this._registerOption(a),this.on("option:"+a.name(),()=>{this._outputConfiguration.writeOut(`${e}
34
34
  `),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let a=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${a}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Jze(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=sd.basename(e,sd.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let a=r.formatHelp(this,r);return n.hasColors?a:this._outputConfiguration.stripColor(a)}_getOutputContext(e){e=e||{};let r=!!e.error,n,a,o;return r?(n=i=>this._outputConfiguration.writeErr(i),a=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=i=>this._outputConfiguration.writeOut(i),a=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:i=>(a||(i=this._outputConfiguration.stripColor(i)),n(i)),hasColors:a,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),a={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",a)),this.emit("beforeHelp",a);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",a),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",a))}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(en.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
35
35
  Expecting one of '${n.join("', '")}'`);let a=`${e}Help`;return this.on(a,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s}
36
- `)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(a=>r.is(a))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function ooe(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",a="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?a=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],a=o[4]),r&&a!=="0"?`${r}=${n}:${parseInt(a)+1}`:e})}function m4(){if(en.env.NO_COLOR||en.env.FORCE_COLOR==="0"||en.env.FORCE_COLOR==="false")return!1;if(en.env.FORCE_COLOR||en.env.CLICOLOR_FORCE!==void 0)return!0}f4.Command=d4;f4.useColor=m4});var uoe=ae(Hc=>{var{Argument:ioe}=AR(),{Command:h4}=soe(),{CommanderError:t6e,InvalidArgumentError:coe}=yw(),{Help:r6e}=o4(),{Option:loe}=l4();Hc.program=new h4;Hc.createCommand=t=>new h4(t);Hc.createOption=(t,e)=>new loe(t,e);Hc.createArgument=(t,e)=>new ioe(t,e);Hc.Command=h4;Hc.Option=loe;Hc.Argument=ioe;Hc.Help=r6e;Hc.CommanderError=t6e;Hc.InvalidArgumentError=coe;Hc.InvalidOptionArgumentError=coe});var vw,g4=E(()=>{vw={name:"@fjall/cli",version:"2.4.0",description:"Fjall CLI helper",private:!0,type:"module",bin:{fjall:"dist/src/cli.js"},files:["dist/"],scripts:{clean:"rm -rf ./dist ./sourcemaps","clean:node":"rm -rf ./node_modules","copy-files":'find generators -type d -name files | while read dir; do mkdir -p "dist/$dir" && cp -R "$dir/"* "dist/$dir/"; done && cp -R src/proto ./dist/src/proto',build:"npm run clean && npx tsc && npm run copy-files && node ../scripts/minify-dist.mjs dist && chmod +x ./dist/src/cli.js",watch:"npm run build && npx tsc-watch","watch:only":'npx tsc-watch --onSuccess "npm run copy-files"',"fjall-cli":"node ./dist/src/cli.js",version:"npx tsx scripts/updateTemplateVersions.ts",format:'prettier --write "src/**/*.{ts,tsx,js,jsx,json}" "generators/**/*.{ts,tsx,js,jsx,json}"',"format:check":'prettier --check "src/**/*.{ts,tsx,js,jsx,json}" "generators/**/*.{ts,tsx,js,jsx,json}"',lint:"eslint src/ generators/","lint:fix":"eslint src/ generators/ --fix",typecheck:"tsc --noEmit","typecheck:tests":"tsc --noEmit --project tsconfig.test.json","typecheck:scripts":"tsc --noEmit --project tsconfig.scripts.json","typecheck:all":"npm run typecheck && npm run typecheck:tests && npm run typecheck:scripts",test:"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:integration":"vitest run --config vitest.config.integration.ts","test:integration:watch":"vitest --config vitest.config.integration.ts","test:e2e":"vitest run --config vitest.e2e.config.ts","test:all":"npm run test && npm run test:integration && npm run test:e2e","test:setup":"node scripts/setupTestFixtures.mjs","test:payload-compat":"npx tsx scripts/testPayloadCompatibility.ts","test:payload-compat:e2e":"npx tsx scripts/testPayloadCompatibility.ts --e2e"},engines:{node:">=22.0.0"},author:"",license:"SEE LICENSE IN LICENSE",devDependencies:{"@eslint/js":"^10.0.1","@playwright/test":"^1.59.1","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","@types/ejs":"^3.1.5","@types/js-yaml":"^4.0.9","@types/mime-types":"^3.0.1","@types/picomatch":"^4.0.3","@types/prompts":"^2.4.9","@types/proper-lockfile":"^4.1.4","@types/react":"^19.2.14","@types/tar-fs":"^2.0.4","@types/tar-stream":"^3.1.4","@typescript-eslint/eslint-plugin":"^8.59.1","@typescript-eslint/parser":"^8.59.1","@vitest/coverage-v8":"^4.1.5",eslint:"^10.2.1","eslint-plugin-fjall":"file:./eslint-rules","ink-testing-library":"^4.0.0",jsdom:"^29.1.0",prettier:"^3.8.3","react-dom":"^19.2.5","tsc-watch":"^7.2.0",tsx:"^4.21.0","typescript-eslint":"^8.59.1",vitest:"4.1.7"},dependencies:{"@aws-sdk/client-auto-scaling":"^3.1038.0","@aws-sdk/client-backup":"^3.1038.0","@aws-sdk/client-cloudformation":"^3.1038.0","@aws-sdk/client-cost-explorer":"^3.1038.0","@aws-sdk/client-ec2":"^3.1038.0","@aws-sdk/client-ecr":"^3.1038.0","@aws-sdk/client-ecs":"^3.1038.0","@aws-sdk/client-elasticache":"^3.1038.0","@aws-sdk/client-iam":"^3.1038.0","@aws-sdk/client-identitystore":"^3.1038.0","@aws-sdk/client-lambda":"^3.1038.0","@aws-sdk/client-organizations":"^3.1038.0","@aws-sdk/client-ram":"^3.1038.0","@aws-sdk/client-rds":"^3.1038.0","@aws-sdk/client-route-53":"^3.1038.0","@aws-sdk/client-s3":"^3.1038.0","@aws-sdk/client-secrets-manager":"^3.1038.0","@aws-sdk/client-ssm":"^3.1038.0","@aws-sdk/client-sso":"^3.1038.0","@aws-sdk/client-sso-admin":"^3.1038.0","@aws-sdk/client-sso-oidc":"^3.1038.0","@aws-sdk/client-sts":"^3.1038.0","@fjall/deploy-core":"^2.4.0","@fjall/generator":"^2.4.0","@fjall/util":"^0.100.0","@nx/devkit":"^22.7.0","@opennextjs/aws":"^3.10.4","@smithy/node-http-handler":"^4.6.1","@toon-format/toon":"^2.1.0","aws-cdk":"^2.1119.0",axios:"^1.15.2",chalk:"^5.6.2","cli-cursor":"^5.0.0",commander:"^14.0.3",ejs:"^5.0.2",ink:"^7.0.1","js-yaml":"^4.1.1","mime-types":"^3.0.2",open:"^11.0.0",ora:"^9.4.0",picomatch:"^4.0.4",prompts:"^2.4.2","proper-lockfile":"^4.1.2",protobufjs:"^8.0.3",react:"^19.2.5","tar-fs":"^3.1.2",typescript:"^6.0.3","update-check":"^1.5.4",zod:"^4.4.3"},gitHead:"8e075d68ec034e0b9c2256f80ac2baf25a0f5645"}});function s6e(){let t=new Map;for(let[e,r]of Object.entries(Jn)){for(let[n,a]of Object.entries(r))Jn[n]={open:`\x1B[${a[0]}m`,close:`\x1B[${a[1]}m`},r[n]=Jn[n],t.set(a[0],a[1]);Object.defineProperty(Jn,e,{value:r,enumerable:!1})}return Object.defineProperty(Jn,"codes",{value:t,enumerable:!1}),Jn.color.close="\x1B[39m",Jn.bgColor.close="\x1B[49m",Jn.color.ansi=moe(),Jn.color.ansi256=foe(),Jn.color.ansi16m=hoe(),Jn.bgColor.ansi=moe(10),Jn.bgColor.ansi256=foe(10),Jn.bgColor.ansi16m=hoe(10),Object.defineProperties(Jn,{rgbToAnsi256:{value(e,r,n){return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let a=Number.parseInt(n,16);return[a>>16&255,a>>8&255,a&255]},enumerable:!1},hexToAnsi256:{value:e=>Jn.rgbToAnsi256(...Jn.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,a;if(e>=232)r=((e-232)*10+8)/255,n=r,a=r;else{e-=16;let i=e%36;r=Math.floor(e/36)/5,n=Math.floor(i/6)/5,a=i%6/5}let o=Math.max(r,n,a)*2;if(o===0)return 30;let s=30+(Math.round(a)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Jn.ansi256ToAnsi(Jn.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Jn.ansi256ToAnsi(Jn.hexToAnsi256(e)),enumerable:!1}}),Jn}var moe,foe,hoe,Jn,fRt,a6e,o6e,hRt,i6e,cu,goe=E(()=>{moe=(t=0)=>e=>`\x1B[${e+t}m`,foe=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,hoe=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Jn={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},fRt=Object.keys(Jn.modifier),a6e=Object.keys(Jn.color),o6e=Object.keys(Jn.bgColor),hRt=[...a6e,...o6e];i6e=s6e(),cu=i6e});import y4 from"node:process";import c6e from"node:os";import yoe from"node:tty";function qc(t,e=globalThis.Deno?globalThis.Deno.args:y4.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),a=e.indexOf("--");return n!==-1&&(a===-1||n<a)}function l6e(){if("FORCE_COLOR"in Xn)return Xn.FORCE_COLOR==="true"?1:Xn.FORCE_COLOR==="false"?0:Xn.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Xn.FORCE_COLOR,10),3)}function u6e(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function p6e(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=l6e();n!==void 0&&(wR=n);let a=r?wR:n;if(a===0)return 0;if(r){if(qc("color=16m")||qc("color=full")||qc("color=truecolor"))return 3;if(qc("color=256"))return 2}if("TF_BUILD"in Xn&&"AGENT_NAME"in Xn)return 1;if(t&&!e&&a===void 0)return 0;let o=a||0;if(Xn.TERM==="dumb")return o;if(y4.platform==="win32"){let s=c6e.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in Xn)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in Xn)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in Xn)||Xn.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in Xn)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Xn.TEAMCITY_VERSION)?1:0;if(Xn.COLORTERM==="truecolor"||Xn.TERM==="xterm-kitty"||Xn.TERM==="xterm-ghostty"||Xn.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Xn){let s=Number.parseInt((Xn.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Xn.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Xn.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Xn.TERM)||"COLORTERM"in Xn?1:o}function voe(t,e={}){let r=p6e(t,{streamIsTTY:t&&t.isTTY,...e});return u6e(r)}var Xn,wR,d6e,Soe,Eoe=E(()=>{({env:Xn}=y4);qc("no-color")||qc("no-colors")||qc("color=false")||qc("color=never")?wR=0:(qc("color")||qc("colors")||qc("color=true")||qc("color=always"))&&(wR=1);d6e={stdout:voe({isTTY:yoe.isatty(1)}),stderr:voe({isTTY:yoe.isatty(2)})},Soe=d6e});function boe(t,e,r){let n=t.indexOf(e);if(n===-1)return t;let a=e.length,o=0,s="";do s+=t.slice(o,n)+e+r,o=n+a,n=t.indexOf(e,o);while(n!==-1);return s+=t.slice(o),s}function xoe(t,e,r,n){let a=0,o="";do{let s=t[n-1]==="\r";o+=t.slice(a,s?n-1:n)+e+(s?`\r
36
+ `)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(a=>r.is(a))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function ooe(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",a="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?a=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],a=o[4]),r&&a!=="0"?`${r}=${n}:${parseInt(a)+1}`:e})}function m4(){if(en.env.NO_COLOR||en.env.FORCE_COLOR==="0"||en.env.FORCE_COLOR==="false")return!1;if(en.env.FORCE_COLOR||en.env.CLICOLOR_FORCE!==void 0)return!0}f4.Command=d4;f4.useColor=m4});var uoe=ae(Hc=>{var{Argument:ioe}=AR(),{Command:h4}=soe(),{CommanderError:t6e,InvalidArgumentError:coe}=yw(),{Help:r6e}=o4(),{Option:loe}=l4();Hc.program=new h4;Hc.createCommand=t=>new h4(t);Hc.createOption=(t,e)=>new loe(t,e);Hc.createArgument=(t,e)=>new ioe(t,e);Hc.Command=h4;Hc.Option=loe;Hc.Argument=ioe;Hc.Help=r6e;Hc.CommanderError=t6e;Hc.InvalidArgumentError=coe;Hc.InvalidOptionArgumentError=coe});var vw,g4=E(()=>{vw={name:"@fjall/cli",version:"2.4.1",description:"Fjall CLI helper",private:!0,type:"module",bin:{fjall:"dist/src/cli.js"},files:["dist/"],scripts:{clean:"rm -rf ./dist ./sourcemaps","clean:node":"rm -rf ./node_modules","copy-files":'find generators -type d -name files | while read dir; do mkdir -p "dist/$dir" && cp -R "$dir/"* "dist/$dir/"; done && cp -R src/proto ./dist/src/proto',build:"npm run clean && npx tsc && npm run copy-files && node ../scripts/minify-dist.mjs dist && chmod +x ./dist/src/cli.js",watch:"npm run build && npx tsc-watch","watch:only":'npx tsc-watch --onSuccess "npm run copy-files"',"fjall-cli":"node ./dist/src/cli.js",version:"npx tsx scripts/updateTemplateVersions.ts",format:'prettier --write "src/**/*.{ts,tsx,js,jsx,json}" "generators/**/*.{ts,tsx,js,jsx,json}"',"format:check":'prettier --check "src/**/*.{ts,tsx,js,jsx,json}" "generators/**/*.{ts,tsx,js,jsx,json}"',lint:"eslint src/ generators/","lint:fix":"eslint src/ generators/ --fix",typecheck:"tsc --noEmit","typecheck:tests":"tsc --noEmit --project tsconfig.test.json","typecheck:scripts":"tsc --noEmit --project tsconfig.scripts.json","typecheck:all":"npm run typecheck && npm run typecheck:tests && npm run typecheck:scripts",test:"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:integration":"vitest run --config vitest.config.integration.ts","test:integration:watch":"vitest --config vitest.config.integration.ts","test:e2e":"vitest run --config vitest.e2e.config.ts","test:all":"npm run test && npm run test:integration && npm run test:e2e","test:setup":"node scripts/setupTestFixtures.mjs","test:payload-compat":"npx tsx scripts/testPayloadCompatibility.ts","test:payload-compat:e2e":"npx tsx scripts/testPayloadCompatibility.ts --e2e"},engines:{node:">=22.0.0"},author:"",license:"SEE LICENSE IN LICENSE",devDependencies:{"@eslint/js":"^10.0.1","@playwright/test":"^1.59.1","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","@types/ejs":"^3.1.5","@types/js-yaml":"^4.0.9","@types/mime-types":"^3.0.1","@types/picomatch":"^4.0.3","@types/prompts":"^2.4.9","@types/proper-lockfile":"^4.1.4","@types/react":"^19.2.14","@types/tar-fs":"^2.0.4","@types/tar-stream":"^3.1.4","@typescript-eslint/eslint-plugin":"^8.59.1","@typescript-eslint/parser":"^8.59.1","@vitest/coverage-v8":"^4.1.5",eslint:"^10.2.1","eslint-plugin-fjall":"file:./eslint-rules","ink-testing-library":"^4.0.0",jsdom:"^29.1.0",prettier:"^3.8.3","react-dom":"^19.2.5","tsc-watch":"^7.2.0",tsx:"^4.21.0","typescript-eslint":"^8.59.1",vitest:"4.1.7"},dependencies:{"@aws-sdk/client-auto-scaling":"^3.1038.0","@aws-sdk/client-backup":"^3.1038.0","@aws-sdk/client-cloudformation":"^3.1038.0","@aws-sdk/client-cost-explorer":"^3.1038.0","@aws-sdk/client-ec2":"^3.1038.0","@aws-sdk/client-ecr":"^3.1038.0","@aws-sdk/client-ecs":"^3.1038.0","@aws-sdk/client-elasticache":"^3.1038.0","@aws-sdk/client-iam":"^3.1038.0","@aws-sdk/client-identitystore":"^3.1038.0","@aws-sdk/client-lambda":"^3.1038.0","@aws-sdk/client-organizations":"^3.1038.0","@aws-sdk/client-ram":"^3.1038.0","@aws-sdk/client-rds":"^3.1038.0","@aws-sdk/client-route-53":"^3.1038.0","@aws-sdk/client-s3":"^3.1038.0","@aws-sdk/client-secrets-manager":"^3.1038.0","@aws-sdk/client-ssm":"^3.1038.0","@aws-sdk/client-sso":"^3.1038.0","@aws-sdk/client-sso-admin":"^3.1038.0","@aws-sdk/client-sso-oidc":"^3.1038.0","@aws-sdk/client-sts":"^3.1038.0","@fjall/deploy-core":"^2.4.1","@fjall/generator":"^2.4.1","@fjall/util":"^0.100.0","@nx/devkit":"^22.7.0","@opennextjs/aws":"^3.10.4","@smithy/node-http-handler":"^4.6.1","@toon-format/toon":"^2.1.0","aws-cdk":"^2.1119.0",axios:"^1.15.2",chalk:"^5.6.2","cli-cursor":"^5.0.0",commander:"^14.0.3",ejs:"^5.0.2",ink:"^7.0.1","js-yaml":"^4.1.1","mime-types":"^3.0.2",open:"^11.0.0",ora:"^9.4.0",picomatch:"^4.0.4",prompts:"^2.4.2","proper-lockfile":"^4.1.2",protobufjs:"^8.0.3",react:"^19.2.5","tar-fs":"^3.1.2",typescript:"^6.0.3","update-check":"^1.5.4",zod:"^4.4.3"},gitHead:"8e075d68ec034e0b9c2256f80ac2baf25a0f5645"}});function s6e(){let t=new Map;for(let[e,r]of Object.entries(Jn)){for(let[n,a]of Object.entries(r))Jn[n]={open:`\x1B[${a[0]}m`,close:`\x1B[${a[1]}m`},r[n]=Jn[n],t.set(a[0],a[1]);Object.defineProperty(Jn,e,{value:r,enumerable:!1})}return Object.defineProperty(Jn,"codes",{value:t,enumerable:!1}),Jn.color.close="\x1B[39m",Jn.bgColor.close="\x1B[49m",Jn.color.ansi=moe(),Jn.color.ansi256=foe(),Jn.color.ansi16m=hoe(),Jn.bgColor.ansi=moe(10),Jn.bgColor.ansi256=foe(10),Jn.bgColor.ansi16m=hoe(10),Object.defineProperties(Jn,{rgbToAnsi256:{value(e,r,n){return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let a=Number.parseInt(n,16);return[a>>16&255,a>>8&255,a&255]},enumerable:!1},hexToAnsi256:{value:e=>Jn.rgbToAnsi256(...Jn.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,a;if(e>=232)r=((e-232)*10+8)/255,n=r,a=r;else{e-=16;let i=e%36;r=Math.floor(e/36)/5,n=Math.floor(i/6)/5,a=i%6/5}let o=Math.max(r,n,a)*2;if(o===0)return 30;let s=30+(Math.round(a)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Jn.ansi256ToAnsi(Jn.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Jn.ansi256ToAnsi(Jn.hexToAnsi256(e)),enumerable:!1}}),Jn}var moe,foe,hoe,Jn,fRt,a6e,o6e,hRt,i6e,cu,goe=E(()=>{moe=(t=0)=>e=>`\x1B[${e+t}m`,foe=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,hoe=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Jn={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},fRt=Object.keys(Jn.modifier),a6e=Object.keys(Jn.color),o6e=Object.keys(Jn.bgColor),hRt=[...a6e,...o6e];i6e=s6e(),cu=i6e});import y4 from"node:process";import c6e from"node:os";import yoe from"node:tty";function qc(t,e=globalThis.Deno?globalThis.Deno.args:y4.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),a=e.indexOf("--");return n!==-1&&(a===-1||n<a)}function l6e(){if("FORCE_COLOR"in Xn)return Xn.FORCE_COLOR==="true"?1:Xn.FORCE_COLOR==="false"?0:Xn.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Xn.FORCE_COLOR,10),3)}function u6e(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function p6e(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=l6e();n!==void 0&&(wR=n);let a=r?wR:n;if(a===0)return 0;if(r){if(qc("color=16m")||qc("color=full")||qc("color=truecolor"))return 3;if(qc("color=256"))return 2}if("TF_BUILD"in Xn&&"AGENT_NAME"in Xn)return 1;if(t&&!e&&a===void 0)return 0;let o=a||0;if(Xn.TERM==="dumb")return o;if(y4.platform==="win32"){let s=c6e.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in Xn)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in Xn)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in Xn)||Xn.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in Xn)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Xn.TEAMCITY_VERSION)?1:0;if(Xn.COLORTERM==="truecolor"||Xn.TERM==="xterm-kitty"||Xn.TERM==="xterm-ghostty"||Xn.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Xn){let s=Number.parseInt((Xn.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Xn.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Xn.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Xn.TERM)||"COLORTERM"in Xn?1:o}function voe(t,e={}){let r=p6e(t,{streamIsTTY:t&&t.isTTY,...e});return u6e(r)}var Xn,wR,d6e,Soe,Eoe=E(()=>{({env:Xn}=y4);qc("no-color")||qc("no-colors")||qc("color=false")||qc("color=never")?wR=0:(qc("color")||qc("colors")||qc("color=true")||qc("color=always"))&&(wR=1);d6e={stdout:voe({isTTY:yoe.isatty(1)}),stderr:voe({isTTY:yoe.isatty(2)})},Soe=d6e});function boe(t,e,r){let n=t.indexOf(e);if(n===-1)return t;let a=e.length,o=0,s="";do s+=t.slice(o,n)+e+r,o=n+a,n=t.indexOf(e,o);while(n!==-1);return s+=t.slice(o),s}function xoe(t,e,r,n){let a=0,o="";do{let s=t[n-1]==="\r";o+=t.slice(a,s?n-1:n)+e+(s?`\r
37
37
  `:`
38
38
  `)+r,a=n+1,n=t.indexOf(`
39
39
  `,a)}while(n!==-1);return o+=t.slice(a),o}var Aoe=E(()=>{});function Ew(t){return f6e(t)}var Coe,woe,v4,RS,Sw,Toe,OS,m6e,f6e,S4,h6e,g6e,E4,TR,y6e,v6e,wRt,H,wn=E(()=>{goe();Eoe();Aoe();({stdout:Coe,stderr:woe}=Soe),v4=Symbol("GENERATOR"),RS=Symbol("STYLER"),Sw=Symbol("IS_EMPTY"),Toe=["ansi","ansi","ansi256","ansi16m"],OS=Object.create(null),m6e=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=Coe?Coe.level:0;t.level=e.level===void 0?r:e.level},f6e=t=>{let e=(...r)=>r.join(" ");return m6e(e,t),Object.setPrototypeOf(e,Ew.prototype),e};Object.setPrototypeOf(Ew.prototype,Function.prototype);for(let[t,e]of Object.entries(cu))OS[t]={get(){let r=TR(this,E4(e.open,e.close,this[RS]),this[Sw]);return Object.defineProperty(this,t,{value:r}),r}};OS.visible={get(){let t=TR(this,this[RS],!0);return Object.defineProperty(this,"visible",{value:t}),t}};S4=(t,e,r,...n)=>t==="rgb"?e==="ansi16m"?cu[r].ansi16m(...n):e==="ansi256"?cu[r].ansi256(cu.rgbToAnsi256(...n)):cu[r].ansi(cu.rgbToAnsi(...n)):t==="hex"?S4("rgb",e,r,...cu.hexToRgb(...n)):cu[r][t](...n),h6e=["rgb","hex","ansi256"];for(let t of h6e){OS[t]={get(){let{level:r}=this;return function(...n){let a=E4(S4(t,Toe[r],"color",...n),cu.color.close,this[RS]);return TR(this,a,this[Sw])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);OS[e]={get(){let{level:r}=this;return function(...n){let a=E4(S4(t,Toe[r],"bgColor",...n),cu.bgColor.close,this[RS]);return TR(this,a,this[Sw])}}}}g6e=Object.defineProperties(()=>{},{...OS,level:{enumerable:!0,get(){return this[v4].level},set(t){this[v4].level=t}}}),E4=(t,e,r)=>{let n,a;return r===void 0?(n=t,a=e):(n=r.openAll+t,a=e+r.closeAll),{open:t,close:e,openAll:n,closeAll:a,parent:r}},TR=(t,e,r)=>{let n=(...a)=>y6e(n,a.length===1?""+a[0]:a.join(" "));return Object.setPrototypeOf(n,g6e),n[v4]=t,n[RS]=e,n[Sw]=r,n},y6e=(t,e)=>{if(t.level<=0||!e)return t[Sw]?"":e;let r=t[RS];if(r===void 0)return e;let{openAll:n,closeAll:a}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=boe(e,r.close,r.open),r=r.parent;let o=e.indexOf(`
@@ -50,7 +50,7 @@ ${e}`,A6e=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),C6e=Obj
50
50
  `);return{buffer:[],stream:a}}flush(){let e=this.flushBuffer(this.buffer,this.mainLogStream,this.mainLogPath);this.buffer=e.buffer,this.mainLogStream=e.stream;let r=this.flushBuffer(this.debugBuffer,this.debugLogStream,this.debugLogPath);this.debugBuffer=r.buffer,this.debugLogStream=r.stream}close(){this.isClosing=!0,this.flush(),this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.mainLogStream&&(this.mainLogStream.end(),this.mainLogStream=null),this.debugLogStream&&(this.debugLogStream.end(),this.debugLogStream=null),this.buffer=[],this.debugBuffer=[],this.initialised=!1,this.isClosing=!1}}});var lg,lu,Iw=E(()=>{"use strict";lg={trace:0,debug:1,info:2,warn:3,error:4},lu={MAX_FILE_SIZE:10*1024*1024,MAX_FILES:5,MAX_BUFFER_SIZE:100,FLUSH_INTERVAL_MS:500,LOG_FILENAME:"fjall.jsonl",DEBUG_LOG_FILENAME:"fjall-debug.jsonl"}});import{join as fWe}from"path";import{homedir as hWe}from"os";function MS(){let t=process.env.FJALL_LOG_DIR;return t!==void 0&&t!==""?t:fWe(hWe(),".fjall","logs")}var Pw=E(()=>{"use strict"});import{createWriteStream as gWe,existsSync as yWe,mkdirSync as vWe}from"fs";import{join as bse}from"path";var _w,W4=E(()=>{"use strict";Iw();Pw();_w=class{mainLogger;appName;operationType;logStream=null;logPath;deploymentId;buffer=[];flushInterval=null;isClosing=!1;maxBufferSize=lu.MAX_BUFFER_SIZE;constructor(e,r,n){this.mainLogger=e,this.appName=r,this.operationType=n,this.deploymentId=`${n}-${Date.now()}`;let a=MS(),o=bse(a,"deployments",r);yWe(o)||vWe(o,{recursive:!0});let s=new Date().toISOString().replace(/[:.]/g,"-"),i=`${n}-${s}.jsonl`;this.logPath=bse(o,i);try{this.logStream=gWe(this.logPath,{flags:"a"}),this.flushInterval=setInterval(()=>this.flush(),lu.FLUSH_INTERVAL_MS),this.info("DeploymentLogger","Deployment logging initialised",{appName:r,operationType:n,deploymentId:this.deploymentId,logPath:this.logPath})}catch{}}log(e,r,n,a,o,s){if(this.isClosing)return;let i={timestamp:new Date().toISOString(),level:e,component:r,message:n,correlationId:this.deploymentId,...a&&Object.keys(a).length>0&&{data:a},...o&&{stackName:o},...s&&{phase:s}};this.buffer.push(i),this.mainLogger.logWithCorrelation(e,r,n,this.deploymentId,a,o,s),this.buffer.length>=this.maxBufferSize&&this.flush()}flush(){if(!(this.buffer.length===0||!this.logStream)){for(let e of this.buffer)this.logStream.write(JSON.stringify(e)+`
51
51
  `);this.buffer=[]}}info(e,r,n){this.log("info",e,r,n)}warn(e,r,n){this.log("warn",e,r,n)}error(e,r,n){this.log("error",e,r,n)}debug(e,r,n){this.log("debug",e,r,n)}stackEvent(e,r,n,a){this.log("info","StackDeployment",n,a,e,r)}dockerEvent(e,r){this.log("info","DockerOperation",e,{percentage:r})}ecsEvent(e,r,n){this.log("info","ECSDeployment",e,{percentage:r,taskCount:n})}close(){this.isClosing=!0,this.flush(),this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.logStream&&(this.logStream.end(),this.logStream=null),this.buffer=[],this.isClosing=!1}getLogPath(){return this.logPath}getDeploymentId(){return this.deploymentId}}});import{join as V4}from"path";var jR,xse=E(()=>{"use strict";Lm();U4();Ese();W4();Iw();Pw();U4();jR=class t{static instance=null;config;debugEnabled;traceEnabled;minLevel;fileWriter;mainLogPath;debugLogPath;constructor(){let e=MS(),r=V4(e,"debug"),n=this.parseEnvInt("FJALL_LOG_MAX_SIZE",lu.MAX_FILE_SIZE),a=this.parseEnvInt("FJALL_LOG_MAX_FILES",lu.MAX_FILES);this.config={logDir:e,debugLogDir:r,maxFileSize:n,maxFiles:a,maxBufferSize:lu.MAX_BUFFER_SIZE,flushIntervalMs:lu.FLUSH_INTERVAL_MS},this.mainLogPath=V4(e,lu.LOG_FILENAME),this.debugLogPath=V4(r,lu.DEBUG_LOG_FILENAME),this.debugEnabled=process.env.FJALL_DEBUG==="true"||process.env.FJALL_TRACE==="true"||process.argv.includes("--verbose")||process.argv.includes("-v"),this.traceEnabled=process.env.FJALL_TRACE==="true";let o=process.env.FJALL_LOG_LEVEL?.toLowerCase();o&&o in lg?this.minLevel=o:this.traceEnabled?this.minLevel="trace":this.debugEnabled?this.minLevel="debug":this.minLevel="info",this.fileWriter=new UR(this.config,this.mainLogPath,this.debugLogPath,this.debugEnabled)}parseEnvInt(e,r){let n=process.env[e];if(n){let a=parseInt(n,10);if(!isNaN(a)&&a>0)return a}return r}static getInstance(){return t.instance||(t.instance=new t),t.instance}shouldLog(e){return lg[e]>=lg[this.minLevel]}createEntry(e,r,n,a,o,s,i){return{timestamp:new Date().toISOString(),level:e,component:r,message:n,...o&&{correlationId:o},...a&&Object.keys(a).length>0&&{data:a},...s&&{stackName:s},...i&&{phase:i}}}log(e,r,n,a,o,s,i){if(!this.shouldLog(e))return;let c=this.createEntry(e,r,n,a,o,s,i),l=e==="debug"||e==="trace";this.fileWriter.write(c,l),this.writeConsole(c)}writeConsole(e){if(_r.shouldSuppressOutput||_r.isNonInteractive)return;let r=this.getConsolePrefix(e.level),n=`[${e.component}]`,a=`${r} ${n} ${e.message}`;e.level==="error"?console.error(a):e.level==="warn"?console.warn(a):console.log(a)}getConsolePrefix(e){switch(e){case"error":return"[ERROR]";case"warn":return"[WARN]";case"info":return"[INFO]";case"debug":return"[DEBUG]";case"trace":return"[TRACE]"}}error(e,r,n){this.log("error",e,r,n)}warn(e,r,n){this.log("warn",e,r,n)}info(e,r,n){this.log("info",e,r,n)}debug(e,r,n){this.log("debug",e,r,n)}trace(e,r,n){this.log("trace",e,r,n)}isDebugEnabled(){return this.debugEnabled}isTraceEnabled(){return this.traceEnabled}enableDebug(){this.debugEnabled=!0,lg[this.minLevel]>lg.debug&&(this.minLevel="debug"),this.fileWriter.setDebugEnabled(!0),this.fileWriter.isInitialised&&this.fileWriter.initialiseDebugStream()}withCorrelation(e){return new $S(this,e)}forDeployment(e,r="deploy"){return new _w(this,e,r)}close(){this.fileWriter.close()}getLogPath(){return this.mainLogPath}getDebugLogPath(){return this.debugLogPath}getLogDir(){return this.config.logDir}logWithCorrelation(e,r,n,a,o,s,i){this.log(e,r,n,o,a,s,i)}static reset(){t.instance&&(t.instance.close(),t.instance=null)}}});var k,ee=E(()=>{"use strict";xse();j4();Iw();Pw();Pw();W4();Iw();k=jR.getInstance()});var G4,Dw,H4=E(()=>{"use strict";ee();Ow();G4=class{info(e){zR(e)}error(e){WR(e)}warning(e){Cse(e)}success(e){Ase(e)}debug(e){k.debug("CLI",e)}startSpinner(e){return wse(e)}stopSpinner(){ug()}updateSpinner(e){Rw(e)}},Dw=class{mode="cli";suppressOutput=!1;isNonInteractive;clearCacheOnAuthFailure=!1;logger;constructor(e={}){this.isNonInteractive=e.noPrompt??!1,this.logger=new G4}}});var q4,Nw,K4=E(()=>{"use strict";q4=class{info(e){}error(e){}warning(e){}success(e){}debug(e){}startSpinner(e){return null}stopSpinner(){}updateSpinner(e){}},Nw=class{mode="ink";suppressOutput=!0;isNonInteractive=!1;clearCacheOnAuthFailure=!0;logger;constructor(){this.logger=new q4}}});var _r,Tse=E(()=>{"use strict";H4();K4();_r=class{static stack=[];static _isNonInteractive=!1;static get current(){return this.stack.length===0?new Dw({noPrompt:!1}):this.stack[this.stack.length-1]}static get isNonInteractive(){return this._isNonInteractive}static enterNonInteractiveMode(){this._isNonInteractive=!0}static exitNonInteractiveMode(){this._isNonInteractive=!1}static getContext(){return this.stack.length>0?this.stack[this.stack.length-1]:void 0}static push(e){this.stack.push(e)}static pop(){this.stack.length>0&&this.stack.pop()}static enterUIMode(){this.push(new Nw)}static exitUIMode(){this.pop()}static async withContext(e,r){this.push(e);try{return await r()}finally{this.pop()}}static get isUIMode(){return this.current.mode==="ink"}static get shouldSuppressOutput(){return this.current.suppressOutput}static reset(){this.stack=[]}}});var Lm=E(()=>{"use strict";dse();H4();K4();Tse()});function zR(t,...e){_r.shouldSuppressOutput||(Gn&&Gn.stop(),console.log(t,...e),Gn&&Gn.start())}function Ase(t,...e){_r.shouldSuppressOutput||(Gn?(Gn.succeed(H.hex("#A4C2A5")(`\u2705 ${t}`)),Gn=null):console.log(H.hex("#A4C2A5")(`\u2705 ${t}`),...e))}function Cse(t,...e){_r.shouldSuppressOutput||(Gn?(Gn.warn(`\u26A0\uFE0F ${t}`),Gn=null):console.log(H.yellow(`\u26A0\uFE0F ${t}`),...e))}function WR(t,...e){_r.shouldSuppressOutput||(Gn?(Gn.fail(H.red.bold(`\u274C Error: ${t}`)),Gn=null):console.error(H.red.bold(`\u274C Error: ${t}`),...e))}function Y4(){return _r.shouldSuppressOutput||_r.isNonInteractive}function wse(t){if(Y4())return null;if(Gn)return Gn.text=t,Gn;let e=H.hex("#FF7BFF")(t);return Gn=BR({text:e,spinner:kse,color:"magenta"}).start(),Gn}function Rw(t){if(Y4())return null;if(Gn)Gn.text=H.hex("#FF7BFF")(t);else{let e=H.hex("#FF7BFF")(t);Gn=BR({text:e,spinner:kse,color:"magenta"}).start()}return Gn}function ug(){Y4()||Gn&&(Gn.stop(),Gn=null)}var kse,Gn,Ow=E(()=>{"use strict";wn();pse();Lm();kse={interval:150,frames:["\u2726","\u2727","\u2736","\u2737","\u2738","\u2739","\u273A","\u273B"]},Gn=null});var Pse=E(()=>{});var _se=E(()=>{Pse()});var Dse=E(()=>{});var Rse=E(()=>{});var Ose=E(()=>{});var Nse=E(()=>{});var VR,$se=E(()=>{VR=class{statusCode;reason;headers;body;constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;let r=e;return typeof r.statusCode=="number"&&typeof r.headers=="object"}}});var Mse=E(()=>{});var Fse=E(()=>{});var Lse=E(()=>{_se();Dse();Rse();Ose();Nse();$se();Mse();Fse()});var GR,SWe,Bse=E(()=>{GR=t=>encodeURIComponent(t).replace(/[!'()*]/g,SWe),SWe=t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`});var Use=E(()=>{});var jse=E(()=>{Bse();Use()});function zse(t){let e=[];for(let r of Object.keys(t).sort()){let n=t[r];if(r=GR(r),Array.isArray(n))for(let a=0,o=n.length;a<o;a++)e.push(`${r}=${GR(n[a])}`);else{let a=r;(n||typeof n=="string")&&(a+=`=${GR(n)}`),e.push(a)}}return e.join("&")}var Wse=E(()=>{jse()});function Z4(t){let e=t&&typeof t=="object"&&"reason"in t?t.reason:void 0;if(e){if(e instanceof Error){let a=new Error("Request aborted");return a.name="AbortError",a.cause=e,a}let n=new Error(String(e));return n.name="AbortError",n}let r=new Error("Request aborted");return r.name="AbortError",r}var Vse=E(()=>{});var Gse,Hse=E(()=>{Gse=["ECONNRESET","EPIPE","ETIMEDOUT"]});var qse,Kse=E(()=>{qse=t=>{let e={};for(let r of Object.keys(t)){let n=t[r];e[r]=Array.isArray(n)?n.join(","):n}return e}});var Fa,pg=E(()=>{Fa={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t)}});var Yse,Zse,Jse=E(()=>{pg();Yse=1e3,Zse=(t,e,r=0)=>{if(!r)return-1;let n=a=>{let o=Fa.setTimeout(()=>{t.destroy(),e(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${r} ms.`),{name:"TimeoutError"}))},r-a),s=i=>{i?.connecting?i.on("connect",()=>{Fa.clearTimeout(o)}):Fa.clearTimeout(o)};t.socket?s(t.socket):t.on("socket",s)};return r<2e3?(n(0),0):Fa.setTimeout(n.bind(null,Yse),Yse)}});var Xse,Qse=E(()=>{pg();Xse=(t,e,r=0,n,a)=>r?Fa.setTimeout(()=>{let o=`@smithy/node-http-handler - [${n?"ERROR":"WARN"}] a request has exceeded the configured ${r} ms requestTimeout.`;if(n){let s=Object.assign(new Error(o),{name:"TimeoutError",code:"ETIMEDOUT"});t.destroy(s),e(s)}else o+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",a?.warn?.(o)},r):-1});var EWe,eie,tie=E(()=>{pg();EWe=3e3,eie=(t,{keepAlive:e,keepAliveMsecs:r},n=EWe)=>{if(e!==!0)return-1;let a=()=>{t.socket?t.socket.setKeepAlive(e,r||0):t.on("socket",o=>{o.setKeepAlive(e,r||0)})};return n===0?(a(),0):Fa.setTimeout(a,n)}});var rie,nie,aie=E(()=>{pg();rie=3e3,nie=(t,e,r=0)=>{let n=a=>{let o=r-a,s=()=>{t.destroy(),e(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${r} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}))};t.socket?(t.socket.setTimeout(o,s),t.on("close",()=>t.socket?.removeListener("timeout",s))):t.setTimeout(o,s)};return 0<r&&r<6e3?(n(0),0):Fa.setTimeout(n.bind(null,r===0?0:rie),rie)}});import{Readable as bWe}from"node:stream";async function sie(t,e,r=oie,n=!1){let a=e.headers??{},o=a.Expect||a.expect,s=-1,i=!0;!n&&o==="100-continue"&&(i=await Promise.race([new Promise(c=>{s=Number(Fa.setTimeout(()=>c(!0),Math.max(oie,r)))}),new Promise(c=>{t.on("continue",()=>{Fa.clearTimeout(s),c(!0)}),t.on("response",()=>{Fa.clearTimeout(s),c(!1)}),t.on("error",()=>{Fa.clearTimeout(s),c(!1)})})])),i&&xWe(t,e.body)}function xWe(t,e){if(e instanceof bWe){e.pipe(t);return}if(e){let r=Buffer.isBuffer(e);if(r||typeof e=="string"){r&&e.byteLength===0?t.end():t.end(e);return}let a=e;if(typeof a=="object"&&a.buffer&&typeof a.byteOffset=="number"&&typeof a.byteLength=="number"){t.end(Buffer.from(a.buffer,a.byteOffset,a.byteLength));return}t.end(Buffer.from(e));return}t.end()}var oie,iie=E(()=>{pg();oie=6e3});import{Agent as J4,request as AWe}from"node:https";var HR,cie,ao,lie=E(()=>{Lse();Wse();Vse();Hse();Kse();Jse();Qse();tie();aie();pg();iie();ao=class t{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:"http/1.1"};static create(e){return typeof e?.handle=="function"?e:new t(e)}static checkSocketUsage(e,r,n=console){let{sockets:a,requests:o,maxSockets:s}=e;if(typeof s!="number"||s===1/0||Date.now()-15e3<r)return r;if(a&&o)for(let c in a){let l=a[c]?.length??0,u=o[c]?.length??0;if(l>=s&&u>=2*s)return n?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${l} and ${u} additional requests are enqueued.
52
52
  See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
53
- or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return r}constructor(e){this.configProvider=new Promise((r,n)=>{typeof e=="function"?e().then(a=>{r(this.resolveDefaultConfig(a))}).catch(n):r(this.resolveDefaultConfig(e))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:r,requestTimeout:n}={}){this.config||(this.config=await this.configProvider);let a=this.config,o=e.protocol==="https:";return!o&&!this.config.httpAgent&&(this.config.httpAgent=await this.config.httpAgentProvider()),new Promise((s,i)=>{let c,l=[],u=async O=>{await c,l.forEach(Fa.clearTimeout),s(O)},p=async O=>{await c,l.forEach(Fa.clearTimeout),i(O)};if(r?.aborted){let O=Z4(r);p(O);return}let m=e.headers??{},d=(m.Expect??m.expect)==="100-continue",f=o?a.httpsAgent:a.httpAgent;d&&!this.externalAgent&&(f=new(o?J4:HR)({keepAlive:!1,maxSockets:1/0})),l.push(Fa.setTimeout(()=>{this.socketWarningTimestamp=t.checkSocketUsage(f,this.socketWarningTimestamp,a.logger)},a.socketAcquisitionWarningTimeout??(a.requestTimeout??2e3)+(a.connectionTimeout??1e3)));let h=zse(e.query||{}),y;if(e.username!=null||e.password!=null){let O=e.username??"",R=e.password??"";y=`${O}:${R}`}let S=e.path;h&&(S+=`?${h}`),e.fragment&&(S+=`#${e.fragment}`);let x=e.hostname??"";x[0]==="["&&x.endsWith("]")?x=e.hostname.slice(1,-1):x=e.hostname;let w={headers:e.headers,host:x,method:e.method,path:S,port:e.port,agent:f,auth:y},T=(o?AWe:cie)(w,O=>{let R=new VR({statusCode:O.statusCode||-1,reason:O.statusMessage,headers:qse(O.headers),body:O});u({response:R})});if(T.on("error",O=>{Gse.includes(O.code)?p(Object.assign(O,{name:"TimeoutError"})):p(O)}),r){let O=()=>{T.destroy();let R=Z4(r);p(R)};if(typeof r.addEventListener=="function"){let R=r;R.addEventListener("abort",O,{once:!0}),T.once("close",()=>R.removeEventListener("abort",O))}else r.onabort=O}let _=n??a.requestTimeout;l.push(Zse(T,p,a.connectionTimeout)),l.push(Xse(T,p,_,a.throwOnRequestTimeout,a.logger??console)),l.push(nie(T,p,a.socketTimeout));let D=w.agent;typeof D=="object"&&"keepAlive"in D&&l.push(eie(T,{keepAlive:D.keepAlive,keepAliveMsecs:D.keepAliveMsecs})),c=sie(T,e,_,this.externalAgent).catch(O=>(l.forEach(Fa.clearTimeout),i(O)))})}updateHttpClientConfig(e,r){this.config=void 0,this.configProvider=this.configProvider.then(n=>({...n,[e]:r}))}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(e){let{requestTimeout:r,connectionTimeout:n,socketTimeout:a,socketAcquisitionWarningTimeout:o,httpAgent:s,httpsAgent:i,throwOnRequestTimeout:c,logger:l}=e||{},u=!0,p=50;return{connectionTimeout:n,requestTimeout:r,socketTimeout:a,socketAcquisitionWarningTimeout:o,throwOnRequestTimeout:c,httpAgentProvider:async()=>{let{Agent:m,request:d}=await import("node:http");return cie=d,HR=m,s instanceof HR||typeof s?.destroy=="function"?(this.externalAgent=!0,s):new HR({keepAlive:u,maxSockets:p,...s})},httpsAgent:i instanceof J4||typeof i?.destroy=="function"?(this.externalAgent=!0,i):new J4({keepAlive:u,maxSockets:p,...i}),logger:l}}}});var uie=E(()=>{});var pie=E(()=>{});var Bm=E(()=>{lie();uie();pie()});function Q4(t){let e=t.replace(/\./g,"-");return{hostedZoneId:`${e}-hosted-zone-id`,certificateArn:`${e}-certificate-arn`,delegationRoleArn:`${e}-delegation-role-arn`,nameservers:`${e}-nameservers`}}var X4,die=E(()=>{X4="@"});function Qu(t){return t.replace(/[-_](.)/g,(e,r)=>r.toUpperCase()).replace(/^./,e=>e.toUpperCase())}function $w(t){return t.replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/([a-z\d])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function FS(t){return $w(t).replace(/-/g,"_")}var mie=E(()=>{});function dg(t){return t instanceof Error?t:new Error(String(t))}function ep(t){return t instanceof Error?t.message:typeof t=="string"?t:t&&typeof t=="object"&&"message"in t?String(t.message):"An unknown error occurred"}var fie=E(()=>{});var hie=E(()=>{});function ez(t){return t.replace(/-----BEGIN [A-Z ]*PRIVATE KEY-----(?:[^"\\]|\\[\\nrt"])*?-----END [A-Z ]*PRIVATE KEY-----/g,"-----BEGIN [REDACTED] PRIVATE KEY-----...-----END [REDACTED] PRIVATE KEY-----").replace(/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g,"-----BEGIN [REDACTED] PRIVATE KEY-----...-----END [REDACTED] PRIVATE KEY-----").replace(/(\w+:\/\/[^:]+:)[^@]+(@)/gi,"$1***$2").replace(/(?<![a-zA-Z])(password|passwd|secret|api[_-]?key|token|auth|credential)([=:])["']?[^\s"']+/gi,"$1$2***").replace(/\b(ghu_|ghs_|ghp_|gho_|github_pat_)[A-Za-z0-9_]+/g,"$1***").replace(/(?<=Authorization:\s*Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"***").replace(/\b(AKIA|ASIA)[A-Z0-9]{12,}\b/g,"$1***").replace(/(?<=AWS_SECRET_ACCESS_KEY=|SecretAccessKey[=:]\s*|"secretAccessKey":\s*")[A-Za-z0-9/+=]{40,}/g,"***").replace(/(arn:aws[^:]*:[^:]*:[^:]*:)(\d{12})(:[^\s]*)/g,"$1***$3").replace(/(?<="(aws)?[Ss]essionToken":\s*")[^"]+/g,"***").replace(/(?<="(internal[Aa]piKey|fjallCallbackToken)":\s*")[^"]+/g,"***").replace(CWe,"fjall_ak_***")}var CWe,gie=E(()=>{CWe=/fjall_ak_[A-Z2-7]{16}\.[A-Z2-7]{40}/g});var yie=E(()=>{});var vie,Sie,wWe,Eie=E(()=>{vie=["production","staging","development","platform","compliance"],Sie={ROOT:"root",PLATFORM:"platform"},wWe=[...vie,Sie.ROOT]});var T$t,k$t,I$t,bie=E(()=>{T$t=Object.freeze({"AWS::IAM::Role":"security","AWS::IAM::Policy":"security","AWS::IAM::OIDCProvider":"security","AWS::EC2::SecurityGroup":"security","AWS::KMS::Key":"security","AWS::KMS::Alias":"security","AWS::EC2::VPC":"network","AWS::EC2::Subnet":"network","AWS::EC2::InternetGateway":"network","AWS::EC2::NatGateway":"network","AWS::EC2::RouteTable":"network","AWS::EC2::Route":"network","AWS::EC2::VPCGatewayAttachment":"network","AWS::EC2::SubnetRouteTableAssociation":"network","AWS::EC2::EIP":"network","AWS::ECS::Cluster":"compute","AWS::ECS::Service":"compute","AWS::ECS::TaskDefinition":"compute","AWS::Lambda::Function":"compute","AWS::ElasticLoadBalancingV2::LoadBalancer":"compute","AWS::ElasticLoadBalancingV2::TargetGroup":"compute","AWS::ElasticLoadBalancingV2::Listener":"compute","AWS::ElasticLoadBalancingV2::ListenerRule":"compute","AWS::RDS::DBInstance":"database","AWS::RDS::DBCluster":"database","AWS::SecretsManager::Secret":"database","AWS::S3::Bucket":"storage","AWS::S3::BucketPolicy":"storage","AWS::CloudTrail::Trail":"monitoring","AWS::CloudWatch::Alarm":"monitoring","AWS::Logs::LogGroup":"monitoring","AWS::Events::EventBus":"events","AWS::Events::Rule":"events","AWS::ECR::Repository":"registry","AWS::CodeBuild::Project":"registry","AWS::Route53::RecordSet":"dns","AWS::CertificateManager::Certificate":"dns","AWS::CloudFront::Distribution":"dns","AWS::Backup::BackupVault":"backup","AWS::Backup::BackupPlan":"backup","AWS::Backup::BackupSelection":"backup","AWS::SSO::PermissionSet":"identity","AWS::SSO::Assignment":"identity","AWS::Organizations::Account":"identity","AWS::CDK::Metadata":"compute","AWS::CloudFormation::CustomResource":"compute","AWS::CloudFormation::WaitCondition":"compute","AWS::CloudFormation::WaitConditionHandle":"compute"}),k$t=Object.freeze({"AWS::EC2::NatGateway":120,"AWS::RDS::DBInstance":300,"AWS::RDS::DBCluster":300,"AWS::CloudFront::Distribution":300,"AWS::ECS::Service":180,"AWS::ElasticLoadBalancingV2::LoadBalancer":60,"AWS::EC2::SecurityGroup":10,"AWS::IAM::Role":15,"AWS::IAM::Policy":15,"AWS::IAM::OIDCProvider":10,"AWS::S3::Bucket":10,"AWS::S3::BucketPolicy":5,"AWS::Lambda::Function":30,"AWS::EC2::VPC":15,"AWS::EC2::Subnet":15,"AWS::EC2::InternetGateway":10,"AWS::EC2::RouteTable":5,"AWS::EC2::Route":5,"AWS::EC2::VPCGatewayAttachment":10,"AWS::EC2::SubnetRouteTableAssociation":5,"AWS::EC2::EIP":10,"AWS::ECS::Cluster":15,"AWS::ECS::TaskDefinition":10,"AWS::ElasticLoadBalancingV2::TargetGroup":10,"AWS::ElasticLoadBalancingV2::Listener":10,"AWS::ElasticLoadBalancingV2::ListenerRule":5,"AWS::SecretsManager::Secret":10,"AWS::Logs::LogGroup":5,"AWS::CloudWatch::Alarm":10,"AWS::CloudTrail::Trail":15,"AWS::Events::EventBus":5,"AWS::Events::Rule":5,"AWS::ECR::Repository":10,"AWS::Route53::RecordSet":30,"AWS::CertificateManager::Certificate":60,"AWS::KMS::Key":15,"AWS::KMS::Alias":5,"AWS::Backup::BackupVault":10,"AWS::Backup::BackupPlan":10,"AWS::Backup::BackupSelection":10,"AWS::SSO::PermissionSet":15,"AWS::SSO::Assignment":10,"AWS::Organizations::Account":60}),I$t=Object.freeze({"AWS::Lambda::Function":"Lambda Function","AWS::IAM::Role":"IAM Role","AWS::IAM::Policy":"IAM Policy","AWS::S3::Bucket":"S3 Bucket","AWS::DynamoDB::Table":"DynamoDB Table","AWS::EC2::Instance":"EC2 Instance","AWS::EC2::SecurityGroup":"Security Group","AWS::EC2::VPC":"VPC","AWS::EC2::Subnet":"Subnet","AWS::EC2::InternetGateway":"Internet Gateway","AWS::EC2::RouteTable":"Route Table","AWS::EC2::Route":"Route","AWS::ECS::Cluster":"ECS Cluster","AWS::ECS::Service":"ECS Service","AWS::ECS::TaskDefinition":"Task Definition","AWS::ElasticLoadBalancingV2::LoadBalancer":"Load Balancer","AWS::ElasticLoadBalancingV2::TargetGroup":"Target Group","AWS::ElasticLoadBalancingV2::Listener":"Listener","AWS::CloudFormation::Stack":"CloudFormation Stack","AWS::CDK::Metadata":"CDK Metadata","Custom::CDKBucketDeployment":"Bucket Deployment","AWS::SSM::Parameter":"SSM Parameter","AWS::CloudWatch::Alarm":"CloudWatch Alarm","AWS::Logs::LogGroup":"Log Group","AWS::ApiGateway::RestApi":"API Gateway","AWS::ApiGateway::Deployment":"API Deployment","AWS::ApiGateway::Stage":"API Stage","AWS::ApiGateway::Method":"API Method","AWS::ApiGateway::Resource":"API Resource","AWS::CloudFront::Distribution":"CloudFront Distribution","AWS::Route53::RecordSet":"Route53 Record","AWS::RDS::DBInstance":"RDS Instance","AWS::RDS::DBCluster":"RDS Cluster","AWS::SQS::Queue":"SQS Queue","AWS::SNS::Topic":"SNS Topic","AWS::Events::Rule":"EventBridge Rule","AWS::StepFunctions::StateMachine":"Step Function","AWS::EC2::NatGateway":"NAT Gateway","AWS::EC2::EIP":"Elastic IP","AWS::EC2::VPCGatewayAttachment":"Gateway Attachment","AWS::EC2::SubnetRouteTableAssociation":"Route Association","AWS::CloudTrail::Trail":"CloudTrail","AWS::IAM::OIDCProvider":"OIDC Provider","AWS::Events::EventBus":"Event Bus","AWS::Backup::BackupVault":"Backup Vault","AWS::Backup::BackupPlan":"Backup Plan","AWS::Backup::BackupSelection":"Backup Selection","AWS::SecretsManager::Secret":"Secret","AWS::KMS::Key":"KMS Key","AWS::KMS::Alias":"KMS Alias","AWS::ECR::Repository":"ECR Repository","AWS::CertificateManager::Certificate":"Certificate","AWS::ElasticLoadBalancingV2::ListenerRule":"Listener Rule","AWS::EC2::IPAM":"IPAM","AWS::EC2::IPAMPool":"IPAM Pool","AWS::EC2::IPAMPoolCidr":"IPAM Pool CIDR","Custom::ram":"RAM","Custom::ipamDelegateAdmin":"IPAM Delegate Admin","Custom::CostAllocationTags":"Cost Allocation Tags","Custom::ActivateOrganisationsAccess":"Activate Organisations Access","Custom::Organizations_TagResource":"Organisations Tag Resource","AWS::CloudFormation::CustomResource":"Custom Resource","AWS::CloudFormation::WaitCondition":"Wait Condition","AWS::CloudFormation::WaitConditionHandle":"Wait Condition Handle","AWS::SSO::PermissionSet":"SSO Permission Set","AWS::SSO::Assignment":"SSO Assignment","AWS::Organizations::Account":"Organisations Account","AWS::S3::BucketPolicy":"S3 Bucket Policy","AWS::CodeBuild::Project":"CodeBuild Project"})});var xie=E(()=>{});var tz=E(()=>{});var Aie=E(()=>{});var Cie=E(()=>{tz()});function qR(t,e){if(e!==void 0){if(e.trim()==="")throw new Error("buildAppConfigPath: container must be a non-empty string");return`${e}/fjall/${t}`}return`fjall/${t}`}var wie=E(()=>{});var rz=E(()=>{});var Tie=E(()=>{rz()});var kie=E(()=>{});var Iie=E(()=>{});var Pie=E(()=>{});var LS=E(()=>{die();mie();fie();hie();gie();yie();Eie();bie();xie();tz();Aie();Cie();wie();rz();Tie();kie();Iie();Pie()});var Mw=E(()=>{"use strict";LS()});function cd(t){return t.success===!0}function Mt(t){return t.success===!1}function A(t){return{success:!0,data:t}}function v(t){return{success:!1,error:t}}async function nz(t){try{let e=await t();return A(e)}catch(e){return v(dg(e))}}function az(t){try{let e=t();return A(e)}catch(e){return v(dg(e))}}var cn=E(()=>{"use strict";Mw()});function oz(t){let e=/^rate\((\d+) (minute|minutes|hour|hours|day|days)\)$/.exec(t);if(!e)return;let r=e[1],n=e[2];if(r===void 0||n===void 0)return;let a=parseInt(r,10);if(!Number.isFinite(a)||a<1)return;let o=n==="minute"||n==="hour"||n==="day";if(!(o&&a!==1)&&!(!o&&a===1))return n==="minute"||n==="minutes"?{everyMs:a*6e4}:n==="hour"||n==="hours"?{everyMs:a*60*6e4}:{everyMs:a*24*60*6e4}}var _ie,Et,Die=E(()=>{"use strict";_ie=/^[a-zA-Z][a-zA-Z0-9-]*$/,Et=Object.freeze({IDENTIFIER:_ie,RESOURCE_NAME:/^[a-zA-Z][a-zA-Z0-9]*$/,ECS_SERVICE_NAME:_ie,BUCKET_NAME:/^[a-z][a-z0-9-]*[a-z0-9]$|^[a-z][a-z0-9]*$/,DATABASE_NAME:/^[a-zA-Z][a-zA-Z0-9_]*$/,RESOURCE_TYPE:/^[a-z]+(:[a-z]+)?$/,SSM_PATH:/^\/[a-zA-Z][a-zA-Z0-9-]*(\/[a-zA-Z][a-zA-Z0-9-]*)*$/,SECRET_NAME:/^[a-zA-Z_][a-zA-Z0-9._-]*$/,SSM_COMPONENT:/^[a-zA-Z][a-zA-Z0-9._-]*$/,EMAIL:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,DOCKER_IMAGE:/^[a-z0-9][a-z0-9._-]*[a-z0-9](:[a-z0-9._-]+)?$/,DOMAIN:/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i,PASCAL_CASE:/^[A-Z][A-Za-z0-9]*$/,AWS_ACCOUNT_ID:/^\d{12}$/,VPC_ID:/^vpc-[a-z0-9]+$/,ROLE_ARN:/^arn:aws[a-zA-Z-]*:iam::\d{12}:role\/.+$/,CIDR:/^((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\/(3[0-2]|[12]?\d)$/,SCHEDULE_EXPRESSION:/^(rate\(1 (?:minute|hour|day)\)|rate\((?:[2-9]|[1-9]\d+) (?:minutes|hours|days)\)|cron\([^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+\))$/,LAMBDA_RUNTIME_IDENTIFIER:/^[A-Za-z0-9._-]+$/,ENV_VAR_NAME:/^[A-Za-z_][A-Za-z0-9_]*$/})});var M,Rie=E(()=>{"use strict";M=Object.freeze({IDENTIFIER:"Must start with a letter, contain only letters, numbers, and hyphens",IDENTIFIER_MIN_LENGTH:"Must be at least 2 characters",IDENTIFIER_NO_TRAILING_HYPHEN:"Must not end with a hyphen",IDENTIFIER_NO_CONSECUTIVE_HYPHENS:"Must not contain consecutive hyphens",RESOURCE_NAME:"Must start with a letter and contain only letters and numbers (PascalCase recommended)",ECS_SERVICE_NAME:"Service name must start with a letter and contain only letters, numbers, and hyphens",BUCKET_NAME:"Bucket name must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",DATABASE_NAME:"Database name must start with a letter and contain only letters, numbers, and underscores",RESOURCE_TYPE:"Resource type must be in format 'category' or 'category:type'",SSM_PATH:"SSM path must start with / and contain valid namespace segments (e.g., /myapp/ApiCluster/service)",SECRET_NAME:"Secret name must start with a letter or underscore and contain only letters, numbers, underscores, hyphens, or periods",SSM_COMPONENT:"Must start with a letter and contain only letters, numbers, periods, hyphens, or underscores",EMAIL:"Please enter a valid email address",DOMAIN:"Please enter a valid domain (e.g., cms.example.com)",DOCKER_IMAGE:"Invalid Docker image name format",REQUIRED:{APP_NAME:"Application name is required",RESOURCE_NAME:"Resource name is required",BUCKET_NAME:"Bucket name is required",SERVICE_NAME:"Service name is required",NETWORK_NAME:"Network name is required",DATABASE_NAME:"Database name is required",ORGANISATION_NAME:"Organisation name is required",EMAIL:"Email is required",NAME:"Name is required",USERNAME:"Username is required",CONTAINER_NAME:"Container name is required",FIRST_NAME:"First name is required",LAST_NAME:"Last name is required",GROUP:"Group is required",PATTERN_NAME:"Pattern name is required",ROUTING_PATH:"Routing path is required",RESOURCE_REFERENCE:"Resource reference is required",RESOURCE_TYPE:"Resource type is required",VARIANT:"Variant is required",SUBTYPE:"Subtype is required",DEPLOY_TARGET:"Deploy target is required",DESTROY_TARGET:"Destroy target is required"},MAX_LENGTH:{APP_NAME:"Application name must be 50 characters or less",RESOURCE_NAME:"Resource name must be 63 characters or less",BUCKET_NAME:"Bucket name must be 63 characters or less",SERVICE_NAME:"Service name must be 255 characters or less",NETWORK_NAME:"Network name must be 50 characters or less",DATABASE_NAME:"Database name must be 63 characters or less",ORGANISATION_NAME:"Organisation name must be 50 characters or less"},PORT:{INTEGER:"Port must be an integer",MIN:"Port must be at least 1",MAX:"Port cannot exceed 65535"},USERNAME:{MAX_LENGTH:"Username cannot exceed 63 characters"},LAMBDA:{MEMORY:{INTEGER:"Lambda memory must be an integer",MIN:"Memory must be at least 128 MB",MAX:"Memory cannot exceed 10240 MB",MULTIPLE:"Memory must be 128 MB or a multiple of 64 MB"},TIMEOUT:{INTEGER:"Timeout must be an integer",MIN:"Timeout must be at least 1 second",MAX:"Timeout cannot exceed 900 seconds"},RUNTIME:"Lambda runtime must contain only letters, digits, dots, underscores, or dashes (e.g. 'NODEJS_20_X' or 'nodejs20.x')"},ENV_VAR_NAME:"Environment variable names must start with a letter or underscore and contain only letters, digits, and underscores",PRIORITY:{INTEGER:"Priority must be an integer",MIN:"Priority must be at least 1",MAX:"Priority cannot exceed 50000"},CAPACITY:{MIN:{INTEGER:"Minimum capacity must be an integer",MIN_0:"Minimum capacity must be at least 0",MIN_1:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 100"},MAX:{INTEGER:"Maximum capacity must be an integer",MIN_0:"Maximum capacity must be at least 0",MIN_1:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 100"},DESIRED:{INTEGER:"Desired count must be an integer",MIN:"Desired count must be at least 0",MAX:"Desired count cannot exceed 100"},WARM_POOL_REQUIRED:"minCapacity 0 requires a warmPool \u2014 without it, new tasks wait 60-90s for a cold instance launch",WARM_POOL:{MIN_SIZE:{INTEGER:"Warm pool minSize must be an integer",MIN:"Warm pool minSize must be at least 0",MAX:"Warm pool minSize cannot exceed 100"},MIN_SIZE_EXCEEDS_MAX_CAPACITY:"warmPool.minSize cannot exceed maxCapacity \u2014 the warm pool cannot hold more instances than the ASG allows"}},MEMORY_LIMIT:{INTEGER:"Memory limit must be an integer",MIN_512:"Memory limit must be at least 512 MiB",MIN_128:"Memory limit must be at least 128 MiB",MAX:"Memory limit cannot exceed 30720 MiB"},DATABASE:{PORT:{INTEGER:"Database port must be an integer",MIN:"Database port must be at least 1024",MAX:"Database port cannot exceed 65535"},NAME:{REQUIRED:"Database name is required",MAX_LENGTH:"Database name must be 63 characters or less"}},BACKUP_RETENTION:{INTEGER:"Backup retention must be an integer",MIN:"Backup retention must be at least 1 day",MAX:"Backup retention cannot exceed 35 days"},SQS:{VISIBILITY_TIMEOUT:{INTEGER:"Visibility timeout must be an integer",MIN:"Visibility timeout must be at least 0 seconds",MAX:"Visibility timeout cannot exceed 43200 seconds (12 hours)"},RETENTION_PERIOD:{INTEGER:"Retention period must be an integer",MIN:"Retention period must be at least 60 seconds",MAX:"Retention period cannot exceed 1209600 seconds (14 days)"}},READER:{COUNT:{INTEGER:"Reader count must be an integer",MIN:"Reader count must be at least 0",MAX:"Reader count cannot exceed 15"}},IDENTIFIER_SUFFIX:{REQUIRED:"Identifier suffix is required when specified",MAX_LENGTH:"Identifier suffix cannot exceed 50 characters"},ROTATION:{INTEGER:"Rotation days must be an integer",MIN:"Rotation interval must be at least 1 day",MAX:"Rotation interval cannot exceed 365 days"},MAX_CONNECTIONS:{INTEGER:"Max connections must be an integer",MIN:"Max connections must be at least 1",MAX:"Max connections cannot exceed 100"},MONITORING_INTERVAL:{INTEGER:"Monitoring interval must be an integer",MIN:"Monitoring interval must be at least 0",MAX:"Monitoring interval cannot exceed 60 seconds",VALUES:"Monitoring interval must be 0, 1, 5, 10, 15, 30, or 60 seconds"},RETENTION_DAYS:{INTEGER:"Retention days must be an integer",MIN:"Retention days must be at least 1",MAX:"Retention days cannot exceed 365"},BATCH_SIZE:{INTEGER:"Batch size must be an integer",MIN:"Batch size must be at least 1",MAX:"Batch size cannot exceed 10000"},SERVICE:{UNIQUE_WITHIN_CLUSTER:"Service names must be unique within a cluster",MIN_REQUIRED:"At least one service is required",ROUTING_REQUIRED:"Multiple services with ports require routing config (path or host)"},PROXY_CONFIG:{MAX_IDLE_CONNECTIONS:{INTEGER:"Max idle connections must be an integer",MIN:"Max idle connections must be at least 0",MAX:"Max idle connections cannot exceed 100"},BORROW_TIMEOUT:{INTEGER:"Connection borrow timeout must be an integer",MIN:"Connection borrow timeout must be at least 1 second",MAX:"Connection borrow timeout cannot exceed 3600 seconds"}},MAX_AZS:{INTEGER:"Max AZs must be an integer",MIN:"Max AZs must be at least 1",MAX:"Max AZs cannot exceed 3"},BATCHING_WINDOW:{INTEGER:"Max batching window must be an integer",MIN:"Max batching window must be at least 0",MAX:"Max batching window cannot exceed 300 seconds"},HEALTH_CHECK:{INTERVAL:{INTEGER:"Health check interval must be an integer",MIN:"Health check interval must be at least 5 seconds",MAX:"Health check interval cannot exceed 300 seconds"},TIMEOUT:{INTEGER:"Health check timeout must be an integer",MIN:"Health check timeout must be at least 2 seconds",MAX:"Health check timeout cannot exceed 60 seconds"},RETRIES:{INTEGER:"Health check retries must be an integer",MIN:"Health check retries must be at least 1",MAX:"Health check retries cannot exceed 10"},START_PERIOD:{INTEGER:"Health check start period must be an integer",MIN:"Health check start period must be at least 0 seconds",MAX:"Health check start period cannot exceed 300 seconds"}},EPHEMERAL_STORAGE:{INTEGER:"Ephemeral storage size must be an integer",MIN:"Ephemeral storage size must be at least 512 MB",MAX:"Ephemeral storage size cannot exceed 10240 MB"},MAX_MESSAGE_SIZE:{INTEGER:"Max message size must be an integer",MIN:"Max message size must be at least 1024 bytes",MAX:"Max message size cannot exceed 262144 bytes (256 KB)"},CAPACITY_CONSTRAINT:{MIN_LTE_MAX:"minCapacity must be less than or equal to maxCapacity"},DIRECT_ACCESS:{NO_DOMAIN:"directAccess cannot be used with domain (no ALB for HTTPS)",NO_LOAD_BALANCER:"directAccess cannot be used with loadBalancer (mutually exclusive)"},GLOBAL_AURORA:{PRIMARY_REGION_REQUIRED:"primaryRegion is required for GlobalAurora databases"},NAT_GATEWAY:{INTEGER:"NAT gateway count must be an integer",MIN:"NAT gateway count must be at least 0",MAX:"NAT gateway count cannot exceed 3"},CIDR_MASK:{INTEGER:"CIDR mask must be an integer",MIN:"CIDR mask must be at least 16",MAX:"CIDR mask cannot exceed 28"},CPU:{INTEGER:"CPU must be an integer",MIN:"CPU must be at least 256 units",MAX:"CPU cannot exceed 4096 units"},KMS:{KEY_REQUIRED:"KMS key ARN is required when using KMS encryption"},READER_INSTANCES:{MAX:"Cannot have more than 15 reader instances",COUNT_OR_INSTANCES:"Cannot specify both 'count' and 'instances' - use one or the other"},GENERATOR_CAPACITY:{MIN:{MIN:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 1000"},MAX:{MIN:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 1000"}},INSTANCE_TYPE:"Unknown instance type. Common types include: t4g.micro, t4g.small, m5.large",ARCHITECTURE_MISMATCH:"Architecture mismatch between instance type and AMI",ALLOCATED_STORAGE:{INTEGER:"Allocated storage must be an integer",MIN:"Allocated storage must be at least 20 GB",MAX:"Allocated storage cannot exceed 65536 GB"},DLQ:{MAX_RECEIVE_COUNT:{INTEGER:"Max receive count must be an integer",MIN:"Max receive count must be at least 1",MAX:"Max receive count cannot exceed 1000"}},ALARM:{PERCENTAGE:{MIN:"Threshold must be at least 1%",MAX:"Threshold must be at most 100%"},FREE_STORAGE_GIB:{MIN:"Free storage threshold must be at least 1 GiB"}},REGION:"Invalid AWS region",PASCAL_CASE:"Resource name must start with an uppercase letter and contain only alphanumerics (PascalCase).",IMAGE_DOCKER_MUTEX:"image and docker are mutually exclusive",AWS_ACCOUNT_ID:"AWS account id must be exactly 12 digits (no hyphens)",VPC_ID:"VPC id must look like vpc-abc12345",ROLE_ARN:"Role ARN must have the form arn:aws:iam::<account-id>:role/<name>",CIDR:"CIDR must be in dotted-quad/prefix-length form (e.g. 10.0.0.0/16)",VPC_PEER:{MIN_REQUESTER_ACCOUNTS:"At least one requester account id is required",REGION_REQUIRED:"Peer region is required when specified",ROUTE_TABLE_ID_REQUIRED:"Route table id must not be empty"},SCHEDULE_EXPRESSION:"Schedule expression must be 'rate(N minute|minutes|hour|hours|day|days)' with N>=1, or 'cron(<6-field AWS expression>)'"})});var Kc=E(()=>{"use strict";Die();Rie()});function US(t){return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}function Lw(t){return uu.includes(t)}function Bw(t){return/^[a-z]{2}-[a-z]+-[1-9]$/.test(t)}function Uw(t){if(!t)return BS.slice(0,3);let e=t.toLowerCase().split("-"),r=e[0],n=e.length>1?e[1]:"",a=[];return r&&n&&(a=uu.filter(o=>o.startsWith(`${r}-${n}`))),a.length===0&&r&&(a=uu.filter(o=>o.startsWith(`${r}-`))),a.length>0?a.slice(0,3):BS.slice(0,3)}function jw(t){if(Lw(t))return!0;let e=Uw(t);return Bw(t)?`Unknown region. Try: ${e.join(", ")}`:`Invalid format. Try: ${e.join(", ")}`}function KR(t){if(!t||t.trim()==="")return!0;let e=US(t);for(let r of e){let n=jw(r);if(n!==!0)return n}return!0}function zw(t,e){return t.filter(r=>r!==e)}function Ti(){return pu.map(t=>({label:t.city,value:t.code,description:t.code}))}function Um(t){return pu.filter(e=>e.code!==t).map(e=>({label:e.city,value:e.code,description:e.code}))}function ki(t){let e=pu.find(r=>r.code===t);return e?e.city:t}function YR(t){return e=>{let r=US(e);return zw(r,t)}}var Ye,uu,pu,Fw,BS,sz=E(()=>{"use strict";Ye="us-east-2",uu=Object.freeze(["us-east-2","us-west-2","us-east-1","eu-west-1","eu-central-1","ap-southeast-1","ap-northeast-1","ap-southeast-2","us-west-1","ca-central-1","af-south-1","ap-east-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-south-2","ap-southeast-3","ap-southeast-4","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-2","eu-west-3","me-central-1","me-south-1","sa-east-1"]),pu=Object.freeze([{code:"us-east-2",name:"US East",city:"Ohio",country:"USA"},{code:"us-west-2",name:"US West",city:"Oregon",country:"USA"},{code:"us-east-1",name:"US East",city:"N. Virginia",country:"USA"},{code:"eu-west-1",name:"EU West",city:"Ireland",country:"Ireland"},{code:"eu-central-1",name:"EU Central",city:"Frankfurt",country:"Germany"},{code:"ap-southeast-1",name:"Asia Pacific",city:"Singapore",country:"Singapore"},{code:"ap-northeast-1",name:"Asia Pacific",city:"Tokyo",country:"Japan"},{code:"ap-southeast-2",name:"Asia Pacific",city:"Sydney",country:"Australia"},{code:"us-west-1",name:"US West",city:"N. California",country:"USA"},{code:"ca-central-1",name:"Canada",city:"Central",country:"Canada"},{code:"af-south-1",name:"Africa",city:"Cape Town",country:"South Africa"},{code:"ap-east-1",name:"Asia Pacific",city:"Hong Kong",country:"China"},{code:"ap-northeast-2",name:"Asia Pacific",city:"Seoul",country:"South Korea"},{code:"ap-northeast-3",name:"Asia Pacific",city:"Osaka",country:"Japan"},{code:"ap-south-1",name:"Asia Pacific",city:"Mumbai",country:"India"},{code:"ap-south-2",name:"Asia Pacific",city:"Hyderabad",country:"India"},{code:"ap-southeast-3",name:"Asia Pacific",city:"Jakarta",country:"Indonesia"},{code:"ap-southeast-4",name:"Asia Pacific",city:"Melbourne",country:"Australia"},{code:"eu-central-2",name:"EU Central",city:"Zurich",country:"Switzerland"},{code:"eu-north-1",name:"EU North",city:"Stockholm",country:"Sweden"},{code:"eu-south-1",name:"EU South",city:"Milan",country:"Italy"},{code:"eu-south-2",name:"EU South",city:"Spain",country:"Spain"},{code:"eu-west-2",name:"EU West",city:"London",country:"UK"},{code:"eu-west-3",name:"EU West",city:"Paris",country:"France"},{code:"me-central-1",name:"Middle East",city:"UAE",country:"UAE"},{code:"me-south-1",name:"Middle East",city:"Bahrain",country:"Bahrain"},{code:"sa-east-1",name:"South America",city:"S\xE3o Paulo",country:"Brazil"}]),Fw=Object.freeze([{code:"us-east-2",name:"US East",city:"Ohio",country:"USA"},{code:"us-west-2",name:"US West",city:"Oregon",country:"USA"},{code:"us-east-1",name:"US East",city:"N. Virginia",country:"USA"},{code:"eu-west-1",name:"EU West",city:"Ireland",country:"Ireland"},{code:"eu-central-1",name:"EU Central",city:"Frankfurt",country:"Germany"},{code:"ap-southeast-1",name:"Asia Pacific",city:"Singapore",country:"Singapore"}]),BS=Object.freeze(["us-east-2","us-west-2","us-east-1","eu-west-1","ap-southeast-1"])});var Ww,iz=E(()=>{"use strict";Ww="2.3.0"});function Y(t,e,r){function n(i,c){if(i._zod||Object.defineProperty(i,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),i._zod.traits.has(t))return;i._zod.traits.add(t),e(i,c);let l=s.prototype,u=Object.keys(l);for(let p=0;p<u.length;p++){let m=u[p];m in i||(i[m]=l[m].bind(i))}}let a=r?.Parent??Object;class o extends a{}Object.defineProperty(o,"name",{value:t});function s(i){var c;let l=r?.Parent?new o:this;n(l,i),(c=l._zod).deferred??(c.deferred=[]);for(let u of l._zod.deferred)u();return l}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:i=>r?.Parent&&i instanceof r.Parent?!0:i?._zod?.traits?.has(t)}),Object.defineProperty(s,"name",{value:t}),s}function Ca(t){return t&&Object.assign(mg,t),mg}var Oie,cz,lz,du,jm,mg,fg=E(()=>{cz=Object.freeze({status:"aborted"});lz=Symbol("zod_brand"),du=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},jm=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(Oie=globalThis).__zod_globalConfig??(Oie.__zod_globalConfig={});mg=globalThis.__zod_globalConfig});var Te={};Dt(Te,{BIGINT_FORMAT_RANGES:()=>Sz,Class:()=>pz,NUMBER_FORMAT_RANGES:()=>vz,aborted:()=>Gm,allowsEval:()=>fz,assert:()=>$We,assertEqual:()=>DWe,assertIs:()=>OWe,assertNever:()=>NWe,assertNotEqual:()=>RWe,assignProp:()=>Wm,base64ToUint8Array:()=>$ie,base64urlToUint8Array:()=>XWe,cached:()=>zS,captureStackTrace:()=>JR,cleanEnum:()=>JWe,cleanRegex:()=>Hw,clone:()=>$s,cloneDef:()=>FWe,createTransparentProxy:()=>WWe,defineLazy:()=>lr,esc:()=>ZR,escapeRegex:()=>Yc,explicitlyAborted:()=>Ez,extend:()=>HWe,finalizeIssue:()=>Ms,floatSafeRemainder:()=>dz,getElementAtPath:()=>LWe,getEnumValues:()=>Gw,getLengthableOrigin:()=>Yw,getParsedType:()=>zWe,getSizableOrigin:()=>Kw,hexToUint8Array:()=>eVe,isObject:()=>hg,isPlainObject:()=>Vm,issue:()=>WS,joinValues:()=>ce,jsonStringifyReplacer:()=>jS,merge:()=>KWe,mergeDefs:()=>ld,normalizeParams:()=>Oe,nullish:()=>zm,numKeys:()=>jWe,objectClone:()=>MWe,omit:()=>GWe,optionalKeys:()=>yz,parsedType:()=>Ce,partial:()=>YWe,pick:()=>VWe,prefixIssues:()=>Ii,primitiveTypes:()=>gz,promiseAllObject:()=>BWe,propertyKeyTypes:()=>qw,randomString:()=>UWe,required:()=>ZWe,safeExtend:()=>qWe,shallowClone:()=>hz,slugify:()=>mz,stringifyPrimitive:()=>be,uint8ArrayToBase64:()=>Mie,uint8ArrayToBase64url:()=>QWe,uint8ArrayToHex:()=>tVe,unwrapMessage:()=>Vw});function DWe(t){return t}function RWe(t){return t}function OWe(t){}function NWe(t){throw new Error("Unexpected value in exhaustive check")}function $We(t){}function Gw(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,a])=>e.indexOf(+n)===-1).map(([n,a])=>a)}function ce(t,e="|"){return t.map(r=>be(r)).join(e)}function jS(t,e){return typeof e=="bigint"?e.toString():e}function zS(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function zm(t){return t==null}function Hw(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function dz(t,e){let r=t/e,n=Math.round(r),a=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<a?0:r-n}function lr(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==Nie)return n===void 0&&(n=Nie,n=r()),n},set(a){Object.defineProperty(t,e,{value:a})},configurable:!0})}function MWe(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Wm(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ld(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function FWe(t){return ld(t._zod.def)}function LWe(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function BWe(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let a={};for(let o=0;o<e.length;o++)a[e[o]]=n[o];return a})}function UWe(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function ZR(t){return JSON.stringify(t)}function mz(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function hg(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Vm(t){if(hg(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(hg(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function hz(t){return Vm(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function jWe(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}function Yc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $s(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function Oe(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function WWe(t){let e;return new Proxy({},{get(r,n,a){return e??(e=t()),Reflect.get(e,n,a)},set(r,n,a,o){return e??(e=t()),Reflect.set(e,n,a,o)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,a){return e??(e=t()),Reflect.defineProperty(e,n,a)}})}function be(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function yz(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function VWe(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=ld(t._zod.def,{get shape(){let s={};for(let i in e){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);e[i]&&(s[i]=r.shape[i])}return Wm(this,"shape",s),s},checks:[]});return $s(t,o)}function GWe(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=ld(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let i in e){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);e[i]&&delete s[i]}return Wm(this,"shape",s),s},checks:[]});return $s(t,o)}function HWe(t,e){if(!Vm(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let o=t._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let a=ld(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return Wm(this,"shape",o),o}});return $s(t,a)}function qWe(t,e){if(!Vm(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=ld(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return Wm(this,"shape",n),n}});return $s(t,r)}function KWe(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=ld(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return Wm(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return $s(t,r)}function YWe(t,e,r){let a=e._zod.def.checks;if(a&&a.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=ld(e._zod.def,{get shape(){let i=e._zod.def.shape,c={...i};if(r)for(let l in r){if(!(l in i))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(c[l]=t?new t({type:"optional",innerType:i[l]}):i[l])}else for(let l in i)c[l]=t?new t({type:"optional",innerType:i[l]}):i[l];return Wm(this,"shape",c),c},checks:[]});return $s(e,s)}function ZWe(t,e,r){let n=ld(e._zod.def,{get shape(){let a=e._zod.def.shape,o={...a};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:a[s]}))}else for(let s in a)o[s]=new t({type:"nonoptional",innerType:a[s]});return Wm(this,"shape",o),o}});return $s(e,n)}function Gm(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function Ez(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function Ii(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function Vw(t){return typeof t=="string"?t:t?.message}function Ms(t,e,r){let n=t.message?t.message:Vw(t.inst?._zod.def?.error?.(t))??Vw(e?.error?.(t))??Vw(r.customError?.(t))??Vw(r.localeError?.(t))??"Invalid input",{inst:a,continue:o,input:s,...i}=t;return i.path??(i.path=[]),i.message=n,e?.reportInput&&(i.input=s),i}function Kw(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Yw(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Ce(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function WS(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function JWe(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function $ie(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function Mie(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function XWe(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return $ie(e+r)}function QWe(t){return Mie(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function eVe(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n/2]=Number.parseInt(e.slice(n,n+2),16);return r}function tVe(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Nie,JR,fz,zWe,qw,gz,vz,Sz,pz,at=E(()=>{fg();Nie=Symbol("evaluating");JR="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};fz=zS(()=>{if(mg.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});zWe=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},qw=new Set(["string","number","symbol"]),gz=new Set(["string","number","bigint","boolean","symbol","undefined"]);vz={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Sz={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};pz=class{constructor(...e){}}});function Jw(t,e=r=>r.message){let r={},n=[];for(let a of t.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(e(a))):n.push(e(a));return{formErrors:n,fieldErrors:r}}function Xw(t,e=r=>r.message){let r={_errors:[]},n=(a,o=[])=>{for(let s of a.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(i=>n({issues:i},[...o,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...o,...s.path]);else{let i=[...o,...s.path];if(i.length===0)r._errors.push(e(s));else{let c=r,l=0;for(;l<i.length;){let u=i[l];l===i.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(e(s))):c[u]=c[u]||{_errors:[]},c=c[u],l++}}}};return n(t),r}function bz(t,e=r=>r.message){let r={errors:[]},n=(a,o=[])=>{var s,i;for(let c of a.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>n({issues:l},[...o,...c.path]));else if(c.code==="invalid_key")n({issues:c.issues},[...o,...c.path]);else if(c.code==="invalid_element")n({issues:c.issues},[...o,...c.path]);else{let l=[...o,...c.path];if(l.length===0){r.errors.push(e(c));continue}let u=r,p=0;for(;p<l.length;){let m=l[p],d=p===l.length-1;typeof m=="string"?(u.properties??(u.properties={}),(s=u.properties)[m]??(s[m]={errors:[]}),u=u.properties[m]):(u.items??(u.items=[]),(i=u.items)[m]??(i[m]={errors:[]}),u=u.items[m]),d&&u.errors.push(e(c)),p++}}};return n(t),r}function Lie(t){let e=[],r=t.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?e.push(`[${n}]`):typeof n=="symbol"?e.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?e.push(`[${JSON.stringify(n)}]`):(e.length&&e.push("."),e.push(n));return e.join("")}function xz(t){let e=[],r=[...t.issues].sort((n,a)=>(n.path??[]).length-(a.path??[]).length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${Lie(n.path)}`);return e.join(`
53
+ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return r}constructor(e){this.configProvider=new Promise((r,n)=>{typeof e=="function"?e().then(a=>{r(this.resolveDefaultConfig(a))}).catch(n):r(this.resolveDefaultConfig(e))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(e,{abortSignal:r,requestTimeout:n}={}){this.config||(this.config=await this.configProvider);let a=this.config,o=e.protocol==="https:";return!o&&!this.config.httpAgent&&(this.config.httpAgent=await this.config.httpAgentProvider()),new Promise((s,i)=>{let c,l=[],u=async O=>{await c,l.forEach(Fa.clearTimeout),s(O)},p=async O=>{await c,l.forEach(Fa.clearTimeout),i(O)};if(r?.aborted){let O=Z4(r);p(O);return}let m=e.headers??{},d=(m.Expect??m.expect)==="100-continue",f=o?a.httpsAgent:a.httpAgent;d&&!this.externalAgent&&(f=new(o?J4:HR)({keepAlive:!1,maxSockets:1/0})),l.push(Fa.setTimeout(()=>{this.socketWarningTimestamp=t.checkSocketUsage(f,this.socketWarningTimestamp,a.logger)},a.socketAcquisitionWarningTimeout??(a.requestTimeout??2e3)+(a.connectionTimeout??1e3)));let h=zse(e.query||{}),y;if(e.username!=null||e.password!=null){let O=e.username??"",R=e.password??"";y=`${O}:${R}`}let S=e.path;h&&(S+=`?${h}`),e.fragment&&(S+=`#${e.fragment}`);let x=e.hostname??"";x[0]==="["&&x.endsWith("]")?x=e.hostname.slice(1,-1):x=e.hostname;let w={headers:e.headers,host:x,method:e.method,path:S,port:e.port,agent:f,auth:y},T=(o?AWe:cie)(w,O=>{let R=new VR({statusCode:O.statusCode||-1,reason:O.statusMessage,headers:qse(O.headers),body:O});u({response:R})});if(T.on("error",O=>{Gse.includes(O.code)?p(Object.assign(O,{name:"TimeoutError"})):p(O)}),r){let O=()=>{T.destroy();let R=Z4(r);p(R)};if(typeof r.addEventListener=="function"){let R=r;R.addEventListener("abort",O,{once:!0}),T.once("close",()=>R.removeEventListener("abort",O))}else r.onabort=O}let _=n??a.requestTimeout;l.push(Zse(T,p,a.connectionTimeout)),l.push(Xse(T,p,_,a.throwOnRequestTimeout,a.logger??console)),l.push(nie(T,p,a.socketTimeout));let D=w.agent;typeof D=="object"&&"keepAlive"in D&&l.push(eie(T,{keepAlive:D.keepAlive,keepAliveMsecs:D.keepAliveMsecs})),c=sie(T,e,_,this.externalAgent).catch(O=>(l.forEach(Fa.clearTimeout),i(O)))})}updateHttpClientConfig(e,r){this.config=void 0,this.configProvider=this.configProvider.then(n=>({...n,[e]:r}))}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(e){let{requestTimeout:r,connectionTimeout:n,socketTimeout:a,socketAcquisitionWarningTimeout:o,httpAgent:s,httpsAgent:i,throwOnRequestTimeout:c,logger:l}=e||{},u=!0,p=50;return{connectionTimeout:n,requestTimeout:r,socketTimeout:a,socketAcquisitionWarningTimeout:o,throwOnRequestTimeout:c,httpAgentProvider:async()=>{let{Agent:m,request:d}=await import("node:http");return cie=d,HR=m,s instanceof HR||typeof s?.destroy=="function"?(this.externalAgent=!0,s):new HR({keepAlive:u,maxSockets:p,...s})},httpsAgent:i instanceof J4||typeof i?.destroy=="function"?(this.externalAgent=!0,i):new J4({keepAlive:u,maxSockets:p,...i}),logger:l}}}});var uie=E(()=>{});var pie=E(()=>{});var Bm=E(()=>{lie();uie();pie()});function Q4(t){let e=t.replace(/\./g,"-");return{hostedZoneId:`${e}-hosted-zone-id`,certificateArn:`${e}-certificate-arn`,delegationRoleArn:`${e}-delegation-role-arn`,nameservers:`${e}-nameservers`}}var X4,die=E(()=>{X4="@"});function Qu(t){return t.replace(/[-_](.)/g,(e,r)=>r.toUpperCase()).replace(/^./,e=>e.toUpperCase())}function $w(t){return t.replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/([a-z\d])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function FS(t){return $w(t).replace(/-/g,"_")}var mie=E(()=>{});function dg(t){return t instanceof Error?t:new Error(String(t))}function ep(t){return t instanceof Error?t.message:typeof t=="string"?t:t&&typeof t=="object"&&"message"in t?String(t.message):"An unknown error occurred"}var fie=E(()=>{});var hie=E(()=>{});function ez(t){return t.replace(/-----BEGIN [A-Z ]*PRIVATE KEY-----(?:[^"\\]|\\[\\nrt"])*?-----END [A-Z ]*PRIVATE KEY-----/g,"-----BEGIN [REDACTED] PRIVATE KEY-----...-----END [REDACTED] PRIVATE KEY-----").replace(/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g,"-----BEGIN [REDACTED] PRIVATE KEY-----...-----END [REDACTED] PRIVATE KEY-----").replace(/(\w+:\/\/[^:]+:)[^@]+(@)/gi,"$1***$2").replace(/(?<![a-zA-Z])(password|passwd|secret|api[_-]?key|token|auth|credential)([=:])["']?[^\s"']+/gi,"$1$2***").replace(/\b(ghu_|ghs_|ghp_|gho_|github_pat_)[A-Za-z0-9_]+/g,"$1***").replace(/(?<=Authorization:\s*Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"***").replace(/\b(AKIA|ASIA)[A-Z0-9]{12,}\b/g,"$1***").replace(/(?<=AWS_SECRET_ACCESS_KEY=|SecretAccessKey[=:]\s*|"secretAccessKey":\s*")[A-Za-z0-9/+=]{40,}/g,"***").replace(/(arn:aws[^:]*:[^:]*:[^:]*:)(\d{12})(:[^\s]*)/g,"$1***$3").replace(/(?<="(aws)?[Ss]essionToken":\s*")[^"]+/g,"***").replace(/(?<="(internal[Aa]piKey|fjallCallbackToken)":\s*")[^"]+/g,"***").replace(CWe,"fjall_ak_***")}var CWe,gie=E(()=>{CWe=/fjall_ak_[A-Z2-7]{16}\.[A-Z2-7]{40}/g});var yie=E(()=>{});var vie,Sie,wWe,Eie=E(()=>{vie=["production","staging","development","platform","compliance"],Sie={ROOT:"root",PLATFORM:"platform"},wWe=[...vie,Sie.ROOT]});var T$t,k$t,I$t,bie=E(()=>{T$t=Object.freeze({"AWS::IAM::Role":"security","AWS::IAM::Policy":"security","AWS::IAM::OIDCProvider":"security","AWS::EC2::SecurityGroup":"security","AWS::KMS::Key":"security","AWS::KMS::Alias":"security","AWS::EC2::VPC":"network","AWS::EC2::Subnet":"network","AWS::EC2::InternetGateway":"network","AWS::EC2::NatGateway":"network","AWS::EC2::RouteTable":"network","AWS::EC2::Route":"network","AWS::EC2::VPCGatewayAttachment":"network","AWS::EC2::SubnetRouteTableAssociation":"network","AWS::EC2::EIP":"network","AWS::ECS::Cluster":"compute","AWS::ECS::Service":"compute","AWS::ECS::TaskDefinition":"compute","AWS::Lambda::Function":"compute","AWS::ElasticLoadBalancingV2::LoadBalancer":"compute","AWS::ElasticLoadBalancingV2::TargetGroup":"compute","AWS::ElasticLoadBalancingV2::Listener":"compute","AWS::ElasticLoadBalancingV2::ListenerRule":"compute","AWS::RDS::DBInstance":"database","AWS::RDS::DBCluster":"database","AWS::SecretsManager::Secret":"database","AWS::S3::Bucket":"storage","AWS::S3::BucketPolicy":"storage","AWS::CloudTrail::Trail":"monitoring","AWS::CloudWatch::Alarm":"monitoring","AWS::Logs::LogGroup":"monitoring","AWS::Events::EventBus":"events","AWS::Events::Rule":"events","AWS::ECR::Repository":"registry","AWS::CodeBuild::Project":"registry","AWS::Route53::RecordSet":"dns","AWS::CertificateManager::Certificate":"dns","AWS::CloudFront::Distribution":"dns","AWS::Backup::BackupVault":"backup","AWS::Backup::BackupPlan":"backup","AWS::Backup::BackupSelection":"backup","AWS::SSO::PermissionSet":"identity","AWS::SSO::Assignment":"identity","AWS::Organizations::Account":"identity","AWS::CDK::Metadata":"compute","AWS::CloudFormation::CustomResource":"compute","AWS::CloudFormation::WaitCondition":"compute","AWS::CloudFormation::WaitConditionHandle":"compute"}),k$t=Object.freeze({"AWS::EC2::NatGateway":120,"AWS::RDS::DBInstance":300,"AWS::RDS::DBCluster":300,"AWS::CloudFront::Distribution":300,"AWS::ECS::Service":180,"AWS::ElasticLoadBalancingV2::LoadBalancer":60,"AWS::EC2::SecurityGroup":10,"AWS::IAM::Role":15,"AWS::IAM::Policy":15,"AWS::IAM::OIDCProvider":10,"AWS::S3::Bucket":10,"AWS::S3::BucketPolicy":5,"AWS::Lambda::Function":30,"AWS::EC2::VPC":15,"AWS::EC2::Subnet":15,"AWS::EC2::InternetGateway":10,"AWS::EC2::RouteTable":5,"AWS::EC2::Route":5,"AWS::EC2::VPCGatewayAttachment":10,"AWS::EC2::SubnetRouteTableAssociation":5,"AWS::EC2::EIP":10,"AWS::ECS::Cluster":15,"AWS::ECS::TaskDefinition":10,"AWS::ElasticLoadBalancingV2::TargetGroup":10,"AWS::ElasticLoadBalancingV2::Listener":10,"AWS::ElasticLoadBalancingV2::ListenerRule":5,"AWS::SecretsManager::Secret":10,"AWS::Logs::LogGroup":5,"AWS::CloudWatch::Alarm":10,"AWS::CloudTrail::Trail":15,"AWS::Events::EventBus":5,"AWS::Events::Rule":5,"AWS::ECR::Repository":10,"AWS::Route53::RecordSet":30,"AWS::CertificateManager::Certificate":60,"AWS::KMS::Key":15,"AWS::KMS::Alias":5,"AWS::Backup::BackupVault":10,"AWS::Backup::BackupPlan":10,"AWS::Backup::BackupSelection":10,"AWS::SSO::PermissionSet":15,"AWS::SSO::Assignment":10,"AWS::Organizations::Account":60}),I$t=Object.freeze({"AWS::Lambda::Function":"Lambda Function","AWS::IAM::Role":"IAM Role","AWS::IAM::Policy":"IAM Policy","AWS::S3::Bucket":"S3 Bucket","AWS::DynamoDB::Table":"DynamoDB Table","AWS::EC2::Instance":"EC2 Instance","AWS::EC2::SecurityGroup":"Security Group","AWS::EC2::VPC":"VPC","AWS::EC2::Subnet":"Subnet","AWS::EC2::InternetGateway":"Internet Gateway","AWS::EC2::RouteTable":"Route Table","AWS::EC2::Route":"Route","AWS::ECS::Cluster":"ECS Cluster","AWS::ECS::Service":"ECS Service","AWS::ECS::TaskDefinition":"Task Definition","AWS::ElasticLoadBalancingV2::LoadBalancer":"Load Balancer","AWS::ElasticLoadBalancingV2::TargetGroup":"Target Group","AWS::ElasticLoadBalancingV2::Listener":"Listener","AWS::CloudFormation::Stack":"CloudFormation Stack","AWS::CDK::Metadata":"CDK Metadata","Custom::CDKBucketDeployment":"Bucket Deployment","AWS::SSM::Parameter":"SSM Parameter","AWS::CloudWatch::Alarm":"CloudWatch Alarm","AWS::Logs::LogGroup":"Log Group","AWS::ApiGateway::RestApi":"API Gateway","AWS::ApiGateway::Deployment":"API Deployment","AWS::ApiGateway::Stage":"API Stage","AWS::ApiGateway::Method":"API Method","AWS::ApiGateway::Resource":"API Resource","AWS::CloudFront::Distribution":"CloudFront Distribution","AWS::Route53::RecordSet":"Route53 Record","AWS::RDS::DBInstance":"RDS Instance","AWS::RDS::DBCluster":"RDS Cluster","AWS::SQS::Queue":"SQS Queue","AWS::SNS::Topic":"SNS Topic","AWS::Events::Rule":"EventBridge Rule","AWS::StepFunctions::StateMachine":"Step Function","AWS::EC2::NatGateway":"NAT Gateway","AWS::EC2::EIP":"Elastic IP","AWS::EC2::VPCGatewayAttachment":"Gateway Attachment","AWS::EC2::SubnetRouteTableAssociation":"Route Association","AWS::CloudTrail::Trail":"CloudTrail","AWS::IAM::OIDCProvider":"OIDC Provider","AWS::Events::EventBus":"Event Bus","AWS::Backup::BackupVault":"Backup Vault","AWS::Backup::BackupPlan":"Backup Plan","AWS::Backup::BackupSelection":"Backup Selection","AWS::SecretsManager::Secret":"Secret","AWS::KMS::Key":"KMS Key","AWS::KMS::Alias":"KMS Alias","AWS::ECR::Repository":"ECR Repository","AWS::CertificateManager::Certificate":"Certificate","AWS::ElasticLoadBalancingV2::ListenerRule":"Listener Rule","AWS::EC2::IPAM":"IPAM","AWS::EC2::IPAMPool":"IPAM Pool","AWS::EC2::IPAMPoolCidr":"IPAM Pool CIDR","Custom::ram":"RAM","Custom::ipamDelegateAdmin":"IPAM Delegate Admin","Custom::CostAllocationTags":"Cost Allocation Tags","Custom::ActivateOrganisationsAccess":"Activate Organisations Access","Custom::Organizations_TagResource":"Organisations Tag Resource","AWS::CloudFormation::CustomResource":"Custom Resource","AWS::CloudFormation::WaitCondition":"Wait Condition","AWS::CloudFormation::WaitConditionHandle":"Wait Condition Handle","AWS::SSO::PermissionSet":"SSO Permission Set","AWS::SSO::Assignment":"SSO Assignment","AWS::Organizations::Account":"Organisations Account","AWS::S3::BucketPolicy":"S3 Bucket Policy","AWS::CodeBuild::Project":"CodeBuild Project"})});var xie=E(()=>{});var tz=E(()=>{});var Aie=E(()=>{});var Cie=E(()=>{tz()});function qR(t,e){if(e!==void 0){if(e.trim()==="")throw new Error("buildAppConfigPath: container must be a non-empty string");return`${e}/fjall/${t}`}return`fjall/${t}`}var wie=E(()=>{});var rz=E(()=>{});var Tie=E(()=>{rz()});var kie=E(()=>{});var Iie=E(()=>{});var Pie=E(()=>{});var LS=E(()=>{die();mie();fie();hie();gie();yie();Eie();bie();xie();tz();Aie();Cie();wie();rz();Tie();kie();Iie();Pie()});var Mw=E(()=>{"use strict";LS()});function cd(t){return t.success===!0}function Mt(t){return t.success===!1}function A(t){return{success:!0,data:t}}function v(t){return{success:!1,error:t}}async function nz(t){try{let e=await t();return A(e)}catch(e){return v(dg(e))}}function az(t){try{let e=t();return A(e)}catch(e){return v(dg(e))}}var cn=E(()=>{"use strict";Mw()});function oz(t){let e=/^rate\((\d+) (minute|minutes|hour|hours|day|days)\)$/.exec(t);if(!e)return;let r=e[1],n=e[2];if(r===void 0||n===void 0)return;let a=parseInt(r,10);if(!Number.isFinite(a)||a<1)return;let o=n==="minute"||n==="hour"||n==="day";if(!(o&&a!==1)&&!(!o&&a===1))return n==="minute"||n==="minutes"?{everyMs:a*6e4}:n==="hour"||n==="hours"?{everyMs:a*60*6e4}:{everyMs:a*24*60*6e4}}var _ie,Et,Die=E(()=>{"use strict";_ie=/^[a-zA-Z][a-zA-Z0-9-]*$/,Et=Object.freeze({IDENTIFIER:_ie,RESOURCE_NAME:/^[a-zA-Z][a-zA-Z0-9]*$/,ECS_SERVICE_NAME:_ie,BUCKET_NAME:/^[a-z][a-z0-9-]*[a-z0-9]$|^[a-z][a-z0-9]*$/,DATABASE_NAME:/^[a-zA-Z][a-zA-Z0-9_]*$/,RESOURCE_TYPE:/^[a-z]+(:[a-z]+)?$/,SSM_PATH:/^\/[a-zA-Z][a-zA-Z0-9-]*(\/[a-zA-Z][a-zA-Z0-9-]*)*$/,SECRET_NAME:/^[a-zA-Z_][a-zA-Z0-9._-]*$/,SSM_COMPONENT:/^[a-zA-Z][a-zA-Z0-9._-]*$/,EMAIL:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,DOCKER_IMAGE:/^[a-z0-9][a-z0-9._-]*[a-z0-9](:[a-z0-9._-]+)?$/,DOMAIN:/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i,PASCAL_CASE:/^[A-Z][A-Za-z0-9]*$/,AWS_ACCOUNT_ID:/^\d{12}$/,VPC_ID:/^vpc-[a-z0-9]+$/,ROLE_ARN:/^arn:aws[a-zA-Z-]*:iam::\d{12}:role\/.+$/,CIDR:/^((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\/(3[0-2]|[12]?\d)$/,SCHEDULE_EXPRESSION:/^(rate\(1 (?:minute|hour|day)\)|rate\((?:[2-9]|[1-9]\d+) (?:minutes|hours|days)\)|cron\([^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+\))$/,LAMBDA_RUNTIME_IDENTIFIER:/^[A-Za-z0-9._-]+$/,ENV_VAR_NAME:/^[A-Za-z_][A-Za-z0-9_]*$/})});var M,Rie=E(()=>{"use strict";M=Object.freeze({IDENTIFIER:"Must start with a letter, contain only letters, numbers, and hyphens",IDENTIFIER_MIN_LENGTH:"Must be at least 2 characters",IDENTIFIER_NO_TRAILING_HYPHEN:"Must not end with a hyphen",IDENTIFIER_NO_CONSECUTIVE_HYPHENS:"Must not contain consecutive hyphens",RESOURCE_NAME:"Must start with a letter and contain only letters and numbers (PascalCase recommended)",ECS_SERVICE_NAME:"Service name must start with a letter and contain only letters, numbers, and hyphens",BUCKET_NAME:"Bucket name must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",DATABASE_NAME:"Database name must start with a letter and contain only letters, numbers, and underscores",RESOURCE_TYPE:"Resource type must be in format 'category' or 'category:type'",SSM_PATH:"SSM path must start with / and contain valid namespace segments (e.g., /myapp/ApiCluster/service)",SECRET_NAME:"Secret name must start with a letter or underscore and contain only letters, numbers, underscores, hyphens, or periods",SSM_COMPONENT:"Must start with a letter and contain only letters, numbers, periods, hyphens, or underscores",EMAIL:"Please enter a valid email address",DOMAIN:"Please enter a valid domain (e.g., cms.example.com)",DOCKER_IMAGE:"Invalid Docker image name format",REQUIRED:{APP_NAME:"Application name is required",RESOURCE_NAME:"Resource name is required",BUCKET_NAME:"Bucket name is required",SERVICE_NAME:"Service name is required",NETWORK_NAME:"Network name is required",DATABASE_NAME:"Database name is required",ORGANISATION_NAME:"Organisation name is required",EMAIL:"Email is required",NAME:"Name is required",USERNAME:"Username is required",CONTAINER_NAME:"Container name is required",FIRST_NAME:"First name is required",LAST_NAME:"Last name is required",GROUP:"Group is required",PATTERN_NAME:"Pattern name is required",ROUTING_PATH:"Routing path is required",RESOURCE_REFERENCE:"Resource reference is required",RESOURCE_TYPE:"Resource type is required",VARIANT:"Variant is required",SUBTYPE:"Subtype is required",DEPLOY_TARGET:"Deploy target is required",DESTROY_TARGET:"Destroy target is required"},MAX_LENGTH:{APP_NAME:"Application name must be 50 characters or less",RESOURCE_NAME:"Resource name must be 63 characters or less",BUCKET_NAME:"Bucket name must be 63 characters or less",SERVICE_NAME:"Service name must be 255 characters or less",NETWORK_NAME:"Network name must be 50 characters or less",DATABASE_NAME:"Database name must be 63 characters or less",ORGANISATION_NAME:"Organisation name must be 50 characters or less"},PORT:{INTEGER:"Port must be an integer",MIN:"Port must be at least 1",MAX:"Port cannot exceed 65535"},USERNAME:{MAX_LENGTH:"Username cannot exceed 63 characters"},LAMBDA:{MEMORY:{INTEGER:"Lambda memory must be an integer",MIN:"Memory must be at least 128 MB",MAX:"Memory cannot exceed 10240 MB",MULTIPLE:"Memory must be 128 MB or a multiple of 64 MB"},TIMEOUT:{INTEGER:"Timeout must be an integer",MIN:"Timeout must be at least 1 second",MAX:"Timeout cannot exceed 900 seconds"},RUNTIME:"Lambda runtime must contain only letters, digits, dots, underscores, or dashes (e.g. 'NODEJS_20_X' or 'nodejs20.x')"},ENV_VAR_NAME:"Environment variable names must start with a letter or underscore and contain only letters, digits, and underscores",PRIORITY:{INTEGER:"Priority must be an integer",MIN:"Priority must be at least 1",MAX:"Priority cannot exceed 50000"},CAPACITY:{MIN:{INTEGER:"Minimum capacity must be an integer",MIN_0:"Minimum capacity must be at least 0",MIN_1:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 100"},MAX:{INTEGER:"Maximum capacity must be an integer",MIN_0:"Maximum capacity must be at least 0",MIN_1:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 100"},DESIRED:{INTEGER:"Desired count must be an integer",MIN:"Desired count must be at least 0",MAX:"Desired count cannot exceed 100"},WARM_POOL_REQUIRED:"minCapacity 0 requires a warmPool \u2014 without it, new tasks wait 60-90s for a cold instance launch",WARM_POOL:{MIN_SIZE:{INTEGER:"Warm pool minSize must be an integer",MIN:"Warm pool minSize must be at least 0",MAX:"Warm pool minSize cannot exceed 100"},MIN_SIZE_EXCEEDS_MAX_CAPACITY:"warmPool.minSize cannot exceed maxCapacity \u2014 the warm pool cannot hold more instances than the ASG allows"}},MEMORY_LIMIT:{INTEGER:"Memory limit must be an integer",MIN_512:"Memory limit must be at least 512 MiB",MIN_128:"Memory limit must be at least 128 MiB",MAX:"Memory limit cannot exceed 30720 MiB"},DATABASE:{PORT:{INTEGER:"Database port must be an integer",MIN:"Database port must be at least 1024",MAX:"Database port cannot exceed 65535"},NAME:{REQUIRED:"Database name is required",MAX_LENGTH:"Database name must be 63 characters or less"}},BACKUP_RETENTION:{INTEGER:"Backup retention must be an integer",MIN:"Backup retention must be at least 1 day",MAX:"Backup retention cannot exceed 35 days"},SQS:{VISIBILITY_TIMEOUT:{INTEGER:"Visibility timeout must be an integer",MIN:"Visibility timeout must be at least 0 seconds",MAX:"Visibility timeout cannot exceed 43200 seconds (12 hours)"},RETENTION_PERIOD:{INTEGER:"Retention period must be an integer",MIN:"Retention period must be at least 60 seconds",MAX:"Retention period cannot exceed 1209600 seconds (14 days)"}},READER:{COUNT:{INTEGER:"Reader count must be an integer",MIN:"Reader count must be at least 0",MAX:"Reader count cannot exceed 15"}},IDENTIFIER_SUFFIX:{REQUIRED:"Identifier suffix is required when specified",MAX_LENGTH:"Identifier suffix cannot exceed 50 characters"},ROTATION:{INTEGER:"Rotation days must be an integer",MIN:"Rotation interval must be at least 1 day",MAX:"Rotation interval cannot exceed 365 days"},MAX_CONNECTIONS:{INTEGER:"Max connections must be an integer",MIN:"Max connections must be at least 1",MAX:"Max connections cannot exceed 100"},MONITORING_INTERVAL:{INTEGER:"Monitoring interval must be an integer",MIN:"Monitoring interval must be at least 0",MAX:"Monitoring interval cannot exceed 60 seconds",VALUES:"Monitoring interval must be 0, 1, 5, 10, 15, 30, or 60 seconds"},RETENTION_DAYS:{INTEGER:"Retention days must be an integer",MIN:"Retention days must be at least 1",MAX:"Retention days cannot exceed 365"},BATCH_SIZE:{INTEGER:"Batch size must be an integer",MIN:"Batch size must be at least 1",MAX:"Batch size cannot exceed 10000"},SERVICE:{UNIQUE_WITHIN_CLUSTER:"Service names must be unique within a cluster",MIN_REQUIRED:"At least one service is required",ROUTING_REQUIRED:"Multiple services with ports require routing config (path or host)"},PROXY_CONFIG:{MAX_IDLE_CONNECTIONS:{INTEGER:"Max idle connections must be an integer",MIN:"Max idle connections must be at least 0",MAX:"Max idle connections cannot exceed 100"},BORROW_TIMEOUT:{INTEGER:"Connection borrow timeout must be an integer",MIN:"Connection borrow timeout must be at least 1 second",MAX:"Connection borrow timeout cannot exceed 3600 seconds"}},MAX_AZS:{INTEGER:"Max AZs must be an integer",MIN:"Max AZs must be at least 1",MAX:"Max AZs cannot exceed 3"},BATCHING_WINDOW:{INTEGER:"Max batching window must be an integer",MIN:"Max batching window must be at least 0",MAX:"Max batching window cannot exceed 300 seconds"},HEALTH_CHECK:{INTERVAL:{INTEGER:"Health check interval must be an integer",MIN:"Health check interval must be at least 5 seconds",MAX:"Health check interval cannot exceed 300 seconds"},TIMEOUT:{INTEGER:"Health check timeout must be an integer",MIN:"Health check timeout must be at least 2 seconds",MAX:"Health check timeout cannot exceed 60 seconds"},RETRIES:{INTEGER:"Health check retries must be an integer",MIN:"Health check retries must be at least 1",MAX:"Health check retries cannot exceed 10"},START_PERIOD:{INTEGER:"Health check start period must be an integer",MIN:"Health check start period must be at least 0 seconds",MAX:"Health check start period cannot exceed 300 seconds"}},EPHEMERAL_STORAGE:{INTEGER:"Ephemeral storage size must be an integer",MIN:"Ephemeral storage size must be at least 512 MB",MAX:"Ephemeral storage size cannot exceed 10240 MB"},MAX_MESSAGE_SIZE:{INTEGER:"Max message size must be an integer",MIN:"Max message size must be at least 1024 bytes",MAX:"Max message size cannot exceed 262144 bytes (256 KB)"},CAPACITY_CONSTRAINT:{MIN_LTE_MAX:"minCapacity must be less than or equal to maxCapacity"},DIRECT_ACCESS:{NO_DOMAIN:"directAccess cannot be used with domain (no ALB for HTTPS)",NO_LOAD_BALANCER:"directAccess cannot be used with loadBalancer (mutually exclusive)"},GLOBAL_AURORA:{PRIMARY_REGION_REQUIRED:"primaryRegion is required for GlobalAurora databases"},NAT_GATEWAY:{INTEGER:"NAT gateway count must be an integer",MIN:"NAT gateway count must be at least 0",MAX:"NAT gateway count cannot exceed 3"},CIDR_MASK:{INTEGER:"CIDR mask must be an integer",MIN:"CIDR mask must be at least 16",MAX:"CIDR mask cannot exceed 28"},CPU:{INTEGER:"CPU must be an integer",MIN:"CPU must be at least 256 units",MAX:"CPU cannot exceed 4096 units"},KMS:{KEY_REQUIRED:"KMS key ARN is required when using KMS encryption"},READER_INSTANCES:{MAX:"Cannot have more than 15 reader instances",COUNT_OR_INSTANCES:"Cannot specify both 'count' and 'instances' - use one or the other"},GENERATOR_CAPACITY:{MIN:{MIN:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 1000"},MAX:{MIN:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 1000"}},INSTANCE_TYPE:"Unknown instance type. Common types include: t4g.micro, t4g.small, m5.large",ARCHITECTURE_MISMATCH:"Architecture mismatch between instance type and AMI",ALLOCATED_STORAGE:{INTEGER:"Allocated storage must be an integer",MIN:"Allocated storage must be at least 20 GB",MAX:"Allocated storage cannot exceed 65536 GB"},DLQ:{MAX_RECEIVE_COUNT:{INTEGER:"Max receive count must be an integer",MIN:"Max receive count must be at least 1",MAX:"Max receive count cannot exceed 1000"}},ALARM:{PERCENTAGE:{MIN:"Threshold must be at least 1%",MAX:"Threshold must be at most 100%"},FREE_STORAGE_GIB:{MIN:"Free storage threshold must be at least 1 GiB"}},REGION:"Invalid AWS region",PASCAL_CASE:"Resource name must start with an uppercase letter and contain only alphanumerics (PascalCase).",IMAGE_DOCKER_MUTEX:"image and docker are mutually exclusive",AWS_ACCOUNT_ID:"AWS account id must be exactly 12 digits (no hyphens)",VPC_ID:"VPC id must look like vpc-abc12345",ROLE_ARN:"Role ARN must have the form arn:aws:iam::<account-id>:role/<name>",CIDR:"CIDR must be in dotted-quad/prefix-length form (e.g. 10.0.0.0/16)",VPC_PEER:{MIN_REQUESTER_ACCOUNTS:"At least one requester account id is required",REGION_REQUIRED:"Peer region is required when specified",ROUTE_TABLE_ID_REQUIRED:"Route table id must not be empty"},SCHEDULE_EXPRESSION:"Schedule expression must be 'rate(N minute|minutes|hour|hours|day|days)' with N>=1, or 'cron(<6-field AWS expression>)'"})});var Kc=E(()=>{"use strict";Die();Rie()});function US(t){return t?t.split(",").map(e=>e.trim()).filter(Boolean):[]}function Lw(t){return uu.includes(t)}function Bw(t){return/^[a-z]{2}-[a-z]+-[1-9]$/.test(t)}function Uw(t){if(!t)return BS.slice(0,3);let e=t.toLowerCase().split("-"),r=e[0],n=e.length>1?e[1]:"",a=[];return r&&n&&(a=uu.filter(o=>o.startsWith(`${r}-${n}`))),a.length===0&&r&&(a=uu.filter(o=>o.startsWith(`${r}-`))),a.length>0?a.slice(0,3):BS.slice(0,3)}function jw(t){if(Lw(t))return!0;let e=Uw(t);return Bw(t)?`Unknown region. Try: ${e.join(", ")}`:`Invalid format. Try: ${e.join(", ")}`}function KR(t){if(!t||t.trim()==="")return!0;let e=US(t);for(let r of e){let n=jw(r);if(n!==!0)return n}return!0}function zw(t,e){return t.filter(r=>r!==e)}function Ti(){return pu.map(t=>({label:t.city,value:t.code,description:t.code}))}function Um(t){return pu.filter(e=>e.code!==t).map(e=>({label:e.city,value:e.code,description:e.code}))}function ki(t){let e=pu.find(r=>r.code===t);return e?e.city:t}function YR(t){return e=>{let r=US(e);return zw(r,t)}}var Ye,uu,pu,Fw,BS,sz=E(()=>{"use strict";Ye="us-east-2",uu=Object.freeze(["us-east-2","us-west-2","us-east-1","eu-west-1","eu-central-1","ap-southeast-1","ap-northeast-1","ap-southeast-2","us-west-1","ca-central-1","af-south-1","ap-east-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-south-2","ap-southeast-3","ap-southeast-4","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-2","eu-west-3","me-central-1","me-south-1","sa-east-1"]),pu=Object.freeze([{code:"us-east-2",name:"US East",city:"Ohio",country:"USA"},{code:"us-west-2",name:"US West",city:"Oregon",country:"USA"},{code:"us-east-1",name:"US East",city:"N. Virginia",country:"USA"},{code:"eu-west-1",name:"EU West",city:"Ireland",country:"Ireland"},{code:"eu-central-1",name:"EU Central",city:"Frankfurt",country:"Germany"},{code:"ap-southeast-1",name:"Asia Pacific",city:"Singapore",country:"Singapore"},{code:"ap-northeast-1",name:"Asia Pacific",city:"Tokyo",country:"Japan"},{code:"ap-southeast-2",name:"Asia Pacific",city:"Sydney",country:"Australia"},{code:"us-west-1",name:"US West",city:"N. California",country:"USA"},{code:"ca-central-1",name:"Canada",city:"Central",country:"Canada"},{code:"af-south-1",name:"Africa",city:"Cape Town",country:"South Africa"},{code:"ap-east-1",name:"Asia Pacific",city:"Hong Kong",country:"China"},{code:"ap-northeast-2",name:"Asia Pacific",city:"Seoul",country:"South Korea"},{code:"ap-northeast-3",name:"Asia Pacific",city:"Osaka",country:"Japan"},{code:"ap-south-1",name:"Asia Pacific",city:"Mumbai",country:"India"},{code:"ap-south-2",name:"Asia Pacific",city:"Hyderabad",country:"India"},{code:"ap-southeast-3",name:"Asia Pacific",city:"Jakarta",country:"Indonesia"},{code:"ap-southeast-4",name:"Asia Pacific",city:"Melbourne",country:"Australia"},{code:"eu-central-2",name:"EU Central",city:"Zurich",country:"Switzerland"},{code:"eu-north-1",name:"EU North",city:"Stockholm",country:"Sweden"},{code:"eu-south-1",name:"EU South",city:"Milan",country:"Italy"},{code:"eu-south-2",name:"EU South",city:"Spain",country:"Spain"},{code:"eu-west-2",name:"EU West",city:"London",country:"UK"},{code:"eu-west-3",name:"EU West",city:"Paris",country:"France"},{code:"me-central-1",name:"Middle East",city:"UAE",country:"UAE"},{code:"me-south-1",name:"Middle East",city:"Bahrain",country:"Bahrain"},{code:"sa-east-1",name:"South America",city:"S\xE3o Paulo",country:"Brazil"}]),Fw=Object.freeze([{code:"us-east-2",name:"US East",city:"Ohio",country:"USA"},{code:"us-west-2",name:"US West",city:"Oregon",country:"USA"},{code:"us-east-1",name:"US East",city:"N. Virginia",country:"USA"},{code:"eu-west-1",name:"EU West",city:"Ireland",country:"Ireland"},{code:"eu-central-1",name:"EU Central",city:"Frankfurt",country:"Germany"},{code:"ap-southeast-1",name:"Asia Pacific",city:"Singapore",country:"Singapore"}]),BS=Object.freeze(["us-east-2","us-west-2","us-east-1","eu-west-1","ap-southeast-1"])});var Ww,iz=E(()=>{"use strict";Ww="2.4.0"});function Y(t,e,r){function n(i,c){if(i._zod||Object.defineProperty(i,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),i._zod.traits.has(t))return;i._zod.traits.add(t),e(i,c);let l=s.prototype,u=Object.keys(l);for(let p=0;p<u.length;p++){let m=u[p];m in i||(i[m]=l[m].bind(i))}}let a=r?.Parent??Object;class o extends a{}Object.defineProperty(o,"name",{value:t});function s(i){var c;let l=r?.Parent?new o:this;n(l,i),(c=l._zod).deferred??(c.deferred=[]);for(let u of l._zod.deferred)u();return l}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:i=>r?.Parent&&i instanceof r.Parent?!0:i?._zod?.traits?.has(t)}),Object.defineProperty(s,"name",{value:t}),s}function Ca(t){return t&&Object.assign(mg,t),mg}var Oie,cz,lz,du,jm,mg,fg=E(()=>{cz=Object.freeze({status:"aborted"});lz=Symbol("zod_brand"),du=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},jm=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(Oie=globalThis).__zod_globalConfig??(Oie.__zod_globalConfig={});mg=globalThis.__zod_globalConfig});var Te={};Dt(Te,{BIGINT_FORMAT_RANGES:()=>Sz,Class:()=>pz,NUMBER_FORMAT_RANGES:()=>vz,aborted:()=>Gm,allowsEval:()=>fz,assert:()=>$We,assertEqual:()=>DWe,assertIs:()=>OWe,assertNever:()=>NWe,assertNotEqual:()=>RWe,assignProp:()=>Wm,base64ToUint8Array:()=>$ie,base64urlToUint8Array:()=>XWe,cached:()=>zS,captureStackTrace:()=>JR,cleanEnum:()=>JWe,cleanRegex:()=>Hw,clone:()=>$s,cloneDef:()=>FWe,createTransparentProxy:()=>WWe,defineLazy:()=>lr,esc:()=>ZR,escapeRegex:()=>Yc,explicitlyAborted:()=>Ez,extend:()=>HWe,finalizeIssue:()=>Ms,floatSafeRemainder:()=>dz,getElementAtPath:()=>LWe,getEnumValues:()=>Gw,getLengthableOrigin:()=>Yw,getParsedType:()=>zWe,getSizableOrigin:()=>Kw,hexToUint8Array:()=>eVe,isObject:()=>hg,isPlainObject:()=>Vm,issue:()=>WS,joinValues:()=>ce,jsonStringifyReplacer:()=>jS,merge:()=>KWe,mergeDefs:()=>ld,normalizeParams:()=>Oe,nullish:()=>zm,numKeys:()=>jWe,objectClone:()=>MWe,omit:()=>GWe,optionalKeys:()=>yz,parsedType:()=>Ce,partial:()=>YWe,pick:()=>VWe,prefixIssues:()=>Ii,primitiveTypes:()=>gz,promiseAllObject:()=>BWe,propertyKeyTypes:()=>qw,randomString:()=>UWe,required:()=>ZWe,safeExtend:()=>qWe,shallowClone:()=>hz,slugify:()=>mz,stringifyPrimitive:()=>be,uint8ArrayToBase64:()=>Mie,uint8ArrayToBase64url:()=>QWe,uint8ArrayToHex:()=>tVe,unwrapMessage:()=>Vw});function DWe(t){return t}function RWe(t){return t}function OWe(t){}function NWe(t){throw new Error("Unexpected value in exhaustive check")}function $We(t){}function Gw(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,a])=>e.indexOf(+n)===-1).map(([n,a])=>a)}function ce(t,e="|"){return t.map(r=>be(r)).join(e)}function jS(t,e){return typeof e=="bigint"?e.toString():e}function zS(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function zm(t){return t==null}function Hw(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function dz(t,e){let r=t/e,n=Math.round(r),a=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<a?0:r-n}function lr(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==Nie)return n===void 0&&(n=Nie,n=r()),n},set(a){Object.defineProperty(t,e,{value:a})},configurable:!0})}function MWe(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Wm(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ld(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function FWe(t){return ld(t._zod.def)}function LWe(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function BWe(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let a={};for(let o=0;o<e.length;o++)a[e[o]]=n[o];return a})}function UWe(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function ZR(t){return JSON.stringify(t)}function mz(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function hg(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Vm(t){if(hg(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(hg(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function hz(t){return Vm(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function jWe(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}function Yc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $s(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function Oe(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function WWe(t){let e;return new Proxy({},{get(r,n,a){return e??(e=t()),Reflect.get(e,n,a)},set(r,n,a,o){return e??(e=t()),Reflect.set(e,n,a,o)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,a){return e??(e=t()),Reflect.defineProperty(e,n,a)}})}function be(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function yz(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function VWe(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=ld(t._zod.def,{get shape(){let s={};for(let i in e){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);e[i]&&(s[i]=r.shape[i])}return Wm(this,"shape",s),s},checks:[]});return $s(t,o)}function GWe(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=ld(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let i in e){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);e[i]&&delete s[i]}return Wm(this,"shape",s),s},checks:[]});return $s(t,o)}function HWe(t,e){if(!Vm(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let o=t._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let a=ld(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return Wm(this,"shape",o),o}});return $s(t,a)}function qWe(t,e){if(!Vm(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=ld(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return Wm(this,"shape",n),n}});return $s(t,r)}function KWe(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=ld(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return Wm(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return $s(t,r)}function YWe(t,e,r){let a=e._zod.def.checks;if(a&&a.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=ld(e._zod.def,{get shape(){let i=e._zod.def.shape,c={...i};if(r)for(let l in r){if(!(l in i))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(c[l]=t?new t({type:"optional",innerType:i[l]}):i[l])}else for(let l in i)c[l]=t?new t({type:"optional",innerType:i[l]}):i[l];return Wm(this,"shape",c),c},checks:[]});return $s(e,s)}function ZWe(t,e,r){let n=ld(e._zod.def,{get shape(){let a=e._zod.def.shape,o={...a};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:a[s]}))}else for(let s in a)o[s]=new t({type:"nonoptional",innerType:a[s]});return Wm(this,"shape",o),o}});return $s(e,n)}function Gm(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function Ez(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function Ii(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function Vw(t){return typeof t=="string"?t:t?.message}function Ms(t,e,r){let n=t.message?t.message:Vw(t.inst?._zod.def?.error?.(t))??Vw(e?.error?.(t))??Vw(r.customError?.(t))??Vw(r.localeError?.(t))??"Invalid input",{inst:a,continue:o,input:s,...i}=t;return i.path??(i.path=[]),i.message=n,e?.reportInput&&(i.input=s),i}function Kw(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Yw(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Ce(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function WS(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function JWe(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function $ie(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function Mie(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function XWe(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return $ie(e+r)}function QWe(t){return Mie(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function eVe(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n/2]=Number.parseInt(e.slice(n,n+2),16);return r}function tVe(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Nie,JR,fz,zWe,qw,gz,vz,Sz,pz,at=E(()=>{fg();Nie=Symbol("evaluating");JR="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};fz=zS(()=>{if(mg.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});zWe=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},qw=new Set(["string","number","symbol"]),gz=new Set(["string","number","bigint","boolean","symbol","undefined"]);vz={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Sz={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};pz=class{constructor(...e){}}});function Jw(t,e=r=>r.message){let r={},n=[];for(let a of t.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(e(a))):n.push(e(a));return{formErrors:n,fieldErrors:r}}function Xw(t,e=r=>r.message){let r={_errors:[]},n=(a,o=[])=>{for(let s of a.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(i=>n({issues:i},[...o,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...o,...s.path]);else{let i=[...o,...s.path];if(i.length===0)r._errors.push(e(s));else{let c=r,l=0;for(;l<i.length;){let u=i[l];l===i.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(e(s))):c[u]=c[u]||{_errors:[]},c=c[u],l++}}}};return n(t),r}function bz(t,e=r=>r.message){let r={errors:[]},n=(a,o=[])=>{var s,i;for(let c of a.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>n({issues:l},[...o,...c.path]));else if(c.code==="invalid_key")n({issues:c.issues},[...o,...c.path]);else if(c.code==="invalid_element")n({issues:c.issues},[...o,...c.path]);else{let l=[...o,...c.path];if(l.length===0){r.errors.push(e(c));continue}let u=r,p=0;for(;p<l.length;){let m=l[p],d=p===l.length-1;typeof m=="string"?(u.properties??(u.properties={}),(s=u.properties)[m]??(s[m]={errors:[]}),u=u.properties[m]):(u.items??(u.items=[]),(i=u.items)[m]??(i[m]={errors:[]}),u=u.items[m]),d&&u.errors.push(e(c)),p++}}};return n(t),r}function Lie(t){let e=[],r=t.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?e.push(`[${n}]`):typeof n=="symbol"?e.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?e.push(`[${JSON.stringify(n)}]`):(e.length&&e.push("."),e.push(n));return e.join("")}function xz(t){let e=[],r=[...t.issues].sort((n,a)=>(n.path??[]).length-(a.path??[]).length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${Lie(n.path)}`);return e.join(`
54
54
  `)}var Fie,Zw,Pi,Az=E(()=>{fg();at();Fie=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,jS,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Zw=Y("$ZodError",Fie),Pi=Y("$ZodError",Fie,{Parent:Error})});var VS,XR,GS,QR,HS,Cz,qS,wz,eO,nVe,tO,aVe,rO,oVe,nO,sVe,aO,iVe,oO,cVe,sO,lVe,iO,uVe,Tz=E(()=>{fg();Az();at();VS=t=>(e,r,n,a)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new du;if(s.issues.length){let i=new(a?.Err??t)(s.issues.map(c=>Ms(c,o,Ca())));throw JR(i,a?.callee),i}return s.value},XR=VS(Pi),GS=t=>async(e,r,n,a)=>{let o=n?{...n,async:!0}:{async:!0},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let i=new(a?.Err??t)(s.issues.map(c=>Ms(c,o,Ca())));throw JR(i,a?.callee),i}return s.value},QR=GS(Pi),HS=t=>(e,r,n)=>{let a=n?{...n,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new du;return o.issues.length?{success:!1,error:new(t??Zw)(o.issues.map(s=>Ms(s,a,Ca())))}:{success:!0,data:o.value}},Cz=HS(Pi),qS=t=>async(e,r,n)=>{let a=n?{...n,async:!0}:{async:!0},o=e._zod.run({value:r,issues:[]},a);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>Ms(s,a,Ca())))}:{success:!0,data:o.value}},wz=qS(Pi),eO=t=>(e,r,n)=>{let a=n?{...n,direction:"backward"}:{direction:"backward"};return VS(t)(e,r,a)},nVe=eO(Pi),tO=t=>(e,r,n)=>VS(t)(e,r,n),aVe=tO(Pi),rO=t=>async(e,r,n)=>{let a=n?{...n,direction:"backward"}:{direction:"backward"};return GS(t)(e,r,a)},oVe=rO(Pi),nO=t=>async(e,r,n)=>GS(t)(e,r,n),sVe=nO(Pi),aO=t=>(e,r,n)=>{let a=n?{...n,direction:"backward"}:{direction:"backward"};return HS(t)(e,r,a)},iVe=aO(Pi),oO=t=>(e,r,n)=>HS(t)(e,r,n),cVe=oO(Pi),sO=t=>async(e,r,n)=>{let a=n?{...n,direction:"backward"}:{direction:"backward"};return qS(t)(e,r,a)},lVe=sO(Pi),iO=t=>async(e,r,n)=>qS(t)(e,r,n),uVe=iO(Pi)});var mc={};Dt(mc,{base64:()=>zz,base64url:()=>cO,bigint:()=>Yz,boolean:()=>Jz,browserEmail:()=>vVe,cidrv4:()=>Uz,cidrv6:()=>jz,cuid:()=>kz,cuid2:()=>Iz,date:()=>Gz,datetime:()=>qz,domain:()=>bVe,duration:()=>Oz,e164:()=>Vz,email:()=>$z,emoji:()=>Mz,extendedDuration:()=>pVe,guid:()=>Nz,hex:()=>xVe,hostname:()=>EVe,html5Email:()=>hVe,httpProtocol:()=>Wz,idnEmail:()=>yVe,integer:()=>Zz,ipv4:()=>Fz,ipv6:()=>Lz,ksuid:()=>Dz,lowercase:()=>e6,mac:()=>Bz,md5_base64:()=>CVe,md5_base64url:()=>wVe,md5_hex:()=>AVe,nanoid:()=>Rz,null:()=>Xz,number:()=>lO,rfc5322Email:()=>gVe,sha1_base64:()=>kVe,sha1_base64url:()=>IVe,sha1_hex:()=>TVe,sha256_base64:()=>_Ve,sha256_base64url:()=>DVe,sha256_hex:()=>PVe,sha384_base64:()=>OVe,sha384_base64url:()=>NVe,sha384_hex:()=>RVe,sha512_base64:()=>MVe,sha512_base64url:()=>FVe,sha512_hex:()=>$Ve,string:()=>Kz,time:()=>Hz,ulid:()=>Pz,undefined:()=>Qz,unicodeEmail:()=>Bie,uppercase:()=>t6,uuid:()=>gg,uuid4:()=>dVe,uuid6:()=>mVe,uuid7:()=>fVe,xid:()=>_z});function Mz(){return new RegExp(SVe,"u")}function jie(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Hz(t){return new RegExp(`^${jie(t)}$`)}function qz(t){let e=jie({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Uie}T(?:${n})$`)}function Qw(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function e0(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var kz,Iz,Pz,_z,Dz,Rz,Oz,pVe,Nz,gg,dVe,mVe,fVe,$z,hVe,gVe,Bie,yVe,vVe,SVe,Fz,Lz,Bz,Uz,jz,zz,cO,EVe,bVe,Wz,Vz,Uie,Gz,Kz,Yz,Zz,lO,Jz,Xz,Qz,e6,t6,xVe,AVe,CVe,wVe,TVe,kVe,IVe,PVe,_Ve,DVe,RVe,OVe,NVe,$Ve,MVe,FVe,uO=E(()=>{at();kz=/^[cC][0-9a-z]{6,}$/,Iz=/^[0-9a-z]+$/,Pz=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,_z=/^[0-9a-vA-V]{20}$/,Dz=/^[A-Za-z0-9]{27}$/,Rz=/^[a-zA-Z0-9_-]{21}$/,Oz=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,pVe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Nz=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,gg=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,dVe=gg(4),mVe=gg(6),fVe=gg(7),$z=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,hVe=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,gVe=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Bie=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,yVe=Bie,vVe=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,SVe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Fz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Lz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Bz=t=>{let e=Yc(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Uz=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,jz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,zz=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,cO=/^[A-Za-z0-9_-]*$/,EVe=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,bVe=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Wz=/^https?$/,Vz=/^\+[1-9]\d{6,14}$/,Uie="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Gz=new RegExp(`^${Uie}$`);Kz=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Yz=/^-?\d+n?$/,Zz=/^-?\d+$/,lO=/^-?\d+(?:\.\d+)?$/,Jz=/^(?:true|false)$/i,Xz=/^null$/i,Qz=/^undefined$/i,e6=/^[^A-Z]*$/,t6=/^[^a-z]*$/,xVe=/^[0-9a-fA-F]*$/;AVe=/^[0-9a-fA-F]{32}$/,CVe=Qw(22,"=="),wVe=e0(22),TVe=/^[0-9a-fA-F]{40}$/,kVe=Qw(27,"="),IVe=e0(27),PVe=/^[0-9a-fA-F]{64}$/,_Ve=Qw(43,"="),DVe=e0(43),RVe=/^[0-9a-fA-F]{96}$/,OVe=Qw(64,""),NVe=e0(64),$Ve=/^[0-9a-fA-F]{128}$/,MVe=Qw(86,"=="),FVe=e0(86)});function zie(t,e,r){t.issues.length&&e.issues.push(...Ii(r,t.issues))}var Tn,Wie,pO,dO,r6,n6,a6,o6,s6,i6,c6,l6,u6,KS,p6,d6,m6,f6,h6,g6,y6,v6,S6,mO=E(()=>{fg();uO();at();Tn=Y("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Wie={number:"number",bigint:"bigint",object:"date"},pO=Y("$ZodCheckLessThan",(t,e)=>{Tn.init(t,e);let r=Wie[typeof e.value];t._zod.onattach.push(n=>{let a=n._zod.bag,o=(e.inclusive?a.maximum:a.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?a.maximum=e.value:a.exclusiveMaximum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),dO=Y("$ZodCheckGreaterThan",(t,e)=>{Tn.init(t,e);let r=Wie[typeof e.value];t._zod.onattach.push(n=>{let a=n._zod.bag,o=(e.inclusive?a.minimum:a.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?a.minimum=e.value:a.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),r6=Y("$ZodCheckMultipleOf",(t,e)=>{Tn.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):dz(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),n6=Y("$ZodCheckNumberFormat",(t,e)=>{Tn.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[a,o]=vz[e.format];t._zod.onattach.push(s=>{let i=s._zod.bag;i.format=e.format,i.minimum=a,i.maximum=o,r&&(i.pattern=Zz)}),t._zod.check=s=>{let i=s.value;if(r){if(!Number.isInteger(i)){s.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:i,inst:t});return}if(!Number.isSafeInteger(i)){i>0?s.issues.push({input:i,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):s.issues.push({input:i,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}i<a&&s.issues.push({origin:"number",input:i,code:"too_small",minimum:a,inclusive:!0,inst:t,continue:!e.abort}),i>o&&s.issues.push({origin:"number",input:i,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),a6=Y("$ZodCheckBigIntFormat",(t,e)=>{Tn.init(t,e);let[r,n]=Sz[e.format];t._zod.onattach.push(a=>{let o=a._zod.bag;o.format=e.format,o.minimum=r,o.maximum=n}),t._zod.check=a=>{let o=a.value;o<r&&a.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),o>n&&a.issues.push({origin:"bigint",input:o,code:"too_big",maximum:n,inclusive:!0,inst:t,continue:!e.abort})}}),o6=Y("$ZodCheckMaxSize",(t,e)=>{var r;Tn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let a=n.value;return!zm(a)&&a.size!==void 0}),t._zod.onattach.push(n=>{let a=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<a&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let a=n.value;a.size<=e.maximum||n.issues.push({origin:Kw(a),code:"too_big",maximum:e.maximum,inclusive:!0,input:a,inst:t,continue:!e.abort})}}),s6=Y("$ZodCheckMinSize",(t,e)=>{var r;Tn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let a=n.value;return!zm(a)&&a.size!==void 0}),t._zod.onattach.push(n=>{let a=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>a&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let a=n.value;a.size>=e.minimum||n.issues.push({origin:Kw(a),code:"too_small",minimum:e.minimum,inclusive:!0,input:a,inst:t,continue:!e.abort})}}),i6=Y("$ZodCheckSizeEquals",(t,e)=>{var r;Tn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let a=n.value;return!zm(a)&&a.size!==void 0}),t._zod.onattach.push(n=>{let a=n._zod.bag;a.minimum=e.size,a.maximum=e.size,a.size=e.size}),t._zod.check=n=>{let a=n.value,o=a.size;if(o===e.size)return;let s=o>e.size;n.issues.push({origin:Kw(a),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),c6=Y("$ZodCheckMaxLength",(t,e)=>{var r;Tn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let a=n.value;return!zm(a)&&a.length!==void 0}),t._zod.onattach.push(n=>{let a=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<a&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let a=n.value;if(a.length<=e.maximum)return;let s=Yw(a);n.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:a,inst:t,continue:!e.abort})}}),l6=Y("$ZodCheckMinLength",(t,e)=>{var r;Tn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let a=n.value;return!zm(a)&&a.length!==void 0}),t._zod.onattach.push(n=>{let a=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>a&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let a=n.value;if(a.length>=e.minimum)return;let s=Yw(a);n.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:a,inst:t,continue:!e.abort})}}),u6=Y("$ZodCheckLengthEquals",(t,e)=>{var r;Tn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let a=n.value;return!zm(a)&&a.length!==void 0}),t._zod.onattach.push(n=>{let a=n._zod.bag;a.minimum=e.length,a.maximum=e.length,a.length=e.length}),t._zod.check=n=>{let a=n.value,o=a.length;if(o===e.length)return;let s=Yw(a),i=o>e.length;n.issues.push({origin:s,...i?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),KS=Y("$ZodCheckStringFormat",(t,e)=>{var r,n;Tn.init(t,e),t._zod.onattach.push(a=>{let o=a._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=a=>{e.pattern.lastIndex=0,!e.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:e.format,input:a.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),p6=Y("$ZodCheckRegex",(t,e)=>{KS.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),d6=Y("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=e6),KS.init(t,e)}),m6=Y("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=t6),KS.init(t,e)}),f6=Y("$ZodCheckIncludes",(t,e)=>{Tn.init(t,e);let r=Yc(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(a=>{let o=a._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),t._zod.check=a=>{a.value.includes(e.includes,e.position)||a.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:a.value,inst:t,continue:!e.abort})}}),h6=Y("$ZodCheckStartsWith",(t,e)=>{Tn.init(t,e);let r=new RegExp(`^${Yc(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let a=n._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),g6=Y("$ZodCheckEndsWith",(t,e)=>{Tn.init(t,e);let r=new RegExp(`.*${Yc(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let a=n._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});y6=Y("$ZodCheckProperty",(t,e)=>{Tn.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(a=>zie(a,r,e.property));zie(n,r,e.property)}}),v6=Y("$ZodCheckMimeType",(t,e)=>{Tn.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t,continue:!e.abort})}}),S6=Y("$ZodCheckOverwrite",(t,e)=>{Tn.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}})});var t0,E6=E(()=>{t0=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
55
55
  `).filter(s=>s),a=Math.min(...n.map(s=>s.length-s.trimStart().length)),o=n.map(s=>s.slice(a)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,r=this?.args,a=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...r,a.join(`
56
56
  `))}}});var b6,x6=E(()=>{b6={major:4,minor:4,patch:3}});function V6(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function oce(t){if(!cO.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return V6(r)}function sce(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let a=JSON.parse(atob(n));return!("typ"in a&&a?.typ!=="JWT"||!a.alg||e&&(!("alg"in a)||a.alg!==e))}catch{return!1}}function Gie(t,e,r){t.issues.length&&e.issues.push(...Ii(r,t.issues)),e.value[r]=t.value}function yO(t,e,r,n,a,o){let s=r in n;if(t.issues.length){if(a&&o&&!s)return;e.issues.push(...Ii(r,t.issues))}if(!s&&!a){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?s&&(e.value[r]=void 0):e.value[r]=t.value}function ice(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=yz(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function cce(t,e,r,n,a,o){let s=[],i=a.keySet,c=a.catchall._zod,l=c.def.type,u=c.optin==="optional",p=c.optout==="optional";for(let m in e){if(m==="__proto__"||i.has(m))continue;if(l==="never"){s.push(m);continue}let d=c.run({value:e[m],issues:[]},n);d instanceof Promise?t.push(d.then(f=>yO(f,r,m,e,u,p))):yO(d,r,m,e,u,p)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),t.length?Promise.all(t).then(()=>r):r}function Hie(t,e,r,n){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let a=t.filter(o=>!Gm(o));return a.length===1?(e.value=a[0].value,a[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>Ms(s,n,Ca())))}),e)}function qie(t,e,r,n){let a=t.filter(o=>o.issues.length===0);return a.length===1?(e.value=a[0].value,e):(a.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>Ms(s,n,Ca())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}function A6(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Vm(t)&&Vm(e)){let r=Object.keys(e),n=Object.keys(t).filter(o=>r.indexOf(o)!==-1),a={...t,...e};for(let o of n){let s=A6(t[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};a[o]=s.data}return{valid:!0,data:a}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<t.length;n++){let a=t[n],o=e[n],s=A6(a,o);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Kie(t,e,r){let n=new Map,a;for(let i of e.issues)if(i.code==="unrecognized_keys"){a??(a=i);for(let c of i.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else t.issues.push(i);for(let i of r.issues)if(i.code==="unrecognized_keys")for(let c of i.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else t.issues.push(i);let o=[...n].filter(([,i])=>i.l&&i.r).map(([i])=>i);if(o.length&&a&&t.issues.push({...a,keys:o}),Gm(t))return t;let s=A6(e.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}function Yie(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]._zod[e]!=="optional")return r+1;return 0}function Zie(t,e,r){t.issues.length&&e.issues.push(...Ii(r,t.issues)),e.value[r]=t.value}function Jie(t,e,r,n,a){for(let o=0;o<r.length;o++){let s=t[o],i=o<n.length;if(s.issues.length){if(!i&&o>=a){e.value.length=o;break}e.issues.push(...Ii(o,s.issues))}e.value[o]=s.value}for(let o=e.value.length-1;o>=n.length&&(r[o]._zod.optout==="optional"&&e.value[o]===void 0);o--)e.value.length=o;return e}function Xie(t,e,r,n,a,o,s){t.issues.length&&(qw.has(typeof n)?r.issues.push(...Ii(n,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:a,inst:o,issues:t.issues.map(i=>Ms(i,s,Ca()))})),e.issues.length&&(qw.has(typeof n)?r.issues.push(...Ii(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:a,inst:o,key:n,issues:e.issues.map(i=>Ms(i,s,Ca()))})),r.value.set(t.value,e.value)}function Qie(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function ece(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}function tce(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function rce(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function fO(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}function hO(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let a=e.transform(t.value,t);return a instanceof Promise?a.then(o=>gO(t,o,e.out,r)):gO(t,a,e.out,r)}else{let a=e.reverseTransform(t.value,t);return a instanceof Promise?a.then(o=>gO(t,o,e.in,r)):gO(t,a,e.in,r)}}function gO(t,e,r,n){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},n)}function nce(t){return t.value=Object.freeze(t.value),t}function ace(t,e,r,n){if(!t){let a={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(a.params=n._zod.def.params),e.issues.push(WS(a))}}var Ft,yg,bn,C6,w6,T6,k6,I6,P6,_6,D6,R6,O6,N6,$6,M6,F6,L6,B6,U6,j6,z6,W6,G6,H6,q6,K6,Y6,vO,Z6,r0,SO,J6,X6,Q6,eW,tW,rW,nW,aW,oW,sW,lce,iW,n0,cW,lW,uW,EO,pW,dW,mW,fW,hW,gW,yW,bO,vW,SW,EW,bW,xW,AW,CW,wW,xO,a0,TW,kW,IW,PW,_W,DW,RW,OW=E(()=>{mO();fg();E6();Tz();uO();at();x6();at();Ft=Y("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=b6;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let a of n)for(let o of a._zod.onattach)o(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let a=(s,i,c)=>{let l=Gm(s),u;for(let p of i){if(p._zod.def.when){if(Ez(s)||!p._zod.def.when(s))continue}else if(l)continue;let m=s.issues.length,d=p._zod.check(s);if(d instanceof Promise&&c?.async===!1)throw new du;if(u||d instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await d,s.issues.length!==m&&(l||(l=Gm(s,m)))});else{if(s.issues.length===m)continue;l||(l=Gm(s,m))}}return u?u.then(()=>s):s},o=(s,i,c)=>{if(Gm(s))return s.aborted=!0,s;let l=a(i,n,c);if(l instanceof Promise){if(c.async===!1)throw new du;return l.then(u=>t._zod.parse(u,c))}return t._zod.parse(l,c)};t._zod.run=(s,i)=>{if(i.skipChecks)return t._zod.parse(s,i);if(i.direction==="backward"){let l=t._zod.parse({value:s.value,issues:[]},{...i,skipChecks:!0});return l instanceof Promise?l.then(u=>o(u,s,i)):o(l,s,i)}let c=t._zod.parse(s,i);if(c instanceof Promise){if(i.async===!1)throw new du;return c.then(l=>a(l,n,i))}return a(c,n,i)}}lr(t,"~standard",()=>({validate:a=>{try{let o=Cz(t,a);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return wz(t,a).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),yg=Y("$ZodString",(t,e)=>{Ft.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Kz(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),bn=Y("$ZodStringFormat",(t,e)=>{KS.init(t,e),yg.init(t,e)}),C6=Y("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Nz),bn.init(t,e)}),w6=Y("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=gg(n))}else e.pattern??(e.pattern=gg());bn.init(t,e)}),T6=Y("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=$z),bn.init(t,e)}),k6=Y("$ZodURL",(t,e)=>{bn.init(t,e),t._zod.check=r=>{try{let n=r.value.trim();if(!e.normalize&&e.protocol?.source===Wz.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let a=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=a.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),I6=Y("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Mz()),bn.init(t,e)}),P6=Y("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Rz),bn.init(t,e)}),_6=Y("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=kz),bn.init(t,e)}),D6=Y("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Iz),bn.init(t,e)}),R6=Y("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Pz),bn.init(t,e)}),O6=Y("$ZodXID",(t,e)=>{e.pattern??(e.pattern=_z),bn.init(t,e)}),N6=Y("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Dz),bn.init(t,e)}),$6=Y("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=qz(e)),bn.init(t,e)}),M6=Y("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Gz),bn.init(t,e)}),F6=Y("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Hz(e)),bn.init(t,e)}),L6=Y("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Oz),bn.init(t,e)}),B6=Y("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Fz),bn.init(t,e),t._zod.bag.format="ipv4"}),U6=Y("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Lz),bn.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),j6=Y("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=Bz(e.delimiter)),bn.init(t,e),t._zod.bag.format="mac"}),z6=Y("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Uz),bn.init(t,e)}),W6=Y("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=jz),bn.init(t,e),t._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[a,o]=n;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${a}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});G6=Y("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=zz),bn.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{V6(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});H6=Y("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=cO),bn.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{oce(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),q6=Y("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Vz),bn.init(t,e)});K6=Y("$ZodJWT",(t,e)=>{bn.init(t,e),t._zod.check=r=>{sce(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Y6=Y("$ZodCustomStringFormat",(t,e)=>{bn.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),vO=Y("$ZodNumber",(t,e)=>{Ft.init(t,e),t._zod.pattern=t._zod.bag.pattern??lO,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let a=r.value;if(typeof a=="number"&&!Number.isNaN(a)&&Number.isFinite(a))return r;let o=typeof a=="number"?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:a,inst:t,...o?{received:o}:{}}),r}}),Z6=Y("$ZodNumberFormat",(t,e)=>{n6.init(t,e),vO.init(t,e)}),r0=Y("$ZodBoolean",(t,e)=>{Ft.init(t,e),t._zod.pattern=Jz,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let a=r.value;return typeof a=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:t}),r}}),SO=Y("$ZodBigInt",(t,e)=>{Ft.init(t,e),t._zod.pattern=Yz,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),J6=Y("$ZodBigIntFormat",(t,e)=>{a6.init(t,e),SO.init(t,e)}),X6=Y("$ZodSymbol",(t,e)=>{Ft.init(t,e),t._zod.parse=(r,n)=>{let a=r.value;return typeof a=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:a,inst:t}),r}}),Q6=Y("$ZodUndefined",(t,e)=>{Ft.init(t,e),t._zod.pattern=Qz,t._zod.values=new Set([void 0]),t._zod.parse=(r,n)=>{let a=r.value;return typeof a>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:a,inst:t}),r}}),eW=Y("$ZodNull",(t,e)=>{Ft.init(t,e),t._zod.pattern=Xz,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let a=r.value;return a===null||r.issues.push({expected:"null",code:"invalid_type",input:a,inst:t}),r}}),tW=Y("$ZodAny",(t,e)=>{Ft.init(t,e),t._zod.parse=r=>r}),rW=Y("$ZodUnknown",(t,e)=>{Ft.init(t,e),t._zod.parse=r=>r}),nW=Y("$ZodNever",(t,e)=>{Ft.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),aW=Y("$ZodVoid",(t,e)=>{Ft.init(t,e),t._zod.parse=(r,n)=>{let a=r.value;return typeof a>"u"||r.issues.push({expected:"void",code:"invalid_type",input:a,inst:t}),r}}),oW=Y("$ZodDate",(t,e)=>{Ft.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let a=r.value,o=a instanceof Date;return o&&!Number.isNaN(a.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:a,...o?{received:"Invalid Date"}:{},inst:t}),r}});sW=Y("$ZodArray",(t,e)=>{Ft.init(t,e),t._zod.parse=(r,n)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:"array",code:"invalid_type",input:a,inst:t}),r;r.value=Array(a.length);let o=[];for(let s=0;s<a.length;s++){let i=a[s],c=e.element._zod.run({value:i,issues:[]},n);c instanceof Promise?o.push(c.then(l=>Gie(l,r,s))):Gie(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});lce=Y("$ZodObject",(t,e)=>{if(Ft.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let i=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...i};return Object.defineProperty(e,"shape",{value:c}),c}})}let n=zS(()=>ice(e));lr(t._zod,"propValues",()=>{let i=e.shape,c={};for(let l in i){let u=i[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(let p of u.values)c[l].add(p)}}return c});let a=hg,o=e.catchall,s;t._zod.parse=(i,c)=>{s??(s=n.value);let l=i.value;if(!a(l))return i.issues.push({expected:"object",code:"invalid_type",input:l,inst:t}),i;i.value={};let u=[],p=s.shape;for(let m of s.keys){let d=p[m],f=d._zod.optin==="optional",h=d._zod.optout==="optional",y=d._zod.run({value:l[m],issues:[]},c);y instanceof Promise?u.push(y.then(S=>yO(S,i,m,l,f,h))):yO(y,i,m,l,f,h)}return o?cce(u,l,i,c,n.value,t):u.length?Promise.all(u).then(()=>i):i}}),iW=Y("$ZodObjectJIT",(t,e)=>{lce.init(t,e);let r=t._zod.parse,n=zS(()=>ice(e)),a=m=>{let d=new t0(["shape","payload","ctx"]),f=n.value,h=w=>{let C=ZR(w);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};d.write("const input = payload.value;");let y=Object.create(null),S=0;for(let w of f.keys)y[w]=`key_${S++}`;d.write("const newResult = {};");for(let w of f.keys){let C=y[w],T=ZR(w),_=m[w],D=_?._zod?.optin==="optional",O=_?._zod?.optout==="optional";d.write(`const ${C} = ${h(w)};`),D&&O?d.write(`
@@ -837,7 +837,7 @@ ${b(o.stderr||o.stdout)}`,"migration_failed",{projectRoot:e,exitCode:o.exitCode,
837
837
  `;function CRe(t,e){var r=[],n="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var a=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(o,s,i){var c=t[o];c&&Array.isArray(c)?c.forEach(function(l){n+=gA(o+"[]")+a+gA(l)+`
838
838
  `}):c&&typeof c=="object"?r.push(o):n+=gA(o)+a+gA(c)+qQ}),e.section&&n.length&&(n="["+gA(e.section)+"]"+qQ+n),r.forEach(function(o,s,i){var c=wRe(o).join("\\."),l=(e.section?e.section+".":"")+c,u=CRe(t[o],{section:l,whitespace:e.whitespace});n.length&&u.length&&(n+=qQ),n+=u}),n}function wRe(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function ryt(t){var e={},r=e,n=null,a=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,i,c){if(!(!s||s.match(/^\s*[;#]/))){var l=s.match(a);if(l){if(l[1]!==void 0){if(n=G2(l[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var u=G2(l[2]);if(u!=="__proto__"){var p=l[3]?G2(l[4]):!0;switch(p){case"true":case"false":case"null":p=JSON.parse(p)}if(u.length>2&&u.slice(-2)==="[]"){if(u=u.substring(0,u.length-2),u==="__proto__")return;r[u]?Array.isArray(r[u])||(r[u]=[r[u]]):r[u]=[]}Array.isArray(r[u])?r[u].push(p):r[u]=p}}}}),Object.keys(e).filter(function(s,i,c){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var l=wRe(s),u=e,p=l.pop(),m=p.replace(/\\\./g,".");return l.forEach(function(d,f,h){d!=="__proto__"&&((!u[d]||typeof u[d]!="object")&&(u[d]={}),u=u[d])}),u===e&&m===p?!1:(u[m]=e[s],!0)}).forEach(function(s,i,c){delete e[s]}),e}function TRe(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function gA(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&TRe(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function G2(t,e){if(t=(t||"").trim(),TRe(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",a=0,o=t.length;a<o;a++){var s=t.charAt(a);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var _Re=ae((nRr,PRe)=>{"use strict";var KQ=1,IRe=2;function nyt(){return""}function ayt(t,e,r){return t.slice(e,r).replace(/\S/g," ")}PRe.exports=function(t,e){e=e||{};for(var r,n,a=!1,o=!1,s=0,i="",c=e.whitespace===!1?nyt:ayt,l=0;l<t.length;l++){if(r=t[l],n=t[l+1],!o&&r==='"'){var u=t[l-1]==="\\"&&t[l-2]!=="\\";u||(a=!a)}if(!a){if(!o&&r+n==="//")i+=t.slice(s,l),s=l,o=KQ,l++;else if(o===KQ&&r+n===`\r
839
839
  `){l++,o=!1,i+=c(t,s,l),s=l;continue}else if(o===KQ&&r===`
840
- `)o=!1,i+=c(t,s,l),s=l;else if(!o&&r+n==="/*"){i+=t.slice(s,l),s=l,o=IRe,l++;continue}else if(o===IRe&&r+n==="*/"){l++,o=!1,i+=c(t,s,l+1),s=l+1;continue}}}return i+(o?c(t.substr(s)):t.substr(s))}});var RRe=ae(yA=>{"use strict";var DRe=Ct("fs"),oyt=kRe(),h_=Ct("path"),syt=_Re(),iyt=yA.parse=function(t){return/^\s*{/.test(t)?JSON.parse(syt(t)):oyt.parse(t)},cyt=yA.file=function(){var t=[].slice.call(arguments).filter(function(a){return a!=null});for(var e in t)if(typeof t[e]!="string")return;var r=h_.join.apply(null,t),n;try{return DRe.readFileSync(r,"utf-8")}catch{return}},aRr=yA.json=function(){var t=cyt.apply(null,arguments);return t?iyt(t):null},oRr=yA.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var a in e)if(a.toLowerCase().indexOf(t.toLowerCase())===0){for(var o=a.substring(n).split("__"),s;(s=o.indexOf(""))>-1;)o.splice(s,1);var i=r;o.forEach(function(l,u){!l||typeof i!="object"||(u===o.length-1&&(i[l]=e[a]),i[l]===void 0&&(i[l]={}),i=i[l])})}return r},sRr=yA.find=function(){var t=h_.join.apply(null,[].slice.call(arguments));function e(r,n){var a=h_.join(r,n);try{return DRe.statSync(a),a}catch{if(h_.dirname(r)!==r)return e(h_.dirname(r),n)}}return e(process.cwd(),t)}});var LRe=ae((cRr,FRe)=>{"use strict";function NRe(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function $Re(t){if(t instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function MRe(t){var e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=MRe(r):NRe(r)?e[n]=$Re(r):e[n]=YQ({},r):e[n]=r}),e}function ORe(t,e){return e==="__proto__"?void 0:t[e]}var YQ=FRe.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var t=arguments[0],e=Array.prototype.slice.call(arguments,1),r,n,a;return e.forEach(function(o){typeof o!="object"||o===null||Array.isArray(o)||Object.keys(o).forEach(function(s){if(n=ORe(t,s),r=ORe(o,s),r!==t)if(typeof r!="object"||r===null){t[s]=r;return}else if(Array.isArray(r)){t[s]=MRe(r);return}else if(NRe(r)){t[s]=$Re(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[s]=YQ({},r);return}else{t[s]=YQ(n,r);return}})}),t}});var zRe=ae((lRr,jRe)=>{"use strict";function lyt(t,e){var r=t;e.slice(0,-1).forEach(function(a){r=r[a]||{}});var n=e[e.length-1];return n in r}function BRe(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function URe(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}jRe.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(C){r.bools[C]=!0});var n={};function a(C){return n[C].some(function(T){return r.bools[T]})}Object.keys(e.alias||{}).forEach(function(C){n[C]=[].concat(e.alias[C]),n[C].forEach(function(T){n[T]=[C].concat(n[C].filter(function(_){return T!==_}))})}),[].concat(e.string).filter(Boolean).forEach(function(C){r.strings[C]=!0,n[C]&&[].concat(n[C]).forEach(function(T){r.strings[T]=!0})});var o=e.default||{},s={_:[]};function i(C,T){return r.allBools&&/^--[^=]+$/.test(T)||r.strings[C]||r.bools[C]||n[C]}function c(C,T,_){for(var D=C,O=0;O<T.length-1;O++){var R=T[O];if(URe(D,R))return;D[R]===void 0&&(D[R]={}),(D[R]===Object.prototype||D[R]===Number.prototype||D[R]===String.prototype)&&(D[R]={}),D[R]===Array.prototype&&(D[R]=[]),D=D[R]}var L=T[T.length-1];URe(D,L)||((D===Object.prototype||D===Number.prototype||D===String.prototype)&&(D={}),D===Array.prototype&&(D=[]),D[L]===void 0||r.bools[L]||typeof D[L]=="boolean"?D[L]=_:Array.isArray(D[L])?D[L].push(_):D[L]=[D[L],_])}function l(C,T,_){if(!(_&&r.unknownFn&&!i(C,_)&&r.unknownFn(_)===!1)){var D=!r.strings[C]&&BRe(T)?Number(T):T;c(s,C.split("."),D),(n[C]||[]).forEach(function(O){c(s,O.split("."),D)})}}Object.keys(r.bools).forEach(function(C){l(C,o[C]===void 0?!1:o[C])});var u=[];t.indexOf("--")!==-1&&(u=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var p=0;p<t.length;p++){var m=t[p],d,f;if(/^--.+=/.test(m)){var h=m.match(/^--([^=]+)=([\s\S]*)$/);d=h[1];var y=h[2];r.bools[d]&&(y=y!=="false"),l(d,y,m)}else if(/^--no-.+/.test(m))d=m.match(/^--no-(.+)/)[1],l(d,!1,m);else if(/^--.+/.test(m))d=m.match(/^--(.+)/)[1],f=t[p+1],f!==void 0&&!/^(-|--)[^-]/.test(f)&&!r.bools[d]&&!r.allBools&&(!n[d]||!a(d))?(l(d,f,m),p+=1):/^(true|false)$/.test(f)?(l(d,f==="true",m),p+=1):l(d,r.strings[d]?"":!0,m);else if(/^-[^-]+/.test(m)){for(var S=m.slice(1,-1).split(""),x=!1,w=0;w<S.length;w++){if(f=m.slice(w+2),f==="-"){l(S[w],f,m);continue}if(/[A-Za-z]/.test(S[w])&&f[0]==="="){l(S[w],f.slice(1),m),x=!0;break}if(/[A-Za-z]/.test(S[w])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(f)){l(S[w],f,m),x=!0;break}if(S[w+1]&&S[w+1].match(/\W/)){l(S[w],m.slice(w+2),m),x=!0;break}else l(S[w],r.strings[S[w]]?"":!0,m)}d=m.slice(-1)[0],!x&&d!=="-"&&(t[p+1]&&!/^(-|--)[^-]/.test(t[p+1])&&!r.bools[d]&&(!n[d]||!a(d))?(l(d,t[p+1],m),p+=1):t[p+1]&&/^(true|false)$/.test(t[p+1])?(l(d,t[p+1]==="true",m),p+=1):l(d,r.strings[d]?"":!0,m))}else if((!r.unknownFn||r.unknownFn(m)!==!1)&&s._.push(r.strings._||!BRe(m)?m:Number(m)),e.stopEarly){s._.push.apply(s._,t.slice(p+1));break}}return Object.keys(o).forEach(function(C){lyt(s,C.split("."))||(c(s,C.split("."),o[C]),(n[C]||[]).forEach(function(T){c(s,T.split("."),o[C])}))}),e["--"]?s["--"]=u.slice():u.forEach(function(C){s._.push(C)}),s}});var ZQ=ae((uRr,GRe)=>{var g_=RRe(),vA=Ct("path").join,uyt=LRe(),WRe="/etc",VRe=process.platform==="win32",y_=VRe?process.env.USERPROFILE:process.env.HOME;GRe.exports=function(t,e,r,n){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=zRe()(process.argv.slice(2))),e=(typeof e=="string"?g_.json(e):e)||{},n=n||g_.parse;var a=g_.env(t+"_"),o=[e],s=[];function i(c){if(!(s.indexOf(c)>=0)){var l=g_.file(c);l&&(o.push(n(l)),s.push(c))}}return VRe||[vA(WRe,t,"config"),vA(WRe,t+"rc")].forEach(i),y_&&[vA(y_,".config",t,"config"),vA(y_,".config",t),vA(y_,"."+t,"config"),vA(y_,"."+t+"rc")].forEach(i),i(g_.find("."+t+"rc")),a.config&&i(a.config),r.config&&i(r.config),uyt.apply(null,o.concat([a,r,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var qRe=ae((pRr,HRe)=>{"use strict";HRe.exports=function(t){var e=ZQ()("npm",{registry:"https://registry.npmjs.org/"}),r=e[t+":registry"]||e.registry;return r.slice(-1)==="/"?r:r+"/"}});var ZRe=ae((JQ,YRe)=>{var H2=Ct("buffer"),Lp=H2.Buffer;function KRe(t,e){for(var r in t)e[r]=t[r]}Lp.from&&Lp.alloc&&Lp.allocUnsafe&&Lp.allocUnsafeSlow?YRe.exports=H2:(KRe(H2,JQ),JQ.Buffer=vv);function vv(t,e,r){return Lp(t,e,r)}vv.prototype=Object.create(Lp.prototype);KRe(Lp,vv);vv.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Lp(t,e,r)};vv.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Lp(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};vv.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Lp(t)};vv.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return H2.SlowBuffer(t)}});var QRe=ae((dRr,XRe)=>{var JRe=ZRe().Buffer;function pyt(t){return JRe.from(t,"base64").toString("utf8")}function dyt(t){return JRe.from(t,"utf8").toString("base64")}XRe.exports={decodeBase64:pyt,encodeBase64:dyt}});var sOe=ae((mRr,oOe)=>{var XQ=Ct("url"),nOe=QRe(),myt=nOe.decodeBase64,fyt=nOe.encodeBase64,eOe=":_authToken",tOe=":username",rOe=":_password";oOe.exports=function(){var t,e;return arguments.length>=2?(t=arguments[0],e=arguments[1]):typeof arguments[0]=="string"?t=arguments[0]:e=arguments[0],e=e||{},e.npmrc=e.npmrc||ZQ()("npm",{registry:"https://registry.npmjs.org/"}),t=t||e.npmrc.registry,aOe(t,e)||hyt(e.npmrc)};function aOe(t,e){for(var r=XQ.parse(t,!1,!0),n;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";var a="//"+r.host+n.replace(/\/$/,""),o=yyt(a,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:aOe(XQ.resolve(t,"."),e);r.pathname=XQ.resolve(gyt(n),"..")||"/"}}function hyt(t){if(t._auth)return{token:t._auth,type:"Basic"}}function gyt(t){return t[t.length-1]==="/"?t:t+"/"}function yyt(t,e){var r=vyt(e[t+eOe]||e[t+"/"+eOe]);if(r)return r;var n=e[t+tOe]||e[t+"/"+tOe],a=e[t+rOe]||e[t+"/"+rOe],o=Syt(n,a);if(o)return o}function vyt(t){if(t){var e=t.replace(/^\$\{?([^}]*)\}?$/,function(r,n){return process.env[n]});return{token:e,type:"Bearer"}}}function Syt(t,e){if(!(!t||!e)){var r=myt(e.replace(/^\$\{?([^}]*)\}?$/,function(a,o){return process.env[o]})),n=fyt(t+":"+r);return{token:n,type:"Basic",password:r,username:t}}}});var uOe=ae((fRr,lOe)=>{var{URL:Eyt}=Ct("url"),{join:iOe}=Ct("path"),v_=Ct("fs"),{promisify:QQ}=Ct("util"),{tmpdir:byt}=Ct("os"),xyt=qRe(),Ayt=QQ(v_.writeFile),Cyt=QQ(v_.mkdir),wyt=QQ(v_.readFile),Tyt=(t,e)=>t.localeCompare(e,"en-US",{numeric:!0}),kyt=t=>encodeURIComponent(t).replace(/^%40/,"@"),Iyt=async(t,e)=>{let r=byt(),n=iOe(r,"update-check");v_.existsSync(n)||await Cyt(n);let a=`${t.name}-${e}.json`;return t.scope&&(a=`${t.scope}-${a}`),iOe(n,a)},Pyt=async(t,e,r)=>{if(v_.existsSync(t)){let n=await wyt(t,"utf8"),{lastUpdate:a,latest:o}=JSON.parse(n);if(a+r>e)return{shouldCheck:!1,latest:o}}return{shouldCheck:!0,latest:null}},_yt=async(t,e,r)=>{let n=JSON.stringify({latest:e,lastUpdate:r});await Ayt(t,n,"utf8")},cOe=(t,e)=>new Promise((r,n)=>{let a={host:t.hostname,path:t.pathname,port:t.port,headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},timeout:2e3};e&&(a.headers.authorization=`${e.type} ${e.token}`);let{get:o}=t.protocol==="https:"?Ct("https"):Ct("http");o(a,s=>{let{statusCode:i}=s;if(i!==200){let l=new Error(`Request failed with code ${i}`);l.code=i,n(l),s.resume();return}let c="";s.setEncoding("utf8"),s.on("data",l=>{c+=l}),s.on("end",()=>{try{let l=JSON.parse(c);r(l)}catch(l){n(l)}})}).on("error",n).on("timeout",n)}),Dyt=async({full:t,scope:e},r)=>{let n=xyt(e),a=new Eyt(t,n),o=null;try{o=await cOe(a)}catch(i){if(i.code&&String(i.code).startsWith(4)){let l=sOe()(n,{recursive:!0});o=await cOe(a,l)}else throw i}let s=o["dist-tags"][r];if(!s)throw new Error(`Distribution tag ${r} is not available`);return s},Ryt={interval:36e5,distTag:"latest"},Oyt=t=>{let e={full:kyt(t)};if(t.includes("/")){let r=t.split("/");e.scope=r[0],e.name=r[1]}else e.scope=null,e.name=t;return e};lOe.exports=async(t,e)=>{if(typeof t!="object")throw new Error("The first parameter should be your package.json file content");let r=Oyt(t.name),n=Date.now(),{distTag:a,interval:o}=Object.assign({},Ryt,e),s=await Iyt(r,a),i=null,c=!0;return{shouldCheck:c,latest:i}=await Pyt(s,n,o),c&&(i=await Dyt(r,a),await _yt(s,i,n)),Tyt(t.version,i)===-1?{latest:i,fromCache:!c}:null}});import{realpathSync as Nyt}from"fs";async function $yt(){let{default:t}=await Promise.resolve().then(()=>dc(uOe(),1));return t}var S_,E_,eee=E(()=>{"use strict";se();kt();Q();ee();B();S_=class extends _e{constructor(e,r){super("VERSION_CHECK_ERROR",e,r,!1)}};E_=class{updateAvailable=null;isHomebrewInstall(){let e=process.env.HOMEBREW_PREFIX;if(!e)return!1;let r=process.argv[1];if(!r)return!1;try{return Nyt(r).startsWith(e)}catch{return k.debug("VersionCheck","Could not resolve binary path for Homebrew detection"),!1}}async performCheck(e){let r=await $yt(),n;try{let a=await Promise.race([r(e,{interval:864e5}),new Promise(o=>{n=setTimeout(()=>o(null),1e4),n.unref()})]);return a?(this.updateAvailable={current:e.version,latest:a.latest,installSource:this.isHomebrewInstall()?"homebrew":"npm"},this.updateAvailable):null}finally{n!==void 0&&clearTimeout(n)}}async checkForUpdates(e){if(!(process.env.CI||process.env.CONTINUOUS_INTEGRATION))try{await this.performCheck(e)}catch(r){k.debug("VersionCheck","Update check failed (non-critical)",{error:b(P(r))})}}async checkForUpdatesWithResult(e){if(process.env.CI||process.env.CONTINUOUS_INTEGRATION)return A(null);try{let r=await this.performCheck(e);return A(r)}catch(r){return v(new S_(`Failed to check for updates: ${b(P(r))}`,r))}}getUpdate(){return this.updateAvailable}}});import{RDSClient as Myt,DescribeDBSnapshotsCommand as Fyt,DescribeDBClusterSnapshotsCommand as Lyt}from"@aws-sdk/client-rds";function b_(t,e=Byt){return typeof t=="string"?t:e}function Uyt(t,e=0){return typeof t=="number"?t:e}var Byt,x_,A_,pOe=E(()=>{"use strict";_a();se();kt();Q();Byt="unknown";x_=class extends _e{type;constructor(e,r,n){super(`RDS_SNAPSHOT_${r.toUpperCase()}`,e,void 0,r!=="aws_error",n instanceof Error?n:void 0),this.type=r}},A_=class{aws;ssoCallbacks;setSsoCallbacks(e){this.ssoCallbacks=e}async getAws(){return this.aws||(this.aws=await Ge.initialise({ssoCallbacks:this.ssoCallbacks})),this.aws}async getClient(){return(await this.getAws()).getClient(Myt)}async describeSnapshot(e){try{let r=await this.getClient(),n=e.buildCommand(e.identifier),a=await r.send(n),o=e.extractSnapshot(a);return o?A({snapshotIdentifier:b_(o[e.identifierField],e.identifier),engine:b_(o.Engine),engineVersion:b_(o.EngineVersion),masterUsername:b_(o.MasterUsername),status:b_(o.Status),allocatedStorage:Uyt(o.AllocatedStorage),snapshotType:e.snapshotType}):v(new x_(`${e.label} '${e.identifier}' not found`,"not_found"))}catch(r){let{name:n,message:a}=In(r);return n===e.notFoundFault?v(new x_(`${e.label} '${e.identifier}' not found`,"not_found",r)):v(new x_(`Failed to describe ${e.label.toLowerCase()}: ${a}`,"aws_error",r))}}async describeDbSnapshot(e){return this.describeSnapshot({identifier:e,snapshotType:"instance",buildCommand:r=>new Fyt({DBSnapshotIdentifier:r}),extractSnapshot:r=>r.DBSnapshots?.[0],identifierField:"DBSnapshotIdentifier",notFoundFault:"DBSnapshotNotFoundFault",label:"Snapshot"})}async describeDbClusterSnapshot(e){return this.describeSnapshot({identifier:e,snapshotType:"cluster",buildCommand:r=>new Lyt({DBClusterSnapshotIdentifier:r}),extractSnapshot:r=>r.DBClusterSnapshots?.[0],identifierField:"DBClusterSnapshotIdentifier",notFoundFault:"DBClusterSnapshotNotFoundFault",label:"Cluster snapshot"})}async findSnapshot(e){let r=await this.describeDbSnapshot(e);return r.success?r:r.error.type==="not_found"?this.describeDbClusterSnapshot(e):r}async validateSnapshot(e,r,n){let a=await this.findSnapshot(e);if(!a.success)return a.error.type==="not_found"?A({exists:!1,available:!1,warnings:[`Snapshot '${e}' not found. Ensure the identifier is correct and the snapshot exists in the current region.`]}):a;let o=a.data,s=[],i=o.status==="available";if(i||s.push(`Snapshot status is '${o.status}' \u2014 it must be 'available' before it can be used for restoration.`),r&&o.engine!==r&&s.push(`Engine mismatch: snapshot uses '${o.engine}' but '${r}' was expected.`),n){let c=o.engineVersion.split(".")[0]??"",l=n.split(".")[0]??"";c!==l&&s.push(`Major version mismatch: snapshot is version '${o.engineVersion}' but '${n}' was expected.`)}return A({exists:!0,available:i,snapshot:o,warnings:s})}}});var ha,q2=E(()=>{"use strict";kt();ha=class extends _e{errorType;constructor(e,r,n){super(`TUNNEL_${r.toUpperCase()}`,e,n,r!=="access_denied"),this.errorType=r}}});import{AutoScalingClient as jyt,DescribeAutoScalingGroupsCommand as zyt}from"@aws-sdk/client-auto-scaling";import{SecretsManagerClient as Wyt,GetSecretValueCommand as Vyt}from"@aws-sdk/client-secrets-manager";var SA,tee=E(()=>{"use strict";_a();se();q2();Se();Ou();B();Q();ee();SA=class{aws=null;constructor(){}async getAws(){return this.aws||(this.aws=await Ge.initialise()),this.aws}async getBastionInstanceId(e,r){r?.onDiscovery?.("bastion","Looking up bastion instance");let n=`${Qn(e)}Network`,a=await Ss().getStackOutputs(n);if(!a.success)return v(new ha(`Failed to read Network stack outputs: ${b(a.error.message)}`,"bastion_not_found",{stackName:n}));let o=a.data.find(i=>i.OutputKey?.endsWith("BastionInstanceId"));if(!o?.OutputValue)return v(new ha(`No bastion found in stack ${n}. Ensure the application has a bastion host enabled.`,"bastion_not_found",{stackName:n,outputs:a.data.map(i=>i.OutputKey)}));let s=o.OutputValue;try{let i=(await(await this.getAws()).getClient(jyt).send(new zyt({AutoScalingGroupNames:[s]}))).AutoScalingGroups?.[0]?.Instances??[],c=i.find(l=>l.LifecycleState==="InService"&&l.HealthStatus==="Healthy");return c?.InstanceId?(r?.onDiscovery?.("bastion",`Found bastion instance ${c.InstanceId}`),A(c.InstanceId)):v(new ha(`Bastion ASG "${s}" has no healthy instances. The bastion may be starting up or has been terminated.`,"bastion_not_found",{asgName:s,instanceCount:i.length}))}catch(i){return v(new ha(`Failed to resolve bastion instance from ASG: ${b(P(i))}`,"bastion_not_found",{asgName:s,error:i}))}}async discoverTargets(e,r){r?.onDiscovery?.("databases","Discovering database targets");let n=`${Qn(e)}Database`,a=await Ss().getStackOutputs(n);if(!a.success)return v(new ha(`Failed to read Database stack outputs: ${b(a.error.message)}`,"no_databases",{stackName:n}));let o=a.data;if(o.length===0)return v(new ha(`No database stack found for "${e}". Deploy a database first.`,"no_databases",{stackName:n}));let s=new Map;for(let l of o)l.OutputKey&&l.OutputValue&&s.set(l.OutputKey,l.OutputValue);let i=[...s.keys()].filter(l=>l.endsWith("Endpoint")),c=[];for(let l of i){let u=l.replace(/Endpoint$/,""),p=s.get(l),m=s.get(`${u}Port`),d=s.get(`${u}DatabaseName`),f=s.get(`${u}SecretArn`),h=s.get(`${u}ProxyEndpoint`),y=s.get(`${u}Engine`),S=s.get(`${u}DatabaseType`);if(!p||!m||!d||!f){k.debug("TunnelDiscoveryService","Skipping incomplete database output",{prefix:u,hasEndpoint:!!p,hasPort:!!m,hasDatabaseName:!!d,hasSecretArn:!!f});continue}let x=this.resolveEngine(y),w=this.resolveDatabaseType(S);c.push({name:u,type:w,engine:x,endpoint:p,proxyEndpoint:h||void 0,port:parseInt(m,10),databaseName:d,secretArn:f})}return c.length===0?v(new ha(`No complete database configurations found in stack "${n}".`,"no_databases",{stackName:n,outputKeys:[...s.keys()]})):(r?.onDiscovery?.("databases",`Found ${String(c.length)} database target(s)`),A(c))}async getCredentials(e,r){r?.onDiscovery?.("credentials","Fetching database credentials");try{let n=await(await this.getAws()).getClient(Wyt).send(new Vyt({SecretId:e.secretArn}));if(!n.SecretString)return v(new ha("Secret value is empty or binary (expected JSON string).","credentials_failed",{secretArn:e.secretArn}));let a;try{a=JSON.parse(n.SecretString)}catch(o){return k.debug("TunnelDiscoveryService","Secret value JSON parse failed",{secretArn:e.secretArn,error:o instanceof Error?o.message:String(o)}),v(new ha("Secret value is not valid JSON.","credentials_failed",{secretArn:e.secretArn}))}return this.isValidCredentials(a)?(r?.onDiscovery?.("credentials","Credentials retrieved"),A({username:a.username,password:a.password})):v(new ha("Secret does not contain valid username/password fields.","credentials_failed",{secretArn:e.secretArn}))}catch(n){let a=P(n);return a.includes("AccessDeniedException")||a.includes("is not authorized")?v(new ha(`Access denied when reading secret: ${b(a)}`,"access_denied",{secretArn:e.secretArn})):v(new ha(`Failed to fetch credentials: ${b(a)}`,"credentials_failed",{secretArn:e.secretArn}))}}resolveEngine(e){if(!e)return"postgresql";let r=e.toLowerCase();return r.includes("mysql")||r.includes("mariadb")?"mysql":"postgresql"}resolveDatabaseType(e){if(!e)return"Instance";let r=e.toLowerCase();return r.includes("global")?"GlobalAurora":r.includes("aurora")||r.includes("cluster")?"Aurora":"Instance"}isValidCredentials(e){return typeof e=="object"&&e!==null&&"username"in e&&"password"in e&&typeof e.username=="string"&&typeof e.password=="string"}}});import{spawn as Gyt,execFileSync as dOe}from"child_process";var C_,mOe=E(()=>{"use strict";se();q2();B();ee();tee();C_=class{discovery=new SA;constructor(){}checkPrerequisites(e){let r=[];e?.onPrerequisiteCheck?.("aws-cli","checking");try{dOe("aws",["--version"],{stdio:"pipe",env:Ar(process.env)}),e?.onPrerequisiteCheck?.("aws-cli","found")}catch(n){k.debug("Tunnel","aws-cli check failed",{error:n instanceof Error?n.message:String(n)}),e?.onPrerequisiteCheck?.("aws-cli","missing"),r.push("aws (AWS CLI)")}e?.onPrerequisiteCheck?.("session-manager-plugin","checking");try{dOe("session-manager-plugin",["--version"],{stdio:"pipe",env:Ar(process.env)}),e?.onPrerequisiteCheck?.("session-manager-plugin","found")}catch(n){k.debug("Tunnel","session-manager-plugin check failed",{error:n instanceof Error?n.message:String(n)}),e?.onPrerequisiteCheck?.("session-manager-plugin","missing"),r.push("session-manager-plugin")}return r.length>0?v(new ha(`Required tools not found: ${r.join(", ")}. Install them before using tunnel.`,"prerequisites_missing",{missing:r})):A(void 0)}async getBastionInstanceId(e,r){return this.discovery.getBastionInstanceId(e,r)}async discoverTargets(e,r){return this.discovery.discoverTargets(e,r)}async getCredentials(e,r){return this.discovery.getCredentials(e,r)}async openTunnel(e){let{bastionInstanceId:r,target:n,localPort:a,credentials:o,callbacks:s}=e,i=e.awsRegion??(await this.discovery.getAws()).getRegion(),c=n.proxyEndpoint??n.endpoint,l=JSON.stringify({host:[c],portNumber:[String(n.port)],localPortNumber:[String(a)]}),u=["ssm","start-session","--target",r,"--document-name","AWS-StartPortForwardingSessionToRemoteHost","--parameters",l,"--region",i],p=Ar(process.env);return new Promise(m=>{let d=Gyt("aws",u,{stdio:["ignore","pipe","pipe"],shell:!1,env:{...p}});if(d.pid===void 0){d.on("error",w=>{k.debug("Tunnel","Spawn error (already handled)",{error:w.message})}),m(v(new ha("Failed to spawn SSM session process -- no PID.","session_failed",{command:"aws",args:u})));return}let f=!1,h=6e4,y=setTimeout(()=>{f||(f=!0,d.stdout&&d.stdout.destroy(),d.stderr&&d.stderr.destroy(),d.kill("SIGTERM"),x(),m(v(new ha(`SSM session connection timed out after ${h/1e3}s`,"session_failed",{command:"aws",args:u}))))},h),S=()=>{d.stdin&&d.stdin.destroy(),d.stdout&&d.stdout.destroy(),d.stderr&&d.stderr.destroy(),d.kill("SIGTERM")},x=()=>{process.removeListener("SIGINT",S),process.removeListener("SIGTERM",S)};process.on("SIGINT",S),process.on("SIGTERM",S),d.on("error",w=>{f||(f=!0,clearTimeout(y),x(),m(v(new ha(`Failed to start SSM session: ${b(w.message)}`,"session_failed",{command:"aws",args:u}))))}),d.stderr?.on("data",w=>{let C=w.toString();if(k.debug("TunnelService","SSM stderr",{output:b(C)}),C.includes("Waiting for connections")&&!f){f=!0,clearTimeout(y);let T=this.buildConnectionInfo(a,c,n.databaseName,n.engine,o);s?.onTunnelReady?.(T)}}),d.stdout?.on("data",w=>{let C=w.toString();k.debug("TunnelService","SSM stdout",{output:b(C)})}),d.on("close",w=>{clearTimeout(y),x(),s?.onTunnelClosed?.(),w!==0&&w!==null&&!f?m(v(new ha(`SSM session exited with code ${String(w)}`,"session_failed",{exitCode:w}))):(w!==0&&w!==null&&k.debug("TunnelService","Tunnel exited with non-zero code after successful connection",{exitCode:w}),m(A(void 0)))})})}buildConnectionInfo(e,r,n,a,o){let s=`${a==="postgresql"?"postgresql":"mysql"}://${encodeURIComponent(o.username)}:${encodeURIComponent(o.password)}@localhost:${String(e)}/${n}`;return{localPort:e,endpoint:r,databaseName:n,connectionString:s}}}});import{existsSync as EA,readdirSync as Hyt}from"fs";import{promises as qyt}from"dns";var Kyt,Xi,w_,ree=E(()=>{"use strict";se();kt();Gr();B();wr();Se();vl();If();ee();Kyt="DomainService",Xi=class extends _e{errorType;constructor(e,r,n){super(`DOMAIN_${r.toUpperCase()}`,e,n,!1),this.errorType=r}},w_=class{async createDomain(e,r={},n){let a=new Me(n),o=El(e);if(EA(o))return v(new Xi(`Domain '${e}' already exists at ${o}`,"already_exists"));try{a.step(`Creating domain '${e}'`);let s=await Pn().runGenerator({type:"domain",schema:{domainName:e,hostedZoneId:r.hostedZoneId}});return s.success?(a.step(`Created ${o}`),A({name:e,path:o})):v(new Xi(`Failed to generate domain: ${b(s.error.message)}`,"deploy_error",s.error))}catch(s){let i=b(P(s));return v(new Xi(i,"deploy_error"))}}async deployDomain(e,r){let n=new Me(r),a=El(e);if(!EA(a))return v(new Xi(`Domain '${e}' not found. Run 'fjall create domain ${e}' first.`,"not_found"));let o=xy(e);if(!EA(o))return v(new Xi(`infrastructure.ts not found at ${o}. Import or create a domain first.`,"not_found"));try{n.step(`Deploying domain '${e}'`);let s=Ge.getCurrent()??await Ge.initialise(),i;try{i=s.getAccountId()}catch(h){return v(new Xi(`AWS authentication required: ${b(P(h))}`,"deploy_error"))}let c=s.getRegion(),l=s.getCredentials(),u,p=await po().getOrgConfig();p.success&&(u=Ho.serialise(p.data));let m,d=await LP().lookupOrganisation();d.success?m=d.data:k.warn(Kyt,"Organisation lookup failed \u2014 domain deploy proceeds without org context",{error:b(d.error.message)});let f=await pv().deploy(a,void 0,{outputCallback:h=>{r?.onProgress?.({type:"info",message:b(h)})},context:{accountId:i,region:c,...m!==void 0&&{orgId:m.orgId,rootId:m.rootId,managementAccountId:m.managementAccountId},...u!==void 0&&{orgConfig:u}},...l!==void 0&&{credentials:l}});return f.success?A({name:e}):v(new Xi(`CDK deploy failed: ${b(P(f.error))}`,"deploy_error"))}catch(s){let i=b(P(s));return v(new Xi(i,"deploy_error"))}}async verifyDomain(e,r){let n=new Me(r),a;try{n.step(`Checking DNS propagation for ${e}`);let o=await Promise.race([qyt.resolveNs(e),new Promise((i,c)=>{a=setTimeout(()=>c(new Error("DNS lookup timed out")),1e4)})]),s=o.some(i=>i.includes("awsdns"));return n.step(s?"Nameserver delegation: VERIFIED":"Nameservers found but not pointing to Route53"),A({name:e,delegated:s,nameservers:o})}catch(o){let s=b(P(o));return v(new Xi(`DNS verification failed for ${e}: ${s}`,"verification_error"))}finally{a!==void 0&&clearTimeout(a)}}listDomains(){let e=n7();if(!EA(e))return A([]);try{let r=Hyt(e,{withFileTypes:!0}).filter(n=>n.isDirectory()).map(n=>{let a=El(n.name);return{name:n.name,path:a,hasZoneFile:EA(Rxe(n.name)),hasInfrastructure:EA(xy(n.name))}});return A(r)}catch(r){let n=b(P(r));return v(new Xi(n,"not_found"))}}resolveDomainForApp(e){let r=this.listDomains();if(!r.success)return;let n=r.data;if(n.length===0)return;let a=n.find(s=>s.name===e);if(a)return this.buildExportNames(a.name);let o=e.split(".");for(let s=1;s<o.length;s++){let i=o.slice(s).join("."),c=n.find(l=>l.name===i);if(c)return this.buildExportNames(c.name)}}buildExportNames(e){let r=Ni(e);return{hostedZoneIdExport:r.hostedZoneId,certificateArnExport:r.certificateArn,zoneName:e}}}});import{readFile as nee,writeFile as fOe,mkdir as Yyt,access as Zyt}from"fs/promises";import*as K2 from"path";import*as hOe from"os";function aee(t){return typeof t!="object"||t===null||Array.isArray(t)?!1:Object.values(t).every(e=>typeof e=="object"&&e!==null&&"id"in e&&typeof e.id=="string"&&"resolvedAt"in e&&typeof e.resolvedAt=="string")}async function oee(t){try{return await Zyt(t),!0}catch{return!1}}var bA,um,xA,see=E(()=>{"use strict";se();kt();Vr();ee();Q();bA=class extends _e{appName;constructor(e,r){super("APP_IDENTITY_ERROR",e),this.appName=r}};um=K2.join(hOe.homedir(),".fjall","app-id-cache.json");xA=class{memoryCache=new Map;async resolveAppId(e){let r=this.memoryCache.get(e);if(r)return A(r);let n=await this.readCacheEntry(e);return n?(this.memoryCache.set(e,n),A(n)):this.resolveFromApi(e)}async invalidateCache(e){this.memoryCache.delete(e),await this.removeCacheEntry(e)}async resolveFromApi(e){let r=Ke.fromCredentials();if(!r)return v(new bA("Not logged in. Run 'fjall login' first.",e));let n=await r.getApplicationByName(e);if(!n.success)return v(new bA(`Application '${e}' not found. Deploy it first.`,e));let a=n.data.application.id;return this.memoryCache.set(e,a),await this.writeCacheEntry(e,a),A(a)}async readCacheEntry(e){try{if(!await oee(um))return;let r=await nee(um,"utf8"),n=JSON.parse(r);return aee(n)?n[e]?.id:void 0}catch(r){k.debug("AppIdentityService","Failed to read cache",{appName:e,error:r instanceof Error?r.message:String(r)});return}}async writeCacheEntry(e,r){try{let n=K2.dirname(um);await Yyt(n,{recursive:!0});let a={};try{if(await oee(um)){let o=JSON.parse(await nee(um,"utf8"));aee(o)&&(a=o)}}catch(o){k.debug("AppIdentityService","Corrupted cache, starting fresh",{error:P(o)})}a[e]={id:r,resolvedAt:new Date().toISOString()},await fOe(um,JSON.stringify(a,null,2),{mode:384})}catch(n){k.debug("AppIdentityService","Failed to write cache",{error:P(n)})}}async removeCacheEntry(e){try{if(!await oee(um))return;let r=JSON.parse(await nee(um,"utf8"));if(!aee(r))return;delete r[e],await fOe(um,JSON.stringify(r,null,2),{mode:384})}catch(r){k.debug("AppIdentityService","Cache cleanup failed",{error:P(r)})}}}});async function Xyt(t,e,r){let n=new Array(t.length),a=0;async function o(){for(;;){let i=a++;if(i>=t.length)return;let c=t[i];if(c===void 0)return;n[i]=await r(c)}}let s=Math.max(1,Math.min(e,t.length));return await Promise.all(Array.from({length:s},()=>o())),n}function iee(t){return t===void 0||t==="DOES_NOT_EXIST"?"not-deployed":t.includes("IN_PROGRESS")?"deploying":HJ.has(t)?"healthy":"unhealthy"}function gOe(t){let e=0,r=0,n=0;for(let a of t)a.health==="healthy"?e++:a.health==="unhealthy"?r++:a.health==="deploying"&&n++;return{applications:t,totalCount:t.length,healthy:e,unhealthy:r,deploying:n}}var Jyt,lh,AA,cee=E(()=>{"use strict";XL();Vr();vl();Se();Ln();se();kt();ee();Q();B();Jyt=5;lh=class extends _e{errorType;constructor(e,r,n){super(`APP_QUERY_${r.toUpperCase()}`,e,n,!1),this.errorType=r}};AA=class{requireClient(){let e=Ke.fromCredentials();return e?A(e):v(new lh("Unable to resolve API credentials","credential_error"))}async checkAppHealth(e){try{await Ge.initialise();let r=Ss(),n=rr(e,ue.NETWORK),a=await r.getStackStatus(n);return a.success?iee(a.data.status):"not-deployed"}catch(r){return k.debug("AppQueryService","Health check failed",{app:e,error:P(r)}),"unknown"}}async listApplications(){let e=this.requireClient();if(!e.success)return e;let r=await e.data.listApps();if(!r.success)return v(new lh(b(r.error.message),"api_error",r.error));let n=r.data,a=await Xyt(n,Jyt,async o=>({id:o.id,name:o.name,health:await this.checkAppHealth(o.name)}));return A(gOe(a))}async getApplicationDetail(e){let r=this.requireClient();if(!r.success)return r;let n=r.data,a=await n.getApplicationByName(e);if(!a.success)return v(new lh(`Application "${e}" not found`,"not_found",a.error));let{id:o,name:s}=a.data.application,i=await n.getApplication(o);if(!i.success)return v(new lh(`Failed to fetch details for "${e}"`,"api_error",i.error));let c=await this.checkAppHealth(s);return A({id:o,name:s,health:c,application:i.data.application})}async getApplicationStatus(e){if(e){let r=await this.getApplicationDetail(e);return r.success?A(gOe([r.data])):v(r.error)}return this.listApplications()}}});var Bp,CA,Y2=E(()=>{"use strict";Vr();se();kt();B();Bp=class extends _e{errorType;constructor(e,r,n){super(`ASSET_QUERY_${r.toUpperCase()}`,e,n,!1),this.errorType=r}},CA=class{requireClient(){let e=Ke.fromCredentials();return e?A(e):v(new Bp("Unable to resolve API credentials","credential_error"))}async listAssets(e){let r=this.requireClient();if(!r.success)return r;let n=await r.data.listAssets(e);return n.success?A(n.data):v(new Bp(b(n.error.message),"api_error",n.error))}async getAssetDetail(e){let r=this.requireClient();if(!r.success)return r;let n=await r.data.getAsset(e);if(!n.success){let a=n.error.statusCode===404?"not_found":"api_error";return v(new Bp(b(n.error.message),a,n.error))}return A(n.data)}async getAssetCompliance(e){let r=this.requireClient();if(!r.success)return r;let n=await r.data.getAssetCompliance(e);if(!n.success){let a=n.error.statusCode===404?"not_found":"api_error";return v(new Bp(b(n.error.message),a,n.error))}return A(n.data)}}});import*as Qi from"fs";import*as Z2 from"path";import{homedir as Qyt}from"os";function yOe(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function tvt(t){return yOe(t)?typeof t.awsAccountId=="string"&&typeof t.accountName=="string"&&typeof t.status=="string"&&typeof t.role=="string"&&typeof t.connectedAt=="string":!1}function rvt(t){return yOe(t)?typeof t.fetchedAt=="string"&&typeof t.organisationId=="string"&&Array.isArray(t.accounts)&&t.accounts.every(tvt):!1}var evt,Sv,lee=E(()=>{"use strict";ee();Q();B();evt=Z2.join(Qyt(),".fjall","connections.json");Sv=class{cacheFile;constructor(e){this.cacheFile=e??evt}get(e){try{if(!Qi.existsSync(this.cacheFile))return null;let r=JSON.parse(Qi.readFileSync(this.cacheFile,"utf-8"));if(!rvt(r)||r.organisationId!==e)return null;let n=new Date(r.fetchedAt).getTime();return Date.now()-n>300*1e3?null:r.accounts}catch(r){return k.debug("ConnectionCache","Cache read failed",{error:P(r)}),null}}set(e,r){try{let n=Z2.dirname(this.cacheFile);Qi.existsSync(n)||Qi.mkdirSync(n,{recursive:!0,mode:448});let a={accounts:r,fetchedAt:new Date().toISOString(),organisationId:e},o=`${this.cacheFile}.tmp`;Qi.writeFileSync(o,JSON.stringify(a,null,2),{mode:384}),Qi.renameSync(o,this.cacheFile)}catch(n){k.warn("ConnectionCache","Failed to write cache",{error:b(P(n))})}}invalidate(){try{Qi.existsSync(this.cacheFile)&&Qi.unlinkSync(this.cacheFile)}catch(e){k.debug("ConnectionCache","Failed to invalidate cache",{error:P(e)})}}}});function nvt(t,e){return{awsAccountId:jd,accountName:t??jd,status:jd,role:"account",roleArn:jd,connectedAt:new Date().toISOString(),quickCreateUrl:e}}var Up,wA,vOe=E(()=>{"use strict";se();kt();Vr();Wb();Jk();Gr();Q();ee();lee();oF();kn();B();Up=class extends _e{constructor(e,r){super("CONNECT_ERROR",e,r,!1)}};wA=class{oidcSetup;oidcBootstrap;cache;constructor(e,r,n){this.oidcSetup=e??new Sp,this.oidcBootstrap=n??new zd(this.oidcSetup),this.cache=r??new Sv}async hasActiveConnection(){let e=Ke.fromCredentials();if(!e)return v(new Up("Not logged in. Run 'fjall login' first."));let r=await e.getIdentity();r.success||k.warn("Connect","Identity resolution failed, cache operations skipped",{error:b(P(r.error))});let n=await e.getConnectedAccounts();if(!n.success){if(r.success){let s=this.cache.get(r.data.organisationId);if(s&&s.length>0)return k.debug("Connect","Using cached connections (API unreachable)"),A(s)}let o=r.success?"":` (identity resolution also failed: ${b(P(r.error))})`;return v(new Up(`Failed to check connections: ${b(P(n.error))}${o}`))}let a=n.data.accounts;return r.success&&r.data.organisationId!==void 0&&this.cache.set(r.data.organisationId,a),A(a)}async connect(e,r,n,a,o){let s=new Me(r),i=e??Ye,c=n??"production",l=Ke.fromCredentials();if(!l)return v(new Up("Not logged in. Run 'fjall login' first."));let u=await l.getIdentity();if(!u.success){let y=u.error,S=y.statusCode?` (HTTP ${y.statusCode}: ${y.message})`:` (${y.message})`,x;return y.errorType==="not_authenticated"||y.statusCode===401?x="Your API key may be invalid or expired. Run 'fjall login --force' to re-authenticate.":y.errorType==="permission_denied"||y.statusCode===403?x="Your account does not have an active organisation. Sign in at the webapp to create one, or check your organisation membership.":y.errorType==="network_error"||y.errorType==="timeout"?x="Could not reach the Fjall API. Check your internet connection and try again.":x="Run 'fjall login --force' to re-authenticate, or check your organisation membership at the webapp.",k.debug("Connect","Identity resolution failed in connect()",{errorType:y.errorType,statusCode:y.statusCode,message:y.message}),v(new Up(`${x}${S}`))}let p=o?.force===!0,m=!1;if(!p){s.info("Checking existing AWS connections...");let y=await this.hasActiveConnection();if(y.success&&(m=!0,y.data.length>0)){r?.onExistingConnectionsFound?.(y.data);let S=Vb(y.data,c);if(S)return A({awsAccountId:S.awsAccountId,accountName:S.accountName,status:"active",role:S.role,roleArn:S.roleArn,connectedAt:new Date().toISOString()})}}s.step("Setting up AWS connection...");let d=await this.oidcBootstrap.establishOidcTrust(i,c,a,r,{skipWait:o?.skipWait,skipExistingCheck:p||m});if(!d.success)return v(new Up(`Connection failed: ${b(P(d.error))}`,d.error));let f=d.data;if(f.quickCreateUrl!==void 0)return A(nvt(a,f.quickCreateUrl));let h={awsAccountId:f.awsAccountId,accountName:f.accountName,status:"active",role:"account",roleArn:f.roleArn,connectedAt:new Date().toISOString()};return this.cache.invalidate(),A(h)}async ensureConnection(e){let r=await this.hasActiveConnection();if(r.success&&r.data.length>0)return r;new Me(e).warning("No AWS connection found. Starting connection setup...");let n=await this.connect(void 0,e);return n.success?A([n.data]):v(n.error)}}});var uee=E(()=>{"use strict";vOe();lee()});function pee(t){if(!t)return!1;let e=/Number of stacks with differences:\s*(\d+)/,r=t.match(e);if(r&&r[1]){let n=parseInt(r[1],10);if(!isNaN(n))return n>0}return!t.split(`
840
+ `)o=!1,i+=c(t,s,l),s=l;else if(!o&&r+n==="/*"){i+=t.slice(s,l),s=l,o=IRe,l++;continue}else if(o===IRe&&r+n==="*/"){l++,o=!1,i+=c(t,s,l+1),s=l+1;continue}}}return i+(o?c(t.substr(s)):t.substr(s))}});var RRe=ae(yA=>{"use strict";var DRe=Ct("fs"),oyt=kRe(),h_=Ct("path"),syt=_Re(),iyt=yA.parse=function(t){return/^\s*{/.test(t)?JSON.parse(syt(t)):oyt.parse(t)},cyt=yA.file=function(){var t=[].slice.call(arguments).filter(function(a){return a!=null});for(var e in t)if(typeof t[e]!="string")return;var r=h_.join.apply(null,t),n;try{return DRe.readFileSync(r,"utf-8")}catch{return}},aRr=yA.json=function(){var t=cyt.apply(null,arguments);return t?iyt(t):null},oRr=yA.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var a in e)if(a.toLowerCase().indexOf(t.toLowerCase())===0){for(var o=a.substring(n).split("__"),s;(s=o.indexOf(""))>-1;)o.splice(s,1);var i=r;o.forEach(function(l,u){!l||typeof i!="object"||(u===o.length-1&&(i[l]=e[a]),i[l]===void 0&&(i[l]={}),i=i[l])})}return r},sRr=yA.find=function(){var t=h_.join.apply(null,[].slice.call(arguments));function e(r,n){var a=h_.join(r,n);try{return DRe.statSync(a),a}catch{if(h_.dirname(r)!==r)return e(h_.dirname(r),n)}}return e(process.cwd(),t)}});var LRe=ae((cRr,FRe)=>{"use strict";function NRe(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function $Re(t){if(t instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function MRe(t){var e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=MRe(r):NRe(r)?e[n]=$Re(r):e[n]=YQ({},r):e[n]=r}),e}function ORe(t,e){return e==="__proto__"?void 0:t[e]}var YQ=FRe.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var t=arguments[0],e=Array.prototype.slice.call(arguments,1),r,n,a;return e.forEach(function(o){typeof o!="object"||o===null||Array.isArray(o)||Object.keys(o).forEach(function(s){if(n=ORe(t,s),r=ORe(o,s),r!==t)if(typeof r!="object"||r===null){t[s]=r;return}else if(Array.isArray(r)){t[s]=MRe(r);return}else if(NRe(r)){t[s]=$Re(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[s]=YQ({},r);return}else{t[s]=YQ(n,r);return}})}),t}});var zRe=ae((lRr,jRe)=>{"use strict";function lyt(t,e){var r=t;e.slice(0,-1).forEach(function(a){r=r[a]||{}});var n=e[e.length-1];return n in r}function BRe(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function URe(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}jRe.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(C){r.bools[C]=!0});var n={};function a(C){return n[C].some(function(T){return r.bools[T]})}Object.keys(e.alias||{}).forEach(function(C){n[C]=[].concat(e.alias[C]),n[C].forEach(function(T){n[T]=[C].concat(n[C].filter(function(_){return T!==_}))})}),[].concat(e.string).filter(Boolean).forEach(function(C){r.strings[C]=!0,n[C]&&[].concat(n[C]).forEach(function(T){r.strings[T]=!0})});var o=e.default||{},s={_:[]};function i(C,T){return r.allBools&&/^--[^=]+$/.test(T)||r.strings[C]||r.bools[C]||n[C]}function c(C,T,_){for(var D=C,O=0;O<T.length-1;O++){var R=T[O];if(URe(D,R))return;D[R]===void 0&&(D[R]={}),(D[R]===Object.prototype||D[R]===Number.prototype||D[R]===String.prototype)&&(D[R]={}),D[R]===Array.prototype&&(D[R]=[]),D=D[R]}var L=T[T.length-1];URe(D,L)||((D===Object.prototype||D===Number.prototype||D===String.prototype)&&(D={}),D===Array.prototype&&(D=[]),D[L]===void 0||r.bools[L]||typeof D[L]=="boolean"?D[L]=_:Array.isArray(D[L])?D[L].push(_):D[L]=[D[L],_])}function l(C,T,_){if(!(_&&r.unknownFn&&!i(C,_)&&r.unknownFn(_)===!1)){var D=!r.strings[C]&&BRe(T)?Number(T):T;c(s,C.split("."),D),(n[C]||[]).forEach(function(O){c(s,O.split("."),D)})}}Object.keys(r.bools).forEach(function(C){l(C,o[C]===void 0?!1:o[C])});var u=[];t.indexOf("--")!==-1&&(u=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var p=0;p<t.length;p++){var m=t[p],d,f;if(/^--.+=/.test(m)){var h=m.match(/^--([^=]+)=([\s\S]*)$/);d=h[1];var y=h[2];r.bools[d]&&(y=y!=="false"),l(d,y,m)}else if(/^--no-.+/.test(m))d=m.match(/^--no-(.+)/)[1],l(d,!1,m);else if(/^--.+/.test(m))d=m.match(/^--(.+)/)[1],f=t[p+1],f!==void 0&&!/^(-|--)[^-]/.test(f)&&!r.bools[d]&&!r.allBools&&(!n[d]||!a(d))?(l(d,f,m),p+=1):/^(true|false)$/.test(f)?(l(d,f==="true",m),p+=1):l(d,r.strings[d]?"":!0,m);else if(/^-[^-]+/.test(m)){for(var S=m.slice(1,-1).split(""),x=!1,w=0;w<S.length;w++){if(f=m.slice(w+2),f==="-"){l(S[w],f,m);continue}if(/[A-Za-z]/.test(S[w])&&f[0]==="="){l(S[w],f.slice(1),m),x=!0;break}if(/[A-Za-z]/.test(S[w])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(f)){l(S[w],f,m),x=!0;break}if(S[w+1]&&S[w+1].match(/\W/)){l(S[w],m.slice(w+2),m),x=!0;break}else l(S[w],r.strings[S[w]]?"":!0,m)}d=m.slice(-1)[0],!x&&d!=="-"&&(t[p+1]&&!/^(-|--)[^-]/.test(t[p+1])&&!r.bools[d]&&(!n[d]||!a(d))?(l(d,t[p+1],m),p+=1):t[p+1]&&/^(true|false)$/.test(t[p+1])?(l(d,t[p+1]==="true",m),p+=1):l(d,r.strings[d]?"":!0,m))}else if((!r.unknownFn||r.unknownFn(m)!==!1)&&s._.push(r.strings._||!BRe(m)?m:Number(m)),e.stopEarly){s._.push.apply(s._,t.slice(p+1));break}}return Object.keys(o).forEach(function(C){lyt(s,C.split("."))||(c(s,C.split("."),o[C]),(n[C]||[]).forEach(function(T){c(s,T.split("."),o[C])}))}),e["--"]?s["--"]=u.slice():u.forEach(function(C){s._.push(C)}),s}});var ZQ=ae((uRr,GRe)=>{var g_=RRe(),vA=Ct("path").join,uyt=LRe(),WRe="/etc",VRe=process.platform==="win32",y_=VRe?process.env.USERPROFILE:process.env.HOME;GRe.exports=function(t,e,r,n){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=zRe()(process.argv.slice(2))),e=(typeof e=="string"?g_.json(e):e)||{},n=n||g_.parse;var a=g_.env(t+"_"),o=[e],s=[];function i(c){if(!(s.indexOf(c)>=0)){var l=g_.file(c);l&&(o.push(n(l)),s.push(c))}}return VRe||[vA(WRe,t,"config"),vA(WRe,t+"rc")].forEach(i),y_&&[vA(y_,".config",t,"config"),vA(y_,".config",t),vA(y_,"."+t,"config"),vA(y_,"."+t+"rc")].forEach(i),i(g_.find("."+t+"rc")),a.config&&i(a.config),r.config&&i(r.config),uyt.apply(null,o.concat([a,r,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var qRe=ae((pRr,HRe)=>{"use strict";HRe.exports=function(t){var e=ZQ()("npm",{registry:"https://registry.npmjs.org/"}),r=e[t+":registry"]||e.registry;return r.slice(-1)==="/"?r:r+"/"}});var ZRe=ae((JQ,YRe)=>{var H2=Ct("buffer"),Lp=H2.Buffer;function KRe(t,e){for(var r in t)e[r]=t[r]}Lp.from&&Lp.alloc&&Lp.allocUnsafe&&Lp.allocUnsafeSlow?YRe.exports=H2:(KRe(H2,JQ),JQ.Buffer=vv);function vv(t,e,r){return Lp(t,e,r)}vv.prototype=Object.create(Lp.prototype);KRe(Lp,vv);vv.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Lp(t,e,r)};vv.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Lp(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};vv.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Lp(t)};vv.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return H2.SlowBuffer(t)}});var QRe=ae((dRr,XRe)=>{var JRe=ZRe().Buffer;function pyt(t){return JRe.from(t,"base64").toString("utf8")}function dyt(t){return JRe.from(t,"utf8").toString("base64")}XRe.exports={decodeBase64:pyt,encodeBase64:dyt}});var sOe=ae((mRr,oOe)=>{var XQ=Ct("url"),nOe=QRe(),myt=nOe.decodeBase64,fyt=nOe.encodeBase64,eOe=":_authToken",tOe=":username",rOe=":_password";oOe.exports=function(){var t,e;return arguments.length>=2?(t=arguments[0],e=arguments[1]):typeof arguments[0]=="string"?t=arguments[0]:e=arguments[0],e=e||{},e.npmrc=e.npmrc||ZQ()("npm",{registry:"https://registry.npmjs.org/"}),t=t||e.npmrc.registry,aOe(t,e)||hyt(e.npmrc)};function aOe(t,e){for(var r=XQ.parse(t,!1,!0),n;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";var a="//"+r.host+n.replace(/\/$/,""),o=yyt(a,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:aOe(XQ.resolve(t,"."),e);r.pathname=XQ.resolve(gyt(n),"..")||"/"}}function hyt(t){if(t._auth)return{token:t._auth,type:"Basic"}}function gyt(t){return t[t.length-1]==="/"?t:t+"/"}function yyt(t,e){var r=vyt(e[t+eOe]||e[t+"/"+eOe]);if(r)return r;var n=e[t+tOe]||e[t+"/"+tOe],a=e[t+rOe]||e[t+"/"+rOe],o=Syt(n,a);if(o)return o}function vyt(t){if(t){var e=t.replace(/^\$\{?([^}]*)\}?$/,function(r,n){return process.env[n]});return{token:e,type:"Bearer"}}}function Syt(t,e){if(!(!t||!e)){var r=myt(e.replace(/^\$\{?([^}]*)\}?$/,function(a,o){return process.env[o]})),n=fyt(t+":"+r);return{token:n,type:"Basic",password:r,username:t}}}});var uOe=ae((fRr,lOe)=>{var{URL:Eyt}=Ct("url"),{join:iOe}=Ct("path"),v_=Ct("fs"),{promisify:QQ}=Ct("util"),{tmpdir:byt}=Ct("os"),xyt=qRe(),Ayt=QQ(v_.writeFile),Cyt=QQ(v_.mkdir),wyt=QQ(v_.readFile),Tyt=(t,e)=>t.localeCompare(e,"en-US",{numeric:!0}),kyt=t=>encodeURIComponent(t).replace(/^%40/,"@"),Iyt=async(t,e)=>{let r=byt(),n=iOe(r,"update-check");v_.existsSync(n)||await Cyt(n);let a=`${t.name}-${e}.json`;return t.scope&&(a=`${t.scope}-${a}`),iOe(n,a)},Pyt=async(t,e,r)=>{if(v_.existsSync(t)){let n=await wyt(t,"utf8"),{lastUpdate:a,latest:o}=JSON.parse(n);if(a+r>e)return{shouldCheck:!1,latest:o}}return{shouldCheck:!0,latest:null}},_yt=async(t,e,r)=>{let n=JSON.stringify({latest:e,lastUpdate:r});await Ayt(t,n,"utf8")},cOe=(t,e)=>new Promise((r,n)=>{let a={host:t.hostname,path:t.pathname,port:t.port,headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},timeout:2e3};e&&(a.headers.authorization=`${e.type} ${e.token}`);let{get:o}=t.protocol==="https:"?Ct("https"):Ct("http");o(a,s=>{let{statusCode:i}=s;if(i!==200){let l=new Error(`Request failed with code ${i}`);l.code=i,n(l),s.resume();return}let c="";s.setEncoding("utf8"),s.on("data",l=>{c+=l}),s.on("end",()=>{try{let l=JSON.parse(c);r(l)}catch(l){n(l)}})}).on("error",n).on("timeout",n)}),Dyt=async({full:t,scope:e},r)=>{let n=xyt(e),a=new Eyt(t,n),o=null;try{o=await cOe(a)}catch(i){if(i.code&&String(i.code).startsWith(4)){let l=sOe()(n,{recursive:!0});o=await cOe(a,l)}else throw i}let s=o["dist-tags"][r];if(!s)throw new Error(`Distribution tag ${r} is not available`);return s},Ryt={interval:36e5,distTag:"latest"},Oyt=t=>{let e={full:kyt(t)};if(t.includes("/")){let r=t.split("/");e.scope=r[0],e.name=r[1]}else e.scope=null,e.name=t;return e};lOe.exports=async(t,e)=>{if(typeof t!="object")throw new Error("The first parameter should be your package.json file content");let r=Oyt(t.name),n=Date.now(),{distTag:a,interval:o}=Object.assign({},Ryt,e),s=await Iyt(r,a),i=null,c=!0;return{shouldCheck:c,latest:i}=await Pyt(s,n,o),c&&(i=await Dyt(r,a),await _yt(s,i,n)),Tyt(t.version,i)===-1?{latest:i,fromCache:!c}:null}});import{realpathSync as Nyt}from"fs";async function $yt(){let{default:t}=await Promise.resolve().then(()=>dc(uOe(),1));return t}var S_,E_,eee=E(()=>{"use strict";se();kt();Q();ee();B();S_=class extends _e{constructor(e,r){super("VERSION_CHECK_ERROR",e,r,!1)}};E_=class{updateAvailable=null;isHomebrewInstall(){let e=process.env.HOMEBREW_PREFIX;if(!e)return!1;let r=process.argv[1];if(!r)return!1;try{return Nyt(r).startsWith(e)}catch{return k.debug("VersionCheck","Could not resolve binary path for Homebrew detection"),!1}}async performCheck(e){let r=await $yt(),n;try{let a=await Promise.race([r(e,{interval:864e5}),new Promise(o=>{n=setTimeout(()=>o(null),1e4),n.unref()})]);return a?(this.updateAvailable={current:e.version,latest:a.latest,installSource:this.isHomebrewInstall()?"homebrew":"npm"},this.updateAvailable):null}finally{n!==void 0&&clearTimeout(n)}}async checkForUpdates(e){if(!(process.env.CI||process.env.CONTINUOUS_INTEGRATION))try{await this.performCheck(e)}catch(r){k.debug("VersionCheck","Update check failed (non-critical)",{error:b(P(r))})}}async checkForUpdatesWithResult(e){if(process.env.CI||process.env.CONTINUOUS_INTEGRATION)return A(null);try{let r=await this.performCheck(e);return A(r)}catch(r){return v(new S_(`Failed to check for updates: ${b(P(r))}`,r))}}getUpdate(){return this.updateAvailable}}});import{RDSClient as Myt,DescribeDBSnapshotsCommand as Fyt,DescribeDBClusterSnapshotsCommand as Lyt}from"@aws-sdk/client-rds";function b_(t,e=Byt){return typeof t=="string"?t:e}function Uyt(t,e=0){return typeof t=="number"?t:e}var Byt,x_,A_,pOe=E(()=>{"use strict";_a();se();kt();Q();Byt="unknown";x_=class extends _e{type;constructor(e,r,n){super(`RDS_SNAPSHOT_${r.toUpperCase()}`,e,void 0,r!=="aws_error",n instanceof Error?n:void 0),this.type=r}},A_=class{aws;ssoCallbacks;setSsoCallbacks(e){this.ssoCallbacks=e}async getAws(){return this.aws||(this.aws=await Ge.initialise({ssoCallbacks:this.ssoCallbacks})),this.aws}async getClient(){return(await this.getAws()).getClient(Myt)}async describeSnapshot(e){try{let r=await this.getClient(),n=e.buildCommand(e.identifier),a=await r.send(n),o=e.extractSnapshot(a);return o?A({snapshotIdentifier:b_(o[e.identifierField],e.identifier),engine:b_(o.Engine),engineVersion:b_(o.EngineVersion),masterUsername:b_(o.MasterUsername),status:b_(o.Status),allocatedStorage:Uyt(o.AllocatedStorage),snapshotType:e.snapshotType}):v(new x_(`${e.label} '${e.identifier}' not found`,"not_found"))}catch(r){let{name:n,message:a}=In(r);return n===e.notFoundFault?v(new x_(`${e.label} '${e.identifier}' not found`,"not_found",r)):v(new x_(`Failed to describe ${e.label.toLowerCase()}: ${a}`,"aws_error",r))}}async describeDbSnapshot(e){return this.describeSnapshot({identifier:e,snapshotType:"instance",buildCommand:r=>new Fyt({DBSnapshotIdentifier:r}),extractSnapshot:r=>r.DBSnapshots?.[0],identifierField:"DBSnapshotIdentifier",notFoundFault:"DBSnapshotNotFoundFault",label:"Snapshot"})}async describeDbClusterSnapshot(e){return this.describeSnapshot({identifier:e,snapshotType:"cluster",buildCommand:r=>new Lyt({DBClusterSnapshotIdentifier:r}),extractSnapshot:r=>r.DBClusterSnapshots?.[0],identifierField:"DBClusterSnapshotIdentifier",notFoundFault:"DBClusterSnapshotNotFoundFault",label:"Cluster snapshot"})}async findSnapshot(e){let r=await this.describeDbSnapshot(e);return r.success?r:r.error.type==="not_found"?this.describeDbClusterSnapshot(e):r}async validateSnapshot(e,r,n){let a=await this.findSnapshot(e);if(!a.success)return a.error.type==="not_found"?A({exists:!1,available:!1,warnings:[`Snapshot '${e}' not found. Ensure the identifier is correct and the snapshot exists in the current region.`]}):a;let o=a.data,s=[],i=o.status==="available";if(i||s.push(`Snapshot status is '${o.status}' \u2014 it must be 'available' before it can be used for restoration.`),r&&o.engine!==r&&s.push(`Engine mismatch: snapshot uses '${o.engine}' but '${r}' was expected.`),n){let c=o.engineVersion.split(".")[0]??"",l=n.split(".")[0]??"";c!==l&&s.push(`Major version mismatch: snapshot is version '${o.engineVersion}' but '${n}' was expected.`)}return A({exists:!0,available:i,snapshot:o,warnings:s})}}});var ha,q2=E(()=>{"use strict";kt();ha=class extends _e{errorType;constructor(e,r,n){super(`TUNNEL_${r.toUpperCase()}`,e,n,r!=="access_denied"),this.errorType=r}}});import{AutoScalingClient as jyt,DescribeAutoScalingGroupsCommand as zyt}from"@aws-sdk/client-auto-scaling";import{SecretsManagerClient as Wyt,GetSecretValueCommand as Vyt}from"@aws-sdk/client-secrets-manager";var SA,tee=E(()=>{"use strict";_a();se();q2();Se();Ou();B();Q();ee();SA=class{aws=null;constructor(){}async getAws(){return this.aws||(this.aws=await Ge.initialise()),this.aws}async getBastionInstanceId(e,r){r?.onDiscovery?.("bastion","Looking up bastion instance");let n=`${Qn(e)}Network`,a=await Ss().getStackOutputs(n);if(!a.success)return v(new ha(`Failed to read Network stack outputs: ${b(a.error.message)}`,"bastion_not_found",{stackName:n}));let o=a.data.find(i=>i.OutputKey?.endsWith("BastionInstanceId"));if(!o?.OutputValue)return v(new ha(`No bastion found in stack ${n}. Ensure the application has a bastion host enabled.`,"bastion_not_found",{stackName:n,outputs:a.data.map(i=>i.OutputKey)}));let s=o.OutputValue;try{let i=(await(await this.getAws()).getClient(jyt).send(new zyt({AutoScalingGroupNames:[s]}))).AutoScalingGroups?.[0]?.Instances??[],c=i.find(l=>l.LifecycleState==="InService"&&l.HealthStatus==="Healthy");return c?.InstanceId?(r?.onDiscovery?.("bastion",`Found bastion instance ${c.InstanceId}`),A(c.InstanceId)):v(new ha(`Bastion ASG "${s}" has no healthy instances. The bastion may be starting up or has been terminated.`,"bastion_not_found",{asgName:s,instanceCount:i.length}))}catch(i){return v(new ha(`Failed to resolve bastion instance from ASG: ${b(P(i))}`,"bastion_not_found",{asgName:s,error:i}))}}async discoverTargets(e,r){r?.onDiscovery?.("databases","Discovering database targets");let n=`${Qn(e)}Database`,a=await Ss().getStackOutputs(n);if(!a.success)return v(new ha(`Failed to read Database stack outputs: ${b(a.error.message)}`,"no_databases",{stackName:n}));let o=a.data;if(o.length===0)return v(new ha(`No database stack found for "${e}". Deploy a database first.`,"no_databases",{stackName:n}));let s=new Map;for(let l of o)l.OutputKey&&l.OutputValue&&s.set(l.OutputKey,l.OutputValue);let i=[...s.keys()].filter(l=>l.endsWith("Endpoint")),c=[];for(let l of i){let u=l.replace(/Endpoint$/,""),p=s.get(l),m=s.get(`${u}Port`),d=s.get(`${u}DatabaseName`),f=s.get(`${u}SecretArn`),h=s.get(`${u}ProxyEndpoint`),y=s.get(`${u}Engine`),S=s.get(`${u}DatabaseType`);if(!p||!m||!d||!f){k.debug("TunnelDiscoveryService","Skipping incomplete database output",{prefix:u,hasEndpoint:!!p,hasPort:!!m,hasDatabaseName:!!d,hasSecretArn:!!f});continue}let x=this.resolveEngine(y),w=this.resolveDatabaseType(S);c.push({name:u,type:w,engine:x,endpoint:p,proxyEndpoint:h||void 0,port:parseInt(m,10),databaseName:d,secretArn:f})}return c.length===0?v(new ha(`No complete database configurations found in stack "${n}".`,"no_databases",{stackName:n,outputKeys:[...s.keys()]})):(r?.onDiscovery?.("databases",`Found ${String(c.length)} database target(s)`),A(c))}async getCredentials(e,r){r?.onDiscovery?.("credentials","Fetching database credentials");try{let n=await(await this.getAws()).getClient(Wyt).send(new Vyt({SecretId:e.secretArn}));if(!n.SecretString)return v(new ha("Secret value is empty or binary (expected JSON string).","credentials_failed",{secretArn:e.secretArn}));let a;try{a=JSON.parse(n.SecretString)}catch(o){return k.debug("TunnelDiscoveryService","Secret value JSON parse failed",{secretArn:e.secretArn,error:o instanceof Error?o.message:String(o)}),v(new ha("Secret value is not valid JSON.","credentials_failed",{secretArn:e.secretArn}))}return this.isValidCredentials(a)?(r?.onDiscovery?.("credentials","Credentials retrieved"),A({username:a.username,password:a.password})):v(new ha("Secret does not contain valid username/password fields.","credentials_failed",{secretArn:e.secretArn}))}catch(n){let a=P(n);return a.includes("AccessDeniedException")||a.includes("is not authorized")?v(new ha(`Access denied when reading secret: ${b(a)}`,"access_denied",{secretArn:e.secretArn})):v(new ha(`Failed to fetch credentials: ${b(a)}`,"credentials_failed",{secretArn:e.secretArn}))}}resolveEngine(e){if(!e)return"postgresql";let r=e.toLowerCase();return r.includes("mysql")||r.includes("mariadb")?"mysql":"postgresql"}resolveDatabaseType(e){if(!e)return"Instance";let r=e.toLowerCase();return r.includes("global")?"GlobalAurora":r.includes("aurora")||r.includes("cluster")?"Aurora":"Instance"}isValidCredentials(e){return typeof e=="object"&&e!==null&&"username"in e&&"password"in e&&typeof e.username=="string"&&typeof e.password=="string"}}});import{spawn as Gyt,execFileSync as dOe}from"child_process";var C_,mOe=E(()=>{"use strict";se();q2();B();ee();tee();C_=class{discovery=new SA;constructor(){}checkPrerequisites(e){let r=[];e?.onPrerequisiteCheck?.("aws-cli","checking");try{dOe("aws",["--version"],{stdio:"pipe",env:Ar(process.env)}),e?.onPrerequisiteCheck?.("aws-cli","found")}catch(n){k.debug("Tunnel","aws-cli check failed",{error:n instanceof Error?n.message:String(n)}),e?.onPrerequisiteCheck?.("aws-cli","missing"),r.push("aws (AWS CLI)")}e?.onPrerequisiteCheck?.("session-manager-plugin","checking");try{dOe("session-manager-plugin",["--version"],{stdio:"pipe",env:Ar(process.env)}),e?.onPrerequisiteCheck?.("session-manager-plugin","found")}catch(n){k.debug("Tunnel","session-manager-plugin check failed",{error:n instanceof Error?n.message:String(n)}),e?.onPrerequisiteCheck?.("session-manager-plugin","missing"),r.push("session-manager-plugin")}return r.length>0?v(new ha(`Required tools not found: ${r.join(", ")}. Install them before using tunnel.`,"prerequisites_missing",{missing:r})):A(void 0)}async getBastionInstanceId(e,r){return this.discovery.getBastionInstanceId(e,r)}async discoverTargets(e,r){return this.discovery.discoverTargets(e,r)}async getCredentials(e,r){return this.discovery.getCredentials(e,r)}async openTunnel(e){let{bastionInstanceId:r,target:n,localPort:a,credentials:o,callbacks:s}=e,i=e.awsRegion??(await this.discovery.getAws()).getRegion(),c=n.proxyEndpoint??n.endpoint,l=JSON.stringify({host:[c],portNumber:[String(n.port)],localPortNumber:[String(a)]}),u=["ssm","start-session","--target",r,"--document-name","AWS-StartPortForwardingSessionToRemoteHost","--parameters",l,"--region",i],p=Ar(process.env);return new Promise(m=>{let d=Gyt("aws",u,{stdio:["ignore","pipe","pipe"],shell:!1,env:{...p}});if(d.pid===void 0){d.on("error",w=>{k.debug("Tunnel","Spawn error (already handled)",{error:w.message})}),m(v(new ha("Failed to spawn SSM session process -- no PID.","session_failed",{command:"aws",args:u})));return}let f=!1,h=6e4,y=setTimeout(()=>{f||(f=!0,d.stdout&&d.stdout.destroy(),d.stderr&&d.stderr.destroy(),d.kill("SIGTERM"),x(),m(v(new ha(`SSM session connection timed out after ${h/1e3}s`,"session_failed",{command:"aws",args:u}))))},h),S=()=>{d.stdin&&d.stdin.destroy(),d.stdout&&d.stdout.destroy(),d.stderr&&d.stderr.destroy(),d.kill("SIGTERM")},x=()=>{process.removeListener("SIGINT",S),process.removeListener("SIGTERM",S)};process.on("SIGINT",S),process.on("SIGTERM",S),d.on("error",w=>{f||(f=!0,clearTimeout(y),x(),m(v(new ha(`Failed to start SSM session: ${b(w.message)}`,"session_failed",{command:"aws",args:u}))))}),d.stderr?.on("data",w=>{let C=w.toString();if(k.debug("TunnelService","SSM stderr",{output:b(C)}),C.includes("Waiting for connections")&&!f){f=!0,clearTimeout(y);let T=this.buildConnectionInfo(a,c,n.databaseName,n.engine,o);s?.onTunnelReady?.(T)}}),d.stdout?.on("data",w=>{let C=w.toString();k.debug("TunnelService","SSM stdout",{output:b(C)})}),d.on("close",w=>{clearTimeout(y),x(),s?.onTunnelClosed?.(),w!==0&&w!==null&&!f?m(v(new ha(`SSM session exited with code ${String(w)}`,"session_failed",{exitCode:w}))):(w!==0&&w!==null&&k.debug("TunnelService","Tunnel exited with non-zero code after successful connection",{exitCode:w}),m(A(void 0)))})})}buildConnectionInfo(e,r,n,a,o){let s=`${a==="postgresql"?"postgresql":"mysql"}://${encodeURIComponent(o.username)}:${encodeURIComponent(o.password)}@localhost:${String(e)}/${n}`;return{localPort:e,endpoint:r,databaseName:n,connectionString:s}}}});import{existsSync as EA,readdirSync as Hyt}from"fs";import{promises as qyt}from"dns";var Kyt,Xi,w_,ree=E(()=>{"use strict";se();kt();Gr();B();wr();Se();vl();If();ee();Kyt="DomainService",Xi=class extends _e{errorType;constructor(e,r,n){super(`DOMAIN_${r.toUpperCase()}`,e,n,!1),this.errorType=r}},w_=class{async createDomain(e,r={},n){let a=new Me(n),o=El(e);if(EA(o))return v(new Xi(`Domain '${e}' already exists at ${o}`,"already_exists"));try{a.step(`Creating domain '${e}'`);let s=await Pn().runGenerator({type:"domain",schema:{domainName:e,hostedZoneId:r.hostedZoneId}});return s.success?(a.step(`Created ${o}`),A({name:e,path:o})):v(new Xi(`Failed to generate domain: ${b(s.error.message)}`,"deploy_error",s.error))}catch(s){let i=b(P(s));return v(new Xi(i,"deploy_error"))}}async deployDomain(e,r){let n=new Me(r),a=El(e);if(!EA(a))return v(new Xi(`Domain '${e}' not found. Run 'fjall create domain ${e}' first.`,"not_found"));let o=xy(e);if(!EA(o))return v(new Xi(`infrastructure.ts not found at ${o}. Import or create a domain first.`,"not_found"));try{n.step(`Deploying domain '${e}'`);let s=Ge.getCurrent()??await Ge.initialise(),i;try{i=s.getAccountId()}catch(h){return v(new Xi(`AWS authentication required: ${b(P(h))}`,"deploy_error"))}let c=s.getRegion(),l=s.getCredentials(),u,p=await po().getOrgConfig();p.success&&(u=Ho.serialise(p.data));let m,d=await LP().lookupOrganisation();d.success?m=d.data:k.warn(Kyt,"Organisation lookup failed \u2014 domain deploy proceeds without org context",{error:b(d.error.message)});let f=await pv().deploy(a,void 0,{outputCallback:h=>{r?.onProgress?.({type:"info",message:b(h)})},context:{accountId:i,region:c,...m!==void 0&&{orgId:m.orgId,rootId:m.rootId,managementAccountId:m.managementAccountId},...u!==void 0&&{orgConfig:u}},...l!==void 0&&{credentials:l}});return f.success?A({name:e}):v(new Xi(`CDK deploy failed: ${b(P(f.error))}`,"deploy_error"))}catch(s){let i=b(P(s));return v(new Xi(i,"deploy_error"))}}async verifyDomain(e,r){let n=new Me(r),a;try{n.step(`Checking DNS propagation for ${e}`);let o=await Promise.race([qyt.resolveNs(e),new Promise((i,c)=>{a=setTimeout(()=>c(new Error("DNS lookup timed out")),1e4)})]),s=o.some(i=>i.includes("awsdns"));return n.step(s?"Nameserver delegation: VERIFIED":"Nameservers found but not pointing to Route53"),A({name:e,delegated:s,nameservers:o})}catch(o){let s=b(P(o));return v(new Xi(`DNS verification failed for ${e}: ${s}`,"verification_error"))}finally{a!==void 0&&clearTimeout(a)}}listDomains(){let e=n7();if(!EA(e))return A([]);try{let r=Hyt(e,{withFileTypes:!0}).filter(n=>n.isDirectory()).map(n=>{let a=El(n.name);return{name:n.name,path:a,hasZoneFile:EA(Rxe(n.name)),hasInfrastructure:EA(xy(n.name))}});return A(r)}catch(r){let n=b(P(r));return v(new Xi(n,"not_found"))}}resolveDomainForApp(e){let r=this.listDomains();if(!r.success)return;let n=r.data;if(n.length===0)return;let a=n.find(s=>s.name===e);if(a)return this.buildExportNames(a.name);let o=e.split(".");for(let s=1;s<o.length;s++){let i=o.slice(s).join("."),c=n.find(l=>l.name===i);if(c)return this.buildExportNames(c.name)}}buildExportNames(e){let r=Ni(e);return{hostedZoneIdExport:r.hostedZoneId,certificateArnExport:r.certificateArn,zoneName:e}}}});import{readFile as nee,writeFile as fOe,mkdir as Yyt,access as Zyt}from"fs/promises";import*as K2 from"path";import*as hOe from"os";function aee(t){return typeof t!="object"||t===null||Array.isArray(t)?!1:Object.values(t).every(e=>typeof e=="object"&&e!==null&&"id"in e&&typeof e.id=="string"&&"resolvedAt"in e&&typeof e.resolvedAt=="string")}async function oee(t){try{return await Zyt(t),!0}catch{return!1}}var bA,um,xA,see=E(()=>{"use strict";se();kt();Vr();ee();Q();bA=class extends _e{appName;constructor(e,r){super("APP_IDENTITY_ERROR",e),this.appName=r}};um=K2.join(hOe.homedir(),".fjall","app-id-cache.json");xA=class{memoryCache=new Map;async resolveAppId(e){let r=this.memoryCache.get(e);if(r)return A(r);let n=await this.readCacheEntry(e);return n?(this.memoryCache.set(e,n),A(n)):this.resolveFromApi(e)}async invalidateCache(e){this.memoryCache.delete(e),await this.removeCacheEntry(e)}async resolveFromApi(e){let r=Ke.fromCredentials();if(!r)return v(new bA("Not logged in. Run 'fjall login' first.",e));let n=await r.getApplicationByName(e);if(!n.success)return v(new bA(`Application '${e}' not found. Deploy it first.`,e));let a=n.data.application.id;return this.memoryCache.set(e,a),await this.writeCacheEntry(e,a),A(a)}async readCacheEntry(e){try{if(!await oee(um))return;let r=await nee(um,"utf8"),n=JSON.parse(r);return aee(n)?n[e]?.id:void 0}catch(r){k.debug("AppIdentityService","Failed to read cache",{appName:e,error:r instanceof Error?r.message:String(r)});return}}async writeCacheEntry(e,r){try{let n=K2.dirname(um);await Yyt(n,{recursive:!0});let a={};try{if(await oee(um)){let o=JSON.parse(await nee(um,"utf8"));aee(o)&&(a=o)}}catch(o){k.debug("AppIdentityService","Corrupted cache, starting fresh",{error:P(o)})}a[e]={id:r,resolvedAt:new Date().toISOString()},await fOe(um,JSON.stringify(a,null,2),{mode:384})}catch(n){k.debug("AppIdentityService","Failed to write cache",{error:P(n)})}}async removeCacheEntry(e){try{if(!await oee(um))return;let r=JSON.parse(await nee(um,"utf8"));if(!aee(r))return;delete r[e],await fOe(um,JSON.stringify(r,null,2),{mode:384})}catch(r){k.debug("AppIdentityService","Cache cleanup failed",{error:P(r)})}}}});async function Xyt(t,e,r){let n=new Array(t.length),a=0;async function o(){for(;;){let i=a++;if(i>=t.length)return;let c=t[i];if(c===void 0)return;n[i]=await r(c)}}let s=Math.max(1,Math.min(e,t.length));return await Promise.all(Array.from({length:s},()=>o())),n}function iee(t){return t===void 0||t==="DOES_NOT_EXIST"?"not-deployed":t.includes("IN_PROGRESS")?"deploying":HJ.has(t)?"healthy":"unhealthy"}function gOe(t){let e=0,r=0,n=0;for(let a of t)a.health==="healthy"?e++:a.health==="unhealthy"?r++:a.health==="deploying"&&n++;return{applications:t,totalCount:t.length,healthy:e,unhealthy:r,deploying:n}}var Jyt,lh,AA,cee=E(()=>{"use strict";XL();Vr();vl();Se();Ln();se();kt();ee();Q();B();Jyt=5;lh=class extends _e{errorType;constructor(e,r,n){super(`APP_QUERY_${r.toUpperCase()}`,e,n,!1),this.errorType=r}};AA=class{requireClient(){let e=Ke.fromCredentials();return e?A(e):v(new lh("Unable to resolve API credentials","credential_error"))}async checkAppHealth(e){try{await Ge.initialise();let r=Ss(),n=rr(e,ue.NETWORK),a=await r.getStackStatus(n);return a.success?iee(a.data.status):"not-deployed"}catch(r){return k.debug("AppQueryService","Health check failed",{app:e,error:P(r)}),"unknown"}}async listApplications(){let e=this.requireClient();if(!e.success)return e;let r=await e.data.listApps();if(!r.success)return v(new lh(b(r.error.message),"api_error",r.error));let n=r.data,a=await Xyt(n,Jyt,async o=>({id:o.id,name:o.name,health:await this.checkAppHealth(o.name)}));return A(gOe(a))}async getApplicationDetail(e){let r=this.requireClient();if(!r.success)return r;let n=r.data,a=await n.getApplicationByName(e);if(!a.success)return v(new lh(`Application "${e}" not found`,"not_found",a.error));let{id:o,name:s}=a.data.application,i=await n.getApplication(o);if(!i.success)return v(new lh(`Failed to fetch details for "${e}"`,"api_error",i.error));let c=await this.checkAppHealth(s);return A({id:o,name:s,health:c,application:i.data.application})}async getApplicationStatus(e){if(e){let r=await this.getApplicationDetail(e);return r.success?A(gOe([r.data])):v(r.error)}return this.listApplications()}}});var Bp,CA,Y2=E(()=>{"use strict";Vr();se();kt();B();Bp=class extends _e{errorType;constructor(e,r,n){super(`ASSET_QUERY_${r.toUpperCase()}`,e,n,!1),this.errorType=r}},CA=class{requireClient(){let e=Ke.fromCredentials();return e?A(e):v(new Bp("Unable to resolve API credentials","credential_error"))}async listAssets(e){let r=this.requireClient();if(!r.success)return r;let n=await r.data.listAssets(e);return n.success?A(n.data):v(new Bp(b(n.error.message),"api_error",n.error))}async getAssetDetail(e){let r=this.requireClient();if(!r.success)return r;let n=await r.data.getAsset(e);if(!n.success){let a=n.error.statusCode===404?"not_found":"api_error";return v(new Bp(b(n.error.message),a,n.error))}return A(n.data)}async getAssetCompliance(e){let r=this.requireClient();if(!r.success)return r;let n=await r.data.getAssetCompliance(e);if(!n.success){let a=n.error.statusCode===404?"not_found":"api_error";return v(new Bp(b(n.error.message),a,n.error))}return A(n.data)}}});import*as Qi from"fs";import*as Z2 from"path";import{homedir as Qyt}from"os";function yOe(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function tvt(t){return yOe(t)?typeof t.awsAccountId=="string"&&typeof t.accountName=="string"&&typeof t.status=="string"&&typeof t.role=="string"&&typeof t.connectedAt=="string":!1}function rvt(t){return yOe(t)?typeof t.fetchedAt=="string"&&typeof t.organisationId=="string"&&Array.isArray(t.accounts)&&t.accounts.every(tvt):!1}var evt,Sv,lee=E(()=>{"use strict";ee();Q();B();evt=Z2.join(Qyt(),".fjall","connections.json");Sv=class{cacheFile;constructor(e){this.cacheFile=e??evt}get(e){try{if(!Qi.existsSync(this.cacheFile))return null;let r=JSON.parse(Qi.readFileSync(this.cacheFile,"utf-8"));if(!rvt(r)||r.organisationId!==e)return null;let n=new Date(r.fetchedAt).getTime();return Date.now()-n>300*1e3?null:r.accounts}catch(r){return k.debug("ConnectionCache","Cache read failed",{error:P(r)}),null}}set(e,r){try{let n=Z2.dirname(this.cacheFile);Qi.existsSync(n)||Qi.mkdirSync(n,{recursive:!0,mode:448});let a={accounts:r,fetchedAt:new Date().toISOString(),organisationId:e},o=`${this.cacheFile}.tmp`;Qi.writeFileSync(o,JSON.stringify(a,null,2),{mode:384}),Qi.renameSync(o,this.cacheFile)}catch(n){k.warn("ConnectionCache","Failed to write cache",{error:b(P(n))})}}invalidate(){try{Qi.existsSync(this.cacheFile)&&Qi.unlinkSync(this.cacheFile)}catch(e){k.debug("ConnectionCache","Failed to invalidate cache",{error:P(e)})}}}});function nvt(t,e){return{awsAccountId:jd,accountName:t??jd,status:jd,role:"account",roleArn:jd,connectedAt:new Date().toISOString(),quickCreateUrl:e}}var Up,wA,vOe=E(()=>{"use strict";se();kt();Vr();Wb();Jk();Gr();Q();ee();lee();oF();kn();B();Up=class extends _e{constructor(e,r){super("CONNECT_ERROR",e,r,!1)}};wA=class{oidcSetup;oidcBootstrap;cache;constructor(e,r,n){this.oidcSetup=e??new Sp,this.oidcBootstrap=n??new zd(this.oidcSetup),this.cache=r??new Sv}async hasActiveConnection(){let e=Ke.fromCredentials();if(!e)return v(new Up("Not logged in. Run 'fjall login' first."));let r=await e.getIdentity();r.success||k.warn("Connect","Identity resolution failed, cache operations skipped",{error:b(P(r.error))});let n=await e.getConnectedAccounts();if(!n.success){if(r.success){let s=this.cache.get(r.data.organisationId);if(s&&s.length>0)return k.debug("Connect","Using cached connections (API unreachable)"),A(s)}let o=r.success?"":` (identity resolution also failed: ${b(P(r.error))})`;return v(new Up(`Failed to check connections: ${b(P(n.error))}${o}`))}let a=n.data.accounts;return r.success&&r.data.organisationId!==void 0&&this.cache.set(r.data.organisationId,a),A(a)}async connect(e,r,n,a,o){let s=new Me(r),i=e??Ye,c=n??"production",l=Ke.fromCredentials();if(!l)return v(new Up("Not logged in. Run 'fjall login' first."));let u=await l.getIdentity();if(!u.success){let y=u.error,S=y.statusCode?` (HTTP ${y.statusCode}: ${y.message})`:` (${y.message})`,x;return y.errorType==="not_authenticated"||y.statusCode===401?x="Your API key may be invalid or expired. Run 'fjall login --force' to re-authenticate.":y.errorType==="permission_denied"||y.statusCode===403?x="Your account does not have an active organisation. Sign in at the webapp to create one, or check your organisation membership.":y.errorType==="network_error"||y.errorType==="timeout"?x="Could not reach the Fjall API. Check your internet connection and try again.":x="Run 'fjall login --force' to re-authenticate, or check your organisation membership at the webapp.",k.debug("Connect","Identity resolution failed in connect()",{errorType:y.errorType,statusCode:y.statusCode,message:y.message}),v(new Up(`${x}${S}`))}let p=o?.force===!0,m=!1;if(!p){s.info("Checking existing AWS connections...");let y=await this.hasActiveConnection();if(y.success&&(m=!0,r?.onExistingConnectionsFound?.(y.data),y.data.length>0)){let S=Vb(y.data,c);if(S)return A({awsAccountId:S.awsAccountId,accountName:S.accountName,status:"active",role:S.role,roleArn:S.roleArn,connectedAt:new Date().toISOString()})}}s.step("Setting up AWS connection...");let d=await this.oidcBootstrap.establishOidcTrust(i,c,a,r,{skipWait:o?.skipWait,skipExistingCheck:p||m});if(!d.success)return v(new Up(`Connection failed: ${b(P(d.error))}`,d.error));let f=d.data;if(f.quickCreateUrl!==void 0)return A(nvt(a,f.quickCreateUrl));let h={awsAccountId:f.awsAccountId,accountName:f.accountName,status:"active",role:"account",roleArn:f.roleArn,connectedAt:new Date().toISOString()};return this.cache.invalidate(),A(h)}async ensureConnection(e){let r=await this.hasActiveConnection();if(r.success&&r.data.length>0)return r;new Me(e).warning("No AWS connection found. Starting connection setup...");let n=await this.connect(void 0,e);return n.success?A([n.data]):v(n.error)}}});var uee=E(()=>{"use strict";vOe();lee()});function pee(t){if(!t)return!1;let e=/Number of stacks with differences:\s*(\d+)/,r=t.match(e);if(r&&r[1]){let n=parseInt(r[1],10);if(!isNaN(n))return n>0}return!t.split(`
841
841
  `).filter(n=>n.trim().startsWith("Stack")).every(n=>n.includes("There were no differences"))}function dee(t){let e={hasSecurityChanges:t.includes("(requires replacement)")||t.includes("IAM Statement Changes"),resourceChanges:0,outputChanges:0,resources:[]},r=t.match(/\[\+\]|\[-\]|\[~\]/g);return r&&(e.resourceChanges=r.length),e}var SOe=E(()=>{"use strict"});var EOe=E(()=>{"use strict";CK();SOe();qJ();YJ();KJ();Sr();s2();GJ();VJ()});var Wd={};Dt(Wd,{AppIdentityError:()=>bA,AppIdentityService:()=>xA,AppQueryError:()=>lh,AppQueryService:()=>AA,AssetQueryError:()=>Bp,AssetQueryService:()=>CA,AwsAccountService:()=>WP,AwsOrgAccountProvisioningService:()=>d_,AwsOrgProvisioningService:()=>p_,CdkService:()=>ml,CloudFormationService:()=>eA,ConnectError:()=>Up,ConnectService:()=>wA,ConnectionCache:()=>Sv,CreateError:()=>ft,CreateService:()=>ux,DeploymentService:()=>rx,DeploymentTracker:()=>kc,DiscoveryService:()=>YP,DockerError:()=>Io,DomainError:()=>Xi,DomainService:()=>w_,EcrError:()=>St,EcrService:()=>wP,EcsDeploymentError:()=>lv,EcsDeploymentService:()=>oA,EcsService:()=>tA,FjallApiClient:()=>Ke,GeneratorService:()=>GP,ImportError:()=>Kn,ImportService:()=>KP,InfrastructureIntrospectionService:()=>HP,ListError:()=>JL,ListService:()=>dP,LoginError:()=>Pa,LoginService:()=>zb,ManifestError:()=>gv,ManifestService:()=>a_,MonitoringMetadataError:()=>Ji,MonitoringMetadataService:()=>u_,NPM_INSTALL_TIMEOUT_MS:()=>_7,NPM_MAX_BUFFER_BYTES:()=>D7,OPENNEXT_CONFIG_FILENAME:()=>T2,OidcBootstrapService:()=>zd,OidcSetupError:()=>Ua,OidcSetupService:()=>Sp,OpenNextError:()=>Xa,OpenNextService:()=>QP,OrgConfigCache:()=>Gb,OrgConfigClient:()=>Ho,OrgConfigError:()=>Ey,OrganisationService:()=>jP,PayloadConfigError:()=>na,PayloadConfigService:()=>l_,ProfileService:()=>Hb,ProfileValidationService:()=>qb,RdsSnapshotService:()=>A_,ReportVersionService:()=>E_,RestoreError:()=>fa,RestoreService:()=>JP,SecretManagerService:()=>f_,SecretsError:()=>wt,SecretsService:()=>n_,StepRegistry:()=>uo,TEMPLATES:()=>uI,TemplateHashService:()=>_u,TunnelDiscoveryService:()=>SA,TunnelError:()=>ha,TunnelService:()=>C_,UserError:()=>Bt,UserGroupService:()=>Vd,UserService:()=>Yb,VALID_TIERS:()=>nx,ValidationService:()=>qx,VersionCheckError:()=>S_,VersionError:()=>nh,VersionService:()=>qP,buildNpmInstallError:()=>Ty,fetchEntitlements:()=>Av,formatInfrastructureError:()=>dl,getAccountService:()=>qX,getAppIdentityService:()=>rI,getAppQueryService:()=>IA,getAssetQueryService:()=>PA,getAwsOrgAccountProvisioningService:()=>dvt,getAwsOrgProvisioningService:()=>LP,getCdkService:()=>pv,getCliDockerProvider:()=>nI,getCloudFormationService:()=>Ss,getConnectService:()=>xv,getCreateService:()=>TA,getDeploymentService:()=>Ev,getDiscoveryService:()=>xOe,getDockerCli:()=>tv,getDockerConfigService:()=>Nf,getDomainService:()=>Vi,getEcrService:()=>T_,getEcsDeploymentService:()=>pvt,getEcsService:()=>svt,getGeneratorService:()=>Pn,getImportService:()=>pm,getInfrastructureIntrospectionService:()=>bOe,getListService:()=>J2,getLoginService:()=>Dl,getManifestService:()=>Dc,getMonitoringMetadataService:()=>_f,getNpmAuthErrorMessage:()=>ox,getOidcBootstrapService:()=>uvt,getOidcSetupService:()=>AOe,getOpenNextService:()=>YX,getOrgConfigClient:()=>po,getOrganisationService:()=>wF,getPayloadConfigService:()=>lRe,getProfileService:()=>lI,getProfileValidationService:()=>avt,getRdsSnapshotService:()=>cvt,getReportVersionService:()=>uh,getRequiredSecretsFromManifest:()=>t_,getRestoreService:()=>dm,getSecretManagerService:()=>lvt,getSecretsService:()=>Qs,getSourceContext:()=>hy,getStructuralHint:()=>fy,getTemplateHashService:()=>JX,getTunnelService:()=>kA,getUserGroupService:()=>ovt,getUserService:()=>bv,getValidationService:()=>_n,getVersionService:()=>ivt,getVersionUpdate:()=>vn,hasCdkDifferences:()=>pee,isCdkError:()=>Af,isNpmAuthError:()=>hI,parseDiffOutput:()=>dee,resolveTemplate:()=>pI,runNpmInstallWithAuth:()=>sx,synthesiseHealth:()=>iee,tryNpmInstall:()=>ky,validateSecretsExist:()=>_2});async function Av(){let t=Ke.fromCredentials();if(!t)return null;let e=await t.getEntitlements();return e.success?e.data:null}function vn(){return uh().getUpdate()??void 0}var Ev,TA,lI,avt,Ss,_n,bv,ovt,J2,pv,T_,svt,tv,nI,wF,Dl,qX,bOe,Pn,ivt,xOe,pm,dm,po,cvt,kA,Vi,YX,lvt,Qs,JX,Dc,AOe,uvt,rI,IA,PA,_f,pvt,LP,dvt,xv,uh,Se=E(()=>{"use strict";T7();Iy();Qk();QK();GJ();lF();eI();XL();qJ();KJ();YJ();oPe();EX();lPe();MX();YPe();aF();n_e();s2();VP();x_e();eQ();oQ();B_e();H_e();XP();kQ();gDe();IQ();z2();Wb();Jk();VQ();KX();yRe();vRe();HQ();eee();If();pOe();mOe();tee();ree();see();cee();Y2();uee();B();Vr();z2();ree();q2();EOe();see();cee();Y2();Vr();Iy();eI();lF();aF();XL();eQ();oQ();DF();C2();XP();kQ();EQ();IQ();z2();uee();Wb();Jk();If();XK();VQ();Cy();kl();im();eee();LX();bP();Ev=bt(()=>new rx),TA=bt(()=>ux.createUnsafe()),lI=bt(()=>new Hb),avt=bt(()=>new qb),Ss=bt(()=>new eA),_n=bt(()=>new qx),bv=bt(()=>new Yb),ovt=bt(()=>new Vd),J2=bt(()=>new dP),pv=bt(()=>{let t=new Zs,e=new fP(t);return new ml({processManager:e})}),T_=bt(()=>new wP),svt=bt(()=>new tA),tv=bt(()=>new PP({logger:cPe()})),nI=bt(()=>new u2(tv(),T_())),wF=bt(()=>new jP),Dl=bt(()=>new zb),qX=bt(()=>new WP),bOe=bt(()=>new HP),Pn=bt(()=>new GP(bOe())),ivt=bt(()=>new qP),xOe=bt(()=>new YP),pm=bt(()=>new KP(pv(),xOe())),dm=bt(()=>new JP),po=bt(()=>new Ho),cvt=bt(()=>new A_),kA=bt(()=>new C_),Vi=bt(()=>new w_),YX=bt(()=>new QP),lvt=bt(()=>new f_),Qs=bt(()=>new n_),JX=bt(()=>new _u),Dc=bt(()=>new a_),AOe=bt(()=>new Sp),uvt=bt(()=>new zd(AOe())),rI=bt(()=>new xA),IA=bt(()=>new AA),PA=bt(()=>new CA),_f=bt(()=>new u_),pvt=bt(()=>new oA),LP=bt(()=>new p_),dvt=bt(()=>new d_),xv=bt(()=>new wA),uh=bt(()=>new E_)});function hvt(){return process.env.FJALL_PALETTE==="daltonised"?"daltonised":"standard"}var COe,mvt,fvt,wOe,I,Jo=E(()=>{"use strict";COe={primary:"#0A9396",fjallPink:"#FF7BFF",iconBrown:"#78290F",summitBlush:"#FFECD1",secondary:"#47817E",completed:"#90a955",success:"#A4C2A5",warning:"#FFA500",error:"#AE2012",info:"#0A9396",muted:"#808080",white:"#E8E8EA",black:"#000000",dim:"#666666",border:"#FF7D00",deployYellow:"#F2CC8F",deployGreen:"#81B29A",deployText:"#F4F1DE"},mvt={primary:"#0A9396",fjallPink:"#CC79A7",iconBrown:"#78290F",summitBlush:"#FFECD1",secondary:"#47817E",completed:"#0072B2",success:"#56B4E9",warning:"#E69F00",error:"#D55E00",info:"#0A9396",muted:"#808080",white:"#E8E8EA",black:"#000000",dim:"#666666",border:"#E69F00",deployYellow:"#E69F00",deployGreen:"#56B4E9",deployText:"#F4F1DE"},fvt={standard:COe,daltonised:mvt},wOe="standard";wOe=hvt();I=Object.freeze({colours:new Proxy(COe,{get(t,e){return fvt[wOe][e]}}),text:{prompt:t=>t,hint:t=>t,error:t=>`Error: ${t}`,success:t=>t,warning:t=>`Warning: ${t}`},icons:{selected:"\u2192",unselected:" ",spinner:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},spacing:{small:1,medium:2,large:3}})});import{existsSync as gvt}from"node:fs";function yvt(t){try{return gvt(t)}catch(e){return k.debug("Agent","safeExistsSync swallowed error",{path:t,error:e instanceof Error?e.message:String(e)}),!1}}function Svt(){if(k_!==null)return k_;for(let t of vvt)if(t.detect())return k_={name:t.name,detected:!0},k_;k_=void 0}function X2(t){return t?.agent===!0?!0:t?.agent===!1||Svt()===void 0?!1:!process.stdout.isTTY}var vvt,k_,mee=E(()=>{"use strict";ee();vvt=[{name:"claude-code",detect:()=>!!process.env.CLAUDECODE||!!process.env.CLAUDE_CODE},{name:"cowork",detect:()=>!!process.env.CLAUDE_CODE_IS_COWORK},{name:"codex",detect:()=>!!process.env.CODEX_SANDBOX||!!process.env.CODEX_CI||!!process.env.CODEX_THREAD_ID},{name:"cursor",detect:()=>!!process.env.CURSOR_TRACE_ID||!!process.env.CURSOR_AGENT||process.env.CURSOR_EXTENSION_HOST_ROLE==="agent-exec"},{name:"gemini",detect:()=>!!process.env.GEMINI_CLI},{name:"copilot",detect:()=>!!process.env.COPILOT_MODEL||!!process.env.COPILOT_ALLOW_ALL||!!process.env.COPILOT_GITHUB_TOKEN},{name:"devin",detect:()=>yvt("/opt/.devin")},{name:"replit",detect:()=>!!process.env.REPL_ID},{name:"augment",detect:()=>!!process.env.AUGMENT_AGENT},{name:"opencode",detect:()=>!!process.env.OPENCODE_CLIENT},{name:"generic",detect:()=>!!process.env.AI_AGENT}],k_=null});function xe(t){return X2(t)}function I_(t){return xe(t)?!0:t?.nonInteractive||!process.stdout.isTTY}var sr=E(()=>{"use strict";mee()});function TOe(t){if(t==null||typeof t!="object")return;let e=("name"in t&&typeof t.name=="string"?t.name:void 0)??t.constructor?.name;if(e===void 0||e==="Error")return;let r=Evt[e];if(r===void 0)return;let n=bvt[e];if(n!==void 0){let a="errorType"in t&&typeof t.errorType=="string"?t.errorType:"code"in t&&typeof t.code=="string"?t.code:"operation"in t&&typeof t.operation=="string"?t.operation:void 0;if(a!==void 0&&n[a]!==void 0)return n[a]}return r}var Evt,bvt,kOe=E(()=>{"use strict";Evt={AppQueryError:"NOT_FOUND",SecretsError:"VALIDATION_ERROR",UserError:"VALIDATION_ERROR",ApiError:"UNKNOWN",AuthenticationError:"AUTH_REQUIRED",CloudFormationError:"AWS_ERROR",CredentialError:"AUTH_REQUIRED",DeploymentError:"DEPLOY_FAILED",ValidationError:"VALIDATION_ERROR",ZodError:"VALIDATION_ERROR",DomainError:"NOT_FOUND",CreateError:"VALIDATION_ERROR",RestoreError:"AWS_ERROR",ImportError:"NOT_FOUND",MonitoringMetadataError:"UNKNOWN"},bvt={AppQueryError:{not_found:"NOT_FOUND",api_error:"NETWORK_ERROR",credential_error:"AUTH_REQUIRED",general:"UNKNOWN"},SecretsError:{not_found:"NOT_FOUND",invalid_namespace:"VALIDATION_ERROR",general:"UNKNOWN"},UserError:{not_found:"NOT_FOUND",already_exists:"CONFLICT",general:"UNKNOWN"},DomainError:{not_found:"NOT_FOUND",already_exists:"CONFLICT",parse_error:"VALIDATION_ERROR",deploy_error:"DEPLOY_FAILED",verification_error:"TIMEOUT",validation_error:"VALIDATION_ERROR",import_error:"AWS_ERROR",export_error:"AWS_ERROR"},CreateError:{already_exists:"CONFLICT",not_found:"NOT_FOUND",generation_error:"UNKNOWN",dependency_error:"UNKNOWN",validation_error:"VALIDATION_ERROR",authentication_error:"AUTH_REQUIRED"},RestoreError:{not_found:"NOT_FOUND",permission_denied:"FORBIDDEN",validation_error:"VALIDATION_ERROR",aws_error:"AWS_ERROR",no_recovery_points:"NOT_FOUND"},ImportError:{APP_NOT_FOUND:"NOT_FOUND",MISSING_INFRASTRUCTURE_FILE:"NOT_FOUND",NO_RESOURCES:"NOT_FOUND",NO_RESOURCES_SELECTED:"VALIDATION_ERROR",MULTIPLE_RESOURCES:"VALIDATION_ERROR",DISCOVERY_FAILED:"AWS_ERROR",GENERATION_FAILED:"AWS_ERROR",SYNTHESIS_FAILED:"AWS_ERROR",MAPPING_FAILED:"AWS_ERROR",CDK_IMPORT_FAILED:"AWS_ERROR",IMPORT_FAILED:"AWS_ERROR"},MonitoringMetadataError:{captureMonitoringMetadata:"AWS_ERROR",sendMonitoringMetadata:"NETWORK_ERROR"}}});function _A(t){let e=TOe(t);if(e!==void 0)return e;let r=fee(t);if(r==="")return"UNKNOWN";for(let{pattern:n,code:a}of xvt)if(n.test(r))return a;return"UNKNOWN"}function P_(t){return Avt.has(t)}function fee(t){if(t==null)return"";if(typeof t=="string")return t;if(t instanceof Error)return t.message;if(typeof t=="object"&&"message"in t){let e=t.message;return typeof e=="string"?e:String(e)}return String(t)}var xvt,Avt,Q2=E(()=>{"use strict";kOe();xvt=[{pattern:/throttl|rate.?limit/i,code:"RATE_LIMITED"},{pattern:/buildx (?:unavailable|not (?:installed|found))|docker buildx version/i,code:"BUILDX_UNAVAILABLE"},{pattern:/token.+(expired|invalid)|session.+expired/i,code:"AUTH_EXPIRED"},{pattern:/already authenticated/i,code:"CONFLICT"},{pattern:/not.?logged.?in|no.+credentials|authenticat/i,code:"AUTH_REQUIRED"},{pattern:/access.?denied|not authorized to|forbidden/i,code:"FORBIDDEN"},{pattern:/no.+aws.+account/i,code:"NO_AWS_ACCOUNT"},{pattern:/network|econnrefused|etimedout|enotfound/i,code:"NETWORK_ERROR"},{pattern:/timed.?out|timeout/i,code:"TIMEOUT"},{pattern:/already exists/i,code:"CONFLICT"},{pattern:/not.?found|does not exist/i,code:"NOT_FOUND"},{pattern:/cloudformation|cfn|^aws\.|aws::|resourcenotready/i,code:"AWS_ERROR"},{pattern:/validation failed|invalid parameter|is required/i,code:"VALIDATION_ERROR"}],Avt=new Set(["AUTH_REQUIRED","AUTH_EXPIRED","FORBIDDEN","BUILDX_UNAVAILABLE"])});function _Oe(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}function kvt(t){return t===Cvt||t===wvt||t===POe}function mm(t){if(t===null)return null;if(typeof t=="object"&&t!==null&&"toJSON"in t&&typeof t.toJSON=="function"){let e=t.toJSON();if(e!==t)return mm(e)}if(typeof t=="string"||typeof t=="boolean")return t;if(typeof t=="number")return Object.is(t,-0)?0:Number.isFinite(t)?t:null;if(typeof t=="bigint")return t>=Number.MIN_SAFE_INTEGER&&t<=Number.MAX_SAFE_INTEGER?Number(t):t.toString();if(t instanceof Date)return t.toISOString();if(Array.isArray(t))return t.map(mm);if(t instanceof Set)return Array.from(t).map(mm);if(t instanceof Map)return Object.fromEntries(Array.from(t,([e,r])=>[String(e),mm(r)]));if(Ivt(t)){let e={};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=mm(t[r]));return e}return null}function Cv(t){return t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function ph(t){return Array.isArray(t)}function zu(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function __(t){return Object.keys(t).length===0}function Ivt(t){if(t===null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function D_(t){return t.length===0||t.every(e=>Cv(e))}function Pvt(t){return t.length===0||t.every(e=>ph(e))}function DOe(t){return t.length===0||t.every(e=>zu(e))}function _vt(t){return/^[A-Z_][\w.]*$/i.test(t)}function Dvt(t){return/^[A-Z_]\w*$/i.test(t)}function Rvt(t,e=O_){return!(!t||t!==t.trim()||kvt(t)||Ovt(t)||t.includes(":")||t.includes('"')||t.includes("\\")||/[[\]{}]/.test(t)||/[\n\r\t]/.test(t)||t.includes(e)||t.startsWith("-"))}function Ovt(t){return/^-?\d+(?:\.\d+)?(?:e[+-]?\d+)?$/i.test(t)||/^0\d+$/.test(t)}function Nvt(t,e,r,n,a,o,s){if(n.keyFolding!=="safe"||!zu(e))return;let{segments:i,tail:c,leafValue:l}=$vt(t,e,s??n.flattenDepth);if(i.length<2||!i.every(m=>Dvt(m)))return;let u=Mvt(i),p=o?`${o}.${u}`:u;if(!r.includes(u)&&!(a&&a.has(p)))return{foldedKey:u,remainder:c,leafValue:l,segmentCount:i.length}}function $vt(t,e,r){let n=[t],a=e;for(;n.length<r&&zu(a);){let o=Object.keys(a);if(o.length!==1)break;let s=o[0],i=a[s];n.push(s),a=i}return!zu(a)||__(a)?{segments:n,tail:void 0,leafValue:a}:{segments:n,tail:a,leafValue:a}}function Mvt(t){return t.join(".")}function RA(t,e){return t===null?POe:typeof t=="boolean"||typeof t=="number"?String(t):Fvt(t,e)}function Fvt(t,e=O_){return Rvt(t,e)?t:`"${_Oe(t)}"`}function R_(t){return _vt(t)?t:`"${_Oe(t)}"`}function ROe(t,e=O_){return t.map(r=>RA(r,e)).join(e)}function fm(t,e){let r=e?.key,n=e?.fields,a=e?.delimiter??",",o="";if(r&&(o+=R_(r)),o+=`[${t}${a!==O_?a:""}]`,n){let s=n.map(i=>R_(i));o+=`{${s.join(a)}}`}return o+=":",o}function*Lvt(t,e,r){if(Cv(t)){let n=RA(t,e.delimiter);n!==""&&(yield n);return}ph(t)?yield*hee(void 0,t,r,e):zu(t)&&(yield*DA(t,r,e))}function*DA(t,e,r,n,a,o){let s=Object.keys(t);e===0&&!n&&(n=new Set(s.filter(c=>c.includes("."))));let i=o??r.flattenDepth;for(let[c,l]of Object.entries(t))yield*Bvt(c,l,e,r,s,n,a,i)}function*Bvt(t,e,r,n,a,o,s,i){let c=s?`${s}.${t}`:t,l=i??n.flattenDepth;if(n.keyFolding==="safe"&&a){let p=Nvt(t,e,a,n,o,s,l);if(p){let{foldedKey:m,remainder:d,leafValue:f,segmentCount:h}=p,y=R_(m);if(d===void 0){if(Cv(f)){yield Oc(r,`${y}: ${RA(f,n.delimiter)}`,n.indent);return}else if(ph(f)){yield*hee(m,f,r,n);return}else if(zu(f)&&__(f)){yield Oc(r,`${y}:`,n.indent);return}}if(zu(d)){yield Oc(r,`${y}:`,n.indent);let S=l-h,x=s?`${s}.${m}`:m;yield*DA(d,r+1,n,o,x,S);return}}}let u=R_(t);Cv(e)?yield Oc(r,`${u}: ${RA(e,n.delimiter)}`,n.indent):ph(e)?yield*hee(t,e,r,n):zu(e)&&(yield Oc(r,`${u}:`,n.indent),__(e)||(yield*DA(e,r+1,n,o,c,l)))}function*hee(t,e,r,n){if(e.length===0){yield Oc(r,fm(0,{key:t,delimiter:n.delimiter}),n.indent);return}if(D_(e)){yield Oc(r,tB(e,n.delimiter,t),n.indent);return}if(Pvt(e)&&e.every(a=>D_(a))){yield*Uvt(t,e,r,n);return}if(DOe(e)){let a=OOe(e);a?yield*jvt(t,e,a,r,n):yield*IOe(t,e,r,n);return}yield*IOe(t,e,r,n)}function*Uvt(t,e,r,n){yield Oc(r,fm(e.length,{key:t,delimiter:n.delimiter}),n.indent);for(let a of e)if(D_(a)){let o=tB(a,n.delimiter);yield jp(r+1,o,n.indent)}}function tB(t,e,r){let n=fm(t.length,{key:r,delimiter:e}),a=ROe(t,e);return t.length===0?n:`${n} ${a}`}function*jvt(t,e,r,n,a){yield Oc(n,fm(e.length,{key:t,fields:r,delimiter:a.delimiter}),a.indent),yield*NOe(e,r,n+1,a)}function OOe(t){if(t.length===0)return;let e=t[0],r=Object.keys(e);if(r.length!==0&&zvt(t,r))return r}function zvt(t,e){for(let r of t){if(Object.keys(r).length!==e.length)return!1;for(let n of e)if(!(n in r)||!Cv(r[n]))return!1}return!0}function*NOe(t,e,r,n){for(let a of t)yield Oc(r,ROe(e.map(o=>a[o]),n.delimiter),n.indent)}function*IOe(t,e,r,n){yield Oc(r,fm(e.length,{key:t,delimiter:n.delimiter}),n.indent);for(let a of e)yield*gee(a,r+1,n)}function*Wvt(t,e,r){if(__(t)){yield Oc(e,"-",r.indent);return}let n=Object.entries(t),[a,o]=n[0],s=n.slice(1);if(ph(o)&&DOe(o)){let c=OOe(o);if(c){yield jp(e,fm(o.length,{key:a,fields:c,delimiter:r.delimiter}),r.indent),yield*NOe(o,c,e+2,r),s.length>0&&(yield*DA(Object.fromEntries(s),e+1,r));return}}let i=R_(a);if(Cv(o))yield jp(e,`${i}: ${RA(o,r.delimiter)}`,r.indent);else if(ph(o))if(o.length===0)yield jp(e,`${i}${fm(0,{delimiter:r.delimiter})}`,r.indent);else if(D_(o))yield jp(e,`${i}${tB(o,r.delimiter)}`,r.indent);else{yield jp(e,`${i}${fm(o.length,{delimiter:r.delimiter})}`,r.indent);for(let c of o)yield*gee(c,e+2,r)}else zu(o)&&(yield jp(e,`${i}:`,r.indent),__(o)||(yield*DA(o,e+2,r)));s.length>0&&(yield*DA(Object.fromEntries(s),e+1,r))}function*gee(t,e,r){if(Cv(t))yield jp(e,RA(t,r.delimiter),r.indent);else if(ph(t))if(D_(t))yield jp(e,tB(t,r.delimiter),r.indent);else{yield jp(e,fm(t.length,{delimiter:r.delimiter}),r.indent);for(let n of t)yield*gee(n,e+1,r)}else zu(t)&&(yield*Wvt(t,e,r))}function Oc(t,e,r){return" ".repeat(r*t)+e}function jp(t,e,r){return Oc(t,"- "+e,r)}function Vvt(t,e){let r=e("",t,[]);return r===void 0?eB(t,e,[]):eB(mm(r),e,[])}function eB(t,e,r){return zu(t)?Gvt(t,e,r):ph(t)?Hvt(t,e,r):t}function Gvt(t,e,r){let n={};for(let[a,o]of Object.entries(t)){let s=[...r,a],i=e(a,o,s);i!==void 0&&(n[a]=eB(mm(i),e,s))}return n}function Hvt(t,e,r){let n=[];for(let a=0;a<t.length;a++){let o=t[a],s=[...r,a],i=e(String(a),o,s);if(i===void 0)continue;let c=mm(i);n.push(eB(c,e,s))}return n}function N_(t,e){return Array.from(qvt(t,e)).join(`
842
842
  `)}function qvt(t,e){let r=mm(t),n=Kvt(e);return Lvt(n.replacer?Vvt(r,n.replacer):r,n,0)}function Kvt(t){return{indent:t?.indent??2,delimiter:t?.delimiter??O_,keyFolding:t?.keyFolding??"off",flattenDepth:t?.flattenDepth??Number.POSITIVE_INFINITY,replacer:t?.replacer}}var POe,Cvt,wvt,Tvt,O_,$Oe=E(()=>{POe="null",Cvt="true",wvt="false",Tvt={comma:",",tab:" ",pipe:"|"},O_=Tvt.comma});function Yvt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&Object.keys(t).length>0}function MOe(t){return N_(t)}function FOe(t){return Yvt(t)?N_(t):""}function LOe(t,e,r){let n=r?.entity??"items",a=t.map(s=>e.project(s)),o={[n]:a,...r?.aggregates??{}};return N_(o)}function nB(t){let e=[];if(e.push(`error: ${rB(t.message)}`),e.push(`code: ${t.code}`),t.userActionRequired!==void 0&&e.push(`userActionRequired: ${t.userActionRequired}`),t.details!==void 0&&Object.keys(t.details).length>0){let r=MOe(t.details).split(`
843
843
  `).map(n=>` ${n}`).join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fjall",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "Fjall CLI",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -43,7 +43,7 @@
43
43
  "typescript": "^6.0.3"
44
44
  },
45
45
  "devDependencies": {
46
- "@fjall/cli": "^2.4.0",
46
+ "@fjall/cli": "^2.4.1",
47
47
  "esbuild": "^0.28.0",
48
48
  "vitest": "^4.1.5"
49
49
  },
@@ -62,5 +62,5 @@
62
62
  "engines": {
63
63
  "node": ">=22.0.0"
64
64
  },
65
- "gitHead": "241280ece4e8e3caf88bc344e3f79dd38cee0b09"
65
+ "gitHead": "164e50a0f9097678d2eb8f03c7a192652de0b0a2"
66
66
  }