cdk-insights 0.15.0 → 0.15.2

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.
@@ -1,129 +1,75 @@
1
- "use strict";var VL=Object.create;var Ia=Object.defineProperty;var WL=Object.getOwnPropertyDescriptor;var ZL=Object.getOwnPropertyNames;var KL=Object.getPrototypeOf,JL=Object.prototype.hasOwnProperty;var C=(e,t)=>()=>(e&&(t=e(e=0)),t);var b=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),dt=(e,t)=>{for(var r in t)Ia(e,r,{get:t[r],enumerable:!0})},Wh=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ZL(t))!JL.call(e,s)&&s!==r&&Ia(e,s,{get:()=>t[s],enumerable:!(n=WL(t,s))||n.enumerable});return e};var P=(e,t,r)=>(r=e!=null?VL(KL(e)):{},Wh(t||!e||!e.__esModule?Ia(r,"default",{value:e,enumerable:!0}):r,e)),re=e=>Wh(Ia({},"__esModule",{value:!0}),e);var bu=b(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.createJsonFormatter=void 0;var YL=e=>{switch(e){case 0:return"DEBUG";case 1:return"INFO";case 2:return"WARN";case 3:return"ERROR";case 4:return"FATAL";default:return"UNKNOWN"}},QL=()=>({format:e=>JSON.stringify({timestamp:e.timestamp,level:YL(e.level),message:e.message,...e.context,...e.error&&{error:{name:e.error.name,message:e.error.message,stack:e.error.stack}},...e.metadata&&{metadata:e.metadata}})});Aa.createJsonFormatter=QL});var Ft=b(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.LogLevel=void 0;var Zh;(function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.FATAL=4]="FATAL"})(Zh||(Oa.LogLevel=Zh={}))});var ur=b(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.shouldLog=Ls.BaseTransport=void 0;var XL=Ft(),wu=class{constructor(){this.level=XL.LogLevel.INFO}setLevel(t){this.level=t}getLevel(){return this.level}shouldLog(t){return t>=this.level}};Ls.BaseTransport=wu;var ek=(e,t)=>e>=t;Ls.shouldLog=ek});var Ra=b(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.createConsoleTransport=void 0;var ks=Ft(),tk=ur(),rk=(e={})=>{let t=e.level??ks.LogLevel.INFO,r=e.formatter||{format:n=>JSON.stringify(n)};return{log:n=>{if(!(0,tk.shouldLog)(n.level,t))return;let s=r.format(n);switch(n.level){case ks.LogLevel.DEBUG:console.debug(s);break;case ks.LogLevel.INFO:console.info(s);break;case ks.LogLevel.WARN:console.warn(s);break;case ks.LogLevel.ERROR:case ks.LogLevel.FATAL:console.error(s);break}},setLevel:n=>{t=n},getLevel:()=>t}};Da.createConsoleTransport=rk});var Tu=b(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.createBatchedLogger=xn.createBatchedTransport=void 0;var nk=(e,t={maxSize:100,maxWaitTime:5e3,maxBatchSize:1024*1024})=>{let r={logs:[],currentSize:0,lastFlush:Date.now()},n={totalLogs:0,totalBatches:0,averageBatchSize:0,lastFlushTime:0,pendingLogs:0},s=u=>u.reduce((m,p)=>m+JSON.stringify(p).length,0),o=async()=>{if(r.logs.length===0)return;let u=[...r.logs];r.logs=[],r.currentSize=0,r.lastFlush=Date.now(),r.flushTimer&&(clearTimeout(r.flushTimer),r.flushTimer=void 0);try{await Promise.allSettled(u.map(m=>e.log(m))),n.totalLogs+=u.length,n.totalBatches+=1,n.averageBatchSize=n.totalLogs/n.totalBatches,n.lastFlushTime=Date.now(),n.pendingLogs=r.logs.length}catch(m){console.error("Batch flush failed:",m),r.logs.unshift(...u),r.currentSize=s(r.logs)}},i=()=>{r.flushTimer||(r.flushTimer=setTimeout(()=>{o().catch(console.error)},t.maxWaitTime))};return{log:async u=>{let m=JSON.stringify(u).length;(r.logs.length>=t.maxSize||r.currentSize+m>=t.maxBatchSize)&&await o(),r.logs.push(u),r.currentSize+=m,n.pendingLogs=r.logs.length,r.logs.length===1&&i()},setLevel:u=>{e.setLevel(u)},getLevel:()=>e.getLevel(),flush:o,getStats:()=>({...n,pendingLogs:r.logs.length})}};xn.createBatchedTransport=nk;var sk=(e,t={maxSize:50,maxWaitTime:2e3,maxBatchSize:512*1024})=>{let r=e.map(c=>(0,xn.createBatchedTransport)(c,t));return{log:async c=>{await Promise.allSettled(r.map(d=>d.log(c)))},setLevel:c=>{for(let d of r)d.setLevel(c)},getLevel:()=>Math.min(...r.map(c=>c.getLevel())),flush:async()=>{await Promise.allSettled(r.map(c=>c.flush()))},getStats:()=>r.map(c=>c.getStats())}};xn.createBatchedLogger=sk});var Pu=b(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.createDefaultEnrichmentMiddleware=ie.createEnrichmentMiddleware=ie.createLoggerInstanceEnricher=ie.createUserEnricher=ie.createEnvironmentEnricher=ie.createSessionEnricher=ie.createCorrelationEnricher=ie.generateLoggerInstanceId=ie.generateSpanId=ie.generateTraceId=ie.generateCorrelationId=void 0;var ok=()=>`corr_${Date.now()}_${Math.random().toString(36).substr(2,9)}`;ie.generateCorrelationId=ok;var ik=()=>Math.random().toString(16).substr(2,32);ie.generateTraceId=ik;var ak=()=>Math.random().toString(16).substr(2,16);ie.generateSpanId=ak;var ck=()=>{let e=Date.now(),t=Math.random().toString(36).substr(2,9),r=process.pid||0;return`logger_${e}_${t}_${r}`};ie.generateLoggerInstanceId=ck;var dk=()=>{let e,t,r;return{name:"correlation",enrich:n=>(n.correlationId||(e=e||(0,ie.generateCorrelationId)(),n.correlationId=e),n.traceId||(t=t||(0,ie.generateTraceId)(),n.traceId=t),n.spanId||(r=r||(0,ie.generateSpanId)(),n.spanId=r),n)}};ie.createCorrelationEnricher=dk;var lk=e=>{let t=e||`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`;return{name:"session",enrich:r=>(r.sessionId||(r.sessionId=t),r)}};ie.createSessionEnricher=lk;var uk=(e,t)=>({name:"environment",enrich:r=>(e&&!r.serviceName&&(r.serviceName=e),t&&!r.stage&&(r.stage=t),r)});ie.createEnvironmentEnricher=uk;var mk=e=>({name:"user",enrich:t=>(e&&!t.userId&&(t.userId=e),t)});ie.createUserEnricher=mk;var pk=e=>({name:"loggerInstance",enrich:t=>(t.instanceId||(t.instanceId=e),t)});ie.createLoggerInstanceEnricher=pk;var fk=e=>t=>e.reduce((r,n)=>n.enrich(r),{...t});ie.createEnrichmentMiddleware=fk;var gk=(e,t,r,n)=>{let s=[(0,ie.createCorrelationEnricher)(),(0,ie.createSessionEnricher)(r),(0,ie.createEnvironmentEnricher)(e,t)];return n&&s.push((0,ie.createLoggerInstanceEnricher)(n)),(0,ie.createEnrichmentMiddleware)(s)};ie.createDefaultEnrichmentMiddleware=gk});var qo=b(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.getParsedType=ye.ZodParsedType=ye.objectUtil=ye.util=void 0;var xu;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{let o={};for(let i of s)o[i]=i;return o},e.getValidEnumValues=s=>{let o=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),i={};for(let a of o)i[a]=s[a];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(let i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(xu||(ye.util=xu={}));var Kh;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Kh||(ye.objectUtil=Kh={}));ye.ZodParsedType=xu.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var hk=e=>{switch(typeof e){case"undefined":return ye.ZodParsedType.undefined;case"string":return ye.ZodParsedType.string;case"number":return Number.isNaN(e)?ye.ZodParsedType.nan:ye.ZodParsedType.number;case"boolean":return ye.ZodParsedType.boolean;case"function":return ye.ZodParsedType.function;case"bigint":return ye.ZodParsedType.bigint;case"symbol":return ye.ZodParsedType.symbol;case"object":return Array.isArray(e)?ye.ZodParsedType.array:e===null?ye.ZodParsedType.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ye.ZodParsedType.promise:typeof Map<"u"&&e instanceof Map?ye.ZodParsedType.map:typeof Set<"u"&&e instanceof Set?ye.ZodParsedType.set:typeof Date<"u"&&e instanceof Date?ye.ZodParsedType.date:ye.ZodParsedType.object;default:return ye.ZodParsedType.unknown}};ye.getParsedType=hk});var Na=b(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.ZodError=Mr.quotelessJson=Mr.ZodIssueCode=void 0;var Jh=qo();Mr.ZodIssueCode=Jh.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var yk=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");Mr.quotelessJson=yk;var Go=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let a=n,c=0;for(;c<i.path.length;){let d=i.path[c];c===i.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(r(i))):a[d]=a[d]||{_errors:[]},a=a[d],c++}}};return s(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Jh.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let s of this.issues)if(s.path.length>0){let o=s.path[0];r[o]=r[o]||[],r[o].push(t(s))}else n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Mr.ZodError=Go;Go.create=e=>new Go(e)});var Au=b(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});var Ge=Na(),In=qo(),_k=(e,t)=>{let r;switch(e.code){case Ge.ZodIssueCode.invalid_type:e.received===In.ZodParsedType.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Ge.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,In.util.jsonStringifyReplacer)}`;break;case Ge.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${In.util.joinValues(e.keys,", ")}`;break;case Ge.ZodIssueCode.invalid_union:r="Invalid input";break;case Ge.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${In.util.joinValues(e.options)}`;break;case Ge.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${In.util.joinValues(e.options)}, received '${e.received}'`;break;case Ge.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case Ge.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case Ge.ZodIssueCode.invalid_date:r="Invalid date";break;case Ge.ZodIssueCode.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:In.util.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Ge.ZodIssueCode.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case Ge.ZodIssueCode.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case Ge.ZodIssueCode.custom:r="Invalid input";break;case Ge.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case Ge.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Ge.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,In.util.assertNever(e)}return{message:r}};Iu.default=_k});var La=b(Fr=>{"use strict";var vk=Fr&&Fr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.defaultErrorMap=void 0;Fr.setErrorMap=Sk;Fr.getErrorMap=Ek;var Yh=vk(Au());Fr.defaultErrorMap=Yh.default;var Qh=Yh.default;function Sk(e){Qh=e}function Ek(){return Qh}});var Du=b(le=>{"use strict";var Ck=le&&le.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(le,"__esModule",{value:!0});le.isAsync=le.isValid=le.isDirty=le.isAborted=le.OK=le.DIRTY=le.INVALID=le.ParseStatus=le.EMPTY_PATH=le.makeIssue=void 0;le.addIssueToContext=Tk;var bk=La(),Xh=Ck(Au()),wk=e=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="",c=n.filter(d=>!!d).slice().reverse();for(let d of c)a=d(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}};le.makeIssue=wk;le.EMPTY_PATH=[];function Tk(e,t){let r=(0,bk.getErrorMap)(),n=(0,le.makeIssue)({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Xh.default?void 0:Xh.default].filter(s=>!!s)});e.common.issues.push(n)}var Ou=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let s of r){if(s.status==="aborted")return le.INVALID;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let s of r){let o=await s.key,i=await s.value;n.push({key:o,value:i})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let s of r){let{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return le.INVALID;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:t.value,value:n}}};le.ParseStatus=Ou;le.INVALID=Object.freeze({status:"aborted"});var Pk=e=>({status:"dirty",value:e});le.DIRTY=Pk;var xk=e=>({status:"valid",value:e});le.OK=xk;var Ik=e=>e.status==="aborted";le.isAborted=Ik;var Ak=e=>e.status==="dirty";le.isDirty=Ak;var Ok=e=>e.status==="valid";le.isValid=Ok;var Dk=e=>typeof Promise<"u"&&e instanceof Promise;le.isAsync=Dk});var ty=b(ey=>{"use strict";Object.defineProperty(ey,"__esModule",{value:!0})});var ny=b(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.errorUtil=void 0;var ry;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ry||(ka.errorUtil=ry={}))});var gy=b(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.discriminatedUnion=v.date=v.boolean=v.bigint=v.array=v.any=v.coerce=v.ZodFirstPartyTypeKind=v.late=v.ZodSchema=v.Schema=v.ZodReadonly=v.ZodPipeline=v.ZodBranded=v.BRAND=v.ZodNaN=v.ZodCatch=v.ZodDefault=v.ZodNullable=v.ZodOptional=v.ZodTransformer=v.ZodEffects=v.ZodPromise=v.ZodNativeEnum=v.ZodEnum=v.ZodLiteral=v.ZodLazy=v.ZodFunction=v.ZodSet=v.ZodMap=v.ZodRecord=v.ZodTuple=v.ZodIntersection=v.ZodDiscriminatedUnion=v.ZodUnion=v.ZodObject=v.ZodArray=v.ZodVoid=v.ZodNever=v.ZodUnknown=v.ZodAny=v.ZodNull=v.ZodUndefined=v.ZodSymbol=v.ZodDate=v.ZodBoolean=v.ZodBigInt=v.ZodNumber=v.ZodString=v.ZodType=void 0;v.NEVER=v.void=v.unknown=v.union=v.undefined=v.tuple=v.transformer=v.symbol=v.string=v.strictObject=v.set=v.record=v.promise=v.preprocess=v.pipeline=v.ostring=v.optional=v.onumber=v.oboolean=v.object=v.number=v.nullable=v.null=v.never=v.nativeEnum=v.nan=v.map=v.literal=v.lazy=v.intersection=v.instanceof=v.function=v.enum=v.effect=void 0;v.datetimeRegex=cy;v.custom=ly;var M=Na(),Ma=La(),q=ny(),S=Du(),F=qo(),St=class{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},sy=(e,t)=>{if((0,S.isValid)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new M.ZodError(e.common.issues);return this._error=r,this._error}}};function J(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(i,a)=>{let{message:c}=e;return i.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:s}}var Y=class{get description(){return this._def.description}_getType(t){return(0,F.getParsedType)(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:(0,F.getParsedType)(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new S.ParseStatus,ctx:{common:t.parent.common,data:t.data,parsedType:(0,F.getParsedType)(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if((0,S.isAsync)(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:(0,F.getParsedType)(t)},s=this._parseSync({data:t,path:n.path,parent:n});return sy(n,s)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:(0,F.getParsedType)(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return(0,S.isValid)(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>(0,S.isValid)(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:(0,F.getParsedType)(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await((0,S.isAsync)(s)?s:Promise.resolve(s));return sy(n,o)}refine(t,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{let i=t(s),a=()=>o.addIssue({code:M.ZodIssueCode.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new lt({schema:this,typeName:W.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return vt.create(this,this._def)}nullable(){return Wt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fr.create(this)}promise(){return Br.create(this,this._def)}or(t){return kn.create([this,t],this._def)}and(t){return Mn.create(this,t,this._def)}transform(t){return new lt({...J(this._def),schema:this,typeName:W.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new $n({...J(this._def),innerType:this,defaultValue:r,typeName:W.ZodDefault})}brand(){return new Vo({typeName:W.ZodBranded,type:this,...J(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new zn({...J(this._def),innerType:this,catchValue:r,typeName:W.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Wo.create(this,t)}readonly(){return Hn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};v.ZodType=Y;v.Schema=Y;v.ZodSchema=Y;var Rk=/^c[^\s-]{8,}$/i,Nk=/^[0-9a-z]+$/,Lk=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kk=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Mk=/^[a-z0-9_-]{21}$/i,Fk=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,jk=/^[-+]?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)?)??$/,Uk=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Bk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ru,$k=/^(?:(?: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])$/,zk=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Hk=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,qk=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Gk=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Vk=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,iy="((\\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])))",Wk=new RegExp(`^${iy}$`);function ay(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function Zk(e){return new RegExp(`^${ay(e)}$`)}function cy(e){let t=`${iy}T${ay(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Kk(e,t){return!!((t==="v4"||!t)&&$k.test(e)||(t==="v6"||!t)&&Hk.test(e))}function Jk(e,t){if(!Fk.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function Yk(e,t){return!!((t==="v4"||!t)&&zk.test(e)||(t==="v6"||!t)&&qk.test(e))}var jr=class e extends Y{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==F.ZodParsedType.string){let o=this._getOrReturnCtx(t);return(0,S.addIssueToContext)(o,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.string,received:o.parsedType}),S.INVALID}let n=new S.ParseStatus,s;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{code:M.ZodIssueCode.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{code:M.ZodIssueCode.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let i=t.data.length>o.value,a=t.data.length<o.value;(i||a)&&(s=this._getOrReturnCtx(t,s),i?(0,S.addIssueToContext)(s,{code:M.ZodIssueCode.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&(0,S.addIssueToContext)(s,{code:M.ZodIssueCode.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Uk.test(t.data)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{validation:"email",code:M.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Ru||(Ru=new RegExp(Bk,"u")),Ru.test(t.data)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{validation:"emoji",code:M.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")kk.test(t.data)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{validation:"uuid",code:M.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Mk.test(t.data)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{validation:"nanoid",code:M.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")Rk.test(t.data)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{validation:"cuid",code:M.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Nk.test(t.data)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{validation:"cuid2",code:M.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Lk.test(t.data)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{validation:"ulid",code:M.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{validation:"url",code:M.ZodIssueCode.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{validation:"regex",code:M.ZodIssueCode.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{code:M.ZodIssueCode.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{code:M.ZodIssueCode.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{code:M.ZodIssueCode.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?cy(o).test(t.data)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{code:M.ZodIssueCode.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?Wk.test(t.data)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{code:M.ZodIssueCode.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Zk(o).test(t.data)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{code:M.ZodIssueCode.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?jk.test(t.data)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{validation:"duration",code:M.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Kk(t.data,o.version)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{validation:"ip",code:M.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Jk(t.data,o.alg)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{validation:"jwt",code:M.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Yk(t.data,o.version)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{validation:"cidr",code:M.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?Gk.test(t.data)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{validation:"base64",code:M.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?Vk.test(t.data)||(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{validation:"base64url",code:M.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):F.util.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:M.ZodIssueCode.invalid_string,...q.errorUtil.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...q.errorUtil.errToObj(t)})}url(t){return this._addCheck({kind:"url",...q.errorUtil.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...q.errorUtil.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...q.errorUtil.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...q.errorUtil.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...q.errorUtil.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...q.errorUtil.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...q.errorUtil.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...q.errorUtil.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...q.errorUtil.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...q.errorUtil.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...q.errorUtil.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...q.errorUtil.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...q.errorUtil.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...q.errorUtil.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...q.errorUtil.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...q.errorUtil.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...q.errorUtil.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...q.errorUtil.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...q.errorUtil.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...q.errorUtil.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...q.errorUtil.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...q.errorUtil.errToObj(r)})}nonempty(t){return this.min(1,q.errorUtil.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};v.ZodString=jr;jr.create=e=>new jr({checks:[],typeName:W.ZodString,coerce:e?.coerce??!1,...J(e)});function Qk(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=Number.parseInt(e.toFixed(s).replace(".","")),i=Number.parseInt(t.toFixed(s).replace(".",""));return o%i/10**s}var An=class e extends Y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==F.ZodParsedType.number){let o=this._getOrReturnCtx(t);return(0,S.addIssueToContext)(o,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.number,received:o.parsedType}),S.INVALID}let n,s=new S.ParseStatus;for(let o of this._def.checks)o.kind==="int"?F.util.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?Qk(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.not_finite,message:o.message}),s.dirty()):F.util.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,q.errorUtil.toString(r))}gt(t,r){return this.setLimit("min",t,!1,q.errorUtil.toString(r))}lte(t,r){return this.setLimit("max",t,!0,q.errorUtil.toString(r))}lt(t,r){return this.setLimit("max",t,!1,q.errorUtil.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:q.errorUtil.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:q.errorUtil.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:q.errorUtil.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:q.errorUtil.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:q.errorUtil.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:q.errorUtil.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:q.errorUtil.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:q.errorUtil.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:q.errorUtil.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:q.errorUtil.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&F.util.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};v.ZodNumber=An;An.create=e=>new An({checks:[],typeName:W.ZodNumber,coerce:e?.coerce||!1,...J(e)});var On=class e extends Y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==F.ZodParsedType.bigint)return this._getInvalidInput(t);let n,s=new S.ParseStatus;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):F.util.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return(0,S.addIssueToContext)(r,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.bigint,received:r.parsedType}),S.INVALID}gte(t,r){return this.setLimit("min",t,!0,q.errorUtil.toString(r))}gt(t,r){return this.setLimit("min",t,!1,q.errorUtil.toString(r))}lte(t,r){return this.setLimit("max",t,!0,q.errorUtil.toString(r))}lt(t,r){return this.setLimit("max",t,!1,q.errorUtil.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:q.errorUtil.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:q.errorUtil.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:q.errorUtil.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:q.errorUtil.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:q.errorUtil.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:q.errorUtil.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};v.ZodBigInt=On;On.create=e=>new On({checks:[],typeName:W.ZodBigInt,coerce:e?.coerce??!1,...J(e)});var Dn=class extends Y{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==F.ZodParsedType.boolean){let n=this._getOrReturnCtx(t);return(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.boolean,received:n.parsedType}),S.INVALID}return(0,S.OK)(t.data)}};v.ZodBoolean=Dn;Dn.create=e=>new Dn({typeName:W.ZodBoolean,coerce:e?.coerce||!1,...J(e)});var Rn=class e extends Y{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==F.ZodParsedType.date){let o=this._getOrReturnCtx(t);return(0,S.addIssueToContext)(o,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.date,received:o.parsedType}),S.INVALID}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return(0,S.addIssueToContext)(o,{code:M.ZodIssueCode.invalid_date}),S.INVALID}let n=new S.ParseStatus,s;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{code:M.ZodIssueCode.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),(0,S.addIssueToContext)(s,{code:M.ZodIssueCode.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):F.util.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:q.errorUtil.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:q.errorUtil.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};v.ZodDate=Rn;Rn.create=e=>new Rn({checks:[],coerce:e?.coerce||!1,typeName:W.ZodDate,...J(e)});var Fs=class extends Y{_parse(t){if(this._getType(t)!==F.ZodParsedType.symbol){let n=this._getOrReturnCtx(t);return(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.symbol,received:n.parsedType}),S.INVALID}return(0,S.OK)(t.data)}};v.ZodSymbol=Fs;Fs.create=e=>new Fs({typeName:W.ZodSymbol,...J(e)});var Nn=class extends Y{_parse(t){if(this._getType(t)!==F.ZodParsedType.undefined){let n=this._getOrReturnCtx(t);return(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.undefined,received:n.parsedType}),S.INVALID}return(0,S.OK)(t.data)}};v.ZodUndefined=Nn;Nn.create=e=>new Nn({typeName:W.ZodUndefined,...J(e)});var Ln=class extends Y{_parse(t){if(this._getType(t)!==F.ZodParsedType.null){let n=this._getOrReturnCtx(t);return(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.null,received:n.parsedType}),S.INVALID}return(0,S.OK)(t.data)}};v.ZodNull=Ln;Ln.create=e=>new Ln({typeName:W.ZodNull,...J(e)});var Ur=class extends Y{constructor(){super(...arguments),this._any=!0}_parse(t){return(0,S.OK)(t.data)}};v.ZodAny=Ur;Ur.create=e=>new Ur({typeName:W.ZodAny,...J(e)});var pr=class extends Y{constructor(){super(...arguments),this._unknown=!0}_parse(t){return(0,S.OK)(t.data)}};v.ZodUnknown=pr;pr.create=e=>new pr({typeName:W.ZodUnknown,...J(e)});var jt=class extends Y{_parse(t){let r=this._getOrReturnCtx(t);return(0,S.addIssueToContext)(r,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.never,received:r.parsedType}),S.INVALID}};v.ZodNever=jt;jt.create=e=>new jt({typeName:W.ZodNever,...J(e)});var js=class extends Y{_parse(t){if(this._getType(t)!==F.ZodParsedType.undefined){let n=this._getOrReturnCtx(t);return(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.void,received:n.parsedType}),S.INVALID}return(0,S.OK)(t.data)}};v.ZodVoid=js;js.create=e=>new js({typeName:W.ZodVoid,...J(e)});var fr=class e extends Y{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==F.ZodParsedType.array)return(0,S.addIssueToContext)(r,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.array,received:r.parsedType}),S.INVALID;if(s.exactLength!==null){let i=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(i||a)&&((0,S.addIssueToContext)(r,{code:i?M.ZodIssueCode.too_big:M.ZodIssueCode.too_small,minimum:a?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&((0,S.addIssueToContext)(r,{code:M.ZodIssueCode.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&((0,S.addIssueToContext)(r,{code:M.ZodIssueCode.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>s.type._parseAsync(new St(r,i,r.path,a)))).then(i=>S.ParseStatus.mergeArray(n,i));let o=[...r.data].map((i,a)=>s.type._parseSync(new St(r,i,r.path,a)));return S.ParseStatus.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:q.errorUtil.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:q.errorUtil.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:q.errorUtil.toString(r)}})}nonempty(t){return this.min(1,t)}};v.ZodArray=fr;fr.create=(e,t)=>new fr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:W.ZodArray,...J(t)});function Ms(e){if(e instanceof tt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=vt.create(Ms(n))}return new tt({...e._def,shape:()=>t})}else return e instanceof fr?new fr({...e._def,type:Ms(e.element)}):e instanceof vt?vt.create(Ms(e.unwrap())):e instanceof Wt?Wt.create(Ms(e.unwrap())):e instanceof Vt?Vt.create(e.items.map(t=>Ms(t))):e}var tt=class e extends Y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=F.util.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==F.ZodParsedType.object){let d=this._getOrReturnCtx(t);return(0,S.addIssueToContext)(d,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.object,received:d.parsedType}),S.INVALID}let{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof jt&&this._def.unknownKeys==="strip"))for(let d in s.data)i.includes(d)||a.push(d);let c=[];for(let d of i){let l=o[d],u=s.data[d];c.push({key:{status:"valid",value:d},value:l._parse(new St(s,u,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof jt){let d=this._def.unknownKeys;if(d==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:s.data[l]}});else if(d==="strict")a.length>0&&((0,S.addIssueToContext)(s,{code:M.ZodIssueCode.unrecognized_keys,keys:a}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let l of a){let u=s.data[l];c.push({key:{status:"valid",value:l},value:d._parse(new St(s,u,s.path,l)),alwaysSet:l in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let d=[];for(let l of c){let u=await l.key,m=await l.value;d.push({key:u,value:m,alwaysSet:l.alwaysSet})}return d}).then(d=>S.ParseStatus.mergeObjectSync(n,d)):S.ParseStatus.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return q.errorUtil.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:q.errorUtil.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:W.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of F.util.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of F.util.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Ms(this)}partial(t){let r={};for(let n of F.util.objectKeys(this.shape)){let s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of F.util.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof vt;)o=o._def.innerType;r[n]=o}return new e({...this._def,shape:()=>r})}keyof(){return dy(F.util.objectKeys(this.shape))}};v.ZodObject=tt;tt.create=(e,t)=>new tt({shape:()=>e,unknownKeys:"strip",catchall:jt.create(),typeName:W.ZodObject,...J(t)});tt.strictCreate=(e,t)=>new tt({shape:()=>e,unknownKeys:"strict",catchall:jt.create(),typeName:W.ZodObject,...J(t)});tt.lazycreate=(e,t)=>new tt({shape:e,unknownKeys:"strip",catchall:jt.create(),typeName:W.ZodObject,...J(t)});var kn=class extends Y{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let i=o.map(a=>new M.ZodError(a.ctx.common.issues));return(0,S.addIssueToContext)(r,{code:M.ZodIssueCode.invalid_union,unionErrors:i}),S.INVALID}if(r.common.async)return Promise.all(n.map(async o=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let o,i=[];for(let c of n){let d={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:d});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=i.map(c=>new M.ZodError(c));return(0,S.addIssueToContext)(r,{code:M.ZodIssueCode.invalid_union,unionErrors:a}),S.INVALID}}get options(){return this._def.options}};v.ZodUnion=kn;kn.create=(e,t)=>new kn({options:e,typeName:W.ZodUnion,...J(t)});var mr=e=>e instanceof Fn?mr(e.schema):e instanceof lt?mr(e.innerType()):e instanceof jn?[e.value]:e instanceof Un?e.options:e instanceof Bn?F.util.objectValues(e.enum):e instanceof $n?mr(e._def.innerType):e instanceof Nn?[void 0]:e instanceof Ln?[null]:e instanceof vt?[void 0,...mr(e.unwrap())]:e instanceof Wt?[null,...mr(e.unwrap())]:e instanceof Vo||e instanceof Hn?mr(e.unwrap()):e instanceof zn?mr(e._def.innerType):[],Fa=class e extends Y{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==F.ZodParsedType.object)return(0,S.addIssueToContext)(r,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.object,received:r.parsedType}),S.INVALID;let n=this.discriminator,s=r.data[n],o=this.optionsMap.get(s);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):((0,S.addIssueToContext)(r,{code:M.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),S.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let s=new Map;for(let o of r){let i=mr(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of i){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,o)}}return new e({typeName:W.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...J(n)})}};v.ZodDiscriminatedUnion=Fa;function Nu(e,t){let r=(0,F.getParsedType)(e),n=(0,F.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(r===F.ZodParsedType.object&&n===F.ZodParsedType.object){let s=F.util.objectKeys(t),o=F.util.objectKeys(e).filter(a=>s.indexOf(a)!==-1),i={...e,...t};for(let a of o){let c=Nu(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===F.ZodParsedType.array&&n===F.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let i=e[o],a=t[o],c=Nu(i,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===F.ZodParsedType.date&&n===F.ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Mn=class extends Y{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=(o,i)=>{if((0,S.isAborted)(o)||(0,S.isAborted)(i))return S.INVALID;let a=Nu(o.value,i.value);return a.valid?(((0,S.isDirty)(o)||(0,S.isDirty)(i))&&r.dirty(),{status:r.value,value:a.data}):((0,S.addIssueToContext)(n,{code:M.ZodIssueCode.invalid_intersection_types}),S.INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};v.ZodIntersection=Mn;Mn.create=(e,t,r)=>new Mn({left:e,right:t,typeName:W.ZodIntersection,...J(r)});var Vt=class e extends Y{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==F.ZodParsedType.array)return(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.array,received:n.parsedType}),S.INVALID;if(n.data.length<this._def.items.length)return(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&((0,S.addIssueToContext)(n,{code:M.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new St(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>S.ParseStatus.mergeArray(r,i)):S.ParseStatus.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};v.ZodTuple=Vt;Vt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vt({items:e,typeName:W.ZodTuple,rest:null,...J(t)})};var ja=class e extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==F.ZodParsedType.object)return(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.object,received:n.parsedType}),S.INVALID;let s=[],o=this._def.keyType,i=this._def.valueType;for(let a in n.data)s.push({key:o._parse(new St(n,a,n.path,a)),value:i._parse(new St(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?S.ParseStatus.mergeObjectAsync(r,s):S.ParseStatus.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Y?new e({keyType:t,valueType:r,typeName:W.ZodRecord,...J(n)}):new e({keyType:jr.create(),valueType:t,typeName:W.ZodRecord,...J(r)})}};v.ZodRecord=ja;var Us=class extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==F.ZodParsedType.map)return(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.map,received:n.parsedType}),S.INVALID;let s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([a,c],d)=>({key:s._parse(new St(n,a,n.path,[d,"key"])),value:o._parse(new St(n,c,n.path,[d,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let d=await c.key,l=await c.value;if(d.status==="aborted"||l.status==="aborted")return S.INVALID;(d.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(d.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of i){let d=c.key,l=c.value;if(d.status==="aborted"||l.status==="aborted")return S.INVALID;(d.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(d.value,l.value)}return{status:r.value,value:a}}}};v.ZodMap=Us;Us.create=(e,t,r)=>new Us({valueType:t,keyType:e,typeName:W.ZodMap,...J(r)});var Bs=class e extends Y{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==F.ZodParsedType.set)return(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.set,received:n.parsedType}),S.INVALID;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&((0,S.addIssueToContext)(n,{code:M.ZodIssueCode.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&((0,S.addIssueToContext)(n,{code:M.ZodIssueCode.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let o=this._def.valueType;function i(c){let d=new Set;for(let l of c){if(l.status==="aborted")return S.INVALID;l.status==="dirty"&&r.dirty(),d.add(l.value)}return{status:r.value,value:d}}let a=[...n.data.values()].map((c,d)=>o._parse(new St(n,c,n.path,d)));return n.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:q.errorUtil.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:q.errorUtil.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};v.ZodSet=Bs;Bs.create=(e,t)=>new Bs({valueType:e,minSize:null,maxSize:null,typeName:W.ZodSet,...J(t)});var Ua=class e extends Y{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==F.ZodParsedType.function)return(0,S.addIssueToContext)(r,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.function,received:r.parsedType}),S.INVALID;function n(a,c){return(0,S.makeIssue)({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,Ma.getErrorMap)(),Ma.defaultErrorMap].filter(d=>!!d),issueData:{code:M.ZodIssueCode.invalid_arguments,argumentsError:c}})}function s(a,c){return(0,S.makeIssue)({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,Ma.getErrorMap)(),Ma.defaultErrorMap].filter(d=>!!d),issueData:{code:M.ZodIssueCode.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Br){let a=this;return(0,S.OK)(async function(...c){let d=new M.ZodError([]),l=await a._def.args.parseAsync(c,o).catch(p=>{throw d.addIssue(n(c,p)),d}),u=await Reflect.apply(i,this,l);return await a._def.returns._def.type.parseAsync(u,o).catch(p=>{throw d.addIssue(s(u,p)),d})})}else{let a=this;return(0,S.OK)(function(...c){let d=a._def.args.safeParse(c,o);if(!d.success)throw new M.ZodError([n(c,d.error)]);let l=Reflect.apply(i,this,d.data),u=a._def.returns.safeParse(l,o);if(!u.success)throw new M.ZodError([s(l,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Vt.create(t).rest(pr.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||Vt.create([]).rest(pr.create()),returns:r||pr.create(),typeName:W.ZodFunction,...J(n)})}};v.ZodFunction=Ua;var Fn=class extends Y{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};v.ZodLazy=Fn;Fn.create=(e,t)=>new Fn({getter:e,typeName:W.ZodLazy,...J(t)});var jn=class extends Y{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return(0,S.addIssueToContext)(r,{received:r.data,code:M.ZodIssueCode.invalid_literal,expected:this._def.value}),S.INVALID}return{status:"valid",value:t.data}}get value(){return this._def.value}};v.ZodLiteral=jn;jn.create=(e,t)=>new jn({value:e,typeName:W.ZodLiteral,...J(t)});function dy(e,t){return new Un({values:e,typeName:W.ZodEnum,...J(t)})}var Un=class e extends Y{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return(0,S.addIssueToContext)(r,{expected:F.util.joinValues(n),received:r.parsedType,code:M.ZodIssueCode.invalid_type}),S.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return(0,S.addIssueToContext)(r,{received:r.data,code:M.ZodIssueCode.invalid_enum_value,options:n}),S.INVALID}return(0,S.OK)(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};v.ZodEnum=Un;Un.create=dy;var Bn=class extends Y{_parse(t){let r=F.util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==F.ZodParsedType.string&&n.parsedType!==F.ZodParsedType.number){let s=F.util.objectValues(r);return(0,S.addIssueToContext)(n,{expected:F.util.joinValues(s),received:n.parsedType,code:M.ZodIssueCode.invalid_type}),S.INVALID}if(this._cache||(this._cache=new Set(F.util.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let s=F.util.objectValues(r);return(0,S.addIssueToContext)(n,{received:n.data,code:M.ZodIssueCode.invalid_enum_value,options:s}),S.INVALID}return(0,S.OK)(t.data)}get enum(){return this._def.values}};v.ZodNativeEnum=Bn;Bn.create=(e,t)=>new Bn({values:e,typeName:W.ZodNativeEnum,...J(t)});var Br=class extends Y{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==F.ZodParsedType.promise&&r.common.async===!1)return(0,S.addIssueToContext)(r,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.promise,received:r.parsedType}),S.INVALID;let n=r.parsedType===F.ZodParsedType.promise?r.data:Promise.resolve(r.data);return(0,S.OK)(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};v.ZodPromise=Br;Br.create=(e,t)=>new Br({type:e,typeName:W.ZodPromise,...J(t)});var lt=class extends Y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===W.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{(0,S.addIssueToContext)(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){let i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async a=>{if(r.value==="aborted")return S.INVALID;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?S.INVALID:c.status==="dirty"||r.value==="dirty"?(0,S.DIRTY)(c.value):c});{if(r.value==="aborted")return S.INVALID;let a=this._def.schema._parseSync({data:i,path:n.path,parent:n});return a.status==="aborted"?S.INVALID:a.status==="dirty"||r.value==="dirty"?(0,S.DIRTY)(a.value):a}}if(s.type==="refinement"){let i=a=>{let c=s.refinement(a,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?S.INVALID:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?S.INVALID:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0,S.isValid)(i))return S.INVALID;let a=s.transform(i.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>(0,S.isValid)(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:r.value,value:a})):S.INVALID);F.util.assertNever(s)}};v.ZodEffects=lt;v.ZodTransformer=lt;lt.create=(e,t,r)=>new lt({schema:e,typeName:W.ZodEffects,effect:t,...J(r)});lt.createWithPreprocess=(e,t,r)=>new lt({schema:t,effect:{type:"preprocess",transform:e},typeName:W.ZodEffects,...J(r)});var vt=class extends Y{_parse(t){return this._getType(t)===F.ZodParsedType.undefined?(0,S.OK)(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};v.ZodOptional=vt;vt.create=(e,t)=>new vt({innerType:e,typeName:W.ZodOptional,...J(t)});var Wt=class extends Y{_parse(t){return this._getType(t)===F.ZodParsedType.null?(0,S.OK)(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};v.ZodNullable=Wt;Wt.create=(e,t)=>new Wt({innerType:e,typeName:W.ZodNullable,...J(t)});var $n=class extends Y{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===F.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};v.ZodDefault=$n;$n.create=(e,t)=>new $n({innerType:e,typeName:W.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...J(t)});var zn=class extends Y{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return(0,S.isAsync)(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new M.ZodError(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new M.ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};v.ZodCatch=zn;zn.create=(e,t)=>new zn({innerType:e,typeName:W.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...J(t)});var $s=class extends Y{_parse(t){if(this._getType(t)!==F.ZodParsedType.nan){let n=this._getOrReturnCtx(t);return(0,S.addIssueToContext)(n,{code:M.ZodIssueCode.invalid_type,expected:F.ZodParsedType.nan,received:n.parsedType}),S.INVALID}return{status:"valid",value:t.data}}};v.ZodNaN=$s;$s.create=e=>new $s({typeName:W.ZodNaN,...J(e)});v.BRAND=Symbol("zod_brand");var Vo=class extends Y{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};v.ZodBranded=Vo;var Wo=class e extends Y{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?S.INVALID:o.status==="dirty"?(r.dirty(),(0,S.DIRTY)(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?S.INVALID:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:W.ZodPipeline})}};v.ZodPipeline=Wo;var Hn=class extends Y{_parse(t){let r=this._def.innerType._parse(t),n=s=>((0,S.isValid)(s)&&(s.value=Object.freeze(s.value)),s);return(0,S.isAsync)(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};v.ZodReadonly=Hn;Hn.create=(e,t)=>new Hn({innerType:e,typeName:W.ZodReadonly,...J(t)});function oy(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function ly(e,t={},r){return e?Ur.create().superRefine((n,s)=>{let o=e(n);if(o instanceof Promise)return o.then(i=>{if(!i){let a=oy(t,n),c=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:c})}});if(!o){let i=oy(t,n),a=i.fatal??r??!0;s.addIssue({code:"custom",...i,fatal:a})}}):Ur.create()}v.late={object:tt.lazycreate};var W;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(W||(v.ZodFirstPartyTypeKind=W={}));var Xk=(e,t={message:`Input not instance of ${e.name}`})=>ly(r=>r instanceof e,t);v.instanceof=Xk;var uy=jr.create;v.string=uy;var my=An.create;v.number=my;var eM=$s.create;v.nan=eM;var tM=On.create;v.bigint=tM;var py=Dn.create;v.boolean=py;var rM=Rn.create;v.date=rM;var nM=Fs.create;v.symbol=nM;var sM=Nn.create;v.undefined=sM;var oM=Ln.create;v.null=oM;var iM=Ur.create;v.any=iM;var aM=pr.create;v.unknown=aM;var cM=jt.create;v.never=cM;var dM=js.create;v.void=dM;var lM=fr.create;v.array=lM;var uM=tt.create;v.object=uM;var mM=tt.strictCreate;v.strictObject=mM;var pM=kn.create;v.union=pM;var fM=Fa.create;v.discriminatedUnion=fM;var gM=Mn.create;v.intersection=gM;var hM=Vt.create;v.tuple=hM;var yM=ja.create;v.record=yM;var _M=Us.create;v.map=_M;var vM=Bs.create;v.set=vM;var SM=Ua.create;v.function=SM;var EM=Fn.create;v.lazy=EM;var CM=jn.create;v.literal=CM;var bM=Un.create;v.enum=bM;var wM=Bn.create;v.nativeEnum=wM;var TM=Br.create;v.promise=TM;var fy=lt.create;v.effect=fy;v.transformer=fy;var PM=vt.create;v.optional=PM;var xM=Wt.create;v.nullable=xM;var IM=lt.createWithPreprocess;v.preprocess=IM;var AM=Wo.create;v.pipeline=AM;var OM=()=>uy().optional();v.ostring=OM;var DM=()=>my().optional();v.onumber=DM;var RM=()=>py().optional();v.oboolean=RM;v.coerce={string:e=>jr.create({...e,coerce:!0}),number:e=>An.create({...e,coerce:!0}),boolean:e=>Dn.create({...e,coerce:!0}),bigint:e=>On.create({...e,coerce:!0}),date:e=>Rn.create({...e,coerce:!0})};v.NEVER=S.INVALID});var Lu=b(Et=>{"use strict";var NM=Et&&Et.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),zs=Et&&Et.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&NM(t,e,r)};Object.defineProperty(Et,"__esModule",{value:!0});zs(La(),Et);zs(Du(),Et);zs(ty(),Et);zs(qo(),Et);zs(gy(),Et);zs(Na(),Et)});var _y=b(rt=>{"use strict";var hy=rt&&rt.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),LM=rt&&rt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),kM=rt&&rt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&hy(t,e,r);return LM(t,e),t},MM=rt&&rt.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&hy(t,e,r)};Object.defineProperty(rt,"__esModule",{value:!0});rt.z=void 0;var yy=kM(Lu());rt.z=yy;MM(Lu(),rt);rt.default=yy});var ku=b(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.getEnvironment=void 0;var gr=_y(),FM=gr.z.object({LOG_LEVEL:gr.z.enum(["DEBUG","INFO","WARN","ERROR","FATAL"]).optional(),STAGE:gr.z.enum(["dev","prod","test"]).default("dev"),SERVICE_NAME:gr.z.string().optional(),ENABLE_STRUCTURED_LOGGING:gr.z.string().transform(e=>e==="true").optional(),CLOUDWATCH_LOG_GROUP:gr.z.string().optional(),CLOUDWATCH_LOG_STREAM:gr.z.string().optional(),AWS_REGION:gr.z.string().optional()}),jM=(e=process.env)=>{let t;try{t=FM.parse(e)}catch(r){r instanceof gr.z.ZodError&&console.warn("Environment validation failed, using defaults:",r.errors),t={STAGE:"dev"}}return{...t,isProduction:t.STAGE==="prod",isDevelopment:t.STAGE==="dev",logLevel:t.LOG_LEVEL??void 0,serviceName:t.SERVICE_NAME??void 0,enableStructuredLogging:t.ENABLE_STRUCTURED_LOGGING??!0,stage:t.STAGE}};Ba.getEnvironment=jM});var Mu=b(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.createLogFilter=Zt.createSampler=Zt.createRateLimiter=void 0;var UM=(e,t)=>{let r={tokens:t,lastRefill:Date.now(),maxTokens:t,refillRate:e},n=()=>{let o=Date.now(),a=(o-r.lastRefill)/1e3*r.refillRate;r.tokens=Math.min(r.maxTokens,r.tokens+a),r.lastRefill=o};return{tryConsume:(o=1)=>(n(),r.tokens>=o?(r.tokens-=o,!0):!1),getState:()=>({...r})}};Zt.createRateLimiter=UM;var BM=e=>{let t={totalLogs:0,sampledLogs:0};return{shouldSample:()=>(t.totalLogs++,e>=1?(t.sampledLogs++,!0):e<=0?!1:Math.random()<=e?(t.sampledLogs++,!0):!1),getStats:()=>({totalLogs:t.totalLogs,sampledLogs:t.sampledLogs,samplingRate:t.totalLogs>0?t.sampledLogs/t.totalLogs:0,configuredRate:e})}};Zt.createSampler=BM;var $M=e=>{let t=e.rateLimit?(0,Zt.createRateLimiter)(e.rateLimit.maxLogsPerSecond,e.rateLimit.burstSize):null,r=e.samplingRate!==void 0?(0,Zt.createSampler)(e.samplingRate):null;return{shouldLog:()=>!t&&!r?!0:!(t&&!t.tryConsume()||r&&!r.shouldSample()),getStats:()=>({rateLimit:t?.getState(),sampling:r?.getStats()})}};Zt.createLogFilter=$M});var Fu=b(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.printLoggerConfig=Ct.createStrogger=Ct.strogger=Ct.createLogger=void 0;var zM=bu(),HM=Ra(),pe=Ft(),qM=Tu(),vy=Pu(),GM=ku(),VM=Mu(),Sy=e=>{if(!e||typeof e!="object")return console.warn("[strogger] No environment provided, defaulting to DEBUG"),pe.LogLevel.DEBUG;switch(e.LOG_LEVEL?.toUpperCase()){case"DEBUG":return pe.LogLevel.DEBUG;case"INFO":return pe.LogLevel.INFO;case"WARN":return pe.LogLevel.WARN;case"ERROR":return pe.LogLevel.ERROR;case"FATAL":return pe.LogLevel.FATAL;case void 0:return e.STAGE==="prod"?pe.LogLevel.INFO:pe.LogLevel.DEBUG;default:return console.warn(`[strogger] Invalid LOG_LEVEL '${e.LOG_LEVEL}' provided. Defaulting to ${e.STAGE==="prod"?"INFO":"DEBUG"}.`),e.STAGE==="prod"?pe.LogLevel.INFO:pe.LogLevel.DEBUG}},WM=(e,t)=>e>=(t.level!==void 0?t.level:pe.LogLevel.INFO),ZM=(e,t,r,n,s,o)=>({timestamp:new Date().toISOString(),level:t,message:r,context:{...e.stage&&{stage:e.stage},...e.serviceName&&{serviceName:e.serviceName},...n},error:s?{name:s.name,message:s.message,stack:s.stack}:void 0,metadata:o}),KM=({config:e={},transports:t=[],formatter:r,env:n})=>{let s=e.instanceId||(0,vy.generateLoggerInstanceId)(),o={level:Sy(n),serviceName:n.SERVICE_NAME||void 0,stage:n.STAGE||"dev",enableStructuredLogging:n.ENABLE_STRUCTURED_LOGGING??!0,includeTimestamp:!0,includeLogLevel:!0,instanceId:s,...e};if(typeof o.level=="string")switch(o.level.toUpperCase()){case"DEBUG":o.level=pe.LogLevel.DEBUG;break;case"INFO":o.level=pe.LogLevel.INFO;break;case"WARN":o.level=pe.LogLevel.WARN;break;case"ERROR":o.level=pe.LogLevel.ERROR;break;case"FATAL":o.level=pe.LogLevel.FATAL;break;default:o.level=pe.LogLevel.INFO}e.level!==void 0&&(o.level=e.level);let i=(0,VM.createLogFilter)(o),a=(0,vy.createDefaultEnrichmentMiddleware)(o.serviceName,o.stage,void 0,s),d=e.batching===!0?t.map(u=>(0,qM.createBatchedTransport)(u,{maxSize:50,maxWaitTime:2e3,maxBatchSize:512*1024})):t,l=async(u,m,p,h,y)=>{if(!WM(u,o)||(o.samplingRate!==void 0||o.rateLimit)&&!i.shouldLog())return;let _=a(p||{}),w=ZM(o,u,m,_,h,y),E=w;if(typeof o.redact=="function"&&(E=o.redact(w)),typeof o.validate=="function")try{o.validate(E)}catch(T){console.error("[LOGGER ERROR] Log entry validation failed:",T);return}if(Array.isArray(o.hooks))for(let T of o.hooks)try{let A=T(E);A&&typeof A.then=="function"&&await A}catch(A){console.error("[LOGGER ERROR] Log hook failed:",A)}let B=await Promise.allSettled(d.map(T=>T.log(E)));for(let T of B)T.status==="rejected"&&console.error(T.reason)};return{debug:(u,m,p)=>l(pe.LogLevel.DEBUG,u,m,void 0,p),info:(u,m,p)=>l(pe.LogLevel.INFO,u,m,void 0,p),warn:(u,m,p,h)=>l(pe.LogLevel.WARN,u,m,p,h),error:(u,m,p,h)=>l(pe.LogLevel.ERROR,u,m,p,h),fatal:(u,m,p,h)=>l(pe.LogLevel.FATAL,u,m,p,h),logFunctionStart:(u,m,p)=>l(pe.LogLevel.INFO,`Function ${u} started`,{...m,functionName:u},void 0,p),logFunctionEnd:(u,m,p,h)=>l(pe.LogLevel.INFO,`Function ${u} completed in ${m}ms`,{...p,functionName:u,duration:m},void 0,h),logDatabaseOperation:(u,m,p,h)=>l(pe.LogLevel.DEBUG,`Database operation: ${u} on table ${m}`,{...p,operation:u,table:m},void 0,h),logApiRequest:(u,m,p,h,y)=>l(pe.LogLevel.INFO,`API ${u} ${m} - ${p}`,{...h,method:u,path:m,statusCode:p},void 0,y),setLevel:u=>{o.level=u;for(let m of t)m.setLevel?.(u)},getLevel:()=>o.level!==void 0?o.level:pe.LogLevel.INFO,getInstanceId:()=>s,addTransport:u=>t.push(u),removeTransport:u=>{let m=t.indexOf(u);m>-1&&t.splice(m,1)},setFormatter:u=>{},getSamplingStats:()=>i.getStats(),flush:async()=>{await Promise.allSettled(d.map(u=>u.flush?.()||Promise.resolve()))},getBatchStats:()=>d.map(u=>u.getStats?.()||{})}};Ct.createLogger=KM;var JM=(0,GM.getEnvironment)(),Ey=(0,zM.createJsonFormatter)(),YM=(0,HM.createConsoleTransport)({formatter:Ey});Ct.strogger=(0,Ct.createLogger)({config:{},transports:[YM],formatter:Ey,env:JM});Ct.createStrogger=Ct.createLogger;var QM=e=>{let t=Sy(e);console.log("--- Strogger Logger Configuration ---"),console.log("LOG_LEVEL:",e.LOG_LEVEL??"(default)"),console.log("STAGE:",e.STAGE??"dev"),console.log("SERVICE_NAME:",e.SERVICE_NAME??"(none)"),console.log("ENABLE_STRUCTURED_LOGGING:",e.ENABLE_STRUCTURED_LOGGING??!0),console.log("Effective log level:",t),console.log("--------------------------------------")};Ct.printLoggerConfig=QM});var zr=b(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.handleTransportError=Ce.validateTransportConfig=Ce.validateEnvironmentVariable=Ce.createDetailedError=Ce.ERROR_MESSAGES=Ce.ValidationError=Ce.ConfigurationError=Ce.TransportError=Ce.LoggerError=void 0;var $r=class extends Error{constructor(t,r,n){super(t),this.code=r,this.details=n,this.name="LoggerError"}};Ce.LoggerError=$r;var qn=class extends $r{constructor(t,r,n){super(t,"TRANSPORT_ERROR",{transportName:r,...n}),this.transportName=r,this.name="TransportError"}};Ce.TransportError=qn;var $a=class extends $r{constructor(t,r){super(t,"CONFIGURATION_ERROR",r),this.name="ConfigurationError"}};Ce.ConfigurationError=$a;var ju=class extends $r{constructor(t,r){super(t,"VALIDATION_ERROR",r),this.name="ValidationError"}};Ce.ValidationError=ju;Ce.ERROR_MESSAGES={NEW_RELIC_MISSING_API_KEY:{message:"New Relic transport requires NEW_RELIC_LICENSE_KEY environment variable",solution:"Set NEW_RELIC_LICENSE_KEY in your environment variables or pass apiKey option",example:"NEW_RELIC_LICENSE_KEY=your-license-key-here"},NEW_RELIC_MISSING_ACCOUNT_ID:{message:"New Relic transport requires NEW_RELIC_ACCOUNT_ID environment variable",solution:"Set NEW_RELIC_ACCOUNT_ID in your environment variables or pass accountId option",example:"NEW_RELIC_ACCOUNT_ID=your-account-id-here"},NEW_RELIC_API_ERROR:{message:"Failed to send logs to New Relic API",solution:"Check your API key, account ID, and network connectivity"},DATADOG_MISSING_API_KEY:{message:"DataDog transport requires DATADOG_API_KEY environment variable",solution:"Set DATADOG_API_KEY in your environment variables",example:"DATADOG_API_KEY=your-api-key-here"},DATADOG_API_ERROR:{message:"Failed to send logs to DataDog API",solution:"Check your API key and network connectivity"},CLOUDWATCH_MISSING_CREDENTIALS:{message:"CloudWatch transport requires AWS credentials",solution:"Configure AWS credentials via environment variables, IAM role, or AWS credentials file",example:`AWS_ACCESS_KEY_ID=your-key
2
- AWS_SECRET_ACCESS_KEY=your-secret`},CLOUDWATCH_MISSING_LOG_GROUP:{message:"CloudWatch transport requires logGroupName option",solution:"Provide logGroupName in transport options or set CLOUDWATCH_LOG_GROUP environment variable",example:'logGroupName: "/aws/lambda/my-function"'},CLOUDWATCH_LOG_GROUP_NOT_FOUND:{message:"CloudWatch log group does not exist",solution:"Create the log group in CloudWatch before using this transport",example:'aws logs create-log-group --log-group-name "/aws/lambda/my-function"'},CLOUDWATCH_API_ERROR:{message:"Failed to send logs to CloudWatch",solution:"Check your AWS credentials, region, and network connectivity"},TRANSPORT_INITIALIZATION_FAILED:{message:"Failed to initialize transport",solution:"Check transport configuration and required dependencies"},TRANSPORT_SEND_FAILED:{message:"Failed to send log entry to transport",solution:"Check transport configuration and network connectivity"},MISSING_SERVICE_NAME:{message:"Logger configuration requires serviceName",solution:"Set SERVICE_NAME environment variable or provide serviceName in config",example:"SERVICE_NAME=my-service"},INVALID_LOG_LEVEL:{message:"Invalid log level specified",solution:"Use one of: DEBUG, INFO, WARN, ERROR, FATAL",example:"LOG_LEVEL=INFO"},ENVIRONMENT_VALIDATION_FAILED:{message:"Environment configuration validation failed",solution:"Check your environment variables and configuration"},FORMATTER_MISSING:{message:"Logger requires a formatter",solution:"Provide a formatter object with a format(entry) method",example:"formatter: createJsonFormatter()"},PERFORMANCE_MONITOR_INITIALIZATION_FAILED:{message:"Failed to initialize performance monitor",solution:"Check performance monitor configuration"},SPLUNK_MISSING_HEC_URL:{message:"Splunk transport requires SPLUNK_HEC_URL environment variable",solution:"Set SPLUNK_HEC_URL in your environment variables",example:"SPLUNK_HEC_URL=https://your-splunk-instance:8088/services/collector"},SPLUNK_MISSING_HEC_TOKEN:{message:"Splunk transport requires SPLUNK_HEC_TOKEN environment variable",solution:"Set SPLUNK_HEC_TOKEN in your environment variables",example:"SPLUNK_HEC_TOKEN=your-hec-token-here"},SPLUNK_API_ERROR:{message:"Failed to send logs to Splunk HEC",solution:"Check your HEC URL, token, and network connectivity"},ELASTICSEARCH_MISSING_AUTH:{message:"Elasticsearch transport requires authentication",solution:"Set ELASTICSEARCH_API_KEY or ELASTICSEARCH_USERNAME/PASSWORD",example:"ELASTICSEARCH_API_KEY=your-api-key-here"},ELASTICSEARCH_MISSING_DATE:{message:"Date string is missing for Elasticsearch index pattern",solution:"Check date generation logic and ensure valid date string is produced"},ELASTICSEARCH_API_ERROR:{message:"Failed to send logs to Elasticsearch",solution:"Check your connection URL, authentication, and network connectivity"}};var XM=(e,t,r)=>{let n=Ce.ERROR_MESSAGES[e],s=`${n.message}${t?` (${t})`:""}`,o={...n,...r,...t&&{transportName:t}};return t?new qn(s,t,o):new $r(s,"LOGGER_ERROR",o)};Ce.createDetailedError=XM;var eF=(e,t,r=!1)=>{if(r&&!t)throw new $a(`Required environment variable ${e} is not set`,{missingVariable:e,message:`Required environment variable ${e} is not set`})};Ce.validateEnvironmentVariable=eF;var tF=(e,t,r)=>{let n=r.filter(s=>!t[s]);if(n.length>0)throw new qn(`Missing required configuration fields: ${n.join(", ")}`,e,{missingFields:n,message:`Missing required configuration fields: ${n.join(", ")}`})};Ce.validateTransportConfig=tF;var rF=(e,t,r=!0)=>{let n;if(e instanceof $r?n=e:e instanceof Error?n=new qn(`Unexpected error in ${t}: ${e.message}`,t,{originalError:e.message,stack:e.stack}):n=new qn(`Unknown error in ${t}`,t,{originalError:e}),r&&(console.error(`[LOGGER ERROR] ${n.message}`),n.details?.solution&&console.error(`[LOGGER SOLUTION] ${n.details.solution}`),n.details?.example&&console.error(`[LOGGER EXAMPLE] ${n.details.example}`)),!r)throw n};Ce.handleTransportError=rF});var Uu=b(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.createDataDogTransport=void 0;var Hs=Ft(),qs=zr(),nF=ur(),sF=(e={})=>{let t="DataDog";try{let r=e.level??Hs.LogLevel.INFO,n=e.apiKey||process.env.DATADOG_API_KEY,s=e.serviceName||process.env.DD_SERVICE||process.env.SERVICE_NAME,o=e.source||"nodejs",i=e.tags||[],a=e.batchSize||10,c=e.flushInterval||5e3,d=e.region||process.env.DD_SITE||"us";(0,qs.validateEnvironmentVariable)("DATADOG_API_KEY",n,!0),(0,qs.validateTransportConfig)(t,{apiKey:n},["apiKey"]);let u=[...[`env:${process.env.NODE_ENV||"dev"}`,`service:${s||"unknown"}`,`source:${o}`],...i].join(","),m=[],p=null,h=async E=>{try{let B=`https://http-intake.logs.${d==="eu"?"eu.":""}datadoghq.com/api/v2/logs`,T=E.map(H=>({message:H.message,level:y(H.level),timestamp:new Date(H.timestamp).getTime(),ddsource:o,ddtags:u,service:s,...H.context,...H.error&&{error_name:H.error.name,error_message:H.error.message,error_stack:H.error.stack},...H.metadata&&{metadata:H.metadata}})),A=await fetch(B,{method:"POST",headers:{"Content-Type":"application/json","DD-API-KEY":n},body:JSON.stringify(T)});if(!A.ok)throw(0,qs.createDetailedError)("DATADOG_API_ERROR",t,{status:A.status,statusText:A.statusText,url:B,responseBody:await A.text().catch(()=>"Unable to read response body")})}catch(B){(0,qs.handleTransportError)(B,t,!0)}},y=E=>{switch(E){case Hs.LogLevel.DEBUG:return"debug";case Hs.LogLevel.INFO:return"info";case Hs.LogLevel.WARN:return"warning";case Hs.LogLevel.ERROR:return"error";case Hs.LogLevel.FATAL:return"critical";default:return"info"}},_=async()=>{if(m.length===0)return;let E=[...m];m=[],await h(E)};return(()=>{p||(p=setInterval(()=>{_().catch(E=>{(0,qs.handleTransportError)(E,t,!0)})},c))})(),{log:async E=>{(0,nF.shouldLog)(E.level,r)&&(m.push(E),m.length>=a&&await _())},setLevel:E=>{r=E},getLevel:()=>r,flush:async()=>{await _()},close:async()=>{p&&(clearInterval(p),p=null),await _()},addTags:E=>{i.push(...E)},getConfig:()=>({serviceName:s,source:o,tags:[...i],region:d,batchSize:a,flushInterval:c})}}catch(r){throw(0,qs.handleTransportError)(r,t,!1),r}};za.createDataDogTransport=sF});var Bu=b(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.createSplunkTransport=void 0;var Gs=Ft(),Gn=zr(),oF=ur(),iF=(e={})=>{let t="Splunk";try{let r=e.level??Gs.LogLevel.INFO,n=e.hecUrl||process.env.SPLUNK_HEC_URL,s=e.hecToken||process.env.SPLUNK_HEC_TOKEN,o=e.source||"nodejs-logger",i=e.sourcetype||"_json",a=e.index||process.env.SPLUNK_INDEX,c=e.batchSize||10,d=e.flushInterval||5e3,l=e.channel||process.env.SPLUNK_CHANNEL;(0,Gn.validateEnvironmentVariable)("SPLUNK_HEC_URL",n,!0),(0,Gn.validateEnvironmentVariable)("SPLUNK_HEC_TOKEN",s,!0),(0,Gn.validateTransportConfig)(t,{hecUrl:n,hecToken:s},["hecUrl","hecToken"]);let u=[],m=null,p=async w=>{try{let E=w.map(T=>({event:{message:T.message,level:h(T.level),timestamp:new Date(T.timestamp).getTime(),...T.context,...T.error&&{error_name:T.error.name,error_message:T.error.message,error_stack:T.error.stack},...T.metadata&&{metadata:T.metadata}},sourcetype:i,source:o,...a&&{index:a},...l&&{channel:l}})),B=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Splunk ${s}`},body:JSON.stringify(E)});if(!B.ok)throw(0,Gn.createDetailedError)("SPLUNK_API_ERROR",t,{status:B.status,statusText:B.statusText,url:n,responseBody:await B.text().catch(()=>"Unable to read response body")})}catch(E){(0,Gn.handleTransportError)(E,t,!0)}},h=w=>{switch(w){case Gs.LogLevel.DEBUG:return"DEBUG";case Gs.LogLevel.INFO:return"INFO";case Gs.LogLevel.WARN:return"WARN";case Gs.LogLevel.ERROR:return"ERROR";case Gs.LogLevel.FATAL:return"FATAL";default:return"INFO"}},y=async()=>{if(u.length===0)return;let w=[...u];u=[],await p(w)};return(()=>{m||(m=setInterval(()=>{y().catch(w=>{(0,Gn.handleTransportError)(w,t,!0)})},d))})(),{log:async w=>{(0,oF.shouldLog)(w.level,r)&&(u.push(w),u.length>=c&&await y())},setLevel:w=>{r=w},getLevel:()=>r,flush:async()=>{await y()},close:async()=>{m&&(clearInterval(m),m=null),await y()},getConfig:()=>({hecUrl:n,source:o,sourcetype:i,index:a,channel:l,batchSize:c,flushInterval:d})}}catch(r){throw(0,Gn.handleTransportError)(r,t,!1),r}};Ha.createSplunkTransport=iF});var $u=b(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.createElasticsearchTransport=void 0;var Vs=Ft(),Ws=zr(),aF=ur(),cF=(e={})=>{let t="Elasticsearch";try{let r=e.level??Vs.LogLevel.INFO,n=e.url||process.env.ELASTICSEARCH_URL||"http://localhost:9200",s=e.username||process.env.ELASTICSEARCH_USERNAME,o=e.password||process.env.ELASTICSEARCH_PASSWORD,i=e.apiKey||process.env.ELASTICSEARCH_API_KEY,a=e.index||process.env.ELASTICSEARCH_INDEX||"logs",c=e.indexPattern||process.env.ELASTICSEARCH_INDEX_PATTERN||"logs-{YYYY.MM.DD}",d=e.batchSize||10,l=e.flushInterval||5e3,u=e.timeout||3e4;if(!i&&(!s||!o))throw(0,Ws.createDetailedError)("ELASTICSEARCH_MISSING_AUTH",t,{message:"Elasticsearch transport requires either API key or username/password"});let m=[],p=null,h=()=>{if(c?.includes("{YYYY.MM.DD}")){let A=new Date().toISOString().split("T")[0]?.replace(/-/g,".");if(!A)throw(0,Ws.createDetailedError)("ELASTICSEARCH_MISSING_DATE",t,{message:"Date string is missing"});return c.replace("{YYYY.MM.DD}",A)}return typeof a=="string"&&a.length>0?a:"logs"},y=()=>i?{Authorization:`ApiKey ${i}`}:s&&o?{Authorization:`Basic ${Buffer.from(`${s}:${o}`).toString("base64")}`}:{},_=async T=>{try{let A=h(),H=`${n}/_bulk`,Z=`${T.map(K=>{let Ee={message:K.message,level:w(K.level),timestamp:new Date(K.timestamp).toISOString(),service:process.env.SERVICE_NAME||"unknown",...K.context,...K.error&&{error_name:K.error.name,error_message:K.error.message,error_stack:K.error.stack},...K.metadata&&{metadata:K.metadata}};return`${JSON.stringify({index:{_index:A}})}
3
- ${JSON.stringify(Ee)}`}).join(`
1
+ "use strict";var Qn=Object.create;var Ot=Object.defineProperty;var Xn=Object.getOwnPropertyDescriptor;var es=Object.getOwnPropertyNames;var ts=Object.getPrototypeOf,rs=Object.prototype.hasOwnProperty;var O=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ns=(t,e)=>{for(var r in e)Ot(t,r,{get:e[r],enumerable:!0})},Or=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of es(e))!rs.call(t,s)&&s!==r&&Ot(t,s,{get:()=>e[s],enumerable:!(n=Xn(e,s))||n.enumerable});return t};var sr=(t,e,r)=>(r=t!=null?Qn(ts(t)):{},Or(e||!t||!t.__esModule?Ot(r,"default",{value:t,enumerable:!0}):r,t)),ss=t=>Or(Ot({},"__esModule",{value:!0}),t);var ar=O(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.createJsonFormatter=void 0;var as=t=>{switch(t){case 0:return"DEBUG";case 1:return"INFO";case 2:return"WARN";case 3:return"ERROR";case 4:return"FATAL";default:return"UNKNOWN"}},os=()=>({format:t=>JSON.stringify({timestamp:t.timestamp,level:as(t.level),message:t.message,...t.context,...t.error&&{error:{name:t.error.name,message:t.error.message,stack:t.error.stack}},...t.metadata&&{metadata:t.metadata}})});Rt.createJsonFormatter=os});var le=O(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.LogLevel=void 0;var Rr;(function(t){t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR",t[t.FATAL=4]="FATAL"})(Rr||(Dt.LogLevel=Rr={}))});var _e=O(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.shouldLog=ot.BaseTransport=void 0;var is=le(),or=class{constructor(){this.level=is.LogLevel.INFO}setLevel(e){this.level=e}getLevel(){return this.level}shouldLog(e){return e>=this.level}};ot.BaseTransport=or;var cs=(t,e)=>t>=e;ot.shouldLog=cs});var Zt=O(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.createConsoleTransport=void 0;var it=le(),ls=_e(),us=(t={})=>{let e=t.level??it.LogLevel.INFO,r=t.formatter||{format:n=>JSON.stringify(n)};return{log:n=>{if(!(0,ls.shouldLog)(n.level,e))return;let s=r.format(n);switch(n.level){case it.LogLevel.DEBUG:console.debug(s);break;case it.LogLevel.INFO:console.info(s);break;case it.LogLevel.WARN:console.warn(s);break;case it.LogLevel.ERROR:case it.LogLevel.FATAL:console.error(s);break}},setLevel:n=>{e=n},getLevel:()=>e}};Pt.createConsoleTransport=us});var ir=O(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.createBatchedLogger=Me.createBatchedTransport=void 0;var ds=(t,e={maxSize:100,maxWaitTime:5e3,maxBatchSize:1024*1024})=>{let r={logs:[],currentSize:0,lastFlush:Date.now()},n={totalLogs:0,totalBatches:0,averageBatchSize:0,lastFlushTime:0,pendingLogs:0},s=p=>p.reduce((d,m)=>d+JSON.stringify(m).length,0),a=async()=>{if(r.logs.length===0)return;let p=[...r.logs];r.logs=[],r.currentSize=0,r.lastFlush=Date.now(),r.flushTimer&&(clearTimeout(r.flushTimer),r.flushTimer=void 0);try{await Promise.allSettled(p.map(d=>t.log(d))),n.totalLogs+=p.length,n.totalBatches+=1,n.averageBatchSize=n.totalLogs/n.totalBatches,n.lastFlushTime=Date.now(),n.pendingLogs=r.logs.length}catch(d){console.error("Batch flush failed:",d),r.logs.unshift(...p),r.currentSize=s(r.logs)}},i=()=>{r.flushTimer||(r.flushTimer=setTimeout(()=>{a().catch(console.error)},e.maxWaitTime))};return{log:async p=>{let d=JSON.stringify(p).length;(r.logs.length>=e.maxSize||r.currentSize+d>=e.maxBatchSize)&&await a(),r.logs.push(p),r.currentSize+=d,n.pendingLogs=r.logs.length,r.logs.length===1&&i()},setLevel:p=>{t.setLevel(p)},getLevel:()=>t.getLevel(),flush:a,getStats:()=>({...n,pendingLogs:r.logs.length})}};Me.createBatchedTransport=ds;var gs=(t,e={maxSize:50,maxWaitTime:2e3,maxBatchSize:512*1024})=>{let r=t.map(g=>(0,Me.createBatchedTransport)(g,e));return{log:async g=>{await Promise.allSettled(r.map(u=>u.log(g)))},setLevel:g=>{for(let u of r)u.setLevel(g)},getLevel:()=>Math.min(...r.map(g=>g.getLevel())),flush:async()=>{await Promise.allSettled(r.map(g=>g.flush()))},getStats:()=>r.map(g=>g.getStats())}};Me.createBatchedLogger=gs});var cr=O(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.createDefaultEnrichmentMiddleware=P.createEnrichmentMiddleware=P.createLoggerInstanceEnricher=P.createUserEnricher=P.createEnvironmentEnricher=P.createSessionEnricher=P.createCorrelationEnricher=P.generateLoggerInstanceId=P.generateSpanId=P.generateTraceId=P.generateCorrelationId=void 0;var ps=()=>`corr_${Date.now()}_${Math.random().toString(36).substr(2,9)}`;P.generateCorrelationId=ps;var ms=()=>Math.random().toString(16).substr(2,32);P.generateTraceId=ms;var fs=()=>Math.random().toString(16).substr(2,16);P.generateSpanId=fs;var hs=()=>{let t=Date.now(),e=Math.random().toString(36).substr(2,9),r=process.pid||0;return`logger_${t}_${e}_${r}`};P.generateLoggerInstanceId=hs;var vs=()=>{let t,e,r;return{name:"correlation",enrich:n=>(n.correlationId||(t=t||(0,P.generateCorrelationId)(),n.correlationId=t),n.traceId||(e=e||(0,P.generateTraceId)(),n.traceId=e),n.spanId||(r=r||(0,P.generateSpanId)(),n.spanId=r),n)}};P.createCorrelationEnricher=vs;var ys=t=>{let e=t||`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`;return{name:"session",enrich:r=>(r.sessionId||(r.sessionId=e),r)}};P.createSessionEnricher=ys;var _s=(t,e)=>({name:"environment",enrich:r=>(t&&!r.serviceName&&(r.serviceName=t),e&&!r.stage&&(r.stage=e),r)});P.createEnvironmentEnricher=_s;var Is=t=>({name:"user",enrich:e=>(t&&!e.userId&&(e.userId=t),e)});P.createUserEnricher=Is;var Ss=t=>({name:"loggerInstance",enrich:e=>(e.instanceId||(e.instanceId=t),e)});P.createLoggerInstanceEnricher=Ss;var Ts=t=>e=>t.reduce((r,n)=>n.enrich(r),{...e});P.createEnrichmentMiddleware=Ts;var Cs=(t,e,r,n)=>{let s=[(0,P.createCorrelationEnricher)(),(0,P.createSessionEnricher)(r),(0,P.createEnvironmentEnricher)(t,e)];return n&&s.push((0,P.createLoggerInstanceEnricher)(n)),(0,P.createEnrichmentMiddleware)(s)};P.createDefaultEnrichmentMiddleware=Cs});var Ct=O(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.getParsedType=W.ZodParsedType=W.objectUtil=W.util=void 0;var lr;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{let a={};for(let i of s)a[i]=i;return a},t.getValidEnumValues=s=>{let a=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(let o of a)i[o]=s[o];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(a){return s[a]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let a=[];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},t.find=(s,a)=>{for(let i of s)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(lr||(W.util=lr={}));var Dr;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Dr||(W.objectUtil=Dr={}));W.ZodParsedType=lr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var bs=t=>{switch(typeof t){case"undefined":return W.ZodParsedType.undefined;case"string":return W.ZodParsedType.string;case"number":return Number.isNaN(t)?W.ZodParsedType.nan:W.ZodParsedType.number;case"boolean":return W.ZodParsedType.boolean;case"function":return W.ZodParsedType.function;case"bigint":return W.ZodParsedType.bigint;case"symbol":return W.ZodParsedType.symbol;case"object":return Array.isArray(t)?W.ZodParsedType.array:t===null?W.ZodParsedType.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?W.ZodParsedType.promise:typeof Map<"u"&&t instanceof Map?W.ZodParsedType.map:typeof Set<"u"&&t instanceof Set?W.ZodParsedType.set:typeof Date<"u"&&t instanceof Date?W.ZodParsedType.date:W.ZodParsedType.object;default:return W.ZodParsedType.unknown}};W.getParsedType=bs});var Ft=O(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.ZodError=we.quotelessJson=we.ZodIssueCode=void 0;var Pr=Ct();we.ZodIssueCode=Pr.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var Es=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");we.quotelessJson=Es;var bt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(a){return a.message},n={_errors:[]},s=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let o=n,g=0;for(;g<i.path.length;){let u=i.path[g];g===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(i))):o[u]=o[u]||{_errors:[]},o=o[u],g++}}};return s(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Pr.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let s of this.issues)if(s.path.length>0){let a=s.path[0];r[a]=r[a]||[],r[a].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};we.ZodError=bt;bt.create=t=>new bt(t)});var dr=O(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});var K=Ft(),je=Ct(),Ls=(t,e)=>{let r;switch(t.code){case K.ZodIssueCode.invalid_type:t.received===je.ZodParsedType.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case K.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,je.util.jsonStringifyReplacer)}`;break;case K.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${je.util.joinValues(t.keys,", ")}`;break;case K.ZodIssueCode.invalid_union:r="Invalid input";break;case K.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${je.util.joinValues(t.options)}`;break;case K.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${je.util.joinValues(t.options)}, received '${t.received}'`;break;case K.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case K.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case K.ZodIssueCode.invalid_date:r="Invalid date";break;case K.ZodIssueCode.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:je.util.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case K.ZodIssueCode.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case K.ZodIssueCode.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case K.ZodIssueCode.custom:r="Invalid input";break;case K.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case K.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case K.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=e.defaultError,je.util.assertNever(t)}return{message:r}};ur.default=Ls});var Mt=O(Ne=>{"use strict";var xs=Ne&&Ne.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.defaultErrorMap=void 0;Ne.setErrorMap=ws;Ne.getErrorMap=Ns;var Zr=xs(dr());Ne.defaultErrorMap=Zr.default;var Fr=Zr.default;function ws(t){Fr=t}function Ns(){return Fr}});var pr=O(M=>{"use strict";var As=M&&M.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(M,"__esModule",{value:!0});M.isAsync=M.isValid=M.isDirty=M.isAborted=M.OK=M.DIRTY=M.INVALID=M.ParseStatus=M.EMPTY_PATH=M.makeIssue=void 0;M.addIssueToContext=Rs;var ks=Mt(),Mr=As(dr()),Os=t=>{let{data:e,path:r,errorMaps:n,issueData:s}=t,a=[...r,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="",g=n.filter(u=>!!u).slice().reverse();for(let u of g)o=u(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}};M.makeIssue=Os;M.EMPTY_PATH=[];function Rs(t,e){let r=(0,ks.getErrorMap)(),n=(0,M.makeIssue)({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Mr.default?void 0:Mr.default].filter(s=>!!s)});t.common.issues.push(n)}var gr=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let s of r){if(s.status==="aborted")return M.INVALID;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let s of r){let a=await s.key,i=await s.value;n.push({key:a,value:i})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let s of r){let{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return M.INVALID;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}};M.ParseStatus=gr;M.INVALID=Object.freeze({status:"aborted"});var Ds=t=>({status:"dirty",value:t});M.DIRTY=Ds;var Ps=t=>({status:"valid",value:t});M.OK=Ps;var Zs=t=>t.status==="aborted";M.isAborted=Zs;var Fs=t=>t.status==="dirty";M.isDirty=Fs;var Ms=t=>t.status==="valid";M.isValid=Ms;var js=t=>typeof Promise<"u"&&t instanceof Promise;M.isAsync=js});var Ur=O(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0})});var $r=O(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.errorUtil=void 0;var Wr;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Wr||(jt.errorUtil=Wr={}))});var en=O(c=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});c.discriminatedUnion=c.date=c.boolean=c.bigint=c.array=c.any=c.coerce=c.ZodFirstPartyTypeKind=c.late=c.ZodSchema=c.Schema=c.ZodReadonly=c.ZodPipeline=c.ZodBranded=c.BRAND=c.ZodNaN=c.ZodCatch=c.ZodDefault=c.ZodNullable=c.ZodOptional=c.ZodTransformer=c.ZodEffects=c.ZodPromise=c.ZodNativeEnum=c.ZodEnum=c.ZodLiteral=c.ZodLazy=c.ZodFunction=c.ZodSet=c.ZodMap=c.ZodRecord=c.ZodTuple=c.ZodIntersection=c.ZodDiscriminatedUnion=c.ZodUnion=c.ZodObject=c.ZodArray=c.ZodVoid=c.ZodNever=c.ZodUnknown=c.ZodAny=c.ZodNull=c.ZodUndefined=c.ZodSymbol=c.ZodDate=c.ZodBoolean=c.ZodBigInt=c.ZodNumber=c.ZodString=c.ZodType=void 0;c.NEVER=c.void=c.unknown=c.union=c.undefined=c.tuple=c.transformer=c.symbol=c.string=c.strictObject=c.set=c.record=c.promise=c.preprocess=c.pipeline=c.ostring=c.optional=c.onumber=c.oboolean=c.object=c.number=c.nullable=c.null=c.never=c.nativeEnum=c.nan=c.map=c.literal=c.lazy=c.intersection=c.instanceof=c.function=c.enum=c.effect=void 0;c.datetimeRegex=zr;c.custom=Kr;var v=Ft(),Ut=Mt(),C=$r(),l=pr(),_=Ct(),ae=class{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Vr=(t,e)=>{if((0,l.isValid)(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new v.ZodError(t.common.issues);return this._error=r,this._error}}};function w(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{let{message:g}=t;return i.code==="invalid_enum_value"?{message:g??o.defaultError}:typeof o.data>"u"?{message:g??n??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:g??r??o.defaultError}},description:s}}var N=class{get description(){return this._def.description}_getType(e){return(0,_.getParsedType)(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:(0,_.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new l.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,_.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if((0,l.isAsync)(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,_.getParsedType)(e)},s=this._parseSync({data:e,path:n.path,parent:n});return Vr(n,s)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,_.getParsedType)(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return(0,l.isValid)(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>(0,l.isValid)(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,_.getParsedType)(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await((0,l.isAsync)(s)?s:Promise.resolve(s));return Vr(n,a)}refine(e,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,a)=>{let i=e(s),o=()=>a.addIssue({code:v.ZodIssueCode.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(g=>g?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new ee({schema:this,typeName:x.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return se.create(this,this._def)}nullable(){return he.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Te.create(this)}promise(){return Oe.create(this,this._def)}or(e){return qe.create([this,e],this._def)}and(e){return ze.create(this,e,this._def)}transform(e){return new ee({...w(this._def),schema:this,typeName:x.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Qe({...w(this._def),innerType:this,defaultValue:r,typeName:x.ZodDefault})}brand(){return new Et({typeName:x.ZodBranded,type:this,...w(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Xe({...w(this._def),innerType:this,catchValue:r,typeName:x.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Lt.create(this,e)}readonly(){return et.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};c.ZodType=N;c.Schema=N;c.ZodSchema=N;var Us=/^c[^\s-]{8,}$/i,Ws=/^[0-9a-z]+$/,$s=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Vs=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Gs=/^[a-z0-9_-]{21}$/i,Bs=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,qs=/^[-+]?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)?)??$/,zs=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Hs="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",mr,Ks=/^(?:(?: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])$/,Js=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Ys=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Qs=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Xs=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ea=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Br="((\\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])))",ta=new RegExp(`^${Br}$`);function qr(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function ra(t){return new RegExp(`^${qr(t)}$`)}function zr(t){let e=`${Br}T${qr(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function na(t,e){return!!((e==="v4"||!e)&&Ks.test(t)||(e==="v6"||!e)&&Ys.test(t))}function sa(t,e){if(!Bs.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function aa(t,e){return!!((e==="v4"||!e)&&Js.test(t)||(e==="v6"||!e)&&Qs.test(t))}var Ae=class t extends N{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==_.ZodParsedType.string){let a=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(a,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.string,received:a.parsedType}),l.INVALID}let n=new l.ParseStatus,s;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{code:v.ZodIssueCode.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{code:v.ZodIssueCode.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?(0,l.addIssueToContext)(s,{code:v.ZodIssueCode.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&(0,l.addIssueToContext)(s,{code:v.ZodIssueCode.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")zs.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{validation:"email",code:v.ZodIssueCode.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")mr||(mr=new RegExp(Hs,"u")),mr.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{validation:"emoji",code:v.ZodIssueCode.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Vs.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{validation:"uuid",code:v.ZodIssueCode.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")Gs.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{validation:"nanoid",code:v.ZodIssueCode.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Us.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{validation:"cuid",code:v.ZodIssueCode.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Ws.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{validation:"cuid2",code:v.ZodIssueCode.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")$s.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{validation:"ulid",code:v.ZodIssueCode.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{validation:"url",code:v.ZodIssueCode.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{validation:"regex",code:v.ZodIssueCode.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{code:v.ZodIssueCode.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{code:v.ZodIssueCode.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{code:v.ZodIssueCode.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?zr(a).test(e.data)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{code:v.ZodIssueCode.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?ta.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{code:v.ZodIssueCode.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?ra(a).test(e.data)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{code:v.ZodIssueCode.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?qs.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{validation:"duration",code:v.ZodIssueCode.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?na(e.data,a.version)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{validation:"ip",code:v.ZodIssueCode.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?sa(e.data,a.alg)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{validation:"jwt",code:v.ZodIssueCode.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?aa(e.data,a.version)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{validation:"cidr",code:v.ZodIssueCode.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Xs.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{validation:"base64",code:v.ZodIssueCode.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?ea.test(e.data)||(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{validation:"base64url",code:v.ZodIssueCode.invalid_string,message:a.message}),n.dirty()):_.util.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:v.ZodIssueCode.invalid_string,...C.errorUtil.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...C.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...C.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...C.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...C.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...C.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...C.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...C.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...C.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...C.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...C.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...C.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...C.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...C.errorUtil.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...C.errorUtil.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...C.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...C.errorUtil.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...C.errorUtil.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...C.errorUtil.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...C.errorUtil.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...C.errorUtil.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...C.errorUtil.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...C.errorUtil.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...C.errorUtil.errToObj(r)})}nonempty(e){return this.min(1,C.errorUtil.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};c.ZodString=Ae;Ae.create=t=>new Ae({checks:[],typeName:x.ZodString,coerce:t?.coerce??!1,...w(t)});function oa(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,a=Number.parseInt(t.toFixed(s).replace(".","")),i=Number.parseInt(e.toFixed(s).replace(".",""));return a%i/10**s}var Ue=class t extends N{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==_.ZodParsedType.number){let a=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(a,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.number,received:a.parsedType}),l.INVALID}let n,s=new l.ParseStatus;for(let a of this._def.checks)a.kind==="int"?_.util.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?oa(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.not_finite,message:a.message}),s.dirty()):_.util.assertNever(a);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,C.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,C.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,C.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,C.errorUtil.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:C.errorUtil.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:C.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:C.errorUtil.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:C.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.errorUtil.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_.util.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};c.ZodNumber=Ue;Ue.create=t=>new Ue({checks:[],typeName:x.ZodNumber,coerce:t?.coerce||!1,...w(t)});var We=class t extends N{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==_.ZodParsedType.bigint)return this._getInvalidInput(e);let n,s=new l.ParseStatus;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):_.util.assertNever(a);return{status:s.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(r,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.bigint,received:r.parsedType}),l.INVALID}gte(e,r){return this.setLimit("min",e,!0,C.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,C.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,C.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,C.errorUtil.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:C.errorUtil.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:C.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:C.errorUtil.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};c.ZodBigInt=We;We.create=t=>new We({checks:[],typeName:x.ZodBigInt,coerce:t?.coerce??!1,...w(t)});var $e=class extends N{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==_.ZodParsedType.boolean){let n=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.boolean,received:n.parsedType}),l.INVALID}return(0,l.OK)(e.data)}};c.ZodBoolean=$e;$e.create=t=>new $e({typeName:x.ZodBoolean,coerce:t?.coerce||!1,...w(t)});var Ve=class t extends N{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==_.ZodParsedType.date){let a=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(a,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.date,received:a.parsedType}),l.INVALID}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(a,{code:v.ZodIssueCode.invalid_date}),l.INVALID}let n=new l.ParseStatus,s;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{code:v.ZodIssueCode.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),(0,l.addIssueToContext)(s,{code:v.ZodIssueCode.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):_.util.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:C.errorUtil.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:C.errorUtil.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};c.ZodDate=Ve;Ve.create=t=>new Ve({checks:[],coerce:t?.coerce||!1,typeName:x.ZodDate,...w(t)});var lt=class extends N{_parse(e){if(this._getType(e)!==_.ZodParsedType.symbol){let n=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.symbol,received:n.parsedType}),l.INVALID}return(0,l.OK)(e.data)}};c.ZodSymbol=lt;lt.create=t=>new lt({typeName:x.ZodSymbol,...w(t)});var Ge=class extends N{_parse(e){if(this._getType(e)!==_.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.undefined,received:n.parsedType}),l.INVALID}return(0,l.OK)(e.data)}};c.ZodUndefined=Ge;Ge.create=t=>new Ge({typeName:x.ZodUndefined,...w(t)});var Be=class extends N{_parse(e){if(this._getType(e)!==_.ZodParsedType.null){let n=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.null,received:n.parsedType}),l.INVALID}return(0,l.OK)(e.data)}};c.ZodNull=Be;Be.create=t=>new Be({typeName:x.ZodNull,...w(t)});var ke=class extends N{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,l.OK)(e.data)}};c.ZodAny=ke;ke.create=t=>new ke({typeName:x.ZodAny,...w(t)});var Se=class extends N{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,l.OK)(e.data)}};c.ZodUnknown=Se;Se.create=t=>new Se({typeName:x.ZodUnknown,...w(t)});var ue=class extends N{_parse(e){let r=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(r,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.never,received:r.parsedType}),l.INVALID}};c.ZodNever=ue;ue.create=t=>new ue({typeName:x.ZodNever,...w(t)});var ut=class extends N{_parse(e){if(this._getType(e)!==_.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.void,received:n.parsedType}),l.INVALID}return(0,l.OK)(e.data)}};c.ZodVoid=ut;ut.create=t=>new ut({typeName:x.ZodVoid,...w(t)});var Te=class t extends N{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==_.ZodParsedType.array)return(0,l.addIssueToContext)(r,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.array,received:r.parsedType}),l.INVALID;if(s.exactLength!==null){let i=r.data.length>s.exactLength.value,o=r.data.length<s.exactLength.value;(i||o)&&((0,l.addIssueToContext)(r,{code:i?v.ZodIssueCode.too_big:v.ZodIssueCode.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&((0,l.addIssueToContext)(r,{code:v.ZodIssueCode.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&((0,l.addIssueToContext)(r,{code:v.ZodIssueCode.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>s.type._parseAsync(new ae(r,i,r.path,o)))).then(i=>l.ParseStatus.mergeArray(n,i));let a=[...r.data].map((i,o)=>s.type._parseSync(new ae(r,i,r.path,o)));return l.ParseStatus.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:C.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:C.errorUtil.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:C.errorUtil.toString(r)}})}nonempty(e){return this.min(1,e)}};c.ZodArray=Te;Te.create=(t,e)=>new Te({type:t,minLength:null,maxLength:null,exactLength:null,typeName:x.ZodArray,...w(e)});function ct(t){if(t instanceof Y){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=se.create(ct(n))}return new Y({...t._def,shape:()=>e})}else return t instanceof Te?new Te({...t._def,type:ct(t.element)}):t instanceof se?se.create(ct(t.unwrap())):t instanceof he?he.create(ct(t.unwrap())):t instanceof fe?fe.create(t.items.map(e=>ct(e))):t}var Y=class t extends N{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=_.util.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==_.ZodParsedType.object){let u=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(u,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.object,received:u.parsedType}),l.INVALID}let{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ue&&this._def.unknownKeys==="strip"))for(let u in s.data)i.includes(u)||o.push(u);let g=[];for(let u of i){let h=a[u],p=s.data[u];g.push({key:{status:"valid",value:u},value:h._parse(new ae(s,p,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof ue){let u=this._def.unknownKeys;if(u==="passthrough")for(let h of o)g.push({key:{status:"valid",value:h},value:{status:"valid",value:s.data[h]}});else if(u==="strict")o.length>0&&((0,l.addIssueToContext)(s,{code:v.ZodIssueCode.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let h of o){let p=s.data[h];g.push({key:{status:"valid",value:h},value:u._parse(new ae(s,p,s.path,h)),alwaysSet:h in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let u=[];for(let h of g){let p=await h.key,d=await h.value;u.push({key:p,value:d,alwaysSet:h.alwaysSet})}return u}).then(u=>l.ParseStatus.mergeObjectSync(n,u)):l.ParseStatus.mergeObjectSync(n,g)}get shape(){return this._def.shape()}strict(e){return C.errorUtil.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:C.errorUtil.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:x.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of _.util.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of _.util.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return ct(this)}partial(e){let r={};for(let n of _.util.objectKeys(this.shape)){let s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of _.util.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof se;)a=a._def.innerType;r[n]=a}return new t({...this._def,shape:()=>r})}keyof(){return Hr(_.util.objectKeys(this.shape))}};c.ZodObject=Y;Y.create=(t,e)=>new Y({shape:()=>t,unknownKeys:"strip",catchall:ue.create(),typeName:x.ZodObject,...w(e)});Y.strictCreate=(t,e)=>new Y({shape:()=>t,unknownKeys:"strict",catchall:ue.create(),typeName:x.ZodObject,...w(e)});Y.lazycreate=(t,e)=>new Y({shape:t,unknownKeys:"strip",catchall:ue.create(),typeName:x.ZodObject,...w(e)});var qe=class extends N{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function s(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(o=>new v.ZodError(o.ctx.common.issues));return(0,l.addIssueToContext)(r,{code:v.ZodIssueCode.invalid_union,unionErrors:i}),l.INVALID}if(r.common.async)return Promise.all(n.map(async a=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let a,i=[];for(let g of n){let u={...r,common:{...r.common,issues:[]},parent:null},h=g._parseSync({data:r.data,path:r.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!a&&(a={result:h,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(g=>new v.ZodError(g));return(0,l.addIssueToContext)(r,{code:v.ZodIssueCode.invalid_union,unionErrors:o}),l.INVALID}}get options(){return this._def.options}};c.ZodUnion=qe;qe.create=(t,e)=>new qe({options:t,typeName:x.ZodUnion,...w(e)});var Ie=t=>t instanceof He?Ie(t.schema):t instanceof ee?Ie(t.innerType()):t instanceof Ke?[t.value]:t instanceof Je?t.options:t instanceof Ye?_.util.objectValues(t.enum):t instanceof Qe?Ie(t._def.innerType):t instanceof Ge?[void 0]:t instanceof Be?[null]:t instanceof se?[void 0,...Ie(t.unwrap())]:t instanceof he?[null,...Ie(t.unwrap())]:t instanceof Et||t instanceof et?Ie(t.unwrap()):t instanceof Xe?Ie(t._def.innerType):[],Wt=class t extends N{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==_.ZodParsedType.object)return(0,l.addIssueToContext)(r,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.object,received:r.parsedType}),l.INVALID;let n=this.discriminator,s=r.data[n],a=this.optionsMap.get(s);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):((0,l.addIssueToContext)(r,{code:v.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),l.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let s=new Map;for(let a of r){let i=Ie(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of i){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,a)}}return new t({typeName:x.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...w(n)})}};c.ZodDiscriminatedUnion=Wt;function fr(t,e){let r=(0,_.getParsedType)(t),n=(0,_.getParsedType)(e);if(t===e)return{valid:!0,data:t};if(r===_.ZodParsedType.object&&n===_.ZodParsedType.object){let s=_.util.objectKeys(e),a=_.util.objectKeys(t).filter(o=>s.indexOf(o)!==-1),i={...t,...e};for(let o of a){let g=fr(t[o],e[o]);if(!g.valid)return{valid:!1};i[o]=g.data}return{valid:!0,data:i}}else if(r===_.ZodParsedType.array&&n===_.ZodParsedType.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let a=0;a<t.length;a++){let i=t[a],o=e[a],g=fr(i,o);if(!g.valid)return{valid:!1};s.push(g.data)}return{valid:!0,data:s}}else return r===_.ZodParsedType.date&&n===_.ZodParsedType.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ze=class extends N{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=(a,i)=>{if((0,l.isAborted)(a)||(0,l.isAborted)(i))return l.INVALID;let o=fr(a.value,i.value);return o.valid?(((0,l.isDirty)(a)||(0,l.isDirty)(i))&&r.dirty(),{status:r.value,value:o.data}):((0,l.addIssueToContext)(n,{code:v.ZodIssueCode.invalid_intersection_types}),l.INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};c.ZodIntersection=ze;ze.create=(t,e,r)=>new ze({left:t,right:e,typeName:x.ZodIntersection,...w(r)});var fe=class t extends N{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.ZodParsedType.array)return(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.array,received:n.parsedType}),l.INVALID;if(n.data.length<this._def.items.length)return(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),l.INVALID;!this._def.rest&&n.data.length>this._def.items.length&&((0,l.addIssueToContext)(n,{code:v.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,o)=>{let g=this._def.items[o]||this._def.rest;return g?g._parse(new ae(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>l.ParseStatus.mergeArray(r,i)):l.ParseStatus.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};c.ZodTuple=fe;fe.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fe({items:t,typeName:x.ZodTuple,rest:null,...w(e)})};var $t=class t extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.ZodParsedType.object)return(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.object,received:n.parsedType}),l.INVALID;let s=[],a=this._def.keyType,i=this._def.valueType;for(let o in n.data)s.push({key:a._parse(new ae(n,o,n.path,o)),value:i._parse(new ae(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?l.ParseStatus.mergeObjectAsync(r,s):l.ParseStatus.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof N?new t({keyType:e,valueType:r,typeName:x.ZodRecord,...w(n)}):new t({keyType:Ae.create(),valueType:e,typeName:x.ZodRecord,...w(r)})}};c.ZodRecord=$t;var dt=class extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.ZodParsedType.map)return(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.map,received:n.parsedType}),l.INVALID;let s=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,g],u)=>({key:s._parse(new ae(n,o,n.path,[u,"key"])),value:a._parse(new ae(n,g,n.path,[u,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let g of i){let u=await g.key,h=await g.value;if(u.status==="aborted"||h.status==="aborted")return l.INVALID;(u.status==="dirty"||h.status==="dirty")&&r.dirty(),o.set(u.value,h.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let g of i){let u=g.key,h=g.value;if(u.status==="aborted"||h.status==="aborted")return l.INVALID;(u.status==="dirty"||h.status==="dirty")&&r.dirty(),o.set(u.value,h.value)}return{status:r.value,value:o}}}};c.ZodMap=dt;dt.create=(t,e,r)=>new dt({valueType:e,keyType:t,typeName:x.ZodMap,...w(r)});var gt=class t extends N{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.ZodParsedType.set)return(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.set,received:n.parsedType}),l.INVALID;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&((0,l.addIssueToContext)(n,{code:v.ZodIssueCode.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&((0,l.addIssueToContext)(n,{code:v.ZodIssueCode.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let a=this._def.valueType;function i(g){let u=new Set;for(let h of g){if(h.status==="aborted")return l.INVALID;h.status==="dirty"&&r.dirty(),u.add(h.value)}return{status:r.value,value:u}}let o=[...n.data.values()].map((g,u)=>a._parse(new ae(n,g,n.path,u)));return n.common.async?Promise.all(o).then(g=>i(g)):i(o)}min(e,r){return new t({...this._def,minSize:{value:e,message:C.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:C.errorUtil.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};c.ZodSet=gt;gt.create=(t,e)=>new gt({valueType:t,minSize:null,maxSize:null,typeName:x.ZodSet,...w(e)});var Vt=class t extends N{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==_.ZodParsedType.function)return(0,l.addIssueToContext)(r,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.function,received:r.parsedType}),l.INVALID;function n(o,g){return(0,l.makeIssue)({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,Ut.getErrorMap)(),Ut.defaultErrorMap].filter(u=>!!u),issueData:{code:v.ZodIssueCode.invalid_arguments,argumentsError:g}})}function s(o,g){return(0,l.makeIssue)({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,(0,Ut.getErrorMap)(),Ut.defaultErrorMap].filter(u=>!!u),issueData:{code:v.ZodIssueCode.invalid_return_type,returnTypeError:g}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Oe){let o=this;return(0,l.OK)(async function(...g){let u=new v.ZodError([]),h=await o._def.args.parseAsync(g,a).catch(m=>{throw u.addIssue(n(g,m)),u}),p=await Reflect.apply(i,this,h);return await o._def.returns._def.type.parseAsync(p,a).catch(m=>{throw u.addIssue(s(p,m)),u})})}else{let o=this;return(0,l.OK)(function(...g){let u=o._def.args.safeParse(g,a);if(!u.success)throw new v.ZodError([n(g,u.error)]);let h=Reflect.apply(i,this,u.data),p=o._def.returns.safeParse(h,a);if(!p.success)throw new v.ZodError([s(h,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:fe.create(e).rest(Se.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||fe.create([]).rest(Se.create()),returns:r||Se.create(),typeName:x.ZodFunction,...w(n)})}};c.ZodFunction=Vt;var He=class extends N{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};c.ZodLazy=He;He.create=(t,e)=>new He({getter:t,typeName:x.ZodLazy,...w(e)});var Ke=class extends N{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(r,{received:r.data,code:v.ZodIssueCode.invalid_literal,expected:this._def.value}),l.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}};c.ZodLiteral=Ke;Ke.create=(t,e)=>new Ke({value:t,typeName:x.ZodLiteral,...w(e)});function Hr(t,e){return new Je({values:t,typeName:x.ZodEnum,...w(e)})}var Je=class t extends N{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return(0,l.addIssueToContext)(r,{expected:_.util.joinValues(n),received:r.parsedType,code:v.ZodIssueCode.invalid_type}),l.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return(0,l.addIssueToContext)(r,{received:r.data,code:v.ZodIssueCode.invalid_enum_value,options:n}),l.INVALID}return(0,l.OK)(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};c.ZodEnum=Je;Je.create=Hr;var Ye=class extends N{_parse(e){let r=_.util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==_.ZodParsedType.string&&n.parsedType!==_.ZodParsedType.number){let s=_.util.objectValues(r);return(0,l.addIssueToContext)(n,{expected:_.util.joinValues(s),received:n.parsedType,code:v.ZodIssueCode.invalid_type}),l.INVALID}if(this._cache||(this._cache=new Set(_.util.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=_.util.objectValues(r);return(0,l.addIssueToContext)(n,{received:n.data,code:v.ZodIssueCode.invalid_enum_value,options:s}),l.INVALID}return(0,l.OK)(e.data)}get enum(){return this._def.values}};c.ZodNativeEnum=Ye;Ye.create=(t,e)=>new Ye({values:t,typeName:x.ZodNativeEnum,...w(e)});var Oe=class extends N{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==_.ZodParsedType.promise&&r.common.async===!1)return(0,l.addIssueToContext)(r,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.promise,received:r.parsedType}),l.INVALID;let n=r.parsedType===_.ZodParsedType.promise?r.data:Promise.resolve(r.data);return(0,l.OK)(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};c.ZodPromise=Oe;Oe.create=(t,e)=>new Oe({type:t,typeName:x.ZodPromise,...w(e)});var ee=class extends N{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===x.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{(0,l.addIssueToContext)(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){let i=s.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return l.INVALID;let g=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return g.status==="aborted"?l.INVALID:g.status==="dirty"||r.value==="dirty"?(0,l.DIRTY)(g.value):g});{if(r.value==="aborted")return l.INVALID;let o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?l.INVALID:o.status==="dirty"||r.value==="dirty"?(0,l.DIRTY)(o.value):o}}if(s.type==="refinement"){let i=o=>{let g=s.refinement(o,a);if(n.common.async)return Promise.resolve(g);if(g instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?l.INVALID:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?l.INVALID:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0,l.isValid)(i))return l.INVALID;let o=s.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>(0,l.isValid)(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:r.value,value:o})):l.INVALID);_.util.assertNever(s)}};c.ZodEffects=ee;c.ZodTransformer=ee;ee.create=(t,e,r)=>new ee({schema:t,typeName:x.ZodEffects,effect:e,...w(r)});ee.createWithPreprocess=(t,e,r)=>new ee({schema:e,effect:{type:"preprocess",transform:t},typeName:x.ZodEffects,...w(r)});var se=class extends N{_parse(e){return this._getType(e)===_.ZodParsedType.undefined?(0,l.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};c.ZodOptional=se;se.create=(t,e)=>new se({innerType:t,typeName:x.ZodOptional,...w(e)});var he=class extends N{_parse(e){return this._getType(e)===_.ZodParsedType.null?(0,l.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};c.ZodNullable=he;he.create=(t,e)=>new he({innerType:t,typeName:x.ZodNullable,...w(e)});var Qe=class extends N{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===_.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};c.ZodDefault=Qe;Qe.create=(t,e)=>new Qe({innerType:t,typeName:x.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...w(e)});var Xe=class extends N{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return(0,l.isAsync)(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new v.ZodError(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new v.ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};c.ZodCatch=Xe;Xe.create=(t,e)=>new Xe({innerType:t,typeName:x.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...w(e)});var pt=class extends N{_parse(e){if(this._getType(e)!==_.ZodParsedType.nan){let n=this._getOrReturnCtx(e);return(0,l.addIssueToContext)(n,{code:v.ZodIssueCode.invalid_type,expected:_.ZodParsedType.nan,received:n.parsedType}),l.INVALID}return{status:"valid",value:e.data}}};c.ZodNaN=pt;pt.create=t=>new pt({typeName:x.ZodNaN,...w(t)});c.BRAND=Symbol("zod_brand");var Et=class extends N{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};c.ZodBranded=Et;var Lt=class t extends N{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?l.INVALID:a.status==="dirty"?(r.dirty(),(0,l.DIRTY)(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?l.INVALID:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:x.ZodPipeline})}};c.ZodPipeline=Lt;var et=class extends N{_parse(e){let r=this._def.innerType._parse(e),n=s=>((0,l.isValid)(s)&&(s.value=Object.freeze(s.value)),s);return(0,l.isAsync)(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};c.ZodReadonly=et;et.create=(t,e)=>new et({innerType:t,typeName:x.ZodReadonly,...w(e)});function Gr(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Kr(t,e={},r){return t?ke.create().superRefine((n,s)=>{let a=t(n);if(a instanceof Promise)return a.then(i=>{if(!i){let o=Gr(e,n),g=o.fatal??r??!0;s.addIssue({code:"custom",...o,fatal:g})}});if(!a){let i=Gr(e,n),o=i.fatal??r??!0;s.addIssue({code:"custom",...i,fatal:o})}}):ke.create()}c.late={object:Y.lazycreate};var x;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(x||(c.ZodFirstPartyTypeKind=x={}));var ia=(t,e={message:`Input not instance of ${t.name}`})=>Kr(r=>r instanceof t,e);c.instanceof=ia;var Jr=Ae.create;c.string=Jr;var Yr=Ue.create;c.number=Yr;var ca=pt.create;c.nan=ca;var la=We.create;c.bigint=la;var Qr=$e.create;c.boolean=Qr;var ua=Ve.create;c.date=ua;var da=lt.create;c.symbol=da;var ga=Ge.create;c.undefined=ga;var pa=Be.create;c.null=pa;var ma=ke.create;c.any=ma;var fa=Se.create;c.unknown=fa;var ha=ue.create;c.never=ha;var va=ut.create;c.void=va;var ya=Te.create;c.array=ya;var _a=Y.create;c.object=_a;var Ia=Y.strictCreate;c.strictObject=Ia;var Sa=qe.create;c.union=Sa;var Ta=Wt.create;c.discriminatedUnion=Ta;var Ca=ze.create;c.intersection=Ca;var ba=fe.create;c.tuple=ba;var Ea=$t.create;c.record=Ea;var La=dt.create;c.map=La;var xa=gt.create;c.set=xa;var wa=Vt.create;c.function=wa;var Na=He.create;c.lazy=Na;var Aa=Ke.create;c.literal=Aa;var ka=Je.create;c.enum=ka;var Oa=Ye.create;c.nativeEnum=Oa;var Ra=Oe.create;c.promise=Ra;var Xr=ee.create;c.effect=Xr;c.transformer=Xr;var Da=se.create;c.optional=Da;var Pa=he.create;c.nullable=Pa;var Za=ee.createWithPreprocess;c.preprocess=Za;var Fa=Lt.create;c.pipeline=Fa;var Ma=()=>Jr().optional();c.ostring=Ma;var ja=()=>Yr().optional();c.onumber=ja;var Ua=()=>Qr().optional();c.oboolean=Ua;c.coerce={string:t=>Ae.create({...t,coerce:!0}),number:t=>Ue.create({...t,coerce:!0}),boolean:t=>$e.create({...t,coerce:!0}),bigint:t=>We.create({...t,coerce:!0}),date:t=>Ve.create({...t,coerce:!0})};c.NEVER=l.INVALID});var hr=O(oe=>{"use strict";var Wa=oe&&oe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),mt=oe&&oe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Wa(e,t,r)};Object.defineProperty(oe,"__esModule",{value:!0});mt(Mt(),oe);mt(pr(),oe);mt(Ur(),oe);mt(Ct(),oe);mt(en(),oe);mt(Ft(),oe)});var nn=O(Q=>{"use strict";var tn=Q&&Q.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),$a=Q&&Q.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Va=Q&&Q.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&tn(e,t,r);return $a(e,t),e},Ga=Q&&Q.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tn(e,t,r)};Object.defineProperty(Q,"__esModule",{value:!0});Q.z=void 0;var rn=Va(hr());Q.z=rn;Ga(hr(),Q);Q.default=rn});var vr=O(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.getEnvironment=void 0;var Ce=nn(),Ba=Ce.z.object({LOG_LEVEL:Ce.z.enum(["DEBUG","INFO","WARN","ERROR","FATAL"]).optional(),STAGE:Ce.z.enum(["dev","prod","test"]).default("dev"),SERVICE_NAME:Ce.z.string().optional(),ENABLE_STRUCTURED_LOGGING:Ce.z.string().transform(t=>t==="true").optional(),CLOUDWATCH_LOG_GROUP:Ce.z.string().optional(),CLOUDWATCH_LOG_STREAM:Ce.z.string().optional(),AWS_REGION:Ce.z.string().optional()}),qa=(t=process.env)=>{let e;try{e=Ba.parse(t)}catch(r){r instanceof Ce.z.ZodError&&console.warn("Environment validation failed, using defaults:",r.errors),e={STAGE:"dev"}}return{...e,isProduction:e.STAGE==="prod",isDevelopment:e.STAGE==="dev",logLevel:e.LOG_LEVEL??void 0,serviceName:e.SERVICE_NAME??void 0,enableStructuredLogging:e.ENABLE_STRUCTURED_LOGGING??!0,stage:e.STAGE}};Gt.getEnvironment=qa});var yr=O(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.createLogFilter=ve.createSampler=ve.createRateLimiter=void 0;var za=(t,e)=>{let r={tokens:e,lastRefill:Date.now(),maxTokens:e,refillRate:t},n=()=>{let a=Date.now(),o=(a-r.lastRefill)/1e3*r.refillRate;r.tokens=Math.min(r.maxTokens,r.tokens+o),r.lastRefill=a};return{tryConsume:(a=1)=>(n(),r.tokens>=a?(r.tokens-=a,!0):!1),getState:()=>({...r})}};ve.createRateLimiter=za;var Ha=t=>{let e={totalLogs:0,sampledLogs:0};return{shouldSample:()=>(e.totalLogs++,t>=1?(e.sampledLogs++,!0):t<=0?!1:Math.random()<=t?(e.sampledLogs++,!0):!1),getStats:()=>({totalLogs:e.totalLogs,sampledLogs:e.sampledLogs,samplingRate:e.totalLogs>0?e.sampledLogs/e.totalLogs:0,configuredRate:t})}};ve.createSampler=Ha;var Ka=t=>{let e=t.rateLimit?(0,ve.createRateLimiter)(t.rateLimit.maxLogsPerSecond,t.rateLimit.burstSize):null,r=t.samplingRate!==void 0?(0,ve.createSampler)(t.samplingRate):null;return{shouldLog:()=>!e&&!r?!0:!(e&&!e.tryConsume()||r&&!r.shouldSample()),getStats:()=>({rateLimit:e?.getState(),sampling:r?.getStats()})}};ve.createLogFilter=Ka});var _r=O(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.printLoggerConfig=ie.createStrogger=ie.strogger=ie.createLogger=void 0;var Ja=ar(),Ya=Zt(),U=le(),Qa=ir(),sn=cr(),Xa=vr(),eo=yr(),an=t=>{if(!t||typeof t!="object")return console.warn("[strogger] No environment provided, defaulting to DEBUG"),U.LogLevel.DEBUG;switch(t.LOG_LEVEL?.toUpperCase()){case"DEBUG":return U.LogLevel.DEBUG;case"INFO":return U.LogLevel.INFO;case"WARN":return U.LogLevel.WARN;case"ERROR":return U.LogLevel.ERROR;case"FATAL":return U.LogLevel.FATAL;case void 0:return t.STAGE==="prod"?U.LogLevel.INFO:U.LogLevel.DEBUG;default:return console.warn(`[strogger] Invalid LOG_LEVEL '${t.LOG_LEVEL}' provided. Defaulting to ${t.STAGE==="prod"?"INFO":"DEBUG"}.`),t.STAGE==="prod"?U.LogLevel.INFO:U.LogLevel.DEBUG}},to=(t,e)=>t>=(e.level!==void 0?e.level:U.LogLevel.INFO),ro=(t,e,r,n,s,a)=>({timestamp:new Date().toISOString(),level:e,message:r,context:{...t.stage&&{stage:t.stage},...t.serviceName&&{serviceName:t.serviceName},...n},error:s?{name:s.name,message:s.message,stack:s.stack}:void 0,metadata:a}),no=({config:t={},transports:e=[],formatter:r,env:n})=>{let s=t.instanceId||(0,sn.generateLoggerInstanceId)(),a={level:an(n),serviceName:n.SERVICE_NAME||void 0,stage:n.STAGE||"dev",enableStructuredLogging:n.ENABLE_STRUCTURED_LOGGING??!0,includeTimestamp:!0,includeLogLevel:!0,instanceId:s,...t};if(typeof a.level=="string")switch(a.level.toUpperCase()){case"DEBUG":a.level=U.LogLevel.DEBUG;break;case"INFO":a.level=U.LogLevel.INFO;break;case"WARN":a.level=U.LogLevel.WARN;break;case"ERROR":a.level=U.LogLevel.ERROR;break;case"FATAL":a.level=U.LogLevel.FATAL;break;default:a.level=U.LogLevel.INFO}t.level!==void 0&&(a.level=t.level);let i=(0,eo.createLogFilter)(a),o=(0,sn.createDefaultEnrichmentMiddleware)(a.serviceName,a.stage,void 0,s),u=t.batching===!0?e.map(p=>(0,Qa.createBatchedTransport)(p,{maxSize:50,maxWaitTime:2e3,maxBatchSize:512*1024})):e,h=async(p,d,m,S,b)=>{if(!to(p,a)||(a.samplingRate!==void 0||a.rateLimit)&&!i.shouldLog())return;let E=o(m||{}),T=ro(a,p,d,E,S,b),I=T;if(typeof a.redact=="function"&&(I=a.redact(T)),typeof a.validate=="function")try{a.validate(I)}catch(y){console.error("[LOGGER ERROR] Log entry validation failed:",y);return}if(Array.isArray(a.hooks))for(let y of a.hooks)try{let L=y(I);L&&typeof L.then=="function"&&await L}catch(L){console.error("[LOGGER ERROR] Log hook failed:",L)}let j=await Promise.allSettled(u.map(y=>y.log(I)));for(let y of j)y.status==="rejected"&&console.error(y.reason)};return{debug:(p,d,m)=>h(U.LogLevel.DEBUG,p,d,void 0,m),info:(p,d,m)=>h(U.LogLevel.INFO,p,d,void 0,m),warn:(p,d,m,S)=>h(U.LogLevel.WARN,p,d,m,S),error:(p,d,m,S)=>h(U.LogLevel.ERROR,p,d,m,S),fatal:(p,d,m,S)=>h(U.LogLevel.FATAL,p,d,m,S),logFunctionStart:(p,d,m)=>h(U.LogLevel.INFO,`Function ${p} started`,{...d,functionName:p},void 0,m),logFunctionEnd:(p,d,m,S)=>h(U.LogLevel.INFO,`Function ${p} completed in ${d}ms`,{...m,functionName:p,duration:d},void 0,S),logDatabaseOperation:(p,d,m,S)=>h(U.LogLevel.DEBUG,`Database operation: ${p} on table ${d}`,{...m,operation:p,table:d},void 0,S),logApiRequest:(p,d,m,S,b)=>h(U.LogLevel.INFO,`API ${p} ${d} - ${m}`,{...S,method:p,path:d,statusCode:m},void 0,b),setLevel:p=>{a.level=p;for(let d of e)d.setLevel?.(p)},getLevel:()=>a.level!==void 0?a.level:U.LogLevel.INFO,getInstanceId:()=>s,addTransport:p=>e.push(p),removeTransport:p=>{let d=e.indexOf(p);d>-1&&e.splice(d,1)},setFormatter:p=>{},getSamplingStats:()=>i.getStats(),flush:async()=>{await Promise.allSettled(u.map(p=>p.flush?.()||Promise.resolve()))},getBatchStats:()=>u.map(p=>p.getStats?.()||{})}};ie.createLogger=no;var so=(0,Xa.getEnvironment)(),on=(0,Ja.createJsonFormatter)(),ao=(0,Ya.createConsoleTransport)({formatter:on});ie.strogger=(0,ie.createLogger)({config:{},transports:[ao],formatter:on,env:so});ie.createStrogger=ie.createLogger;var oo=t=>{let e=an(t);console.log("--- Strogger Logger Configuration ---"),console.log("LOG_LEVEL:",t.LOG_LEVEL??"(default)"),console.log("STAGE:",t.STAGE??"dev"),console.log("SERVICE_NAME:",t.SERVICE_NAME??"(none)"),console.log("ENABLE_STRUCTURED_LOGGING:",t.ENABLE_STRUCTURED_LOGGING??!0),console.log("Effective log level:",e),console.log("--------------------------------------")};ie.printLoggerConfig=oo});var De=O(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.handleTransportError=V.validateTransportConfig=V.validateEnvironmentVariable=V.createDetailedError=V.ERROR_MESSAGES=V.ValidationError=V.ConfigurationError=V.TransportError=V.LoggerError=void 0;var Re=class extends Error{constructor(e,r,n){super(e),this.code=r,this.details=n,this.name="LoggerError"}};V.LoggerError=Re;var tt=class extends Re{constructor(e,r,n){super(e,"TRANSPORT_ERROR",{transportName:r,...n}),this.transportName=r,this.name="TransportError"}};V.TransportError=tt;var Bt=class extends Re{constructor(e,r){super(e,"CONFIGURATION_ERROR",r),this.name="ConfigurationError"}};V.ConfigurationError=Bt;var Ir=class extends Re{constructor(e,r){super(e,"VALIDATION_ERROR",r),this.name="ValidationError"}};V.ValidationError=Ir;V.ERROR_MESSAGES={NEW_RELIC_MISSING_API_KEY:{message:"New Relic transport requires NEW_RELIC_LICENSE_KEY environment variable",solution:"Set NEW_RELIC_LICENSE_KEY in your environment variables or pass apiKey option",example:"NEW_RELIC_LICENSE_KEY=your-license-key-here"},NEW_RELIC_MISSING_ACCOUNT_ID:{message:"New Relic transport requires NEW_RELIC_ACCOUNT_ID environment variable",solution:"Set NEW_RELIC_ACCOUNT_ID in your environment variables or pass accountId option",example:"NEW_RELIC_ACCOUNT_ID=your-account-id-here"},NEW_RELIC_API_ERROR:{message:"Failed to send logs to New Relic API",solution:"Check your API key, account ID, and network connectivity"},DATADOG_MISSING_API_KEY:{message:"DataDog transport requires DATADOG_API_KEY environment variable",solution:"Set DATADOG_API_KEY in your environment variables",example:"DATADOG_API_KEY=your-api-key-here"},DATADOG_API_ERROR:{message:"Failed to send logs to DataDog API",solution:"Check your API key and network connectivity"},CLOUDWATCH_MISSING_CREDENTIALS:{message:"CloudWatch transport requires AWS credentials",solution:"Configure AWS credentials via environment variables, IAM role, or AWS credentials file",example:`AWS_ACCESS_KEY_ID=your-key
2
+ AWS_SECRET_ACCESS_KEY=your-secret`},CLOUDWATCH_MISSING_LOG_GROUP:{message:"CloudWatch transport requires logGroupName option",solution:"Provide logGroupName in transport options or set CLOUDWATCH_LOG_GROUP environment variable",example:'logGroupName: "/aws/lambda/my-function"'},CLOUDWATCH_LOG_GROUP_NOT_FOUND:{message:"CloudWatch log group does not exist",solution:"Create the log group in CloudWatch before using this transport",example:'aws logs create-log-group --log-group-name "/aws/lambda/my-function"'},CLOUDWATCH_API_ERROR:{message:"Failed to send logs to CloudWatch",solution:"Check your AWS credentials, region, and network connectivity"},TRANSPORT_INITIALIZATION_FAILED:{message:"Failed to initialize transport",solution:"Check transport configuration and required dependencies"},TRANSPORT_SEND_FAILED:{message:"Failed to send log entry to transport",solution:"Check transport configuration and network connectivity"},MISSING_SERVICE_NAME:{message:"Logger configuration requires serviceName",solution:"Set SERVICE_NAME environment variable or provide serviceName in config",example:"SERVICE_NAME=my-service"},INVALID_LOG_LEVEL:{message:"Invalid log level specified",solution:"Use one of: DEBUG, INFO, WARN, ERROR, FATAL",example:"LOG_LEVEL=INFO"},ENVIRONMENT_VALIDATION_FAILED:{message:"Environment configuration validation failed",solution:"Check your environment variables and configuration"},FORMATTER_MISSING:{message:"Logger requires a formatter",solution:"Provide a formatter object with a format(entry) method",example:"formatter: createJsonFormatter()"},PERFORMANCE_MONITOR_INITIALIZATION_FAILED:{message:"Failed to initialize performance monitor",solution:"Check performance monitor configuration"},SPLUNK_MISSING_HEC_URL:{message:"Splunk transport requires SPLUNK_HEC_URL environment variable",solution:"Set SPLUNK_HEC_URL in your environment variables",example:"SPLUNK_HEC_URL=https://your-splunk-instance:8088/services/collector"},SPLUNK_MISSING_HEC_TOKEN:{message:"Splunk transport requires SPLUNK_HEC_TOKEN environment variable",solution:"Set SPLUNK_HEC_TOKEN in your environment variables",example:"SPLUNK_HEC_TOKEN=your-hec-token-here"},SPLUNK_API_ERROR:{message:"Failed to send logs to Splunk HEC",solution:"Check your HEC URL, token, and network connectivity"},ELASTICSEARCH_MISSING_AUTH:{message:"Elasticsearch transport requires authentication",solution:"Set ELASTICSEARCH_API_KEY or ELASTICSEARCH_USERNAME/PASSWORD",example:"ELASTICSEARCH_API_KEY=your-api-key-here"},ELASTICSEARCH_MISSING_DATE:{message:"Date string is missing for Elasticsearch index pattern",solution:"Check date generation logic and ensure valid date string is produced"},ELASTICSEARCH_API_ERROR:{message:"Failed to send logs to Elasticsearch",solution:"Check your connection URL, authentication, and network connectivity"}};var io=(t,e,r)=>{let n=V.ERROR_MESSAGES[t],s=`${n.message}${e?` (${e})`:""}`,a={...n,...r,...e&&{transportName:e}};return e?new tt(s,e,a):new Re(s,"LOGGER_ERROR",a)};V.createDetailedError=io;var co=(t,e,r=!1)=>{if(r&&!e)throw new Bt(`Required environment variable ${t} is not set`,{missingVariable:t,message:`Required environment variable ${t} is not set`})};V.validateEnvironmentVariable=co;var lo=(t,e,r)=>{let n=r.filter(s=>!e[s]);if(n.length>0)throw new tt(`Missing required configuration fields: ${n.join(", ")}`,t,{missingFields:n,message:`Missing required configuration fields: ${n.join(", ")}`})};V.validateTransportConfig=lo;var uo=(t,e,r=!0)=>{let n;if(t instanceof Re?n=t:t instanceof Error?n=new tt(`Unexpected error in ${e}: ${t.message}`,e,{originalError:t.message,stack:t.stack}):n=new tt(`Unknown error in ${e}`,e,{originalError:t}),r&&(console.error(`[LOGGER ERROR] ${n.message}`),n.details?.solution&&console.error(`[LOGGER SOLUTION] ${n.details.solution}`),n.details?.example&&console.error(`[LOGGER EXAMPLE] ${n.details.example}`)),!r)throw n};V.handleTransportError=uo});var Sr=O(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.createDataDogTransport=void 0;var ft=le(),ht=De(),go=_e(),po=(t={})=>{let e="DataDog";try{let r=t.level??ft.LogLevel.INFO,n=t.apiKey||process.env.DATADOG_API_KEY,s=t.serviceName||process.env.DD_SERVICE||process.env.SERVICE_NAME,a=t.source||"nodejs",i=t.tags||[],o=t.batchSize||10,g=t.flushInterval||5e3,u=t.region||process.env.DD_SITE||"us";(0,ht.validateEnvironmentVariable)("DATADOG_API_KEY",n,!0),(0,ht.validateTransportConfig)(e,{apiKey:n},["apiKey"]);let p=[...[`env:${process.env.NODE_ENV||"dev"}`,`service:${s||"unknown"}`,`source:${a}`],...i].join(","),d=[],m=null,S=async I=>{try{let j=`https://http-intake.logs.${u==="eu"?"eu.":""}datadoghq.com/api/v2/logs`,y=I.map(F=>({message:F.message,level:b(F.level),timestamp:new Date(F.timestamp).getTime(),ddsource:a,ddtags:p,service:s,...F.context,...F.error&&{error_name:F.error.name,error_message:F.error.message,error_stack:F.error.stack},...F.metadata&&{metadata:F.metadata}})),L=await fetch(j,{method:"POST",headers:{"Content-Type":"application/json","DD-API-KEY":n},body:JSON.stringify(y)});if(!L.ok)throw(0,ht.createDetailedError)("DATADOG_API_ERROR",e,{status:L.status,statusText:L.statusText,url:j,responseBody:await L.text().catch(()=>"Unable to read response body")})}catch(j){(0,ht.handleTransportError)(j,e,!0)}},b=I=>{switch(I){case ft.LogLevel.DEBUG:return"debug";case ft.LogLevel.INFO:return"info";case ft.LogLevel.WARN:return"warning";case ft.LogLevel.ERROR:return"error";case ft.LogLevel.FATAL:return"critical";default:return"info"}},E=async()=>{if(d.length===0)return;let I=[...d];d=[],await S(I)};return(()=>{m||(m=setInterval(()=>{E().catch(I=>{(0,ht.handleTransportError)(I,e,!0)})},g))})(),{log:async I=>{(0,go.shouldLog)(I.level,r)&&(d.push(I),d.length>=o&&await E())},setLevel:I=>{r=I},getLevel:()=>r,flush:async()=>{await E()},close:async()=>{m&&(clearInterval(m),m=null),await E()},addTags:I=>{i.push(...I)},getConfig:()=>({serviceName:s,source:a,tags:[...i],region:u,batchSize:o,flushInterval:g})}}catch(r){throw(0,ht.handleTransportError)(r,e,!1),r}};qt.createDataDogTransport=po});var Tr=O(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.createSplunkTransport=void 0;var vt=le(),rt=De(),mo=_e(),fo=(t={})=>{let e="Splunk";try{let r=t.level??vt.LogLevel.INFO,n=t.hecUrl||process.env.SPLUNK_HEC_URL,s=t.hecToken||process.env.SPLUNK_HEC_TOKEN,a=t.source||"nodejs-logger",i=t.sourcetype||"_json",o=t.index||process.env.SPLUNK_INDEX,g=t.batchSize||10,u=t.flushInterval||5e3,h=t.channel||process.env.SPLUNK_CHANNEL;(0,rt.validateEnvironmentVariable)("SPLUNK_HEC_URL",n,!0),(0,rt.validateEnvironmentVariable)("SPLUNK_HEC_TOKEN",s,!0),(0,rt.validateTransportConfig)(e,{hecUrl:n,hecToken:s},["hecUrl","hecToken"]);let p=[],d=null,m=async T=>{try{let I=T.map(y=>({event:{message:y.message,level:S(y.level),timestamp:new Date(y.timestamp).getTime(),...y.context,...y.error&&{error_name:y.error.name,error_message:y.error.message,error_stack:y.error.stack},...y.metadata&&{metadata:y.metadata}},sourcetype:i,source:a,...o&&{index:o},...h&&{channel:h}})),j=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Splunk ${s}`},body:JSON.stringify(I)});if(!j.ok)throw(0,rt.createDetailedError)("SPLUNK_API_ERROR",e,{status:j.status,statusText:j.statusText,url:n,responseBody:await j.text().catch(()=>"Unable to read response body")})}catch(I){(0,rt.handleTransportError)(I,e,!0)}},S=T=>{switch(T){case vt.LogLevel.DEBUG:return"DEBUG";case vt.LogLevel.INFO:return"INFO";case vt.LogLevel.WARN:return"WARN";case vt.LogLevel.ERROR:return"ERROR";case vt.LogLevel.FATAL:return"FATAL";default:return"INFO"}},b=async()=>{if(p.length===0)return;let T=[...p];p=[],await m(T)};return(()=>{d||(d=setInterval(()=>{b().catch(T=>{(0,rt.handleTransportError)(T,e,!0)})},u))})(),{log:async T=>{(0,mo.shouldLog)(T.level,r)&&(p.push(T),p.length>=g&&await b())},setLevel:T=>{r=T},getLevel:()=>r,flush:async()=>{await b()},close:async()=>{d&&(clearInterval(d),d=null),await b()},getConfig:()=>({hecUrl:n,source:a,sourcetype:i,index:o,channel:h,batchSize:g,flushInterval:u})}}catch(r){throw(0,rt.handleTransportError)(r,e,!1),r}};zt.createSplunkTransport=fo});var Cr=O(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.createElasticsearchTransport=void 0;var yt=le(),_t=De(),ho=_e(),vo=(t={})=>{let e="Elasticsearch";try{let r=t.level??yt.LogLevel.INFO,n=t.url||process.env.ELASTICSEARCH_URL||"http://localhost:9200",s=t.username||process.env.ELASTICSEARCH_USERNAME,a=t.password||process.env.ELASTICSEARCH_PASSWORD,i=t.apiKey||process.env.ELASTICSEARCH_API_KEY,o=t.index||process.env.ELASTICSEARCH_INDEX||"logs",g=t.indexPattern||process.env.ELASTICSEARCH_INDEX_PATTERN||"logs-{YYYY.MM.DD}",u=t.batchSize||10,h=t.flushInterval||5e3,p=t.timeout||3e4;if(!i&&(!s||!a))throw(0,_t.createDetailedError)("ELASTICSEARCH_MISSING_AUTH",e,{message:"Elasticsearch transport requires either API key or username/password"});let d=[],m=null,S=()=>{if(g?.includes("{YYYY.MM.DD}")){let L=new Date().toISOString().split("T")[0]?.replace(/-/g,".");if(!L)throw(0,_t.createDetailedError)("ELASTICSEARCH_MISSING_DATE",e,{message:"Date string is missing"});return g.replace("{YYYY.MM.DD}",L)}return typeof o=="string"&&o.length>0?o:"logs"},b=()=>i?{Authorization:`ApiKey ${i}`}:s&&a?{Authorization:`Basic ${Buffer.from(`${s}:${a}`).toString("base64")}`}:{},E=async y=>{try{let L=S(),F=`${n}/_bulk`,k=`${y.map($=>{let me={message:$.message,level:T($.level),timestamp:new Date($.timestamp).toISOString(),service:process.env.SERVICE_NAME||"unknown",...$.context,...$.error&&{error_name:$.error.name,error_message:$.error.message,error_stack:$.error.stack},...$.metadata&&{metadata:$.metadata}};return`${JSON.stringify({index:{_index:L}})}
3
+ ${JSON.stringify(me)}`}).join(`
4
4
  `)}
5
- `,V=await fetch(H,{method:"POST",headers:{"Content-Type":"application/x-ndjson",...y()},body:Z,signal:AbortSignal.timeout(u)});if(!V.ok){let K=await V.text().catch(()=>"Unable to read response body");throw(0,Ws.createDetailedError)("ELASTICSEARCH_API_ERROR",t,{status:V.status,statusText:V.statusText,url:H,responseBody:K})}let me=await V.json().catch(()=>null);if(me?.errors&&Array.isArray(me.items)){let K=me.items.filter(Ee=>Ee.index?.error).map(Ee=>Ee.index?.error).slice(0,3);K?.length>0&&console.warn("[ELASTICSEARCH] Some documents failed to index:",K)}}catch(A){(0,Ws.handleTransportError)(A,t,!0)}},w=T=>{switch(T){case Vs.LogLevel.DEBUG:return"debug";case Vs.LogLevel.INFO:return"info";case Vs.LogLevel.WARN:return"warn";case Vs.LogLevel.ERROR:return"error";case Vs.LogLevel.FATAL:return"fatal";default:return"info"}},E=async()=>{if(m.length===0)return;let T=[...m];m=[],await _(T)};return(()=>{p||(p=setInterval(()=>{E().catch(T=>{(0,Ws.handleTransportError)(T,t,!0)})},l))})(),{log:async T=>{(0,aF.shouldLog)(T.level,r)&&(m.push(T),m.length>=d&&await E())},setLevel:T=>{r=T},getLevel:()=>r,flush:async()=>{await E()},close:async()=>{p&&(clearInterval(p),p=null),await E()},getConfig:()=>({url:n,index:a,indexPattern:c,batchSize:d,flushInterval:l,timeout:u}),getCurrentIndex:()=>h()}}catch(r){throw(0,Ws.handleTransportError)(r,t,!1),r}};qa.createElasticsearchTransport=cF});var zu=b(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.createNewRelicTransport=void 0;var dF=Ft(),Vn=zr(),lF=ur(),uF=(e={})=>{let t="New Relic";try{let r=e.level??dF.LogLevel.INFO,n=e.apiKey||process.env.NEW_RELIC_LICENSE_KEY,s=e.accountId||process.env.NEW_RELIC_ACCOUNT_ID,o=e.region||process.env.NEW_RELIC_REGION||"us",i=e.serviceName||process.env.NEW_RELIC_SERVICE_NAME,a=e.batchSize||10,c=e.flushInterval||5e3;(0,Vn.validateEnvironmentVariable)("NEW_RELIC_LICENSE_KEY",n,!0),(0,Vn.validateEnvironmentVariable)("NEW_RELIC_ACCOUNT_ID",s,!0),(0,Vn.validateTransportConfig)(t,{apiKey:n,accountId:s},["apiKey","accountId"]);let d=[],l=null,u=async h=>{try{let y=`https://log-api.${o}.newrelic.com/log/v1`,_={timestamp:Date.now(),service:i,attributes:{logtype:"application",timestamp:new Date().toISOString()},logs:h.map(E=>({message:E.message,level:E.level,timestamp:new Date(E.timestamp).getTime(),attributes:{...E.context,...E.error&&{error_name:E.error.name,error_message:E.error.message,error_stack:E.error.stack},...E.metadata&&{metadata:E.metadata}}}))},w=await fetch(y,{method:"POST",headers:{"Content-Type":"application/json","Api-Key":n,"X-License-Key":n},body:JSON.stringify(_)});if(!w.ok)throw(0,Vn.createDetailedError)("NEW_RELIC_API_ERROR",t,{status:w.status,statusText:w.statusText,url:y,responseBody:await w.text().catch(()=>"Unable to read response body")})}catch(y){(0,Vn.handleTransportError)(y,t,!0)}},m=async()=>{if(d.length===0)return;let h=[...d];d=[],await u(h)};return(()=>{l||(l=setInterval(()=>{m().catch(h=>{(0,Vn.handleTransportError)(h,t,!0)})},c))})(),{log:async h=>{(0,lF.shouldLog)(h.level,r)&&(d.push(h),d.length>=a&&await m())},setLevel:h=>{r=h},getLevel:()=>r,flush:async()=>{await m()},close:async()=>{l&&(clearInterval(l),l=null),await m()}}}catch(r){throw(0,Vn.handleTransportError)(r,t,!1),r}};Ga.createNewRelicTransport=uF});var Cy=b(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.createFileTransport=void 0;var ut=require("node:fs"),Zo=require("node:path"),mF=require("node:util"),pF=require("node:zlib"),fF=Ft(),Hr=zr(),gF=ur(),hF=(0,mF.promisify)(pF.gzip),yF=(e={})=>{let t="File";try{let r=e.level??fF.LogLevel.INFO,n=e.formatter||{format:Z=>JSON.stringify(Z)},s=e.filePath||process.env.LOG_FILE_PATH||"./logs/app.log",o=e.maxFileSize??10*1024*1024,i=e.maxFiles??5,a=e.rotationInterval??24*60*60*1e3,c=e.compressOldFiles??!1,d=e.dateFormat??"YYYY-MM-DD",l=e.encoding??"utf8",u=e.createSymlink??!1,m=e.symlinkName??"current.log";(0,Hr.validateEnvironmentVariable)("LOG_FILE_PATH",s,!1),(0,Hr.validateTransportConfig)(t,{filePath:s},["filePath"]);let p={currentFile:s,currentSize:0,lastRotation:Date.now()},h=null,y=async Z=>{let V=(0,Zo.dirname)(Z);try{await ut.promises.access(V)}catch{await ut.promises.mkdir(V,{recursive:!0})}},_=(Z,V)=>{let me=(0,Zo.extname)(Z),K=Z.replace(me,""),Ee=new Date().toISOString().split("T")[0];return`${K}.${Ee}.${V}${me}${c?".gz":""}`},w=()=>{let Z=Date.now()-p.lastRotation;return p.currentSize>=o||Z>=a},E=async Z=>{if(c)try{let V=await ut.promises.readFile(Z,l),me=await hF(V);await ut.promises.writeFile(`${Z}.gz`,me),await ut.promises.unlink(Z)}catch(V){(0,Hr.handleTransportError)(V,t,!0)}},B=async()=>{try{p.fileHandle&&(await p.fileHandle.close(),p.fileHandle=void 0);for(let V=i-1;V>=1;V--){let me=_(s,V),K=_(s,V+1);try{await ut.promises.access(me),await ut.promises.rename(me,K)}catch{}}let Z=_(s,1);try{await ut.promises.access(s),await ut.promises.rename(s,Z),await E(Z)}catch{}if(p.currentSize=0,p.lastRotation=Date.now(),await y(s),p.fileHandle=await ut.promises.open(s,"a"),u){let V=(0,Zo.join)((0,Zo.dirname)(s),m);try{await ut.promises.unlink(V)}catch{}await ut.promises.symlink((0,Zo.basename)(s),V)}console.log(`[FILE] Rotated log file to: ${Z}`)}catch(Z){(0,Hr.handleTransportError)(Z,t,!0)}},T=async Z=>{try{w()&&await B(),p.fileHandle||(await y(s),p.fileHandle=await ut.promises.open(s,"a"));let V=`${Z}
6
- `;await p.fileHandle.write(V,void 0,l),p.currentSize+=V.length}catch(V){(0,Hr.handleTransportError)(V,t,!0)}},A=async()=>{try{p.fileHandle&&await p.fileHandle.sync()}catch(Z){(0,Hr.handleTransportError)(Z,t,!0)}};return(()=>{h||(h=setInterval(()=>{A().catch(Z=>{(0,Hr.handleTransportError)(Z,t,!0)})},5e3))})(),{log:async Z=>{if(!(0,gF.shouldLog)(Z.level,r))return;let V=n.format(Z);await T(V)},setLevel:Z=>{r=Z},getLevel:()=>r,rotate:async()=>{await B()},getCurrentFile:()=>p.currentFile,getCurrentSize:()=>p.currentSize,flush:async()=>{await A()},close:async()=>{h&&(clearInterval(h),h=null),p.fileHandle&&(await p.fileHandle.close(),p.fileHandle=void 0)},getConfig:()=>({filePath:s,maxFileSize:o,maxFiles:i,rotationInterval:a,compressOldFiles:c,dateFormat:d,encoding:l,createSymlink:u,symlinkName:m}),getStats:()=>({currentFile:p.currentFile,currentSize:p.currentSize,lastRotation:p.lastRotation,fileHandleOpen:!!p.fileHandle,flushTimerActive:!!h})}}catch(r){throw(0,Hr.handleTransportError)(r,t,!1),r}};Va.createFileTransport=yF});var qr=b(fe=>{"use strict";fe.HttpAuthLocation=void 0;(function(e){e.HEADER="header",e.QUERY="query"})(fe.HttpAuthLocation||(fe.HttpAuthLocation={}));fe.HttpApiKeyAuthLocation=void 0;(function(e){e.HEADER="header",e.QUERY="query"})(fe.HttpApiKeyAuthLocation||(fe.HttpApiKeyAuthLocation={}));fe.EndpointURLScheme=void 0;(function(e){e.HTTP="http",e.HTTPS="https"})(fe.EndpointURLScheme||(fe.EndpointURLScheme={}));fe.AlgorithmId=void 0;(function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"})(fe.AlgorithmId||(fe.AlgorithmId={}));var _F=e=>{let t=[];return e.sha256!==void 0&&t.push({algorithmId:()=>fe.AlgorithmId.SHA256,checksumConstructor:()=>e.sha256}),e.md5!=null&&t.push({algorithmId:()=>fe.AlgorithmId.MD5,checksumConstructor:()=>e.md5}),{addChecksumAlgorithm(r){t.push(r)},checksumAlgorithms(){return t}}},vF=e=>{let t={};return e.checksumAlgorithms().forEach(r=>{t[r.algorithmId()]=r.checksumConstructor()}),t},SF=e=>_F(e),EF=e=>vF(e);fe.FieldPosition=void 0;(function(e){e[e.HEADER=0]="HEADER",e[e.TRAILER=1]="TRAILER"})(fe.FieldPosition||(fe.FieldPosition={}));var CF="__smithy_context";fe.IniSectionType=void 0;(function(e){e.PROFILE="profile",e.SSO_SESSION="sso-session",e.SERVICES="services"})(fe.IniSectionType||(fe.IniSectionType={}));fe.RequestHandlerProtocol=void 0;(function(e){e.HTTP_0_9="http/0.9",e.HTTP_1_0="http/1.0",e.TDS_8_0="tds/8.0"})(fe.RequestHandlerProtocol||(fe.RequestHandlerProtocol={}));fe.SMITHY_CONTEXT_KEY=CF;fe.getDefaultClientConfiguration=SF;fe.resolveDefaultRuntimeConfig=EF});var ge=b((Eee,xy)=>{var Wa=Object.defineProperty,bF=Object.getOwnPropertyDescriptor,wF=Object.getOwnPropertyNames,TF=Object.prototype.hasOwnProperty,Gr=(e,t)=>Wa(e,"name",{value:t,configurable:!0}),PF=(e,t)=>{for(var r in t)Wa(e,r,{get:t[r],enumerable:!0})},xF=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of wF(t))!TF.call(e,s)&&s!==r&&Wa(e,s,{get:()=>t[s],enumerable:!(n=bF(t,s))||n.enumerable});return e},IF=e=>xF(Wa({},"__esModule",{value:!0}),e),by={};PF(by,{Field:()=>DF,Fields:()=>RF,HttpRequest:()=>NF,HttpResponse:()=>LF,IHttpRequest:()=>wy.HttpRequest,getHttpHandlerExtensionConfiguration:()=>AF,isValidHostname:()=>Py,resolveHttpHandlerRuntimeConfig:()=>OF});xy.exports=IF(by);var AF=Gr(e=>({setHttpHandler(t){e.httpHandler=t},httpHandler(){return e.httpHandler},updateHttpClientConfig(t,r){e.httpHandler?.updateHttpClientConfig(t,r)},httpHandlerConfigs(){return e.httpHandler.httpHandlerConfigs()}}),"getHttpHandlerExtensionConfiguration"),OF=Gr(e=>({httpHandler:e.httpHandler()}),"resolveHttpHandlerRuntimeConfig"),wy=qr(),DF=class{static{Gr(this,"Field")}constructor({name:e,kind:t=wy.FieldPosition.HEADER,values:r=[]}){this.name=e,this.kind=t,this.values=r}add(e){this.values.push(e)}set(e){this.values=e}remove(e){this.values=this.values.filter(t=>t!==e)}toString(){return this.values.map(e=>e.includes(",")||e.includes(" ")?`"${e}"`:e).join(", ")}get(){return this.values}},RF=class{constructor({fields:e=[],encoding:t="utf-8"}){this.entries={},e.forEach(this.setField.bind(this)),this.encoding=t}static{Gr(this,"Fields")}setField(e){this.entries[e.name.toLowerCase()]=e}getField(e){return this.entries[e.toLowerCase()]}removeField(e){delete this.entries[e.toLowerCase()]}getByType(e){return Object.values(this.entries).filter(t=>t.kind===e)}},NF=class Hu{static{Gr(this,"HttpRequest")}constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){let r=new Hu({...t,headers:{...t.headers}});return r.query&&(r.query=Ty(r.query)),r}static isInstance(t){if(!t)return!1;let r=t;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return Hu.clone(this)}};function Ty(e){return Object.keys(e).reduce((t,r)=>{let n=e[r];return{...t,[r]:Array.isArray(n)?[...n]:n}},{})}Gr(Ty,"cloneQuery");var LF=class{static{Gr(this,"HttpResponse")}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 t=e;return typeof t.statusCode=="number"&&typeof t.headers=="object"}};function Py(e){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(e)}Gr(Py,"isValidHostname")});var Ko=b((Tee,Ry)=>{"use strict";var Ka=Object.defineProperty,kF=Object.getOwnPropertyDescriptor,MF=Object.getOwnPropertyNames,FF=Object.prototype.hasOwnProperty,Za=(e,t)=>Ka(e,"name",{value:t,configurable:!0}),jF=(e,t)=>{for(var r in t)Ka(e,r,{get:t[r],enumerable:!0})},UF=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of MF(t))!FF.call(e,s)&&s!==r&&Ka(e,s,{get:()=>t[s],enumerable:!(n=kF(t,s))||n.enumerable});return e},BF=e=>UF(Ka({},"__esModule",{value:!0}),e),Iy={};jF(Iy,{getHostHeaderPlugin:()=>zF,hostHeaderMiddleware:()=>Oy,hostHeaderMiddlewareOptions:()=>Dy,resolveHostHeaderConfig:()=>Ay});Ry.exports=BF(Iy);var $F=ge();function Ay(e){return e}Za(Ay,"resolveHostHeaderConfig");var Oy=Za(e=>t=>async r=>{if(!$F.HttpRequest.isInstance(r.request))return t(r);let{request:n}=r,{handlerProtocol:s=""}=e.requestHandler.metadata||{};if(s.indexOf("h2")>=0&&!n.headers[":authority"])delete n.headers.host,n.headers[":authority"]=n.hostname+(n.port?":"+n.port:"");else if(!n.headers.host){let o=n.hostname;n.port!=null&&(o+=`:${n.port}`),n.headers.host=o}return t(r)},"hostHeaderMiddleware"),Dy={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},zF=Za(e=>({applyToStack:Za(t=>{t.add(Oy(e),Dy)},"applyToStack")}),"getHostHeaderPlugin")});var Jo=b((Pee,My)=>{"use strict";var Ja=Object.defineProperty,HF=Object.getOwnPropertyDescriptor,qF=Object.getOwnPropertyNames,GF=Object.prototype.hasOwnProperty,qu=(e,t)=>Ja(e,"name",{value:t,configurable:!0}),VF=(e,t)=>{for(var r in t)Ja(e,r,{get:t[r],enumerable:!0})},WF=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of qF(t))!GF.call(e,s)&&s!==r&&Ja(e,s,{get:()=>t[s],enumerable:!(n=HF(t,s))||n.enumerable});return e},ZF=e=>WF(Ja({},"__esModule",{value:!0}),e),Ny={};VF(Ny,{getLoggerPlugin:()=>KF,loggerMiddleware:()=>Ly,loggerMiddlewareOptions:()=>ky});My.exports=ZF(Ny);var Ly=qu(()=>(e,t)=>async r=>{try{let n=await e(r),{clientName:s,commandName:o,logger:i,dynamoDbDocumentClientOptions:a={}}=t,{overrideInputFilterSensitiveLog:c,overrideOutputFilterSensitiveLog:d}=a,l=c??t.inputFilterSensitiveLog,u=d??t.outputFilterSensitiveLog,{$metadata:m,...p}=n.output;return i?.info?.({clientName:s,commandName:o,input:l(r.input),output:u(p),metadata:m}),n}catch(n){let{clientName:s,commandName:o,logger:i,dynamoDbDocumentClientOptions:a={}}=t,{overrideInputFilterSensitiveLog:c}=a,d=c??t.inputFilterSensitiveLog;throw i?.error?.({clientName:s,commandName:o,input:d(r.input),error:n,metadata:n.$metadata}),n}},"loggerMiddleware"),ky={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},KF=qu(e=>({applyToStack:qu(t=>{t.add(Ly(),ky)},"applyToStack")}),"getLoggerPlugin")});var Yo=b((xee,By)=>{"use strict";var Qa=Object.defineProperty,JF=Object.getOwnPropertyDescriptor,YF=Object.getOwnPropertyNames,QF=Object.prototype.hasOwnProperty,Ya=(e,t)=>Qa(e,"name",{value:t,configurable:!0}),XF=(e,t)=>{for(var r in t)Qa(e,r,{get:t[r],enumerable:!0})},e1=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of YF(t))!QF.call(e,s)&&s!==r&&Qa(e,s,{get:()=>t[s],enumerable:!(n=JF(t,s))||n.enumerable});return e},t1=e=>e1(Qa({},"__esModule",{value:!0}),e),Fy={};XF(Fy,{addRecursionDetectionMiddlewareOptions:()=>Uy,getRecursionDetectionPlugin:()=>o1,recursionDetectionMiddleware:()=>jy});By.exports=t1(Fy);var r1=ge(),Gu="X-Amzn-Trace-Id",n1="AWS_LAMBDA_FUNCTION_NAME",s1="_X_AMZN_TRACE_ID",jy=Ya(e=>t=>async r=>{let{request:n}=r;if(!r1.HttpRequest.isInstance(n)||e.runtime!=="node")return t(r);let s=Object.keys(n.headers??{}).find(c=>c.toLowerCase()===Gu.toLowerCase())??Gu;if(n.headers.hasOwnProperty(s))return t(r);let o=process.env[n1],i=process.env[s1],a=Ya(c=>typeof c=="string"&&c.length>0,"nonEmptyString");return a(o)&&a(i)&&(n.headers[Gu]=i),t({...r,request:n})},"recursionDetectionMiddleware"),Uy={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},o1=Ya(e=>({applyToStack:Ya(t=>{t.add(jy(e),Uy)},"applyToStack")}),"getRecursionDetectionPlugin")});var Vu,i1,$y=C(()=>{Vu=P(qr()),i1=e=>e[Vu.SMITHY_CONTEXT_KEY]||(e[Vu.SMITHY_CONTEXT_KEY]={})});var mt=b(Wu=>{"use strict";var zy=qr(),a1=e=>e[zy.SMITHY_CONTEXT_KEY]||(e[zy.SMITHY_CONTEXT_KEY]={}),c1=e=>{if(typeof e=="function")return e;let t=Promise.resolve(e);return()=>t};Wu.getSmithyContext=a1;Wu.normalizeProvider=c1});var Hy,qy=C(()=>{Hy=(e,t)=>{if(!t||t.length===0)return e;let r=[];for(let n of t)for(let s of e)s.schemeId.split("#")[1]===n&&r.push(s);for(let n of e)r.find(({schemeId:s})=>s===n.schemeId)||r.push(n);return r}});function d1(e){let t=new Map;for(let r of e)t.set(r.schemeId,r);return t}var Gy,Qo,Xa=C(()=>{Gy=P(mt());qy();Qo=(e,t)=>(r,n)=>async s=>{let o=e.httpAuthSchemeProvider(await t.httpAuthSchemeParametersProvider(e,n,s.input)),i=e.authSchemePreference?await e.authSchemePreference():[],a=Hy(o,i),c=d1(e.httpAuthSchemes),d=(0,Gy.getSmithyContext)(n),l=[];for(let u of a){let m=c.get(u.schemeId);if(!m){l.push(`HttpAuthScheme \`${u.schemeId}\` was not enabled for this service.`);continue}let p=m.identityProvider(await t.identityProviderConfigProvider(e));if(!p){l.push(`HttpAuthScheme \`${u.schemeId}\` did not have an IdentityProvider configured.`);continue}let{identityProperties:h={},signingProperties:y={}}=u.propertiesExtractor?.(e,n)||{};u.identityProperties=Object.assign(u.identityProperties||{},h),u.signingProperties=Object.assign(u.signingProperties||{},y),d.selectedHttpAuthScheme={httpAuthOption:u,identity:await p(u.identityProperties),signer:m.signer};break}if(!d.selectedHttpAuthScheme)throw new Error(l.join(`
7
- `));return r(s)}});var Vy,Xo,Wy=C(()=>{Xa();Vy={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},Xo=(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:r})=>({applyToStack:n=>{n.addRelativeTo(Qo(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:r}),Vy)}})});var Vr=b((kee,e_)=>{var ec=Object.defineProperty,l1=Object.getOwnPropertyDescriptor,u1=Object.getOwnPropertyNames,m1=Object.prototype.hasOwnProperty,tc=(e,t)=>ec(e,"name",{value:t,configurable:!0}),p1=(e,t)=>{for(var r in t)ec(e,r,{get:t[r],enumerable:!0})},f1=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of u1(t))!m1.call(e,s)&&s!==r&&ec(e,s,{get:()=>t[s],enumerable:!(n=l1(t,s))||n.enumerable});return e},g1=e=>f1(ec({},"__esModule",{value:!0}),e),Zy={};p1(Zy,{deserializerMiddleware:()=>Ky,deserializerMiddlewareOption:()=>Yy,getSerdePlugin:()=>Xy,serializerMiddleware:()=>Jy,serializerMiddlewareOption:()=>Qy});e_.exports=g1(Zy);var h1=ge(),Ky=tc((e,t)=>(r,n)=>async s=>{let{response:o}=await r(s);try{let i=await t(o,e);return{response:o,output:i}}catch(i){if(Object.defineProperty(i,"$response",{value:o}),!("$metadata"in i)){let a="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{i.message+=`
8
- `+a}catch{!n.logger||n.logger?.constructor?.name==="NoOpLogger"?console.warn(a):n.logger?.warn?.(a)}typeof i.$responseBodyText<"u"&&i.$response&&(i.$response.body=i.$responseBodyText);try{if(h1.HttpResponse.isInstance(o)){let{headers:c={}}=o,d=Object.entries(c);i.$metadata={httpStatusCode:o.statusCode,requestId:Zu(/^x-[\w-]+-request-?id$/,d),extendedRequestId:Zu(/^x-[\w-]+-id-2$/,d),cfId:Zu(/^x-[\w-]+-cf-id$/,d)}}}catch{}}throw i}},"deserializerMiddleware"),Zu=tc((e,t)=>(t.find(([r])=>r.match(e))||[void 0,void 0])[1],"findHeader"),Jy=tc((e,t)=>(r,n)=>async s=>{let o=e,i=n.endpointV2?.url&&o.urlParser?async()=>o.urlParser(n.endpointV2.url):o.endpoint;if(!i)throw new Error("No valid endpoint provider available.");let a=await t(s.input,{...e,endpoint:i});return r({...s,request:a})},"serializerMiddleware"),Yy={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Qy={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Xy(e,t,r){return{applyToStack:n=>{n.add(Ky(e,r),Yy),n.add(Jy(e,t),Qy)}}}tc(Xy,"getSerdePlugin")});var t_,r_,y1,n_=C(()=>{t_=P(Vr());Xa();r_={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:t_.serializerMiddlewareOption.name},y1=(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:r})=>({applyToStack:n=>{n.addRelativeTo(Qo(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:r}),r_)}})});var s_=C(()=>{Xa();Wy();n_()});var o_,i_,_1,v1,Ku,Ju=C(()=>{o_=P(ge()),i_=P(mt()),_1=e=>t=>{throw t},v1=(e,t)=>{},Ku=e=>(t,r)=>async n=>{if(!o_.HttpRequest.isInstance(n.request))return t(n);let o=(0,i_.getSmithyContext)(r).selectedHttpAuthScheme;if(!o)throw new Error("No HttpAuthScheme was selected: unable to sign request");let{httpAuthOption:{signingProperties:i={}},identity:a,signer:c}=o,d=await t({...n,request:await c.sign(n.request,a,i)}).catch((c.errorHandler||_1)(i));return(c.successHandler||v1)(d.response,i),d}});var a_,ei,c_=C(()=>{Ju();a_={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},ei=e=>({applyToStack:t=>{t.addRelativeTo(Ku(e),a_)}})});var d_=C(()=>{Ju();c_()});var Wr,l_=C(()=>{Wr=e=>{if(typeof e=="function")return e;let t=Promise.resolve(e);return()=>t}});function u_(e,t,r,n,s){return async function*(i,a,...c){let d=a,l=i.startingToken??d[r],u=!0,m;for(;u;){if(d[r]=l,s&&(d[s]=d[s]??i.pageSize),i.client instanceof e)m=await S1(t,i.client,a,i.withCommand,...c);else throw new Error(`Invalid client, expected instance of ${e.name}`);yield m;let p=l;l=E1(m,n),u=!!(l&&(!i.stopOnSameToken||l!==p))}return void 0}}var S1,E1,m_=C(()=>{S1=async(e,t,r,n=o=>o,...s)=>{let o=new e(r);return o=n(o)??o,await t.send(o,...s)};E1=(e,t)=>{let r=e,n=t.split(".");for(let s of n){if(!r||typeof r!="object")return;r=r[s]}return r}});var Yu=b((Jee,f_)=>{var rc=Object.defineProperty,C1=Object.getOwnPropertyDescriptor,b1=Object.getOwnPropertyNames,w1=Object.prototype.hasOwnProperty,T1=(e,t)=>rc(e,"name",{value:t,configurable:!0}),P1=(e,t)=>{for(var r in t)rc(e,r,{get:t[r],enumerable:!0})},x1=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of b1(t))!w1.call(e,s)&&s!==r&&rc(e,s,{get:()=>t[s],enumerable:!(n=C1(t,s))||n.enumerable});return e},I1=e=>x1(rc({},"__esModule",{value:!0}),e),p_={};P1(p_,{isArrayBuffer:()=>A1});f_.exports=I1(p_);var A1=T1(e=>typeof ArrayBuffer=="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]","isArrayBuffer")});var Zs=b((Yee,y_)=>{var nc=Object.defineProperty,O1=Object.getOwnPropertyDescriptor,D1=Object.getOwnPropertyNames,R1=Object.prototype.hasOwnProperty,g_=(e,t)=>nc(e,"name",{value:t,configurable:!0}),N1=(e,t)=>{for(var r in t)nc(e,r,{get:t[r],enumerable:!0})},L1=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of D1(t))!R1.call(e,s)&&s!==r&&nc(e,s,{get:()=>t[s],enumerable:!(n=O1(t,s))||n.enumerable});return e},k1=e=>L1(nc({},"__esModule",{value:!0}),e),h_={};N1(h_,{fromArrayBuffer:()=>F1,fromString:()=>j1});y_.exports=k1(h_);var M1=Yu(),Qu=require("buffer"),F1=g_((e,t=0,r=e.byteLength-t)=>{if(!(0,M1.isArrayBuffer)(e))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return Qu.Buffer.from(e,t,r)},"fromArrayBuffer"),j1=g_((e,t)=>{if(typeof e!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?Qu.Buffer.from(e,t):Qu.Buffer.from(e)},"fromString")});var __=b(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.fromBase64=void 0;var U1=Zs(),B1=/^[A-Za-z0-9+/]*={0,2}$/,$1=e=>{if(e.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!B1.exec(e))throw new TypeError("Invalid base64 string.");let t=(0,U1.fromString)(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)};sc.fromBase64=$1});var Re=b((Xee,C_)=>{var oc=Object.defineProperty,z1=Object.getOwnPropertyDescriptor,H1=Object.getOwnPropertyNames,q1=Object.prototype.hasOwnProperty,Xu=(e,t)=>oc(e,"name",{value:t,configurable:!0}),G1=(e,t)=>{for(var r in t)oc(e,r,{get:t[r],enumerable:!0})},V1=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of H1(t))!q1.call(e,s)&&s!==r&&oc(e,s,{get:()=>t[s],enumerable:!(n=z1(t,s))||n.enumerable});return e},W1=e=>V1(oc({},"__esModule",{value:!0}),e),v_={};G1(v_,{fromUtf8:()=>E_,toUint8Array:()=>Z1,toUtf8:()=>K1});C_.exports=W1(v_);var S_=Zs(),E_=Xu(e=>{let t=(0,S_.fromString)(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),Z1=Xu(e=>typeof e=="string"?E_(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),"toUint8Array"),K1=Xu(e=>{if(typeof e=="string")return e;if(typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return(0,S_.fromArrayBuffer)(e.buffer,e.byteOffset,e.byteLength).toString("utf8")},"toUtf8")});var b_=b(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.toBase64=void 0;var J1=Zs(),Y1=Re(),Q1=e=>{let t;if(typeof e=="string"?t=(0,Y1.fromUtf8)(e):t=e,typeof t!="object"||typeof t.byteOffset!="number"||typeof t.byteLength!="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return(0,J1.fromArrayBuffer)(t.buffer,t.byteOffset,t.byteLength).toString("base64")};ic.toBase64=Q1});var Je=b((tte,ac)=>{var w_=Object.defineProperty,X1=Object.getOwnPropertyDescriptor,ej=Object.getOwnPropertyNames,tj=Object.prototype.hasOwnProperty,em=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ej(t))!tj.call(e,s)&&s!==r&&w_(e,s,{get:()=>t[s],enumerable:!(n=X1(t,s))||n.enumerable});return e},T_=(e,t,r)=>(em(e,t,"default"),r&&em(r,t,"default")),rj=e=>em(w_({},"__esModule",{value:!0}),e),tm={};ac.exports=rj(tm);T_(tm,__(),ac.exports);T_(tm,b_(),ac.exports)});var nm=b(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.ChecksumStream=void 0;var nj=Je(),sj=require("stream"),rm=class extends sj.Duplex{constructor({expectedChecksum:t,checksum:r,source:n,checksumSourceLocation:s,base64Encoder:o}){var i,a;if(super(),typeof n.pipe=="function")this.source=n;else throw new Error(`@smithy/util-stream: unsupported source type ${(a=(i=n?.constructor)===null||i===void 0?void 0:i.name)!==null&&a!==void 0?a:n} in ChecksumStream.`);this.base64Encoder=o??nj.toBase64,this.expectedChecksum=t,this.checksum=r,this.checksumSourceLocation=s,this.source.pipe(this)}_read(t){}_write(t,r,n){try{this.checksum.update(t),this.push(t)}catch(s){return n(s)}return n()}async _final(t){try{let r=await this.checksum.digest(),n=this.base64Encoder(r);if(this.expectedChecksum!==n)return t(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${n}" in response header "${this.checksumSourceLocation}".`))}catch(r){return t(r)}return this.push(null),t()}};cc.ChecksumStream=rm});var Zr=b(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.isBlob=Ks.isReadableStream=void 0;var oj=e=>{var t;return typeof ReadableStream=="function"&&(((t=e?.constructor)===null||t===void 0?void 0:t.name)===ReadableStream.name||e instanceof ReadableStream)};Ks.isReadableStream=oj;var ij=e=>{var t;return typeof Blob=="function"&&(((t=e?.constructor)===null||t===void 0?void 0:t.name)===Blob.name||e instanceof Blob)};Ks.isBlob=ij});var P_=b(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.ChecksumStream=void 0;var aj=typeof ReadableStream=="function"?ReadableStream:function(){},sm=class extends aj{};dc.ChecksumStream=sm});var x_=b(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.createChecksumStream=void 0;var cj=Je(),dj=Zr(),lj=P_(),uj=({expectedChecksum:e,checksum:t,source:r,checksumSourceLocation:n,base64Encoder:s})=>{var o,i;if(!(0,dj.isReadableStream)(r))throw new Error(`@smithy/util-stream: unsupported source type ${(i=(o=r?.constructor)===null||o===void 0?void 0:o.name)!==null&&i!==void 0?i:r} in ChecksumStream.`);let a=s??cj.toBase64;if(typeof TransformStream!="function")throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let c=new TransformStream({start(){},async transform(l,u){t.update(l),u.enqueue(l)},async flush(l){let u=await t.digest(),m=a(u);if(e!==m){let p=new Error(`Checksum mismatch: expected "${e}" but received "${m}" in response header "${n}".`);l.error(p)}else l.terminate()}});r.pipeThrough(c);let d=c.readable;return Object.setPrototypeOf(d,lj.ChecksumStream.prototype),d};lc.createChecksumStream=uj});var I_=b(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.createChecksumStream=gj;var mj=Zr(),pj=nm(),fj=x_();function gj(e){return typeof ReadableStream=="function"&&(0,mj.isReadableStream)(e.source)?(0,fj.createChecksumStream)(e):new pj.ChecksumStream(e)}});var am=b(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.ByteArrayCollector=void 0;var im=class{constructor(t){this.allocByteArray=t,this.byteLength=0,this.byteArrays=[]}push(t){this.byteArrays.push(t),this.byteLength+=t.byteLength}flush(){if(this.byteArrays.length===1){let n=this.byteArrays[0];return this.reset(),n}let t=this.allocByteArray(this.byteLength),r=0;for(let n=0;n<this.byteArrays.length;++n){let s=this.byteArrays[n];t.set(s,r),r+=s.byteLength}return this.reset(),t}reset(){this.byteArrays=[],this.byteLength=0}};uc.ByteArrayCollector=im});var R_=b(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.createBufferedReadable=void 0;hr.createBufferedReadableStream=A_;hr.merge=O_;hr.flush=mc;hr.sizeOf=Js;hr.modeOf=D_;var hj=am();function A_(e,t,r){let n=e.getReader(),s=!1,o=0,i=["",new hj.ByteArrayCollector(d=>new Uint8Array(d))],a=-1,c=async d=>{let{value:l,done:u}=await n.read(),m=l;if(u){if(a!==-1){let p=mc(i,a);Js(p)>0&&d.enqueue(p)}d.close()}else{let p=D_(m,!1);if(a!==p&&(a>=0&&d.enqueue(mc(i,a)),a=p),a===-1){d.enqueue(m);return}let h=Js(m);o+=h;let y=Js(i[a]);if(h>=t&&y===0)d.enqueue(m);else{let _=O_(i,a,m);!s&&o>t*2&&(s=!0,r?.warn(`@smithy/util-stream - stream chunk size ${h} is below threshold of ${t}, automatically buffering.`)),_>=t?d.enqueue(mc(i,a)):await c(d)}}};return new ReadableStream({pull:c})}hr.createBufferedReadable=A_;function O_(e,t,r){switch(t){case 0:return e[0]+=r,Js(e[0]);case 1:case 2:return e[t].push(r),Js(e[t])}}function mc(e,t){switch(t){case 0:let r=e[0];return e[0]="",r;case 1:case 2:return e[t].flush()}throw new Error(`@smithy/util-stream - invalid index ${t} given to flush()`)}function Js(e){var t,r;return(r=(t=e?.byteLength)!==null&&t!==void 0?t:e?.length)!==null&&r!==void 0?r:0}function D_(e,t=!0){return t&&typeof Buffer<"u"&&e instanceof Buffer?2:e instanceof Uint8Array?1:typeof e=="string"?0:-1}});var L_=b(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});cm.createBufferedReadable=vj;var yj=require("node:stream"),N_=am(),yr=R_(),_j=Zr();function vj(e,t,r){if((0,_j.isReadableStream)(e))return(0,yr.createBufferedReadableStream)(e,t,r);let n=new yj.Readable({read(){}}),s=!1,o=0,i=["",new N_.ByteArrayCollector(c=>new Uint8Array(c)),new N_.ByteArrayCollector(c=>Buffer.from(new Uint8Array(c)))],a=-1;return e.on("data",c=>{let d=(0,yr.modeOf)(c,!0);if(a!==d&&(a>=0&&n.push((0,yr.flush)(i,a)),a=d),a===-1){n.push(c);return}let l=(0,yr.sizeOf)(c);o+=l;let u=(0,yr.sizeOf)(i[a]);if(l>=t&&u===0)n.push(c);else{let m=(0,yr.merge)(i,a,c);!s&&o>t*2&&(s=!0,r?.warn(`@smithy/util-stream - stream chunk size ${l} is below threshold of ${t}, automatically buffering.`)),m>=t&&n.push((0,yr.flush)(i,a))}}),e.on("end",()=>{if(a!==-1){let c=(0,yr.flush)(i,a);(0,yr.sizeOf)(c)>0&&n.push(c)}n.push(null)}),n}});var k_=b(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.getAwsChunkedEncodingStream=void 0;var Sj=require("stream"),Ej=(e,t)=>{let{base64Encoder:r,bodyLengthChecker:n,checksumAlgorithmFn:s,checksumLocationName:o,streamHasher:i}=t,a=r!==void 0&&s!==void 0&&o!==void 0&&i!==void 0,c=a?i(s,e):void 0,d=new Sj.Readable({read:()=>{}});return e.on("data",l=>{let u=n(l)||0;d.push(`${u.toString(16)}\r
9
- `),d.push(l),d.push(`\r
10
- `)}),e.on("end",async()=>{if(d.push(`0\r
11
- `),a){let l=r(await c);d.push(`${o}:${l}\r
12
- `),d.push(`\r
13
- `)}d.push(null)}),d};pc.getAwsChunkedEncodingStream=Ej});var M_=b(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});dm.headStream=Cj;async function Cj(e,t){var r;let n=0,s=[],o=e.getReader(),i=!1;for(;!i;){let{done:d,value:l}=await o.read();if(l&&(s.push(l),n+=(r=l?.byteLength)!==null&&r!==void 0?r:0),n>=t)break;i=d}o.releaseLock();let a=new Uint8Array(Math.min(t,n)),c=0;for(let d of s){if(d.byteLength>a.byteLength-c){a.set(d.subarray(0,a.byteLength-c),c);break}else a.set(d,c);c+=d.length}return a}});var F_=b(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.headStream=void 0;var bj=require("stream"),wj=M_(),Tj=Zr(),Pj=(e,t)=>(0,Tj.isReadableStream)(e)?(0,wj.headStream)(e,t):new Promise((r,n)=>{let s=new lm;s.limit=t,e.pipe(s),e.on("error",o=>{s.end(),n(o)}),s.on("error",n),s.on("finish",function(){let o=new Uint8Array(Buffer.concat(this.buffers));r(o)})});fc.headStream=Pj;var lm=class extends bj.Writable{constructor(){super(...arguments),this.buffers=[],this.limit=1/0,this.bytesBuffered=0}_write(t,r,n){var s;if(this.buffers.push(t),this.bytesBuffered+=(s=t.byteLength)!==null&&s!==void 0?s:0,this.bytesBuffered>=this.limit){let o=this.bytesBuffered-this.limit,i=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=i.subarray(0,i.byteLength-o),this.emit("finish")}n()}}});var mm=b((pte,B_)=>{var gc=Object.defineProperty,xj=Object.getOwnPropertyDescriptor,Ij=Object.getOwnPropertyNames,Aj=Object.prototype.hasOwnProperty,um=(e,t)=>gc(e,"name",{value:t,configurable:!0}),Oj=(e,t)=>{for(var r in t)gc(e,r,{get:t[r],enumerable:!0})},Dj=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ij(t))!Aj.call(e,s)&&s!==r&&gc(e,s,{get:()=>t[s],enumerable:!(n=xj(t,s))||n.enumerable});return e},Rj=e=>Dj(gc({},"__esModule",{value:!0}),e),j_={};Oj(j_,{escapeUri:()=>U_,escapeUriPath:()=>Lj});B_.exports=Rj(j_);var U_=um(e=>encodeURIComponent(e).replace(/[!'()*]/g,Nj),"escapeUri"),Nj=um(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),Lj=um(e=>e.split("/").map(U_).join("/"),"escapeUriPath")});var fm=b((fte,H_)=>{var hc=Object.defineProperty,kj=Object.getOwnPropertyDescriptor,Mj=Object.getOwnPropertyNames,Fj=Object.prototype.hasOwnProperty,jj=(e,t)=>hc(e,"name",{value:t,configurable:!0}),Uj=(e,t)=>{for(var r in t)hc(e,r,{get:t[r],enumerable:!0})},Bj=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Mj(t))!Fj.call(e,s)&&s!==r&&hc(e,s,{get:()=>t[s],enumerable:!(n=kj(t,s))||n.enumerable});return e},$j=e=>Bj(hc({},"__esModule",{value:!0}),e),$_={};Uj($_,{buildQueryString:()=>z_});H_.exports=$j($_);var pm=mm();function z_(e){let t=[];for(let r of Object.keys(e).sort()){let n=e[r];if(r=(0,pm.escapeUri)(r),Array.isArray(n))for(let s=0,o=n.length;s<o;s++)t.push(`${r}=${(0,pm.escapeUri)(n[s])}`);else{let s=r;(n||typeof n=="string")&&(s+=`=${(0,pm.escapeUri)(n)}`),t.push(s)}}return t.join("&")}jj(z_,"buildQueryString")});var Wn=b((gte,ov)=>{var zj=Object.create,ti=Object.defineProperty,Hj=Object.getOwnPropertyDescriptor,qj=Object.getOwnPropertyNames,Gj=Object.getPrototypeOf,Vj=Object.prototype.hasOwnProperty,he=(e,t)=>ti(e,"name",{value:t,configurable:!0}),Wj=(e,t)=>{for(var r in t)ti(e,r,{get:t[r],enumerable:!0})},Z_=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of qj(t))!Vj.call(e,s)&&s!==r&&ti(e,s,{get:()=>t[s],enumerable:!(n=Hj(t,s))||n.enumerable});return e},Zj=(e,t,r)=>(r=e!=null?zj(Gj(e)):{},Z_(t||!e||!e.__esModule?ti(r,"default",{value:e,enumerable:!0}):r,e)),Kj=e=>Z_(ti({},"__esModule",{value:!0}),e),K_={};Wj(K_,{DEFAULT_REQUEST_TIMEOUT:()=>tv,NodeHttp2Handler:()=>oU,NodeHttpHandler:()=>tU,streamCollector:()=>aU});ov.exports=Kj(K_);var J_=ge(),Y_=fm(),gm=require("http"),hm=require("https"),Jj=["ECONNRESET","EPIPE","ETIMEDOUT"],Q_=he(e=>{let t={};for(let r of Object.keys(e)){let n=e[r];t[r]=Array.isArray(n)?n.join(","):n}return t},"getTransformedHeaders"),nt={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},q_=1e3,Yj=he((e,t,r=0)=>{if(!r)return-1;let n=he(s=>{let o=nt.setTimeout(()=>{e.destroy(),t(Object.assign(new Error(`Socket timed out without establishing a connection within ${r} ms`),{name:"TimeoutError"}))},r-s),i=he(a=>{a?.connecting?a.on("connect",()=>{nt.clearTimeout(o)}):nt.clearTimeout(o)},"doWithSocket");e.socket?i(e.socket):e.on("socket",i)},"registerTimeout");return r<2e3?(n(0),0):nt.setTimeout(n.bind(null,q_),q_)},"setConnectionTimeout"),Qj=3e3,Xj=he((e,{keepAlive:t,keepAliveMsecs:r},n=Qj)=>{if(t!==!0)return-1;let s=he(()=>{e.socket?e.socket.setKeepAlive(t,r||0):e.on("socket",o=>{o.setKeepAlive(t,r||0)})},"registerListener");return n===0?(s(),0):nt.setTimeout(s,n)},"setSocketKeepAlive"),G_=3e3,eU=he((e,t,r=tv)=>{let n=he(s=>{let o=r-s,i=he(()=>{e.destroy(),t(Object.assign(new Error(`Connection timed out after ${r} ms`),{name:"TimeoutError"}))},"onTimeout");e.socket?(e.socket.setTimeout(o,i),e.on("close",()=>e.socket?.removeListener("timeout",i))):e.setTimeout(o,i)},"registerTimeout");return 0<r&&r<6e3?(n(0),0):nt.setTimeout(n.bind(null,r===0?0:G_),G_)},"setSocketTimeout"),X_=require("stream"),V_=6e3;async function _m(e,t,r=V_){let n=t.headers??{},s=n.Expect||n.expect,o=-1,i=!0;s==="100-continue"&&(i=await Promise.race([new Promise(a=>{o=Number(nt.setTimeout(()=>a(!0),Math.max(V_,r)))}),new Promise(a=>{e.on("continue",()=>{nt.clearTimeout(o),a(!0)}),e.on("response",()=>{nt.clearTimeout(o),a(!1)}),e.on("error",()=>{nt.clearTimeout(o),a(!1)})})])),i&&ev(e,t.body)}he(_m,"writeRequestBody");function ev(e,t){if(t instanceof X_.Readable){t.pipe(e);return}if(t){if(Buffer.isBuffer(t)||typeof t=="string"){e.end(t);return}let r=t;if(typeof r=="object"&&r.buffer&&typeof r.byteOffset=="number"&&typeof r.byteLength=="number"){e.end(Buffer.from(r.buffer,r.byteOffset,r.byteLength));return}e.end(Buffer.from(t));return}e.end()}he(ev,"writeBody");var tv=0,tU=class ym{constructor(t){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((r,n)=>{typeof t=="function"?t().then(s=>{r(this.resolveDefaultConfig(s))}).catch(n):r(this.resolveDefaultConfig(t))})}static{he(this,"NodeHttpHandler")}static create(t){return typeof t?.handle=="function"?t:new ym(t)}static checkSocketUsage(t,r,n=console){let{sockets:s,requests:o,maxSockets:i}=t;if(typeof i!="number"||i===1/0||Date.now()-15e3<r)return r;if(s&&o)for(let c in s){let d=s[c]?.length??0,l=o[c]?.length??0;if(d>=i&&l>=2*i)return n?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${d} and ${l} additional requests are enqueued.
14
- See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
15
- or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return r}resolveDefaultConfig(t){let{requestTimeout:r,connectionTimeout:n,socketTimeout:s,socketAcquisitionWarningTimeout:o,httpAgent:i,httpsAgent:a}=t||{},c=!0,d=50;return{connectionTimeout:n,requestTimeout:r??s,socketAcquisitionWarningTimeout:o,httpAgent:i instanceof gm.Agent||typeof i?.destroy=="function"?i:new gm.Agent({keepAlive:c,maxSockets:d,...i}),httpsAgent:a instanceof hm.Agent||typeof a?.destroy=="function"?a:new hm.Agent({keepAlive:c,maxSockets:d,...a}),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(t,{abortSignal:r,requestTimeout:n}={}){return this.config||(this.config=await this.configProvider),new Promise((s,o)=>{let i,a=[],c=he(async A=>{await i,a.forEach(nt.clearTimeout),s(A)},"resolve"),d=he(async A=>{await i,a.forEach(nt.clearTimeout),o(A)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(r?.aborted){let A=new Error("Request aborted");A.name="AbortError",d(A);return}let l=t.protocol==="https:",u=l?this.config.httpsAgent:this.config.httpAgent;a.push(nt.setTimeout(()=>{this.socketWarningTimestamp=ym.checkSocketUsage(u,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2e3)+(this.config.connectionTimeout??1e3)));let m=(0,Y_.buildQueryString)(t.query||{}),p;if(t.username!=null||t.password!=null){let A=t.username??"",H=t.password??"";p=`${A}:${H}`}let h=t.path;m&&(h+=`?${m}`),t.fragment&&(h+=`#${t.fragment}`);let y=t.hostname??"";y[0]==="["&&y.endsWith("]")?y=t.hostname.slice(1,-1):y=t.hostname;let _={headers:t.headers,host:y,method:t.method,path:h,port:t.port,agent:u,auth:p},E=(l?hm.request:gm.request)(_,A=>{let H=new J_.HttpResponse({statusCode:A.statusCode||-1,reason:A.statusMessage,headers:Q_(A.headers),body:A});c({response:H})});if(E.on("error",A=>{Jj.includes(A.code)?d(Object.assign(A,{name:"TimeoutError"})):d(A)}),r){let A=he(()=>{E.destroy();let H=new Error("Request aborted");H.name="AbortError",d(H)},"onAbort");if(typeof r.addEventListener=="function"){let H=r;H.addEventListener("abort",A,{once:!0}),E.once("close",()=>H.removeEventListener("abort",A))}else r.onabort=A}let B=n??this.config.requestTimeout;a.push(Yj(E,d,this.config.connectionTimeout)),a.push(eU(E,d,B));let T=_.agent;typeof T=="object"&&"keepAlive"in T&&a.push(Xj(E,{keepAlive:T.keepAlive,keepAliveMsecs:T.keepAliveMsecs})),i=_m(E,t,B).catch(A=>(a.forEach(nt.clearTimeout),o(A)))})}updateHttpClientConfig(t,r){this.config=void 0,this.configProvider=this.configProvider.then(n=>({...n,[t]:r}))}httpHandlerConfigs(){return this.config??{}}},W_=require("http2"),rU=Zj(require("http2")),nU=class{constructor(e){this.sessions=[],this.sessions=e??[]}static{he(this,"NodeHttp2ConnectionPool")}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(e){this.sessions.push(e)}contains(e){return this.sessions.includes(e)}remove(e){this.sessions=this.sessions.filter(t=>t!==e)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(e){for(let t of this.sessions)t===e&&(t.destroyed||t.destroy())}},sU=class{constructor(e){if(this.sessionCache=new Map,this.config=e,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}static{he(this,"NodeHttp2ConnectionManager")}lease(e,t){let r=this.getUrlString(e),n=this.sessionCache.get(r);if(n){let a=n.poll();if(a&&!this.config.disableConcurrency)return a}let s=rU.default.connect(r);this.config.maxConcurrency&&s.settings({maxConcurrentStreams:this.config.maxConcurrency},a=>{if(a)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+e.destination.toString())}),s.unref();let o=he(()=>{s.destroy(),this.deleteSession(r,s)},"destroySessionCb");s.on("goaway",o),s.on("error",o),s.on("frameError",o),s.on("close",()=>this.deleteSession(r,s)),t.requestTimeout&&s.setTimeout(t.requestTimeout,o);let i=this.sessionCache.get(r)||new nU;return i.offerLast(s),this.sessionCache.set(r,i),s}deleteSession(e,t){let r=this.sessionCache.get(e);r&&r.contains(t)&&(r.remove(t),this.sessionCache.set(e,r))}release(e,t){let r=this.getUrlString(e);this.sessionCache.get(r)?.offerLast(t)}destroy(){for(let[e,t]of this.sessionCache){for(let r of t)r.destroyed||r.destroy(),t.remove(r);this.sessionCache.delete(e)}}setMaxConcurrentStreams(e){if(e&&e<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=e}setDisableConcurrentStreams(e){this.config.disableConcurrency=e}getUrlString(e){return e.destination.toString()}},oU=class rv{constructor(t){this.metadata={handlerProtocol:"h2"},this.connectionManager=new sU({}),this.configProvider=new Promise((r,n)=>{typeof t=="function"?t().then(s=>{r(s||{})}).catch(n):r(t||{})})}static{he(this,"NodeHttp2Handler")}static create(t){return typeof t?.handle=="function"?t:new rv(t)}destroy(){this.connectionManager.destroy()}async handle(t,{abortSignal:r,requestTimeout:n}={}){this.config||(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams&&this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams));let{requestTimeout:s,disableConcurrentStreams:o}=this.config,i=n??s;return new Promise((a,c)=>{let d=!1,l,u=he(async K=>{await l,a(K)},"resolve"),m=he(async K=>{await l,c(K)},"reject");if(r?.aborted){d=!0;let K=new Error("Request aborted");K.name="AbortError",m(K);return}let{hostname:p,method:h,port:y,protocol:_,query:w}=t,E="";if(t.username!=null||t.password!=null){let K=t.username??"",Ee=t.password??"";E=`${K}:${Ee}@`}let B=`${_}//${E}${p}${y?`:${y}`:""}`,T={destination:new URL(B)},A=this.connectionManager.lease(T,{requestTimeout:this.config?.sessionTimeout,disableConcurrentStreams:o||!1}),H=he(K=>{o&&this.destroySession(A),d=!0,m(K)},"rejectWithDestroy"),Z=(0,Y_.buildQueryString)(w||{}),V=t.path;Z&&(V+=`?${Z}`),t.fragment&&(V+=`#${t.fragment}`);let me=A.request({...t.headers,[W_.constants.HTTP2_HEADER_PATH]:V,[W_.constants.HTTP2_HEADER_METHOD]:h});if(A.ref(),me.on("response",K=>{let Ee=new J_.HttpResponse({statusCode:K[":status"]||-1,headers:Q_(K),body:me});d=!0,u({response:Ee}),o&&(A.close(),this.connectionManager.deleteSession(B,A))}),i&&me.setTimeout(i,()=>{me.close();let K=new Error(`Stream timed out because of no activity for ${i} ms`);K.name="TimeoutError",H(K)}),r){let K=he(()=>{me.close();let Ee=new Error("Request aborted");Ee.name="AbortError",H(Ee)},"onAbort");if(typeof r.addEventListener=="function"){let Ee=r;Ee.addEventListener("abort",K,{once:!0}),me.once("close",()=>Ee.removeEventListener("abort",K))}else r.onabort=K}me.on("frameError",(K,Ee,Ns)=>{H(new Error(`Frame type id ${K} in stream id ${Ns} has failed with code ${Ee}.`))}),me.on("error",H),me.on("aborted",()=>{H(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${me.rstCode}.`))}),me.on("close",()=>{A.unref(),o&&A.destroy(),d||H(new Error("Unexpected error: http2 request did not get a response"))}),l=_m(me,t,i)})}updateHttpClientConfig(t,r){this.config=void 0,this.configProvider=this.configProvider.then(n=>({...n,[t]:r}))}httpHandlerConfigs(){return this.config??{}}destroySession(t){t.destroyed||t.destroy()}},iU=class extends X_.Writable{constructor(){super(...arguments),this.bufferedBytes=[]}static{he(this,"Collector")}_write(e,t,r){this.bufferedBytes.push(e),r()}},aU=he(e=>cU(e)?sv(e):new Promise((t,r)=>{let n=new iU;e.pipe(n),e.on("error",s=>{n.end(),r(s)}),n.on("error",r),n.on("finish",function(){let s=new Uint8Array(Buffer.concat(this.bufferedBytes));t(s)})}),"streamCollector"),cU=he(e=>typeof ReadableStream=="function"&&e instanceof ReadableStream,"isReadableStreamInstance");async function sv(e){let t=[],r=e.getReader(),n=!1,s=0;for(;!n;){let{done:a,value:c}=await r.read();c&&(t.push(c),s+=c.length),n=a}let o=new Uint8Array(s),i=0;for(let a of t)o.set(a,i),i+=a.length;return o}he(sv,"collectReadableStream")});var fv=b((vte,pv)=>{var _c=Object.defineProperty,dU=Object.getOwnPropertyDescriptor,lU=Object.getOwnPropertyNames,uU=Object.prototype.hasOwnProperty,Kt=(e,t)=>_c(e,"name",{value:t,configurable:!0}),mU=(e,t)=>{for(var r in t)_c(e,r,{get:t[r],enumerable:!0})},pU=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of lU(t))!uU.call(e,s)&&s!==r&&_c(e,s,{get:()=>t[s],enumerable:!(n=dU(t,s))||n.enumerable});return e},fU=e=>pU(_c({},"__esModule",{value:!0}),e),av={};mU(av,{FetchHttpHandler:()=>hU,keepAliveSupport:()=>yc,streamCollector:()=>_U});pv.exports=fU(av);var iv=ge(),gU=fm();function vm(e,t){return new Request(e,t)}Kt(vm,"createRequest");function cv(e=0){return new Promise((t,r)=>{e&&setTimeout(()=>{let n=new Error(`Request did not complete within ${e} ms`);n.name="TimeoutError",r(n)},e)})}Kt(cv,"requestTimeout");var yc={supported:void 0},hU=class dv{static{Kt(this,"FetchHttpHandler")}static create(t){return typeof t?.handle=="function"?t:new dv(t)}constructor(t){typeof t=="function"?this.configProvider=t().then(r=>r||{}):(this.config=t??{},this.configProvider=Promise.resolve(this.config)),yc.supported===void 0&&(yc.supported=typeof Request<"u"&&"keepalive"in vm("https://[::1]"))}destroy(){}async handle(t,{abortSignal:r,requestTimeout:n}={}){this.config||(this.config=await this.configProvider);let s=n??this.config.requestTimeout,o=this.config.keepAlive===!0,i=this.config.credentials;if(r?.aborted){let E=new Error("Request aborted");return E.name="AbortError",Promise.reject(E)}let a=t.path,c=(0,gU.buildQueryString)(t.query||{});c&&(a+=`?${c}`),t.fragment&&(a+=`#${t.fragment}`);let d="";if(t.username!=null||t.password!=null){let E=t.username??"",B=t.password??"";d=`${E}:${B}@`}let{port:l,method:u}=t,m=`${t.protocol}//${d}${t.hostname}${l?`:${l}`:""}${a}`,p=u==="GET"||u==="HEAD"?void 0:t.body,h={body:p,headers:new Headers(t.headers),method:u,credentials:i};this.config?.cache&&(h.cache=this.config.cache),p&&(h.duplex="half"),typeof AbortController<"u"&&(h.signal=r),yc.supported&&(h.keepalive=o),typeof this.config.requestInit=="function"&&Object.assign(h,this.config.requestInit(t));let y=Kt(()=>{},"removeSignalEventListener"),_=vm(m,h),w=[fetch(_).then(E=>{let B=E.headers,T={};for(let H of B.entries())T[H[0]]=H[1];return E.body!=null?{response:new iv.HttpResponse({headers:T,reason:E.statusText,statusCode:E.status,body:E.body})}:E.blob().then(H=>({response:new iv.HttpResponse({headers:T,reason:E.statusText,statusCode:E.status,body:H})}))}),cv(s)];return r&&w.push(new Promise((E,B)=>{let T=Kt(()=>{let A=new Error("Request aborted");A.name="AbortError",B(A)},"onAbort");if(typeof r.addEventListener=="function"){let A=r;A.addEventListener("abort",T,{once:!0}),y=Kt(()=>A.removeEventListener("abort",T),"removeSignalEventListener")}else r.onabort=T})),Promise.race(w).finally(y)}updateHttpClientConfig(t,r){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[t]=r,n))}httpHandlerConfigs(){return this.config??{}}},yU=Je(),_U=Kt(async e=>typeof Blob=="function"&&e instanceof Blob||e.constructor?.name==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await e.arrayBuffer()):lv(e):uv(e),"streamCollector");async function lv(e){let t=await mv(e),r=(0,yU.fromBase64)(t);return new Uint8Array(r)}Kt(lv,"collectBlob");async function uv(e){let t=[],r=e.getReader(),n=!1,s=0;for(;!n;){let{done:a,value:c}=await r.read();c&&(t.push(c),s+=c.length),n=a}let o=new Uint8Array(s),i=0;for(let a of t)o.set(a,i),i+=a.length;return o}Kt(uv,"collectStream");function mv(e){return new Promise((t,r)=>{let n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));let s=n.result??"",o=s.indexOf(","),i=o>-1?o+1:s.length;t(s.substring(i))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(e)})}Kt(mv,"readToBase64")});var Sc=b((Ste,Sv)=>{var vc=Object.defineProperty,vU=Object.getOwnPropertyDescriptor,SU=Object.getOwnPropertyNames,EU=Object.prototype.hasOwnProperty,gv=(e,t)=>vc(e,"name",{value:t,configurable:!0}),CU=(e,t)=>{for(var r in t)vc(e,r,{get:t[r],enumerable:!0})},bU=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of SU(t))!EU.call(e,s)&&s!==r&&vc(e,s,{get:()=>t[s],enumerable:!(n=vU(t,s))||n.enumerable});return e},wU=e=>bU(vc({},"__esModule",{value:!0}),e),hv={};CU(hv,{fromHex:()=>_v,toHex:()=>vv});Sv.exports=wU(hv);var yv={},Sm={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),yv[e]=t,Sm[t]=e}function _v(e){if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2){let n=e.slice(r,r+2).toLowerCase();if(n in Sm)t[r/2]=Sm[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return t}gv(_v,"fromHex");function vv(e){let t="";for(let r=0;r<e.byteLength;r++)t+=yv[e[r]];return t}gv(vv,"toHex")});var wv=b(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.sdkStreamMixin=void 0;var TU=fv(),PU=Je(),xU=Sc(),IU=Re(),Ev=Zr(),Cv="The stream has already been transformed.",AU=e=>{var t,r;if(!bv(e)&&!(0,Ev.isReadableStream)(e)){let i=((r=(t=e?.__proto__)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)||e;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${i}`)}let n=!1,s=async()=>{if(n)throw new Error(Cv);return n=!0,await(0,TU.streamCollector)(e)},o=i=>{if(typeof i.stream!="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
16
- If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return i.stream()};return Object.assign(e,{transformToByteArray:s,transformToString:async i=>{let a=await s();if(i==="base64")return(0,PU.toBase64)(a);if(i==="hex")return(0,xU.toHex)(a);if(i===void 0||i==="utf8"||i==="utf-8")return(0,IU.toUtf8)(a);if(typeof TextDecoder=="function")return new TextDecoder(i).decode(a);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(n)throw new Error(Cv);if(n=!0,bv(e))return o(e);if((0,Ev.isReadableStream)(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})};Ec.sdkStreamMixin=AU;var bv=e=>typeof Blob=="function"&&e instanceof Blob});var Pv=b(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.sdkStreamMixin=void 0;var OU=Wn(),DU=Zs(),Em=require("stream"),RU=wv(),Tv="The stream has already been transformed.",NU=e=>{var t,r;if(!(e instanceof Em.Readable))try{return(0,RU.sdkStreamMixin)(e)}catch{let i=((r=(t=e?.__proto__)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)||e;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${i}`)}let n=!1,s=async()=>{if(n)throw new Error(Tv);return n=!0,await(0,OU.streamCollector)(e)};return Object.assign(e,{transformToByteArray:s,transformToString:async o=>{let i=await s();return o===void 0||Buffer.isEncoding(o)?(0,DU.fromArrayBuffer)(i.buffer,i.byteOffset,i.byteLength).toString(o):new TextDecoder(o).decode(i)},transformToWebStream:()=>{if(n)throw new Error(Tv);if(e.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof Em.Readable.toWeb!="function")throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return n=!0,Em.Readable.toWeb(e)}})};Cc.sdkStreamMixin=NU});var xv=b(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.splitStream=LU;async function LU(e){return typeof e.stream=="function"&&(e=e.stream()),e.tee()}});var Ov=b(bm=>{"use strict";Object.defineProperty(bm,"__esModule",{value:!0});bm.splitStream=MU;var Iv=require("stream"),kU=xv(),Av=Zr();async function MU(e){if((0,Av.isReadableStream)(e)||(0,Av.isBlob)(e))return(0,kU.splitStream)(e);let t=new Iv.PassThrough,r=new Iv.PassThrough;return e.pipe(t),e.pipe(r),[t,r]}});var wc=b((Tte,Yt)=>{var bc=Object.defineProperty,FU=Object.getOwnPropertyDescriptor,jU=Object.getOwnPropertyNames,UU=Object.prototype.hasOwnProperty,Pm=(e,t)=>bc(e,"name",{value:t,configurable:!0}),BU=(e,t)=>{for(var r in t)bc(e,r,{get:t[r],enumerable:!0})},wm=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of jU(t))!UU.call(e,s)&&s!==r&&bc(e,s,{get:()=>t[s],enumerable:!(n=FU(t,s))||n.enumerable});return e},Kr=(e,t,r)=>(wm(e,t,"default"),r&&wm(r,t,"default")),$U=e=>wm(bc({},"__esModule",{value:!0}),e),Jt={};BU(Jt,{Uint8ArrayBlobAdapter:()=>Tm});Yt.exports=$U(Jt);var Dv=Je(),Rv=Re();function Nv(e,t="utf-8"){return t==="base64"?(0,Dv.toBase64)(e):(0,Rv.toUtf8)(e)}Pm(Nv,"transformToString");function Lv(e,t){return t==="base64"?Tm.mutate((0,Dv.fromBase64)(e)):Tm.mutate((0,Rv.fromUtf8)(e))}Pm(Lv,"transformFromString");var Tm=class kv extends Uint8Array{static{Pm(this,"Uint8ArrayBlobAdapter")}static fromString(t,r="utf-8"){switch(typeof t){case"string":return Lv(t,r);default:throw new Error(`Unsupported conversion from ${typeof t} to Uint8ArrayBlobAdapter.`)}}static mutate(t){return Object.setPrototypeOf(t,kv.prototype),t}transformToString(t="utf-8"){return Nv(this,t)}};Kr(Jt,nm(),Yt.exports);Kr(Jt,I_(),Yt.exports);Kr(Jt,L_(),Yt.exports);Kr(Jt,k_(),Yt.exports);Kr(Jt,F_(),Yt.exports);Kr(Jt,Pv(),Yt.exports);Kr(Jt,Ov(),Yt.exports);Kr(Jt,Zr(),Yt.exports)});var Tc,Ut,Pc=C(()=>{Tc=P(wc()),Ut=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return Tc.Uint8ArrayBlobAdapter.mutate(e);if(!e)return Tc.Uint8ArrayBlobAdapter.mutate(new Uint8Array);let r=t.streamCollector(e);return Tc.Uint8ArrayBlobAdapter.mutate(await r)}});function Qt(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}var xc=C(()=>{});var Xt,xm=C(()=>{Xt=e=>typeof e=="function"?e():e});var Mv,Fv,jv,Im,Uv=C(()=>{Mv=P(ge()),Fv=P(mt()),jv=e=>(t,r)=>async n=>{let{response:s}=await t(n),{operationSchema:o}=(0,Fv.getSmithyContext)(r);try{let i=await e.protocol.deserializeResponse(o,{...e,...r},s);return{response:s,output:i}}catch(i){if(Object.defineProperty(i,"$response",{value:s}),!("$metadata"in i)){let a="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{i.message+=`
17
- `+a}catch{!r.logger||r.logger?.constructor?.name==="NoOpLogger"?console.warn(a):r.logger?.warn?.(a)}typeof i.$responseBodyText<"u"&&i.$response&&(i.$response.body=i.$responseBodyText);try{if(Mv.HttpResponse.isInstance(s)){let{headers:c={}}=s,d=Object.entries(c);i.$metadata={httpStatusCode:s.statusCode,requestId:Im(/^x-[\w-]+-request-?id$/,d),extendedRequestId:Im(/^x-[\w-]+-id-2$/,d),cfId:Im(/^x-[\w-]+-cf-id$/,d)}}}catch{}}throw i}},Im=(e,t)=>(t.find(([r])=>r.match(e))||[void 0,void 0])[1]});var Bv,$v,zv=C(()=>{Bv=P(mt()),$v=e=>(t,r)=>async n=>{let{operationSchema:s}=(0,Bv.getSmithyContext)(r),o=r.endpointV2?.url&&e.urlParser?async()=>e.urlParser(r.endpointV2.url):e.endpoint,i=await e.protocol.serializeRequest(s,n.input,{...e,...r,endpoint:o});return t({...n,request:i})}});function zU(e){return{applyToStack:t=>{t.add($v(e),qv),t.add(jv(e),Hv),e.protocol.setSerdeContext(e)}}}var Hv,qv,Gv=C(()=>{Uv();zv();Hv={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},qv={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0}});var ue,Jr=C(()=>{ue=class e{constructor(t,r=new Map){this.namespace=t,this.schemas=r}static for(t){return e.registries.has(t)||e.registries.set(t,new e(t)),e.registries.get(t)}register(t,r){let n=this.normalizeShapeId(t);e.for(this.getNamespace(t)).schemas.set(n,r)}getSchema(t){let r=this.normalizeShapeId(t);if(!this.schemas.has(r))throw new Error(`@smithy/core/schema - schema not found for ${r}`);return this.schemas.get(r)}getBaseException(){for(let[t,r]of this.schemas.entries())if(t.startsWith("smithy.ts.sdk.synthetic.")&&t.endsWith("ServiceException"))return r}find(t){return[...this.schemas.values()].find(t)}destroy(){e.registries.delete(this.namespace),this.schemas.clear()}normalizeShapeId(t){return t.includes("#")?t:this.namespace+"#"+t}getNamespace(t){return this.normalizeShapeId(t).split("#")[0]}};ue.registries=new Map});var pt,Zn=C(()=>{pt=class{constructor(t,r){this.name=t,this.traits=r}}});function HU(e,t,r={},n){let s=new Kn(e+"#"+t,r,typeof n=="function"?n():n);return ue.for(e).register(t,s),s}var Kn,Am=C(()=>{Jr();Zn();Kn=class e extends pt{constructor(t,r,n){super(t,r),this.name=t,this.traits=r,this.valueSchema=n,this.symbol=e.symbol}static[Symbol.hasInstance](t){let r=e.prototype.isPrototypeOf(t);return!r&&typeof t=="object"&&t!==null?t.symbol===e.symbol:r}};Kn.symbol=Symbol.for("@smithy/core/schema::ListSchema")});function qU(e,t,r={},n,s){let o=new Jn(e+"#"+t,r,n,typeof s=="function"?s():s);return ue.for(e).register(t,o),o}var Jn,Om=C(()=>{Jr();Zn();Jn=class e extends pt{constructor(t,r,n,s){super(t,r),this.name=t,this.traits=r,this.keySchema=n,this.valueSchema=s,this.symbol=e.symbol}static[Symbol.hasInstance](t){let r=e.prototype.isPrototypeOf(t);return!r&&typeof t=="object"&&t!==null?t.symbol===e.symbol:r}};Jn.symbol=Symbol.for("@smithy/core/schema::MapSchema")});function GU(e,t,r={},n,s){let o=new Ic(e+"#"+t,r,n,s);return ue.for(e).register(t,o),o}var Ic,Vv=C(()=>{Jr();Zn();Ic=class extends pt{constructor(t,r,n,s){super(t,r),this.name=t,this.traits=r,this.input=n,this.output=s}}});function VU(e,t,r,n,s){let o=new _r(e+"#"+t,r,n,s);return ue.for(e).register(t,o),o}var _r,Ac=C(()=>{Jr();Zn();_r=class e extends pt{constructor(t,r,n,s){super(t,r),this.name=t,this.traits=r,this.memberNames=n,this.memberList=s,this.symbol=e.symbol,this.members={};for(let o=0;o<n.length;++o)this.members[n[o]]=Array.isArray(s[o])?s[o]:[s[o],0]}static[Symbol.hasInstance](t){let r=e.prototype.isPrototypeOf(t);return!r&&typeof t=="object"&&t!==null?t.symbol===e.symbol:r}};_r.symbol=Symbol.for("@smithy/core/schema::StructureSchema")});function WU(e,t,r={},n,s,o){let i=new ri(e+"#"+t,r,n,s,o);return ue.for(e).register(t,i),i}var ri,Wv=C(()=>{Jr();Ac();ri=class e extends _r{constructor(t,r,n,s,o){super(t,r,n,s),this.name=t,this.traits=r,this.memberNames=n,this.memberList=s,this.ctor=o,this.symbol=e.symbol}static[Symbol.hasInstance](t){let r=e.prototype.isPrototypeOf(t);return!r&&typeof t=="object"&&t!==null?t.symbol===e.symbol:r}};ri.symbol=Symbol.for("@smithy/core/schema::ErrorSchema")});var U,Dm=C(()=>{U={BLOB:21,STREAMING_BLOB:42,BOOLEAN:2,STRING:0,NUMERIC:1,BIG_INTEGER:17,BIG_DECIMAL:19,DOCUMENT:15,TIMESTAMP_DEFAULT:4,TIMESTAMP_DATE_TIME:5,TIMESTAMP_HTTP_DATE:6,TIMESTAMP_EPOCH_SECONDS:7,LIST_MODIFIER:64,MAP_MODIFIER:128}});function ZU(e,t,r,n){let s=new Yn(e+"#"+t,r,n);return ue.for(e).register(t,s),s}var Yn,Rm=C(()=>{Jr();Zn();Yn=class e extends pt{constructor(t,r,n){super(t,n),this.name=t,this.schemaRef=r,this.traits=n,this.symbol=e.symbol}static[Symbol.hasInstance](t){let r=e.prototype.isPrototypeOf(t);return!r&&typeof t=="object"&&t!==null?t.symbol===e.symbol:r}};Yn.symbol=Symbol.for("@smithy/core/schema::SimpleSchema")});var G,Zv=C(()=>{xm();Am();Om();Dm();Rm();Ac();G=class e{constructor(t,r){this.ref=t,this.memberName=r,this.symbol=e.symbol;let n=[],s=t,o=t;for(this._isMemberSchema=!1;Array.isArray(s);)n.push(s[1]),s=s[0],o=Xt(s),this._isMemberSchema=!0;if(n.length>0){this.memberTraits={};for(let i=n.length-1;i>=0;--i){let a=n[i];Object.assign(this.memberTraits,e.translateTraits(a))}}else this.memberTraits=0;if(o instanceof e){this.name=o.name,this.traits=o.traits,this._isMemberSchema=o._isMemberSchema,this.schema=o.schema,this.memberTraits=Object.assign({},o.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.ref=o.ref,this.memberName=r??o.memberName;return}if(this.schema=Xt(o),this.schema&&typeof this.schema=="object"?this.traits=this.schema?.traits??{}:this.traits=0,this.name=(typeof this.schema=="object"?this.schema?.name:void 0)??this.memberName??this.getSchemaName(),this._isMemberSchema&&!r)throw new Error(`@smithy/core/schema - NormalizedSchema member schema ${this.getName(!0)} must initialize with memberName argument.`)}static[Symbol.hasInstance](t){let r=e.prototype.isPrototypeOf(t);return!r&&typeof t=="object"&&t!==null?t.symbol===e.symbol:r}static of(t,r){return t instanceof e?t:new e(t,r)}static translateTraits(t){if(typeof t=="object")return t;t=t|0;let r={};return(t&1)===1&&(r.httpLabel=1),(t>>1&1)===1&&(r.idempotent=1),(t>>2&1)===1&&(r.idempotencyToken=1),(t>>3&1)===1&&(r.sensitive=1),(t>>4&1)===1&&(r.httpPayload=1),(t>>5&1)===1&&(r.httpResponseCode=1),(t>>6&1)===1&&(r.httpQueryParams=1),r}static memberFrom(t,r){return t instanceof e?(t.memberName=r,t._isMemberSchema=!0,t):new e(t,r)}getSchema(){return this.schema instanceof e?this.schema=this.schema.getSchema():this.schema instanceof Yn?Xt(this.schema.schemaRef):Xt(this.schema)}getName(t=!1){return!t&&this.name&&this.name.includes("#")?this.name.split("#")[1]:this.name||void 0}getMemberName(){if(!this.isMemberSchema())throw new Error(`@smithy/core/schema - cannot get member name on non-member schema: ${this.getName(!0)}`);return this.memberName}isMemberSchema(){return this._isMemberSchema}isUnitSchema(){return this.getSchema()==="unit"}isListSchema(){let t=this.getSchema();return typeof t=="number"?t>=U.LIST_MODIFIER&&t<U.MAP_MODIFIER:t instanceof Kn}isMapSchema(){let t=this.getSchema();return typeof t=="number"?t>=U.MAP_MODIFIER&&t<=255:t instanceof Jn}isDocumentSchema(){return this.getSchema()===U.DOCUMENT}isStructSchema(){let t=this.getSchema();return t!==null&&typeof t=="object"&&"members"in t||t instanceof _r}isBlobSchema(){return this.getSchema()===U.BLOB||this.getSchema()===U.STREAMING_BLOB}isTimestampSchema(){let t=this.getSchema();return typeof t=="number"&&t>=U.TIMESTAMP_DEFAULT&&t<=U.TIMESTAMP_EPOCH_SECONDS}isStringSchema(){return this.getSchema()===U.STRING}isBooleanSchema(){return this.getSchema()===U.BOOLEAN}isNumericSchema(){return this.getSchema()===U.NUMERIC}isBigIntegerSchema(){return this.getSchema()===U.BIG_INTEGER}isBigDecimalSchema(){return this.getSchema()===U.BIG_DECIMAL}isStreaming(){return this.getMergedTraits().streaming?!0:this.getSchema()===U.STREAMING_BLOB}isIdempotencyToken(){return typeof this.traits=="number"?(this.traits&4)===4:typeof this.traits=="object"?!!this.traits.idempotencyToken:!1}getMergedTraits(){return this.normalizedTraits?this.normalizedTraits:(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()},this.normalizedTraits)}getMemberTraits(){return e.translateTraits(this.memberTraits)}getOwnTraits(){return e.translateTraits(this.traits)}getKeySchema(){if(this.isDocumentSchema())return e.memberFrom([U.DOCUMENT,0],"key");if(!this.isMapSchema())throw new Error(`@smithy/core/schema - cannot get key schema for non-map schema: ${this.getName(!0)}`);let t=this.getSchema();return typeof t=="number"?e.memberFrom([63&t,0],"key"):e.memberFrom([t.keySchema,0],"key")}getValueSchema(){let t=this.getSchema();if(typeof t=="number"){if(this.isMapSchema())return e.memberFrom([63&t,0],"value");if(this.isListSchema())return e.memberFrom([63&t,0],"member")}if(t&&typeof t=="object"){if(this.isStructSchema())throw new Error(`cannot call getValueSchema() with StructureSchema ${this.getName(!0)}`);let r=t;if("valueSchema"in r){if(this.isMapSchema())return e.memberFrom([r.valueSchema,0],"value");if(this.isListSchema())return e.memberFrom([r.valueSchema,0],"member")}}if(this.isDocumentSchema())return e.memberFrom([U.DOCUMENT,0],"value");throw new Error(`@smithy/core/schema - the schema ${this.getName(!0)} does not have a value member.`)}hasMemberSchema(t){if(this.isStructSchema()){let r=this.getSchema();return t in r.members}return!1}getMemberSchema(t){if(this.isStructSchema()){let r=this.getSchema();if(!(t in r.members))throw new Error(`@smithy/core/schema - the schema ${this.getName(!0)} does not have a member with name=${t}.`);return e.memberFrom(r.members[t],t)}if(this.isDocumentSchema())return e.memberFrom([U.DOCUMENT,0],t);throw new Error(`@smithy/core/schema - the schema ${this.getName(!0)} does not have members.`)}getMemberSchemas(){let{schema:t}=this,r=t;if(!r||typeof r!="object")return{};if("members"in r){let n={};for(let s of r.memberNames)n[s]=this.getMemberSchema(s);return n}return{}}getEventStreamMember(){if(this.isStructSchema()){for(let[t,r]of this.structIterator())if(r.isStreaming()&&r.isStructSchema())return t}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot acquire structIterator on non-struct schema.");let t=this.getSchema();for(let r=0;r<t.memberNames.length;++r)yield[t.memberNames[r],e.memberFrom([t.memberList[r],0],t.memberNames[r])]}getSchemaName(){let t=this.getSchema();if(typeof t=="number"){let r=63&t,n=192&t,s=Object.entries(U).find(([,o])=>o===r)?.[0]??"Unknown";switch(n){case U.MAP_MODIFIER:return`${s}Map`;case U.LIST_MODIFIER:return`${s}List`;case 0:return s}}return"Unknown"}};G.symbol=Symbol.for("@smithy/core/schema::NormalizedSchema")});var Kv={};dt(Kv,{ErrorSchema:()=>ri,ListSchema:()=>Kn,MapSchema:()=>Jn,NormalizedSchema:()=>G,OperationSchema:()=>Ic,SCHEMA:()=>U,Schema:()=>pt,SimpleSchema:()=>Yn,StructureSchema:()=>_r,TypeRegistry:()=>ue,deref:()=>Xt,deserializerMiddlewareOption:()=>Hv,error:()=>WU,getSchemaSerdePlugin:()=>zU,list:()=>HU,map:()=>qU,op:()=>GU,serializerMiddlewareOption:()=>qv,sim:()=>ZU,struct:()=>VU});var xe=C(()=>{xm();Gv();Am();Om();Vv();Wv();Zv();Zn();Rm();Ac();Dm();Jr()});var KU,Jv=C(()=>{KU=(e,t,r=n=>n)=>e});var JU,YU,ni,QU,Oc,si,XU,Nm,Lm,km,Mm,eB,tB,Yv,rB,nB,Rc,sB,Fm,oB,Ys,jm,iB,aB,cB,Qv,Xv,dB,lB,Qn,Um,Dc,oi,Bm=C(()=>{JU=e=>{switch(e){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${e}"`)}},YU=e=>{if(e!=null){if(typeof e=="number"){if((e===0||e===1)&&oi.warn(Dc(`Expected boolean, got ${typeof e}: ${e}`)),e===0)return!1;if(e===1)return!0}if(typeof e=="string"){let t=e.toLowerCase();if((t==="false"||t==="true")&&oi.warn(Dc(`Expected boolean, got ${typeof e}: ${e}`)),t==="false")return!1;if(t==="true")return!0}if(typeof e=="boolean")return e;throw new TypeError(`Expected boolean, got ${typeof e}: ${e}`)}},ni=e=>{if(e!=null){if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&oi.warn(Dc(`Expected number but observed string: ${e}`)),t}if(typeof e=="number")return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},QU=Math.ceil(34028234663852886e22),Oc=e=>{let t=ni(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>QU)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},si=e=>{if(e!=null){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}},XU=si,Nm=e=>Mm(e,32),Lm=e=>Mm(e,16),km=e=>Mm(e,8),Mm=(e,t)=>{let r=si(e);if(r!==void 0&&eB(r,t)!==r)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return r},eB=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},tB=(e,t)=>{if(e==null)throw t?new TypeError(`Expected a non-null value for ${t}`):new TypeError("Expected a non-null value");return e},Yv=e=>{if(e==null)return;if(typeof e=="object"&&!Array.isArray(e))return e;let t=Array.isArray(e)?"array":typeof e;throw new TypeError(`Expected object, got ${t}: ${e}`)},rB=e=>{if(e!=null){if(typeof e=="string")return e;if(["boolean","number","bigint"].includes(typeof e))return oi.warn(Dc(`Expected string, got ${typeof e}: ${e}`)),String(e);throw new TypeError(`Expected string, got ${typeof e}: ${e}`)}},nB=e=>{if(e==null)return;let t=Yv(e),r=Object.entries(t).filter(([,n])=>n!=null).map(([n])=>n);if(r.length===0)throw new TypeError("Unions must have exactly one non-null member. None were found.");if(r.length>1)throw new TypeError(`Unions must have exactly one non-null member. Keys ${r} were not null.`);return t},Rc=e=>ni(typeof e=="string"?Ys(e):e),sB=Rc,Fm=e=>Oc(typeof e=="string"?Ys(e):e),oB=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,Ys=e=>{let t=e.match(oB);if(t===null||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},jm=e=>typeof e=="string"?Qv(e):ni(e),iB=jm,aB=jm,cB=e=>typeof e=="string"?Qv(e):Oc(e),Qv=e=>{switch(e){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error(`Unable to parse float value: ${e}`)}},Xv=e=>si(typeof e=="string"?Ys(e):e),dB=Xv,lB=e=>Nm(typeof e=="string"?Ys(e):e),Qn=e=>Lm(typeof e=="string"?Ys(e):e),Um=e=>km(typeof e=="string"?Ys(e):e),Dc=e=>String(new TypeError(e).stack||e).split(`
18
- `).slice(0,5).filter(t=>!t.includes("stackTraceWarning")).join(`
19
- `),oi={warn:console.warn}});function ai(e){let t=e.getUTCFullYear(),r=e.getUTCMonth(),n=e.getUTCDay(),s=e.getUTCDate(),o=e.getUTCHours(),i=e.getUTCMinutes(),a=e.getUTCSeconds(),c=s<10?`0${s}`:`${s}`,d=o<10?`0${o}`:`${o}`,l=i<10?`0${i}`:`${i}`,u=a<10?`0${a}`:`${a}`;return`${uB[n]}, ${c} ${zm[r]} ${t} ${d}:${l}:${u} GMT`}var uB,zm,mB,pB,fB,ci,gB,hB,yB,di,li,ii,_B,vB,SB,$m,EB,CB,bB,er,wB,TB,Qs,eS=C(()=>{Bm();uB=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],zm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];mB=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),pB=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let t=mB.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");let[r,n,s,o,i,a,c,d]=t,l=Qn(Qs(n)),u=er(s,"month",1,12),m=er(o,"day",1,31);return ii(l,u,m,{hours:i,minutes:a,seconds:c,fractionalMilliseconds:d})},fB=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),ci=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let t=fB.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");let[r,n,s,o,i,a,c,d,l]=t,u=Qn(Qs(n)),m=er(s,"month",1,12),p=er(o,"day",1,31),h=ii(u,m,p,{hours:i,minutes:a,seconds:c,fractionalMilliseconds:d});return l.toUpperCase()!="Z"&&h.setTime(h.getTime()-TB(l)),h},gB=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),hB=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),yB=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),di=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=gB.exec(e);if(t){let[r,n,s,o,i,a,c,d]=t;return ii(Qn(Qs(o)),$m(s),er(n,"day",1,31),{hours:i,minutes:a,seconds:c,fractionalMilliseconds:d})}if(t=hB.exec(e),t){let[r,n,s,o,i,a,c,d]=t;return SB(ii(_B(o),$m(s),er(n,"day",1,31),{hours:i,minutes:a,seconds:c,fractionalMilliseconds:d}))}if(t=yB.exec(e),t){let[r,n,s,o,i,a,c,d]=t;return ii(Qn(Qs(d)),$m(n),er(s.trimLeft(),"day",1,31),{hours:o,minutes:i,seconds:a,fractionalMilliseconds:c})}throw new TypeError("Invalid RFC-7231 date-time value")},li=e=>{if(e==null)return;let t;if(typeof e=="number")t=e;else if(typeof e=="string")t=Rc(e);else if(typeof e=="object"&&e.tag===1)t=e.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(t*1e3))},ii=(e,t,r,n)=>{let s=t-1;return CB(e,s,r),new Date(Date.UTC(e,s,r,er(n.hours,"hour",0,23),er(n.minutes,"minute",0,59),er(n.seconds,"seconds",0,60),wB(n.fractionalMilliseconds)))},_B=e=>{let t=new Date().getUTCFullYear(),r=Math.floor(t/100)*100+Qn(Qs(e));return r<t?r+100:r},vB=50*365*24*60*60*1e3,SB=e=>e.getTime()-new Date().getTime()>vB?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,$m=e=>{let t=zm.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},EB=[31,28,31,30,31,30,31,31,30,31,30,31],CB=(e,t,r)=>{let n=EB[t];if(t===1&&bB(e)&&(n=29),r>n)throw new TypeError(`Invalid day for ${zm[t]} in ${e}: ${r}`)},bB=e=>e%4===0&&(e%100!==0||e%400===0),er=(e,t,r,n)=>{let s=Um(Qs(e));if(s<r||s>n)throw new TypeError(`${t} must be between ${r} and ${n}, inclusive`);return s},wB=e=>e==null?0:Fm("0."+e)*1e3,TB=e=>{let t=e[0],r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);let n=Number(e.substring(1,3)),s=Number(e.substring(4,6));return r*(n*60+s)*60*1e3},Qs=e=>{let t=0;for(;t<e.length-1&&e.charAt(t)==="0";)t++;return t===0?e:e.slice(t)}});function ui(){return Nc>Lc.length-16&&(tS.default.randomFillSync(Lc),Nc=0),Lc.slice(Nc,Nc+=16)}var tS,Lc,Nc,Hm=C(()=>{tS=P(require("crypto")),Lc=new Uint8Array(256),Nc=Lc.length});var rS,nS=C(()=>{rS=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function PB(e){return typeof e=="string"&&rS.test(e)}var Yr,mi=C(()=>{nS();Yr=PB});function Xn(e,t=0){return Me[e[t+0]]+Me[e[t+1]]+Me[e[t+2]]+Me[e[t+3]]+"-"+Me[e[t+4]]+Me[e[t+5]]+"-"+Me[e[t+6]]+Me[e[t+7]]+"-"+Me[e[t+8]]+Me[e[t+9]]+"-"+Me[e[t+10]]+Me[e[t+11]]+Me[e[t+12]]+Me[e[t+13]]+Me[e[t+14]]+Me[e[t+15]]}function xB(e,t=0){let r=Xn(e,t);if(!Yr(r))throw TypeError("Stringified UUID is invalid");return r}var Me,sS,pi=C(()=>{mi();Me=[];for(let e=0;e<256;++e)Me.push((e+256).toString(16).slice(1));sS=xB});function IB(e,t,r){let n=t&&r||0,s=t||new Array(16);e=e||{};let o=e.node||oS,i=e.clockseq!==void 0?e.clockseq:qm;if(o==null||i==null){let m=e.random||(e.rng||ui)();o==null&&(o=oS=[m[0]|1,m[1],m[2],m[3],m[4],m[5]]),i==null&&(i=qm=(m[6]<<8|m[7])&16383)}let a=e.msecs!==void 0?e.msecs:Date.now(),c=e.nsecs!==void 0?e.nsecs:Vm+1,d=a-Gm+(c-Vm)/1e4;if(d<0&&e.clockseq===void 0&&(i=i+1&16383),(d<0||a>Gm)&&e.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Gm=a,Vm=c,qm=i,a+=122192928e5;let l=((a&268435455)*1e4+c)%4294967296;s[n++]=l>>>24&255,s[n++]=l>>>16&255,s[n++]=l>>>8&255,s[n++]=l&255;let u=a/4294967296*1e4&268435455;s[n++]=u>>>8&255,s[n++]=u&255,s[n++]=u>>>24&15|16,s[n++]=u>>>16&255,s[n++]=i>>>8|128,s[n++]=i&255;for(let m=0;m<6;++m)s[n+m]=o[m];return t||Xn(s)}var oS,qm,Gm,Vm,iS,aS=C(()=>{Hm();pi();Gm=0,Vm=0;iS=IB});function AB(e){if(!Yr(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}var kc,Wm=C(()=>{mi();kc=AB});function OB(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}function fi(e,t,r){function n(s,o,i,a){var c;if(typeof s=="string"&&(s=OB(s)),typeof o=="string"&&(o=kc(o)),((c=o)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let d=new Uint8Array(16+s.length);if(d.set(o),d.set(s,o.length),d=r(d),d[6]=d[6]&15|t,d[8]=d[8]&63|128,i){a=a||0;for(let l=0;l<16;++l)i[a+l]=d[l];return i}return Xn(d)}try{n.name=e}catch{}return n.DNS=DB,n.URL=RB,n}var DB,RB,Zm=C(()=>{pi();Wm();DB="6ba7b810-9dad-11d1-80b4-00c04fd430c8",RB="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function NB(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),cS.default.createHash("md5").update(e).digest()}var cS,dS,lS=C(()=>{cS=P(require("crypto"));dS=NB});var LB,uS,mS=C(()=>{Zm();lS();LB=fi("v3",48,dS),uS=LB});var pS,Km,fS=C(()=>{pS=P(require("crypto")),Km={randomUUID:pS.default.randomUUID}});function kB(e,t,r){if(Km.randomUUID&&!t&&!e)return Km.randomUUID();e=e||{};let n=e.random||(e.rng||ui)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let s=0;s<16;++s)t[r+s]=n[s];return t}return Xn(n)}var Mc,gS=C(()=>{fS();Hm();pi();Mc=kB});function MB(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),hS.default.createHash("sha1").update(e).digest()}var hS,yS,_S=C(()=>{hS=P(require("crypto"));yS=MB});var FB,vS,SS=C(()=>{Zm();_S();FB=fi("v5",80,yS),vS=FB});var ES,CS=C(()=>{ES="00000000-0000-0000-0000-000000000000"});function jB(e){if(!Yr(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}var bS,wS=C(()=>{mi();bS=jB});var Jm={};dt(Jm,{NIL:()=>ES,parse:()=>kc,stringify:()=>sS,v1:()=>iS,v3:()=>uS,v4:()=>Mc,v5:()=>vS,validate:()=>Yr,version:()=>bS});var Fc=C(()=>{aS();mS();gS();SS();CS();wS();mi();pi();Wm()});var TS=C(()=>{Fc()});var Ye,PS=C(()=>{Ye=function(t){return Object.assign(new String(t),{deserializeJSON(){return JSON.parse(String(t))},toString(){return String(t)},toJSON(){return String(t)}})};Ye.from=e=>e&&typeof e=="object"&&(e instanceof Ye||"deserializeJSON"in e)?e:typeof e=="string"||Object.getPrototypeOf(e)===String.prototype?Ye(String(e)):Ye(JSON.stringify(e));Ye.fromObject=Ye.from});function Ym(e){return(e.includes(",")||e.includes('"'))&&(e=`"${e.replace(/"/g,'\\"')}"`),e}var xS=C(()=>{});function Qm(e,t,r){if(r<=0||!Number.isInteger(r))throw new Error("Invalid number of delimiters ("+r+") for splitEvery.");let n=e.split(t);if(r===1)return n;let s=[],o="";for(let i=0;i<n.length;i++)o===""?o=n[i]:o+=t+n[i],(i+1)%r===0&&(s.push(o),o="");return o!==""&&s.push(o),s}var IS=C(()=>{});var gi,AS=C(()=>{gi=e=>{let t=e.length,r=[],n=!1,s,o=0;for(let i=0;i<t;++i){let a=e[i];switch(a){case'"':s!=="\\"&&(n=!n);break;case",":n||(r.push(e.slice(o,i)),o=i+1);break;default:}s=a}return r.push(e.slice(o)),r.map(i=>{i=i.trim();let a=i.length;return a<2?i:(i[0]==='"'&&i[a-1]==='"'&&(i=i.slice(1,a-1)),i.replace(/\\"/g,'"'))})}});function UB(e){return new Fe(String(e),"bigDecimal")}var Fe,OS=C(()=>{Fe=class e{constructor(t,r){this.string=t,this.type=r;let n=0;for(let s=0;s<t.length;++s){let o=t.charCodeAt(s);if(!(s===0&&o===45)){if(o===46){if(n)throw new Error("@smithy/core/serde - NumericValue must contain at most one decimal point.");n=1;continue}if(o<48||o>57)throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}}}toString(){return this.string}static[Symbol.hasInstance](t){if(!t||typeof t!="object")return!1;let r=t,n=e.prototype.isPrototypeOf(t);return n||(typeof r.string=="string"&&typeof r.type=="string"&&r.constructor?.name?.endsWith("NumericValue")?!0:n)}}});var DS={};dt(DS,{LazyJsonString:()=>Ye,NumericValue:()=>Fe,copyDocumentWithTransform:()=>KU,dateToUtcString:()=>ai,expectBoolean:()=>YU,expectByte:()=>km,expectFloat32:()=>Oc,expectInt:()=>XU,expectInt32:()=>Nm,expectLong:()=>si,expectNonNull:()=>tB,expectNumber:()=>ni,expectObject:()=>Yv,expectShort:()=>Lm,expectString:()=>rB,expectUnion:()=>nB,generateIdempotencyToken:()=>Mc,handleFloat:()=>iB,limitedParseDouble:()=>jm,limitedParseFloat:()=>aB,limitedParseFloat32:()=>cB,logger:()=>oi,nv:()=>UB,parseBoolean:()=>JU,parseEpochTimestamp:()=>li,parseRfc3339DateTime:()=>pB,parseRfc3339DateTimeWithOffset:()=>ci,parseRfc7231DateTime:()=>di,quoteHeader:()=>Ym,splitEvery:()=>Qm,splitHeader:()=>gi,strictParseByte:()=>Um,strictParseDouble:()=>Rc,strictParseFloat:()=>sB,strictParseFloat32:()=>Fm,strictParseInt:()=>dB,strictParseInt32:()=>lB,strictParseLong:()=>Xv,strictParseShort:()=>Qn});var bt=C(()=>{Jv();eS();TS();PS();Bm();xS();IS();AS();OS()});var RS,Xm,NS=C(()=>{xe();RS=P(Re()),Xm=class{constructor({marshaller:t,serializer:r,deserializer:n,serdeContext:s,defaultContentType:o}){this.marshaller=t,this.serializer=r,this.deserializer=n,this.serdeContext=s,this.defaultContentType=o}async serializeEventStream({eventStream:t,requestSchema:r,initialRequest:n}){let s=this.marshaller,o=r.getEventStreamMember(),i=r.getMemberSchema(o),a=i.getMemberSchemas(),c=this.serializer,d=this.defaultContentType,l=Symbol("initialRequestMarker"),u={async*[Symbol.asyncIterator](){if(n){let m={":event-type":{type:"string",value:"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:d}};c.write(r,n);let p=c.flush();yield{[l]:!0,headers:m,body:p}}for await(let m of t)yield m}};return s.serialize(u,m=>{if(m[l])return{headers:m.headers,body:m.body};let p=Object.keys(m).find(B=>B!=="__type")??"",{additionalHeaders:h,body:y,eventType:_,explicitPayloadContentType:w}=this.writeEventBody(p,i,m);return{headers:{":event-type":{type:"string",value:_},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:w??d},...h},body:y}})}async deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:n}){let s=this.marshaller,o=r.getEventStreamMember(),a=r.getMemberSchema(o).getMemberSchemas(),c=Symbol("initialResponseMarker"),d=s.deserialize(t.body,async m=>{let p=Object.keys(m).find(h=>h!=="__type")??"";if(p==="initial-response"){let h=await this.deserializer.read(r,m[p].body);return delete h[o],{[c]:!0,...h}}else if(p in a){let h=a[p];return{[p]:await this.deserializer.read(h,m[p].body)}}else return{$unknown:m}}),l=d[Symbol.asyncIterator](),u=await l.next();if(u.done)return d;if(u.value?.[c]){if(!r)throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(let[m,p]of Object.entries(u.value))n[m]=p}return{async*[Symbol.asyncIterator](){for(u?.value?.[c]||(yield u.value);;){let{done:m,value:p}=await l.next();if(m)break;yield p}}}}writeEventBody(t,r,n){let s=this.serializer,o=t,i=null,a,c=r.hasMemberSchema(t),d={};if(c){let m=r.getMemberSchema(t);if(m.isStructSchema()){for(let[p,h]of m.structIterator()){let{eventHeader:y,eventPayload:_}=h.getMergedTraits();if(_){i=p;break}else if(y){let w=n[t][p],E="binary";h.isNumericSchema()?(-2)**31<=w&&w<=2**31-1?E="integer":E="long":h.isTimestampSchema()?E="timestamp":h.isStringSchema()?E="string":h.isBooleanSchema()&&(E="boolean"),w!=null&&(d[p]={type:E,value:w},delete n[t][p])}}if(i!==null){let p=m.getMemberSchema(i);p.isBlobSchema()?a="application/octet-stream":p.isStringSchema()&&(a="text/plain"),s.write(p,n[t][i])}else s.write(m,n[t])}else throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}else{let[m,p]=n[t];o=m,s.write(U.DOCUMENT,p)}let l=s.flush();return{body:typeof l=="string"?(this.serdeContext?.utf8Decoder??RS.fromUtf8)(l):l,eventType:o,explicitPayloadContentType:a,additionalHeaders:d}}}});var LS={};dt(LS,{EventStreamSerde:()=>Xm});var kS=C(()=>{NS()});var jc,es,Uc=C(()=>{xe();jc=P(ge()),es=class{constructor(t){this.options=t}getRequestType(){return jc.HttpRequest}getResponseType(){return jc.HttpResponse}setSerdeContext(t){this.serdeContext=t,this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(t)}updateServiceEndpoint(t,r){if("url"in r){t.protocol=r.url.protocol,t.hostname=r.url.hostname,t.port=r.url.port?Number(r.url.port):void 0,t.path=r.url.pathname,t.fragment=r.url.hash||void 0,t.username=r.url.username||void 0,t.password=r.url.password||void 0;for(let[n,s]of r.url.searchParams.entries())t.query||(t.query={}),t.query[n]=s;return t}else return t.protocol=r.protocol,t.hostname=r.hostname,t.port=r.port?Number(r.port):void 0,t.path=r.path,t.query={...r.query},t}setHostPrefix(t,r,n){let s=G.of(r),o=G.of(r.input);if(s.getMergedTraits().endpoint){let i=s.getMergedTraits().endpoint?.[0];if(typeof i=="string"){let a=[...o.structIterator()].filter(([,c])=>c.getMergedTraits().hostLabel);for(let[c]of a){let d=n[c];if(typeof d!="string")throw new Error(`@smithy/core/schema - ${c} in input must be a string as hostLabel.`);i=i.replace(`{${c}}`,d)}t.hostname=i+t.hostname}}}deserializeMetadata(t){return{httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:t,requestSchema:r,initialRequest:n}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:t,requestSchema:r,initialRequest:n})}async deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:n}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:n})}async loadEventStreamCapability(){let{EventStreamSerde:t}=await Promise.resolve().then(()=>(kS(),LS));return new t({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(t,r,n,s,o){return[]}getEventStreamMarshaller(){let t=this.serdeContext;if(!t.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return t.eventStreamMarshaller}}});var MS,FS,ts,jS=C(()=>{xe();bt();MS=P(ge()),FS=P(wc());Pc();xc();Uc();ts=class extends es{async serializeRequest(t,r,n){let s={...r??{}},o=this.serializer,i={},a={},c=await n.endpoint(),d=G.of(t?.input),l=d.getSchema(),u=!1,m,p=new MS.HttpRequest({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:i,headers:a,body:void 0});if(c){this.updateServiceEndpoint(p,c),this.setHostPrefix(p,t,s);let h=G.translateTraits(t.traits);if(h.http){p.method=h.http[0];let[y,_]=h.http[1].split("?");p.path=="/"?p.path=y:p.path+=y;let w=new URLSearchParams(_??"");Object.assign(i,Object.fromEntries(w))}}for(let[h,y]of d.structIterator()){let _=y.getMergedTraits()??{},w=s[h];if(w!=null)if(_.httpPayload)y.isStreaming()?y.isStructSchema()?s[h]&&(m=await this.serializeEventStream({eventStream:s[h],requestSchema:d})):m=w:(o.write(y,w),m=o.flush()),delete s[h];else if(_.httpLabel){o.write(y,w);let E=o.flush();p.path.includes(`{${h}+}`)?p.path=p.path.replace(`{${h}+}`,E.split("/").map(Qt).join("/")):p.path.includes(`{${h}}`)&&(p.path=p.path.replace(`{${h}}`,Qt(E))),delete s[h]}else if(_.httpHeader)o.write(y,w),a[_.httpHeader.toLowerCase()]=String(o.flush()),delete s[h];else if(typeof _.httpPrefixHeaders=="string"){for(let[E,B]of Object.entries(w)){let T=_.httpPrefixHeaders+E;o.write([y.getValueSchema(),{httpHeader:T}],B),a[T.toLowerCase()]=o.flush()}delete s[h]}else _.httpQuery||_.httpQueryParams?(this.serializeQuery(y,w,i),delete s[h]):u=!0}return u&&s&&(o.write(l,s),m=o.flush()),p.headers=a,p.query=i,p.body=m,p}serializeQuery(t,r,n){let s=this.serializer,o=t.getMergedTraits();if(o.httpQueryParams){for(let[i,a]of Object.entries(r))i in n||this.serializeQuery(G.of([t.getValueSchema(),{...o,httpQuery:i,httpQueryParams:void 0}]),a,n);return}if(t.isListSchema()){let i=!!t.getMergedTraits().sparse,a=[];for(let c of r){s.write([t.getValueSchema(),o],c);let d=s.flush();(i||d!==void 0)&&a.push(d)}n[o.httpQuery]=a}else s.write([t,o],r),n[o.httpQuery]=s.flush()}async deserializeResponse(t,r,n){let s=this.deserializer,o=G.of(t.output),i={};if(n.statusCode>=300){let c=await Ut(n.body,r);throw c.byteLength>0&&Object.assign(i,await s.read(U.DOCUMENT,c)),await this.handleError(t,r,n,i,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(let c in n.headers){let d=n.headers[c];delete n.headers[c],n.headers[c.toLowerCase()]=d}let a=await this.deserializeHttpMessage(o,r,n,i);if(a.length){let c=await Ut(n.body,r);if(c.byteLength>0){let d=await s.read(o,c);for(let l of a)i[l]=d[l]}}return i.$metadata=this.deserializeMetadata(n),i}async deserializeHttpMessage(t,r,n,s,o){let i;s instanceof Set?i=o:i=s;let a=this.deserializer,c=G.of(t),d=[];for(let[l,u]of c.structIterator()){let m=u.getMemberTraits();if(m.httpPayload){if(u.isStreaming())u.isStructSchema()?i[l]=await this.deserializeEventStream({response:n,responseSchema:c}):i[l]=(0,FS.sdkStreamMixin)(n.body);else if(n.body){let h=await Ut(n.body,r);h.byteLength>0&&(i[l]=await a.read(u,h))}}else if(m.httpHeader){let p=String(m.httpHeader).toLowerCase(),h=n.headers[p];if(h!=null)if(u.isListSchema()){let y=u.getValueSchema(),_;y.isTimestampSchema()&&y.getSchema()===U.TIMESTAMP_DEFAULT?_=Qm(h,",",2):_=gi(h);let w=[];for(let E of _)w.push(await a.read([y,{httpHeader:p}],E.trim()));i[l]=w}else i[l]=await a.read(u,h)}else if(m.httpPrefixHeaders!==void 0){i[l]={};for(let[p,h]of Object.entries(n.headers))p.startsWith(m.httpPrefixHeaders)&&(i[l][p.slice(m.httpPrefixHeaders.length)]=await a.read([u.getValueSchema(),{httpHeader:p}],h))}else m.httpResponseCode?i[l]=n.statusCode:d.push(l)}return d}}});var US,rs,BS=C(()=>{xe();US=P(ge());Pc();Uc();rs=class extends es{async serializeRequest(t,r,n){let s=this.serializer,o={},i={},a=await n.endpoint(),c=G.of(t?.input),d=c.getSchema(),l,u=new US.HttpRequest({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:o,headers:i,body:void 0});a&&(this.updateServiceEndpoint(u,a),this.setHostPrefix(u,t,r));let m={...r};if(r){let p=c.getEventStreamMember();if(p){if(m[p]){let h={};for(let[y,_]of c.structIterator())y!==p&&m[y]&&(s.write(_,m[y]),h[y]=s.flush());l=await this.serializeEventStream({eventStream:m[p],requestSchema:c,initialRequest:h})}}else s.write(d,m),l=s.flush()}return u.headers=i,u.query=o,u.body=l,u.method="POST",u}async deserializeResponse(t,r,n){let s=this.deserializer,o=G.of(t.output),i={};if(n.statusCode>=300){let c=await Ut(n.body,r);throw c.byteLength>0&&Object.assign(i,await s.read(U.DOCUMENT,c)),await this.handleError(t,r,n,i,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(let c in n.headers){let d=n.headers[c];delete n.headers[c],n.headers[c.toLowerCase()]=d}let a=o.getEventStreamMember();if(a)i[a]=await this.deserializeEventStream({response:n,responseSchema:o,initialResponseContainer:i});else{let c=await Ut(n.body,r);c.byteLength>0&&Object.assign(i,await s.read(o,c))}return i.$metadata=this.deserializeMetadata(n),i}}});var ep,tp=C(()=>{xc();ep=(e,t,r,n,s,o)=>{if(t!=null&&t[r]!==void 0){let i=n();if(i.length<=0)throw new Error("Empty value provided for input HTTP label: "+r+".");e=e.replace(s,o?i.split("/").map(a=>Qt(a)).join("/"):Qt(i))}else throw new Error("No value provided for input HTTP label: "+r+".");return e}});function hi(e,t){return new Bc(e,t)}var $S,Bc,zS=C(()=>{$S=P(ge());tp();Bc=class{constructor(t,r){this.input=t,this.context=r,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){let{hostname:t,protocol:r="https",port:n,path:s}=await this.context.endpoint();this.path=s;for(let o of this.resolvePathStack)o(this.path);return new $S.HttpRequest({protocol:r,hostname:this.hostname||t,port:n,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(t){return this.hostname=t,this}bp(t){return this.resolvePathStack.push(r=>{this.path=`${r?.endsWith("/")?r.slice(0,-1):r||""}`+t}),this}p(t,r,n,s){return this.resolvePathStack.push(o=>{this.path=ep(o,this.input,t,r,n,s)}),this}h(t){return this.headers=t,this}q(t){return this.query=t,this}b(t){return this.body=t,this}m(t){return this.method=t,this}}});function ns(e,t){if(t.timestampFormat.useTrait&&e.isTimestampSchema()&&(e.getSchema()===U.TIMESTAMP_DATE_TIME||e.getSchema()===U.TIMESTAMP_HTTP_DATE||e.getSchema()===U.TIMESTAMP_EPOCH_SECONDS))return e.getSchema();let{httpLabel:r,httpPrefixHeaders:n,httpHeader:s,httpQuery:o}=e.getMergedTraits();return(t.httpBindings?typeof n=="string"||s?U.TIMESTAMP_HTTP_DATE:o||r?U.TIMESTAMP_DATE_TIME:void 0:void 0)??t.timestampFormat.default}var $c=C(()=>{xe()});var rp,HS,ss,np=C(()=>{xe();bt();rp=P(Je()),HS=P(Re());$c();ss=class{constructor(t){this.settings=t}setSerdeContext(t){this.serdeContext=t}read(t,r){let n=G.of(t);if(n.isListSchema())return gi(r).map(s=>this.read(n.getValueSchema(),s));if(n.isBlobSchema())return(this.serdeContext?.base64Decoder??rp.fromBase64)(r);if(n.isTimestampSchema())switch(ns(n,this.settings)){case U.TIMESTAMP_DATE_TIME:return ci(r);case U.TIMESTAMP_HTTP_DATE:return di(r);case U.TIMESTAMP_EPOCH_SECONDS:return li(r);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",r),new Date(r)}if(n.isStringSchema()){let s=n.getMergedTraits().mediaType,o=r;if(s)return n.getMergedTraits().httpHeader&&(o=this.base64ToUtf8(o)),(s==="application/json"||s.endsWith("+json"))&&(o=Ye.from(o)),o}switch(!0){case n.isNumericSchema():return Number(r);case n.isBigIntegerSchema():return BigInt(r);case n.isBigDecimalSchema():return new Fe(r,"bigDecimal");case n.isBooleanSchema():return String(r).toLowerCase()==="true"}return r}base64ToUtf8(t){return(this.serdeContext?.utf8Encoder??HS.toUtf8)((this.serdeContext?.base64Decoder??rp.fromBase64)(t))}}});var zc,os,qS=C(()=>{xe();zc=P(Re());np();os=class{constructor(t,r){this.codecDeserializer=t,this.stringDeserializer=new ss(r)}setSerdeContext(t){this.stringDeserializer.setSerdeContext(t),this.codecDeserializer.setSerdeContext(t),this.serdeContext=t}read(t,r){let n=G.of(t),s=n.getMergedTraits(),o=this.serdeContext?.utf8Encoder??zc.toUtf8;if(s.httpHeader||s.httpResponseCode)return this.stringDeserializer.read(n,o(r));if(s.httpPayload){if(n.isBlobSchema()){let i=this.serdeContext?.utf8Decoder??zc.fromUtf8;return typeof r=="string"?i(r):r}else if(n.isStringSchema())return"byteLength"in r?o(r):r}return this.codecDeserializer.read(n,r)}}});var sp,yi,op=C(()=>{xe();bt();sp=P(Je());$c();yi=class{constructor(t){this.settings=t,this.stringBuffer="",this.serdeContext=void 0}setSerdeContext(t){this.serdeContext=t}write(t,r){let n=G.of(t);switch(typeof r){case"object":if(r===null){this.stringBuffer="null";return}if(n.isTimestampSchema()){if(!(r instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${r} when schema expected Date in ${n.getName(!0)}`);switch(ns(n,this.settings)){case U.TIMESTAMP_DATE_TIME:this.stringBuffer=r.toISOString().replace(".000Z","Z");break;case U.TIMESTAMP_HTTP_DATE:this.stringBuffer=ai(r);break;case U.TIMESTAMP_EPOCH_SECONDS:this.stringBuffer=String(r.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",r),this.stringBuffer=String(r.getTime()/1e3)}return}if(n.isBlobSchema()&&"byteLength"in r){this.stringBuffer=(this.serdeContext?.base64Encoder??sp.toBase64)(r);return}if(n.isListSchema()&&Array.isArray(r)){let i="";for(let a of r){this.write([n.getValueSchema(),n.getMergedTraits()],a);let c=this.flush(),d=n.getValueSchema().isTimestampSchema()?c:Ym(c);i!==""&&(i+=", "),i+=d}this.stringBuffer=i;return}this.stringBuffer=JSON.stringify(r,null,2);break;case"string":let s=n.getMergedTraits().mediaType,o=r;if(s&&((s==="application/json"||s.endsWith("+json"))&&(o=Ye.from(o)),n.getMergedTraits().httpHeader)){this.stringBuffer=(this.serdeContext?.base64Encoder??sp.toBase64)(o.toString());return}this.stringBuffer=r;break;default:this.stringBuffer=String(r)}}flush(){let t=this.stringBuffer;return this.stringBuffer="",t}}});var is,GS=C(()=>{xe();op();is=class{constructor(t,r,n=new yi(r)){this.codecSerializer=t,this.stringSerializer=n}setSerdeContext(t){this.codecSerializer.setSerdeContext(t),this.stringSerializer.setSerdeContext(t)}write(t,r){let n=G.of(t),s=n.getMergedTraits();if(s.httpHeader||s.httpLabel||s.httpQuery){this.stringSerializer.write(n,r),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(n,r)}flush(){if(this.buffer!==void 0){let t=this.buffer;return this.buffer=void 0,t}return this.codecSerializer.flush()}}});var VS={};dt(VS,{FromStringShapeDeserializer:()=>ss,HttpBindingProtocol:()=>ts,HttpInterceptingShapeDeserializer:()=>os,HttpInterceptingShapeSerializer:()=>is,HttpProtocol:()=>es,RequestBuilder:()=>Bc,RpcProtocol:()=>rs,ToStringShapeSerializer:()=>yi,collectBody:()=>Ut,determineTimestampFormat:()=>ns,extendedEncodeURIComponent:()=>Qt,requestBuilder:()=>hi,resolvedPath:()=>ep});var vr=C(()=>{Pc();xc();jS();Uc();BS();zS();tp();np();qS();GS();op();$c()});var WS=C(()=>{vr()});function BB(e,t,r){e.__smithy_context?e.__smithy_context.features||(e.__smithy_context.features={}):e.__smithy_context={features:{}},e.__smithy_context.features[t]=r}var ZS=C(()=>{});var as,KS=C(()=>{as=class{constructor(t){this.authSchemes=new Map;for(let[r,n]of Object.entries(t))n!==void 0&&this.authSchemes.set(r,n)}getIdentityProvider(t){return this.authSchemes.get(t)}}});var JS,ip,ap,YS=C(()=>{JS=P(ge()),ip=P(qr()),ap=class{async sign(t,r,n){if(!n)throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!n.name)throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!n.in)throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!r.apiKey)throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");let s=JS.HttpRequest.clone(t);if(n.in===ip.HttpApiKeyAuthLocation.QUERY)s.query[n.name]=r.apiKey;else if(n.in===ip.HttpApiKeyAuthLocation.HEADER)s.headers[n.name]=n.scheme?`${n.scheme} ${r.apiKey}`:r.apiKey;else throw new Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+n.in+"`");return s}}});var QS,cp,XS=C(()=>{QS=P(ge()),cp=class{async sign(t,r,n){let s=QS.HttpRequest.clone(t);if(!r.token)throw new Error("request could not be signed with `token` since the `token` is not defined");return s.headers.Authorization=`Bearer ${r.token}`,s}}});var Sr,eE=C(()=>{Sr=class{async sign(t,r,n){return t}}});var tE=C(()=>{YS();XS();eE()});var rE,$B,dp,Hc,lp,nE=C(()=>{rE=e=>t=>Hc(t)&&t.expiration.getTime()-Date.now()<e,$B=3e5,dp=rE(3e5),Hc=e=>e.expiration!==void 0,lp=(e,t,r)=>{if(e===void 0)return;let n=typeof e!="function"?async()=>Promise.resolve(e):e,s,o,i,a=!1,c=async d=>{o||(o=n(d));try{s=await o,i=!0,a=!1}finally{o=void 0}return s};return t===void 0?async d=>((!i||d?.forceRefresh)&&(s=await c(d)),s):async d=>((!i||d?.forceRefresh)&&(s=await c(d)),a?s:r(s)?(t(s)&&await c(d),s):(a=!0,s))}});var sE=C(()=>{KS();tE();nE()});var Xs={};dt(Xs,{DefaultIdentityProviderConfig:()=>as,EXPIRATION_MS:()=>$B,HttpApiKeyAuthSigner:()=>ap,HttpBearerAuthSigner:()=>cp,NoAuthSigner:()=>Sr,createIsIdentityExpiredFunction:()=>rE,createPaginator:()=>u_,doesIdentityRequireRefresh:()=>Hc,getHttpAuthSchemeEndpointRuleSetPlugin:()=>Xo,getHttpAuthSchemePlugin:()=>y1,getHttpSigningPlugin:()=>ei,getSmithyContext:()=>i1,httpAuthSchemeEndpointRuleSetMiddlewareOptions:()=>Vy,httpAuthSchemeMiddleware:()=>Qo,httpAuthSchemeMiddlewareOptions:()=>r_,httpSigningMiddleware:()=>Ku,httpSigningMiddlewareOptions:()=>a_,isIdentityExpired:()=>dp,memoizeIdentityProvider:()=>lp,normalizeProvider:()=>Wr,requestBuilder:()=>hi,setFeature:()=>BB});var st=C(()=>{$y();s_();d_();l_();m_();WS();ZS();sE()});var ds=b(cs=>{"use strict";var mp=qr(),pp=class{capacity;data=new Map;parameters=[];constructor({size:t,params:r}){this.capacity=t??50,r&&(this.parameters=r)}get(t,r){let n=this.hash(t);if(n===!1)return r();if(!this.data.has(n)){if(this.data.size>this.capacity+10){let s=this.data.keys(),o=0;for(;;){let{value:i,done:a}=s.next();if(this.data.delete(i),a||++o>10)break}}this.data.set(n,r())}return this.data.get(n)}size(){return this.data.size}hash(t){let r="",{parameters:n}=this;if(n.length===0)return!1;for(let s of n){let o=String(t[s]??"");if(o.includes("|;"))return!1;r+=o+"|;"}return r}},zB=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),oE=e=>zB.test(e)||e.startsWith("[")&&e.endsWith("]"),HB=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),gp=(e,t=!1)=>{if(!t)return HB.test(e);let r=e.split(".");for(let n of r)if(!gp(n))return!1;return!0},fp={},_i="endpoints";function Qr(e){return typeof e!="object"||e==null?e:"ref"in e?`$${Qr(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(Qr).join(", ")})`:JSON.stringify(e,null,2)}var Ve=class extends Error{constructor(t){super(t),this.name="EndpointError"}},qB=(e,t)=>e===t,GB=e=>{let t=e.split("."),r=[];for(let n of t){let s=n.indexOf("[");if(s!==-1){if(n.indexOf("]")!==n.length-1)throw new Ve(`Path: '${e}' does not end with ']'`);let o=n.slice(s+1,-1);if(Number.isNaN(parseInt(o)))throw new Ve(`Invalid array index: '${o}' in path: '${e}'`);s!==0&&r.push(n.slice(0,s)),r.push(o)}else r.push(n)}return r},iE=(e,t)=>GB(t).reduce((r,n)=>{if(typeof r!="object")throw new Ve(`Index '${n}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(r)?r[parseInt(n)]:r[n]},e),VB=e=>e!=null,WB=e=>!e,up={[mp.EndpointURLScheme.HTTP]:80,[mp.EndpointURLScheme.HTTPS]:443},ZB=e=>{let t=(()=>{try{if(e instanceof URL)return e;if(typeof e=="object"&&"hostname"in e){let{hostname:m,port:p,protocol:h="",path:y="",query:_={}}=e,w=new URL(`${h}//${m}${p?`:${p}`:""}${y}`);return w.search=Object.entries(_).map(([E,B])=>`${E}=${B}`).join("&"),w}return new URL(e)}catch{return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;let r=t.href,{host:n,hostname:s,pathname:o,protocol:i,search:a}=t;if(a)return null;let c=i.slice(0,-1);if(!Object.values(mp.EndpointURLScheme).includes(c))return null;let d=oE(s),l=r.includes(`${n}:${up[c]}`)||typeof e=="string"&&e.includes(`${n}:${up[c]}`),u=`${n}${l?`:${up[c]}`:""}`;return{scheme:c,authority:u,path:o,normalizedPath:o.endsWith("/")?o:`${o}/`,isIp:d}},KB=(e,t)=>e===t,JB=(e,t,r,n)=>t>=r||e.length<r?null:n?e.substring(e.length-r,e.length-t):e.substring(t,r),YB=e=>encodeURIComponent(e).replace(/[!*'()]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),QB={booleanEquals:qB,getAttr:iE,isSet:VB,isValidHostLabel:gp,not:WB,parseURL:ZB,stringEquals:KB,substring:JB,uriEncode:YB},aE=(e,t)=>{let r=[],n={...t.endpointParams,...t.referenceRecord},s=0;for(;s<e.length;){let o=e.indexOf("{",s);if(o===-1){r.push(e.slice(s));break}r.push(e.slice(s,o));let i=e.indexOf("}",o);if(i===-1){r.push(e.slice(o));break}e[o+1]==="{"&&e[i+1]==="}"&&(r.push(e.slice(o+1,i)),s=i+2);let a=e.substring(o+1,i);if(a.includes("#")){let[c,d]=a.split("#");r.push(iE(n[c],d))}else r.push(n[a]);s=i+1}return r.join("")},XB=({ref:e},t)=>({...t.endpointParams,...t.referenceRecord})[e],qc=(e,t,r)=>{if(typeof e=="string")return aE(e,r);if(e.fn)return dE.callFunction(e,r);if(e.ref)return XB(e,r);throw new Ve(`'${t}': ${String(e)} is not a string, function or reference.`)},cE=({fn:e,argv:t},r)=>{let n=t.map(o=>["boolean","number"].includes(typeof o)?o:dE.evaluateExpression(o,"arg",r)),s=e.split(".");return s[0]in fp&&s[1]!=null?fp[s[0]][s[1]](...n):QB[e](...n)},dE={evaluateExpression:qc,callFunction:cE},e$=({assign:e,...t},r)=>{if(e&&e in r.referenceRecord)throw new Ve(`'${e}' is already defined in Reference Record.`);let n=cE(t,r);return r.logger?.debug?.(`${_i} evaluateCondition: ${Qr(t)} = ${Qr(n)}`),{result:n===""?!0:!!n,...e!=null&&{toAssign:{name:e,value:n}}}},hp=(e=[],t)=>{let r={};for(let n of e){let{result:s,toAssign:o}=e$(n,{...t,referenceRecord:{...t.referenceRecord,...r}});if(!s)return{result:s};o&&(r[o.name]=o.value,t.logger?.debug?.(`${_i} assign: ${o.name} := ${Qr(o.value)}`))}return{result:!0,referenceRecord:r}},t$=(e,t)=>Object.entries(e).reduce((r,[n,s])=>({...r,[n]:s.map(o=>{let i=qc(o,"Header value entry",t);if(typeof i!="string")throw new Ve(`Header '${n}' value '${i}' is not a string`);return i})}),{}),lE=(e,t)=>Object.entries(e).reduce((r,[n,s])=>({...r,[n]:mE.getEndpointProperty(s,t)}),{}),uE=(e,t)=>{if(Array.isArray(e))return e.map(r=>uE(r,t));switch(typeof e){case"string":return aE(e,t);case"object":if(e===null)throw new Ve(`Unexpected endpoint property: ${e}`);return mE.getEndpointProperties(e,t);case"boolean":return e;default:throw new Ve(`Unexpected endpoint property type: ${typeof e}`)}},mE={getEndpointProperty:uE,getEndpointProperties:lE},r$=(e,t)=>{let r=qc(e,"Endpoint URL",t);if(typeof r=="string")try{return new URL(r)}catch(n){throw console.error(`Failed to construct URL with ${r}`,n),n}throw new Ve(`Endpoint URL must be a string, got ${typeof r}`)},n$=(e,t)=>{let{conditions:r,endpoint:n}=e,{result:s,referenceRecord:o}=hp(r,t);if(!s)return;let i={...t,referenceRecord:{...t.referenceRecord,...o}},{url:a,properties:c,headers:d}=n;return t.logger?.debug?.(`${_i} Resolving endpoint from template: ${Qr(n)}`),{...d!=null&&{headers:t$(d,i)},...c!=null&&{properties:lE(c,i)},url:r$(a,i)}},s$=(e,t)=>{let{conditions:r,error:n}=e,{result:s,referenceRecord:o}=hp(r,t);if(s)throw new Ve(qc(n,"Error",{...t,referenceRecord:{...t.referenceRecord,...o}}))},pE=(e,t)=>{for(let r of e)if(r.type==="endpoint"){let n=n$(r,t);if(n)return n}else if(r.type==="error")s$(r,t);else if(r.type==="tree"){let n=fE.evaluateTreeRule(r,t);if(n)return n}else throw new Ve(`Unknown endpoint rule: ${r}`);throw new Ve("Rules evaluation failed")},o$=(e,t)=>{let{conditions:r,rules:n}=e,{result:s,referenceRecord:o}=hp(r,t);if(s)return fE.evaluateRules(n,{...t,referenceRecord:{...t.referenceRecord,...o}})},fE={evaluateRules:pE,evaluateTreeRule:o$},i$=(e,t)=>{let{endpointParams:r,logger:n}=t,{parameters:s,rules:o}=e;t.logger?.debug?.(`${_i} Initial EndpointParams: ${Qr(r)}`);let i=Object.entries(s).filter(([,d])=>d.default!=null).map(([d,l])=>[d,l.default]);if(i.length>0)for(let[d,l]of i)r[d]=r[d]??l;let a=Object.entries(s).filter(([,d])=>d.required).map(([d])=>d);for(let d of a)if(r[d]==null)throw new Ve(`Missing required parameter: '${d}'`);let c=pE(o,{endpointParams:r,logger:n,referenceRecord:{}});return t.logger?.debug?.(`${_i} Resolved endpoint: ${Qr(c)}`),c};cs.EndpointCache=pp;cs.EndpointError=Ve;cs.customEndpointFunctions=fp;cs.isIpAddress=oE;cs.isValidHostLabel=gp;cs.resolveEndpoint=i$});var to=b((Hse,wE)=>{"use strict";var Gc=Object.defineProperty,a$=Object.getOwnPropertyDescriptor,c$=Object.getOwnPropertyNames,d$=Object.prototype.hasOwnProperty,eo=(e,t)=>Gc(e,"name",{value:t,configurable:!0}),l$=(e,t)=>{for(var r in t)Gc(e,r,{get:t[r],enumerable:!0})},u$=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of c$(t))!d$.call(e,s)&&s!==r&&Gc(e,s,{get:()=>t[s],enumerable:!(n=a$(t,s))||n.enumerable});return e},m$=e=>u$(Gc({},"__esModule",{value:!0}),e),hE={};l$(hE,{ConditionObject:()=>_e.ConditionObject,DeprecatedObject:()=>_e.DeprecatedObject,EndpointError:()=>_e.EndpointError,EndpointObject:()=>_e.EndpointObject,EndpointObjectHeaders:()=>_e.EndpointObjectHeaders,EndpointObjectProperties:()=>_e.EndpointObjectProperties,EndpointParams:()=>_e.EndpointParams,EndpointResolverOptions:()=>_e.EndpointResolverOptions,EndpointRuleObject:()=>_e.EndpointRuleObject,ErrorRuleObject:()=>_e.ErrorRuleObject,EvaluateOptions:()=>_e.EvaluateOptions,Expression:()=>_e.Expression,FunctionArgv:()=>_e.FunctionArgv,FunctionObject:()=>_e.FunctionObject,FunctionReturn:()=>_e.FunctionReturn,ParameterObject:()=>_e.ParameterObject,ReferenceObject:()=>_e.ReferenceObject,ReferenceRecord:()=>_e.ReferenceRecord,RuleSetObject:()=>_e.RuleSetObject,RuleSetRules:()=>_e.RuleSetRules,TreeRuleObject:()=>_e.TreeRuleObject,awsEndpointFunctions:()=>bE,getUserAgentPrefix:()=>h$,isIpAddress:()=>_e.isIpAddress,partition:()=>EE,resolveEndpoint:()=>_e.resolveEndpoint,setPartitionInfo:()=>CE,useDefaultPartitionInfo:()=>g$});wE.exports=m$(hE);var _e=ds(),yE=eo((e,t=!1)=>{if(t){for(let r of e.split("."))if(!yE(r))return!1;return!0}return!(!(0,_e.isValidHostLabel)(e)||e.length<3||e.length>63||e!==e.toLowerCase()||(0,_e.isIpAddress)(e))},"isVirtualHostableS3Bucket"),gE=":",p$="/",f$=eo(e=>{let t=e.split(gE);if(t.length<6)return null;let[r,n,s,o,i,...a]=t;if(r!=="arn"||n===""||s===""||a.join(gE)==="")return null;let c=a.map(d=>d.split(p$)).flat();return{partition:n,service:s,region:o,accountId:i,resourceId:c}},"parseArn"),_E={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"AWS Standard global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"AWS China global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"AWS GovCloud (US) global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"c2s.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"AWS ISO (US) global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"sc2s.sgov.gov",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"AWS ISOB (US) global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"cloud.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"AWS ISOE (Europe) global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"csp.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"AWS ISOF global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"amazonaws.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"EU (Germany)"}}}],version:"1.1"},vE=_E,SE="",EE=eo(e=>{let{partitions:t}=vE;for(let n of t){let{regions:s,outputs:o}=n;for(let[i,a]of Object.entries(s))if(i===e)return{...o,...a}}for(let n of t){let{regionRegex:s,outputs:o}=n;if(new RegExp(s).test(e))return{...o}}let r=t.find(n=>n.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}},"partition"),CE=eo((e,t="")=>{vE=e,SE=t},"setPartitionInfo"),g$=eo(()=>{CE(_E,"")},"useDefaultPartitionInfo"),h$=eo(()=>SE,"getUserAgentPrefix"),bE={isVirtualHostableS3Bucket:yE,parseArn:f$,partition:EE};_e.customEndpointFunctions.aws=bE});var Vc,ro,TE=C(()=>{Vc={warningEmitted:!1},ro=e=>{e&&!Vc.warningEmitted&&parseInt(e.substring(1,e.indexOf(".")))<18&&(Vc.warningEmitted=!0,process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
20
- no longer support Node.js 16.x on January 6, 2025.
21
-
22
- To continue receiving updates to AWS services, bug fixes, and security
23
- updates please upgrade to a supported Node.js LTS version.
24
-
25
- More information can be found at: https://a.co/74kJMmI`))}});function Xr(e,t,r){return e.$source||(e.$source={}),e.$source[t]=r,e}var PE=C(()=>{});function xE(e,t,r){e.__aws_sdk_context?e.__aws_sdk_context.features||(e.__aws_sdk_context.features={}):e.__aws_sdk_context={features:{}},e.__aws_sdk_context.features[t]=r}var IE=C(()=>{});function AE(e,t,r){return e.$source||(e.$source={}),e.$source[t]=r,e}var OE=C(()=>{});var en={};dt(en,{emitWarningIfUnsupportedVersion:()=>ro,setCredentialFeature:()=>Xr,setFeature:()=>xE,setTokenFeature:()=>AE,state:()=>Vc});var Bt=C(()=>{TE();PE();IE();OE()});var DE,yp,RE=C(()=>{DE=P(ge()),yp=e=>DE.HttpResponse.isInstance(e)?e.headers?.date??e.headers?.Date:void 0});var no,_p=C(()=>{no=e=>new Date(Date.now()+e)});var NE,LE=C(()=>{_p();NE=(e,t)=>Math.abs(no(t).getTime()-e)>=3e5});var vp,kE=C(()=>{LE();vp=(e,t)=>{let r=Date.parse(e);return NE(r,t)?r-Date.now():t}});var Sp=C(()=>{RE();_p();kE()});var ME,vi,so,ot,Ep,Cp=C(()=>{ME=P(ge());Sp();vi=(e,t)=>{if(!t)throw new Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return t},so=async e=>{let t=vi("context",e.context),r=vi("config",e.config),n=t.endpointV2?.properties?.authSchemes?.[0],o=await vi("signer",r.signer)(n),i=e?.signingRegion,a=e?.signingRegionSet,c=e?.signingName;return{config:r,signer:o,signingRegion:i,signingRegionSet:a,signingName:c}},ot=class{async sign(t,r,n){if(!ME.HttpRequest.isInstance(t))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");let s=await so(n),{config:o,signer:i}=s,{signingRegion:a,signingName:c}=s,d=n.context;if(d?.authSchemes?.length??!1){let[u,m]=d.authSchemes;u?.name==="sigv4a"&&m?.name==="sigv4"&&(a=m?.signingRegion??a,c=m?.signingName??c)}return await i.sign(t,{signingDate:no(o.systemClockOffset),signingRegion:a,signingService:c})}errorHandler(t){return r=>{let n=r.ServerTime??yp(r.$response);if(n){let s=vi("config",t.config),o=s.systemClockOffset;s.systemClockOffset=vp(n,s.systemClockOffset),s.systemClockOffset!==o&&r.$metadata&&(r.$metadata.clockSkewCorrected=!0)}throw r}}successHandler(t,r){let n=yp(t);if(n){let s=vi("config",r.config);s.systemClockOffset=vp(n,s.systemClockOffset)}}},Ep=ot});var FE,Si,jE=C(()=>{FE=P(ge());Sp();Cp();Si=class extends ot{async sign(t,r,n){if(!FE.HttpRequest.isInstance(t))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");let{config:s,signer:o,signingRegion:i,signingRegionSet:a,signingName:c}=await so(n),l=(await s.sigv4aSigningRegionSet?.()??a??[i]).join(",");return await o.sign(t,{signingDate:no(s.systemClockOffset),signingRegion:l,signingService:c})}}});var bp,UE=C(()=>{bp=e=>typeof e=="string"&&e.length>0?e.split(",").map(t=>t.trim()):[]});var Wc,wp=C(()=>{Wc=e=>`AWS_BEARER_TOKEN_${e.replace(/[\s-]/g,"_").toUpperCase()}`});var BE,$E,oo,zE=C(()=>{UE();wp();BE="AWS_AUTH_SCHEME_PREFERENCE",$E="auth_scheme_preference",oo={environmentVariableSelector:(e,t)=>{if(t?.signingName&&Wc(t.signingName)in e)return["httpBearerAuth"];if(BE in e)return bp(e[BE])},configFileSelector:e=>{if($E in e)return bp(e[$E])},default:[]}});var Qe=b(ls=>{"use strict";var io=class e extends Error{name="ProviderError";tryNextLink;constructor(t,r=!0){let n,s=!0;typeof r=="boolean"?(n=void 0,s=r):r!=null&&typeof r=="object"&&(n=r.logger,s=r.tryNextLink??!0),super(t),this.tryNextLink=s,Object.setPrototypeOf(this,e.prototype),n?.debug?.(`@smithy/property-provider ${s?"->":"(!)"} ${t}`)}static from(t,r=!0){return Object.assign(new this(t.message,r),t)}},Tp=class e extends io{name="CredentialsProviderError";constructor(t,r=!0){super(t,r),Object.setPrototypeOf(this,e.prototype)}},Pp=class e extends io{name="TokenProviderError";constructor(t,r=!0){super(t,r),Object.setPrototypeOf(this,e.prototype)}},y$=(...e)=>async()=>{if(e.length===0)throw new io("No providers in chain");let t;for(let r of e)try{return await r()}catch(n){if(t=n,n?.tryNextLink)continue;throw n}throw t},_$=e=>()=>Promise.resolve(e),v$=(e,t,r)=>{let n,s,o,i=!1,a=async()=>{s||(s=e());try{n=await s,o=!0,i=!1}finally{s=void 0}return n};return t===void 0?async c=>((!o||c?.forceRefresh)&&(n=await a()),n):async c=>((!o||c?.forceRefresh)&&(n=await a()),i?n:r&&!r(n)?(i=!0,n):(t(n)&&await a(),n))};ls.CredentialsProviderError=Tp;ls.ProviderError=io;ls.TokenProviderError=Pp;ls.chain=y$;ls.fromStatic=_$;ls.memoize=v$});var xp,HE,qE,GE=C(()=>{st();xp=P(Qe()),HE=e=>(e.sigv4aSigningRegionSet=Wr(e.sigv4aSigningRegionSet),e),qE={environmentVariableSelector(e){if(e.AWS_SIGV4A_SIGNING_REGION_SET)return e.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map(t=>t.trim());throw new xp.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.",{tryNextLink:!0})},configFileSelector(e){if(e.sigv4a_signing_region_set)return(e.sigv4a_signing_region_set??"").split(",").map(t=>t.trim());throw new xp.ProviderError("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0}});var SC=b((Eoe,vC)=>{var ed=Object.defineProperty,S$=Object.getOwnPropertyDescriptor,E$=Object.getOwnPropertyNames,C$=Object.prototype.hasOwnProperty,je=(e,t)=>ed(e,"name",{value:t,configurable:!0}),b$=(e,t)=>{for(var r in t)ed(e,r,{get:t[r],enumerable:!0})},w$=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of E$(t))!C$.call(e,s)&&s!==r&&ed(e,s,{get:()=>t[s],enumerable:!(n=S$(t,s))||n.enumerable});return e},T$=e=>w$(ed({},"__esModule",{value:!0}),e),JE={};b$(JE,{ALGORITHM_IDENTIFIER:()=>Zc,ALGORITHM_IDENTIFIER_V4A:()=>A$,ALGORITHM_QUERY_PARAM:()=>YE,ALWAYS_UNSIGNABLE_HEADERS:()=>oC,AMZ_DATE_HEADER:()=>kp,AMZ_DATE_QUERY_PARAM:()=>Dp,AUTH_HEADER:()=>Lp,CREDENTIAL_QUERY_PARAM:()=>QE,DATE_HEADER:()=>tC,EVENT_ALGORITHM_IDENTIFIER:()=>cC,EXPIRES_QUERY_PARAM:()=>eC,GENERATED_HEADERS:()=>rC,HOST_HEADER:()=>x$,KEY_TYPE_IDENTIFIER:()=>Mp,MAX_CACHE_SIZE:()=>lC,MAX_PRESIGNED_TTL:()=>uC,PROXY_HEADER_PATTERN:()=>iC,REGION_SET_PARAM:()=>P$,SEC_HEADER_PATTERN:()=>aC,SHA256_HEADER:()=>Xc,SIGNATURE_HEADER:()=>nC,SIGNATURE_QUERY_PARAM:()=>Rp,SIGNED_HEADERS_QUERY_PARAM:()=>XE,SignatureV4:()=>B$,SignatureV4Base:()=>_C,TOKEN_HEADER:()=>sC,TOKEN_QUERY_PARAM:()=>Np,UNSIGNABLE_PATTERNS:()=>I$,UNSIGNED_PAYLOAD:()=>dC,clearCredentialCache:()=>D$,createScope:()=>Jc,getCanonicalHeaders:()=>Ip,getCanonicalQuery:()=>yC,getPayloadHash:()=>Yc,getSigningKey:()=>mC,hasHeader:()=>fC,moveHeadersToQuery:()=>hC,prepareRequest:()=>Op,signatureV4aContainer:()=>$$});vC.exports=T$(JE);var VE=Re(),YE="X-Amz-Algorithm",QE="X-Amz-Credential",Dp="X-Amz-Date",XE="X-Amz-SignedHeaders",eC="X-Amz-Expires",Rp="X-Amz-Signature",Np="X-Amz-Security-Token",P$="X-Amz-Region-Set",Lp="authorization",kp=Dp.toLowerCase(),tC="date",rC=[Lp,kp,tC],nC=Rp.toLowerCase(),Xc="x-amz-content-sha256",sC=Np.toLowerCase(),x$="host",oC={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},iC=/^proxy-/,aC=/^sec-/,I$=[/^proxy-/i,/^sec-/i],Zc="AWS4-HMAC-SHA256",A$="AWS4-ECDSA-P256-SHA256",cC="AWS4-HMAC-SHA256-PAYLOAD",dC="UNSIGNED-PAYLOAD",lC=50,Mp="aws4_request",uC=60*60*24*7,tn=Sc(),O$=Re(),ao={},Kc=[],Jc=je((e,t,r)=>`${e}/${t}/${r}/${Mp}`,"createScope"),mC=je(async(e,t,r,n,s)=>{let o=await WE(e,t.secretAccessKey,t.accessKeyId),i=`${r}:${n}:${s}:${(0,tn.toHex)(o)}:${t.sessionToken}`;if(i in ao)return ao[i];for(Kc.push(i);Kc.length>lC;)delete ao[Kc.shift()];let a=`AWS4${t.secretAccessKey}`;for(let c of[r,n,s,Mp])a=await WE(e,a,c);return ao[i]=a},"getSigningKey"),D$=je(()=>{Kc.length=0,Object.keys(ao).forEach(e=>{delete ao[e]})},"clearCredentialCache"),WE=je((e,t,r)=>{let n=new e(t);return n.update((0,O$.toUint8Array)(r)),n.digest()},"hmac"),Ip=je(({headers:e},t,r)=>{let n={};for(let s of Object.keys(e).sort()){if(e[s]==null)continue;let o=s.toLowerCase();(o in oC||t?.has(o)||iC.test(o)||aC.test(o))&&(!r||r&&!r.has(o))||(n[o]=e[s].trim().replace(/\s+/g," "))}return n},"getCanonicalHeaders"),R$=Yu(),N$=Re(),Yc=je(async({headers:e,body:t},r)=>{for(let n of Object.keys(e))if(n.toLowerCase()===Xc)return e[n];if(t==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof t=="string"||ArrayBuffer.isView(t)||(0,R$.isArrayBuffer)(t)){let n=new r;return n.update((0,N$.toUint8Array)(t)),(0,tn.toHex)(await n.digest())}return dC},"getPayloadHash"),ZE=Re(),L$=class{static{je(this,"HeaderFormatter")}format(e){let t=[];for(let s of Object.keys(e)){let o=(0,ZE.fromUtf8)(s);t.push(Uint8Array.from([o.byteLength]),o,this.formatHeaderValue(e[s]))}let r=new Uint8Array(t.reduce((s,o)=>s+o.byteLength,0)),n=0;for(let s of t)r.set(s,n),n+=s.byteLength;return r}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":let t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":let r=new DataView(new ArrayBuffer(5));return r.setUint8(0,4),r.setInt32(1,e.value,!1),new Uint8Array(r.buffer);case"long":let n=new Uint8Array(9);return n[0]=5,n.set(e.value.bytes,1),n;case"binary":let s=new DataView(new ArrayBuffer(3+e.value.byteLength));s.setUint8(0,6),s.setUint16(1,e.value.byteLength,!1);let o=new Uint8Array(s.buffer);return o.set(e.value,3),o;case"string":let i=(0,ZE.fromUtf8)(e.value),a=new DataView(new ArrayBuffer(3+i.byteLength));a.setUint8(0,7),a.setUint16(1,i.byteLength,!1);let c=new Uint8Array(a.buffer);return c.set(i,3),c;case"timestamp":let d=new Uint8Array(9);return d[0]=8,d.set(M$.fromNumber(e.value.valueOf()).bytes,1),d;case"uuid":if(!k$.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);let l=new Uint8Array(17);return l[0]=9,l.set((0,tn.fromHex)(e.value.replace(/\-/g,"")),1),l}}},k$=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,M$=class pC{constructor(t){if(this.bytes=t,t.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static{je(this,"Int64")}static fromNumber(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);let r=new Uint8Array(8);for(let n=7,s=Math.abs(Math.round(t));n>-1&&s>0;n--,s/=256)r[n]=s;return t<0&&Ap(r),new pC(r)}valueOf(){let t=this.bytes.slice(0),r=t[0]&128;return r&&Ap(t),parseInt((0,tn.toHex)(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}};function Ap(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}je(Ap,"negate");var fC=je((e,t)=>{e=e.toLowerCase();for(let r of Object.keys(t))if(e===r.toLowerCase())return!0;return!1},"hasHeader"),gC=ge(),hC=je((e,t={})=>{let{headers:r,query:n={}}=gC.HttpRequest.clone(e);for(let s of Object.keys(r)){let o=s.toLowerCase();(o.slice(0,6)==="x-amz-"&&!t.unhoistableHeaders?.has(o)||t.hoistableHeaders?.has(o))&&(n[s]=r[s],delete r[s])}return{...e,headers:r,query:n}},"moveHeadersToQuery"),Op=je(e=>{e=gC.HttpRequest.clone(e);for(let t of Object.keys(e.headers))rC.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},"prepareRequest"),KE=mt(),F$=Re(),Qc=mm(),yC=je(({query:e={}})=>{let t=[],r={};for(let n of Object.keys(e)){if(n.toLowerCase()===nC)continue;let s=(0,Qc.escapeUri)(n);t.push(s);let o=e[n];typeof o=="string"?r[s]=`${s}=${(0,Qc.escapeUri)(o)}`:Array.isArray(o)&&(r[s]=o.slice(0).reduce((i,a)=>i.concat([`${s}=${(0,Qc.escapeUri)(a)}`]),[]).sort().join("&"))}return t.sort().map(n=>r[n]).filter(n=>n).join("&")},"getCanonicalQuery"),j$=je(e=>U$(e).toISOString().replace(/\.\d{3}Z$/,"Z"),"iso8601"),U$=je(e=>typeof e=="number"?new Date(e*1e3):typeof e=="string"?Number(e)?new Date(Number(e)*1e3):new Date(e):e,"toDate"),_C=class{static{je(this,"SignatureV4Base")}constructor({applyChecksum:e,credentials:t,region:r,service:n,sha256:s,uriEscapePath:o=!0}){this.service=n,this.sha256=s,this.uriEscapePath=o,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=(0,KE.normalizeProvider)(r),this.credentialProvider=(0,KE.normalizeProvider)(t)}createCanonicalRequest(e,t,r){let n=Object.keys(t).sort();return`${e.method}
26
- ${this.getCanonicalPath(e)}
27
- ${yC(e)}
28
- ${n.map(s=>`${s}:${t[s]}`).join(`
29
- `)}
30
-
31
- ${n.join(";")}
32
- ${r}`}async createStringToSign(e,t,r,n){let s=new this.sha256;s.update((0,F$.toUint8Array)(r));let o=await s.digest();return`${n}
33
- ${e}
34
- ${t}
35
- ${(0,tn.toHex)(o)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){let t=[];for(let s of e.split("/"))s?.length!==0&&s!=="."&&(s===".."?t.pop():t.push(s));let r=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return(0,Qc.escapeUri)(r).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(e){let t=j$(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}},B$=class extends _C{constructor({applyChecksum:e,credentials:t,region:r,service:n,sha256:s,uriEscapePath:o=!0}){super({applyChecksum:e,credentials:t,region:r,service:n,sha256:s,uriEscapePath:o}),this.headerFormatter=new L$}static{je(this,"SignatureV4")}async presign(e,t={}){let{signingDate:r=new Date,expiresIn:n=3600,unsignableHeaders:s,unhoistableHeaders:o,signableHeaders:i,hoistableHeaders:a,signingRegion:c,signingService:d}=t,l=await this.credentialProvider();this.validateResolvedCredentials(l);let u=c??await this.regionProvider(),{longDate:m,shortDate:p}=this.formatDate(r);if(n>uC)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");let h=Jc(p,u,d??this.service),y=hC(Op(e),{unhoistableHeaders:o,hoistableHeaders:a});l.sessionToken&&(y.query[Np]=l.sessionToken),y.query[YE]=Zc,y.query[QE]=`${l.accessKeyId}/${h}`,y.query[Dp]=m,y.query[eC]=n.toString(10);let _=Ip(y,s,i);return y.query[XE]=this.getCanonicalHeaderList(_),y.query[Rp]=await this.getSignature(m,h,this.getSigningKey(l,u,p,d),this.createCanonicalRequest(y,_,await Yc(e,this.sha256))),y}async sign(e,t){return typeof e=="string"?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:r=new Date,priorSignature:n,signingRegion:s,signingService:o}){let i=s??await this.regionProvider(),{shortDate:a,longDate:c}=this.formatDate(r),d=Jc(a,i,o??this.service),l=await Yc({headers:{},body:t},this.sha256),u=new this.sha256;u.update(e);let m=(0,tn.toHex)(await u.digest()),p=[cC,c,d,n,m,l].join(`
36
- `);return this.signString(p,{signingDate:r,signingRegion:i,signingService:o})}async signMessage(e,{signingDate:t=new Date,signingRegion:r,signingService:n}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:r,signingService:n,priorSignature:e.priorSignature}).then(o=>({message:e.message,signature:o}))}async signString(e,{signingDate:t=new Date,signingRegion:r,signingService:n}={}){let s=await this.credentialProvider();this.validateResolvedCredentials(s);let o=r??await this.regionProvider(),{shortDate:i}=this.formatDate(t),a=new this.sha256(await this.getSigningKey(s,o,i,n));return a.update((0,VE.toUint8Array)(e)),(0,tn.toHex)(await a.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:r,unsignableHeaders:n,signingRegion:s,signingService:o}={}){let i=await this.credentialProvider();this.validateResolvedCredentials(i);let a=s??await this.regionProvider(),c=Op(e),{longDate:d,shortDate:l}=this.formatDate(t),u=Jc(l,a,o??this.service);c.headers[kp]=d,i.sessionToken&&(c.headers[sC]=i.sessionToken);let m=await Yc(c,this.sha256);!fC(Xc,c.headers)&&this.applyChecksum&&(c.headers[Xc]=m);let p=Ip(c,n,r),h=await this.getSignature(d,u,this.getSigningKey(i,a,l,o),this.createCanonicalRequest(c,p,m));return c.headers[Lp]=`${Zc} Credential=${i.accessKeyId}/${u}, SignedHeaders=${this.getCanonicalHeaderList(p)}, Signature=${h}`,c}async getSignature(e,t,r,n){let s=await this.createStringToSign(e,t,n,Zc),o=new this.sha256(await r);return o.update((0,VE.toUint8Array)(s)),(0,tn.toHex)(await o.digest())}getSigningKey(e,t,r,n){return mC(this.sha256,e,r,t,n||this.service)}},$$={SignatureV4a:null}});function z$(e,{credentials:t,credentialDefaultProvider:r}){let n;return t?t?.memoized?n=t:n=lp(t,dp,Hc):r?n=Wr(r(Object.assign({},e,{parentClientConfig:e}))):n=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},n.memoized=!0,n}function H$(e,t){if(t.configBound)return t;let r=async n=>t({...n,callerClientConfig:e});return r.memoized=t.memoized,r.configBound=!0,r}var Fp,us,EC,CC=C(()=>{Bt();st();Fp=P(SC()),us=e=>{let t=e.credentials,r=!!e.credentials,n;Object.defineProperty(e,"credentials",{set(d){d&&d!==t&&d!==n&&(r=!0),t=d;let l=z$(e,{credentials:t,credentialDefaultProvider:e.credentialDefaultProvider}),u=H$(e,l);r&&!u.attributed?(n=async m=>u(m).then(p=>Xr(p,"CREDENTIALS_CODE","e")),n.memoized=u.memoized,n.configBound=u.configBound,n.attributed=!0):n=u},get(){return n},enumerable:!0,configurable:!0}),e.credentials=t;let{signingEscapePath:s=!0,systemClockOffset:o=e.systemClockOffset||0,sha256:i}=e,a;return e.signer?a=Wr(e.signer):e.regionInfoProvider?a=()=>Wr(e.region)().then(async d=>[await e.regionInfoProvider(d,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},d]).then(([d,l])=>{let{signingRegion:u,signingService:m}=d;e.signingRegion=e.signingRegion||u||l,e.signingName=e.signingName||m||e.serviceId;let p={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:i,uriEscapePath:s},h=e.signerConstructor||Fp.SignatureV4;return new h(p)}):a=async d=>{d=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await Wr(e.region)(),properties:{}},d);let l=d.signingRegion,u=d.signingName;e.signingRegion=e.signingRegion||l,e.signingName=e.signingName||u||e.serviceId;let m={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:i,uriEscapePath:s},p=e.signerConstructor||Fp.SignatureV4;return new p(m)},Object.assign(e,{systemClockOffset:o,signingEscapePath:s,signer:a})},EC=us});var bC=C(()=>{Cp();jE();zE();GE();CC()});var wC={};dt(wC,{AWSSDKSigV4Signer:()=>Ep,AwsSdkSigV4ASigner:()=>Si,AwsSdkSigV4Signer:()=>ot,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:()=>oo,NODE_SIGV4A_CONFIG_OPTIONS:()=>qE,getBearerTokenEnvKey:()=>Wc,resolveAWSSDKSigV4Config:()=>EC,resolveAwsSdkSigV4AConfig:()=>HE,resolveAwsSdkSigV4Config:()=>us,validateSigningProperties:()=>so});var jp=C(()=>{bC();wp()});var q$,G$,V$,TC=C(()=>{q$=e=>{if(e==null)return e;if(typeof e=="number"||typeof e=="bigint"){let t=new Error(`Received number ${e} where a string was expected.`);return t.name="Warning",console.warn(t),String(e)}if(typeof e=="boolean"){let t=new Error(`Received boolean ${e} where a string was expected.`);return t.name="Warning",console.warn(t),String(e)}return e},G$=e=>{if(e==null)return e;if(typeof e=="string"){let t=e.toLowerCase();if(e!==""&&t!=="false"&&t!=="true"){let r=new Error(`Received string "${e}" where a boolean was expected.`);r.name="Warning",console.warn(r)}return e!==""&&t!=="false"}return e},V$=e=>{if(e==null)return e;if(typeof e=="string"){let t=Number(e);if(t.toString()!==e){let r=new Error(`Received string "${e}" where a number was expected.`);return r.name="Warning",console.warn(r),e}return t}return e}});var Ei=b((Foe,IC)=>{var td=Object.defineProperty,W$=Object.getOwnPropertyDescriptor,Z$=Object.getOwnPropertyNames,K$=Object.prototype.hasOwnProperty,J$=(e,t)=>td(e,"name",{value:t,configurable:!0}),Y$=(e,t)=>{for(var r in t)td(e,r,{get:t[r],enumerable:!0})},Q$=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Z$(t))!K$.call(e,s)&&s!==r&&td(e,s,{get:()=>t[s],enumerable:!(n=W$(t,s))||n.enumerable});return e},X$=e=>Q$(td({},"__esModule",{value:!0}),e),xC={};Y$(xC,{calculateBodyLength:()=>e2});IC.exports=X$(xC);var PC=typeof TextEncoder=="function"?new TextEncoder:null,e2=J$(e=>{if(typeof e=="string"){if(PC)return PC.encode(e).byteLength;let t=e.length;for(let r=t-1;r>=0;r--){let n=e.charCodeAt(r);n>127&&n<=2047?t++:n>2047&&n<=65535&&(t+=2),n>=56320&&n<=57343&&r--}return t}else{if(typeof e.byteLength=="number")return e.byteLength;if(typeof e.size=="number")return e.size}throw new Error(`Body Length computation failed for ${e}`)},"calculateBodyLength")});var We,rn=C(()=>{We=class{serdeContext;setSerdeContext(t){this.serdeContext=t}}});function AC(e,t,r){if(r?.source){let n=r.source;if(typeof t=="number"&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||n!==String(t)))return n.includes(".")?new Fe(n,"bigDecimal"):BigInt(n)}return t}var OC=C(()=>{bt()});var kC=b(($oe,LC)=>{var rd=Object.defineProperty,t2=Object.getOwnPropertyDescriptor,r2=Object.getOwnPropertyNames,n2=Object.prototype.hasOwnProperty,wt=(e,t)=>rd(e,"name",{value:t,configurable:!0}),s2=(e,t)=>{for(var r in t)rd(e,r,{get:t[r],enumerable:!0})},o2=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of r2(t))!n2.call(e,s)&&s!==r&&rd(e,s,{get:()=>t[s],enumerable:!(n=t2(t,s))||n.enumerable});return e},i2=e=>o2(rd({},"__esModule",{value:!0}),e),NC={};s2(NC,{constructStack:()=>Up});LC.exports=i2(NC);var ms=wt((e,t)=>{let r=[];if(e&&r.push(e),t)for(let n of t)r.push(n);return r},"getAllAliases"),nn=wt((e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,"getMiddlewareNameWithAliases"),Up=wt(()=>{let e=[],t=[],r=!1,n=new Set,s=wt(u=>u.sort((m,p)=>DC[p.step]-DC[m.step]||RC[p.priority||"normal"]-RC[m.priority||"normal"]),"sort"),o=wt(u=>{let m=!1,p=wt(h=>{let y=ms(h.name,h.aliases);if(y.includes(u)){m=!0;for(let _ of y)n.delete(_);return!1}return!0},"filterCb");return e=e.filter(p),t=t.filter(p),m},"removeByName"),i=wt(u=>{let m=!1,p=wt(h=>{if(h.middleware===u){m=!0;for(let y of ms(h.name,h.aliases))n.delete(y);return!1}return!0},"filterCb");return e=e.filter(p),t=t.filter(p),m},"removeByReference"),a=wt(u=>(e.forEach(m=>{u.add(m.middleware,{...m})}),t.forEach(m=>{u.addRelativeTo(m.middleware,{...m})}),u.identifyOnResolve?.(l.identifyOnResolve()),u),"cloneTo"),c=wt(u=>{let m=[];return u.before.forEach(p=>{p.before.length===0&&p.after.length===0?m.push(p):m.push(...c(p))}),m.push(u),u.after.reverse().forEach(p=>{p.before.length===0&&p.after.length===0?m.push(p):m.push(...c(p))}),m},"expandRelativeMiddlewareList"),d=wt((u=!1)=>{let m=[],p=[],h={};return e.forEach(_=>{let w={..._,before:[],after:[]};for(let E of ms(w.name,w.aliases))h[E]=w;m.push(w)}),t.forEach(_=>{let w={..._,before:[],after:[]};for(let E of ms(w.name,w.aliases))h[E]=w;p.push(w)}),p.forEach(_=>{if(_.toMiddleware){let w=h[_.toMiddleware];if(w===void 0){if(u)return;throw new Error(`${_.toMiddleware} is not found when adding ${nn(_.name,_.aliases)} middleware ${_.relation} ${_.toMiddleware}`)}_.relation==="after"&&w.after.push(_),_.relation==="before"&&w.before.push(_)}}),s(m).map(c).reduce((_,w)=>(_.push(...w),_),[])},"getMiddlewareList"),l={add:(u,m={})=>{let{name:p,override:h,aliases:y}=m,_={step:"initialize",priority:"normal",middleware:u,...m},w=ms(p,y);if(w.length>0){if(w.some(E=>n.has(E))){if(!h)throw new Error(`Duplicate middleware name '${nn(p,y)}'`);for(let E of w){let B=e.findIndex(A=>A.name===E||A.aliases?.some(H=>H===E));if(B===-1)continue;let T=e[B];if(T.step!==_.step||_.priority!==T.priority)throw new Error(`"${nn(T.name,T.aliases)}" middleware with ${T.priority} priority in ${T.step} step cannot be overridden by "${nn(p,y)}" middleware with ${_.priority} priority in ${_.step} step.`);e.splice(B,1)}}for(let E of w)n.add(E)}e.push(_)},addRelativeTo:(u,m)=>{let{name:p,override:h,aliases:y}=m,_={middleware:u,...m},w=ms(p,y);if(w.length>0){if(w.some(E=>n.has(E))){if(!h)throw new Error(`Duplicate middleware name '${nn(p,y)}'`);for(let E of w){let B=t.findIndex(A=>A.name===E||A.aliases?.some(H=>H===E));if(B===-1)continue;let T=t[B];if(T.toMiddleware!==_.toMiddleware||T.relation!==_.relation)throw new Error(`"${nn(T.name,T.aliases)}" middleware ${T.relation} "${T.toMiddleware}" middleware cannot be overridden by "${nn(p,y)}" middleware ${_.relation} "${_.toMiddleware}" middleware.`);t.splice(B,1)}}for(let E of w)n.add(E)}t.push(_)},clone:()=>a(Up()),use:u=>{u.applyToStack(l)},remove:u=>typeof u=="string"?o(u):i(u),removeByTag:u=>{let m=!1,p=wt(h=>{let{tags:y,name:_,aliases:w}=h;if(y&&y.includes(u)){let E=ms(_,w);for(let B of E)n.delete(B);return m=!0,!1}return!0},"filterCb");return e=e.filter(p),t=t.filter(p),m},concat:u=>{let m=a(Up());return m.use(u),m.identifyOnResolve(r||m.identifyOnResolve()||(u.identifyOnResolve?.()??!1)),m},applyToStack:a,identify:()=>d(!0).map(u=>{let m=u.step??u.relation+" "+u.toMiddleware;return nn(u.name,u.aliases)+" - "+m}),identifyOnResolve(u){return typeof u=="boolean"&&(r=u),r},resolve:(u,m)=>{for(let p of d().map(h=>h.middleware).reverse())u=p(u,m);return r&&console.log(l.identify()),u}};return l},"constructStack"),DC={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},RC={high:3,normal:2,low:1}});var ee=b((zoe,Wp)=>{var sd=Object.defineProperty,a2=Object.getOwnPropertyDescriptor,c2=Object.getOwnPropertyNames,d2=Object.prototype.hasOwnProperty,se=(e,t)=>sd(e,"name",{value:t,configurable:!0}),l2=(e,t)=>{for(var r in t)sd(e,r,{get:t[r],enumerable:!0})},zp=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of c2(t))!d2.call(e,s)&&s!==r&&sd(e,s,{get:()=>t[s],enumerable:!(n=a2(t,s))||n.enumerable});return e},u2=(e,t,r)=>(zp(e,t,"default"),r&&zp(r,t,"default")),m2=e=>zp(sd({},"__esModule",{value:!0}),e),Gp={};l2(Gp,{Client:()=>p2,Command:()=>jC,NoOpLogger:()=>D2,SENSITIVE_STRING:()=>h2,ServiceException:()=>_2,_json:()=>qp,collectBody:()=>Bp.collectBody,convertMap:()=>R2,createAggregatedClient:()=>y2,decorateServiceException:()=>UC,emitWarningIfUnsupportedVersion:()=>C2,extendedEncodeURIComponent:()=>Bp.extendedEncodeURIComponent,getArrayIfSingleItem:()=>A2,getDefaultClientConfiguration:()=>x2,getDefaultExtensionConfiguration:()=>$C,getValueFromTextNode:()=>zC,isSerializableHeaderValue:()=>O2,loadConfigsForDefaultMode:()=>E2,map:()=>Vp,resolveDefaultRuntimeConfig:()=>I2,resolvedPath:()=>Bp.resolvedPath,serializeDateTime:()=>j2,serializeFloat:()=>F2,take:()=>N2,throwDefaultError:()=>BC,withBaseException:()=>v2});Wp.exports=m2(Gp);var FC=kC(),p2=class{constructor(e){this.config=e,this.middlewareStack=(0,FC.constructStack)()}static{se(this,"Client")}send(e,t,r){let n=typeof t!="function"?t:void 0,s=typeof t=="function"?t:r,o=n===void 0&&this.config.cacheMiddleware===!0,i;if(o){this.handlers||(this.handlers=new WeakMap);let a=this.handlers;a.has(e.constructor)?i=a.get(e.constructor):(i=e.resolveMiddleware(this.middlewareStack,this.config,n),a.set(e.constructor,i))}else delete this.handlers,i=e.resolveMiddleware(this.middlewareStack,this.config,n);if(s)i(e).then(a=>s(null,a.output),a=>s(a)).catch(()=>{});else return i(e).then(a=>a.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}},Bp=(vr(),re(VS)),Hp=qr(),f2=(xe(),re(Kv)),$p="***SensitiveInformation***";function nd(e,t){if(t==null)return t;let r=f2.NormalizedSchema.of(e);if(r.getMergedTraits().sensitive)return $p;if(r.isListSchema()){if(!!r.getValueSchema().getMergedTraits().sensitive)return $p}else if(r.isMapSchema()){if(!!r.getKeySchema().getMergedTraits().sensitive||!!r.getValueSchema().getMergedTraits().sensitive)return $p}else if(r.isStructSchema()&&typeof t=="object"){let n=t,s={};for(let[o,i]of r.structIterator())n[o]!=null&&(s[o]=nd(i,n[o]));return s}return t}se(nd,"schemaLogFilter");var jC=class{constructor(){this.middlewareStack=(0,FC.constructStack)()}static{se(this,"Command")}static classBuilder(){return new g2}resolveMiddlewareWithContext(e,t,r,{middlewareFn:n,clientName:s,commandName:o,inputFilterSensitiveLog:i,outputFilterSensitiveLog:a,smithyContext:c,additionalContext:d,CommandCtor:l}){for(let y of n.bind(this)(l,e,t,r))this.middlewareStack.use(y);let u=e.concat(this.middlewareStack),{logger:m}=t,p={logger:m,clientName:s,commandName:o,inputFilterSensitiveLog:i,outputFilterSensitiveLog:a,[Hp.SMITHY_CONTEXT_KEY]:{commandInstance:this,...c},...d},{requestHandler:h}=t;return u.resolve(y=>h.handle(y.request,r||{}),p)}},g2=class{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=void 0,this._outputFilterSensitiveLog=void 0,this._serializer=null,this._deserializer=null}static{se(this,"ClassBuilder")}init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,r={}){return this._smithyContext={service:e,operation:t,...r},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=r=>r,t=r=>r){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){let e=this,t;return t=class extends jC{constructor(...[r]){super(),this.serialize=e._serializer,this.deserialize=e._deserializer,this.input=r??{},e._init(this),this.schema=e._operationSchema}static{se(this,"CommandRef")}static getEndpointParameterInstructions(){return e._ep}resolveMiddleware(r,n,s){return this.resolveMiddlewareWithContext(r,n,s,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(e._operationSchema?nd.bind(null,e._operationSchema.input):o=>o),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(e._operationSchema?nd.bind(null,e._operationSchema.output):o=>o),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}}}},h2="***SensitiveInformation***",y2=se((e,t)=>{for(let r of Object.keys(e)){let n=e[r],s=se(async function(i,a,c){let d=new n(i);if(typeof a=="function")this.send(d,a);else if(typeof c=="function"){if(typeof a!="object")throw new Error(`Expected http options but got ${typeof a}`);this.send(d,a||{},c)}else return this.send(d,a)},"methodImpl"),o=(r[0].toLowerCase()+r.slice(1)).replace(/Command$/,"");t.prototype[o]=s}},"createAggregatedClient"),_2=class Ci extends Error{static{se(this,"ServiceException")}constructor(t){super(t.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}static isInstance(t){if(!t)return!1;let r=t;return Ci.prototype.isPrototypeOf(r)||!!r.$fault&&!!r.$metadata&&(r.$fault==="client"||r.$fault==="server")}static[Symbol.hasInstance](t){if(!t)return!1;let r=t;return this===Ci?Ci.isInstance(t):Ci.isInstance(t)?r.name&&this.name?this.prototype.isPrototypeOf(t)||r.name===this.name:this.prototype.isPrototypeOf(t):!1}},UC=se((e,t={})=>{Object.entries(t).filter(([,n])=>n!==void 0).forEach(([n,s])=>{(e[n]==null||e[n]==="")&&(e[n]=s)});let r=e.message||e.Message||"UnknownError";return e.message=r,delete e.Message,e},"decorateServiceException"),BC=se(({output:e,parsedBody:t,exceptionCtor:r,errorCode:n})=>{let s=S2(e),o=s.httpStatusCode?s.httpStatusCode+"":void 0,i=new r({name:t?.code||t?.Code||n||o||"UnknownError",$fault:"client",$metadata:s});throw UC(i,t)},"throwDefaultError"),v2=se(e=>({output:t,parsedBody:r,errorCode:n})=>{BC({output:t,parsedBody:r,exceptionCtor:e,errorCode:n})},"withBaseException"),S2=se(e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),"deserializeMetadata"),E2=se(e=>{switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},"loadConfigsForDefaultMode"),MC=!1,C2=se(e=>{e&&!MC&&parseInt(e.substring(1,e.indexOf(".")))<16&&(MC=!0)},"emitWarningIfUnsupportedVersion"),b2=se(e=>{let t=[];for(let r in Hp.AlgorithmId){let n=Hp.AlgorithmId[r];e[n]!==void 0&&t.push({algorithmId:()=>n,checksumConstructor:()=>e[n]})}return{addChecksumAlgorithm(r){t.push(r)},checksumAlgorithms(){return t}}},"getChecksumConfiguration"),w2=se(e=>{let t={};return e.checksumAlgorithms().forEach(r=>{t[r.algorithmId()]=r.checksumConstructor()}),t},"resolveChecksumRuntimeConfig"),T2=se(e=>({setRetryStrategy(t){e.retryStrategy=t},retryStrategy(){return e.retryStrategy}}),"getRetryConfiguration"),P2=se(e=>{let t={};return t.retryStrategy=e.retryStrategy(),t},"resolveRetryRuntimeConfig"),$C=se(e=>Object.assign(b2(e),T2(e)),"getDefaultExtensionConfiguration"),x2=$C,I2=se(e=>Object.assign(w2(e),P2(e)),"resolveDefaultRuntimeConfig"),A2=se(e=>Array.isArray(e)?e:[e],"getArrayIfSingleItem"),zC=se(e=>{let t="#text";for(let r in e)e.hasOwnProperty(r)&&e[r][t]!==void 0?e[r]=e[r][t]:typeof e[r]=="object"&&e[r]!==null&&(e[r]=zC(e[r]));return e},"getValueFromTextNode"),O2=se(e=>e!=null,"isSerializableHeaderValue"),D2=class{static{se(this,"NoOpLogger")}trace(){}debug(){}info(){}warn(){}error(){}};function Vp(e,t,r){let n,s,o;if(typeof t>"u"&&typeof r>"u")n={},o=e;else{if(n=e,typeof t=="function")return s=t,o=r,L2(n,s,o);o=t}for(let i of Object.keys(o)){if(!Array.isArray(o[i])){n[i]=o[i];continue}HC(n,null,o,i)}return n}se(Vp,"map");var R2=se(e=>{let t={};for(let[r,n]of Object.entries(e||{}))t[r]=[,n];return t},"convertMap"),N2=se((e,t)=>{let r={};for(let n in t)HC(r,e,t,n);return r},"take"),L2=se((e,t,r)=>Vp(e,Object.entries(r).reduce((n,[s,o])=>(Array.isArray(o)?n[s]=o:typeof o=="function"?n[s]=[t,o()]:n[s]=[t,o],n),{})),"mapWithFilter"),HC=se((e,t,r,n)=>{if(t!==null){let i=r[n];typeof i=="function"&&(i=[,i]);let[a=k2,c=M2,d=n]=i;(typeof a=="function"&&a(t[d])||typeof a!="function"&&a)&&(e[n]=c(t[d]));return}let[s,o]=r[n];if(typeof o=="function"){let i,a=s===void 0&&(i=o())!=null,c=typeof s=="function"&&!!s(void 0)||typeof s!="function"&&!!s;a?e[n]=i:c&&(e[n]=o())}else{let i=s===void 0&&o!=null,a=typeof s=="function"&&!!s(o)||typeof s!="function"&&!!s;(i||a)&&(e[n]=o)}},"applyInstruction"),k2=se(e=>e!=null,"nonNullish"),M2=se(e=>e,"pass"),F2=se(e=>{if(e!==e)return"NaN";switch(e){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return e}},"serializeFloat"),j2=se(e=>e.toISOString().replace(".000Z","Z"),"serializeDateTime"),qp=se(e=>{if(e==null)return{};if(Array.isArray(e))return e.filter(t=>t!=null).map(qp);if(typeof e=="object"){let t={};for(let r of Object.keys(e))e[r]!=null&&(t[r]=qp(e[r]));return t}return e},"_json");u2(Gp,(bt(),re(DS)),Wp.exports)});var qC,od,Zp=C(()=>{qC=P(ee()),od=(e,t)=>(0,qC.collectBody)(e,t).then(r=>t.utf8Encoder(r))});var co,Kp,ps,bi=C(()=>{Zp();co=(e,t)=>od(e,t).then(r=>{if(r.length)try{return JSON.parse(r)}catch(n){throw n?.name==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:r}),n}return{}}),Kp=async(e,t)=>{let r=await co(e,t);return r.message=r.message??r.Message,r},ps=(e,t)=>{let r=(o,i)=>Object.keys(o).find(a=>a.toLowerCase()===i.toLowerCase()),n=o=>{let i=o;return typeof i=="number"&&(i=i.toString()),i.indexOf(",")>=0&&(i=i.split(",")[0]),i.indexOf(":")>=0&&(i=i.split(":")[0]),i.indexOf("#")>=0&&(i=i.split("#")[1]),i},s=r(e.headers,"x-amzn-errortype");if(s!==void 0)return n(e.headers[s]);if(t&&typeof t=="object"){let o=r(t,"code");if(o&&t[o]!==void 0)return n(t[o]);if(t.__type!==void 0)return n(t.__type)}}});var GC,wi,Jp=C(()=>{xe();bt();GC=P(Je());rn();OC();bi();wi=class extends We{settings;constructor(t){super(),this.settings=t}async read(t,r){return this._read(t,typeof r=="string"?JSON.parse(r,AC):await co(r,this.serdeContext))}readObject(t,r){return this._read(t,r)}_read(t,r){let n=r!==null&&typeof r=="object",s=G.of(t);if(s.isListSchema()&&Array.isArray(r)){let i=s.getValueSchema(),a=[],c=!!s.getMergedTraits().sparse;for(let d of r)(c||d!=null)&&a.push(this._read(i,d));return a}else if(s.isMapSchema()&&n){let i=s.getValueSchema(),a={},c=!!s.getMergedTraits().sparse;for(let[d,l]of Object.entries(r))(c||l!=null)&&(a[d]=this._read(i,l));return a}else if(s.isStructSchema()&&n){let i={};for(let[a,c]of s.structIterator()){let d=this.settings.jsonName?c.getMergedTraits().jsonName??a:a,l=this._read(c,r[d]);l!=null&&(i[a]=l)}return i}if(s.isBlobSchema()&&typeof r=="string")return(0,GC.fromBase64)(r);let o=s.getMergedTraits().mediaType;if(s.isStringSchema()&&typeof r=="string"&&o&&(o==="application/json"||o.endsWith("+json")))return Ye.from(r);if(s.isTimestampSchema()){let i=this.settings.timestampFormat;switch(i.useTrait?s.getSchema()===U.TIMESTAMP_DEFAULT?i.default:s.getSchema()??i.default:i.default){case U.TIMESTAMP_DATE_TIME:return ci(r);case U.TIMESTAMP_HTTP_DATE:return di(r);case U.TIMESTAMP_EPOCH_SECONDS:return li(r);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",r),new Date(r)}}if(s.isBigIntegerSchema()&&(typeof r=="number"||typeof r=="string"))return BigInt(r);if(s.isBigDecimalSchema()&&r!=null)return r instanceof Fe?r:new Fe(String(r),"bigDecimal");if(s.isNumericSchema()&&typeof r=="string")switch(r){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return r}}});var VC,id,WC=C(()=>{bt();VC="\u039D",id=class{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(t,r)=>{if(r instanceof Fe){let n=`${VC+ +"nv"+this.counter++}_`+r.string;return this.values.set(`"${n}"`,r.string),n}if(typeof r=="bigint"){let n=r.toString(),s=`${VC+"b"+this.counter++}_`+n;return this.values.set(`"${s}"`,n),s}return r}}replaceInJson(t){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return t;for(let[r,n]of this.values)t=t.replace(r,n);return t}}});var Ti,Yp=C(()=>{xe();bt();bt();rn();WC();Ti=class extends We{settings;buffer;rootSchema;constructor(t){super(),this.settings=t}write(t,r){this.rootSchema=G.of(t),this.buffer=this._write(this.rootSchema,r)}flush(){if(this.rootSchema?.isStructSchema()||this.rootSchema?.isDocumentSchema()){let t=new id;return t.replaceInJson(JSON.stringify(this.buffer,t.createReplacer(),0))}return this.buffer}_write(t,r,n){let s=r!==null&&typeof r=="object",o=G.of(t);if(o.isListSchema()&&Array.isArray(r)){let a=o.getValueSchema(),c=[],d=!!o.getMergedTraits().sparse;for(let l of r)(d||l!=null)&&c.push(this._write(a,l));return c}else if(o.isMapSchema()&&s){let a=o.getValueSchema(),c={},d=!!o.getMergedTraits().sparse;for(let[l,u]of Object.entries(r))(d||u!=null)&&(c[l]=this._write(a,u));return c}else if(o.isStructSchema()&&s){let a={};for(let[c,d]of o.structIterator()){let l=this.settings.jsonName?d.getMergedTraits().jsonName??c:c,u=this._write(d,r[c],o);u!==void 0&&(a[l]=u)}return a}if(r===null&&n?.isStructSchema())return;if(o.isBlobSchema()&&(r instanceof Uint8Array||typeof r=="string")){if(o===this.rootSchema)return r;if(!this.serdeContext?.base64Encoder)throw new Error("Missing base64Encoder in serdeContext");return this.serdeContext?.base64Encoder(r)}if(o.isTimestampSchema()&&r instanceof Date){let a=this.settings.timestampFormat;switch(a.useTrait?o.getSchema()===U.TIMESTAMP_DEFAULT?a.default:o.getSchema()??a.default:a.default){case U.TIMESTAMP_DATE_TIME:return r.toISOString().replace(".000Z","Z");case U.TIMESTAMP_HTTP_DATE:return ai(r);case U.TIMESTAMP_EPOCH_SECONDS:return r.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",r),r.getTime()/1e3}}if(o.isNumericSchema()&&typeof r=="number"&&(Math.abs(r)===1/0||isNaN(r)))return String(r);let i=o.getMergedTraits().mediaType;return o.isStringSchema()&&typeof r=="string"&&i&&(i==="application/json"||i.endsWith("+json"))?Ye.from(r):r}}});var fs,ad=C(()=>{rn();Jp();Yp();fs=class extends We{settings;constructor(t){super(),this.settings=t}createSerializer(){let t=new Ti(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){let t=new wi(this.settings);return t.setSerdeContext(this.serdeContext),t}}});var ZC,gs,cd=C(()=>{vr();xe();ZC=P(Ei());ad();bi();gs=class extends rs{serializer;deserializer;codec;constructor({defaultNamespace:t}){super({defaultNamespace:t}),this.codec=new fs({timestampFormat:{useTrait:!0,default:U.TIMESTAMP_EPOCH_SECONDS},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer()}async serializeRequest(t,r,n){let s=await super.serializeRequest(t,r,n);s.path.endsWith("/")||(s.path+="/"),Object.assign(s.headers,{"content-type":`application/x-amz-json-${this.getJsonRpcVersion()}`,"x-amz-target":(this.getJsonRpcVersion()==="1.0"?"JsonRpc10.":"JsonProtocol.")+G.of(t).getName()}),(Xt(t.input)==="unit"||!s.body)&&(s.body="{}");try{s.headers["content-length"]=String((0,ZC.calculateBodyLength)(s.body))}catch{}return s}getPayloadCodec(){return this.codec}async handleError(t,r,n,s,o){let i=ps(n,s)??"Unknown",a=this.options.defaultNamespace,c=i;i.includes("#")&&([a,c]=i.split("#"));let d=ue.for(a),l;try{l=d.getSchema(i)}catch{let _=ue.for("smithy.ts.sdk.synthetic."+a).getBaseException();if(_){let w=_.ctor;throw Object.assign(new w(c),s)}throw new Error(c)}let u=G.of(l),m=s.message??s.Message??"Unknown",p=new l.ctor(m);await this.deserializeHttpMessage(l,r,n,s);let h={};for(let[y,_]of u.structIterator()){let w=_.getMergedTraits().jsonName??y;h[y]=this.codec.createDeserializer().readObject(_,s[w])}throw Object.assign(p,{$metadata:o,$response:n,$fault:u.getMergedTraits().error,message:m,...h}),p}}});var Qp,KC=C(()=>{cd();Qp=class extends gs{constructor({defaultNamespace:t}){super({defaultNamespace:t})}getShapeId(){return"aws.protocols#awsJson1_0"}getJsonRpcVersion(){return"1.0"}}});var Xp,JC=C(()=>{cd();Xp=class extends gs{constructor({defaultNamespace:t}){super({defaultNamespace:t})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}}});var YC,ef,QC=C(()=>{vr();xe();YC=P(Ei());ad();bi();ef=class extends ts{serializer;deserializer;codec;constructor({defaultNamespace:t}){super({defaultNamespace:t});let r={timestampFormat:{useTrait:!0,default:U.TIMESTAMP_EPOCH_SECONDS},httpBindings:!0,jsonName:!0};this.codec=new fs(r),this.serializer=new is(this.codec.createSerializer(),r),this.deserializer=new os(this.codec.createDeserializer(),r)}getShapeId(){return"aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(t){this.codec.setSerdeContext(t),super.setSerdeContext(t)}async serializeRequest(t,r,n){let s=await super.serializeRequest(t,r,n),o=G.of(t.input),i=o.getMemberSchemas();if(!s.headers["content-type"]){let a=Object.values(i).find(c=>!!c.getMergedTraits().httpPayload);if(a){let c=a.getMergedTraits().mediaType;c?s.headers["content-type"]=c:a.isStringSchema()?s.headers["content-type"]="text/plain":a.isBlobSchema()?s.headers["content-type"]="application/octet-stream":s.headers["content-type"]="application/json"}else o.isUnitSchema()||Object.values(i).find(d=>{let{httpQuery:l,httpQueryParams:u,httpHeader:m,httpLabel:p,httpPrefixHeaders:h}=d.getMergedTraits();return!l&&!u&&!m&&!p&&h===void 0})&&(s.headers["content-type"]="application/json")}if(s.headers["content-type"]&&!s.body&&(s.body="{}"),s.body)try{s.headers["content-length"]=String((0,YC.calculateBodyLength)(s.body))}catch{}return s}async handleError(t,r,n,s,o){let i=ps(n,s)??"Unknown",a=this.options.defaultNamespace,c=i;i.includes("#")&&([a,c]=i.split("#"));let d=ue.for(a),l;try{l=d.getSchema(i)}catch{let _=ue.for("smithy.ts.sdk.synthetic."+a).getBaseException();if(_){let w=_.ctor;throw Object.assign(new w(c),s)}throw new Error(c)}let u=G.of(l),m=s.message??s.Message??"Unknown",p=new l.ctor(m);await this.deserializeHttpMessage(l,r,n,s);let h={};for(let[y,_]of u.structIterator()){let w=_.getMergedTraits().jsonName??y;h[y]=this.codec.createDeserializer().readObject(_,s[w])}throw Object.assign(p,{$metadata:o,$response:n,$fault:u.getMergedTraits().error,message:m,...h}),p}}});var XC,U2,e0=C(()=>{XC=P(ee()),U2=e=>{if(e!=null)return typeof e=="object"&&"__type"in e&&delete e.__type,(0,XC.expectUnion)(e)}});var dd=b(Er=>{"use strict";var t0=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",B2=t0+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",r0="["+t0+"]["+B2+"]*",$2=new RegExp("^"+r0+"$"),z2=function(e,t){let r=[],n=t.exec(e);for(;n;){let s=[];s.startIndex=t.lastIndex-n[0].length;let o=n.length;for(let i=0;i<o;i++)s.push(n[i]);r.push(s),n=t.exec(e)}return r},H2=function(e){let t=$2.exec(e);return!(t===null||typeof t>"u")};Er.isExist=function(e){return typeof e<"u"};Er.isEmptyObject=function(e){return Object.keys(e).length===0};Er.merge=function(e,t,r){if(t){let n=Object.keys(t),s=n.length;for(let o=0;o<s;o++)r==="strict"?e[n[o]]=[t[n[o]]]:e[n[o]]=t[n[o]]}};Er.getValue=function(e){return Er.isExist(e)?e:""};Er.isName=H2;Er.getAllMatches=z2;Er.nameRegexp=r0});var rf=b(a0=>{"use strict";var tf=dd(),q2={allowBooleanAttributes:!1,unpairedTags:[]};a0.validate=function(e,t){t=Object.assign({},q2,t);let r=[],n=!1,s=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let o=0;o<e.length;o++)if(e[o]==="<"&&e[o+1]==="?"){if(o+=2,o=s0(e,o),o.err)return o}else if(e[o]==="<"){let i=o;if(o++,e[o]==="!"){o=o0(e,o);continue}else{let a=!1;e[o]==="/"&&(a=!0,o++);let c="";for(;o<e.length&&e[o]!==">"&&e[o]!==" "&&e[o]!==" "&&e[o]!==`
37
- `&&e[o]!=="\r";o++)c+=e[o];if(c=c.trim(),c[c.length-1]==="/"&&(c=c.substring(0,c.length-1),o--),!Q2(c)){let u;return c.trim().length===0?u="Invalid space after '<'.":u="Tag '"+c+"' is an invalid name.",be("InvalidTag",u,Xe(e,o))}let d=W2(e,o);if(d===!1)return be("InvalidAttr","Attributes for '"+c+"' have open quote.",Xe(e,o));let l=d.value;if(o=d.index,l[l.length-1]==="/"){let u=o-l.length;l=l.substring(0,l.length-1);let m=i0(l,t);if(m===!0)n=!0;else return be(m.err.code,m.err.msg,Xe(e,u+m.err.line))}else if(a)if(d.tagClosed){if(l.trim().length>0)return be("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",Xe(e,i));if(r.length===0)return be("InvalidTag","Closing tag '"+c+"' has not been opened.",Xe(e,i));{let u=r.pop();if(c!==u.tagName){let m=Xe(e,u.tagStartPos);return be("InvalidTag","Expected closing tag '"+u.tagName+"' (opened in line "+m.line+", col "+m.col+") instead of closing tag '"+c+"'.",Xe(e,i))}r.length==0&&(s=!0)}}else return be("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",Xe(e,o));else{let u=i0(l,t);if(u!==!0)return be(u.err.code,u.err.msg,Xe(e,o-l.length+u.err.line));if(s===!0)return be("InvalidXml","Multiple possible root nodes found.",Xe(e,o));t.unpairedTags.indexOf(c)!==-1||r.push({tagName:c,tagStartPos:i}),n=!0}for(o++;o<e.length;o++)if(e[o]==="<")if(e[o+1]==="!"){o++,o=o0(e,o);continue}else if(e[o+1]==="?"){if(o=s0(e,++o),o.err)return o}else break;else if(e[o]==="&"){let u=J2(e,o);if(u==-1)return be("InvalidChar","char '&' is not expected.",Xe(e,o));o=u}else if(s===!0&&!n0(e[o]))return be("InvalidXml","Extra text at the end",Xe(e,o));e[o]==="<"&&o--}}else{if(n0(e[o]))continue;return be("InvalidChar","char '"+e[o]+"' is not expected.",Xe(e,o))}if(n){if(r.length==1)return be("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",Xe(e,r[0].tagStartPos));if(r.length>0)return be("InvalidXml","Invalid '"+JSON.stringify(r.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return be("InvalidXml","Start tag expected.",1);return!0};function n0(e){return e===" "||e===" "||e===`
38
- `||e==="\r"}function s0(e,t){let r=t;for(;t<e.length;t++)if(e[t]=="?"||e[t]==" "){let n=e.substr(r,t-r);if(t>5&&n==="xml")return be("InvalidXml","XML declaration allowed only at the start of the document.",Xe(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function o0(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let r=1;for(t+=8;t<e.length;t++)if(e[t]==="<")r++;else if(e[t]===">"&&(r--,r===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}var G2='"',V2="'";function W2(e,t){let r="",n="",s=!1;for(;t<e.length;t++){if(e[t]===G2||e[t]===V2)n===""?n=e[t]:n!==e[t]||(n="");else if(e[t]===">"&&n===""){s=!0;break}r+=e[t]}return n!==""?!1:{value:r,index:t,tagClosed:s}}var Z2=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function i0(e,t){let r=tf.getAllMatches(e,Z2),n={};for(let s=0;s<r.length;s++){if(r[s][1].length===0)return be("InvalidAttr","Attribute '"+r[s][2]+"' has no space in starting.",Pi(r[s]));if(r[s][3]!==void 0&&r[s][4]===void 0)return be("InvalidAttr","Attribute '"+r[s][2]+"' is without value.",Pi(r[s]));if(r[s][3]===void 0&&!t.allowBooleanAttributes)return be("InvalidAttr","boolean attribute '"+r[s][2]+"' is not allowed.",Pi(r[s]));let o=r[s][2];if(!Y2(o))return be("InvalidAttr","Attribute '"+o+"' is an invalid name.",Pi(r[s]));if(!n.hasOwnProperty(o))n[o]=1;else return be("InvalidAttr","Attribute '"+o+"' is repeated.",Pi(r[s]))}return!0}function K2(e,t){let r=/\d/;for(e[t]==="x"&&(t++,r=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(r))break}return-1}function J2(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,K2(e,t);let r=0;for(;t<e.length;t++,r++)if(!(e[t].match(/\w/)&&r<20)){if(e[t]===";")break;return-1}return t}function be(e,t,r){return{err:{code:e,msg:t,line:r.line||r,col:r.col}}}function Y2(e){return tf.isName(e)}function Q2(e){return tf.isName(e)}function Xe(e,t){let r=e.substring(0,t).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function Pi(e){return e.startIndex+e[1].length}});var d0=b(nf=>{var c0={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,r){return e}},X2=function(e){return Object.assign({},c0,e)};nf.buildOptions=X2;nf.defaultOptions=c0});var u0=b((Nie,l0)=>{"use strict";var sf=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,r){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:r})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}};l0.exports=sf});var p0=b((Lie,m0)=>{var ez=dd();function tz(e,t){let r={};if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let n=1,s=!1,o=!1,i="";for(;t<e.length;t++)if(e[t]==="<"&&!o){if(s&&sz(e,t))t+=7,[entityName,val,t]=rz(e,t+1),val.indexOf("&")===-1&&(r[cz(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(s&&oz(e,t))t+=8;else if(s&&iz(e,t))t+=8;else if(s&&az(e,t))t+=9;else if(nz)o=!0;else throw new Error("Invalid DOCTYPE");n++,i=""}else if(e[t]===">"){if(o?e[t-1]==="-"&&e[t-2]==="-"&&(o=!1,n--):n--,n===0)break}else e[t]==="["?s=!0:i+=e[t];if(n!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:r,i:t}}function rz(e,t){let r="";for(;t<e.length&&e[t]!=="'"&&e[t]!=='"';t++)r+=e[t];if(r=r.trim(),r.indexOf(" ")!==-1)throw new Error("External entites are not supported");let n=e[t++],s="";for(;t<e.length&&e[t]!==n;t++)s+=e[t];return[r,s,t]}function nz(e,t){return e[t+1]==="!"&&e[t+2]==="-"&&e[t+3]==="-"}function sz(e,t){return e[t+1]==="!"&&e[t+2]==="E"&&e[t+3]==="N"&&e[t+4]==="T"&&e[t+5]==="I"&&e[t+6]==="T"&&e[t+7]==="Y"}function oz(e,t){return e[t+1]==="!"&&e[t+2]==="E"&&e[t+3]==="L"&&e[t+4]==="E"&&e[t+5]==="M"&&e[t+6]==="E"&&e[t+7]==="N"&&e[t+8]==="T"}function iz(e,t){return e[t+1]==="!"&&e[t+2]==="A"&&e[t+3]==="T"&&e[t+4]==="T"&&e[t+5]==="L"&&e[t+6]==="I"&&e[t+7]==="S"&&e[t+8]==="T"}function az(e,t){return e[t+1]==="!"&&e[t+2]==="N"&&e[t+3]==="O"&&e[t+4]==="T"&&e[t+5]==="A"&&e[t+6]==="T"&&e[t+7]==="I"&&e[t+8]==="O"&&e[t+9]==="N"}function cz(e){if(ez.isName(e))return e;throw new Error(`Invalid entity name ${e}`)}m0.exports=tz});var g0=b((kie,f0)=>{var dz=/^[-+]?0x[a-fA-F0-9]+$/,lz=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,uz={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function mz(e,t={}){if(t=Object.assign({},uz,t),!e||typeof e!="string")return e;let r=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(r))return e;if(e==="0")return 0;if(t.hex&&dz.test(r))return fz(r,16);if(r.search(/[eE]/)!==-1){let n=r.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(n){if(t.leadingZeros)r=(n[1]||"")+n[3];else if(!(n[2]==="0"&&n[3][0]==="."))return e;return t.eNotation?Number(r):e}else return e}else{let n=lz.exec(r);if(n){let s=n[1],o=n[2],i=pz(n[3]);if(!t.leadingZeros&&o.length>0&&s&&r[2]!==".")return e;if(!t.leadingZeros&&o.length>0&&!s&&r[1]!==".")return e;if(t.leadingZeros&&o===e)return 0;{let a=Number(r),c=""+a;return c.search(/[eE]/)!==-1?t.eNotation?a:e:r.indexOf(".")!==-1?c==="0"&&i===""||c===i||s&&c==="-"+i?a:e:o?i===c||s+i===c?a:e:r===c||r===s+c?a:e}}else return e}}function pz(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substr(0,e.length-1))),e}function fz(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}f0.exports=mz});var _0=b((Mie,y0)=>{"use strict";var h0=dd(),xi=u0(),gz=p0(),hz=g0(),of=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(r,n)=>String.fromCharCode(Number.parseInt(n,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(r,n)=>String.fromCharCode(Number.parseInt(n,16))}},this.addExternalEntities=yz,this.parseXml=Cz,this.parseTextData=_z,this.resolveNameSpace=vz,this.buildAttributesMap=Ez,this.isItStopNode=Pz,this.replaceEntitiesValue=wz,this.readStopNodeData=Iz,this.saveTextToParentTag=Tz,this.addChild=bz}};function yz(e){let t=Object.keys(e);for(let r=0;r<t.length;r++){let n=t[r];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:e[n]}}}function _z(e,t,r,n,s,o,i){if(e!==void 0&&(this.options.trimValues&&!n&&(e=e.trim()),e.length>0)){i||(e=this.replaceEntitiesValue(e));let a=this.options.tagValueProcessor(t,e,r,s,o);return a==null?e:typeof a!=typeof e||a!==e?a:this.options.trimValues?cf(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?cf(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function vz(e){if(this.options.removeNSPrefix){let t=e.split(":"),r=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=r+t[1])}return e}var Sz=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Ez(e,t,r){if(!this.options.ignoreAttributes&&typeof e=="string"){let n=h0.getAllMatches(e,Sz),s=n.length,o={};for(let i=0;i<s;i++){let a=this.resolveNameSpace(n[i][1]),c=n[i][4],d=this.options.attributeNamePrefix+a;if(a.length)if(this.options.transformAttributeName&&(d=this.options.transformAttributeName(d)),d==="__proto__"&&(d="#__proto__"),c!==void 0){this.options.trimValues&&(c=c.trim()),c=this.replaceEntitiesValue(c);let l=this.options.attributeValueProcessor(a,c,t);l==null?o[d]=c:typeof l!=typeof c||l!==c?o[d]=l:o[d]=cf(c,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(o[d]=!0)}if(!Object.keys(o).length)return;if(this.options.attributesGroupName){let i={};return i[this.options.attributesGroupName]=o,i}return o}}var Cz=function(e){e=e.replace(/\r\n?/g,`
39
- `);let t=new xi("!xml"),r=t,n="",s="";for(let o=0;o<e.length;o++)if(e[o]==="<")if(e[o+1]==="/"){let a=hs(e,">",o,"Closing Tag is not closed."),c=e.substring(o+2,a).trim();if(this.options.removeNSPrefix){let u=c.indexOf(":");u!==-1&&(c=c.substr(u+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),r&&(n=this.saveTextToParentTag(n,r,s));let d=s.substring(s.lastIndexOf(".")+1);if(c&&this.options.unpairedTags.indexOf(c)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${c}>`);let l=0;d&&this.options.unpairedTags.indexOf(d)!==-1?(l=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=s.lastIndexOf("."),s=s.substring(0,l),r=this.tagsNodeStack.pop(),n="",o=a}else if(e[o+1]==="?"){let a=af(e,o,!1,"?>");if(!a)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,r,s),!(this.options.ignoreDeclaration&&a.tagName==="?xml"||this.options.ignorePiTags)){let c=new xi(a.tagName);c.add(this.options.textNodeName,""),a.tagName!==a.tagExp&&a.attrExpPresent&&(c[":@"]=this.buildAttributesMap(a.tagExp,s,a.tagName)),this.addChild(r,c,s)}o=a.closeIndex+1}else if(e.substr(o+1,3)==="!--"){let a=hs(e,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){let c=e.substring(o+4,a-2);n=this.saveTextToParentTag(n,r,s),r.add(this.options.commentPropName,[{[this.options.textNodeName]:c}])}o=a}else if(e.substr(o+1,2)==="!D"){let a=gz(e,o);this.docTypeEntities=a.entities,o=a.i}else if(e.substr(o+1,2)==="!["){let a=hs(e,"]]>",o,"CDATA is not closed.")-2,c=e.substring(o+9,a);n=this.saveTextToParentTag(n,r,s);let d=this.parseTextData(c,r.tagname,s,!0,!1,!0,!0);d==null&&(d=""),this.options.cdataPropName?r.add(this.options.cdataPropName,[{[this.options.textNodeName]:c}]):r.add(this.options.textNodeName,d),o=a+2}else{let a=af(e,o,this.options.removeNSPrefix),c=a.tagName,d=a.rawTagName,l=a.tagExp,u=a.attrExpPresent,m=a.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),r&&n&&r.tagname!=="!xml"&&(n=this.saveTextToParentTag(n,r,s,!1));let p=r;if(p&&this.options.unpairedTags.indexOf(p.tagname)!==-1&&(r=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),c!==t.tagname&&(s+=s?"."+c:c),this.isItStopNode(this.options.stopNodes,s,c)){let h="";if(l.length>0&&l.lastIndexOf("/")===l.length-1)c[c.length-1]==="/"?(c=c.substr(0,c.length-1),s=s.substr(0,s.length-1),l=c):l=l.substr(0,l.length-1),o=a.closeIndex;else if(this.options.unpairedTags.indexOf(c)!==-1)o=a.closeIndex;else{let _=this.readStopNodeData(e,d,m+1);if(!_)throw new Error(`Unexpected end of ${d}`);o=_.i,h=_.tagContent}let y=new xi(c);c!==l&&u&&(y[":@"]=this.buildAttributesMap(l,s,c)),h&&(h=this.parseTextData(h,c,s,!0,u,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),y.add(this.options.textNodeName,h),this.addChild(r,y,s)}else{if(l.length>0&&l.lastIndexOf("/")===l.length-1){c[c.length-1]==="/"?(c=c.substr(0,c.length-1),s=s.substr(0,s.length-1),l=c):l=l.substr(0,l.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));let h=new xi(c);c!==l&&u&&(h[":@"]=this.buildAttributesMap(l,s,c)),this.addChild(r,h,s),s=s.substr(0,s.lastIndexOf("."))}else{let h=new xi(c);this.tagsNodeStack.push(r),c!==l&&u&&(h[":@"]=this.buildAttributesMap(l,s,c)),this.addChild(r,h,s),r=h}n="",o=m}}else n+=e[o];return t.child};function bz(e,t,r){let n=this.options.updateTag(t.tagname,r,t[":@"]);n===!1||(typeof n=="string"&&(t.tagname=n),e.addChild(t))}var wz=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){let r=this.docTypeEntities[t];e=e.replace(r.regx,r.val)}for(let t in this.lastEntities){let r=this.lastEntities[t];e=e.replace(r.regex,r.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){let r=this.htmlEntities[t];e=e.replace(r.regex,r.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function Tz(e,t,r,n){return e&&(n===void 0&&(n=Object.keys(t.child).length===0),e=this.parseTextData(e,t.tagname,r,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,n),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function Pz(e,t,r){let n="*."+r;for(let s in e){let o=e[s];if(n===o||t===o)return!0}return!1}function xz(e,t,r=">"){let n,s="";for(let o=t;o<e.length;o++){let i=e[o];if(n)i===n&&(n="");else if(i==='"'||i==="'")n=i;else if(i===r[0])if(r[1]){if(e[o+1]===r[1])return{data:s,index:o}}else return{data:s,index:o};else i===" "&&(i=" ");s+=i}}function hs(e,t,r,n){let s=e.indexOf(t,r);if(s===-1)throw new Error(n);return s+t.length-1}function af(e,t,r,n=">"){let s=xz(e,t+1,n);if(!s)return;let o=s.data,i=s.index,a=o.search(/\s/),c=o,d=!0;a!==-1&&(c=o.substring(0,a),o=o.substring(a+1).trimStart());let l=c;if(r){let u=c.indexOf(":");u!==-1&&(c=c.substr(u+1),d=c!==s.data.substr(u+1))}return{tagName:c,tagExp:o,closeIndex:i,attrExpPresent:d,rawTagName:l}}function Iz(e,t,r){let n=r,s=1;for(;r<e.length;r++)if(e[r]==="<")if(e[r+1]==="/"){let o=hs(e,">",r,`${t} is not closed`);if(e.substring(r+2,o).trim()===t&&(s--,s===0))return{tagContent:e.substring(n,r),i:o};r=o}else if(e[r+1]==="?")r=hs(e,"?>",r+1,"StopNode is not closed.");else if(e.substr(r+1,3)==="!--")r=hs(e,"-->",r+3,"StopNode is not closed.");else if(e.substr(r+1,2)==="![")r=hs(e,"]]>",r,"StopNode is not closed.")-2;else{let o=af(e,r,">");o&&((o&&o.tagName)===t&&o.tagExp[o.tagExp.length-1]!=="/"&&s++,r=o.closeIndex)}}function cf(e,t,r){if(t&&typeof e=="string"){let n=e.trim();return n==="true"?!0:n==="false"?!1:hz(e,r)}else return h0.isExist(e)?e:""}y0.exports=of});var E0=b(S0=>{"use strict";function Az(e,t){return v0(e,t)}function v0(e,t,r){let n,s={};for(let o=0;o<e.length;o++){let i=e[o],a=Oz(i),c="";if(r===void 0?c=a:c=r+"."+a,a===t.textNodeName)n===void 0?n=i[a]:n+=""+i[a];else{if(a===void 0)continue;if(i[a]){let d=v0(i[a],t,c),l=Rz(d,t);i[":@"]?Dz(d,i[":@"],c,t):Object.keys(d).length===1&&d[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?d=d[t.textNodeName]:Object.keys(d).length===0&&(t.alwaysCreateTextNode?d[t.textNodeName]="":d=""),s[a]!==void 0&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(d)):t.isArray(a,c,l)?s[a]=[d]:s[a]=d}}}return typeof n=="string"?n.length>0&&(s[t.textNodeName]=n):n!==void 0&&(s[t.textNodeName]=n),s}function Oz(e){let t=Object.keys(e);for(let r=0;r<t.length;r++){let n=t[r];if(n!==":@")return n}}function Dz(e,t,r,n){if(t){let s=Object.keys(t),o=s.length;for(let i=0;i<o;i++){let a=s[i];n.isArray(a,r+"."+a,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function Rz(e,t){let{textNodeName:r}=t,n=Object.keys(e).length;return!!(n===0||n===1&&(e[r]||typeof e[r]=="boolean"||e[r]===0))}S0.prettify=Az});var b0=b((jie,C0)=>{var{buildOptions:Nz}=d0(),Lz=_0(),{prettify:kz}=E0(),Mz=rf(),df=class{constructor(t){this.externalEntities={},this.options=Nz(t)}parse(t,r){if(typeof t!="string")if(t.toString)t=t.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(r){r===!0&&(r={});let o=Mz.validate(t,r);if(o!==!0)throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`)}let n=new Lz(this.options);n.addExternalEntities(this.externalEntities);let s=n.parseXml(t);return this.options.preserveOrder||s===void 0?s:kz(s,this.options)}addEntity(t,r){if(r.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(r==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=r}};C0.exports=df});var I0=b((Uie,x0)=>{var Fz=`
40
- `;function jz(e,t){let r="";return t.format&&t.indentBy.length>0&&(r=Fz),T0(e,t,"",r)}function T0(e,t,r,n){let s="",o=!1;for(let i=0;i<e.length;i++){let a=e[i],c=Uz(a);if(c===void 0)continue;let d="";if(r.length===0?d=c:d=`${r}.${c}`,c===t.textNodeName){let h=a[c];Bz(d,t)||(h=t.tagValueProcessor(c,h),h=P0(h,t)),o&&(s+=n),s+=h,o=!1;continue}else if(c===t.cdataPropName){o&&(s+=n),s+=`<![CDATA[${a[c][0][t.textNodeName]}]]>`,o=!1;continue}else if(c===t.commentPropName){s+=n+`<!--${a[c][0][t.textNodeName]}-->`,o=!0;continue}else if(c[0]==="?"){let h=w0(a[":@"],t),y=c==="?xml"?"":n,_=a[c][0][t.textNodeName];_=_.length!==0?" "+_:"",s+=y+`<${c}${_}${h}?>`,o=!0;continue}let l=n;l!==""&&(l+=t.indentBy);let u=w0(a[":@"],t),m=n+`<${c}${u}`,p=T0(a[c],t,d,l);t.unpairedTags.indexOf(c)!==-1?t.suppressUnpairedNode?s+=m+">":s+=m+"/>":(!p||p.length===0)&&t.suppressEmptyNode?s+=m+"/>":p&&p.endsWith(">")?s+=m+`>${p}${n}</${c}>`:(s+=m+">",p&&n!==""&&(p.includes("/>")||p.includes("</"))?s+=n+t.indentBy+p+n:s+=p,s+=`</${c}>`),o=!0}return s}function Uz(e){let t=Object.keys(e);for(let r=0;r<t.length;r++){let n=t[r];if(e.hasOwnProperty(n)&&n!==":@")return n}}function w0(e,t){let r="";if(e&&!t.ignoreAttributes)for(let n in e){if(!e.hasOwnProperty(n))continue;let s=t.attributeValueProcessor(n,e[n]);s=P0(s,t),s===!0&&t.suppressBooleanAttributes?r+=` ${n.substr(t.attributeNamePrefix.length)}`:r+=` ${n.substr(t.attributeNamePrefix.length)}="${s}"`}return r}function Bz(e,t){e=e.substr(0,e.length-t.textNodeName.length-1);let r=e.substr(e.lastIndexOf(".")+1);for(let n in t.stopNodes)if(t.stopNodes[n]===e||t.stopNodes[n]==="*."+r)return!0;return!1}function P0(e,t){if(e&&e.length>0&&t.processEntities)for(let r=0;r<t.entities.length;r++){let n=t.entities[r];e=e.replace(n.regex,n.val)}return e}x0.exports=jz});var O0=b((Bie,A0)=>{"use strict";var $z=I0(),zz={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function sn(e){this.options=Object.assign({},zz,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Gz),this.processTextOrObjNode=Hz,this.options.format?(this.indentate=qz,this.tagEndChar=`>
41
- `,this.newLine=`
42
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}sn.prototype.build=function(e){return this.options.preserveOrder?$z(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)};sn.prototype.j2x=function(e,t){let r="",n="";for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s))if(typeof e[s]>"u")this.isAttribute(s)&&(n+="");else if(e[s]===null)this.isAttribute(s)?n+="":s[0]==="?"?n+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(e[s]instanceof Date)n+=this.buildTextValNode(e[s],s,"",t);else if(typeof e[s]!="object"){let o=this.isAttribute(s);if(o)r+=this.buildAttrPairStr(o,""+e[s]);else if(s===this.options.textNodeName){let i=this.options.tagValueProcessor(s,""+e[s]);n+=this.replaceEntitiesValue(i)}else n+=this.buildTextValNode(e[s],s,"",t)}else if(Array.isArray(e[s])){let o=e[s].length,i="",a="";for(let c=0;c<o;c++){let d=e[s][c];if(!(typeof d>"u"))if(d===null)s[0]==="?"?n+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(typeof d=="object")if(this.options.oneListGroup){let l=this.j2x(d,t+1);i+=l.val,this.options.attributesGroupName&&d.hasOwnProperty(this.options.attributesGroupName)&&(a+=l.attrStr)}else i+=this.processTextOrObjNode(d,s,t);else if(this.options.oneListGroup){let l=this.options.tagValueProcessor(s,d);l=this.replaceEntitiesValue(l),i+=l}else i+=this.buildTextValNode(d,s,"",t)}this.options.oneListGroup&&(i=this.buildObjectNode(i,s,a,t)),n+=i}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){let o=Object.keys(e[s]),i=o.length;for(let a=0;a<i;a++)r+=this.buildAttrPairStr(o[a],""+e[s][o[a]])}else n+=this.processTextOrObjNode(e[s],s,t);return{attrStr:r,val:n}};sn.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&t==="true"?" "+e:" "+e+'="'+t+'"'};function Hz(e,t,r){let n=this.j2x(e,r+1);return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,n.attrStr,r):this.buildObjectNode(n.val,t,n.attrStr,r)}sn.prototype.buildObjectNode=function(e,t,r,n){if(e==="")return t[0]==="?"?this.indentate(n)+"<"+t+r+"?"+this.tagEndChar:this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar;{let s="</"+t+this.tagEndChar,o="";return t[0]==="?"&&(o="?",s=""),(r||r==="")&&e.indexOf("<")===-1?this.indentate(n)+"<"+t+r+o+">"+e+s:this.options.commentPropName!==!1&&t===this.options.commentPropName&&o.length===0?this.indentate(n)+`<!--${e}-->`+this.newLine:this.indentate(n)+"<"+t+r+o+this.tagEndChar+e+this.indentate(n)+s}};sn.prototype.closeTag=function(e){let t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`></${e}`,t};sn.prototype.buildTextValNode=function(e,t,r,n){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(n)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(n)+`<!--${e}-->`+this.newLine;if(t[0]==="?")return this.indentate(n)+"<"+t+r+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(t,e);return s=this.replaceEntitiesValue(s),s===""?this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar:this.indentate(n)+"<"+t+r+">"+s+"</"+t+this.tagEndChar}};sn.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){let r=this.options.entities[t];e=e.replace(r.regex,r.val)}return e};function qz(e){return this.options.indentBy.repeat(e)}function Gz(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}A0.exports=sn});var lf=b(($ie,D0)=>{"use strict";var Vz=rf(),Wz=b0(),Zz=O0();D0.exports={XMLParser:Wz,XMLValidator:Vz,XMLBuilder:Zz}});var R0,N0,L0,ys,ld=C(()=>{vr();xe();R0=P(ee()),N0=P(Re()),L0=P(lf());rn();ys=class extends We{settings;stringDeserializer;constructor(t){super(),this.settings=t,this.stringDeserializer=new ss(t)}setSerdeContext(t){this.serdeContext=t,this.stringDeserializer.setSerdeContext(t)}read(t,r,n){let s=G.of(t),o=s.getMemberSchemas();if(s.isStructSchema()&&s.isMemberSchema()&&!!Object.values(o).find(d=>!!d.getMemberTraits().eventPayload)){let d={},l=Object.keys(o)[0];return o[l].isBlobSchema()?d[l]=r:d[l]=this.read(o[l],r),d}let a=(this.serdeContext?.utf8Encoder??N0.toUtf8)(r),c=this.parseXml(a);return this.readSchema(t,n?c[n]:c)}readSchema(t,r){let n=G.of(t),s=n.getMergedTraits(),o=n.getSchema();if(n.isListSchema()&&!Array.isArray(r))return this.readSchema(o,[r]);if(r==null)return r;if(typeof r=="object"){let i=!!s.sparse,a=!!s.xmlFlattened;if(n.isListSchema()){let d=n.getValueSchema(),l=[],u=d.getMergedTraits().xmlName??"member",m=a?r:(r[0]??r)[u],p=Array.isArray(m)?m:[m];for(let h of p)(h!=null||i)&&l.push(this.readSchema(d,h));return l}let c={};if(n.isMapSchema()){let d=n.getKeySchema(),l=n.getValueSchema(),u;a?u=Array.isArray(r)?r:[r]:u=Array.isArray(r.entry)?r.entry:[r.entry];let m=d.getMergedTraits().xmlName??"key",p=l.getMergedTraits().xmlName??"value";for(let h of u){let y=h[m],_=h[p];(_!=null||i)&&(c[y]=this.readSchema(l,_))}return c}if(n.isStructSchema()){for(let[d,l]of n.structIterator()){let u=l.getMergedTraits(),m=u.httpPayload?u.xmlName??l.getName():l.getMemberTraits().xmlName??d;r[m]!=null&&(c[d]=this.readSchema(l,r[m]))}return c}if(n.isDocumentSchema())return r;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${n.getName(!0)}`)}else return n.isListSchema()?[]:n.isMapSchema()||n.isStructSchema()?{}:this.stringDeserializer.read(n,r)}parseXml(t){if(t.length){let r=new L0.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(a,c)=>c.trim()===""&&c.includes(`
43
- `)?"":void 0});r.addEntity("#xD","\r"),r.addEntity("#10",`
44
- `);let n;try{n=r.parse(t,!0)}catch(a){throw a&&typeof a=="object"&&Object.defineProperty(a,"$responseBodyText",{value:t}),a}let s="#text",o=Object.keys(n)[0],i=n[o];return i[s]&&(i[o]=i[s],delete i[s]),(0,R0.getValueFromTextNode)(i)}return{}}}});var k0,M0,ud,F0=C(()=>{vr();xe();bt();k0=P(ee()),M0=P(Je());rn();ud=class extends We{settings;buffer;constructor(t){super(),this.settings=t}write(t,r,n=""){this.buffer===void 0&&(this.buffer="");let s=G.of(t);if(n&&!n.endsWith(".")&&(n+="."),s.isBlobSchema())(typeof r=="string"||r instanceof Uint8Array)&&(this.writeKey(n),this.writeValue((this.serdeContext?.base64Encoder??M0.toBase64)(r)));else if(s.isBooleanSchema()||s.isNumericSchema()||s.isStringSchema())r!=null&&(this.writeKey(n),this.writeValue(String(r)));else if(s.isBigIntegerSchema())r!=null&&(this.writeKey(n),this.writeValue(String(r)));else if(s.isBigDecimalSchema())r!=null&&(this.writeKey(n),this.writeValue(r instanceof Fe?r.string:String(r)));else if(s.isTimestampSchema()){if(r instanceof Date)switch(this.writeKey(n),ns(s,this.settings)){case U.TIMESTAMP_DATE_TIME:this.writeValue(r.toISOString().replace(".000Z","Z"));break;case U.TIMESTAMP_HTTP_DATE:this.writeValue((0,k0.dateToUtcString)(r));break;case U.TIMESTAMP_EPOCH_SECONDS:this.writeValue(String(r.getTime()/1e3));break}}else{if(s.isDocumentSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unsupported document type ${s.getName(!0)}`);if(s.isListSchema()){if(Array.isArray(r))if(r.length===0)this.settings.serializeEmptyLists&&(this.writeKey(n),this.writeValue(""));else{let o=s.getValueSchema(),i=this.settings.flattenLists||s.getMergedTraits().xmlFlattened,a=1;for(let c of r){if(c==null)continue;let d=this.getKey("member",o.getMergedTraits().xmlName),l=i?`${n}${a}`:`${n}${d}.${a}`;this.write(o,c,l),++a}}}else if(s.isMapSchema()){if(r&&typeof r=="object"){let o=s.getKeySchema(),i=s.getValueSchema(),a=s.getMergedTraits().xmlFlattened,c=1;for(let[d,l]of Object.entries(r)){if(l==null)continue;let u=this.getKey("key",o.getMergedTraits().xmlName),m=a?`${n}${c}.${u}`:`${n}entry.${c}.${u}`,p=this.getKey("value",i.getMergedTraits().xmlName),h=a?`${n}${c}.${p}`:`${n}entry.${c}.${p}`;this.write(o,d,m),this.write(i,l,h),++c}}}else if(s.isStructSchema()){if(r&&typeof r=="object")for(let[o,i]of s.structIterator()){if(r[o]==null)continue;let a=this.getKey(o,i.getMergedTraits().xmlName),c=`${n}${a}`;this.write(i,r[o],c)}}else if(!s.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${s.getName(!0)}`)}}flush(){if(this.buffer===void 0)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");let t=this.buffer;return delete this.buffer,t}getKey(t,r){let n=r??t;return this.settings.capitalizeKeys?n[0].toUpperCase()+n.slice(1):n}writeKey(t){t.endsWith(".")&&(t=t.slice(0,t.length-1)),this.buffer+=`&${Qt(t)}=`}writeValue(t){this.buffer+=Qt(t)}}});var j0,Ii,uf=C(()=>{vr();xe();j0=P(Ei());ld();F0();Ii=class extends rs{options;serializer;deserializer;constructor(t){super({defaultNamespace:t.defaultNamespace}),this.options=t;let r={timestampFormat:{useTrait:!0,default:U.TIMESTAMP_DATE_TIME},httpBindings:!1,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace,serializeEmptyLists:!0};this.serializer=new ud(r),this.deserializer=new ys(r)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(t){this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t)}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(t,r,n){let s=await super.serializeRequest(t,r,n);s.path.endsWith("/")||(s.path+="/"),Object.assign(s.headers,{"content-type":"application/x-www-form-urlencoded"}),(Xt(t.input)==="unit"||!s.body)&&(s.body=""),s.body=`Action=${t.name.split("#")[1]}&Version=${this.options.version}`+s.body,s.body.endsWith("&")&&(s.body=s.body.slice(-1));try{s.headers["content-length"]=String((0,j0.calculateBodyLength)(s.body))}catch{}return s}async deserializeResponse(t,r,n){let s=this.deserializer,o=G.of(t.output),i={};if(n.statusCode>=300){let l=await Ut(n.body,r);l.byteLength>0&&Object.assign(i,await s.read(U.DOCUMENT,l)),await this.handleError(t,r,n,i,this.deserializeMetadata(n))}for(let l in n.headers){let u=n.headers[l];delete n.headers[l],n.headers[l.toLowerCase()]=u}let a=o.isStructSchema()&&this.useNestedResult()?t.name.split("#")[1]+"Result":void 0,c=await Ut(n.body,r);return c.byteLength>0&&Object.assign(i,await s.read(o,c,a)),{$metadata:this.deserializeMetadata(n),...i}}useNestedResult(){return!0}async handleError(t,r,n,s,o){let i=this.loadQueryErrorCode(n,s)??"Unknown",a=this.options.defaultNamespace,c=i;i.includes("#")&&([a,c]=i.split("#"));let d=this.loadQueryError(s),l=ue.for(a),u;try{u=l.find(_=>G.of(_).getMergedTraits().awsQueryError?.[0]===c),u||(u=l.getSchema(i))}catch{let w=ue.for("smithy.ts.sdk.synthetic."+a).getBaseException();if(w){let E=w.ctor;throw Object.assign(new E(c),d)}throw new Error(c)}let m=G.of(u),p=this.loadQueryErrorMessage(s),h=new u.ctor(p),y={};for(let[_,w]of m.structIterator()){let E=w.getMergedTraits().xmlName??_,B=d[E]??s[E];y[_]=this.deserializer.readSchema(w,B)}throw Object.assign(h,{$metadata:o,$response:n,$fault:m.getMergedTraits().error,message:p,...y}),h}loadQueryErrorCode(t,r){let n=(r.Errors?.[0]?.Error??r.Errors?.Error??r.Error)?.Code;if(n!==void 0)return n;if(t.statusCode==404)return"NotFound"}loadQueryError(t){return t.Errors?.[0]?.Error??t.Errors?.Error??t.Error}loadQueryErrorMessage(t){let r=this.loadQueryError(t);return r?.message??r?.Message??t.message??t.Message??"Unknown"}}});var mf,U0=C(()=>{uf();mf=class extends Ii{options;constructor(t){super(t),this.options=t;let r={capitalizeKeys:!0,flattenLists:!0,serializeEmptyLists:!1};Object.assign(this.serializer.settings,r)}useNestedResult(){return!1}}});var B0,$0,Ai,pf,ff,gf=C(()=>{B0=P(ee()),$0=P(lf());Zp();Ai=(e,t)=>od(e,t).then(r=>{if(r.length){let n=new $0.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(c,d)=>d.trim()===""&&d.includes(`
45
- `)?"":void 0});n.addEntity("#xD","\r"),n.addEntity("#10",`
46
- `);let s;try{s=n.parse(r,!0)}catch(c){throw c&&typeof c=="object"&&Object.defineProperty(c,"$responseBodyText",{value:r}),c}let o="#text",i=Object.keys(s)[0],a=s[i];return a[o]&&(a[i]=a[o],delete a[o]),(0,B0.getValueFromTextNode)(a)}return{}}),pf=async(e,t)=>{let r=await Ai(e,t);return r.Error&&(r.Error.message=r.Error.message??r.Error.Message),r},ff=(e,t)=>{if(t?.Error?.Code!==void 0)return t.Error.Code;if(t?.Code!==void 0)return t.Code;if(e.statusCode==404)return"NotFound"}});var W0=b((iae,V0)=>{"use strict";var pd=Object.defineProperty,Kz=Object.getOwnPropertyDescriptor,Jz=Object.getOwnPropertyNames,Yz=Object.prototype.hasOwnProperty,fd=(e,t)=>pd(e,"name",{value:t,configurable:!0}),Qz=(e,t)=>{for(var r in t)pd(e,r,{get:t[r],enumerable:!0})},Xz=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Jz(t))!Yz.call(e,s)&&s!==r&&pd(e,s,{get:()=>t[s],enumerable:!(n=Kz(t,s))||n.enumerable});return e},eH=e=>Xz(pd({},"__esModule",{value:!0}),e),z0={};Qz(z0,{XmlNode:()=>tH,XmlText:()=>G0});V0.exports=eH(z0);function H0(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}fd(H0,"escapeAttribute");function q0(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#x0D;").replace(/\n/g,"&#x0A;").replace(/\u0085/g,"&#x85;").replace(/\u2028/,"&#x2028;")}fd(q0,"escapeElement");var G0=class{constructor(e){this.value=e}static{fd(this,"XmlText")}toString(){return q0(""+this.value)}},tH=class md{constructor(t,r=[]){this.name=t,this.children=r}static{fd(this,"XmlNode")}attributes={};static of(t,r,n){let s=new md(t);return r!==void 0&&s.addChildNode(new G0(r)),n!==void 0&&s.withName(n),s}withName(t){return this.name=t,this}addAttribute(t,r){return this.attributes[t]=r,this}addChildNode(t){return this.children.push(t),this}removeAttribute(t){return delete this.attributes[t],this}n(t){return this.name=t,this}c(t){return this.children.push(t),this}a(t,r){return r!=null&&(this.attributes[t]=r),this}cc(t,r,n=r){if(t[r]!=null){let s=md.of(r,t[r]).withName(n);this.c(s)}}l(t,r,n,s){t[r]!=null&&s().map(i=>{i.withName(n),this.c(i)})}lc(t,r,n,s){if(t[r]!=null){let o=s(),i=new md(n);o.map(a=>{i.c(a)}),this.c(i)}}toString(){let t=!!this.children.length,r=`<${this.name}`,n=this.attributes;for(let s of Object.keys(n)){let o=n[s];o!=null&&(r+=` ${s}="${H0(""+o)}"`)}return r+=t?`>${this.children.map(s=>s.toString()).join("")}</${this.name}>`:"/>"}}});var Tt,hf,gd,Oi,yf=C(()=>{Tt=P(W0());xe();bt();hf=P(ee()),gd=P(Je());rn();Oi=class extends We{settings;stringBuffer;byteBuffer;buffer;constructor(t){super(),this.settings=t}write(t,r){let n=G.of(t);if(n.isStringSchema()&&typeof r=="string")this.stringBuffer=r;else if(n.isBlobSchema())this.byteBuffer="byteLength"in r?r:(this.serdeContext?.base64Decoder??gd.fromBase64)(r);else{this.buffer=this.writeStruct(n,r,void 0);let s=n.getMergedTraits();s.httpPayload&&!s.xmlName&&this.buffer.withName(n.getName())}}flush(){if(this.byteBuffer!==void 0){let r=this.byteBuffer;return delete this.byteBuffer,r}if(this.stringBuffer!==void 0){let r=this.stringBuffer;return delete this.stringBuffer,r}let t=this.buffer;return this.settings.xmlNamespace&&(t?.attributes?.xmlns||t.addAttribute("xmlns",this.settings.xmlNamespace)),delete this.buffer,t.toString()}writeStruct(t,r,n){let s=t.getMergedTraits(),o=t.isMemberSchema()&&!s.httpPayload?t.getMemberTraits().xmlName??t.getMemberName():s.xmlName??t.getName();if(!o||!t.isStructSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${t.getName(!0)}.`);let i=Tt.XmlNode.of(o),[a,c]=this.getXmlnsAttribute(t,n);c&&i.addAttribute(a,c);for(let[d,l]of t.structIterator()){let u=r[d];if(u!=null){if(l.getMergedTraits().xmlAttribute){i.addAttribute(l.getMergedTraits().xmlName??d,this.writeSimple(l,u));continue}if(l.isListSchema())this.writeList(l,u,i,c);else if(l.isMapSchema())this.writeMap(l,u,i,c);else if(l.isStructSchema())i.addChildNode(this.writeStruct(l,u,c));else{let m=Tt.XmlNode.of(l.getMergedTraits().xmlName??l.getMemberName());this.writeSimpleInto(l,u,m,c),i.addChildNode(m)}}}return i}writeList(t,r,n,s){if(!t.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${t.getName(!0)}`);let o=t.getMergedTraits(),i=t.getValueSchema(),a=i.getMergedTraits(),c=!!a.sparse,d=!!o.xmlFlattened,[l,u]=this.getXmlnsAttribute(t,s),m=(p,h)=>{if(i.isListSchema())this.writeList(i,Array.isArray(h)?h:[h],p,u);else if(i.isMapSchema())this.writeMap(i,h,p,u);else if(i.isStructSchema()){let y=this.writeStruct(i,h,u);p.addChildNode(y.withName(d?o.xmlName??t.getMemberName():a.xmlName??"member"))}else{let y=Tt.XmlNode.of(d?o.xmlName??t.getMemberName():a.xmlName??"member");this.writeSimpleInto(i,h,y,u),p.addChildNode(y)}};if(d)for(let p of r)(c||p!=null)&&m(n,p);else{let p=Tt.XmlNode.of(o.xmlName??t.getMemberName());u&&p.addAttribute(l,u);for(let h of r)(c||h!=null)&&m(p,h);n.addChildNode(p)}}writeMap(t,r,n,s,o=!1){if(!t.isMemberSchema())throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${t.getName(!0)}`);let i=t.getMergedTraits(),a=t.getKeySchema(),d=a.getMergedTraits().xmlName??"key",l=t.getValueSchema(),u=l.getMergedTraits(),m=u.xmlName??"value",p=!!u.sparse,h=!!i.xmlFlattened,[y,_]=this.getXmlnsAttribute(t,s),w=(E,B,T)=>{let A=Tt.XmlNode.of(d,B),[H,Z]=this.getXmlnsAttribute(a,_);Z&&A.addAttribute(H,Z),E.addChildNode(A);let V=Tt.XmlNode.of(m);l.isListSchema()?this.writeList(l,T,V,_):l.isMapSchema()?this.writeMap(l,T,V,_,!0):l.isStructSchema()?V=this.writeStruct(l,T,_):this.writeSimpleInto(l,T,V,_),E.addChildNode(V)};if(h){for(let[E,B]of Object.entries(r))if(p||B!=null){let T=Tt.XmlNode.of(i.xmlName??t.getMemberName());w(T,E,B),n.addChildNode(T)}}else{let E;o||(E=Tt.XmlNode.of(i.xmlName??t.getMemberName()),_&&E.addAttribute(y,_),n.addChildNode(E));for(let[B,T]of Object.entries(r))if(p||T!=null){let A=Tt.XmlNode.of("entry");w(A,B,T),(o?n:E).addChildNode(A)}}}writeSimple(t,r){if(r===null)throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");let n=G.of(t),s=null;if(r&&typeof r=="object")if(n.isBlobSchema())s=(this.serdeContext?.base64Encoder??gd.toBase64)(r);else if(n.isTimestampSchema()&&r instanceof Date){let o=this.settings.timestampFormat;switch(o.useTrait?n.getSchema()===U.TIMESTAMP_DEFAULT?o.default:n.getSchema()??o.default:o.default){case U.TIMESTAMP_DATE_TIME:s=r.toISOString().replace(".000Z","Z");break;case U.TIMESTAMP_HTTP_DATE:s=(0,hf.dateToUtcString)(r);break;case U.TIMESTAMP_EPOCH_SECONDS:s=String(r.getTime()/1e3);break;default:console.warn("Missing timestamp format, using http date",r),s=(0,hf.dateToUtcString)(r);break}}else{if(n.isBigDecimalSchema()&&r)return r instanceof Fe?r.string:String(r);throw n.isMapSchema()||n.isListSchema()?new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."):new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${n.getName(!0)}`)}if((n.isStringSchema()||n.isBooleanSchema()||n.isNumericSchema()||n.isBigIntegerSchema()||n.isBigDecimalSchema())&&(s=String(r)),s===null)throw new Error(`Unhandled schema-value pair ${n.getName(!0)}=${r}`);return s}writeSimpleInto(t,r,n,s){let o=this.writeSimple(t,r),i=G.of(t),a=new Tt.XmlText(o),[c,d]=this.getXmlnsAttribute(i,s);d&&n.addAttribute(c,d),n.addChildNode(a)}getXmlnsAttribute(t,r){let n=t.getMergedTraits(),[s,o]=n.xmlNamespace??[];return o&&o!==r?[s?`xmlns:${s}`:"xmlns",o]:[void 0,void 0]}}});var Di,_f=C(()=>{rn();ld();yf();Di=class extends We{settings;constructor(t){super(),this.settings=t}createSerializer(){let t=new Oi(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){let t=new ys(this.settings);return t.setSerdeContext(this.serdeContext),t}}});var Z0,vf,K0=C(()=>{vr();xe();Z0=P(Ei());gf();_f();vf=class extends ts{codec;serializer;deserializer;constructor(t){super(t);let r={timestampFormat:{useTrait:!0,default:U.TIMESTAMP_DATE_TIME},httpBindings:!0,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace};this.codec=new Di(r),this.serializer=new is(this.codec.createSerializer(),r),this.deserializer=new os(this.codec.createDeserializer(),r)}getPayloadCodec(){return this.codec}getShapeId(){return"aws.protocols#restXml"}async serializeRequest(t,r,n){let s=await super.serializeRequest(t,r,n),o=G.of(t.input),i=o.getMemberSchemas();if(s.path=String(s.path).split("/").filter(a=>a!=="{Bucket}").join("/")||"/",!s.headers["content-type"]){let a=Object.values(i).find(c=>!!c.getMergedTraits().httpPayload);if(a){let c=a.getMergedTraits().mediaType;c?s.headers["content-type"]=c:a.isStringSchema()?s.headers["content-type"]="text/plain":a.isBlobSchema()?s.headers["content-type"]="application/octet-stream":s.headers["content-type"]="application/xml"}else o.isUnitSchema()||Object.values(i).find(d=>{let{httpQuery:l,httpQueryParams:u,httpHeader:m,httpLabel:p,httpPrefixHeaders:h}=d.getMergedTraits();return!l&&!u&&!m&&!p&&h===void 0})&&(s.headers["content-type"]="application/xml")}if(s.headers["content-type"]==="application/xml"&&typeof s.body=="string"&&(s.body='<?xml version="1.0" encoding="UTF-8"?>'+s.body),s.body)try{s.headers["content-length"]=String((0,Z0.calculateBodyLength)(s.body))}catch{}return s}async deserializeResponse(t,r,n){return super.deserializeResponse(t,r,n)}async handleError(t,r,n,s,o){let i=ff(n,s)??"Unknown",a=this.options.defaultNamespace,c=i;i.includes("#")&&([a,c]=i.split("#"));let d=ue.for(a),l;try{l=d.getSchema(i)}catch{let _=ue.for("smithy.ts.sdk.synthetic."+a).getBaseException();if(_){let w=_.ctor;throw Object.assign(new w(c),s)}throw new Error(c)}let u=G.of(l),m=s.Error?.message??s.Error?.Message??s.message??s.Message??"Unknown",p=new l.ctor(m);await this.deserializeHttpMessage(l,r,n,s);let h={};for(let[y,_]of u.structIterator()){let w=_.getMergedTraits().xmlName??y,E=s.Error?.[w]??s[w];h[y]=this.codec.createDeserializer().readSchema(_,E)}throw Object.assign(p,{$metadata:o,$response:n,$fault:u.getMergedTraits().error,message:m,...h}),p}}});var J0=C(()=>{TC();KC();JC();cd();QC();ad();Jp();Yp();e0();bi();U0();uf();K0();_f();ld();yf();gf()});var tr={};dt(tr,{AWSSDKSigV4Signer:()=>Ep,AwsEc2QueryProtocol:()=>mf,AwsJson1_0Protocol:()=>Qp,AwsJson1_1Protocol:()=>Xp,AwsJsonRpcProtocol:()=>gs,AwsQueryProtocol:()=>Ii,AwsRestJsonProtocol:()=>ef,AwsRestXmlProtocol:()=>vf,AwsSdkSigV4ASigner:()=>Si,AwsSdkSigV4Signer:()=>ot,JsonCodec:()=>fs,JsonShapeDeserializer:()=>wi,JsonShapeSerializer:()=>Ti,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:()=>oo,NODE_SIGV4A_CONFIG_OPTIONS:()=>qE,XmlCodec:()=>Di,XmlShapeDeserializer:()=>ys,XmlShapeSerializer:()=>Oi,_toBool:()=>G$,_toNum:()=>V$,_toStr:()=>q$,awsExpectUnion:()=>U2,emitWarningIfUnsupportedVersion:()=>ro,getBearerTokenEnvKey:()=>Wc,loadRestJsonErrorCode:()=>ps,loadRestXmlErrorCode:()=>ff,parseJsonBody:()=>co,parseJsonErrorBody:()=>Kp,parseXmlBody:()=>Ai,parseXmlErrorBody:()=>pf,resolveAWSSDKSigV4Config:()=>EC,resolveAwsSdkSigV4AConfig:()=>HE,resolveAwsSdkSigV4Config:()=>us,setCredentialFeature:()=>Xr,setFeature:()=>xE,setTokenFeature:()=>AE,state:()=>Vc,validateSigningProperties:()=>so});var Ne=C(()=>{Bt();jp();J0()});var lo=b((zae,cb)=>{"use strict";var yd=Object.defineProperty,rH=Object.getOwnPropertyDescriptor,nH=Object.getOwnPropertyNames,sH=Object.prototype.hasOwnProperty,Cr=(e,t)=>yd(e,"name",{value:t,configurable:!0}),oH=(e,t)=>{for(var r in t)yd(e,r,{get:t[r],enumerable:!0})},iH=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of nH(t))!sH.call(e,s)&&s!==r&&yd(e,s,{get:()=>t[s],enumerable:!(n=rH(t,s))||n.enumerable});return e},aH=e=>iH(yd({},"__esModule",{value:!0}),e),eb={};oH(eb,{DEFAULT_UA_APP_ID:()=>tb,getUserAgentMiddlewareOptions:()=>ab,getUserAgentPlugin:()=>gH,resolveUserAgentConfig:()=>nb,userAgentMiddleware:()=>ib});cb.exports=aH(eb);var cH=(st(),re(Xs)),tb=void 0;function rb(e){return e===void 0?!0:typeof e=="string"&&e.length<=50}Cr(rb,"isValidUserAgentAppId");function nb(e){let t=(0,cH.normalizeProvider)(e.userAgentAppId??tb),{customUserAgent:r}=e;return Object.assign(e,{customUserAgent:typeof r=="string"?[[r]]:r,userAgentAppId:Cr(async()=>{let n=await t();if(!rb(n)){let s=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console:e.logger;typeof n!="string"?s?.warn("userAgentAppId must be a string or undefined."):n.length>50&&s?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return n},"userAgentAppId")})}Cr(nb,"resolveUserAgentConfig");var dH=to(),lH=ge(),rr=(Ne(),re(tr)),uH=/\d{12}\.ddb/;async function sb(e,t,r){if(r.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&(0,rr.setFeature)(e,"PROTOCOL_RPC_V2_CBOR","M"),typeof t.retryStrategy=="function"){let o=await t.retryStrategy();typeof o.acquireInitialRetryToken=="function"?o.constructor?.name?.includes("Adaptive")?(0,rr.setFeature)(e,"RETRY_MODE_ADAPTIVE","F"):(0,rr.setFeature)(e,"RETRY_MODE_STANDARD","E"):(0,rr.setFeature)(e,"RETRY_MODE_LEGACY","D")}if(typeof t.accountIdEndpointMode=="function"){let o=e.endpointV2;switch(String(o?.url?.hostname).match(uH)&&(0,rr.setFeature)(e,"ACCOUNT_ID_ENDPOINT","O"),await t.accountIdEndpointMode?.()){case"disabled":(0,rr.setFeature)(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":(0,rr.setFeature)(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":(0,rr.setFeature)(e,"ACCOUNT_ID_MODE_REQUIRED","R");break}}let s=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(s?.$source){let o=s;o.accountId&&(0,rr.setFeature)(e,"RESOLVED_ACCOUNT_ID","T");for(let[i,a]of Object.entries(o.$source??{}))(0,rr.setFeature)(e,i,a)}}Cr(sb,"checkFeatures");var Y0="user-agent",Sf="x-amz-user-agent",Q0=" ",Ef="/",mH=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,pH=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,X0="-",fH=1024;function ob(e){let t="";for(let r in e){let n=e[r];if(t.length+n.length+1<=fH){t.length?t+=","+n:t+=n;continue}break}return t}Cr(ob,"encodeFeatures");var ib=Cr(e=>(t,r)=>async n=>{let{request:s}=n;if(!lH.HttpRequest.isInstance(s))return t(n);let{headers:o}=s,i=r?.userAgent?.map(hd)||[],a=(await e.defaultUserAgentProvider()).map(hd);await sb(r,e,n);let c=r;a.push(`m/${ob(Object.assign({},r.__smithy_context?.features,c.__aws_sdk_context?.features))}`);let d=e?.customUserAgent?.map(hd)||[],l=await e.userAgentAppId();l&&a.push(hd([`app/${l}`]));let u=(0,dH.getUserAgentPrefix)(),m=(u?[u]:[]).concat([...a,...i,...d]).join(Q0),p=[...a.filter(h=>h.startsWith("aws-sdk-")),...d].join(Q0);return e.runtime!=="browser"?(p&&(o[Sf]=o[Sf]?`${o[Y0]} ${p}`:p),o[Y0]=m):o[Sf]=m,t({...n,request:s})},"userAgentMiddleware"),hd=Cr(e=>{let t=e[0].split(Ef).map(i=>i.replace(mH,X0)).join(Ef),r=e[1]?.replace(pH,X0),n=t.indexOf(Ef),s=t.substring(0,n),o=t.substring(n+1);return s==="api"&&(o=o.toLowerCase()),[s,o,r].filter(i=>i&&i.length>0).reduce((i,a,c)=>{switch(c){case 0:return a;case 1:return`${i}/${a}`;default:return`${i}#${a}`}},"")},"escapeUserAgent"),ab={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},gH=Cr(e=>({applyToStack:Cr(t=>{t.add(ib(e),ab)},"applyToStack")}),"getUserAgentPlugin")});var db=b(uo=>{"use strict";var hH=(e,t,r)=>{if(t in e){if(e[t]==="true")return!0;if(e[t]==="false")return!1;throw new Error(`Cannot load ${r} "${t}". Expected "true" or "false", got ${e[t]}.`)}},yH=(e,t,r)=>{if(!(t in e))return;let n=parseInt(e[t],10);if(Number.isNaN(n))throw new TypeError(`Cannot load ${r} '${t}'. Expected number, got '${e[t]}'.`);return n};uo.SelectorType=void 0;(function(e){e.ENV="env",e.CONFIG="shared config entry"})(uo.SelectorType||(uo.SelectorType={}));uo.booleanSelector=hH;uo.numberSelector=yH});var nr=b(Ue=>{"use strict";var on=db(),_d=mt(),_H=ds(),mb="AWS_USE_DUALSTACK_ENDPOINT",pb="use_dualstack_endpoint",vH=!1,SH={environmentVariableSelector:e=>on.booleanSelector(e,mb,on.SelectorType.ENV),configFileSelector:e=>on.booleanSelector(e,pb,on.SelectorType.CONFIG),default:!1},fb="AWS_USE_FIPS_ENDPOINT",gb="use_fips_endpoint",EH=!1,CH={environmentVariableSelector:e=>on.booleanSelector(e,fb,on.SelectorType.ENV),configFileSelector:e=>on.booleanSelector(e,gb,on.SelectorType.CONFIG),default:!1},bH=e=>{let{tls:t,endpoint:r,urlParser:n,useDualstackEndpoint:s}=e;return Object.assign(e,{tls:t??!0,endpoint:_d.normalizeProvider(typeof r=="string"?n(r):r),isCustomEndpoint:!0,useDualstackEndpoint:_d.normalizeProvider(s??!1)})},wH=async e=>{let{tls:t=!0}=e,r=await e.region();if(!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(r))throw new Error("Invalid region in client config");let s=await e.useDualstackEndpoint(),o=await e.useFipsEndpoint(),{hostname:i}=await e.regionInfoProvider(r,{useDualstackEndpoint:s,useFipsEndpoint:o})??{};if(!i)throw new Error("Cannot resolve hostname from client config");return e.urlParser(`${t?"https:":"http:"}//${i}`)},TH=e=>{let t=_d.normalizeProvider(e.useDualstackEndpoint??!1),{endpoint:r,useFipsEndpoint:n,urlParser:s,tls:o}=e;return Object.assign(e,{tls:o??!0,endpoint:r?_d.normalizeProvider(typeof r=="string"?s(r):r):()=>wH({...e,useDualstackEndpoint:t,useFipsEndpoint:n}),isCustomEndpoint:!!r,useDualstackEndpoint:t})},hb="AWS_REGION",yb="region",PH={environmentVariableSelector:e=>e[hb],configFileSelector:e=>e[yb],default:()=>{throw new Error("Region is missing")}},xH={preferredFile:"credentials"},lb=new Set,IH=(e,t=_H.isValidHostLabel)=>{if(!lb.has(e)&&!t(e))if(e==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw new Error(`Region not accepted: region="${e}" is not a valid hostname component.`);else lb.add(e)},_b=e=>typeof e=="string"&&(e.startsWith("fips-")||e.endsWith("-fips")),AH=e=>_b(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e,OH=e=>{let{region:t,useFipsEndpoint:r}=e;if(!t)throw new Error("Region is missing");return Object.assign(e,{region:async()=>{let n=typeof t=="function"?await t():t,s=AH(n);return IH(s),s},useFipsEndpoint:async()=>{let n=typeof t=="string"?t:await t();return _b(n)?!0:typeof r!="function"?Promise.resolve(!!r):r()}})},ub=(e=[],{useFipsEndpoint:t,useDualstackEndpoint:r})=>e.find(({tags:n})=>t===n.includes("fips")&&r===n.includes("dualstack"))?.hostname,DH=(e,{regionHostname:t,partitionHostname:r})=>t||(r?r.replace("{region}",e):void 0),RH=(e,{partitionHash:t})=>Object.keys(t||{}).find(r=>t[r].regions.includes(e))??"aws",NH=(e,{signingRegion:t,regionRegex:r,useFipsEndpoint:n})=>{if(t)return t;if(n){let s=r.replace("\\\\","\\").replace(/^\^/g,"\\.").replace(/\$$/g,"\\."),o=e.match(s);if(o)return o[0].slice(1,-1)}},LH=(e,{useFipsEndpoint:t=!1,useDualstackEndpoint:r=!1,signingService:n,regionHash:s,partitionHash:o})=>{let i=RH(e,{partitionHash:o}),a=e in s?e:o[i]?.endpoint??e,c={useFipsEndpoint:t,useDualstackEndpoint:r},d=ub(s[a]?.variants,c),l=ub(o[i]?.variants,c),u=DH(a,{regionHostname:d,partitionHostname:l});if(u===void 0)throw new Error(`Endpoint resolution failed for: ${{resolvedRegion:a,useFipsEndpoint:t,useDualstackEndpoint:r}}`);let m=NH(u,{signingRegion:s[a]?.signingRegion,regionRegex:o[i].regionRegex,useFipsEndpoint:t});return{partition:i,signingService:n,hostname:u,...m&&{signingRegion:m},...s[a]?.signingService&&{signingService:s[a].signingService}}};Ue.CONFIG_USE_DUALSTACK_ENDPOINT=pb;Ue.CONFIG_USE_FIPS_ENDPOINT=gb;Ue.DEFAULT_USE_DUALSTACK_ENDPOINT=vH;Ue.DEFAULT_USE_FIPS_ENDPOINT=EH;Ue.ENV_USE_DUALSTACK_ENDPOINT=mb;Ue.ENV_USE_FIPS_ENDPOINT=fb;Ue.NODE_REGION_CONFIG_FILE_OPTIONS=xH;Ue.NODE_REGION_CONFIG_OPTIONS=PH;Ue.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS=SH;Ue.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS=CH;Ue.REGION_ENV_NAME=hb;Ue.REGION_INI_NAME=yb;Ue.getRegionInfo=LH;Ue.resolveCustomEndpointsConfig=bH;Ue.resolveEndpointsConfig=TH;Ue.resolveRegionConfig=OH});var Eb=b((Gae,Sb)=>{var vd=Object.defineProperty,kH=Object.getOwnPropertyDescriptor,MH=Object.getOwnPropertyNames,FH=Object.prototype.hasOwnProperty,jH=(e,t)=>vd(e,"name",{value:t,configurable:!0}),UH=(e,t)=>{for(var r in t)vd(e,r,{get:t[r],enumerable:!0})},BH=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of MH(t))!FH.call(e,s)&&s!==r&&vd(e,s,{get:()=>t[s],enumerable:!(n=kH(t,s))||n.enumerable});return e},$H=e=>BH(vd({},"__esModule",{value:!0}),e),vb={};UH(vb,{resolveEventStreamSerdeConfig:()=>zH});Sb.exports=$H(vb);var zH=jH(e=>Object.assign(e,{eventStreamMarshaller:e.eventStreamSerdeProvider(e)}),"resolveEventStreamSerdeConfig")});var Ri=b((Vae,Pb)=>{var Sd=Object.defineProperty,HH=Object.getOwnPropertyDescriptor,qH=Object.getOwnPropertyNames,GH=Object.prototype.hasOwnProperty,bb=(e,t)=>Sd(e,"name",{value:t,configurable:!0}),VH=(e,t)=>{for(var r in t)Sd(e,r,{get:t[r],enumerable:!0})},WH=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of qH(t))!GH.call(e,s)&&s!==r&&Sd(e,s,{get:()=>t[s],enumerable:!(n=HH(t,s))||n.enumerable});return e},ZH=e=>WH(Sd({},"__esModule",{value:!0}),e),wb={};VH(wb,{contentLengthMiddleware:()=>Cf,contentLengthMiddlewareOptions:()=>Tb,getContentLengthPlugin:()=>JH});Pb.exports=ZH(wb);var KH=ge(),Cb="content-length";function Cf(e){return t=>async r=>{let n=r.request;if(KH.HttpRequest.isInstance(n)){let{body:s,headers:o}=n;if(s&&Object.keys(o).map(i=>i.toLowerCase()).indexOf(Cb)===-1)try{let i=e(s);n.headers={...n.headers,[Cb]:String(i)}}catch{}}return t({...r,request:n})}}bb(Cf,"contentLengthMiddleware");var Tb={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},JH=bb(e=>({applyToStack:t=>{t.add(Cf(e.bodyLengthChecker),Tb)}}),"getContentLengthPlugin")});var wf=b(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.getHomeDir=void 0;var YH=require("os"),QH=require("path"),bf={},XH=()=>process&&process.geteuid?`${process.geteuid()}`:"DEFAULT",eq=()=>{let{HOME:e,USERPROFILE:t,HOMEPATH:r,HOMEDRIVE:n=`C:${QH.sep}`}=process.env;if(e)return e;if(t)return t;if(r)return`${n}${r}`;let s=XH();return bf[s]||(bf[s]=(0,YH.homedir)()),bf[s]};Ed.getHomeDir=eq});var Tf=b(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.getSSOTokenFilepath=void 0;var tq=require("crypto"),rq=require("path"),nq=wf(),sq=e=>{let r=(0,tq.createHash)("sha1").update(e).digest("hex");return(0,rq.join)((0,nq.getHomeDir)(),".aws","sso","cache",`${r}.json`)};Cd.getSSOTokenFilepath=sq});var xb=b(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.getSSOTokenFromFile=an.tokenIntercept=void 0;var oq=require("fs/promises"),iq=Tf();an.tokenIntercept={};var aq=async e=>{if(an.tokenIntercept[e])return an.tokenIntercept[e];let t=(0,iq.getSSOTokenFilepath)(e),r=await(0,oq.readFile)(t,"utf8");return JSON.parse(r)};an.getSSOTokenFromFile=aq});var Ib=b(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.readFile=ft.fileIntercept=ft.filePromises=void 0;var cq=require("node:fs/promises");ft.filePromises={};ft.fileIntercept={};var dq=(e,t)=>ft.fileIntercept[e]!==void 0?ft.fileIntercept[e]:((!ft.filePromises[e]||t?.ignoreCache)&&(ft.filePromises[e]=(0,cq.readFile)(e,"utf8")),ft.filePromises[e]);ft.readFile=dq});var cn=b(et=>{"use strict";var Ni=wf(),Ab=Tf(),Pf=xb(),bd=require("path"),wd=qr(),mo=Ib(),Db="AWS_PROFILE",Rb="default",lq=e=>e.profile||process.env[Db]||Rb,_s=".",uq=e=>Object.entries(e).filter(([t])=>{let r=t.indexOf(_s);return r===-1?!1:Object.values(wd.IniSectionType).includes(t.substring(0,r))}).reduce((t,[r,n])=>{let s=r.indexOf(_s),o=r.substring(0,s)===wd.IniSectionType.PROFILE?r.substring(s+1):r;return t[o]=n,t},{...e.default&&{default:e.default}}),mq="AWS_CONFIG_FILE",Nb=()=>process.env[mq]||bd.join(Ni.getHomeDir(),".aws","config"),pq="AWS_SHARED_CREDENTIALS_FILE",fq=()=>process.env[pq]||bd.join(Ni.getHomeDir(),".aws","credentials"),gq=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,hq=["__proto__","profile __proto__"],xf=e=>{let t={},r,n;for(let s of e.split(/\r?\n/)){let o=s.split(/(^|\s)[;#]/)[0].trim();if(o[0]==="["&&o[o.length-1]==="]"){r=void 0,n=void 0;let a=o.substring(1,o.length-1),c=gq.exec(a);if(c){let[,d,,l]=c;Object.values(wd.IniSectionType).includes(d)&&(r=[d,l].join(_s))}else r=a;if(hq.includes(a))throw new Error(`Found invalid profile name "${a}"`)}else if(r){let a=o.indexOf("=");if(![0,-1].includes(a)){let[c,d]=[o.substring(0,a).trim(),o.substring(a+1).trim()];if(d==="")n=c;else{n&&s.trimStart()===s&&(n=void 0),t[r]=t[r]||{};let l=n?[n,c].join(_s):c;t[r][l]=d}}}}return t},Ob=()=>({}),Lb=async(e={})=>{let{filepath:t=fq(),configFilepath:r=Nb()}=e,n=Ni.getHomeDir(),s="~/",o=t;t.startsWith(s)&&(o=bd.join(n,t.slice(2)));let i=r;r.startsWith(s)&&(i=bd.join(n,r.slice(2)));let a=await Promise.all([mo.readFile(i,{ignoreCache:e.ignoreCache}).then(xf).then(uq).catch(Ob),mo.readFile(o,{ignoreCache:e.ignoreCache}).then(xf).catch(Ob)]);return{configFile:a[0],credentialsFile:a[1]}},yq=e=>Object.entries(e).filter(([t])=>t.startsWith(wd.IniSectionType.SSO_SESSION+_s)).reduce((t,[r,n])=>({...t,[r.substring(r.indexOf(_s)+1)]:n}),{}),_q=()=>({}),vq=async(e={})=>mo.readFile(e.configFilepath??Nb()).then(xf).then(yq).catch(_q),Sq=(...e)=>{let t={};for(let r of e)for(let[n,s]of Object.entries(r))t[n]!==void 0?Object.assign(t[n],s):t[n]=s;return t},Eq=async e=>{let t=await Lb(e);return Sq(t.configFile,t.credentialsFile)},Cq={getFileRecord(){return mo.fileIntercept},interceptFile(e,t){mo.fileIntercept[e]=Promise.resolve(t)},getTokenRecord(){return Pf.tokenIntercept},interceptToken(e,t){Pf.tokenIntercept[e]=t}};Object.defineProperty(et,"getSSOTokenFromFile",{enumerable:!0,get:function(){return Pf.getSSOTokenFromFile}});Object.defineProperty(et,"readFile",{enumerable:!0,get:function(){return mo.readFile}});et.CONFIG_PREFIX_SEPARATOR=_s;et.DEFAULT_PROFILE=Rb;et.ENV_PROFILE=Db;et.externalDataInterceptor=Cq;et.getProfileName=lq;et.loadSharedConfigFiles=Lb;et.loadSsoSessionData=vq;et.parseKnownFiles=Eq;Object.keys(Ni).forEach(function(e){e!=="default"&&!Object.prototype.hasOwnProperty.call(et,e)&&Object.defineProperty(et,e,{enumerable:!0,get:function(){return Ni[e]}})});Object.keys(Ab).forEach(function(e){e!=="default"&&!Object.prototype.hasOwnProperty.call(et,e)&&Object.defineProperty(et,e,{enumerable:!0,get:function(){return Ab[e]}})})});var dn=b(Fb=>{"use strict";var Li=Qe(),kb=cn();function Mb(e){try{let t=new Set(Array.from(e.match(/([A-Z_]){3,}/g)??[]));return t.delete("CONFIG"),t.delete("CONFIG_PREFIX_SEPARATOR"),t.delete("ENV"),[...t].join(", ")}catch{return e}}var bq=(e,t)=>async()=>{try{let r=e(process.env,t);if(r===void 0)throw new Error;return r}catch(r){throw new Li.CredentialsProviderError(r.message||`Not found in ENV: ${Mb(e.toString())}`,{logger:t?.logger})}},wq=(e,{preferredFile:t="config",...r}={})=>async()=>{let n=kb.getProfileName(r),{configFile:s,credentialsFile:o}=await kb.loadSharedConfigFiles(r),i=o[n]||{},a=s[n]||{},c=t==="config"?{...i,...a}:{...a,...i};try{let l=e(c,t==="config"?s:o);if(l===void 0)throw new Error;return l}catch(d){throw new Li.CredentialsProviderError(d.message||`Not found in config files w/ profile [${n}]: ${Mb(e.toString())}`,{logger:r.logger})}},Tq=e=>typeof e=="function",Pq=e=>Tq(e)?async()=>await e():Li.fromStatic(e),xq=({environmentVariableSelector:e,configFileSelector:t,default:r},n={})=>{let{signingName:s,logger:o}=n,i={signingName:s,logger:o};return Li.memoize(Li.chain(bq(e,i),wq(t,n),Pq(r)))};Fb.loadConfig=xq});var $b=b(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.getEndpointUrlConfig=void 0;var jb=cn(),Ub="AWS_ENDPOINT_URL",Bb="endpoint_url",Iq=e=>({environmentVariableSelector:t=>{let r=e.split(" ").map(o=>o.toUpperCase()),n=t[[Ub,...r].join("_")];if(n)return n;let s=t[Ub];if(s)return s},configFileSelector:(t,r)=>{if(r&&t.services){let s=r[["services",t.services].join(jb.CONFIG_PREFIX_SEPARATOR)];if(s){let o=e.split(" ").map(a=>a.toLowerCase()),i=s[[o.join("_"),Bb].join(jb.CONFIG_PREFIX_SEPARATOR)];if(i)return i}}let n=t[Bb];if(n)return n},default:void 0});Td.getEndpointUrlConfig=Iq});var If=b(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.getEndpointFromConfig=void 0;var Aq=dn(),Oq=$b(),Dq=async e=>(0,Aq.loadConfig)((0,Oq.getEndpointUrlConfig)(e??""))();Pd.getEndpointFromConfig=Dq});var Gb=b((tce,qb)=>{var xd=Object.defineProperty,Rq=Object.getOwnPropertyDescriptor,Nq=Object.getOwnPropertyNames,Lq=Object.prototype.hasOwnProperty,kq=(e,t)=>xd(e,"name",{value:t,configurable:!0}),Mq=(e,t)=>{for(var r in t)xd(e,r,{get:t[r],enumerable:!0})},Fq=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Nq(t))!Lq.call(e,s)&&s!==r&&xd(e,s,{get:()=>t[s],enumerable:!(n=Rq(t,s))||n.enumerable});return e},jq=e=>Fq(xd({},"__esModule",{value:!0}),e),zb={};Mq(zb,{parseQueryString:()=>Hb});qb.exports=jq(zb);function Hb(e){let t={};if(e=e.replace(/^\?/,""),e)for(let r of e.split("&")){let[n,s=null]=r.split("=");n=decodeURIComponent(n),s&&(s=decodeURIComponent(s)),n in t?Array.isArray(t[n])?t[n].push(s):t[n]=[t[n],s]:t[n]=s}return t}kq(Hb,"parseQueryString")});var vs=b((rce,Zb)=>{var Id=Object.defineProperty,Uq=Object.getOwnPropertyDescriptor,Bq=Object.getOwnPropertyNames,$q=Object.prototype.hasOwnProperty,zq=(e,t)=>Id(e,"name",{value:t,configurable:!0}),Hq=(e,t)=>{for(var r in t)Id(e,r,{get:t[r],enumerable:!0})},qq=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Bq(t))!$q.call(e,s)&&s!==r&&Id(e,s,{get:()=>t[s],enumerable:!(n=Uq(t,s))||n.enumerable});return e},Gq=e=>qq(Id({},"__esModule",{value:!0}),e),Vb={};Hq(Vb,{parseUrl:()=>Wb});Zb.exports=Gq(Vb);var Vq=Gb(),Wb=zq(e=>{if(typeof e=="string")return Wb(new URL(e));let{hostname:t,pathname:r,port:n,protocol:s,search:o}=e,i;return o&&(i=(0,Vq.parseQueryString)(o)),{hostname:t,port:n?parseInt(n):void 0,protocol:s,path:r,query:i}},"parseUrl")});var ln=b((nce,tw)=>{var Od=Object.defineProperty,Wq=Object.getOwnPropertyDescriptor,Zq=Object.getOwnPropertyNames,Kq=Object.prototype.hasOwnProperty,Pt=(e,t)=>Od(e,"name",{value:t,configurable:!0}),Jq=(e,t)=>{for(var r in t)Od(e,r,{get:t[r],enumerable:!0})},Yq=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Zq(t))!Kq.call(e,s)&&s!==r&&Od(e,s,{get:()=>t[s],enumerable:!(n=Wq(t,s))||n.enumerable});return e},Qq=e=>Yq(Od({},"__esModule",{value:!0}),e),Jb={};Jq(Jb,{endpointMiddleware:()=>Xb,endpointMiddlewareOptions:()=>ew,getEndpointFromInstructions:()=>Yb,getEndpointPlugin:()=>d4,resolveEndpointConfig:()=>u4,resolveEndpointRequiredConfig:()=>m4,resolveParams:()=>Qb,toEndpointV1:()=>Af});tw.exports=Qq(Jb);var Xq=Pt(async e=>{let t=e?.Bucket||"";if(typeof e.Bucket=="string"&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),s4(t)){if(e.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!n4(t)||t.indexOf(".")!==-1&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e},"resolveParamsForS3"),e4=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,t4=/(\d+\.){3}\d+/,r4=/\.\./,n4=Pt(e=>e4.test(e)&&!t4.test(e)&&!r4.test(e),"isDnsCompatibleBucketName"),s4=Pt(e=>{let[t,r,n,,,s]=e.split(":"),o=t==="arn"&&e.split(":").length>=6,i=!!(o&&r&&n&&s);if(o&&!i)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return i},"isArnBucketName"),o4=Pt((e,t,r)=>{let n=Pt(async()=>{let s=r[e]??r[t];return typeof s=="function"?s():s},"configProvider");return e==="credentialScope"||t==="CredentialScope"?async()=>{let s=typeof r.credentials=="function"?await r.credentials():r.credentials;return s?.credentialScope??s?.CredentialScope}:e==="accountId"||t==="AccountId"?async()=>{let s=typeof r.credentials=="function"?await r.credentials():r.credentials;return s?.accountId??s?.AccountId}:e==="endpoint"||t==="endpoint"?async()=>{if(r.isCustomEndpoint===!1)return;let s=await n();if(s&&typeof s=="object"){if("url"in s)return s.url.href;if("hostname"in s){let{protocol:o,hostname:i,port:a,path:c}=s;return`${o}//${i}${a?":"+a:""}${c}`}}return s}:n},"createConfigValueProvider"),i4=If(),Kb=vs(),Af=Pt(e=>typeof e=="object"?"url"in e?(0,Kb.parseUrl)(e.url):e:(0,Kb.parseUrl)(e),"toEndpointV1"),Yb=Pt(async(e,t,r,n)=>{if(!r.isCustomEndpoint){let i;r.serviceConfiguredEndpoint?i=await r.serviceConfiguredEndpoint():i=await(0,i4.getEndpointFromConfig)(r.serviceId),i&&(r.endpoint=()=>Promise.resolve(Af(i)),r.isCustomEndpoint=!0)}let s=await Qb(e,t,r);if(typeof r.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");return r.endpointProvider(s,n)},"getEndpointFromInstructions"),Qb=Pt(async(e,t,r)=>{let n={},s=t?.getEndpointParameterInstructions?.()||{};for(let[o,i]of Object.entries(s))switch(i.type){case"staticContextParams":n[o]=i.value;break;case"contextParams":n[o]=e[i.name];break;case"clientContextParams":case"builtInParams":n[o]=await o4(i.name,o,r)();break;case"operationContextParams":n[o]=i.get(e);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(i))}return Object.keys(s).length===0&&Object.assign(n,r),String(r.serviceId).toLowerCase()==="s3"&&await Xq(n),n},"resolveParams"),a4=(st(),re(Xs)),Ad=mt(),Xb=Pt(({config:e,instructions:t})=>(r,n)=>async s=>{e.isCustomEndpoint&&(0,a4.setFeature)(n,"ENDPOINT_OVERRIDE","N");let o=await Yb(s.input,{getEndpointParameterInstructions(){return t}},{...e},n);n.endpointV2=o,n.authSchemes=o.properties?.authSchemes;let i=n.authSchemes?.[0];if(i){n.signing_region=i.signingRegion,n.signing_service=i.signingName;let c=(0,Ad.getSmithyContext)(n)?.selectedHttpAuthScheme?.httpAuthOption;c&&(c.signingProperties=Object.assign(c.signingProperties||{},{signing_region:i.signingRegion,signingRegion:i.signingRegion,signing_service:i.signingName,signingName:i.signingName,signingRegionSet:i.signingRegionSet},i.properties))}return r({...s})},"endpointMiddleware"),c4=Vr(),ew={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:c4.serializerMiddlewareOption.name},d4=Pt((e,t)=>({applyToStack:r=>{r.addRelativeTo(Xb({config:e,instructions:t}),ew)}}),"getEndpointPlugin"),l4=If(),u4=Pt(e=>{let t=e.tls??!0,{endpoint:r,useDualstackEndpoint:n,useFipsEndpoint:s}=e,o=r!=null?async()=>Af(await(0,Ad.normalizeProvider)(r)()):void 0,a=Object.assign(e,{endpoint:o,tls:t,isCustomEndpoint:!!r,useDualstackEndpoint:(0,Ad.normalizeProvider)(n??!1),useFipsEndpoint:(0,Ad.normalizeProvider)(s??!1)}),c;return a.serviceConfiguredEndpoint=async()=>(e.serviceId&&!c&&(c=(0,l4.getEndpointFromConfig)(e.serviceId)),c),a},"resolveEndpointConfig"),m4=Pt(e=>{let{endpoint:t}=e;return t===void 0&&(e.endpoint=async()=>{throw new Error("@smithy/middleware-endpoint: (default endpointRuleSet) endpoint is not set - you must configure an endpoint.")}),e},"resolveEndpointRequiredConfig")});var Df=b((sce,ow)=>{var Dd=Object.defineProperty,p4=Object.getOwnPropertyDescriptor,f4=Object.getOwnPropertyNames,g4=Object.prototype.hasOwnProperty,Ss=(e,t)=>Dd(e,"name",{value:t,configurable:!0}),h4=(e,t)=>{for(var r in t)Dd(e,r,{get:t[r],enumerable:!0})},y4=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of f4(t))!g4.call(e,s)&&s!==r&&Dd(e,s,{get:()=>t[s],enumerable:!(n=p4(t,s))||n.enumerable});return e},_4=e=>y4(Dd({},"__esModule",{value:!0}),e),rw={};h4(rw,{isBrowserNetworkError:()=>sw,isClockSkewCorrectedError:()=>nw,isClockSkewError:()=>P4,isRetryableByTrait:()=>T4,isServerError:()=>I4,isThrottlingError:()=>x4,isTransientError:()=>Of});ow.exports=_4(rw);var v4=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],S4=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],E4=["TimeoutError","RequestTimeout","RequestTimeoutException"],C4=[500,502,503,504],b4=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],w4=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],T4=Ss(e=>e.$retryable!==void 0,"isRetryableByTrait"),P4=Ss(e=>v4.includes(e.name),"isClockSkewError"),nw=Ss(e=>e.$metadata?.clockSkewCorrected,"isClockSkewCorrectedError"),sw=Ss(e=>{let t=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return e&&e instanceof TypeError?t.has(e.message):!1},"isBrowserNetworkError"),x4=Ss(e=>e.$metadata?.httpStatusCode===429||S4.includes(e.name)||e.$retryable?.throttling==!0,"isThrottlingError"),Of=Ss((e,t=0)=>nw(e)||E4.includes(e.name)||b4.includes(e?.code||"")||w4.includes(e?.code||"")||C4.includes(e.$metadata?.httpStatusCode||0)||sw(e)||e.cause!==void 0&&t<=10&&Of(e.cause,t+1),"isTransientError"),I4=Ss(e=>{if(e.$metadata?.httpStatusCode!==void 0){let t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!Of(e)}return!1},"isServerError")});var po=b((oce,gw)=>{var Rd=Object.defineProperty,A4=Object.getOwnPropertyDescriptor,O4=Object.getOwnPropertyNames,D4=Object.prototype.hasOwnProperty,$t=(e,t)=>Rd(e,"name",{value:t,configurable:!0}),R4=(e,t)=>{for(var r in t)Rd(e,r,{get:t[r],enumerable:!0})},N4=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of O4(t))!D4.call(e,s)&&s!==r&&Rd(e,s,{get:()=>t[s],enumerable:!(n=A4(t,s))||n.enumerable});return e},L4=e=>N4(Rd({},"__esModule",{value:!0}),e),aw={};R4(aw,{AdaptiveRetryStrategy:()=>B4,ConfiguredRetryStrategy:()=>$4,DEFAULT_MAX_ATTEMPTS:()=>Rf,DEFAULT_RETRY_DELAY_BASE:()=>ki,DEFAULT_RETRY_MODE:()=>k4,DefaultRateLimiter:()=>dw,INITIAL_RETRY_TOKENS:()=>Nf,INVOCATION_ID_HEADER:()=>F4,MAXIMUM_RETRY_DELAY:()=>Lf,NO_RETRY_INCREMENT:()=>fw,REQUEST_HEADER:()=>j4,RETRY_COST:()=>mw,RETRY_MODES:()=>cw,StandardRetryStrategy:()=>kf,THROTTLING_RETRY_DELAY_BASE:()=>uw,TIMEOUT_RETRY_COST:()=>pw});gw.exports=L4(aw);var cw=(e=>(e.STANDARD="standard",e.ADAPTIVE="adaptive",e))(cw||{}),Rf=3,k4="standard",M4=Df(),dw=class lw{constructor(t){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=t?.beta??.7,this.minCapacity=t?.minCapacity??1,this.minFillRate=t?.minFillRate??.5,this.scaleConstant=t?.scaleConstant??.4,this.smooth=t?.smooth??.8;let r=this.getCurrentTimeInSeconds();this.lastThrottleTime=r,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}static{$t(this,"DefaultRateLimiter")}static{this.setTimeoutFn=setTimeout}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(t){if(this.enabled){if(this.refillTokenBucket(),t>this.currentCapacity){let r=(t-this.currentCapacity)/this.fillRate*1e3;await new Promise(n=>lw.setTimeoutFn(n,r))}this.currentCapacity=this.currentCapacity-t}}refillTokenBucket(){let t=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=t;return}let r=(t-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+r),this.lastTimestamp=t}updateClientSendingRate(t){let r;if(this.updateMeasuredRate(),(0,M4.isThrottlingError)(t)){let s=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=s,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(s),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());let n=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(n)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(t){return this.getPrecise(t*this.beta)}cubicSuccess(t){return this.getPrecise(this.scaleConstant*Math.pow(t-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(t){this.refillTokenBucket(),this.fillRate=Math.max(t,this.minFillRate),this.maxCapacity=Math.max(t,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){let t=this.getCurrentTimeInSeconds(),r=Math.floor(t*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){let n=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(t){return parseFloat(t.toFixed(8))}},ki=100,Lf=20*1e3,uw=500,Nf=500,mw=5,pw=10,fw=1,F4="amz-sdk-invocation-id",j4="amz-sdk-request",U4=$t(()=>{let e=ki;return{computeNextBackoffDelay:$t(n=>Math.floor(Math.min(Lf,Math.random()*2**n*e)),"computeNextBackoffDelay"),setDelayBase:$t(n=>{e=n},"setDelayBase")}},"getDefaultRetryBackoffStrategy"),iw=$t(({retryDelay:e,retryCount:t,retryCost:r})=>({getRetryCount:$t(()=>t,"getRetryCount"),getRetryDelay:$t(()=>Math.min(Lf,e),"getRetryDelay"),getRetryCost:$t(()=>r,"getRetryCost")}),"createDefaultRetryToken"),kf=class{constructor(e){this.maxAttempts=e,this.mode="standard",this.capacity=Nf,this.retryBackoffStrategy=U4(),this.maxAttemptsProvider=typeof e=="function"?e:async()=>e}static{$t(this,"StandardRetryStrategy")}async acquireInitialRetryToken(e){return iw({retryDelay:ki,retryCount:0})}async refreshRetryTokenForRetry(e,t){let r=await this.getMaxAttempts();if(this.shouldRetry(e,t,r)){let n=t.errorType;this.retryBackoffStrategy.setDelayBase(n==="THROTTLING"?uw:ki);let s=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),o=t.retryAfterHint?Math.max(t.retryAfterHint.getTime()-Date.now()||0,s):s,i=this.getCapacityCost(n);return this.capacity-=i,iw({retryDelay:o,retryCount:e.getRetryCount()+1,retryCost:i})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.max(Nf,this.capacity+(e.getRetryCost()??fw))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${Rf}`),Rf}}shouldRetry(e,t,r){return e.getRetryCount()+1<r&&this.capacity>=this.getCapacityCost(t.errorType)&&this.isRetryableError(t.errorType)}getCapacityCost(e){return e==="TRANSIENT"?pw:mw}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}},B4=class{constructor(e,t){this.maxAttemptsProvider=e,this.mode="adaptive";let{rateLimiter:r}=t??{};this.rateLimiter=r??new dw,this.standardRetryStrategy=new kf(e)}static{$t(this,"AdaptiveRetryStrategy")}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}},$4=class extends kf{static{$t(this,"ConfiguredRetryStrategy")}constructor(e,t=ki){super(typeof e=="function"?e:async()=>e),typeof t=="number"?this.computeNextBackoffDelay=()=>t:this.computeNextBackoffDelay=t}async refreshRetryTokenForRetry(e,t){let r=await super.refreshRetryTokenForRetry(e,t);return r.getRetryDelay=()=>this.computeNextBackoffDelay(r.getRetryCount()),r}}});var hw=b(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.isStreamingPayload=void 0;var z4=require("stream"),H4=e=>e?.body instanceof z4.Readable||typeof ReadableStream<"u"&&e?.body instanceof ReadableStream;Nd.isStreamingPayload=H4});var br=b((lce,Dw)=>{var Ld=Object.defineProperty,q4=Object.getOwnPropertyDescriptor,G4=Object.getOwnPropertyNames,V4=Object.prototype.hasOwnProperty,Ie=(e,t)=>Ld(e,"name",{value:t,configurable:!0}),W4=(e,t)=>{for(var r in t)Ld(e,r,{get:t[r],enumerable:!0})},Z4=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of G4(t))!V4.call(e,s)&&s!==r&&Ld(e,s,{get:()=>t[s],enumerable:!(n=q4(t,s))||n.enumerable});return e},K4=e=>Z4(Ld({},"__esModule",{value:!0}),e),_w={};W4(_w,{AdaptiveRetryStrategy:()=>Q4,CONFIG_MAX_ATTEMPTS:()=>Ff,CONFIG_RETRY_MODE:()=>Tw,ENV_MAX_ATTEMPTS:()=>Mf,ENV_RETRY_MODE:()=>ww,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:()=>X4,NODE_RETRY_MODE_CONFIG_OPTIONS:()=>tG,StandardRetryStrategy:()=>bw,defaultDelayDecider:()=>Sw,defaultRetryDecider:()=>Ew,getOmitRetryHeadersPlugin:()=>rG,getRetryAfterHint:()=>Ow,getRetryPlugin:()=>cG,omitRetryHeadersMiddleware:()=>Pw,omitRetryHeadersMiddlewareOptions:()=>xw,resolveRetryConfig:()=>eG,retryMiddleware:()=>Iw,retryMiddlewareOptions:()=>Aw});Dw.exports=K4(_w);var fo=ge(),vw=(Fc(),re(Jm)),Se=po(),J4=Ie((e,t)=>{let r=e,n=t?.noRetryIncrement??Se.NO_RETRY_INCREMENT,s=t?.retryCost??Se.RETRY_COST,o=t?.timeoutRetryCost??Se.TIMEOUT_RETRY_COST,i=e,a=Ie(u=>u.name==="TimeoutError"?o:s,"getCapacityAmount"),c=Ie(u=>a(u)<=i,"hasRetryTokens");return Object.freeze({hasRetryTokens:c,retrieveRetryTokens:Ie(u=>{if(!c(u))throw new Error("No retry token available");let m=a(u);return i-=m,m},"retrieveRetryTokens"),releaseRetryTokens:Ie(u=>{i+=u??n,i=Math.min(i,r)},"releaseRetryTokens")})},"getDefaultRetryQuota"),Sw=Ie((e,t)=>Math.floor(Math.min(Se.MAXIMUM_RETRY_DELAY,Math.random()*2**t*e)),"defaultDelayDecider"),un=Df(),Ew=Ie(e=>e?(0,un.isRetryableByTrait)(e)||(0,un.isClockSkewError)(e)||(0,un.isThrottlingError)(e)||(0,un.isTransientError)(e):!1,"defaultRetryDecider"),Cw=Ie(e=>e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):typeof e=="string"?new Error(e):new Error(`AWS SDK error wrapper for ${e}`),"asSdkError"),bw=class{constructor(e,t){this.maxAttemptsProvider=e,this.mode=Se.RETRY_MODES.STANDARD,this.retryDecider=t?.retryDecider??Ew,this.delayDecider=t?.delayDecider??Sw,this.retryQuota=t?.retryQuota??J4(Se.INITIAL_RETRY_TOKENS)}static{Ie(this,"StandardRetryStrategy")}shouldRetry(e,t,r){return t<r&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)}async getMaxAttempts(){let e;try{e=await this.maxAttemptsProvider()}catch{e=Se.DEFAULT_MAX_ATTEMPTS}return e}async retry(e,t,r){let n,s=0,o=0,i=await this.getMaxAttempts(),{request:a}=t;for(fo.HttpRequest.isInstance(a)&&(a.headers[Se.INVOCATION_ID_HEADER]=(0,vw.v4)());;)try{fo.HttpRequest.isInstance(a)&&(a.headers[Se.REQUEST_HEADER]=`attempt=${s+1}; max=${i}`),r?.beforeRequest&&await r.beforeRequest();let{response:c,output:d}=await e(t);return r?.afterRequest&&r.afterRequest(c),this.retryQuota.releaseRetryTokens(n),d.$metadata.attempts=s+1,d.$metadata.totalRetryDelay=o,{response:c,output:d}}catch(c){let d=Cw(c);if(s++,this.shouldRetry(d,s,i)){n=this.retryQuota.retrieveRetryTokens(d);let l=this.delayDecider((0,un.isThrottlingError)(d)?Se.THROTTLING_RETRY_DELAY_BASE:Se.DEFAULT_RETRY_DELAY_BASE,s),u=Y4(d.$response),m=Math.max(u||0,l);o+=m,await new Promise(p=>setTimeout(p,m));continue}throw d.$metadata||(d.$metadata={}),d.$metadata.attempts=s,d.$metadata.totalRetryDelay=o,d}}},Y4=Ie(e=>{if(!fo.HttpResponse.isInstance(e))return;let t=Object.keys(e.headers).find(o=>o.toLowerCase()==="retry-after");if(!t)return;let r=e.headers[t],n=Number(r);return Number.isNaN(n)?new Date(r).getTime()-Date.now():n*1e3},"getDelayFromRetryAfterHeader"),Q4=class extends bw{static{Ie(this,"AdaptiveRetryStrategy")}constructor(e,t){let{rateLimiter:r,...n}=t??{};super(e,n),this.rateLimiter=r??new Se.DefaultRateLimiter,this.mode=Se.RETRY_MODES.ADAPTIVE}async retry(e,t){return super.retry(e,t,{beforeRequest:async()=>this.rateLimiter.getSendToken(),afterRequest:r=>{this.rateLimiter.updateClientSendingRate(r)}})}},yw=mt(),Mf="AWS_MAX_ATTEMPTS",Ff="max_attempts",X4={environmentVariableSelector:e=>{let t=e[Mf];if(!t)return;let r=parseInt(t);if(Number.isNaN(r))throw new Error(`Environment variable ${Mf} mast be a number, got "${t}"`);return r},configFileSelector:e=>{let t=e[Ff];if(!t)return;let r=parseInt(t);if(Number.isNaN(r))throw new Error(`Shared config file entry ${Ff} mast be a number, got "${t}"`);return r},default:Se.DEFAULT_MAX_ATTEMPTS},eG=Ie(e=>{let{retryStrategy:t,retryMode:r,maxAttempts:n}=e,s=(0,yw.normalizeProvider)(n??Se.DEFAULT_MAX_ATTEMPTS);return Object.assign(e,{maxAttempts:s,retryStrategy:async()=>t||(await(0,yw.normalizeProvider)(r)()===Se.RETRY_MODES.ADAPTIVE?new Se.AdaptiveRetryStrategy(s):new Se.StandardRetryStrategy(s))})},"resolveRetryConfig"),ww="AWS_RETRY_MODE",Tw="retry_mode",tG={environmentVariableSelector:e=>e[ww],configFileSelector:e=>e[Tw],default:Se.DEFAULT_RETRY_MODE},Pw=Ie(()=>e=>async t=>{let{request:r}=t;return fo.HttpRequest.isInstance(r)&&(delete r.headers[Se.INVOCATION_ID_HEADER],delete r.headers[Se.REQUEST_HEADER]),e(t)},"omitRetryHeadersMiddleware"),xw={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},rG=Ie(e=>({applyToStack:t=>{t.addRelativeTo(Pw(),xw)}}),"getOmitRetryHeadersPlugin"),nG=ee(),sG=hw(),Iw=Ie(e=>(t,r)=>async n=>{let s=await e.retryStrategy(),o=await e.maxAttempts();if(oG(s)){s=s;let i=await s.acquireInitialRetryToken(r.partition_id),a=new Error,c=0,d=0,{request:l}=n,u=fo.HttpRequest.isInstance(l);for(u&&(l.headers[Se.INVOCATION_ID_HEADER]=(0,vw.v4)());;)try{u&&(l.headers[Se.REQUEST_HEADER]=`attempt=${c+1}; max=${o}`);let{response:m,output:p}=await t(n);return s.recordSuccess(i),p.$metadata.attempts=c+1,p.$metadata.totalRetryDelay=d,{response:m,output:p}}catch(m){let p=iG(m);if(a=Cw(m),u&&(0,sG.isStreamingPayload)(l))throw(r.logger instanceof nG.NoOpLogger?console:r.logger)?.warn("An error was encountered in a non-retryable streaming request."),a;try{i=await s.refreshRetryTokenForRetry(i,p)}catch{throw a.$metadata||(a.$metadata={}),a.$metadata.attempts=c+1,a.$metadata.totalRetryDelay=d,a}c=i.getRetryCount();let h=i.getRetryDelay();d+=h,await new Promise(y=>setTimeout(y,h))}}else return s=s,s?.mode&&(r.userAgent=[...r.userAgent||[],["cfg/retry-mode",s.mode]]),s.retry(t,n)},"retryMiddleware"),oG=Ie(e=>typeof e.acquireInitialRetryToken<"u"&&typeof e.refreshRetryTokenForRetry<"u"&&typeof e.recordSuccess<"u","isRetryStrategyV2"),iG=Ie(e=>{let t={error:e,errorType:aG(e)},r=Ow(e.$response);return r&&(t.retryAfterHint=r),t},"getRetryErrorInfo"),aG=Ie(e=>(0,un.isThrottlingError)(e)?"THROTTLING":(0,un.isTransientError)(e)?"TRANSIENT":(0,un.isServerError)(e)?"SERVER_ERROR":"CLIENT_ERROR","getRetryErrorType"),Aw={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},cG=Ie(e=>({applyToStack:t=>{t.add(Iw(e),Aw)}}),"getRetryPlugin"),Ow=Ie(e=>{if(!fo.HttpResponse.isInstance(e))return;let t=Object.keys(e.headers).find(o=>o.toLowerCase()==="retry-after");if(!t)return;let r=e.headers[t],n=Number(r);return Number.isNaN(n)?new Date(r):new Date(n*1e3)},"getRetryAfterHint")});var Uf=b(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.resolveHttpAuthSchemeConfig=mn.defaultCloudWatchLogsHttpAuthSchemeProvider=mn.defaultCloudWatchLogsHttpAuthSchemeParametersProvider=void 0;var dG=(Ne(),re(tr)),jf=mt(),lG=async(e,t,r)=>({operation:(0,jf.getSmithyContext)(t).operation,region:await(0,jf.normalizeProvider)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});mn.defaultCloudWatchLogsHttpAuthSchemeParametersProvider=lG;function uG(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"logs",region:e.region},propertiesExtractor:(t,r)=>({signingProperties:{config:t,context:r}})}}var mG=e=>{let t=[];switch(e.operation){default:t.push(uG(e))}return t};mn.defaultCloudWatchLogsHttpAuthSchemeProvider=mG;var pG=e=>{let t=(0,dG.resolveAwsSdkSigV4Config)(e);return Object.assign(t,{authSchemePreference:(0,jf.normalizeProvider)(e.authSchemePreference??[])})};mn.resolveHttpAuthSchemeConfig=pG});var ho={};dt(ho,{__addDisposableResource:()=>rT,__assign:()=>kd,__asyncDelegator:()=>Zw,__asyncGenerator:()=>Ww,__asyncValues:()=>Kw,__await:()=>go,__awaiter:()=>$w,__classPrivateFieldGet:()=>Xw,__classPrivateFieldIn:()=>tT,__classPrivateFieldSet:()=>eT,__createBinding:()=>Fd,__decorate:()=>Lw,__disposeResources:()=>nT,__esDecorate:()=>Mw,__exportStar:()=>Hw,__extends:()=>Rw,__generator:()=>zw,__importDefault:()=>Qw,__importStar:()=>Yw,__makeTemplateObject:()=>Jw,__metadata:()=>Bw,__param:()=>kw,__propKey:()=>jw,__read:()=>zf,__rest:()=>Nw,__rewriteRelativeImportExtension:()=>sT,__runInitializers:()=>Fw,__setFunctionName:()=>Uw,__spread:()=>qw,__spreadArray:()=>Vw,__spreadArrays:()=>Gw,__values:()=>Md,default:()=>hG});function Rw(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Bf(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Nw(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function Lw(e,t,r,n){var s=arguments.length,o=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}function kw(e,t){return function(r,n){t(r,n,e)}}function Mw(e,t,r,n,s,o){function i(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",d=!t&&e?n.static?e:e.prototype:null,l=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),u,m=!1,p=r.length-1;p>=0;p--){var h={};for(var y in n)h[y]=y==="access"?{}:n[y];for(var y in n.access)h.access[y]=n.access[y];h.addInitializer=function(w){if(m)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(w||null))};var _=(0,r[p])(a==="accessor"?{get:l.get,set:l.set}:l[c],h);if(a==="accessor"){if(_===void 0)continue;if(_===null||typeof _!="object")throw new TypeError("Object expected");(u=i(_.get))&&(l.get=u),(u=i(_.set))&&(l.set=u),(u=i(_.init))&&s.unshift(u)}else(u=i(_))&&(a==="field"?s.unshift(u):l[c]=u)}d&&Object.defineProperty(d,n.name,l),m=!0}function Fw(e,t,r){for(var n=arguments.length>2,s=0;s<t.length;s++)r=n?t[s].call(e,r):t[s].call(e);return n?r:void 0}function jw(e){return typeof e=="symbol"?e:"".concat(e)}function Uw(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function Bw(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function $w(e,t,r,n){function s(o){return o instanceof r?o:new r(function(i){i(o)})}return new(r||(r=Promise))(function(o,i){function a(l){try{d(n.next(l))}catch(u){i(u)}}function c(l){try{d(n.throw(l))}catch(u){i(u)}}function d(l){l.done?o(l.value):s(l.value).then(a,c)}d((n=n.apply(e,t||[])).next())})}function zw(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,s,o,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(d){return function(l){return c([d,l])}}function c(d){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,d[0]&&(r=0)),r;)try{if(n=1,s&&(o=d[0]&2?s.return:d[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,d[1])).done)return o;switch(s=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,s=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){r.label=d[1];break}if(d[0]===6&&r.label<o[1]){r.label=o[1],o=d;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(d);break}o[2]&&r.ops.pop(),r.trys.pop();continue}d=t.call(e,r)}catch(l){d=[6,l],s=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Hw(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Fd(t,e,r)}function Md(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function zf(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),s,o=[],i;try{for(;(t===void 0||t-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(a){i={error:a}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return o}function qw(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(zf(arguments[t]));return e}function Gw(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),s=0,t=0;t<r;t++)for(var o=arguments[t],i=0,a=o.length;i<a;i++,s++)n[s]=o[i];return n}function Vw(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}function go(e){return this instanceof go?(this.v=e,this):new go(e)}function Ww(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),s,o=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",i),s[Symbol.asyncIterator]=function(){return this},s;function i(p){return function(h){return Promise.resolve(h).then(p,u)}}function a(p,h){n[p]&&(s[p]=function(y){return new Promise(function(_,w){o.push([p,y,_,w])>1||c(p,y)})},h&&(s[p]=h(s[p])))}function c(p,h){try{d(n[p](h))}catch(y){m(o[0][3],y)}}function d(p){p.value instanceof go?Promise.resolve(p.value.v).then(l,u):m(o[0][2],p)}function l(p){c("next",p)}function u(p){c("throw",p)}function m(p,h){p(h),o.shift(),o.length&&c(o[0][0],o[0][1])}}function Zw(e){var t,r;return t={},n("next"),n("throw",function(s){throw s}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(s,o){t[s]=e[s]?function(i){return(r=!r)?{value:go(e[s](i)),done:!1}:o?o(i):i}:o}}function Kw(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Md=="function"?Md(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(i){return new Promise(function(a,c){i=e[o](i),s(a,c,i.done,i.value)})}}function s(o,i,a,c){Promise.resolve(c).then(function(d){o({value:d,done:a})},i)}}function Jw(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function Yw(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=$f(e),n=0;n<r.length;n++)r[n]!=="default"&&Fd(t,e,r[n]);return fG(t,e),t}function Qw(e){return e&&e.__esModule?e:{default:e}}function Xw(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function eT(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r}function tT(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function rT(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,s;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(s=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this)}catch(o){return Promise.reject(o)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}function nT(e){function t(o){e.error=e.hasError?new gG(o,e.error,"An error was suppressed during disposal."):o,e.hasError=!0}var r,n=0;function s(){for(;r=e.stack.pop();)try{if(!r.async&&n===1)return n=0,e.stack.push(r),Promise.resolve().then(s);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(o).then(s,function(i){return t(i),s()})}else n|=1}catch(i){t(i)}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return s()}function sT(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,s,o,i){return n?t?".jsx":".js":s&&(!o||!i)?r:s+o+"."+i.toLowerCase()+"js"}):e}var Bf,kd,Fd,fG,$f,gG,hG,yo=C(()=>{Bf=function(e,t){return Bf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])},Bf(e,t)};kd=function(){return kd=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},kd.apply(this,arguments)};Fd=Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]};fG=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},$f=function(e){return $f=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},$f(e)};gG=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};hG={__extends:Rw,__assign:kd,__rest:Nw,__decorate:Lw,__param:kw,__esDecorate:Mw,__runInitializers:Fw,__propKey:jw,__setFunctionName:Uw,__metadata:Bw,__awaiter:$w,__generator:zw,__createBinding:Fd,__exportStar:Hw,__values:Md,__read:zf,__spread:qw,__spreadArrays:Gw,__spreadArray:Vw,__await:go,__asyncGenerator:Ww,__asyncDelegator:Zw,__asyncValues:Kw,__makeTemplateObject:Jw,__importStar:Yw,__importDefault:Qw,__classPrivateFieldGet:Xw,__classPrivateFieldSet:eT,__classPrivateFieldIn:tT,__addDisposableResource:rT,__disposeResources:nT,__rewriteRelativeImportExtension:sT}});var oT=b((fce,yG)=>{yG.exports={name:"@aws-sdk/client-cloudwatch-logs",description:"AWS SDK for JavaScript Cloudwatch Logs Client for Node.js, Browser and React Native",version:"3.840.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-cloudwatch-logs","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo cloudwatch-logs"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.840.0","@aws-sdk/credential-provider-node":"3.840.0","@aws-sdk/middleware-host-header":"3.840.0","@aws-sdk/middleware-logger":"3.840.0","@aws-sdk/middleware-recursion-detection":"3.840.0","@aws-sdk/middleware-user-agent":"3.840.0","@aws-sdk/region-config-resolver":"3.840.0","@aws-sdk/types":"3.840.0","@aws-sdk/util-endpoints":"3.840.0","@aws-sdk/util-user-agent-browser":"3.840.0","@aws-sdk/util-user-agent-node":"3.840.0","@smithy/config-resolver":"^4.1.4","@smithy/core":"^3.6.0","@smithy/eventstream-serde-browser":"^4.0.4","@smithy/eventstream-serde-config-resolver":"^4.1.2","@smithy/eventstream-serde-node":"^4.0.4","@smithy/fetch-http-handler":"^5.0.4","@smithy/hash-node":"^4.0.4","@smithy/invalid-dependency":"^4.0.4","@smithy/middleware-content-length":"^4.0.4","@smithy/middleware-endpoint":"^4.1.13","@smithy/middleware-retry":"^4.1.14","@smithy/middleware-serde":"^4.0.8","@smithy/middleware-stack":"^4.0.4","@smithy/node-config-provider":"^4.1.3","@smithy/node-http-handler":"^4.0.6","@smithy/protocol-http":"^5.1.2","@smithy/smithy-client":"^4.4.5","@smithy/types":"^4.3.1","@smithy/url-parser":"^4.0.4","@smithy/util-base64":"^4.0.0","@smithy/util-body-length-browser":"^4.0.0","@smithy/util-body-length-node":"^4.0.0","@smithy/util-defaults-mode-browser":"^4.0.21","@smithy/util-defaults-mode-node":"^4.0.21","@smithy/util-endpoints":"^3.0.6","@smithy/util-middleware":"^4.0.4","@smithy/util-retry":"^4.0.6","@smithy/util-utf8":"^4.0.0","@types/uuid":"^9.0.1",tslib:"^2.6.2",uuid:"^9.0.1"},devDependencies:{"@tsconfig/node18":"18.2.4","@types/node":"^18.19.69",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~5.8.3"},engines:{node:">=18.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudwatch-logs",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-cloudwatch-logs"}}});var Hf=b((gce,pT)=>{"use strict";var jd=Object.defineProperty,_G=Object.getOwnPropertyDescriptor,vG=Object.getOwnPropertyNames,SG=Object.prototype.hasOwnProperty,EG=(e,t)=>jd(e,"name",{value:t,configurable:!0}),CG=(e,t)=>{for(var r in t)jd(e,r,{get:t[r],enumerable:!0})},bG=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of vG(t))!SG.call(e,s)&&s!==r&&jd(e,s,{get:()=>t[s],enumerable:!(n=_G(t,s))||n.enumerable});return e},wG=e=>bG(jd({},"__esModule",{value:!0}),e),iT={};CG(iT,{ENV_ACCOUNT_ID:()=>mT,ENV_CREDENTIAL_SCOPE:()=>uT,ENV_EXPIRATION:()=>lT,ENV_KEY:()=>aT,ENV_SECRET:()=>cT,ENV_SESSION:()=>dT,fromEnv:()=>xG});pT.exports=wG(iT);var TG=(Bt(),re(en)),PG=Qe(),aT="AWS_ACCESS_KEY_ID",cT="AWS_SECRET_ACCESS_KEY",dT="AWS_SESSION_TOKEN",lT="AWS_CREDENTIAL_EXPIRATION",uT="AWS_CREDENTIAL_SCOPE",mT="AWS_ACCOUNT_ID",xG=EG(e=>async()=>{e?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");let t=process.env[aT],r=process.env[cT],n=process.env[dT],s=process.env[lT],o=process.env[uT],i=process.env[mT];if(t&&r){let a={accessKeyId:t,secretAccessKey:r,...n&&{sessionToken:n},...s&&{expiration:new Date(s)},...o&&{credentialScope:o},...i&&{accountId:i}};return(0,TG.setCredentialFeature)(a,"CREDENTIALS_ENV_VARS","g"),a}throw new PG.CredentialsProviderError("Unable to find environment variable credentials.",{logger:e?.logger})},"fromEnv")});var Mi=b((hce,xT)=>{var $d=Object.defineProperty,IG=Object.getOwnPropertyDescriptor,AG=Object.getOwnPropertyNames,OG=Object.prototype.hasOwnProperty,Ae=(e,t)=>$d(e,"name",{value:t,configurable:!0}),DG=(e,t)=>{for(var r in t)$d(e,r,{get:t[r],enumerable:!0})},RG=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of AG(t))!OG.call(e,s)&&s!==r&&$d(e,s,{get:()=>t[s],enumerable:!(n=IG(t,s))||n.enumerable});return e},NG=e=>RG($d({},"__esModule",{value:!0}),e),yT={};DG(yT,{DEFAULT_MAX_RETRIES:()=>ET,DEFAULT_TIMEOUT:()=>ST,ENV_CMDS_AUTH_TOKEN:()=>Vf,ENV_CMDS_FULL_URI:()=>Ud,ENV_CMDS_RELATIVE_URI:()=>Bd,Endpoint:()=>bT,fromContainerMetadata:()=>FG,fromInstanceMetadata:()=>s3,getInstanceMetadataEndpoint:()=>TT,httpRequest:()=>_o,providerConfigFromInit:()=>Wf});xT.exports=NG(yT);var LG=require("url"),sr=Qe(),kG=require("buffer"),MG=require("http");function _o(e){return new Promise((t,r)=>{let n=(0,MG.request)({method:"GET",...e,hostname:e.hostname?.replace(/^\[(.+)\]$/,"$1")});n.on("error",s=>{r(Object.assign(new sr.ProviderError("Unable to connect to instance metadata service"),s)),n.destroy()}),n.on("timeout",()=>{r(new sr.ProviderError("TimeoutError from instance metadata service")),n.destroy()}),n.on("response",s=>{let{statusCode:o=400}=s;(o<200||300<=o)&&(r(Object.assign(new sr.ProviderError("Error response received from instance metadata service"),{statusCode:o})),n.destroy());let i=[];s.on("data",a=>{i.push(a)}),s.on("end",()=>{t(kG.Buffer.concat(i)),n.destroy()})}),n.end()})}Ae(_o,"httpRequest");var _T=Ae(e=>!!e&&typeof e=="object"&&typeof e.AccessKeyId=="string"&&typeof e.SecretAccessKey=="string"&&typeof e.Token=="string"&&typeof e.Expiration=="string","isImdsCredentials"),vT=Ae(e=>({accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:new Date(e.Expiration),...e.AccountId&&{accountId:e.AccountId}}),"fromImdsCredentials"),ST=1e3,ET=0,Wf=Ae(({maxRetries:e=ET,timeout:t=ST})=>({maxRetries:e,timeout:t}),"providerConfigFromInit"),Gf=Ae((e,t)=>{let r=e();for(let n=0;n<t;n++)r=r.catch(e);return r},"retry"),Ud="AWS_CONTAINER_CREDENTIALS_FULL_URI",Bd="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",Vf="AWS_CONTAINER_AUTHORIZATION_TOKEN",FG=Ae((e={})=>{let{timeout:t,maxRetries:r}=Wf(e);return()=>Gf(async()=>{let n=await zG({logger:e.logger}),s=JSON.parse(await jG(t,n));if(!_T(s))throw new sr.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:e.logger});return vT(s)},r)},"fromContainerMetadata"),jG=Ae(async(e,t)=>(process.env[Vf]&&(t.headers={...t.headers,Authorization:process.env[Vf]}),(await _o({...t,timeout:e})).toString()),"requestFromEcsImds"),UG="169.254.170.2",BG={localhost:!0,"127.0.0.1":!0},$G={"http:":!0,"https:":!0},zG=Ae(async({logger:e})=>{if(process.env[Bd])return{hostname:UG,path:process.env[Bd]};if(process.env[Ud]){let t=(0,LG.parse)(process.env[Ud]);if(!t.hostname||!(t.hostname in BG))throw new sr.CredentialsProviderError(`${t.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:e});if(!t.protocol||!(t.protocol in $G))throw new sr.CredentialsProviderError(`${t.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:e});return{...t,port:t.port?parseInt(t.port,10):void 0}}throw new sr.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${Bd} or ${Ud} environment variable is set`,{tryNextLink:!1,logger:e})},"getCmdsUri"),HG=class CT extends sr.CredentialsProviderError{constructor(t,r=!0){super(t,r),this.tryNextLink=r,this.name="InstanceMetadataV1FallbackError",Object.setPrototypeOf(this,CT.prototype)}static{Ae(this,"InstanceMetadataV1FallbackError")}},Zf=dn(),qG=vs(),bT=(e=>(e.IPv4="http://169.254.169.254",e.IPv6="http://[fd00:ec2::254]",e))(bT||{}),GG="AWS_EC2_METADATA_SERVICE_ENDPOINT",VG="ec2_metadata_service_endpoint",WG={environmentVariableSelector:e=>e[GG],configFileSelector:e=>e[VG],default:void 0},wT=(e=>(e.IPv4="IPv4",e.IPv6="IPv6",e))(wT||{}),ZG="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",KG="ec2_metadata_service_endpoint_mode",JG={environmentVariableSelector:e=>e[ZG],configFileSelector:e=>e[KG],default:"IPv4"},TT=Ae(async()=>(0,qG.parseUrl)(await YG()||await QG()),"getInstanceMetadataEndpoint"),YG=Ae(async()=>(0,Zf.loadConfig)(WG)(),"getFromEndpointConfig"),QG=Ae(async()=>{let e=await(0,Zf.loadConfig)(JG)();switch(e){case"IPv4":return"http://169.254.169.254";case"IPv6":return"http://[fd00:ec2::254]";default:throw new Error(`Unsupported endpoint mode: ${e}. Select from ${Object.values(wT)}`)}},"getFromEndpointModeConfig"),XG=5*60,e3=5*60,t3="https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html",fT=Ae((e,t)=>{let r=XG+Math.floor(Math.random()*e3),n=new Date(Date.now()+r*1e3);t.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(n)}.
47
- For more information, please visit: `+t3);let s=e.originalExpiration??e.expiration;return{...e,...s?{originalExpiration:s}:{},expiration:n}},"getExtendedInstanceMetadataCredentials"),r3=Ae((e,t={})=>{let r=t?.logger||console,n;return async()=>{let s;try{s=await e(),s.expiration&&s.expiration.getTime()<Date.now()&&(s=fT(s,r))}catch(o){if(n)r.warn("Credential renew failed: ",o),s=fT(n,r);else throw o}return n=s,s}},"staticStabilityProvider"),PT="/latest/meta-data/iam/security-credentials/",n3="/latest/api/token",qf="AWS_EC2_METADATA_V1_DISABLED",gT="ec2_metadata_v1_disabled",hT="x-aws-ec2-metadata-token",s3=Ae((e={})=>r3(o3(e),{logger:e.logger}),"fromInstanceMetadata"),o3=Ae((e={})=>{let t=!1,{logger:r,profile:n}=e,{timeout:s,maxRetries:o}=Wf(e),i=Ae(async(a,c)=>{if(t||c.headers?.[hT]==null){let u=!1,m=!1,p=await(0,Zf.loadConfig)({environmentVariableSelector:h=>{let y=h[qf];if(m=!!y&&y!=="false",y===void 0)throw new sr.CredentialsProviderError(`${qf} not set in env, checking config file next.`,{logger:e.logger});return m},configFileSelector:h=>{let y=h[gT];return u=!!y&&y!=="false",u},default:!1},{profile:n})();if(e.ec2MetadataV1Disabled||p){let h=[];throw e.ec2MetadataV1Disabled&&h.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"),u&&h.push(`config file profile (${gT})`),m&&h.push(`process environment variable (${qf})`),new HG(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${h.join(", ")}].`)}}let l=(await Gf(async()=>{let u;try{u=await a3(c)}catch(m){throw m.statusCode===401&&(t=!1),m}return u},a)).trim();return Gf(async()=>{let u;try{u=await c3(l,c,e)}catch(m){throw m.statusCode===401&&(t=!1),m}return u},a)},"getCredentials");return async()=>{let a=await TT();if(t)return r?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),i(o,{...a,timeout:s});{let c;try{c=(await i3({...a,timeout:s})).toString()}catch(d){if(d?.statusCode===400)throw Object.assign(d,{message:"EC2 Metadata token request returned error"});return(d.message==="TimeoutError"||[403,404,405].includes(d.statusCode))&&(t=!0),r?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),i(o,{...a,timeout:s})}return i(o,{...a,headers:{[hT]:c},timeout:s})}}},"getInstanceMetadataProvider"),i3=Ae(async e=>_o({...e,path:n3,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),"getMetadataToken"),a3=Ae(async e=>(await _o({...e,path:PT})).toString(),"getProfile"),c3=Ae(async(e,t,r)=>{let n=JSON.parse((await _o({...t,path:PT+e})).toString());if(!_T(n))throw new sr.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:r.logger});return vT(n)},"getCredentialsFromProfile")});var IT=b(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.checkUrl=void 0;var d3=Qe(),l3="169.254.170.2",u3="169.254.170.23",m3="[fd00:ec2::23]",p3=(e,t)=>{if(e.protocol!=="https:"&&!(e.hostname===l3||e.hostname===u3||e.hostname===m3)){if(e.hostname.includes("[")){if(e.hostname==="[::1]"||e.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(e.hostname==="localhost")return;let r=e.hostname.split("."),n=s=>{let o=parseInt(s,10);return 0<=o&&o<=255};if(r[0]==="127"&&n(r[1])&&n(r[2])&&n(r[3])&&r.length===4)return}throw new d3.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following:
48
- - loopback CIDR 127.0.0.0/8 or [::1/128]
49
- - ECS container host 169.254.170.2
50
- - EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:t})}};zd.checkUrl=p3});var AT=b(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.createGetRequest=y3;Hd.getCredentials=_3;var Kf=Qe(),f3=ge(),g3=ee(),h3=wc();function y3(e){return new f3.HttpRequest({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((t,[r,n])=>(t[r]=n,t),{}),fragment:e.hash})}async function _3(e,t){let n=await(0,h3.sdkStreamMixin)(e.body).transformToString();if(e.statusCode===200){let s=JSON.parse(n);if(typeof s.AccessKeyId!="string"||typeof s.SecretAccessKey!="string"||typeof s.Token!="string"||typeof s.Expiration!="string")throw new Kf.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:t});return{accessKeyId:s.AccessKeyId,secretAccessKey:s.SecretAccessKey,sessionToken:s.Token,expiration:(0,g3.parseRfc3339DateTime)(s.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let s={};try{s=JSON.parse(n)}catch{}throw Object.assign(new Kf.CredentialsProviderError(`Server responded with status: ${e.statusCode}`,{logger:t}),{Code:s.Code,Message:s.Message})}throw new Kf.CredentialsProviderError(`Server responded with status: ${e.statusCode}`,{logger:t})}});var OT=b(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.retryWrapper=void 0;var v3=(e,t,r)=>async()=>{for(let n=0;n<t;++n)try{return await e()}catch{await new Promise(o=>setTimeout(o,r))}return await e()};qd.retryWrapper=v3});var NT=b(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.fromHttp=void 0;var S3=(yo(),re(ho)),E3=(Bt(),re(en)),C3=Wn(),DT=Qe(),b3=S3.__importDefault(require("fs/promises")),w3=IT(),RT=AT(),T3=OT(),P3="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",x3="http://169.254.170.2",I3="AWS_CONTAINER_CREDENTIALS_FULL_URI",A3="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",O3="AWS_CONTAINER_AUTHORIZATION_TOKEN",D3=(e={})=>{e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let t,r=e.awsContainerCredentialsRelativeUri??process.env[P3],n=e.awsContainerCredentialsFullUri??process.env[I3],s=e.awsContainerAuthorizationToken??process.env[O3],o=e.awsContainerAuthorizationTokenFile??process.env[A3],i=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console.warn:e.logger.warn;if(r&&n&&(i("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),i("awsContainerCredentialsFullUri will take precedence.")),s&&o&&(i("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),i("awsContainerAuthorizationToken will take precedence.")),n)t=n;else if(r)t=`${x3}${r}`;else throw new DT.CredentialsProviderError(`No HTTP credential provider host provided.
51
- Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:e.logger});let a=new URL(t);(0,w3.checkUrl)(a,e.logger);let c=new C3.NodeHttpHandler({requestTimeout:e.timeout??1e3,connectionTimeout:e.timeout??1e3});return(0,T3.retryWrapper)(async()=>{let d=(0,RT.createGetRequest)(a);s?d.headers.Authorization=s:o&&(d.headers.Authorization=(await b3.default.readFile(o)).toString());try{let l=await c.handle(d);return(0,RT.getCredentials)(l.response).then(u=>(0,E3.setCredentialFeature)(u,"CREDENTIALS_HTTP","z"))}catch(l){throw new DT.CredentialsProviderError(String(l),{logger:e.logger})}},e.maxRetries??3,e.timeout??1e3)};Gd.fromHttp=D3});var Jf=b(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.fromHttp=void 0;var R3=NT();Object.defineProperty(Vd,"fromHttp",{enumerable:!0,get:function(){return R3.fromHttp}})});var Qf=b(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.resolveHttpAuthSchemeConfig=pn.defaultSSOHttpAuthSchemeProvider=pn.defaultSSOHttpAuthSchemeParametersProvider=void 0;var N3=(Ne(),re(tr)),Yf=mt(),L3=async(e,t,r)=>({operation:(0,Yf.getSmithyContext)(t).operation,region:await(0,Yf.normalizeProvider)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});pn.defaultSSOHttpAuthSchemeParametersProvider=L3;function k3(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:e.region},propertiesExtractor:(t,r)=>({signingProperties:{config:t,context:r}})}}function Wd(e){return{schemeId:"smithy.api#noAuth"}}var M3=e=>{let t=[];switch(e.operation){case"GetRoleCredentials":{t.push(Wd(e));break}case"ListAccountRoles":{t.push(Wd(e));break}case"ListAccounts":{t.push(Wd(e));break}case"Logout":{t.push(Wd(e));break}default:t.push(k3(e))}return t};pn.defaultSSOHttpAuthSchemeProvider=M3;var F3=e=>{let t=(0,N3.resolveAwsSdkSigV4Config)(e);return Object.assign(t,{authSchemePreference:(0,Yf.normalizeProvider)(e.authSchemePreference??[])})};pn.resolveHttpAuthSchemeConfig=F3});var LT=b((bce,j3)=>{j3.exports={name:"@aws-sdk/client-sso",description:"AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",version:"3.840.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.840.0","@aws-sdk/middleware-host-header":"3.840.0","@aws-sdk/middleware-logger":"3.840.0","@aws-sdk/middleware-recursion-detection":"3.840.0","@aws-sdk/middleware-user-agent":"3.840.0","@aws-sdk/region-config-resolver":"3.840.0","@aws-sdk/types":"3.840.0","@aws-sdk/util-endpoints":"3.840.0","@aws-sdk/util-user-agent-browser":"3.840.0","@aws-sdk/util-user-agent-node":"3.840.0","@smithy/config-resolver":"^4.1.4","@smithy/core":"^3.6.0","@smithy/fetch-http-handler":"^5.0.4","@smithy/hash-node":"^4.0.4","@smithy/invalid-dependency":"^4.0.4","@smithy/middleware-content-length":"^4.0.4","@smithy/middleware-endpoint":"^4.1.13","@smithy/middleware-retry":"^4.1.14","@smithy/middleware-serde":"^4.0.8","@smithy/middleware-stack":"^4.0.4","@smithy/node-config-provider":"^4.1.3","@smithy/node-http-handler":"^4.0.6","@smithy/protocol-http":"^5.1.2","@smithy/smithy-client":"^4.4.5","@smithy/types":"^4.3.1","@smithy/url-parser":"^4.0.4","@smithy/util-base64":"^4.0.0","@smithy/util-body-length-browser":"^4.0.0","@smithy/util-body-length-node":"^4.0.0","@smithy/util-defaults-mode-browser":"^4.0.21","@smithy/util-defaults-mode-node":"^4.0.21","@smithy/util-endpoints":"^3.0.6","@smithy/util-middleware":"^4.0.4","@smithy/util-retry":"^4.0.6","@smithy/util-utf8":"^4.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node18":"18.2.4","@types/node":"^18.19.69",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~5.8.3"},engines:{node:">=18.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso"}}});var Fi=b((wce,$T)=>{"use strict";var Kd=Object.defineProperty,U3=Object.getOwnPropertyDescriptor,B3=Object.getOwnPropertyNames,$3=Object.prototype.hasOwnProperty,Zd=(e,t)=>Kd(e,"name",{value:t,configurable:!0}),z3=(e,t)=>{for(var r in t)Kd(e,r,{get:t[r],enumerable:!0})},H3=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of B3(t))!$3.call(e,s)&&s!==r&&Kd(e,s,{get:()=>t[s],enumerable:!(n=U3(t,s))||n.enumerable});return e},q3=e=>H3(Kd({},"__esModule",{value:!0}),e),MT={};z3(MT,{NODE_APP_ID_CONFIG_OPTIONS:()=>K3,UA_APP_ID_ENV_NAME:()=>UT,UA_APP_ID_INI_NAME:()=>BT,createDefaultUserAgentProvider:()=>jT,crtAvailability:()=>FT,defaultUserAgent:()=>V3});$T.exports=q3(MT);var kT=require("os"),Xf=require("process"),FT={isCrtAvailable:!1},G3=Zd(()=>FT.isCrtAvailable?["md/crt-avail"]:null,"isCrtAvailable"),jT=Zd(({serviceId:e,clientVersion:t})=>async r=>{let n=[["aws-sdk-js",t],["ua","2.1"],[`os/${(0,kT.platform)()}`,(0,kT.release)()],["lang/js"],["md/nodejs",`${Xf.versions.node}`]],s=G3();s&&n.push(s),e&&n.push([`api/${e}`,t]),Xf.env.AWS_EXECUTION_ENV&&n.push([`exec-env/${Xf.env.AWS_EXECUTION_ENV}`]);let o=await r?.userAgentAppId?.();return o?[...n,[`app/${o}`]]:[...n]},"createDefaultUserAgentProvider"),V3=jT,W3=lo(),UT="AWS_SDK_UA_APP_ID",BT="sdk_ua_app_id",Z3="sdk-ua-app-id",K3={environmentVariableSelector:Zd(e=>e[UT],"environmentVariableSelector"),configFileSelector:Zd(e=>e[BT]??e[Z3],"configFileSelector"),default:W3.DEFAULT_UA_APP_ID}});var ji=b((Tce,GT)=>{var Jd=Object.defineProperty,J3=Object.getOwnPropertyDescriptor,Y3=Object.getOwnPropertyNames,Q3=Object.prototype.hasOwnProperty,HT=(e,t)=>Jd(e,"name",{value:t,configurable:!0}),X3=(e,t)=>{for(var r in t)Jd(e,r,{get:t[r],enumerable:!0})},eV=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Y3(t))!Q3.call(e,s)&&s!==r&&Jd(e,s,{get:()=>t[s],enumerable:!(n=J3(t,s))||n.enumerable});return e},tV=e=>eV(Jd({},"__esModule",{value:!0}),e),qT={};X3(qT,{Hash:()=>sV});GT.exports=tV(qT);var eg=Zs(),rV=Re(),nV=require("buffer"),zT=require("crypto"),sV=class{static{HT(this,"Hash")}constructor(e,t){this.algorithmIdentifier=e,this.secret=t,this.reset()}update(e,t){this.hash.update((0,rV.toUint8Array)(tg(e,t)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?(0,zT.createHmac)(this.algorithmIdentifier,tg(this.secret)):(0,zT.createHash)(this.algorithmIdentifier)}};function tg(e,t){return nV.Buffer.isBuffer(e)?e:typeof e=="string"?(0,eg.fromString)(e,t):ArrayBuffer.isView(e)?(0,eg.fromArrayBuffer)(e.buffer,e.byteOffset,e.byteLength):(0,eg.fromArrayBuffer)(e)}HT(tg,"castSourceData")});var Ui=b((xce,ZT)=>{var Yd=Object.defineProperty,oV=Object.getOwnPropertyDescriptor,iV=Object.getOwnPropertyNames,aV=Object.prototype.hasOwnProperty,cV=(e,t)=>Yd(e,"name",{value:t,configurable:!0}),dV=(e,t)=>{for(var r in t)Yd(e,r,{get:t[r],enumerable:!0})},lV=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of iV(t))!aV.call(e,s)&&s!==r&&Yd(e,s,{get:()=>t[s],enumerable:!(n=oV(t,s))||n.enumerable});return e},uV=e=>lV(Yd({},"__esModule",{value:!0}),e),WT={};dV(WT,{calculateBodyLength:()=>mV});ZT.exports=uV(WT);var VT=require("fs"),mV=cV(e=>{if(!e)return 0;if(typeof e=="string")return Buffer.byteLength(e);if(typeof e.byteLength=="number")return e.byteLength;if(typeof e.size=="number")return e.size;if(typeof e.start=="number"&&typeof e.end=="number")return e.end+1-e.start;if(typeof e.path=="string"||Buffer.isBuffer(e.path))return(0,VT.lstatSync)(e.path).size;if(typeof e.fd=="number")return(0,VT.fstatSync)(e.fd).size;throw new Error(`Body Length computation failed for ${e}`)},"calculateBodyLength")});var dP=b(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});Qd.ruleSet=void 0;var oP="required",It="fn",At="argv",Eo="ref",KT=!0,JT="isSet",Bi="booleanEquals",vo="error",So="endpoint",wr="tree",rg="PartitionResult",ng="getAttr",YT={[oP]:!1,type:"String"},QT={[oP]:!0,default:!1,type:"Boolean"},XT={[Eo]:"Endpoint"},iP={[It]:Bi,[At]:[{[Eo]:"UseFIPS"},!0]},aP={[It]:Bi,[At]:[{[Eo]:"UseDualStack"},!0]},xt={},eP={[It]:ng,[At]:[{[Eo]:rg},"supportsFIPS"]},cP={[Eo]:rg},tP={[It]:Bi,[At]:[!0,{[It]:ng,[At]:[cP,"supportsDualStack"]}]},rP=[iP],nP=[aP],sP=[{[Eo]:"Region"}],pV={version:"1.0",parameters:{Region:YT,UseDualStack:QT,UseFIPS:QT,Endpoint:YT},rules:[{conditions:[{[It]:JT,[At]:[XT]}],rules:[{conditions:rP,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:vo},{conditions:nP,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:vo},{endpoint:{url:XT,properties:xt,headers:xt},type:So}],type:wr},{conditions:[{[It]:JT,[At]:sP}],rules:[{conditions:[{[It]:"aws.partition",[At]:sP,assign:rg}],rules:[{conditions:[iP,aP],rules:[{conditions:[{[It]:Bi,[At]:[KT,eP]},tP],rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:xt,headers:xt},type:So}],type:wr},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:vo}],type:wr},{conditions:rP,rules:[{conditions:[{[It]:Bi,[At]:[eP,KT]}],rules:[{conditions:[{[It]:"stringEquals",[At]:[{[It]:ng,[At]:[cP,"name"]},"aws-us-gov"]}],endpoint:{url:"https://portal.sso.{Region}.amazonaws.com",properties:xt,headers:xt},type:So},{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",properties:xt,headers:xt},type:So}],type:wr},{error:"FIPS is enabled but this partition does not support FIPS",type:vo}],type:wr},{conditions:nP,rules:[{conditions:[tP],rules:[{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:xt,headers:xt},type:So}],type:wr},{error:"DualStack is enabled but this partition does not support DualStack",type:vo}],type:wr},{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:xt,headers:xt},type:So}],type:wr}],type:wr},{error:"Invalid Configuration: Missing Region",type:vo}]};Qd.ruleSet=pV});var lP=b(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.defaultEndpointResolver=void 0;var fV=to(),sg=ds(),gV=dP(),hV=new sg.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),yV=(e,t={})=>hV.get(e,()=>(0,sg.resolveEndpoint)(gV.ruleSet,{endpointParams:e,logger:t.logger}));Xd.defaultEndpointResolver=yV;sg.customEndpointFunctions.aws=fV.awsEndpointFunctions});var pP=b(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.getRuntimeConfig=void 0;var _V=(Ne(),re(tr)),vV=(st(),re(Xs)),SV=ee(),EV=vs(),uP=Je(),mP=Re(),CV=Qf(),bV=lP(),wV=e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??uP.fromBase64,base64Encoder:e?.base64Encoder??uP.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??bV.defaultEndpointResolver,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??CV.defaultSSOHttpAuthSchemeProvider,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new _V.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new vV.NoAuthSigner}],logger:e?.logger??new SV.NoOpLogger,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??EV.parseUrl,utf8Decoder:e?.utf8Decoder??mP.fromUtf8,utf8Encoder:e?.utf8Encoder??mP.toUtf8});el.getRuntimeConfig=wV});var zi=b((Dce,vP)=>{var TV=Object.create,$i=Object.defineProperty,PV=Object.getOwnPropertyDescriptor,xV=Object.getOwnPropertyNames,IV=Object.getPrototypeOf,AV=Object.prototype.hasOwnProperty,og=(e,t)=>$i(e,"name",{value:t,configurable:!0}),OV=(e,t)=>{for(var r in t)$i(e,r,{get:t[r],enumerable:!0})},yP=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of xV(t))!AV.call(e,s)&&s!==r&&$i(e,s,{get:()=>t[s],enumerable:!(n=PV(t,s))||n.enumerable});return e},DV=(e,t,r)=>(r=e!=null?TV(IV(e)):{},yP(t||!e||!e.__esModule?$i(r,"default",{value:e,enumerable:!0}):r,e)),RV=e=>yP($i({},"__esModule",{value:!0}),e),_P={};OV(_P,{resolveDefaultsModeConfig:()=>zV});vP.exports=RV(_P);var NV=nr(),fP=dn(),LV=Qe(),kV="AWS_EXECUTION_ENV",gP="AWS_REGION",hP="AWS_DEFAULT_REGION",MV="AWS_EC2_METADATA_DISABLED",FV=["in-region","cross-region","mobile","standard","legacy"],jV="/latest/meta-data/placement/region",UV="AWS_DEFAULTS_MODE",BV="defaults_mode",$V={environmentVariableSelector:e=>e[UV],configFileSelector:e=>e[BV],default:"legacy"},zV=og(({region:e=(0,fP.loadConfig)(NV.NODE_REGION_CONFIG_OPTIONS),defaultsMode:t=(0,fP.loadConfig)($V)}={})=>(0,LV.memoize)(async()=>{let r=typeof t=="function"?await t():t;switch(r?.toLowerCase()){case"auto":return HV(e);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(r?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${FV.join(", ")}, got ${r}`)}}),"resolveDefaultsModeConfig"),HV=og(async e=>{if(e){let t=typeof e=="function"?await e():e,r=await qV();return r?t===r?"in-region":"cross-region":"standard"}return"standard"},"resolveNodeDefaultsModeAuto"),qV=og(async()=>{if(process.env[kV]&&(process.env[gP]||process.env[hP]))return process.env[gP]??process.env[hP];if(!process.env[MV])try{let{getInstanceMetadataEndpoint:e,httpRequest:t}=await Promise.resolve().then(()=>DV(Mi())),r=await e();return(await t({...r,path:jV})).toString()}catch{}},"inferPhysicalRegion")});var wP=b(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0});rl.getRuntimeConfig=void 0;var GV=(yo(),re(ho)),VV=GV.__importDefault(LT()),SP=(Ne(),re(tr)),EP=Fi(),tl=nr(),WV=ji(),CP=br(),Es=dn(),bP=Wn(),ZV=Ui(),KV=po(),JV=pP(),YV=ee(),QV=zi(),XV=ee(),eW=e=>{(0,XV.emitWarningIfUnsupportedVersion)(process.version);let t=(0,QV.resolveDefaultsModeConfig)(e),r=()=>t().then(YV.loadConfigsForDefaultMode),n=(0,JV.getRuntimeConfig)(e);(0,SP.emitWarningIfUnsupportedVersion)(process.version);let s={profile:e?.profile,logger:n.logger};return{...n,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,Es.loadConfig)(SP.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,s),bodyLengthChecker:e?.bodyLengthChecker??ZV.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,EP.createDefaultUserAgentProvider)({serviceId:n.serviceId,clientVersion:VV.default.version}),maxAttempts:e?.maxAttempts??(0,Es.loadConfig)(CP.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,Es.loadConfig)(tl.NODE_REGION_CONFIG_OPTIONS,{...tl.NODE_REGION_CONFIG_FILE_OPTIONS,...s}),requestHandler:bP.NodeHttpHandler.create(e?.requestHandler??r),retryMode:e?.retryMode??(0,Es.loadConfig)({...CP.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await r()).retryMode||KV.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??WV.Hash.bind(null,"sha256"),streamCollector:e?.streamCollector??bP.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,Es.loadConfig)(tl.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,s),useFipsEndpoint:e?.useFipsEndpoint??(0,Es.loadConfig)(tl.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,s),userAgentAppId:e?.userAgentAppId??(0,Es.loadConfig)(EP.NODE_APP_ID_CONFIG_OPTIONS,s)}};rl.getRuntimeConfig=eW});var Hi=b((Nce,OP)=>{"use strict";var nl=Object.defineProperty,tW=Object.getOwnPropertyDescriptor,rW=Object.getOwnPropertyNames,nW=Object.prototype.hasOwnProperty,or=(e,t)=>nl(e,"name",{value:t,configurable:!0}),sW=(e,t)=>{for(var r in t)nl(e,r,{get:t[r],enumerable:!0})},oW=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of rW(t))!nW.call(e,s)&&s!==r&&nl(e,s,{get:()=>t[s],enumerable:!(n=tW(t,s))||n.enumerable});return e},iW=e=>oW(nl({},"__esModule",{value:!0}),e),PP={};sW(PP,{NODE_REGION_CONFIG_FILE_OPTIONS:()=>lW,NODE_REGION_CONFIG_OPTIONS:()=>dW,REGION_ENV_NAME:()=>xP,REGION_INI_NAME:()=>IP,getAwsRegionExtensionConfiguration:()=>aW,resolveAwsRegionExtensionConfiguration:()=>cW,resolveRegionConfig:()=>uW});OP.exports=iW(PP);var aW=or(e=>({setRegion(t){e.region=t},region(){return e.region}}),"getAwsRegionExtensionConfiguration"),cW=or(e=>({region:e.region()}),"resolveAwsRegionExtensionConfiguration"),xP="AWS_REGION",IP="region",dW={environmentVariableSelector:or(e=>e[xP],"environmentVariableSelector"),configFileSelector:or(e=>e[IP],"configFileSelector"),default:or(()=>{throw new Error("Region is missing")},"default")},lW={preferredFile:"credentials"},AP=or(e=>typeof e=="string"&&(e.startsWith("fips-")||e.endsWith("-fips")),"isFipsRegion"),TP=or(e=>AP(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e,"getRealRegion"),uW=or(e=>{let{region:t,useFipsEndpoint:r}=e;if(!t)throw new Error("Region is missing");return Object.assign(e,{region:or(async()=>{if(typeof t=="string")return TP(t);let n=await t();return TP(n)},"region"),useFipsEndpoint:or(async()=>{let n=typeof t=="string"?t:await t();return AP(n)?!0:typeof r!="function"?Promise.resolve(!!r):r()},"useFipsEndpoint")})},"resolveRegionConfig")});var dx=b((Lce,cx)=>{"use strict";var sl=Object.defineProperty,mW=Object.getOwnPropertyDescriptor,pW=Object.getOwnPropertyNames,fW=Object.prototype.hasOwnProperty,ne=(e,t)=>sl(e,"name",{value:t,configurable:!0}),gW=(e,t)=>{for(var r in t)sl(e,r,{get:t[r],enumerable:!0})},hW=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of pW(t))!fW.call(e,s)&&s!==r&&sl(e,s,{get:()=>t[s],enumerable:!(n=mW(t,s))||n.enumerable});return e},yW=e=>hW(sl({},"__esModule",{value:!0}),e),FP={};gW(FP,{GetRoleCredentialsCommand:()=>ox,GetRoleCredentialsRequestFilterSensitiveLog:()=>WP,GetRoleCredentialsResponseFilterSensitiveLog:()=>KP,InvalidRequestException:()=>UP,ListAccountRolesCommand:()=>ig,ListAccountRolesRequestFilterSensitiveLog:()=>JP,ListAccountsCommand:()=>ag,ListAccountsRequestFilterSensitiveLog:()=>YP,LogoutCommand:()=>ix,LogoutRequestFilterSensitiveLog:()=>QP,ResourceNotFoundException:()=>$P,RoleCredentialsFilterSensitiveLog:()=>ZP,SSO:()=>ax,SSOClient:()=>il,SSOServiceException:()=>Co,TooManyRequestsException:()=>HP,UnauthorizedException:()=>GP,__Client:()=>$.Client,paginateListAccountRoles:()=>HW,paginateListAccounts:()=>qW});cx.exports=yW(FP);var DP=Ko(),_W=Jo(),vW=Yo(),RP=lo(),SW=nr(),Tr=(st(),re(Xs)),EW=Ri(),Gi=ln(),NP=br(),LP=Qf(),CW=ne(e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}),"resolveClientEndpointParameters"),ol={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},bW=wP(),kP=Hi(),MP=ge(),$=ee(),wW=ne(e=>{let t=e.httpAuthSchemes,r=e.httpAuthSchemeProvider,n=e.credentials;return{setHttpAuthScheme(s){let o=t.findIndex(i=>i.schemeId===s.schemeId);o===-1?t.push(s):t.splice(o,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){r=s},httpAuthSchemeProvider(){return r},setCredentials(s){n=s},credentials(){return n}}},"getHttpAuthExtensionConfiguration"),TW=ne(e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),"resolveHttpAuthRuntimeConfig"),PW=ne((e,t)=>{let r=Object.assign((0,kP.getAwsRegionExtensionConfiguration)(e),(0,$.getDefaultExtensionConfiguration)(e),(0,MP.getHttpHandlerExtensionConfiguration)(e),wW(e));return t.forEach(n=>n.configure(r)),Object.assign(e,(0,kP.resolveAwsRegionExtensionConfiguration)(r),(0,$.resolveDefaultRuntimeConfig)(r),(0,MP.resolveHttpHandlerRuntimeConfig)(r),TW(r))},"resolveRuntimeExtensions"),il=class extends $.Client{static{ne(this,"SSOClient")}config;constructor(...[e]){let t=(0,bW.getRuntimeConfig)(e||{});super(t),this.initConfig=t;let r=CW(t),n=(0,RP.resolveUserAgentConfig)(r),s=(0,NP.resolveRetryConfig)(n),o=(0,SW.resolveRegionConfig)(s),i=(0,DP.resolveHostHeaderConfig)(o),a=(0,Gi.resolveEndpointConfig)(i),c=(0,LP.resolveHttpAuthSchemeConfig)(a),d=PW(c,e?.extensions||[]);this.config=d,this.middlewareStack.use((0,RP.getUserAgentPlugin)(this.config)),this.middlewareStack.use((0,NP.getRetryPlugin)(this.config)),this.middlewareStack.use((0,EW.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,DP.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,_W.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,vW.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use((0,Tr.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config,{httpAuthSchemeParametersProvider:LP.defaultSSOHttpAuthSchemeParametersProvider,identityProviderConfigProvider:ne(async l=>new Tr.DefaultIdentityProviderConfig({"aws.auth#sigv4":l.credentials}),"identityProviderConfigProvider")})),this.middlewareStack.use((0,Tr.getHttpSigningPlugin)(this.config))}destroy(){super.destroy()}},al=Vr(),Co=class jP extends $.ServiceException{static{ne(this,"SSOServiceException")}constructor(t){super(t),Object.setPrototypeOf(this,jP.prototype)}},UP=class BP extends Co{static{ne(this,"InvalidRequestException")}name="InvalidRequestException";$fault="client";constructor(t){super({name:"InvalidRequestException",$fault:"client",...t}),Object.setPrototypeOf(this,BP.prototype)}},$P=class zP extends Co{static{ne(this,"ResourceNotFoundException")}name="ResourceNotFoundException";$fault="client";constructor(t){super({name:"ResourceNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,zP.prototype)}},HP=class qP extends Co{static{ne(this,"TooManyRequestsException")}name="TooManyRequestsException";$fault="client";constructor(t){super({name:"TooManyRequestsException",$fault:"client",...t}),Object.setPrototypeOf(this,qP.prototype)}},GP=class VP extends Co{static{ne(this,"UnauthorizedException")}name="UnauthorizedException";$fault="client";constructor(t){super({name:"UnauthorizedException",$fault:"client",...t}),Object.setPrototypeOf(this,VP.prototype)}},WP=ne(e=>({...e,...e.accessToken&&{accessToken:$.SENSITIVE_STRING}}),"GetRoleCredentialsRequestFilterSensitiveLog"),ZP=ne(e=>({...e,...e.secretAccessKey&&{secretAccessKey:$.SENSITIVE_STRING},...e.sessionToken&&{sessionToken:$.SENSITIVE_STRING}}),"RoleCredentialsFilterSensitiveLog"),KP=ne(e=>({...e,...e.roleCredentials&&{roleCredentials:ZP(e.roleCredentials)}}),"GetRoleCredentialsResponseFilterSensitiveLog"),JP=ne(e=>({...e,...e.accessToken&&{accessToken:$.SENSITIVE_STRING}}),"ListAccountRolesRequestFilterSensitiveLog"),YP=ne(e=>({...e,...e.accessToken&&{accessToken:$.SENSITIVE_STRING}}),"ListAccountsRequestFilterSensitiveLog"),QP=ne(e=>({...e,...e.accessToken&&{accessToken:$.SENSITIVE_STRING}}),"LogoutRequestFilterSensitiveLog"),qi=(Ne(),re(tr)),xW=ne(async(e,t)=>{let r=(0,Tr.requestBuilder)(e,t),n=(0,$.map)({},$.isSerializableHeaderValue,{[ll]:e[dl]});r.bp("/federation/credentials");let s=(0,$.map)({[$W]:[,(0,$.expectNonNull)(e[BW],"roleName")],[ex]:[,(0,$.expectNonNull)(e[XP],"accountId")]});return r.m("GET").h(n).q(s).b(void 0),r.build()},"se_GetRoleCredentialsCommand"),IW=ne(async(e,t)=>{let r=(0,Tr.requestBuilder)(e,t),n=(0,$.map)({},$.isSerializableHeaderValue,{[ll]:e[dl]});r.bp("/assignment/roles");let s=(0,$.map)({[sx]:[,e[nx]],[rx]:[()=>e.maxResults!==void 0,()=>e[tx].toString()],[ex]:[,(0,$.expectNonNull)(e[XP],"accountId")]});return r.m("GET").h(n).q(s).b(void 0),r.build()},"se_ListAccountRolesCommand"),AW=ne(async(e,t)=>{let r=(0,Tr.requestBuilder)(e,t),n=(0,$.map)({},$.isSerializableHeaderValue,{[ll]:e[dl]});r.bp("/assignment/accounts");let s=(0,$.map)({[sx]:[,e[nx]],[rx]:[()=>e.maxResults!==void 0,()=>e[tx].toString()]});return r.m("GET").h(n).q(s).b(void 0),r.build()},"se_ListAccountsCommand"),OW=ne(async(e,t)=>{let r=(0,Tr.requestBuilder)(e,t),n=(0,$.map)({},$.isSerializableHeaderValue,{[ll]:e[dl]});return r.bp("/logout"),r.m("POST").h(n).b(void 0),r.build()},"se_LogoutCommand"),DW=ne(async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return cl(e,t);let r=(0,$.map)({$metadata:fn(e)}),n=(0,$.expectNonNull)((0,$.expectObject)(await(0,qi.parseJsonBody)(e.body,t)),"body"),s=(0,$.take)(n,{roleCredentials:$._json});return Object.assign(r,s),r},"de_GetRoleCredentialsCommand"),RW=ne(async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return cl(e,t);let r=(0,$.map)({$metadata:fn(e)}),n=(0,$.expectNonNull)((0,$.expectObject)(await(0,qi.parseJsonBody)(e.body,t)),"body"),s=(0,$.take)(n,{nextToken:$.expectString,roleList:$._json});return Object.assign(r,s),r},"de_ListAccountRolesCommand"),NW=ne(async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return cl(e,t);let r=(0,$.map)({$metadata:fn(e)}),n=(0,$.expectNonNull)((0,$.expectObject)(await(0,qi.parseJsonBody)(e.body,t)),"body"),s=(0,$.take)(n,{accountList:$._json,nextToken:$.expectString});return Object.assign(r,s),r},"de_ListAccountsCommand"),LW=ne(async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return cl(e,t);let r=(0,$.map)({$metadata:fn(e)});return await(0,$.collectBody)(e.body,t),r},"de_LogoutCommand"),cl=ne(async(e,t)=>{let r={...e,body:await(0,qi.parseJsonErrorBody)(e.body,t)},n=(0,qi.loadRestJsonErrorCode)(e,r.body);switch(n){case"InvalidRequestException":case"com.amazonaws.sso#InvalidRequestException":throw await MW(r,t);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await FW(r,t);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await jW(r,t);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await UW(r,t);default:let s=r.body;return kW({output:e,parsedBody:s,errorCode:n})}},"de_CommandError"),kW=(0,$.withBaseException)(Co),MW=ne(async(e,t)=>{let r=(0,$.map)({}),n=e.body,s=(0,$.take)(n,{message:$.expectString});Object.assign(r,s);let o=new UP({$metadata:fn(e),...r});return(0,$.decorateServiceException)(o,e.body)},"de_InvalidRequestExceptionRes"),FW=ne(async(e,t)=>{let r=(0,$.map)({}),n=e.body,s=(0,$.take)(n,{message:$.expectString});Object.assign(r,s);let o=new $P({$metadata:fn(e),...r});return(0,$.decorateServiceException)(o,e.body)},"de_ResourceNotFoundExceptionRes"),jW=ne(async(e,t)=>{let r=(0,$.map)({}),n=e.body,s=(0,$.take)(n,{message:$.expectString});Object.assign(r,s);let o=new HP({$metadata:fn(e),...r});return(0,$.decorateServiceException)(o,e.body)},"de_TooManyRequestsExceptionRes"),UW=ne(async(e,t)=>{let r=(0,$.map)({}),n=e.body,s=(0,$.take)(n,{message:$.expectString});Object.assign(r,s);let o=new GP({$metadata:fn(e),...r});return(0,$.decorateServiceException)(o,e.body)},"de_UnauthorizedExceptionRes"),fn=ne(e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),"deserializeMetadata"),XP="accountId",dl="accessToken",ex="account_id",tx="maxResults",rx="max_result",nx="nextToken",sx="next_token",BW="roleName",$W="role_name",ll="x-amz-sso_bearer_token",ox=class extends $.Command.classBuilder().ep(ol).m(function(e,t,r,n){return[(0,al.getSerdePlugin)(r,this.serialize,this.deserialize),(0,Gi.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").f(WP,KP).ser(xW).de(DW).build(){static{ne(this,"GetRoleCredentialsCommand")}},ig=class extends $.Command.classBuilder().ep(ol).m(function(e,t,r,n){return[(0,al.getSerdePlugin)(r,this.serialize,this.deserialize),(0,Gi.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("SWBPortalService","ListAccountRoles",{}).n("SSOClient","ListAccountRolesCommand").f(JP,void 0).ser(IW).de(RW).build(){static{ne(this,"ListAccountRolesCommand")}},ag=class extends $.Command.classBuilder().ep(ol).m(function(e,t,r,n){return[(0,al.getSerdePlugin)(r,this.serialize,this.deserialize),(0,Gi.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("SWBPortalService","ListAccounts",{}).n("SSOClient","ListAccountsCommand").f(YP,void 0).ser(AW).de(NW).build(){static{ne(this,"ListAccountsCommand")}},ix=class extends $.Command.classBuilder().ep(ol).m(function(e,t,r,n){return[(0,al.getSerdePlugin)(r,this.serialize,this.deserialize),(0,Gi.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("SWBPortalService","Logout",{}).n("SSOClient","LogoutCommand").f(QP,void 0).ser(OW).de(LW).build(){static{ne(this,"LogoutCommand")}},zW={GetRoleCredentialsCommand:ox,ListAccountRolesCommand:ig,ListAccountsCommand:ag,LogoutCommand:ix},ax=class extends il{static{ne(this,"SSO")}};(0,$.createAggregatedClient)(zW,ax);var HW=(0,Tr.createPaginator)(il,ig,"nextToken","nextToken","maxResults"),qW=(0,Tr.createPaginator)(il,ag,"nextToken","nextToken","maxResults")});function GW(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(t,r)=>({signingProperties:{config:t,context:r}})}}function VW(e){return{schemeId:"smithy.api#noAuth"}}var Vi,lx,ux,mx,cg=C(()=>{Ne();Vi=P(mt()),lx=async(e,t,r)=>({operation:(0,Vi.getSmithyContext)(t).operation,region:await(0,Vi.normalizeProvider)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});ux=e=>{let t=[];switch(e.operation){case"CreateToken":{t.push(VW(e));break}default:t.push(GW(e))}return t},mx=e=>{let t=us(e);return Object.assign(t,{authSchemePreference:(0,Vi.normalizeProvider)(e.authSchemePreference??[])})}});var px,fx,dg=C(()=>{px=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),fx={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var ul,lg=C(()=>{ul={name:"@aws-sdk/nested-clients",version:"3.840.0",description:"Nested clients for AWS SDK packages.",main:"./dist-cjs/index.js",module:"./dist-es/index.js",types:"./dist-types/index.d.ts",scripts:{build:"yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline nested-clients","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo",lint:"node ../../scripts/validation/submodules-linter.js --pkg nested-clients",test:"yarn g:vitest run","test:watch":"yarn g:vitest watch"},engines:{node:">=18.0.0"},author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.840.0","@aws-sdk/middleware-host-header":"3.840.0","@aws-sdk/middleware-logger":"3.840.0","@aws-sdk/middleware-recursion-detection":"3.840.0","@aws-sdk/middleware-user-agent":"3.840.0","@aws-sdk/region-config-resolver":"3.840.0","@aws-sdk/types":"3.840.0","@aws-sdk/util-endpoints":"3.840.0","@aws-sdk/util-user-agent-browser":"3.840.0","@aws-sdk/util-user-agent-node":"3.840.0","@smithy/config-resolver":"^4.1.4","@smithy/core":"^3.6.0","@smithy/fetch-http-handler":"^5.0.4","@smithy/hash-node":"^4.0.4","@smithy/invalid-dependency":"^4.0.4","@smithy/middleware-content-length":"^4.0.4","@smithy/middleware-endpoint":"^4.1.13","@smithy/middleware-retry":"^4.1.14","@smithy/middleware-serde":"^4.0.8","@smithy/middleware-stack":"^4.0.4","@smithy/node-config-provider":"^4.1.3","@smithy/node-http-handler":"^4.0.6","@smithy/protocol-http":"^5.1.2","@smithy/smithy-client":"^4.4.5","@smithy/types":"^4.3.1","@smithy/url-parser":"^4.0.4","@smithy/util-base64":"^4.0.0","@smithy/util-body-length-browser":"^4.0.0","@smithy/util-body-length-node":"^4.0.0","@smithy/util-defaults-mode-browser":"^4.0.21","@smithy/util-defaults-mode-node":"^4.0.21","@smithy/util-endpoints":"^3.0.6","@smithy/util-middleware":"^4.0.4","@smithy/util-retry":"^4.0.6","@smithy/util-utf8":"^4.0.0",tslib:"^2.6.2"},devDependencies:{concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~5.8.3"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["./sso-oidc.d.ts","./sso-oidc.js","./sts.d.ts","./sts.js","dist-*/**"],browser:{"./dist-es/submodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},"react-native":{},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"packages/nested-clients"},exports:{"./sso-oidc":{types:"./dist-types/submodules/sso-oidc/index.d.ts",module:"./dist-es/submodules/sso-oidc/index.js",node:"./dist-cjs/submodules/sso-oidc/index.js",import:"./dist-es/submodules/sso-oidc/index.js",require:"./dist-cjs/submodules/sso-oidc/index.js"},"./sts":{types:"./dist-types/submodules/sts/index.d.ts",module:"./dist-es/submodules/sts/index.js",node:"./dist-cjs/submodules/sts/index.js",import:"./dist-es/submodules/sts/index.js",require:"./dist-cjs/submodules/sts/index.js"}}}});var wx,Dt,Rt,To,gx,Wi,bo,wo,Pr,ug,mg,hx,yx,_x,Tx,Px,Ot,vx,xx,Sx,Ex,Cx,bx,ZW,Ix,Ax=C(()=>{wx="required",Dt="fn",Rt="argv",To="ref",gx="isSet",Wi="booleanEquals",bo="error",wo="endpoint",Pr="tree",ug="PartitionResult",mg="getAttr",hx={[wx]:!1,type:"String"},yx={[wx]:!0,default:!1,type:"Boolean"},_x={[To]:"Endpoint"},Tx={[Dt]:Wi,[Rt]:[{[To]:"UseFIPS"},!0]},Px={[Dt]:Wi,[Rt]:[{[To]:"UseDualStack"},!0]},Ot={},vx={[Dt]:mg,[Rt]:[{[To]:ug},"supportsFIPS"]},xx={[To]:ug},Sx={[Dt]:Wi,[Rt]:[!0,{[Dt]:mg,[Rt]:[xx,"supportsDualStack"]}]},Ex=[Tx],Cx=[Px],bx=[{[To]:"Region"}],ZW={version:"1.0",parameters:{Region:hx,UseDualStack:yx,UseFIPS:yx,Endpoint:hx},rules:[{conditions:[{[Dt]:gx,[Rt]:[_x]}],rules:[{conditions:Ex,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:bo},{conditions:Cx,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:bo},{endpoint:{url:_x,properties:Ot,headers:Ot},type:wo}],type:Pr},{conditions:[{[Dt]:gx,[Rt]:bx}],rules:[{conditions:[{[Dt]:"aws.partition",[Rt]:bx,assign:ug}],rules:[{conditions:[Tx,Px],rules:[{conditions:[{[Dt]:Wi,[Rt]:[!0,vx]},Sx],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Ot,headers:Ot},type:wo}],type:Pr},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:bo}],type:Pr},{conditions:Ex,rules:[{conditions:[{[Dt]:Wi,[Rt]:[vx,!0]}],rules:[{conditions:[{[Dt]:"stringEquals",[Rt]:[{[Dt]:mg,[Rt]:[xx,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:Ot,headers:Ot},type:wo},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:Ot,headers:Ot},type:wo}],type:Pr},{error:"FIPS is enabled but this partition does not support FIPS",type:bo}],type:Pr},{conditions:Cx,rules:[{conditions:[Sx],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:Ot,headers:Ot},type:wo}],type:Pr},{error:"DualStack is enabled but this partition does not support DualStack",type:bo}],type:Pr},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:Ot,headers:Ot},type:wo}],type:Pr}],type:Pr},{error:"Invalid Configuration: Missing Region",type:bo}]},Ix=ZW});var Ox,Po,KW,Dx,Rx=C(()=>{Ox=P(to()),Po=P(ds());Ax();KW=new Po.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Dx=(e,t={})=>KW.get(e,()=>(0,Po.resolveEndpoint)(Ix,{endpointParams:e,logger:t.logger}));Po.customEndpointFunctions.aws=Ox.awsEndpointFunctions});var Nx,Lx,ml,pl,kx,Mx=C(()=>{Ne();st();Nx=P(ee()),Lx=P(vs()),ml=P(Je()),pl=P(Re());cg();Rx();kx=e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??ml.fromBase64,base64Encoder:e?.base64Encoder??ml.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Dx,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??ux,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new ot},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Sr}],logger:e?.logger??new Nx.NoOpLogger,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??Lx.parseUrl,utf8Decoder:e?.utf8Decoder??pl.fromUtf8,utf8Encoder:e?.utf8Encoder??pl.toUtf8})});var fl,hn,Fx,gl,gn,hl,jx,Ux,Bx,$x,zx,Hx,qx=C(()=>{lg();Ne();fl=P(Fi()),hn=P(nr()),Fx=P(ji()),gl=P(br()),gn=P(dn()),hl=P(Wn()),jx=P(Ui()),Ux=P(po());Mx();Bx=P(ee()),$x=P(zi()),zx=P(ee()),Hx=e=>{(0,zx.emitWarningIfUnsupportedVersion)(process.version);let t=(0,$x.resolveDefaultsModeConfig)(e),r=()=>t().then(Bx.loadConfigsForDefaultMode),n=kx(e);ro(process.version);let s={profile:e?.profile,logger:n.logger};return{...n,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,gn.loadConfig)(oo,s),bodyLengthChecker:e?.bodyLengthChecker??jx.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,fl.createDefaultUserAgentProvider)({serviceId:n.serviceId,clientVersion:ul.version}),maxAttempts:e?.maxAttempts??(0,gn.loadConfig)(gl.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,gn.loadConfig)(hn.NODE_REGION_CONFIG_OPTIONS,{...hn.NODE_REGION_CONFIG_FILE_OPTIONS,...s}),requestHandler:hl.NodeHttpHandler.create(e?.requestHandler??r),retryMode:e?.retryMode??(0,gn.loadConfig)({...gl.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await r()).retryMode||Ux.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??Fx.Hash.bind(null,"sha256"),streamCollector:e?.streamCollector??hl.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,gn.loadConfig)(hn.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,s),useFipsEndpoint:e?.useFipsEndpoint??(0,gn.loadConfig)(hn.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,s),userAgentAppId:e?.userAgentAppId??(0,gn.loadConfig)(fl.NODE_APP_ID_CONFIG_OPTIONS,s)}}});var Gx,Vx,Wx=C(()=>{Gx=e=>{let t=e.httpAuthSchemes,r=e.httpAuthSchemeProvider,n=e.credentials;return{setHttpAuthScheme(s){let o=t.findIndex(i=>i.schemeId===s.schemeId);o===-1?t.push(s):t.splice(o,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){r=s},httpAuthSchemeProvider(){return r},setCredentials(s){n=s},credentials(){return n}}},Vx=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()})});var yl,_l,vl,Zx,Kx=C(()=>{yl=P(Hi()),_l=P(ge()),vl=P(ee());Wx();Zx=(e,t)=>{let r=Object.assign((0,yl.getAwsRegionExtensionConfiguration)(e),(0,vl.getDefaultExtensionConfiguration)(e),(0,_l.getHttpHandlerExtensionConfiguration)(e),Gx(e));return t.forEach(n=>n.configure(r)),Object.assign(e,(0,yl.resolveAwsRegionExtensionConfiguration)(r),(0,vl.resolveDefaultRuntimeConfig)(r),(0,_l.resolveHttpHandlerRuntimeConfig)(r),Vx(r))}});var Sl,Jx,Yx,El,Qx,Xx,eI,Cl,pg,Zi,fg=C(()=>{Sl=P(Ko()),Jx=P(Jo()),Yx=P(Yo()),El=P(lo()),Qx=P(nr());st();Xx=P(Ri()),eI=P(ln()),Cl=P(br()),pg=P(ee());cg();dg();qx();Kx();Zi=class extends pg.Client{config;constructor(...[t]){let r=Hx(t||{});super(r),this.initConfig=r;let n=px(r),s=(0,El.resolveUserAgentConfig)(n),o=(0,Cl.resolveRetryConfig)(s),i=(0,Qx.resolveRegionConfig)(o),a=(0,Sl.resolveHostHeaderConfig)(i),c=(0,eI.resolveEndpointConfig)(a),d=mx(c),l=Zx(d,t?.extensions||[]);this.config=l,this.middlewareStack.use((0,El.getUserAgentPlugin)(this.config)),this.middlewareStack.use((0,Cl.getRetryPlugin)(this.config)),this.middlewareStack.use((0,Xx.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,Sl.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,Jx.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,Yx.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use(Xo(this.config,{httpAuthSchemeParametersProvider:lx,identityProviderConfigProvider:async u=>new as({"aws.auth#sigv4":u.credentials})})),this.middlewareStack.use(ei(this.config))}destroy(){super.destroy()}}});var tI,Le,bl=C(()=>{tI=P(ee()),Le=class e extends tI.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}});var Cs,Ki,Ji,gg,hg,Yi,Qi,Xi,ea,ta,ra,na,sa,oa,wl=C(()=>{Cs=P(ee());bl();Ki=class e extends Le{name="AccessDeniedException";$fault="client";error;error_description;constructor(t){super({name:"AccessDeniedException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},Ji=class e extends Le{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(t){super({name:"AuthorizationPendingException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},gg=e=>({...e,...e.clientSecret&&{clientSecret:Cs.SENSITIVE_STRING},...e.refreshToken&&{refreshToken:Cs.SENSITIVE_STRING},...e.codeVerifier&&{codeVerifier:Cs.SENSITIVE_STRING}}),hg=e=>({...e,...e.accessToken&&{accessToken:Cs.SENSITIVE_STRING},...e.refreshToken&&{refreshToken:Cs.SENSITIVE_STRING},...e.idToken&&{idToken:Cs.SENSITIVE_STRING}}),Yi=class e extends Le{name="ExpiredTokenException";$fault="client";error;error_description;constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},Qi=class e extends Le{name="InternalServerException";$fault="server";error;error_description;constructor(t){super({name:"InternalServerException",$fault:"server",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},Xi=class e extends Le{name="InvalidClientException";$fault="client";error;error_description;constructor(t){super({name:"InvalidClientException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},ea=class e extends Le{name="InvalidGrantException";$fault="client";error;error_description;constructor(t){super({name:"InvalidGrantException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},ta=class e extends Le{name="InvalidRequestException";$fault="client";error;error_description;constructor(t){super({name:"InvalidRequestException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},ra=class e extends Le{name="InvalidScopeException";$fault="client";error;error_description;constructor(t){super({name:"InvalidScopeException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},na=class e extends Le{name="SlowDownException";$fault="client";error;error_description;constructor(t){super({name:"SlowDownException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},sa=class e extends Le{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(t){super({name:"UnauthorizedClientException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},oa=class e extends Le{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(t){super({name:"UnsupportedGrantTypeException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}}});var j,rI,nI,JW,YW,QW,XW,e8,t8,r8,n8,s8,o8,i8,a8,c8,Nt,sI=C(()=>{Ne();st();j=P(ee());wl();bl();rI=async(e,t)=>{let r=hi(e,t),n={"content-type":"application/json"};r.bp("/token");let s;return s=JSON.stringify((0,j.take)(e,{clientId:[],clientSecret:[],code:[],codeVerifier:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:o=>(0,j._json)(o)})),r.m("POST").h(n).b(s),r.build()},nI=async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return JW(e,t);let r=(0,j.map)({$metadata:Nt(e)}),n=(0,j.expectNonNull)((0,j.expectObject)(await co(e.body,t)),"body"),s=(0,j.take)(n,{accessToken:j.expectString,expiresIn:j.expectInt32,idToken:j.expectString,refreshToken:j.expectString,tokenType:j.expectString});return Object.assign(r,s),r},JW=async(e,t)=>{let r={...e,body:await Kp(e.body,t)},n=ps(e,r.body);switch(n){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await QW(r,t);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await XW(r,t);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await e8(r,t);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await t8(r,t);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await r8(r,t);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await n8(r,t);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await s8(r,t);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await o8(r,t);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await i8(r,t);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await a8(r,t);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await c8(r,t);default:let s=r.body;return YW({output:e,parsedBody:s,errorCode:n})}},YW=(0,j.withBaseException)(Le),QW=async(e,t)=>{let r=(0,j.map)({}),n=e.body,s=(0,j.take)(n,{error:j.expectString,error_description:j.expectString});Object.assign(r,s);let o=new Ki({$metadata:Nt(e),...r});return(0,j.decorateServiceException)(o,e.body)},XW=async(e,t)=>{let r=(0,j.map)({}),n=e.body,s=(0,j.take)(n,{error:j.expectString,error_description:j.expectString});Object.assign(r,s);let o=new Ji({$metadata:Nt(e),...r});return(0,j.decorateServiceException)(o,e.body)},e8=async(e,t)=>{let r=(0,j.map)({}),n=e.body,s=(0,j.take)(n,{error:j.expectString,error_description:j.expectString});Object.assign(r,s);let o=new Yi({$metadata:Nt(e),...r});return(0,j.decorateServiceException)(o,e.body)},t8=async(e,t)=>{let r=(0,j.map)({}),n=e.body,s=(0,j.take)(n,{error:j.expectString,error_description:j.expectString});Object.assign(r,s);let o=new Qi({$metadata:Nt(e),...r});return(0,j.decorateServiceException)(o,e.body)},r8=async(e,t)=>{let r=(0,j.map)({}),n=e.body,s=(0,j.take)(n,{error:j.expectString,error_description:j.expectString});Object.assign(r,s);let o=new Xi({$metadata:Nt(e),...r});return(0,j.decorateServiceException)(o,e.body)},n8=async(e,t)=>{let r=(0,j.map)({}),n=e.body,s=(0,j.take)(n,{error:j.expectString,error_description:j.expectString});Object.assign(r,s);let o=new ea({$metadata:Nt(e),...r});return(0,j.decorateServiceException)(o,e.body)},s8=async(e,t)=>{let r=(0,j.map)({}),n=e.body,s=(0,j.take)(n,{error:j.expectString,error_description:j.expectString});Object.assign(r,s);let o=new ta({$metadata:Nt(e),...r});return(0,j.decorateServiceException)(o,e.body)},o8=async(e,t)=>{let r=(0,j.map)({}),n=e.body,s=(0,j.take)(n,{error:j.expectString,error_description:j.expectString});Object.assign(r,s);let o=new ra({$metadata:Nt(e),...r});return(0,j.decorateServiceException)(o,e.body)},i8=async(e,t)=>{let r=(0,j.map)({}),n=e.body,s=(0,j.take)(n,{error:j.expectString,error_description:j.expectString});Object.assign(r,s);let o=new na({$metadata:Nt(e),...r});return(0,j.decorateServiceException)(o,e.body)},a8=async(e,t)=>{let r=(0,j.map)({}),n=e.body,s=(0,j.take)(n,{error:j.expectString,error_description:j.expectString});Object.assign(r,s);let o=new sa({$metadata:Nt(e),...r});return(0,j.decorateServiceException)(o,e.body)},c8=async(e,t)=>{let r=(0,j.map)({}),n=e.body,s=(0,j.take)(n,{error:j.expectString,error_description:j.expectString});Object.assign(r,s);let o=new oa({$metadata:Nt(e),...r});return(0,j.decorateServiceException)(o,e.body)},Nt=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]})});var oI,iI,yg,ia,_g=C(()=>{oI=P(ln()),iI=P(Vr()),yg=P(ee());dg();wl();sI();ia=class extends yg.Command.classBuilder().ep(fx).m(function(t,r,n,s){return[(0,iI.getSerdePlugin)(n,this.serialize,this.deserialize),(0,oI.getEndpointPlugin)(n,t.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f(gg,hg).ser(rI).de(nI).build(){}});var aI,d8,Tl,cI=C(()=>{aI=P(ee());_g();fg();d8={CreateTokenCommand:ia},Tl=class extends Zi{};(0,aI.createAggregatedClient)(d8,Tl)});var dI=C(()=>{_g()});var lI=C(()=>{wl()});var vg={};dt(vg,{$Command:()=>yg.Command,AccessDeniedException:()=>Ki,AuthorizationPendingException:()=>Ji,CreateTokenCommand:()=>ia,CreateTokenRequestFilterSensitiveLog:()=>gg,CreateTokenResponseFilterSensitiveLog:()=>hg,ExpiredTokenException:()=>Yi,InternalServerException:()=>Qi,InvalidClientException:()=>Xi,InvalidGrantException:()=>ea,InvalidRequestException:()=>ta,InvalidScopeException:()=>ra,SSOOIDC:()=>Tl,SSOOIDCClient:()=>Zi,SSOOIDCServiceException:()=>Le,SlowDownException:()=>na,UnauthorizedClientException:()=>sa,UnsupportedGrantTypeException:()=>oa,__Client:()=>pg.Client});var Sg=C(()=>{fg();cI();dI();lI();bl()});var _I=b((Mde,yI)=>{"use strict";var l8=Object.create,ca=Object.defineProperty,u8=Object.getOwnPropertyDescriptor,m8=Object.getOwnPropertyNames,p8=Object.getPrototypeOf,f8=Object.prototype.hasOwnProperty,xr=(e,t)=>ca(e,"name",{value:t,configurable:!0}),g8=(e,t)=>{for(var r in t)ca(e,r,{get:t[r],enumerable:!0})},pI=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of m8(t))!f8.call(e,s)&&s!==r&&ca(e,s,{get:()=>t[s],enumerable:!(n=u8(t,s))||n.enumerable});return e},fI=(e,t,r)=>(r=e!=null?l8(p8(e)):{},pI(t||!e||!e.__esModule?ca(r,"default",{value:e,enumerable:!0}):r,e)),h8=e=>pI(ca({},"__esModule",{value:!0}),e),gI={};g8(gI,{fromEnvSigningName:()=>v8,fromSso:()=>hI,fromStatic:()=>P8,nodeProvider:()=>x8});yI.exports=h8(gI);var y8=(Bt(),re(en)),_8=(jp(),re(wC)),gt=Qe(),v8=xr(({logger:e,signingName:t}={})=>async()=>{if(e?.debug?.("@aws-sdk/token-providers - fromEnvSigningName"),!t)throw new gt.TokenProviderError("Please pass 'signingName' to compute environment variable key",{logger:e});let r=(0,_8.getBearerTokenEnvKey)(t);if(!(r in process.env))throw new gt.TokenProviderError(`Token not present in '${r}' environment variable`,{logger:e});let n={token:process.env[r]};return(0,y8.setTokenFeature)(n,"BEARER_SERVICE_ENV_VARS","3"),n},"fromEnvSigningName"),S8=5*60*1e3,Eg="To refresh this SSO session run 'aws sso login' with the corresponding profile.",E8=xr(async(e,t={})=>{let{SSOOIDCClient:r}=await Promise.resolve().then(()=>fI((Sg(),re(vg))));return new r(Object.assign({},t.clientConfig??{},{region:e??t.clientConfig?.region,logger:t.clientConfig?.logger??t.parentClientConfig?.logger}))},"getSsoOidcClient"),C8=xr(async(e,t,r={})=>{let{CreateTokenCommand:n}=await Promise.resolve().then(()=>fI((Sg(),re(vg))));return(await E8(t,r)).send(new n({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))},"getNewSsoOidcToken"),uI=xr(e=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new gt.TokenProviderError(`Token is expired. ${Eg}`,!1)},"validateTokenExpiry"),bs=xr((e,t,r=!1)=>{if(typeof t>"u")throw new gt.TokenProviderError(`Value not present for '${e}' in SSO Token${r?". Cannot refresh":""}. ${Eg}`,!1)},"validateTokenKey"),aa=cn(),b8=require("fs"),{writeFile:w8}=b8.promises,T8=xr((e,t)=>{let r=(0,aa.getSSOTokenFilepath)(e),n=JSON.stringify(t,null,2);return w8(r,n)},"writeSSOTokenToFile"),mI=new Date(0),hI=xr((e={})=>async({callerClientConfig:t}={})=>{let r={...e,parentClientConfig:{...t,...e.parentClientConfig}};r.logger?.debug("@aws-sdk/token-providers - fromSso");let n=await(0,aa.parseKnownFiles)(r),s=(0,aa.getProfileName)({profile:r.profile??t?.profile}),o=n[s];if(o){if(!o.sso_session)throw new gt.TokenProviderError(`Profile '${s}' is missing required property 'sso_session'.`)}else throw new gt.TokenProviderError(`Profile '${s}' could not be found in shared credentials file.`,!1);let i=o.sso_session,c=(await(0,aa.loadSsoSessionData)(r))[i];if(!c)throw new gt.TokenProviderError(`Sso session '${i}' could not be found in shared credentials file.`,!1);for(let y of["sso_start_url","sso_region"])if(!c[y])throw new gt.TokenProviderError(`Sso session '${i}' is missing required property '${y}'.`,!1);let d=c.sso_start_url,l=c.sso_region,u;try{u=await(0,aa.getSSOTokenFromFile)(i)}catch{throw new gt.TokenProviderError(`The SSO session token associated with profile=${s} was not found or is invalid. ${Eg}`,!1)}bs("accessToken",u.accessToken),bs("expiresAt",u.expiresAt);let{accessToken:m,expiresAt:p}=u,h={token:m,expiration:new Date(p)};if(h.expiration.getTime()-Date.now()>S8)return h;if(Date.now()-mI.getTime()<30*1e3)return uI(h),h;bs("clientId",u.clientId,!0),bs("clientSecret",u.clientSecret,!0),bs("refreshToken",u.refreshToken,!0);try{mI.setTime(Date.now());let y=await C8(u,l,r);bs("accessToken",y.accessToken),bs("expiresIn",y.expiresIn);let _=new Date(Date.now()+y.expiresIn*1e3);try{await T8(i,{...u,accessToken:y.accessToken,expiresAt:_.toISOString(),refreshToken:y.refreshToken})}catch{}return{token:y.accessToken,expiration:_}}catch{return uI(h),h}},"fromSso"),P8=xr(({token:e,logger:t})=>async()=>{if(t?.debug("@aws-sdk/token-providers - fromStatic"),!e||!e.token)throw new gt.TokenProviderError("Please pass a valid token to fromStatic",!1);return e},"fromStatic"),x8=xr((e={})=>(0,gt.memoize)((0,gt.chain)(hI(e),async()=>{throw new gt.TokenProviderError("Could not load token from any providers",!1)}),t=>t.expiration!==void 0&&t.expiration.getTime()-Date.now()<3e5,t=>t.expiration!==void 0),"nodeProvider")});var bg=b((Fde,xI)=>{"use strict";var xl=Object.defineProperty,I8=Object.getOwnPropertyDescriptor,EI=Object.getOwnPropertyNames,A8=Object.prototype.hasOwnProperty,Il=(e,t)=>xl(e,"name",{value:t,configurable:!0}),O8=(e,t)=>function(){return e&&(t=(0,e[EI(e)[0]])(e=0)),t},CI=(e,t)=>{for(var r in t)xl(e,r,{get:t[r],enumerable:!0})},D8=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of EI(t))!A8.call(e,s)&&s!==r&&xl(e,s,{get:()=>t[s],enumerable:!(n=I8(t,s))||n.enumerable});return e},R8=e=>D8(xl({},"__esModule",{value:!0}),e),bI={};CI(bI,{GetRoleCredentialsCommand:()=>Cg.GetRoleCredentialsCommand,SSOClient:()=>Cg.SSOClient});var Cg,N8=O8({"src/loadSso.ts"(){"use strict";Cg=dx()}}),wI={};CI(wI,{fromSSO:()=>k8,isSsoProfile:()=>TI,validateSsoProfile:()=>PI});xI.exports=R8(wI);var TI=Il(e=>e&&(typeof e.sso_start_url=="string"||typeof e.sso_account_id=="string"||typeof e.sso_session=="string"||typeof e.sso_region=="string"||typeof e.sso_role_name=="string"),"isSsoProfile"),vI=(Bt(),re(en)),L8=_I(),zt=Qe(),Pl=cn(),da=!1,SI=Il(async({ssoStartUrl:e,ssoSession:t,ssoAccountId:r,ssoRegion:n,ssoRoleName:s,ssoClient:o,clientConfig:i,parentClientConfig:a,profile:c,logger:d})=>{let l,u="To refresh this SSO session run aws sso login with the corresponding profile.";if(t)try{let V=await(0,L8.fromSso)({profile:c})();l={accessToken:V.token,expiresAt:new Date(V.expiration).toISOString()}}catch(V){throw new zt.CredentialsProviderError(V.message,{tryNextLink:da,logger:d})}else try{l=await(0,Pl.getSSOTokenFromFile)(e)}catch{throw new zt.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${u}`,{tryNextLink:da,logger:d})}if(new Date(l.expiresAt).getTime()-Date.now()<=0)throw new zt.CredentialsProviderError(`The SSO session associated with this profile has expired. ${u}`,{tryNextLink:da,logger:d});let{accessToken:m}=l,{SSOClient:p,GetRoleCredentialsCommand:h}=await Promise.resolve().then(()=>(N8(),bI)),y=o||new p(Object.assign({},i??{},{logger:i?.logger??a?.logger,region:i?.region??n})),_;try{_=await y.send(new h({accountId:r,roleName:s,accessToken:m}))}catch(V){throw new zt.CredentialsProviderError(V,{tryNextLink:da,logger:d})}let{roleCredentials:{accessKeyId:w,secretAccessKey:E,sessionToken:B,expiration:T,credentialScope:A,accountId:H}={}}=_;if(!w||!E||!B||!T)throw new zt.CredentialsProviderError("SSO returns an invalid temporary credential.",{tryNextLink:da,logger:d});let Z={accessKeyId:w,secretAccessKey:E,sessionToken:B,expiration:new Date(T),...A&&{credentialScope:A},...H&&{accountId:H}};return t?(0,vI.setCredentialFeature)(Z,"CREDENTIALS_SSO","s"):(0,vI.setCredentialFeature)(Z,"CREDENTIALS_SSO_LEGACY","u"),Z},"resolveSSOCredentials"),PI=Il((e,t)=>{let{sso_start_url:r,sso_account_id:n,sso_region:s,sso_role_name:o}=e;if(!r||!n||!s||!o)throw new zt.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}
52
- Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:t});return e},"validateSsoProfile"),k8=Il((e={})=>async({callerClientConfig:t}={})=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");let{ssoStartUrl:r,ssoAccountId:n,ssoRegion:s,ssoRoleName:o,ssoSession:i}=e,{ssoClient:a}=e,c=(0,Pl.getProfileName)({profile:e.profile??t?.profile});if(!r&&!n&&!s&&!o&&!i){let l=(await(0,Pl.parseKnownFiles)(e))[c];if(!l)throw new zt.CredentialsProviderError(`Profile ${c} was not found.`,{logger:e.logger});if(!TI(l))throw new zt.CredentialsProviderError(`Profile ${c} is not configured with SSO credentials.`,{logger:e.logger});if(l?.sso_session){let w=(await(0,Pl.loadSsoSessionData)(e))[l.sso_session],E=` configurations in profile ${c} and sso-session ${l.sso_session}`;if(s&&s!==w.sso_region)throw new zt.CredentialsProviderError("Conflicting SSO region"+E,{tryNextLink:!1,logger:e.logger});if(r&&r!==w.sso_start_url)throw new zt.CredentialsProviderError("Conflicting SSO start_url"+E,{tryNextLink:!1,logger:e.logger});l.sso_region=w.sso_region,l.sso_start_url=w.sso_start_url}let{sso_start_url:u,sso_account_id:m,sso_region:p,sso_role_name:h,sso_session:y}=PI(l,e.logger);return SI({ssoStartUrl:u,ssoSession:y,ssoAccountId:m,ssoRegion:p,ssoRoleName:h,ssoClient:a,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,profile:c})}else{if(!r||!n||!s||!o)throw new zt.CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});return SI({ssoStartUrl:r,ssoSession:i,ssoAccountId:n,ssoRegion:s,ssoRoleName:o,ssoClient:a,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,profile:c})}},"fromSSO")});function M8(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:e.region},propertiesExtractor:(t,r)=>({signingProperties:{config:t,context:r}})}}function F8(e){return{schemeId:"smithy.api#noAuth"}}var la,II,AI,j8,OI,wg=C(()=>{Ne();la=P(mt());ua();II=async(e,t,r)=>({operation:(0,la.getSmithyContext)(t).operation,region:await(0,la.normalizeProvider)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});AI=e=>{let t=[];switch(e.operation){case"AssumeRoleWithWebIdentity":{t.push(F8(e));break}default:t.push(M8(e))}return t},j8=e=>Object.assign(e,{stsClientCtor:ir}),OI=e=>{let t=j8(e),r=us(t);return Object.assign(r,{authSchemePreference:(0,la.normalizeProvider)(e.authSchemePreference??[])})}});var DI,Al,Ol=C(()=>{DI=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,useGlobalEndpoint:e.useGlobalEndpoint??!1,defaultSigningName:"sts"}),Al={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var zI,Q,ae,ce,_n,yn,Be,HI,qI,GI,ve,RI,ar,xo,Pg,NI,Tg,VI,LI,$e,kI,WI,ZI,Ze,ht,MI,KI,JI,FI,YI,jI,UI,BI,$I,U8,QI,XI=C(()=>{zI="required",Q="type",ae="fn",ce="argv",_n="ref",yn="booleanEquals",Be="stringEquals",HI="sigv4",qI="sts",GI="us-east-1",ve="endpoint",RI="https://sts.{Region}.{PartitionResult#dnsSuffix}",ar="tree",xo="error",Pg="getAttr",NI={[zI]:!1,[Q]:"String"},Tg={[zI]:!0,default:!1,[Q]:"Boolean"},VI={[_n]:"Endpoint"},LI={[ae]:"isSet",[ce]:[{[_n]:"Region"}]},$e={[_n]:"Region"},kI={[ae]:"aws.partition",[ce]:[$e],assign:"PartitionResult"},WI={[_n]:"UseFIPS"},ZI={[_n]:"UseDualStack"},Ze={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:HI,signingName:qI,signingRegion:GI}]},headers:{}},ht={},MI={conditions:[{[ae]:Be,[ce]:[$e,"aws-global"]}],[ve]:Ze,[Q]:ve},KI={[ae]:yn,[ce]:[WI,!0]},JI={[ae]:yn,[ce]:[ZI,!0]},FI={[ae]:Pg,[ce]:[{[_n]:"PartitionResult"},"supportsFIPS"]},YI={[_n]:"PartitionResult"},jI={[ae]:yn,[ce]:[!0,{[ae]:Pg,[ce]:[YI,"supportsDualStack"]}]},UI=[{[ae]:"isSet",[ce]:[VI]}],BI=[KI],$I=[JI],U8={version:"1.0",parameters:{Region:NI,UseDualStack:Tg,UseFIPS:Tg,Endpoint:NI,UseGlobalEndpoint:Tg},rules:[{conditions:[{[ae]:yn,[ce]:[{[_n]:"UseGlobalEndpoint"},!0]},{[ae]:"not",[ce]:UI},LI,kI,{[ae]:yn,[ce]:[WI,!1]},{[ae]:yn,[ce]:[ZI,!1]}],rules:[{conditions:[{[ae]:Be,[ce]:[$e,"ap-northeast-1"]}],endpoint:Ze,[Q]:ve},{conditions:[{[ae]:Be,[ce]:[$e,"ap-south-1"]}],endpoint:Ze,[Q]:ve},{conditions:[{[ae]:Be,[ce]:[$e,"ap-southeast-1"]}],endpoint:Ze,[Q]:ve},{conditions:[{[ae]:Be,[ce]:[$e,"ap-southeast-2"]}],endpoint:Ze,[Q]:ve},MI,{conditions:[{[ae]:Be,[ce]:[$e,"ca-central-1"]}],endpoint:Ze,[Q]:ve},{conditions:[{[ae]:Be,[ce]:[$e,"eu-central-1"]}],endpoint:Ze,[Q]:ve},{conditions:[{[ae]:Be,[ce]:[$e,"eu-north-1"]}],endpoint:Ze,[Q]:ve},{conditions:[{[ae]:Be,[ce]:[$e,"eu-west-1"]}],endpoint:Ze,[Q]:ve},{conditions:[{[ae]:Be,[ce]:[$e,"eu-west-2"]}],endpoint:Ze,[Q]:ve},{conditions:[{[ae]:Be,[ce]:[$e,"eu-west-3"]}],endpoint:Ze,[Q]:ve},{conditions:[{[ae]:Be,[ce]:[$e,"sa-east-1"]}],endpoint:Ze,[Q]:ve},{conditions:[{[ae]:Be,[ce]:[$e,GI]}],endpoint:Ze,[Q]:ve},{conditions:[{[ae]:Be,[ce]:[$e,"us-east-2"]}],endpoint:Ze,[Q]:ve},{conditions:[{[ae]:Be,[ce]:[$e,"us-west-1"]}],endpoint:Ze,[Q]:ve},{conditions:[{[ae]:Be,[ce]:[$e,"us-west-2"]}],endpoint:Ze,[Q]:ve},{endpoint:{url:RI,properties:{authSchemes:[{name:HI,signingName:qI,signingRegion:"{Region}"}]},headers:ht},[Q]:ve}],[Q]:ar},{conditions:UI,rules:[{conditions:BI,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[Q]:xo},{conditions:$I,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[Q]:xo},{endpoint:{url:VI,properties:ht,headers:ht},[Q]:ve}],[Q]:ar},{conditions:[LI],rules:[{conditions:[kI],rules:[{conditions:[KI,JI],rules:[{conditions:[{[ae]:yn,[ce]:[!0,FI]},jI],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:ht,headers:ht},[Q]:ve}],[Q]:ar},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[Q]:xo}],[Q]:ar},{conditions:BI,rules:[{conditions:[{[ae]:yn,[ce]:[FI,!0]}],rules:[{conditions:[{[ae]:Be,[ce]:[{[ae]:Pg,[ce]:[YI,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:ht,headers:ht},[Q]:ve},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:ht,headers:ht},[Q]:ve}],[Q]:ar},{error:"FIPS is enabled but this partition does not support FIPS",[Q]:xo}],[Q]:ar},{conditions:$I,rules:[{conditions:[jI],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:ht,headers:ht},[Q]:ve}],[Q]:ar},{error:"DualStack is enabled but this partition does not support DualStack",[Q]:xo}],[Q]:ar},MI,{endpoint:{url:RI,properties:ht,headers:ht},[Q]:ve}],[Q]:ar}],[Q]:ar},{error:"Invalid Configuration: Missing Region",[Q]:xo}]},QI=U8});var eA,Io,B8,tA,rA=C(()=>{eA=P(to()),Io=P(ds());XI();B8=new Io.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),tA=(e,t={})=>B8.get(e,()=>(0,Io.resolveEndpoint)(QI,{endpointParams:e,logger:t.logger}));Io.customEndpointFunctions.aws=eA.awsEndpointFunctions});var nA,sA,Dl,Rl,oA,iA=C(()=>{Ne();st();nA=P(ee()),sA=P(vs()),Dl=P(Je()),Rl=P(Re());wg();rA();oA=e=>({apiVersion:"2011-06-15",base64Decoder:e?.base64Decoder??Dl.fromBase64,base64Encoder:e?.base64Encoder??Dl.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??tA,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??AI,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new ot},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Sr}],logger:e?.logger??new nA.NoOpLogger,serviceId:e?.serviceId??"STS",urlParser:e?.urlParser??sA.parseUrl,utf8Decoder:e?.utf8Decoder??Rl.fromUtf8,utf8Encoder:e?.utf8Encoder??Rl.toUtf8})});var Nl,Sn,aA,Ll,vn,kl,cA,dA,lA,uA,mA,pA,fA=C(()=>{lg();Ne();Nl=P(Fi()),Sn=P(nr());st();aA=P(ji()),Ll=P(br()),vn=P(dn()),kl=P(Wn()),cA=P(Ui()),dA=P(po());iA();lA=P(ee()),uA=P(zi()),mA=P(ee()),pA=e=>{(0,mA.emitWarningIfUnsupportedVersion)(process.version);let t=(0,uA.resolveDefaultsModeConfig)(e),r=()=>t().then(lA.loadConfigsForDefaultMode),n=oA(e);ro(process.version);let s={profile:e?.profile,logger:n.logger};return{...n,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,vn.loadConfig)(oo,s),bodyLengthChecker:e?.bodyLengthChecker??cA.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,Nl.createDefaultUserAgentProvider)({serviceId:n.serviceId,clientVersion:ul.version}),httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:o=>o.getIdentityProvider("aws.auth#sigv4")||(async i=>await e.credentialDefaultProvider(i?.__config||{})()),signer:new ot},{schemeId:"smithy.api#noAuth",identityProvider:o=>o.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Sr}],maxAttempts:e?.maxAttempts??(0,vn.loadConfig)(Ll.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,vn.loadConfig)(Sn.NODE_REGION_CONFIG_OPTIONS,{...Sn.NODE_REGION_CONFIG_FILE_OPTIONS,...s}),requestHandler:kl.NodeHttpHandler.create(e?.requestHandler??r),retryMode:e?.retryMode??(0,vn.loadConfig)({...Ll.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await r()).retryMode||dA.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??aA.Hash.bind(null,"sha256"),streamCollector:e?.streamCollector??kl.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,vn.loadConfig)(Sn.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,s),useFipsEndpoint:e?.useFipsEndpoint??(0,vn.loadConfig)(Sn.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,s),userAgentAppId:e?.userAgentAppId??(0,vn.loadConfig)(Nl.NODE_APP_ID_CONFIG_OPTIONS,s)}}});var gA,hA,yA=C(()=>{gA=e=>{let t=e.httpAuthSchemes,r=e.httpAuthSchemeProvider,n=e.credentials;return{setHttpAuthScheme(s){let o=t.findIndex(i=>i.schemeId===s.schemeId);o===-1?t.push(s):t.splice(o,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){r=s},httpAuthSchemeProvider(){return r},setCredentials(s){n=s},credentials(){return n}}},hA=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()})});var Ml,Fl,jl,_A,vA=C(()=>{Ml=P(Hi()),Fl=P(ge()),jl=P(ee());yA();_A=(e,t)=>{let r=Object.assign((0,Ml.getAwsRegionExtensionConfiguration)(e),(0,jl.getDefaultExtensionConfiguration)(e),(0,Fl.getHttpHandlerExtensionConfiguration)(e),gA(e));return t.forEach(n=>n.configure(r)),Object.assign(e,(0,Ml.resolveAwsRegionExtensionConfiguration)(r),(0,jl.resolveDefaultRuntimeConfig)(r),(0,Fl.resolveHttpHandlerRuntimeConfig)(r),hA(r))}});var Ul,SA,EA,Bl,CA,bA,wA,$l,xg,ir,ua=C(()=>{Ul=P(Ko()),SA=P(Jo()),EA=P(Yo()),Bl=P(lo()),CA=P(nr());st();bA=P(Ri()),wA=P(ln()),$l=P(br()),xg=P(ee());wg();Ol();fA();vA();ir=class extends xg.Client{config;constructor(...[t]){let r=pA(t||{});super(r),this.initConfig=r;let n=DI(r),s=(0,Bl.resolveUserAgentConfig)(n),o=(0,$l.resolveRetryConfig)(s),i=(0,CA.resolveRegionConfig)(o),a=(0,Ul.resolveHostHeaderConfig)(i),c=(0,wA.resolveEndpointConfig)(a),d=OI(c),l=_A(d,t?.extensions||[]);this.config=l,this.middlewareStack.use((0,Bl.getUserAgentPlugin)(this.config)),this.middlewareStack.use((0,$l.getRetryPlugin)(this.config)),this.middlewareStack.use((0,bA.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,Ul.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,SA.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,EA.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use(Xo(this.config,{httpAuthSchemeParametersProvider:II,identityProviderConfigProvider:async u=>new as({"aws.auth#sigv4":u.credentials})})),this.middlewareStack.use(ei(this.config))}destroy(){super.destroy()}}});var TA,it,zl=C(()=>{TA=P(ee()),it=class e extends TA.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}});var Ig,Ag,Og,ma,pa,fa,ga,ha,ya,Dg,Rg,_a,va=C(()=>{Ig=P(ee());zl();Ag=e=>({...e,...e.SecretAccessKey&&{SecretAccessKey:Ig.SENSITIVE_STRING}}),Og=e=>({...e,...e.Credentials&&{Credentials:Ag(e.Credentials)}}),ma=class e extends it{name="ExpiredTokenException";$fault="client";constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},pa=class e extends it{name="MalformedPolicyDocumentException";$fault="client";constructor(t){super({name:"MalformedPolicyDocumentException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},fa=class e extends it{name="PackedPolicyTooLargeException";$fault="client";constructor(t){super({name:"PackedPolicyTooLargeException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ga=class e extends it{name="RegionDisabledException";$fault="client";constructor(t){super({name:"RegionDisabledException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ha=class e extends it{name="IDPRejectedClaimException";$fault="client";constructor(t){super({name:"IDPRejectedClaimException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},ya=class e extends it{name="InvalidIdentityTokenException";$fault="client";constructor(t){super({name:"InvalidIdentityTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}},Dg=e=>({...e,...e.WebIdentityToken&&{WebIdentityToken:Ig.SENSITIVE_STRING}}),Rg=e=>({...e,...e.Credentials&&{Credentials:Ag(e.Credentials)}}),_a=class e extends it{name="IDPCommunicationErrorException";$fault="client";constructor(t){super({name:"IDPCommunicationErrorException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype)}}});var PA,X,xA,IA,AA,OA,DA,$8,z8,H8,q8,G8,V8,W8,Z8,K8,RA,J8,Y8,Q8,X8,e6,t6,NA,r6,n6,LA,s6,o6,i6,a6,c6,d6,l6,Ar,u6,kA,MA,FA,jA,Ng,m6,Lg,Ao,p6,kg,Mg,Oo,Fg,Do,jg,Ug,Bg,Ro,No,$g,zg,Hg,Lo,qg,ko,Mo,Gg,Vg,Ir,Wg,Zg,Kg,Jg,Yg,UA,Qg,Xg,eh,we,BA,f6,th=C(()=>{Ne();PA=P(ge()),X=P(ee());va();zl();xA=async(e,t)=>{let r=MA,n;return n=BA({...Z8(e,t),[jA]:m6,[UA]:FA}),kA(t,r,"/",void 0,n)},IA=async(e,t)=>{let r=MA,n;return n=BA({...K8(e,t),[jA]:p6,[UA]:FA}),kA(t,r,"/",void 0,n)},AA=async(e,t)=>{if(e.statusCode>=300)return DA(e,t);let r=await Ai(e.body,t),n={};return n=r6(r.AssumeRoleResult,t),{$metadata:Ar(e),...n}},OA=async(e,t)=>{if(e.statusCode>=300)return DA(e,t);let r=await Ai(e.body,t),n={};return n=n6(r.AssumeRoleWithWebIdentityResult,t),{$metadata:Ar(e),...n}},DA=async(e,t)=>{let r={...e,body:await pf(e.body,t)},n=f6(e,r.body);switch(n){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await $8(r,t);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await G8(r,t);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await V8(r,t);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await W8(r,t);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await z8(r,t);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await H8(r,t);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await q8(r,t);default:let s=r.body;return u6({output:e,parsedBody:s.Error,errorCode:n})}},$8=async(e,t)=>{let r=e.body,n=s6(r.Error,t),s=new ma({$metadata:Ar(e),...n});return(0,X.decorateServiceException)(s,r)},z8=async(e,t)=>{let r=e.body,n=o6(r.Error,t),s=new _a({$metadata:Ar(e),...n});return(0,X.decorateServiceException)(s,r)},H8=async(e,t)=>{let r=e.body,n=i6(r.Error,t),s=new ha({$metadata:Ar(e),...n});return(0,X.decorateServiceException)(s,r)},q8=async(e,t)=>{let r=e.body,n=a6(r.Error,t),s=new ya({$metadata:Ar(e),...n});return(0,X.decorateServiceException)(s,r)},G8=async(e,t)=>{let r=e.body,n=c6(r.Error,t),s=new pa({$metadata:Ar(e),...n});return(0,X.decorateServiceException)(s,r)},V8=async(e,t)=>{let r=e.body,n=d6(r.Error,t),s=new fa({$metadata:Ar(e),...n});return(0,X.decorateServiceException)(s,r)},W8=async(e,t)=>{let r=e.body,n=l6(r.Error,t),s=new ga({$metadata:Ar(e),...n});return(0,X.decorateServiceException)(s,r)},Z8=(e,t)=>{let r={};if(e[ko]!=null&&(r[ko]=e[ko]),e[Mo]!=null&&(r[Mo]=e[Mo]),e[No]!=null){let n=RA(e[No],t);e[No]?.length===0&&(r.PolicyArns=[]),Object.entries(n).forEach(([s,o])=>{let i=`PolicyArns.${s}`;r[i]=o})}if(e[Ro]!=null&&(r[Ro]=e[Ro]),e[Do]!=null&&(r[Do]=e[Do]),e[Kg]!=null){let n=t6(e[Kg],t);e[Kg]?.length===0&&(r.Tags=[]),Object.entries(n).forEach(([s,o])=>{let i=`Tags.${s}`;r[i]=o})}if(e[Yg]!=null){let n=e6(e[Yg],t);e[Yg]?.length===0&&(r.TransitiveTagKeys=[]),Object.entries(n).forEach(([s,o])=>{let i=`TransitiveTagKeys.${s}`;r[i]=o})}if(e[Ug]!=null&&(r[Ug]=e[Ug]),e[Wg]!=null&&(r[Wg]=e[Wg]),e[Jg]!=null&&(r[Jg]=e[Jg]),e[Ir]!=null&&(r[Ir]=e[Ir]),e[zg]!=null){let n=Q8(e[zg],t);e[zg]?.length===0&&(r.ProvidedContexts=[]),Object.entries(n).forEach(([s,o])=>{let i=`ProvidedContexts.${s}`;r[i]=o})}return r},K8=(e,t)=>{let r={};if(e[ko]!=null&&(r[ko]=e[ko]),e[Mo]!=null&&(r[Mo]=e[Mo]),e[Xg]!=null&&(r[Xg]=e[Xg]),e[Hg]!=null&&(r[Hg]=e[Hg]),e[No]!=null){let n=RA(e[No],t);e[No]?.length===0&&(r.PolicyArns=[]),Object.entries(n).forEach(([s,o])=>{let i=`PolicyArns.${s}`;r[i]=o})}return e[Ro]!=null&&(r[Ro]=e[Ro]),e[Do]!=null&&(r[Do]=e[Do]),r},RA=(e,t)=>{let r={},n=1;for(let s of e){if(s===null)continue;let o=J8(s,t);Object.entries(o).forEach(([i,a])=>{r[`member.${n}.${i}`]=a}),n++}return r},J8=(e,t)=>{let r={};return e[eh]!=null&&(r[eh]=e[eh]),r},Y8=(e,t)=>{let r={};return e[$g]!=null&&(r[$g]=e[$g]),e[Fg]!=null&&(r[Fg]=e[Fg]),r},Q8=(e,t)=>{let r={},n=1;for(let s of e){if(s===null)continue;let o=Y8(s,t);Object.entries(o).forEach(([i,a])=>{r[`member.${n}.${i}`]=a}),n++}return r},X8=(e,t)=>{let r={};return e[Bg]!=null&&(r[Bg]=e[Bg]),e[Qg]!=null&&(r[Qg]=e[Qg]),r},e6=(e,t)=>{let r={},n=1;for(let s of e)s!==null&&(r[`member.${n}`]=s,n++);return r},t6=(e,t)=>{let r={},n=1;for(let s of e){if(s===null)continue;let o=X8(s,t);Object.entries(o).forEach(([i,a])=>{r[`member.${n}.${i}`]=a}),n++}return r},NA=(e,t)=>{let r={};return e[Lg]!=null&&(r[Lg]=(0,X.expectString)(e[Lg])),e[kg]!=null&&(r[kg]=(0,X.expectString)(e[kg])),r},r6=(e,t)=>{let r={};return e[Oo]!=null&&(r[Oo]=LA(e[Oo],t)),e[Ao]!=null&&(r[Ao]=NA(e[Ao],t)),e[Lo]!=null&&(r[Lo]=(0,X.strictParseInt32)(e[Lo])),e[Ir]!=null&&(r[Ir]=(0,X.expectString)(e[Ir])),r},n6=(e,t)=>{let r={};return e[Oo]!=null&&(r[Oo]=LA(e[Oo],t)),e[Vg]!=null&&(r[Vg]=(0,X.expectString)(e[Vg])),e[Ao]!=null&&(r[Ao]=NA(e[Ao],t)),e[Lo]!=null&&(r[Lo]=(0,X.strictParseInt32)(e[Lo])),e[qg]!=null&&(r[qg]=(0,X.expectString)(e[qg])),e[Mg]!=null&&(r[Mg]=(0,X.expectString)(e[Mg])),e[Ir]!=null&&(r[Ir]=(0,X.expectString)(e[Ir])),r},LA=(e,t)=>{let r={};return e[Ng]!=null&&(r[Ng]=(0,X.expectString)(e[Ng])),e[Gg]!=null&&(r[Gg]=(0,X.expectString)(e[Gg])),e[Zg]!=null&&(r[Zg]=(0,X.expectString)(e[Zg])),e[jg]!=null&&(r[jg]=(0,X.expectNonNull)((0,X.parseRfc3339DateTimeWithOffset)(e[jg]))),r},s6=(e,t)=>{let r={};return e[we]!=null&&(r[we]=(0,X.expectString)(e[we])),r},o6=(e,t)=>{let r={};return e[we]!=null&&(r[we]=(0,X.expectString)(e[we])),r},i6=(e,t)=>{let r={};return e[we]!=null&&(r[we]=(0,X.expectString)(e[we])),r},a6=(e,t)=>{let r={};return e[we]!=null&&(r[we]=(0,X.expectString)(e[we])),r},c6=(e,t)=>{let r={};return e[we]!=null&&(r[we]=(0,X.expectString)(e[we])),r},d6=(e,t)=>{let r={};return e[we]!=null&&(r[we]=(0,X.expectString)(e[we])),r},l6=(e,t)=>{let r={};return e[we]!=null&&(r[we]=(0,X.expectString)(e[we])),r},Ar=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),u6=(0,X.withBaseException)(it),kA=async(e,t,r,n,s)=>{let{hostname:o,protocol:i="https",port:a,path:c}=await e.endpoint(),d={protocol:i,hostname:o,port:a,method:"POST",path:c.endsWith("/")?c.slice(0,-1)+r:c+r,headers:t};return n!==void 0&&(d.hostname=n),s!==void 0&&(d.body=s),new PA.HttpRequest(d)},MA={"content-type":"application/x-www-form-urlencoded"},FA="2011-06-15",jA="Action",Ng="AccessKeyId",m6="AssumeRole",Lg="AssumedRoleId",Ao="AssumedRoleUser",p6="AssumeRoleWithWebIdentity",kg="Arn",Mg="Audience",Oo="Credentials",Fg="ContextAssertion",Do="DurationSeconds",jg="Expiration",Ug="ExternalId",Bg="Key",Ro="Policy",No="PolicyArns",$g="ProviderArn",zg="ProvidedContexts",Hg="ProviderId",Lo="PackedPolicySize",qg="Provider",ko="RoleArn",Mo="RoleSessionName",Gg="SecretAccessKey",Vg="SubjectFromWebIdentityToken",Ir="SourceIdentity",Wg="SerialNumber",Zg="SessionToken",Kg="Tags",Jg="TokenCode",Yg="TransitiveTagKeys",UA="Version",Qg="Value",Xg="WebIdentityToken",eh="arn",we="message",BA=e=>Object.entries(e).map(([t,r])=>(0,X.extendedEncodeURIComponent)(t)+"="+(0,X.extendedEncodeURIComponent)(r)).join("&"),f6=(e,t)=>{if(t.Error?.Code!==void 0)return t.Error.Code;if(e.statusCode==404)return"NotFound"}});var $A,zA,HA,ws,Hl=C(()=>{$A=P(ln()),zA=P(Vr()),HA=P(ee());Ol();va();th();ws=class extends HA.Command.classBuilder().ep(Al).m(function(t,r,n,s){return[(0,zA.getSerdePlugin)(n,this.serialize,this.deserialize),(0,$A.getEndpointPlugin)(n,t.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").f(void 0,Og).ser(xA).de(AA).build(){}});var qA,GA,VA,Ts,ql=C(()=>{qA=P(ln()),GA=P(Vr()),VA=P(ee());Ol();va();th();Ts=class extends VA.Command.classBuilder().ep(Al).m(function(t,r,n,s){return[(0,GA.getSerdePlugin)(n,this.serialize,this.deserialize),(0,qA.getEndpointPlugin)(n,t.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").f(Dg,Rg).ser(IA).de(OA).build(){}});var WA,g6,Gl,ZA=C(()=>{WA=P(ee());Hl();ql();ua();g6={AssumeRoleCommand:ws,AssumeRoleWithWebIdentityCommand:Ts},Gl=class extends ir{};(0,WA.createAggregatedClient)(g6,Gl)});var KA=C(()=>{Hl();ql()});var JA=C(()=>{va()});var YA,QA,XA,eO,tO,rO,nO=C(()=>{Bt();Hl();ql();YA="us-east-1",QA=e=>{if(typeof e?.Arn=="string"){let t=e.Arn.split(":");if(t.length>4&&t[4]!=="")return t[4]}},XA=async(e,t,r)=>{let n=typeof e=="function"?await e():e,s=typeof t=="function"?await t():t;return r?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${n} (provider)`,`${s} (parent client)`,`${YA} (STS default)`),n??s??YA},eO=(e,t)=>{let r,n;return async(s,o)=>{if(n=s,!r){let{logger:l=e?.parentClientConfig?.logger,region:u,requestHandler:m=e?.parentClientConfig?.requestHandler,credentialProviderLogger:p}=e,h=await XA(u,e?.parentClientConfig?.region,p),y=!rO(m);r=new t({profile:e?.parentClientConfig?.profile,credentialDefaultProvider:()=>async()=>n,region:h,requestHandler:y?m:void 0,logger:l})}let{Credentials:i,AssumedRoleUser:a}=await r.send(new ws(o));if(!i||!i.AccessKeyId||!i.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${o.RoleArn}`);let c=QA(a),d={accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,sessionToken:i.SessionToken,expiration:i.Expiration,...i.CredentialScope&&{credentialScope:i.CredentialScope},...c&&{accountId:c}};return Xr(d,"CREDENTIALS_STS_ASSUME_ROLE","i"),d}},tO=(e,t)=>{let r;return async n=>{if(!r){let{logger:c=e?.parentClientConfig?.logger,region:d,requestHandler:l=e?.parentClientConfig?.requestHandler,credentialProviderLogger:u}=e,m=await XA(d,e?.parentClientConfig?.region,u),p=!rO(l);r=new t({profile:e?.parentClientConfig?.profile,region:m,requestHandler:p?l:void 0,logger:c})}let{Credentials:s,AssumedRoleUser:o}=await r.send(new Ts(n));if(!s||!s.AccessKeyId||!s.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${n.RoleArn}`);let i=QA(o),a={accessKeyId:s.AccessKeyId,secretAccessKey:s.SecretAccessKey,sessionToken:s.SessionToken,expiration:s.Expiration,...s.CredentialScope&&{credentialScope:s.CredentialScope},...i&&{accountId:i}};return i&&Xr(a,"RESOLVED_ACCOUNT_ID","T"),Xr(a,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),a}},rO=e=>e?.metadata?.handlerProtocol==="h2"});var sO,oO,iO,h6,aO=C(()=>{nO();ua();sO=(e,t)=>t?class extends e{constructor(n){super(n);for(let s of t)this.middlewareStack.use(s)}}:e,oO=(e={},t)=>eO(e,sO(ir,t)),iO=(e={},t)=>tO(e,sO(ir,t)),h6=e=>t=>e({roleAssumer:oO(t),roleAssumerWithWebIdentity:iO(t),...t})});var rh={};dt(rh,{AssumeRoleCommand:()=>ws,AssumeRoleResponseFilterSensitiveLog:()=>Og,AssumeRoleWithWebIdentityCommand:()=>Ts,AssumeRoleWithWebIdentityRequestFilterSensitiveLog:()=>Dg,AssumeRoleWithWebIdentityResponseFilterSensitiveLog:()=>Rg,CredentialsFilterSensitiveLog:()=>Ag,ExpiredTokenException:()=>ma,IDPCommunicationErrorException:()=>_a,IDPRejectedClaimException:()=>ha,InvalidIdentityTokenException:()=>ya,MalformedPolicyDocumentException:()=>pa,PackedPolicyTooLargeException:()=>fa,RegionDisabledException:()=>ga,STS:()=>Gl,STSClient:()=>ir,STSServiceException:()=>it,__Client:()=>xg.Client,decorateDefaultCredentialProvider:()=>h6,getDefaultRoleAssumer:()=>oO,getDefaultRoleAssumerWithWebIdentity:()=>iO});var nh=C(()=>{ua();ZA();KA();JA();aO();zl()});var ih=b((Zle,lO)=>{"use strict";var Vl=Object.defineProperty,y6=Object.getOwnPropertyDescriptor,_6=Object.getOwnPropertyNames,v6=Object.prototype.hasOwnProperty,oh=(e,t)=>Vl(e,"name",{value:t,configurable:!0}),S6=(e,t)=>{for(var r in t)Vl(e,r,{get:t[r],enumerable:!0})},E6=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of _6(t))!v6.call(e,s)&&s!==r&&Vl(e,s,{get:()=>t[s],enumerable:!(n=y6(t,s))||n.enumerable});return e},C6=e=>E6(Vl({},"__esModule",{value:!0}),e),dO={};S6(dO,{fromProcess:()=>I6});lO.exports=C6(dO);var cO=cn(),sh=Qe(),b6=require("child_process"),w6=require("util"),T6=(Bt(),re(en)),P6=oh((e,t,r)=>{if(t.Version!==1)throw Error(`Profile ${e} credential_process did not return Version 1.`);if(t.AccessKeyId===void 0||t.SecretAccessKey===void 0)throw Error(`Profile ${e} credential_process returned invalid credentials.`);if(t.Expiration){let o=new Date;if(new Date(t.Expiration)<o)throw Error(`Profile ${e} credential_process returned expired credentials.`)}let n=t.AccountId;!n&&r?.[e]?.aws_account_id&&(n=r[e].aws_account_id);let s={accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,...t.SessionToken&&{sessionToken:t.SessionToken},...t.Expiration&&{expiration:new Date(t.Expiration)},...t.CredentialScope&&{credentialScope:t.CredentialScope},...n&&{accountId:n}};return(0,T6.setCredentialFeature)(s,"CREDENTIALS_PROCESS","w"),s},"getValidatedProcessCredentials"),x6=oh(async(e,t,r)=>{let n=t[e];if(t[e]){let s=n.credential_process;if(s!==void 0){let o=(0,w6.promisify)(b6.exec);try{let{stdout:i}=await o(s),a;try{a=JSON.parse(i.trim())}catch{throw Error(`Profile ${e} credential_process returned invalid JSON.`)}return P6(e,a,t)}catch(i){throw new sh.CredentialsProviderError(i.message,{logger:r})}}else throw new sh.CredentialsProviderError(`Profile ${e} did not contain credential_process.`,{logger:r})}else throw new sh.CredentialsProviderError(`Profile ${e} could not be found in shared credentials file.`,{logger:r})},"resolveProcessCredentials"),I6=oh((e={})=>async({callerClientConfig:t}={})=>{e.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");let r=await(0,cO.parseKnownFiles)(e);return x6((0,cO.getProfileName)({profile:e.profile??t?.profile}),r,e.logger)},"fromProcess")});var ah=b(cr=>{"use strict";var A6=cr&&cr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),O6=cr&&cr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),D6=cr&&cr.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[n.length]=s);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),s=0;s<n.length;s++)n[s]!=="default"&&A6(r,t,n[s]);return O6(r,t),r}}();Object.defineProperty(cr,"__esModule",{value:!0});cr.fromWebToken=void 0;var R6=e=>async t=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:r,roleSessionName:n,webIdentityToken:s,providerId:o,policyArns:i,policy:a,durationSeconds:c}=e,{roleAssumerWithWebIdentity:d}=e;if(!d){let{getDefaultRoleAssumerWithWebIdentity:l}=await Promise.resolve().then(()=>D6((nh(),re(rh))));d=l({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...t?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return d({RoleArn:r,RoleSessionName:n??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:s,ProviderId:o,PolicyArns:i,Policy:a,DurationSeconds:c})};cr.fromWebToken=R6});var mO=b(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.fromTokenFile=void 0;var N6=(Bt(),re(en)),L6=Qe(),k6=require("fs"),M6=ah(),uO="AWS_WEB_IDENTITY_TOKEN_FILE",F6="AWS_ROLE_ARN",j6="AWS_ROLE_SESSION_NAME",U6=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");let t=e?.webIdentityTokenFile??process.env[uO],r=e?.roleArn??process.env[F6],n=e?.roleSessionName??process.env[j6];if(!t||!r)throw new L6.CredentialsProviderError("Web identity configuration not specified",{logger:e.logger});let s=await(0,M6.fromWebToken)({...e,webIdentityToken:(0,k6.readFileSync)(t,{encoding:"ascii"}),roleArn:r,roleSessionName:n})();return t===process.env[uO]&&(0,N6.setCredentialFeature)(s,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h"),s};Wl.fromTokenFile=U6});var lh=b((Yle,Zl)=>{"use strict";var pO=Object.defineProperty,B6=Object.getOwnPropertyDescriptor,$6=Object.getOwnPropertyNames,z6=Object.prototype.hasOwnProperty,ch=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $6(t))!z6.call(e,s)&&s!==r&&pO(e,s,{get:()=>t[s],enumerable:!(n=B6(t,s))||n.enumerable});return e},fO=(e,t,r)=>(ch(e,t,"default"),r&&ch(r,t,"default")),H6=e=>ch(pO({},"__esModule",{value:!0}),e),dh={};Zl.exports=H6(dh);fO(dh,mO(),Zl.exports);fO(dh,ah(),Zl.exports)});var CO=b((Qle,EO)=>{"use strict";var q6=Object.create,Ea=Object.defineProperty,G6=Object.getOwnPropertyDescriptor,V6=Object.getOwnPropertyNames,W6=Object.getPrototypeOf,Z6=Object.prototype.hasOwnProperty,Oe=(e,t)=>Ea(e,"name",{value:t,configurable:!0}),K6=(e,t)=>{for(var r in t)Ea(e,r,{get:t[r],enumerable:!0})},_O=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of V6(t))!Z6.call(e,s)&&s!==r&&Ea(e,s,{get:()=>t[s],enumerable:!(n=G6(t,s))||n.enumerable});return e},En=(e,t,r)=>(r=e!=null?q6(W6(e)):{},_O(t||!e||!e.__esModule?Ea(r,"default",{value:e,enumerable:!0}):r,e)),J6=e=>_O(Ea({},"__esModule",{value:!0}),e),vO={};K6(vO,{fromIni:()=>c5});EO.exports=J6(vO);var mh=cn(),Cn=(Bt(),re(en)),Sa=Qe(),Y6=Oe((e,t,r)=>{let n={EcsContainer:Oe(async s=>{let{fromHttp:o}=await Promise.resolve().then(()=>En(Jf())),{fromContainerMetadata:i}=await Promise.resolve().then(()=>En(Mi()));return r?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),async()=>(0,Sa.chain)(o(s??{}),i(s))().then(uh)},"EcsContainer"),Ec2InstanceMetadata:Oe(async s=>{r?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");let{fromInstanceMetadata:o}=await Promise.resolve().then(()=>En(Mi()));return async()=>o(s)().then(uh)},"Ec2InstanceMetadata"),Environment:Oe(async s=>{r?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");let{fromEnv:o}=await Promise.resolve().then(()=>En(Hf()));return async()=>o(s)().then(uh)},"Environment")};if(e in n)return n[e];throw new Sa.CredentialsProviderError(`Unsupported credential source in profile ${t}. Got ${e}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:r})},"resolveCredentialSource"),uh=Oe(e=>(0,Cn.setCredentialFeature)(e,"CREDENTIALS_PROFILE_NAMED_PROVIDER","p"),"setNamedProvider"),Q6=Oe((e,{profile:t="default",logger:r}={})=>!!e&&typeof e=="object"&&typeof e.role_arn=="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1&&["undefined","string"].indexOf(typeof e.external_id)>-1&&["undefined","string"].indexOf(typeof e.mfa_serial)>-1&&(X6(e,{profile:t,logger:r})||e5(e,{profile:t,logger:r})),"isAssumeRoleProfile"),X6=Oe((e,{profile:t,logger:r})=>{let n=typeof e.source_profile=="string"&&typeof e.credential_source>"u";return n&&r?.debug?.(` ${t} isAssumeRoleWithSourceProfile source_profile=${e.source_profile}`),n},"isAssumeRoleWithSourceProfile"),e5=Oe((e,{profile:t,logger:r})=>{let n=typeof e.credential_source=="string"&&typeof e.source_profile>"u";return n&&r?.debug?.(` ${t} isCredentialSourceProfile credential_source=${e.credential_source}`),n},"isCredentialSourceProfile"),t5=Oe(async(e,t,r,n={})=>{r.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");let s=t[e],{source_profile:o,region:i}=s;if(!r.roleAssumer){let{getDefaultRoleAssumer:c}=await Promise.resolve().then(()=>En((nh(),re(rh))));r.roleAssumer=c({...r.clientConfig,credentialProviderLogger:r.logger,parentClientConfig:{...r?.parentClientConfig,region:i??r?.parentClientConfig?.region}},r.clientPlugins)}if(o&&o in n)throw new Sa.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${(0,mh.getProfileName)(r)}. Profiles visited: `+Object.keys(n).join(", "),{logger:r.logger});r.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${o?`source_profile=[${o}]`:`profile=[${e}]`}`);let a=o?SO(o,t,r,{...n,[o]:!0},gO(t[o]??{})):(await Y6(s.credential_source,e,r.logger)(r))();if(gO(s))return a.then(c=>(0,Cn.setCredentialFeature)(c,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"));{let c={RoleArn:s.role_arn,RoleSessionName:s.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:s.external_id,DurationSeconds:parseInt(s.duration_seconds||"3600",10)},{mfa_serial:d}=s;if(d){if(!r.mfaCodeProvider)throw new Sa.CredentialsProviderError(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:r.logger,tryNextLink:!1});c.SerialNumber=d,c.TokenCode=await r.mfaCodeProvider(d)}let l=await a;return r.roleAssumer(l,c).then(u=>(0,Cn.setCredentialFeature)(u,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"))}},"resolveAssumeRoleCredentials"),gO=Oe(e=>!e.role_arn&&!!e.credential_source,"isCredentialSourceWithoutRoleArn"),r5=Oe(e=>!!e&&typeof e=="object"&&typeof e.credential_process=="string","isProcessProfile"),n5=Oe(async(e,t)=>Promise.resolve().then(()=>En(ih())).then(({fromProcess:r})=>r({...e,profile:t})().then(n=>(0,Cn.setCredentialFeature)(n,"CREDENTIALS_PROFILE_PROCESS","v"))),"resolveProcessCredentials"),s5=Oe(async(e,t,r={})=>{let{fromSSO:n}=await Promise.resolve().then(()=>En(bg()));return n({profile:e,logger:r.logger,parentClientConfig:r.parentClientConfig,clientConfig:r.clientConfig})().then(s=>t.sso_session?(0,Cn.setCredentialFeature)(s,"CREDENTIALS_PROFILE_SSO","r"):(0,Cn.setCredentialFeature)(s,"CREDENTIALS_PROFILE_SSO_LEGACY","t"))},"resolveSsoCredentials"),o5=Oe(e=>e&&(typeof e.sso_start_url=="string"||typeof e.sso_account_id=="string"||typeof e.sso_session=="string"||typeof e.sso_region=="string"||typeof e.sso_role_name=="string"),"isSsoProfile"),hO=Oe(e=>!!e&&typeof e=="object"&&typeof e.aws_access_key_id=="string"&&typeof e.aws_secret_access_key=="string"&&["undefined","string"].indexOf(typeof e.aws_session_token)>-1&&["undefined","string"].indexOf(typeof e.aws_account_id)>-1,"isStaticCredsProfile"),yO=Oe(async(e,t)=>{t?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");let r={accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token,...e.aws_credential_scope&&{credentialScope:e.aws_credential_scope},...e.aws_account_id&&{accountId:e.aws_account_id}};return(0,Cn.setCredentialFeature)(r,"CREDENTIALS_PROFILE","n")},"resolveStaticCredentials"),i5=Oe(e=>!!e&&typeof e=="object"&&typeof e.web_identity_token_file=="string"&&typeof e.role_arn=="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1,"isWebIdentityProfile"),a5=Oe(async(e,t)=>Promise.resolve().then(()=>En(lh())).then(({fromTokenFile:r})=>r({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:t.roleAssumerWithWebIdentity,logger:t.logger,parentClientConfig:t.parentClientConfig})().then(n=>(0,Cn.setCredentialFeature)(n,"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN","q"))),"resolveWebIdentityCredentials"),SO=Oe(async(e,t,r,n={},s=!1)=>{let o=t[e];if(Object.keys(n).length>0&&hO(o))return yO(o,r);if(s||Q6(o,{profile:e,logger:r.logger}))return t5(e,t,r,n);if(hO(o))return yO(o,r);if(i5(o))return a5(o,r);if(r5(o))return n5(r,e);if(o5(o))return await s5(e,o,r);throw new Sa.CredentialsProviderError(`Could not resolve credentials using profile: [${e}] in configuration/credentials file(s).`,{logger:r.logger})},"resolveProfileData"),c5=Oe((e={})=>async({callerClientConfig:t}={})=>{let r={...e,parentClientConfig:{...t,...e.parentClientConfig}};r.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");let n=await(0,mh.parseKnownFiles)(r);return SO((0,mh.getProfileName)({profile:e.profile??t?.profile}),n,r)},"fromIni")});var OO=b((Xle,AO)=>{"use strict";var d5=Object.create,Ca=Object.defineProperty,l5=Object.getOwnPropertyDescriptor,u5=Object.getOwnPropertyNames,m5=Object.getPrototypeOf,p5=Object.prototype.hasOwnProperty,Kl=(e,t)=>Ca(e,"name",{value:t,configurable:!0}),f5=(e,t)=>{for(var r in t)Ca(e,r,{get:t[r],enumerable:!0})},TO=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of u5(t))!p5.call(e,s)&&s!==r&&Ca(e,s,{get:()=>t[s],enumerable:!(n=l5(t,s))||n.enumerable});return e},Fo=(e,t,r)=>(r=e!=null?d5(m5(e)):{},TO(t||!e||!e.__esModule?Ca(r,"default",{value:e,enumerable:!0}):r,e)),g5=e=>TO(Ca({},"__esModule",{value:!0}),e),PO={};f5(PO,{credentialsTreatedAsExpired:()=>IO,credentialsWillNeedRefresh:()=>xO,defaultProvider:()=>_5});AO.exports=g5(PO);var ph=Hf(),h5=cn(),Ps=Qe(),bO="AWS_EC2_METADATA_DISABLED",y5=Kl(async e=>{let{ENV_CMDS_FULL_URI:t,ENV_CMDS_RELATIVE_URI:r,fromContainerMetadata:n,fromInstanceMetadata:s}=await Promise.resolve().then(()=>Fo(Mi()));if(process.env[r]||process.env[t]){e.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");let{fromHttp:o}=await Promise.resolve().then(()=>Fo(Jf()));return(0,Ps.chain)(o(e),n(e))}return process.env[bO]&&process.env[bO]!=="false"?async()=>{throw new Ps.CredentialsProviderError("EC2 Instance Metadata Service access disabled",{logger:e.logger})}:(e.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),s(e))},"remoteProvider"),wO=!1,_5=Kl((e={})=>(0,Ps.memoize)((0,Ps.chain)(async()=>{if(e.profile??process.env[h5.ENV_PROFILE])throw process.env[ph.ENV_KEY]&&process.env[ph.ENV_SECRET]&&(wO||((e.logger?.warn&&e.logger?.constructor?.name!=="NoOpLogger"?e.logger.warn:console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
53
- Multiple credential sources detected:
54
- Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
55
- This SDK will proceed with the AWS_PROFILE value.
56
-
57
- However, a future version may change this behavior to prefer the ENV static credentials.
58
- Please ensure that your environment only sets either the AWS_PROFILE or the
59
- AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
60
- `),wO=!0)),new Ps.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.",{logger:e.logger,tryNextLink:!0});return e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),(0,ph.fromEnv)(e)()},async()=>{e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");let{ssoStartUrl:t,ssoAccountId:r,ssoRegion:n,ssoRoleName:s,ssoSession:o}=e;if(!t&&!r&&!n&&!s&&!o)throw new Ps.CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:e.logger});let{fromSSO:i}=await Promise.resolve().then(()=>Fo(bg()));return i(e)()},async()=>{e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:t}=await Promise.resolve().then(()=>Fo(CO()));return t(e)()},async()=>{e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:t}=await Promise.resolve().then(()=>Fo(ih()));return t(e)()},async()=>{e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:t}=await Promise.resolve().then(()=>Fo(lh()));return t(e)()},async()=>(e.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await y5(e))()),async()=>{throw new Ps.CredentialsProviderError("Could not load credentials from any providers",{tryNextLink:!1,logger:e.logger})}),IO,xO),"defaultProvider"),xO=Kl(e=>e?.expiration!==void 0,"credentialsWillNeedRefresh"),IO=Kl(e=>e?.expiration!==void 0&&e.expiration.getTime()-Date.now()<3e5,"credentialsTreatedAsExpired")});var NO=b((eue,RO)=>{var Jl=Object.defineProperty,v5=Object.getOwnPropertyDescriptor,S5=Object.getOwnPropertyNames,E5=Object.prototype.hasOwnProperty,C5=(e,t)=>Jl(e,"name",{value:t,configurable:!0}),b5=(e,t)=>{for(var r in t)Jl(e,r,{get:t[r],enumerable:!0})},w5=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of S5(t))!E5.call(e,s)&&s!==r&&Jl(e,s,{get:()=>t[s],enumerable:!(n=v5(t,s))||n.enumerable});return e},T5=e=>w5(Jl({},"__esModule",{value:!0}),e),DO={};b5(DO,{isArrayBuffer:()=>P5});RO.exports=T5(DO);var P5=C5(e=>typeof ArrayBuffer=="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]","isArrayBuffer")});var FO=b((tue,MO)=>{var Yl=Object.defineProperty,x5=Object.getOwnPropertyDescriptor,I5=Object.getOwnPropertyNames,A5=Object.prototype.hasOwnProperty,LO=(e,t)=>Yl(e,"name",{value:t,configurable:!0}),O5=(e,t)=>{for(var r in t)Yl(e,r,{get:t[r],enumerable:!0})},D5=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of I5(t))!A5.call(e,s)&&s!==r&&Yl(e,s,{get:()=>t[s],enumerable:!(n=x5(t,s))||n.enumerable});return e},R5=e=>D5(Yl({},"__esModule",{value:!0}),e),kO={};O5(kO,{fromArrayBuffer:()=>L5,fromString:()=>k5});MO.exports=R5(kO);var N5=NO(),fh=require("buffer"),L5=LO((e,t=0,r=e.byteLength-t)=>{if(!(0,N5.isArrayBuffer)(e))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return fh.Buffer.from(e,t,r)},"fromArrayBuffer"),k5=LO((e,t)=>{if(typeof e!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?fh.Buffer.from(e,t):fh.Buffer.from(e)},"fromString")});var zO=b((rue,$O)=>{var Ql=Object.defineProperty,M5=Object.getOwnPropertyDescriptor,F5=Object.getOwnPropertyNames,j5=Object.prototype.hasOwnProperty,gh=(e,t)=>Ql(e,"name",{value:t,configurable:!0}),U5=(e,t)=>{for(var r in t)Ql(e,r,{get:t[r],enumerable:!0})},B5=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of F5(t))!j5.call(e,s)&&s!==r&&Ql(e,s,{get:()=>t[s],enumerable:!(n=M5(t,s))||n.enumerable});return e},$5=e=>B5(Ql({},"__esModule",{value:!0}),e),jO={};U5(jO,{fromUtf8:()=>BO,toUint8Array:()=>z5,toUtf8:()=>H5});$O.exports=$5(jO);var UO=FO(),BO=gh(e=>{let t=(0,UO.fromString)(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),z5=gh(e=>typeof e=="string"?BO(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),"toUint8Array"),H5=gh(e=>{if(typeof e=="string")return e;if(typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return(0,UO.fromArrayBuffer)(e.buffer,e.byteOffset,e.byteLength).toString("utf8")},"toUtf8")});var HO=b(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.convertToBuffer=void 0;var q5=zO(),G5=typeof Buffer<"u"&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:q5.fromUtf8;function V5(e){return e instanceof Uint8Array?e:typeof e=="string"?G5(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}Xl.convertToBuffer=V5});var qO=b(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.isEmptyData=void 0;function W5(e){return typeof e=="string"?e.length===0:e.byteLength===0}eu.isEmptyData=W5});var GO=b(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.numToUint8=void 0;function Z5(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}tu.numToUint8=Z5});var VO=b(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.uint32ArrayFrom=void 0;function K5(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),r=0;r<e.length;)t[r]=e[r],r+=1;return t}return Uint32Array.from(e)}ru.uint32ArrayFrom=K5});var hh=b(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.uint32ArrayFrom=dr.numToUint8=dr.isEmptyData=dr.convertToBuffer=void 0;var J5=HO();Object.defineProperty(dr,"convertToBuffer",{enumerable:!0,get:function(){return J5.convertToBuffer}});var Y5=qO();Object.defineProperty(dr,"isEmptyData",{enumerable:!0,get:function(){return Y5.isEmptyData}});var Q5=GO();Object.defineProperty(dr,"numToUint8",{enumerable:!0,get:function(){return Q5.numToUint8}});var X5=VO();Object.defineProperty(dr,"uint32ArrayFrom",{enumerable:!0,get:function(){return X5.uint32ArrayFrom}})});var KO=b(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.AwsCrc32=void 0;var WO=(yo(),re(ho)),yh=hh(),ZO=su(),eZ=function(){function e(){this.crc32=new ZO.Crc32}return e.prototype.update=function(t){(0,yh.isEmptyData)(t)||this.crc32.update((0,yh.convertToBuffer)(t))},e.prototype.digest=function(){return WO.__awaiter(this,void 0,void 0,function(){return WO.__generator(this,function(t){return[2,(0,yh.numToUint8)(this.crc32.digest())]})})},e.prototype.reset=function(){this.crc32=new ZO.Crc32},e}();nu.AwsCrc32=eZ});var su=b(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.AwsCrc32=bn.Crc32=bn.crc32=void 0;var tZ=(yo(),re(ho)),rZ=hh();function nZ(e){return new JO().update(e).digest()}bn.crc32=nZ;var JO=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(t){var r,n;try{for(var s=tZ.__values(t),o=s.next();!o.done;o=s.next()){var i=o.value;this.checksum=this.checksum>>>8^oZ[(this.checksum^i)&255]}}catch(a){r={error:a}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return this},e.prototype.digest=function(){return(this.checksum^4294967295)>>>0},e}();bn.Crc32=JO;var sZ=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],oZ=(0,rZ.uint32ArrayFrom)(sZ),iZ=KO();Object.defineProperty(bn,"AwsCrc32",{enumerable:!0,get:function(){return iZ.AwsCrc32}})});var sD=b((lue,nD)=>{var iu=Object.defineProperty,aZ=Object.getOwnPropertyDescriptor,cZ=Object.getOwnPropertyNames,dZ=Object.prototype.hasOwnProperty,Or=(e,t)=>iu(e,"name",{value:t,configurable:!0}),lZ=(e,t)=>{for(var r in t)iu(e,r,{get:t[r],enumerable:!0})},uZ=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of cZ(t))!dZ.call(e,s)&&s!==r&&iu(e,s,{get:()=>t[s],enumerable:!(n=aZ(t,s))||n.enumerable});return e},mZ=e=>uZ(iu({},"__esModule",{value:!0}),e),QO={};lZ(QO,{EventStreamCodec:()=>TZ,HeaderMarshaller:()=>eD,Int64:()=>ou,MessageDecoderStream:()=>PZ,MessageEncoderStream:()=>xZ,SmithyMessageDecoderStream:()=>IZ,SmithyMessageEncoderStream:()=>AZ});nD.exports=mZ(QO);var pZ=su(),xs=Sc(),ou=class XO{constructor(t){if(this.bytes=t,t.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static{Or(this,"Int64")}static fromNumber(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);let r=new Uint8Array(8);for(let n=7,s=Math.abs(Math.round(t));n>-1&&s>0;n--,s/=256)r[n]=s;return t<0&&_h(r),new XO(r)}valueOf(){let t=this.bytes.slice(0),r=t[0]&128;return r&&_h(t),parseInt((0,xs.toHex)(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}};function _h(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}Or(_h,"negate");var eD=class{constructor(e,t){this.toUtf8=e,this.fromUtf8=t}static{Or(this,"HeaderMarshaller")}format(e){let t=[];for(let s of Object.keys(e)){let o=this.fromUtf8(s);t.push(Uint8Array.from([o.byteLength]),o,this.formatHeaderValue(e[s]))}let r=new Uint8Array(t.reduce((s,o)=>s+o.byteLength,0)),n=0;for(let s of t)r.set(s,n),n+=s.byteLength;return r}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":let t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":let r=new DataView(new ArrayBuffer(5));return r.setUint8(0,4),r.setInt32(1,e.value,!1),new Uint8Array(r.buffer);case"long":let n=new Uint8Array(9);return n[0]=5,n.set(e.value.bytes,1),n;case"binary":let s=new DataView(new ArrayBuffer(3+e.value.byteLength));s.setUint8(0,6),s.setUint16(1,e.value.byteLength,!1);let o=new Uint8Array(s.buffer);return o.set(e.value,3),o;case"string":let i=this.fromUtf8(e.value),a=new DataView(new ArrayBuffer(3+i.byteLength));a.setUint8(0,7),a.setUint16(1,i.byteLength,!1);let c=new Uint8Array(a.buffer);return c.set(i,3),c;case"timestamp":let d=new Uint8Array(9);return d[0]=8,d.set(ou.fromNumber(e.value.valueOf()).bytes,1),d;case"uuid":if(!CZ.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);let l=new Uint8Array(17);return l[0]=9,l.set((0,xs.fromHex)(e.value.replace(/\-/g,"")),1),l}}parse(e){let t={},r=0;for(;r<e.byteLength;){let n=e.getUint8(r++),s=this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+r,n));switch(r+=n,e.getUint8(r++)){case 0:t[s]={type:YO,value:!0};break;case 1:t[s]={type:YO,value:!1};break;case 2:t[s]={type:fZ,value:e.getInt8(r++)};break;case 3:t[s]={type:gZ,value:e.getInt16(r,!1)},r+=2;break;case 4:t[s]={type:hZ,value:e.getInt32(r,!1)},r+=4;break;case 5:t[s]={type:yZ,value:new ou(new Uint8Array(e.buffer,e.byteOffset+r,8))},r+=8;break;case 6:let o=e.getUint16(r,!1);r+=2,t[s]={type:_Z,value:new Uint8Array(e.buffer,e.byteOffset+r,o)},r+=o;break;case 7:let i=e.getUint16(r,!1);r+=2,t[s]={type:vZ,value:this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+r,i))},r+=i;break;case 8:t[s]={type:SZ,value:new Date(new ou(new Uint8Array(e.buffer,e.byteOffset+r,8)).valueOf())},r+=8;break;case 9:let a=new Uint8Array(e.buffer,e.byteOffset+r,16);r+=16,t[s]={type:EZ,value:`${(0,xs.toHex)(a.subarray(0,4))}-${(0,xs.toHex)(a.subarray(4,6))}-${(0,xs.toHex)(a.subarray(6,8))}-${(0,xs.toHex)(a.subarray(8,10))}-${(0,xs.toHex)(a.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return t}},YO="boolean",fZ="byte",gZ="short",hZ="integer",yZ="long",_Z="binary",vZ="string",SZ="timestamp",EZ="uuid",CZ=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,bZ=su(),tD=4,wn=tD*2,Is=4,wZ=wn+Is*2;function rD({byteLength:e,byteOffset:t,buffer:r}){if(e<wZ)throw new Error("Provided message too short to accommodate event stream message overhead");let n=new DataView(r,t,e),s=n.getUint32(0,!1);if(e!==s)throw new Error("Reported message length does not match received message length");let o=n.getUint32(tD,!1),i=n.getUint32(wn,!1),a=n.getUint32(e-Is,!1),c=new bZ.Crc32().update(new Uint8Array(r,t,wn));if(i!==c.digest())throw new Error(`The prelude checksum specified in the message (${i}) does not match the calculated CRC32 checksum (${c.digest()})`);if(c.update(new Uint8Array(r,t+wn,e-(wn+Is))),a!==c.digest())throw new Error(`The message checksum (${c.digest()}) did not match the expected value of ${a}`);return{headers:new DataView(r,t+wn+Is,o),body:new Uint8Array(r,t+wn+Is+o,s-o-(wn+Is+Is))}}Or(rD,"splitMessage");var TZ=class{static{Or(this,"EventStreamCodec")}constructor(e,t){this.headerMarshaller=new eD(e,t),this.messageBuffer=[],this.isEndOfStream=!1}feed(e){this.messageBuffer.push(this.decode(e))}endOfStream(){this.isEndOfStream=!0}getMessage(){let e=this.messageBuffer.pop(),t=this.isEndOfStream;return{getMessage(){return e},isEndOfStream(){return t}}}getAvailableMessages(){let e=this.messageBuffer;this.messageBuffer=[];let t=this.isEndOfStream;return{getMessages(){return e},isEndOfStream(){return t}}}encode({headers:e,body:t}){let r=this.headerMarshaller.format(e),n=r.byteLength+t.byteLength+16,s=new Uint8Array(n),o=new DataView(s.buffer,s.byteOffset,s.byteLength),i=new pZ.Crc32;return o.setUint32(0,n,!1),o.setUint32(4,r.byteLength,!1),o.setUint32(8,i.update(s.subarray(0,8)).digest(),!1),s.set(r,12),s.set(t,r.byteLength+12),o.setUint32(n-4,i.update(s.subarray(8,n-4)).digest(),!1),s}decode(e){let{headers:t,body:r}=rD(e);return{headers:this.headerMarshaller.parse(t),body:r}}formatHeaders(e){return this.headerMarshaller.format(e)}},PZ=class{constructor(e){this.options=e}static{Or(this,"MessageDecoderStream")}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.inputStream)yield this.options.decoder.decode(e)}},xZ=class{constructor(e){this.options=e}static{Or(this,"MessageEncoderStream")}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.messageStream)yield this.options.encoder.encode(e);this.options.includeEndFrame&&(yield new Uint8Array(0))}},IZ=class{constructor(e){this.options=e}static{Or(this,"SmithyMessageDecoderStream")}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.messageStream){let t=await this.options.deserializer(e);t!==void 0&&(yield t)}}},AZ=class{constructor(e){this.options=e}static{Or(this,"SmithyMessageEncoderStream")}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.inputStream)yield this.options.serializer(e)}}});var lD=b((yue,dD)=>{var au=Object.defineProperty,OZ=Object.getOwnPropertyDescriptor,DZ=Object.getOwnPropertyNames,RZ=Object.prototype.hasOwnProperty,jo=(e,t)=>au(e,"name",{value:t,configurable:!0}),NZ=(e,t)=>{for(var r in t)au(e,r,{get:t[r],enumerable:!0})},LZ=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of DZ(t))!RZ.call(e,s)&&s!==r&&au(e,s,{get:()=>t[s],enumerable:!(n=OZ(t,s))||n.enumerable});return e},kZ=e=>LZ(au({},"__esModule",{value:!0}),e),oD={};NZ(oD,{EventStreamMarshaller:()=>cD,eventStreamSerdeProvider:()=>MZ});dD.exports=kZ(oD);var ba=sD();function iD(e){let t=0,r=0,n=null,s=null,o=jo(a=>{if(typeof a!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+a);t=a,r=4,n=new Uint8Array(a),new DataView(n.buffer).setUint32(0,a,!1)},"allocateMessage"),i=jo(async function*(){let a=e[Symbol.asyncIterator]();for(;;){let{value:c,done:d}=await a.next();if(d){if(t)if(t===r)yield n;else throw new Error("Truncated event message received.");else return;return}let l=c.length,u=0;for(;u<l;){if(!n){let p=l-u;s||(s=new Uint8Array(4));let h=Math.min(4-r,p);if(s.set(c.slice(u,u+h),r),r+=h,u+=h,r<4)break;o(new DataView(s.buffer).getUint32(0,!1)),s=null}let m=Math.min(t-r,l-u);n.set(c.slice(u,u+m),r),r+=m,u+=m,t&&t===r&&(yield n,n=null,t=0,r=0)}}},"iterator");return{[Symbol.asyncIterator]:i}}jo(iD,"getChunkedStream");function aD(e,t){return async function(r){let{value:n}=r.headers[":message-type"];if(n==="error"){let s=new Error(r.headers[":error-message"].value||"UnknownError");throw s.name=r.headers[":error-code"].value,s}else if(n==="exception"){let s=r.headers[":exception-type"].value,o={[s]:r},i=await e(o);if(i.$unknown){let a=new Error(t(r.body));throw a.name=s,a}throw i[s]}else if(n==="event"){let s={[r.headers[":event-type"].value]:r},o=await e(s);return o.$unknown?void 0:o}else throw Error(`Unrecognizable event type: ${r.headers[":event-type"].value}`)}}jo(aD,"getMessageUnmarshaller");var cD=class{static{jo(this,"EventStreamMarshaller")}constructor({utf8Encoder:e,utf8Decoder:t}){this.eventStreamCodec=new ba.EventStreamCodec(e,t),this.utfEncoder=e}deserialize(e,t){let r=iD(e);return new ba.SmithyMessageDecoderStream({messageStream:new ba.MessageDecoderStream({inputStream:r,decoder:this.eventStreamCodec}),deserializer:aD(t,this.utfEncoder)})}serialize(e,t){return new ba.MessageEncoderStream({messageStream:new ba.SmithyMessageEncoderStream({inputStream:e,serializer:t}),encoder:this.eventStreamCodec,includeEndFrame:!0})}},MZ=jo(e=>new cD(e),"eventStreamSerdeProvider")});var gD=b((vue,fD)=>{var cu=Object.defineProperty,FZ=Object.getOwnPropertyDescriptor,jZ=Object.getOwnPropertyNames,UZ=Object.prototype.hasOwnProperty,vh=(e,t)=>cu(e,"name",{value:t,configurable:!0}),BZ=(e,t)=>{for(var r in t)cu(e,r,{get:t[r],enumerable:!0})},$Z=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of jZ(t))!UZ.call(e,s)&&s!==r&&cu(e,s,{get:()=>t[s],enumerable:!(n=FZ(t,s))||n.enumerable});return e},zZ=e=>$Z(cu({},"__esModule",{value:!0}),e),uD={};BZ(uD,{EventStreamMarshaller:()=>pD,eventStreamSerdeProvider:()=>GZ});fD.exports=zZ(uD);var HZ=lD(),qZ=require("stream");async function*mD(e){let t=!1,r=!1,n=new Array;for(e.on("error",s=>{if(t||(t=!0),s)throw s}),e.on("data",s=>{n.push(s)}),e.on("end",()=>{t=!0});!r;){let s=await new Promise(o=>setTimeout(()=>o(n.shift()),0));s&&(yield s),r=t&&n.length===0}}vh(mD,"readabletoIterable");var pD=class{static{vh(this,"EventStreamMarshaller")}constructor({utf8Encoder:e,utf8Decoder:t}){this.universalMarshaller=new HZ.EventStreamMarshaller({utf8Decoder:t,utf8Encoder:e})}deserialize(e,t){let r=typeof e[Symbol.asyncIterator]=="function"?e:mD(e);return this.universalMarshaller.deserialize(r,t)}serialize(e,t){return qZ.Readable.from(this.universalMarshaller.serialize(e,t))}},GZ=vh(e=>new pD(e),"eventStreamSerdeProvider")});var OD=b(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.ruleSet=void 0;var xD="required",Lt="fn",kt="argv",Bo="ref",hD=!0,yD="isSet",wa="booleanEquals",Uo="error",As="endpoint",Dr="tree",Eh="PartitionResult",_D="stringEquals",vD={[xD]:!1,type:"String"},SD={[xD]:!0,default:!1,type:"Boolean"},ED={[Bo]:"Endpoint"},ID={[Lt]:wa,[kt]:[{[Bo]:"UseFIPS"},!0]},AD={[Lt]:wa,[kt]:[{[Bo]:"UseDualStack"},!0]},at={},Sh={[Bo]:"Region"},CD={[Lt]:"getAttr",[kt]:[{[Bo]:Eh},"supportsFIPS"]},bD={[Lt]:wa,[kt]:[!0,{[Lt]:"getAttr",[kt]:[{[Bo]:Eh},"supportsDualStack"]}]},wD=[ID],TD=[AD],PD=[Sh],VZ={version:"1.0",parameters:{Region:vD,UseDualStack:SD,UseFIPS:SD,Endpoint:vD},rules:[{conditions:[{[Lt]:yD,[kt]:[ED]}],rules:[{conditions:wD,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:Uo},{conditions:TD,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:Uo},{endpoint:{url:ED,properties:at,headers:at},type:As}],type:Dr},{conditions:[{[Lt]:yD,[kt]:PD}],rules:[{conditions:[{[Lt]:"aws.partition",[kt]:PD,assign:Eh}],rules:[{conditions:[ID,AD],rules:[{conditions:[{[Lt]:wa,[kt]:[hD,CD]},bD],rules:[{endpoint:{url:"https://logs-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:at,headers:at},type:As}],type:Dr},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:Uo}],type:Dr},{conditions:wD,rules:[{conditions:[{[Lt]:wa,[kt]:[CD,hD]}],rules:[{conditions:[{[Lt]:_D,[kt]:[Sh,"us-gov-east-1"]}],endpoint:{url:"https://logs.us-gov-east-1.amazonaws.com",properties:at,headers:at},type:As},{conditions:[{[Lt]:_D,[kt]:[Sh,"us-gov-west-1"]}],endpoint:{url:"https://logs.us-gov-west-1.amazonaws.com",properties:at,headers:at},type:As},{endpoint:{url:"https://logs-fips.{Region}.{PartitionResult#dnsSuffix}",properties:at,headers:at},type:As}],type:Dr},{error:"FIPS is enabled but this partition does not support FIPS",type:Uo}],type:Dr},{conditions:TD,rules:[{conditions:[bD],rules:[{endpoint:{url:"https://logs.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:at,headers:at},type:As}],type:Dr},{error:"DualStack is enabled but this partition does not support DualStack",type:Uo}],type:Dr},{endpoint:{url:"https://logs.{Region}.{PartitionResult#dnsSuffix}",properties:at,headers:at},type:As}],type:Dr}],type:Dr},{error:"Invalid Configuration: Missing Region",type:Uo}]};du.ruleSet=VZ});var DD=b(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.defaultEndpointResolver=void 0;var WZ=to(),Ch=ds(),ZZ=OD(),KZ=new Ch.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),JZ=(e,t={})=>KZ.get(e,()=>(0,Ch.resolveEndpoint)(ZZ.ruleSet,{endpointParams:e,logger:t.logger}));lu.defaultEndpointResolver=JZ;Ch.customEndpointFunctions.aws=WZ.awsEndpointFunctions});var LD=b(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.getRuntimeConfig=void 0;var YZ=(Ne(),re(tr)),QZ=ee(),XZ=vs(),RD=Je(),ND=Re(),eK=Uf(),tK=DD(),rK=e=>({apiVersion:"2014-03-28",base64Decoder:e?.base64Decoder??RD.fromBase64,base64Encoder:e?.base64Encoder??RD.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??tK.defaultEndpointResolver,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??eK.defaultCloudWatchLogsHttpAuthSchemeProvider,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new YZ.AwsSdkSigV4Signer}],logger:e?.logger??new QZ.NoOpLogger,serviceId:e?.serviceId??"CloudWatch Logs",urlParser:e?.urlParser??XZ.parseUrl,utf8Decoder:e?.utf8Decoder??ND.fromUtf8,utf8Encoder:e?.utf8Encoder??ND.toUtf8});uu.getRuntimeConfig=rK});var UD=b(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.getRuntimeConfig=void 0;var nK=(yo(),re(ho)),sK=nK.__importDefault(oT()),kD=(Ne(),re(tr)),oK=OO(),MD=Fi(),mu=nr(),iK=gD(),aK=ji(),FD=br(),Os=dn(),jD=Wn(),cK=Ui(),dK=po(),lK=LD(),uK=ee(),mK=zi(),pK=ee(),fK=e=>{(0,pK.emitWarningIfUnsupportedVersion)(process.version);let t=(0,mK.resolveDefaultsModeConfig)(e),r=()=>t().then(uK.loadConfigsForDefaultMode),n=(0,lK.getRuntimeConfig)(e);(0,kD.emitWarningIfUnsupportedVersion)(process.version);let s={profile:e?.profile,logger:n.logger};return{...n,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,Os.loadConfig)(kD.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,s),bodyLengthChecker:e?.bodyLengthChecker??cK.calculateBodyLength,credentialDefaultProvider:e?.credentialDefaultProvider??oK.defaultProvider,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,MD.createDefaultUserAgentProvider)({serviceId:n.serviceId,clientVersion:sK.default.version}),eventStreamSerdeProvider:e?.eventStreamSerdeProvider??iK.eventStreamSerdeProvider,maxAttempts:e?.maxAttempts??(0,Os.loadConfig)(FD.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,Os.loadConfig)(mu.NODE_REGION_CONFIG_OPTIONS,{...mu.NODE_REGION_CONFIG_FILE_OPTIONS,...s}),requestHandler:jD.NodeHttpHandler.create(e?.requestHandler??r),retryMode:e?.retryMode??(0,Os.loadConfig)({...FD.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await r()).retryMode||dK.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??aK.Hash.bind(null,"sha256"),streamCollector:e?.streamCollector??jD.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,Os.loadConfig)(mu.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,s),useFipsEndpoint:e?.useFipsEndpoint??(0,Os.loadConfig)(mu.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,s),userAgentAppId:e?.userAgentAppId??(0,Os.loadConfig)(MD.NODE_APP_ID_CONFIG_OPTIONS,s)}};pu.getRuntimeConfig=fK});var rL=b((Tue,tL)=>{"use strict";var gu=Object.defineProperty,gK=Object.getOwnPropertyDescriptor,hK=Object.getOwnPropertyNames,yK=Object.prototype.hasOwnProperty,g=(e,t)=>gu(e,"name",{value:t,configurable:!0}),_K=(e,t)=>{for(var r in t)gu(e,r,{get:t[r],enumerable:!0})},vK=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of hK(t))!yK.call(e,s)&&s!==r&&gu(e,s,{get:()=>t[s],enumerable:!(n=gK(t,s))||n.enumerable});return e},SK=e=>vK(gu({},"__esModule",{value:!0}),e),GD={};_K(GD,{AccessDeniedException:()=>WD,AnomalyDetectorStatus:()=>kK,AssociateKmsKeyCommand:()=>RR,CancelExportTaskCommand:()=>NR,CloudWatchLogs:()=>eL,CloudWatchLogsClient:()=>Ke,CloudWatchLogsServiceException:()=>Te,ConflictException:()=>oR,CreateDeliveryCommand:()=>LR,CreateExportTaskCommand:()=>kR,CreateLogAnomalyDetectorCommand:()=>MR,CreateLogGroupCommand:()=>FR,CreateLogStreamCommand:()=>jR,DataAlreadyAcceptedException:()=>yR,DataProtectionStatus:()=>BK,DeleteAccountPolicyCommand:()=>UR,DeleteDataProtectionPolicyCommand:()=>BR,DeleteDeliveryCommand:()=>$R,DeleteDeliveryDestinationCommand:()=>zR,DeleteDeliveryDestinationPolicyCommand:()=>HR,DeleteDeliverySourceCommand:()=>qR,DeleteDestinationCommand:()=>GR,DeleteIndexPolicyCommand:()=>VR,DeleteIntegrationCommand:()=>WR,DeleteLogAnomalyDetectorCommand:()=>ZR,DeleteLogGroupCommand:()=>KR,DeleteLogStreamCommand:()=>JR,DeleteMetricFilterCommand:()=>YR,DeleteQueryDefinitionCommand:()=>QR,DeleteResourcePolicyCommand:()=>XR,DeleteRetentionPolicyCommand:()=>eN,DeleteSubscriptionFilterCommand:()=>tN,DeleteTransformerCommand:()=>rN,DeliveryDestinationType:()=>jK,DescribeAccountPoliciesCommand:()=>nN,DescribeConfigurationTemplatesCommand:()=>Ph,DescribeDeliveriesCommand:()=>xh,DescribeDeliveryDestinationsCommand:()=>Ih,DescribeDeliverySourcesCommand:()=>Ah,DescribeDestinationsCommand:()=>Oh,DescribeExportTasksCommand:()=>sN,DescribeFieldIndexesCommand:()=>oN,DescribeIndexPoliciesCommand:()=>iN,DescribeLogGroupsCommand:()=>Dh,DescribeLogStreamsCommand:()=>Rh,DescribeMetricFiltersCommand:()=>Nh,DescribeQueriesCommand:()=>aN,DescribeQueryDefinitionsCommand:()=>cN,DescribeResourcePoliciesCommand:()=>dN,DescribeSubscriptionFiltersCommand:()=>Lh,DisassociateKmsKeyCommand:()=>lN,Distribution:()=>ZK,EntityRejectionErrorType:()=>KK,EvaluationFrequency:()=>MK,EventSource:()=>JK,ExportTaskStatusCode:()=>$K,FilterLogEventsCommand:()=>kh,FlattenedElement:()=>YK,GetDataProtectionPolicyCommand:()=>uN,GetDeliveryCommand:()=>mN,GetDeliveryDestinationCommand:()=>pN,GetDeliveryDestinationPolicyCommand:()=>fN,GetDeliverySourceCommand:()=>gN,GetIntegrationCommand:()=>hN,GetLogAnomalyDetectorCommand:()=>yN,GetLogEventsCommand:()=>Mh,GetLogGroupFieldsCommand:()=>_N,GetLogRecordCommand:()=>vN,GetQueryResultsCommand:()=>SN,GetTransformerCommand:()=>EN,IndexSource:()=>zK,InheritedProperty:()=>HK,IntegrationDetails:()=>bh,IntegrationStatus:()=>XK,IntegrationType:()=>eJ,InvalidOperationException:()=>nR,InvalidParameterException:()=>KD,InvalidSequenceTokenException:()=>vR,LimitExceededException:()=>pR,ListAnomaliesCommand:()=>Fh,ListIntegrationsCommand:()=>CN,ListLogAnomalyDetectorsCommand:()=>jh,ListLogGroupsCommand:()=>bN,ListLogGroupsForQueryCommand:()=>Uh,ListTagsForResourceCommand:()=>wN,ListTagsLogGroupCommand:()=>TN,LogGroupClass:()=>UK,MalformedQueryException:()=>xR,OCSFVersion:()=>tJ,OpenSearchResourceStatusType:()=>QK,OperationAbortedException:()=>YD,OrderBy:()=>qK,OutputFormat:()=>FK,PolicyType:()=>RK,PutAccountPolicyCommand:()=>PN,PutDataProtectionPolicyCommand:()=>xN,PutDeliveryDestinationCommand:()=>IN,PutDeliveryDestinationPolicyCommand:()=>AN,PutDeliverySourceCommand:()=>ON,PutDestinationCommand:()=>DN,PutDestinationPolicyCommand:()=>RN,PutIndexPolicyCommand:()=>NN,PutIntegrationCommand:()=>LN,PutLogEventsCommand:()=>kN,PutMetricFilterCommand:()=>MN,PutQueryDefinitionCommand:()=>FN,PutResourcePolicyCommand:()=>jN,PutRetentionPolicyCommand:()=>UN,PutSubscriptionFilterCommand:()=>BN,PutTransformerCommand:()=>$N,QueryLanguage:()=>VK,QueryStatus:()=>WK,ResourceAlreadyExistsException:()=>gR,ResourceConfig:()=>wh,ResourceNotFoundException:()=>XD,Scope:()=>NK,ServiceQuotaExceededException:()=>aR,ServiceUnavailableException:()=>tR,SessionStreamingException:()=>bR,SessionTimeoutException:()=>TR,StandardUnit:()=>GK,StartLiveTailCommand:()=>zN,StartLiveTailResponseFilterSensitiveLog:()=>DR,StartLiveTailResponseStream:()=>Th,StartLiveTailResponseStreamFilterSensitiveLog:()=>iJ,StartQueryCommand:()=>HN,State:()=>LK,StopQueryCommand:()=>qN,SuppressionState:()=>nJ,SuppressionType:()=>oJ,SuppressionUnit:()=>sJ,TagLogGroupCommand:()=>GN,TagResourceCommand:()=>VN,TestMetricFilterCommand:()=>WN,TestTransformerCommand:()=>ZN,ThrottlingException:()=>dR,TooManyTagsException:()=>AR,Type:()=>rJ,UnrecognizedClientException:()=>ER,UntagLogGroupCommand:()=>KN,UntagResourceCommand:()=>JN,UpdateAnomalyCommand:()=>YN,UpdateDeliveryConfigurationCommand:()=>QN,UpdateLogAnomalyDetectorCommand:()=>XN,ValidationException:()=>uR,__Client:()=>f.Client,paginateDescribeConfigurationTemplates:()=>c7,paginateDescribeDeliveries:()=>d7,paginateDescribeDeliveryDestinations:()=>l7,paginateDescribeDeliverySources:()=>u7,paginateDescribeDestinations:()=>m7,paginateDescribeLogGroups:()=>p7,paginateDescribeLogStreams:()=>f7,paginateDescribeMetricFilters:()=>g7,paginateDescribeSubscriptionFilters:()=>h7,paginateFilterLogEvents:()=>y7,paginateGetLogEvents:()=>_7,paginateListAnomalies:()=>v7,paginateListLogAnomalyDetectors:()=>S7,paginateListLogGroupsForQuery:()=>E7});tL.exports=SK(GD);var BD=Ko(),EK=Jo(),CK=Yo(),$D=lo(),bK=nr(),ze=(st(),re(Xs)),wK=Eb(),TK=Ri(),O=ln(),zD=br(),HD=Uf(),PK=g(e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"logs"}),"resolveClientEndpointParameters"),R={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},xK=UD(),qD=Hi(),fu=ge(),f=ee(),IK=g(e=>{let t=e.httpAuthSchemes,r=e.httpAuthSchemeProvider,n=e.credentials;return{setHttpAuthScheme(s){let o=t.findIndex(i=>i.schemeId===s.schemeId);o===-1?t.push(s):t.splice(o,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){r=s},httpAuthSchemeProvider(){return r},setCredentials(s){n=s},credentials(){return n}}},"getHttpAuthExtensionConfiguration"),AK=g(e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),"resolveHttpAuthRuntimeConfig"),OK=g((e,t)=>{let r=Object.assign((0,qD.getAwsRegionExtensionConfiguration)(e),(0,f.getDefaultExtensionConfiguration)(e),(0,fu.getHttpHandlerExtensionConfiguration)(e),IK(e));return t.forEach(n=>n.configure(r)),Object.assign(e,(0,qD.resolveAwsRegionExtensionConfiguration)(r),(0,f.resolveDefaultRuntimeConfig)(r),(0,fu.resolveHttpHandlerRuntimeConfig)(r),AK(r))},"resolveRuntimeExtensions"),Ke=class extends f.Client{static{g(this,"CloudWatchLogsClient")}config;constructor(...[e]){let t=(0,xK.getRuntimeConfig)(e||{});super(t),this.initConfig=t;let r=PK(t),n=(0,$D.resolveUserAgentConfig)(r),s=(0,zD.resolveRetryConfig)(n),o=(0,bK.resolveRegionConfig)(s),i=(0,BD.resolveHostHeaderConfig)(o),a=(0,O.resolveEndpointConfig)(i),c=(0,wK.resolveEventStreamSerdeConfig)(a),d=(0,HD.resolveHttpAuthSchemeConfig)(c),l=OK(d,e?.extensions||[]);this.config=l,this.middlewareStack.use((0,$D.getUserAgentPlugin)(this.config)),this.middlewareStack.use((0,zD.getRetryPlugin)(this.config)),this.middlewareStack.use((0,TK.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,BD.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,EK.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,CK.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use((0,ze.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config,{httpAuthSchemeParametersProvider:HD.defaultCloudWatchLogsHttpAuthSchemeParametersProvider,identityProviderConfigProvider:g(async u=>new ze.DefaultIdentityProviderConfig({"aws.auth#sigv4":u.credentials}),"identityProviderConfigProvider")})),this.middlewareStack.use((0,ze.getHttpSigningPlugin)(this.config))}destroy(){super.destroy()}},N=Vr(),z=(Ne(),re(tr)),DK=(Fc(),re(Jm)),Te=class VD extends f.ServiceException{static{g(this,"CloudWatchLogsServiceException")}constructor(t){super(t),Object.setPrototypeOf(this,VD.prototype)}},WD=class ZD extends Te{static{g(this,"AccessDeniedException")}name="AccessDeniedException";$fault="client";constructor(t){super({name:"AccessDeniedException",$fault:"client",...t}),Object.setPrototypeOf(this,ZD.prototype)}},RK={DATA_PROTECTION_POLICY:"DATA_PROTECTION_POLICY",FIELD_INDEX_POLICY:"FIELD_INDEX_POLICY",SUBSCRIPTION_FILTER_POLICY:"SUBSCRIPTION_FILTER_POLICY",TRANSFORMER_POLICY:"TRANSFORMER_POLICY"},NK={ALL:"ALL"},LK={Active:"Active",Baseline:"Baseline",Suppressed:"Suppressed"},kK={ANALYZING:"ANALYZING",DELETED:"DELETED",FAILED:"FAILED",INITIALIZING:"INITIALIZING",PAUSED:"PAUSED",TRAINING:"TRAINING"},MK={FIFTEEN_MIN:"FIFTEEN_MIN",FIVE_MIN:"FIVE_MIN",ONE_HOUR:"ONE_HOUR",ONE_MIN:"ONE_MIN",TEN_MIN:"TEN_MIN",THIRTY_MIN:"THIRTY_MIN"},KD=class JD extends Te{static{g(this,"InvalidParameterException")}name="InvalidParameterException";$fault="client";constructor(t){super({name:"InvalidParameterException",$fault:"client",...t}),Object.setPrototypeOf(this,JD.prototype)}},YD=class QD extends Te{static{g(this,"OperationAbortedException")}name="OperationAbortedException";$fault="client";constructor(t){super({name:"OperationAbortedException",$fault:"client",...t}),Object.setPrototypeOf(this,QD.prototype)}},XD=class eR extends Te{static{g(this,"ResourceNotFoundException")}name="ResourceNotFoundException";$fault="client";constructor(t){super({name:"ResourceNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,eR.prototype)}},tR=class rR extends Te{static{g(this,"ServiceUnavailableException")}name="ServiceUnavailableException";$fault="server";constructor(t){super({name:"ServiceUnavailableException",$fault:"server",...t}),Object.setPrototypeOf(this,rR.prototype)}},nR=class sR extends Te{static{g(this,"InvalidOperationException")}name="InvalidOperationException";$fault="client";constructor(t){super({name:"InvalidOperationException",$fault:"client",...t}),Object.setPrototypeOf(this,sR.prototype)}},FK={JSON:"json",PARQUET:"parquet",PLAIN:"plain",RAW:"raw",W3C:"w3c"},jK={CWL:"CWL",FH:"FH",S3:"S3"},oR=class iR extends Te{static{g(this,"ConflictException")}name="ConflictException";$fault="client";constructor(t){super({name:"ConflictException",$fault:"client",...t}),Object.setPrototypeOf(this,iR.prototype)}},aR=class cR extends Te{static{g(this,"ServiceQuotaExceededException")}name="ServiceQuotaExceededException";$fault="client";constructor(t){super({name:"ServiceQuotaExceededException",$fault:"client",...t}),Object.setPrototypeOf(this,cR.prototype)}},dR=class lR extends Te{static{g(this,"ThrottlingException")}name="ThrottlingException";$fault="client";constructor(t){super({name:"ThrottlingException",$fault:"client",...t}),Object.setPrototypeOf(this,lR.prototype)}},uR=class mR extends Te{static{g(this,"ValidationException")}name="ValidationException";$fault="client";constructor(t){super({name:"ValidationException",$fault:"client",...t}),Object.setPrototypeOf(this,mR.prototype)}},pR=class fR extends Te{static{g(this,"LimitExceededException")}name="LimitExceededException";$fault="client";constructor(t){super({name:"LimitExceededException",$fault:"client",...t}),Object.setPrototypeOf(this,fR.prototype)}},gR=class hR extends Te{static{g(this,"ResourceAlreadyExistsException")}name="ResourceAlreadyExistsException";$fault="client";constructor(t){super({name:"ResourceAlreadyExistsException",$fault:"client",...t}),Object.setPrototypeOf(this,hR.prototype)}},UK={DELIVERY:"DELIVERY",INFREQUENT_ACCESS:"INFREQUENT_ACCESS",STANDARD:"STANDARD"},yR=class _R extends Te{static{g(this,"DataAlreadyAcceptedException")}name="DataAlreadyAcceptedException";$fault="client";expectedSequenceToken;constructor(t){super({name:"DataAlreadyAcceptedException",$fault:"client",...t}),Object.setPrototypeOf(this,_R.prototype),this.expectedSequenceToken=t.expectedSequenceToken}},BK={ACTIVATED:"ACTIVATED",ARCHIVED:"ARCHIVED",DELETED:"DELETED",DISABLED:"DISABLED"},$K={CANCELLED:"CANCELLED",COMPLETED:"COMPLETED",FAILED:"FAILED",PENDING:"PENDING",PENDING_CANCEL:"PENDING_CANCEL",RUNNING:"RUNNING"},zK={ACCOUNT:"ACCOUNT",LOG_GROUP:"LOG_GROUP"},HK={ACCOUNT_DATA_PROTECTION:"ACCOUNT_DATA_PROTECTION"},qK={LastEventTime:"LastEventTime",LogStreamName:"LogStreamName"},GK={Bits:"Bits",BitsSecond:"Bits/Second",Bytes:"Bytes",BytesSecond:"Bytes/Second",Count:"Count",CountSecond:"Count/Second",Gigabits:"Gigabits",GigabitsSecond:"Gigabits/Second",Gigabytes:"Gigabytes",GigabytesSecond:"Gigabytes/Second",Kilobits:"Kilobits",KilobitsSecond:"Kilobits/Second",Kilobytes:"Kilobytes",KilobytesSecond:"Kilobytes/Second",Megabits:"Megabits",MegabitsSecond:"Megabits/Second",Megabytes:"Megabytes",MegabytesSecond:"Megabytes/Second",Microseconds:"Microseconds",Milliseconds:"Milliseconds",None:"None",Percent:"Percent",Seconds:"Seconds",Terabits:"Terabits",TerabitsSecond:"Terabits/Second",Terabytes:"Terabytes",TerabytesSecond:"Terabytes/Second"},VK={CWLI:"CWLI",PPL:"PPL",SQL:"SQL"},WK={Cancelled:"Cancelled",Complete:"Complete",Failed:"Failed",Running:"Running",Scheduled:"Scheduled",Timeout:"Timeout",Unknown:"Unknown"},ZK={ByLogStream:"ByLogStream",Random:"Random"},KK={ENTITY_SIZE_TOO_LARGE:"EntitySizeTooLarge",INVALID_ATTRIBUTES:"InvalidAttributes",INVALID_ENTITY:"InvalidEntity",INVALID_KEY_ATTRIBUTE:"InvalidKeyAttributes",INVALID_TYPE_VALUE:"InvalidTypeValue",MISSING_REQUIRED_FIELDS:"MissingRequiredFields",UNSUPPORTED_LOG_GROUP_TYPE:"UnsupportedLogGroupType"},JK={AWSWAF:"AWSWAF",CLOUD_TRAIL:"CloudTrail",EKS_AUDIT:"EKSAudit",ROUTE53_RESOLVER:"Route53Resolver",VPC_FLOW:"VPCFlow"},YK={FIRST:"first",LAST:"last"},QK={ACTIVE:"ACTIVE",ERROR:"ERROR",NOT_FOUND:"NOT_FOUND"},bh;(e=>{e.visit=g((t,r)=>t.openSearchIntegrationDetails!==void 0?r.openSearchIntegrationDetails(t.openSearchIntegrationDetails):r._(t.$unknown[0],t.$unknown[1]),"visit")})(bh||(bh={}));var XK={ACTIVE:"ACTIVE",FAILED:"FAILED",PROVISIONING:"PROVISIONING"},eJ={OPENSEARCH:"OPENSEARCH"},tJ={V1_1:"V1.1"},rJ={BOOLEAN:"boolean",DOUBLE:"double",INTEGER:"integer",STRING:"string"},vR=class SR extends Te{static{g(this,"InvalidSequenceTokenException")}name="InvalidSequenceTokenException";$fault="client";expectedSequenceToken;constructor(t){super({name:"InvalidSequenceTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,SR.prototype),this.expectedSequenceToken=t.expectedSequenceToken}},nJ={SUPPRESSED:"SUPPRESSED",UNSUPPRESSED:"UNSUPPRESSED"},wh;(e=>{e.visit=g((t,r)=>t.openSearchResourceConfig!==void 0?r.openSearchResourceConfig(t.openSearchResourceConfig):r._(t.$unknown[0],t.$unknown[1]),"visit")})(wh||(wh={}));var ER=class CR extends Te{static{g(this,"UnrecognizedClientException")}name="UnrecognizedClientException";$fault="client";constructor(t){super({name:"UnrecognizedClientException",$fault:"client",...t}),Object.setPrototypeOf(this,CR.prototype)}},bR=class wR extends Te{static{g(this,"SessionStreamingException")}name="SessionStreamingException";$fault="client";constructor(t){super({name:"SessionStreamingException",$fault:"client",...t}),Object.setPrototypeOf(this,wR.prototype)}},TR=class PR extends Te{static{g(this,"SessionTimeoutException")}name="SessionTimeoutException";$fault="client";constructor(t){super({name:"SessionTimeoutException",$fault:"client",...t}),Object.setPrototypeOf(this,PR.prototype)}},Th;(e=>{e.visit=g((t,r)=>t.sessionStart!==void 0?r.sessionStart(t.sessionStart):t.sessionUpdate!==void 0?r.sessionUpdate(t.sessionUpdate):t.SessionTimeoutException!==void 0?r.SessionTimeoutException(t.SessionTimeoutException):t.SessionStreamingException!==void 0?r.SessionStreamingException(t.SessionStreamingException):r._(t.$unknown[0],t.$unknown[1]),"visit")})(Th||(Th={}));var xR=class IR extends Te{static{g(this,"MalformedQueryException")}name="MalformedQueryException";$fault="client";queryCompileError;constructor(t){super({name:"MalformedQueryException",$fault:"client",...t}),Object.setPrototypeOf(this,IR.prototype),this.queryCompileError=t.queryCompileError}},AR=class OR extends Te{static{g(this,"TooManyTagsException")}name="TooManyTagsException";$fault="client";resourceName;constructor(t){super({name:"TooManyTagsException",$fault:"client",...t}),Object.setPrototypeOf(this,OR.prototype),this.resourceName=t.resourceName}},sJ={HOURS:"HOURS",MINUTES:"MINUTES",SECONDS:"SECONDS"},oJ={INFINITE:"INFINITE",LIMITED:"LIMITED"},iJ=g(e=>{if(e.sessionStart!==void 0)return{sessionStart:e.sessionStart};if(e.sessionUpdate!==void 0)return{sessionUpdate:e.sessionUpdate};if(e.SessionTimeoutException!==void 0)return{SessionTimeoutException:e.SessionTimeoutException};if(e.SessionStreamingException!==void 0)return{SessionStreamingException:e.SessionStreamingException};if(e.$unknown!==void 0)return{[e.$unknown[0]]:"UNKNOWN"}},"StartLiveTailResponseStreamFilterSensitiveLog"),DR=g(e=>({...e,...e.responseStream&&{responseStream:"STREAMING_CONTENT"}}),"StartLiveTailResponseFilterSensitiveLog"),aJ=g(async(e,t)=>{let r=D("AssociateKmsKey"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_AssociateKmsKeyCommand"),cJ=g(async(e,t)=>{let r=D("CancelExportTask"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_CancelExportTaskCommand"),dJ=g(async(e,t)=>{let r=D("CreateDelivery"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_CreateDeliveryCommand"),lJ=g(async(e,t)=>{let r=D("CreateExportTask"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_CreateExportTaskCommand"),uJ=g(async(e,t)=>{let r=D("CreateLogAnomalyDetector"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_CreateLogAnomalyDetectorCommand"),mJ=g(async(e,t)=>{let r=D("CreateLogGroup"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_CreateLogGroupCommand"),pJ=g(async(e,t)=>{let r=D("CreateLogStream"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_CreateLogStreamCommand"),fJ=g(async(e,t)=>{let r=D("DeleteAccountPolicy"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteAccountPolicyCommand"),gJ=g(async(e,t)=>{let r=D("DeleteDataProtectionPolicy"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteDataProtectionPolicyCommand"),hJ=g(async(e,t)=>{let r=D("DeleteDelivery"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteDeliveryCommand"),yJ=g(async(e,t)=>{let r=D("DeleteDeliveryDestination"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteDeliveryDestinationCommand"),_J=g(async(e,t)=>{let r=D("DeleteDeliveryDestinationPolicy"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteDeliveryDestinationPolicyCommand"),vJ=g(async(e,t)=>{let r=D("DeleteDeliverySource"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteDeliverySourceCommand"),SJ=g(async(e,t)=>{let r=D("DeleteDestination"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteDestinationCommand"),EJ=g(async(e,t)=>{let r=D("DeleteIndexPolicy"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteIndexPolicyCommand"),CJ=g(async(e,t)=>{let r=D("DeleteIntegration"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteIntegrationCommand"),bJ=g(async(e,t)=>{let r=D("DeleteLogAnomalyDetector"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteLogAnomalyDetectorCommand"),wJ=g(async(e,t)=>{let r=D("DeleteLogGroup"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteLogGroupCommand"),TJ=g(async(e,t)=>{let r=D("DeleteLogStream"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteLogStreamCommand"),PJ=g(async(e,t)=>{let r=D("DeleteMetricFilter"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteMetricFilterCommand"),xJ=g(async(e,t)=>{let r=D("DeleteQueryDefinition"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteQueryDefinitionCommand"),IJ=g(async(e,t)=>{let r=D("DeleteResourcePolicy"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteResourcePolicyCommand"),AJ=g(async(e,t)=>{let r=D("DeleteRetentionPolicy"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteRetentionPolicyCommand"),OJ=g(async(e,t)=>{let r=D("DeleteSubscriptionFilter"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteSubscriptionFilterCommand"),DJ=g(async(e,t)=>{let r=D("DeleteTransformer"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DeleteTransformerCommand"),RJ=g(async(e,t)=>{let r=D("DescribeAccountPolicies"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DescribeAccountPoliciesCommand"),NJ=g(async(e,t)=>{let r=D("DescribeConfigurationTemplates"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DescribeConfigurationTemplatesCommand"),LJ=g(async(e,t)=>{let r=D("DescribeDeliveries"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DescribeDeliveriesCommand"),kJ=g(async(e,t)=>{let r=D("DescribeDeliveryDestinations"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DescribeDeliveryDestinationsCommand"),MJ=g(async(e,t)=>{let r=D("DescribeDeliverySources"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DescribeDeliverySourcesCommand"),FJ=g(async(e,t)=>{let r=D("DescribeDestinations"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DescribeDestinationsCommand"),jJ=g(async(e,t)=>{let r=D("DescribeExportTasks"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DescribeExportTasksCommand"),UJ=g(async(e,t)=>{let r=D("DescribeFieldIndexes"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DescribeFieldIndexesCommand"),BJ=g(async(e,t)=>{let r=D("DescribeIndexPolicies"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DescribeIndexPoliciesCommand"),$J=g(async(e,t)=>{let r=D("DescribeLogGroups"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DescribeLogGroupsCommand"),zJ=g(async(e,t)=>{let r=D("DescribeLogStreams"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DescribeLogStreamsCommand"),HJ=g(async(e,t)=>{let r=D("DescribeMetricFilters"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DescribeMetricFiltersCommand"),qJ=g(async(e,t)=>{let r=D("DescribeQueries"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DescribeQueriesCommand"),GJ=g(async(e,t)=>{let r=D("DescribeQueryDefinitions"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DescribeQueryDefinitionsCommand"),VJ=g(async(e,t)=>{let r=D("DescribeResourcePolicies"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DescribeResourcePoliciesCommand"),WJ=g(async(e,t)=>{let r=D("DescribeSubscriptionFilters"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DescribeSubscriptionFiltersCommand"),ZJ=g(async(e,t)=>{let r=D("DisassociateKmsKey"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_DisassociateKmsKeyCommand"),KJ=g(async(e,t)=>{let r=D("FilterLogEvents"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_FilterLogEventsCommand"),JJ=g(async(e,t)=>{let r=D("GetDataProtectionPolicy"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_GetDataProtectionPolicyCommand"),YJ=g(async(e,t)=>{let r=D("GetDelivery"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_GetDeliveryCommand"),QJ=g(async(e,t)=>{let r=D("GetDeliveryDestination"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_GetDeliveryDestinationCommand"),XJ=g(async(e,t)=>{let r=D("GetDeliveryDestinationPolicy"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_GetDeliveryDestinationPolicyCommand"),e9=g(async(e,t)=>{let r=D("GetDeliverySource"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_GetDeliverySourceCommand"),t9=g(async(e,t)=>{let r=D("GetIntegration"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_GetIntegrationCommand"),r9=g(async(e,t)=>{let r=D("GetLogAnomalyDetector"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_GetLogAnomalyDetectorCommand"),n9=g(async(e,t)=>{let r=D("GetLogEvents"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_GetLogEventsCommand"),s9=g(async(e,t)=>{let r=D("GetLogGroupFields"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_GetLogGroupFieldsCommand"),o9=g(async(e,t)=>{let r=D("GetLogRecord"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_GetLogRecordCommand"),i9=g(async(e,t)=>{let r=D("GetQueryResults"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_GetQueryResultsCommand"),a9=g(async(e,t)=>{let r=D("GetTransformer"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_GetTransformerCommand"),c9=g(async(e,t)=>{let r=D("ListAnomalies"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_ListAnomaliesCommand"),d9=g(async(e,t)=>{let r=D("ListIntegrations"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_ListIntegrationsCommand"),l9=g(async(e,t)=>{let r=D("ListLogAnomalyDetectors"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_ListLogAnomalyDetectorsCommand"),u9=g(async(e,t)=>{let r=D("ListLogGroups"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_ListLogGroupsCommand"),m9=g(async(e,t)=>{let r=D("ListLogGroupsForQuery"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_ListLogGroupsForQueryCommand"),p9=g(async(e,t)=>{let r=D("ListTagsForResource"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_ListTagsForResourceCommand"),f9=g(async(e,t)=>{let r=D("ListTagsLogGroup"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_ListTagsLogGroupCommand"),g9=g(async(e,t)=>{let r=D("PutAccountPolicy"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_PutAccountPolicyCommand"),h9=g(async(e,t)=>{let r=D("PutDataProtectionPolicy"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_PutDataProtectionPolicyCommand"),y9=g(async(e,t)=>{let r=D("PutDeliveryDestination"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_PutDeliveryDestinationCommand"),_9=g(async(e,t)=>{let r=D("PutDeliveryDestinationPolicy"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_PutDeliveryDestinationPolicyCommand"),v9=g(async(e,t)=>{let r=D("PutDeliverySource"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_PutDeliverySourceCommand"),S9=g(async(e,t)=>{let r=D("PutDestination"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_PutDestinationCommand"),E9=g(async(e,t)=>{let r=D("PutDestinationPolicy"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_PutDestinationPolicyCommand"),C9=g(async(e,t)=>{let r=D("PutIndexPolicy"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_PutIndexPolicyCommand"),b9=g(async(e,t)=>{let r=D("PutIntegration"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_PutIntegrationCommand"),w9=g(async(e,t)=>{let r=D("PutLogEvents"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_PutLogEventsCommand"),T9=g(async(e,t)=>{let r=D("PutMetricFilter"),n;return n=JSON.stringify(YQ(e,t)),k(t,r,"/",void 0,n)},"se_PutMetricFilterCommand"),P9=g(async(e,t)=>{let r=D("PutQueryDefinition"),n;return n=JSON.stringify(QQ(e,t)),k(t,r,"/",void 0,n)},"se_PutQueryDefinitionCommand"),x9=g(async(e,t)=>{let r=D("PutResourcePolicy"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_PutResourcePolicyCommand"),I9=g(async(e,t)=>{let r=D("PutRetentionPolicy"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_PutRetentionPolicyCommand"),A9=g(async(e,t)=>{let r=D("PutSubscriptionFilter"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_PutSubscriptionFilterCommand"),O9=g(async(e,t)=>{let r=D("PutTransformer"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_PutTransformerCommand"),D9=g(async(e,t)=>{let r=D("StartLiveTail"),n;n=JSON.stringify((0,f._json)(e));let{hostname:s}=await t.endpoint();if(t.disableHostPrefix!==!0&&(s="streaming-"+s,!(0,fu.isValidHostname)(s)))throw new Error("ValidationError: prefixed hostname must be hostname compatible.");return k(t,r,"/",s,n)},"se_StartLiveTailCommand"),R9=g(async(e,t)=>{let r=D("StartQuery"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_StartQueryCommand"),N9=g(async(e,t)=>{let r=D("StopQuery"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_StopQueryCommand"),L9=g(async(e,t)=>{let r=D("TagLogGroup"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_TagLogGroupCommand"),k9=g(async(e,t)=>{let r=D("TagResource"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_TagResourceCommand"),M9=g(async(e,t)=>{let r=D("TestMetricFilter"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_TestMetricFilterCommand"),F9=g(async(e,t)=>{let r=D("TestTransformer"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_TestTransformerCommand"),j9=g(async(e,t)=>{let r=D("UntagLogGroup"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_UntagLogGroupCommand"),U9=g(async(e,t)=>{let r=D("UntagResource"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_UntagResourceCommand"),B9=g(async(e,t)=>{let r=D("UpdateAnomaly"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_UpdateAnomalyCommand"),$9=g(async(e,t)=>{let r=D("UpdateDeliveryConfiguration"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_UpdateDeliveryConfigurationCommand"),z9=g(async(e,t)=>{let r=D("UpdateLogAnomalyDetector"),n;return n=JSON.stringify((0,f._json)(e)),k(t,r,"/",void 0,n)},"se_UpdateLogAnomalyDetectorCommand"),H9=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_AssociateKmsKeyCommand"),q9=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_CancelExportTaskCommand"),G9=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_CreateDeliveryCommand"),V9=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_CreateExportTaskCommand"),W9=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_CreateLogAnomalyDetectorCommand"),Z9=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_CreateLogGroupCommand"),K9=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_CreateLogStreamCommand"),J9=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_DeleteAccountPolicyCommand"),Y9=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_DeleteDataProtectionPolicyCommand"),Q9=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_DeleteDeliveryCommand"),X9=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_DeleteDeliveryDestinationCommand"),eY=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_DeleteDeliveryDestinationPolicyCommand"),tY=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_DeleteDeliverySourceCommand"),rY=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_DeleteDestinationCommand"),nY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DeleteIndexPolicyCommand"),sY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DeleteIntegrationCommand"),oY=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_DeleteLogAnomalyDetectorCommand"),iY=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_DeleteLogGroupCommand"),aY=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_DeleteLogStreamCommand"),cY=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_DeleteMetricFilterCommand"),dY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DeleteQueryDefinitionCommand"),lY=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_DeleteResourcePolicyCommand"),uY=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_DeleteRetentionPolicyCommand"),mY=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_DeleteSubscriptionFilterCommand"),pY=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_DeleteTransformerCommand"),fY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DescribeAccountPoliciesCommand"),gY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DescribeConfigurationTemplatesCommand"),hY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DescribeDeliveriesCommand"),yY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DescribeDeliveryDestinationsCommand"),_Y=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DescribeDeliverySourcesCommand"),vY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DescribeDestinationsCommand"),SY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DescribeExportTasksCommand"),EY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DescribeFieldIndexesCommand"),CY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DescribeIndexPoliciesCommand"),bY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DescribeLogGroupsCommand"),wY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DescribeLogStreamsCommand"),TY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=XQ(r,t),{$metadata:I(e),...n}},"de_DescribeMetricFiltersCommand"),PY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DescribeQueriesCommand"),xY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DescribeQueryDefinitionsCommand"),IY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DescribeResourcePoliciesCommand"),AY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_DescribeSubscriptionFiltersCommand"),OY=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_DisassociateKmsKeyCommand"),DY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_FilterLogEventsCommand"),RY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_GetDataProtectionPolicyCommand"),NY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_GetDeliveryCommand"),LY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_GetDeliveryDestinationCommand"),kY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_GetDeliveryDestinationPolicyCommand"),MY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_GetDeliverySourceCommand"),FY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_GetIntegrationCommand"),jY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_GetLogAnomalyDetectorCommand"),UY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_GetLogEventsCommand"),BY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_GetLogGroupFieldsCommand"),$Y=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_GetLogRecordCommand"),zY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=e7(r,t),{$metadata:I(e),...n}},"de_GetQueryResultsCommand"),HY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_GetTransformerCommand"),qY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_ListAnomaliesCommand"),GY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_ListIntegrationsCommand"),VY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_ListLogAnomalyDetectorsCommand"),WY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_ListLogGroupsCommand"),ZY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_ListLogGroupsForQueryCommand"),KY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_ListTagsForResourceCommand"),JY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_ListTagsLogGroupCommand"),YY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_PutAccountPolicyCommand"),QY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_PutDataProtectionPolicyCommand"),XY=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_PutDeliveryDestinationCommand"),eQ=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_PutDeliveryDestinationPolicyCommand"),tQ=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_PutDeliverySourceCommand"),rQ=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_PutDestinationCommand"),nQ=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_PutDestinationPolicyCommand"),sQ=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_PutIndexPolicyCommand"),oQ=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_PutIntegrationCommand"),iQ=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_PutLogEventsCommand"),aQ=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_PutMetricFilterCommand"),cQ=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_PutQueryDefinitionCommand"),dQ=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_PutResourcePolicyCommand"),lQ=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_PutRetentionPolicyCommand"),uQ=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_PutSubscriptionFilterCommand"),mQ=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_PutTransformerCommand"),pQ=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r={responseStream:zQ(e.body,t)};return{$metadata:I(e),...r}},"de_StartLiveTailCommand"),fQ=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_StartQueryCommand"),gQ=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_StopQueryCommand"),hQ=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_TagLogGroupCommand"),yQ=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_TagResourceCommand"),_Q=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_TestMetricFilterCommand"),vQ=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_TestTransformerCommand"),SQ=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_UntagLogGroupCommand"),EQ=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_UntagResourceCommand"),CQ=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_UpdateAnomalyCommand"),bQ=g(async(e,t)=>{if(e.statusCode>=300)return L(e,t);let r=await(0,z.parseJsonBody)(e.body,t),n={};return n=(0,f._json)(r),{$metadata:I(e),...n}},"de_UpdateDeliveryConfigurationCommand"),wQ=g(async(e,t)=>e.statusCode>=300?L(e,t):(await(0,f.collectBody)(e.body,t),{$metadata:I(e)}),"de_UpdateLogAnomalyDetectorCommand"),L=g(async(e,t)=>{let r={...e,body:await(0,z.parseJsonErrorBody)(e.body,t)},n=(0,z.loadRestJsonErrorCode)(e,r.body);switch(n){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":throw await AQ(r,t);case"OperationAbortedException":case"com.amazonaws.cloudwatchlogs#OperationAbortedException":throw await NQ(r,t);case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":throw await kQ(r,t);case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":throw await FQ(r,t);case"InvalidOperationException":case"com.amazonaws.cloudwatchlogs#InvalidOperationException":throw await IQ(r,t);case"AccessDeniedException":case"com.amazonaws.cloudwatchlogs#AccessDeniedException":throw await TQ(r,t);case"ConflictException":case"com.amazonaws.cloudwatchlogs#ConflictException":throw await PQ(r,t);case"ServiceQuotaExceededException":case"com.amazonaws.cloudwatchlogs#ServiceQuotaExceededException":throw await MQ(r,t);case"ThrottlingException":case"com.amazonaws.cloudwatchlogs#ThrottlingException":throw await jQ(r,t);case"ValidationException":case"com.amazonaws.cloudwatchlogs#ValidationException":throw await $Q(r,t);case"LimitExceededException":case"com.amazonaws.cloudwatchlogs#LimitExceededException":throw await DQ(r,t);case"ResourceAlreadyExistsException":case"com.amazonaws.cloudwatchlogs#ResourceAlreadyExistsException":throw await LQ(r,t);case"DataAlreadyAcceptedException":case"com.amazonaws.cloudwatchlogs#DataAlreadyAcceptedException":throw await xQ(r,t);case"InvalidSequenceTokenException":case"com.amazonaws.cloudwatchlogs#InvalidSequenceTokenException":throw await OQ(r,t);case"UnrecognizedClientException":case"com.amazonaws.cloudwatchlogs#UnrecognizedClientException":throw await BQ(r,t);case"MalformedQueryException":case"com.amazonaws.cloudwatchlogs#MalformedQueryException":throw await RQ(r,t);case"TooManyTagsException":case"com.amazonaws.cloudwatchlogs#TooManyTagsException":throw await UQ(r,t);default:let s=r.body;return i7({output:e,parsedBody:s,errorCode:n})}},"de_CommandError"),TQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new WD({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_AccessDeniedExceptionRes"),PQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new oR({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_ConflictExceptionRes"),xQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new yR({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_DataAlreadyAcceptedExceptionRes"),IQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new nR({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_InvalidOperationExceptionRes"),AQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new KD({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_InvalidParameterExceptionRes"),OQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new vR({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_InvalidSequenceTokenExceptionRes"),DQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new pR({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_LimitExceededExceptionRes"),RQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new xR({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_MalformedQueryExceptionRes"),NQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new YD({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_OperationAbortedExceptionRes"),LQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new gR({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_ResourceAlreadyExistsExceptionRes"),kQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new XD({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_ResourceNotFoundExceptionRes"),MQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new aR({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_ServiceQuotaExceededExceptionRes"),FQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new tR({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_ServiceUnavailableExceptionRes"),jQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new dR({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_ThrottlingExceptionRes"),UQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new AR({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_TooManyTagsExceptionRes"),BQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new ER({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_UnrecognizedClientExceptionRes"),$Q=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new uR({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_ValidationExceptionRes"),zQ=g((e,t)=>t.eventStreamMarshaller.deserialize(e,async r=>r.sessionStart!=null?{sessionStart:await HQ(r.sessionStart,t)}:r.sessionUpdate!=null?{sessionUpdate:await qQ(r.sessionUpdate,t)}:r.SessionTimeoutException!=null?{SessionTimeoutException:await VQ(r.SessionTimeoutException,t)}:r.SessionStreamingException!=null?{SessionStreamingException:await GQ(r.SessionStreamingException,t)}:{$unknown:r}),"de_StartLiveTailResponseStream"),HQ=g(async(e,t)=>{let r={},n=await(0,z.parseJsonBody)(e.body,t);return Object.assign(r,(0,f._json)(n)),r},"de_LiveTailSessionStart_event"),qQ=g(async(e,t)=>{let r={},n=await(0,z.parseJsonBody)(e.body,t);return Object.assign(r,(0,f._json)(n)),r},"de_LiveTailSessionUpdate_event"),GQ=g(async(e,t)=>{let r={...e,body:await(0,z.parseJsonBody)(e.body,t)};return WQ(r,t)},"de_SessionStreamingException_event"),VQ=g(async(e,t)=>{let r={...e,body:await(0,z.parseJsonBody)(e.body,t)};return ZQ(r,t)},"de_SessionTimeoutException_event"),WQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new bR({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_SessionStreamingExceptionRes"),ZQ=g(async(e,t)=>{let r=e.body,n=(0,f._json)(r),s=new TR({$metadata:I(e),...n});return(0,f.decorateServiceException)(s,r)},"de_SessionTimeoutExceptionRes"),KQ=g((e,t)=>(0,f.take)(e,{defaultValue:f.serializeFloat,dimensions:f._json,metricName:[],metricNamespace:[],metricValue:[],unit:[]}),"se_MetricTransformation"),JQ=g((e,t)=>e.filter(r=>r!=null).map(r=>KQ(r,t)),"se_MetricTransformations"),YQ=g((e,t)=>(0,f.take)(e,{applyOnTransformedLogs:[],filterName:[],filterPattern:[],logGroupName:[],metricTransformations:g(r=>JQ(r,t),"metricTransformations")}),"se_PutMetricFilterRequest"),QQ=g((e,t)=>(0,f.take)(e,{clientToken:[!0,r=>r??(0,DK.v4)()],logGroupNames:f._json,name:[],queryDefinitionId:[],queryLanguage:[],queryString:[]}),"se_PutQueryDefinitionRequest"),XQ=g((e,t)=>(0,f.take)(e,{metricFilters:g(r=>r7(r,t),"metricFilters"),nextToken:f.expectString}),"de_DescribeMetricFiltersResponse"),e7=g((e,t)=>(0,f.take)(e,{encryptionKey:f.expectString,queryLanguage:f.expectString,results:f._json,statistics:g(r=>o7(r,t),"statistics"),status:f.expectString}),"de_GetQueryResultsResponse"),t7=g((e,t)=>(0,f.take)(e,{applyOnTransformedLogs:f.expectBoolean,creationTime:f.expectLong,filterName:f.expectString,filterPattern:f.expectString,logGroupName:f.expectString,metricTransformations:g(r=>s7(r,t),"metricTransformations")}),"de_MetricFilter"),r7=g((e,t)=>(e||[]).filter(n=>n!=null).map(n=>t7(n,t)),"de_MetricFilters"),n7=g((e,t)=>(0,f.take)(e,{defaultValue:f.limitedParseDouble,dimensions:f._json,metricName:f.expectString,metricNamespace:f.expectString,metricValue:f.expectString,unit:f.expectString}),"de_MetricTransformation"),s7=g((e,t)=>(e||[]).filter(n=>n!=null).map(n=>n7(n,t)),"de_MetricTransformations"),o7=g((e,t)=>(0,f.take)(e,{bytesScanned:f.limitedParseDouble,estimatedBytesSkipped:f.limitedParseDouble,estimatedRecordsSkipped:f.limitedParseDouble,logGroupsScanned:f.limitedParseDouble,recordsMatched:f.limitedParseDouble,recordsScanned:f.limitedParseDouble}),"de_QueryStatistics"),I=g(e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),"deserializeMetadata"),i7=(0,f.withBaseException)(Te),k=g(async(e,t,r,n,s)=>{let{hostname:o,protocol:i="https",port:a,path:c}=await e.endpoint(),d={protocol:i,hostname:o,port:a,method:"POST",path:c.endsWith("/")?c.slice(0,-1)+r:c+r,headers:t};return n!==void 0&&(d.hostname=n),s!==void 0&&(d.body=s),new fu.HttpRequest(d)},"buildHttpRpcRequest");function D(e){return{"content-type":"application/x-amz-json-1.1","x-amz-target":`Logs_20140328.${e}`}}g(D,"sharedHeaders");var RR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","AssociateKmsKey",{}).n("CloudWatchLogsClient","AssociateKmsKeyCommand").f(void 0,void 0).ser(aJ).de(H9).build(){static{g(this,"AssociateKmsKeyCommand")}},NR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","CancelExportTask",{}).n("CloudWatchLogsClient","CancelExportTaskCommand").f(void 0,void 0).ser(cJ).de(q9).build(){static{g(this,"CancelExportTaskCommand")}},LR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","CreateDelivery",{}).n("CloudWatchLogsClient","CreateDeliveryCommand").f(void 0,void 0).ser(dJ).de(G9).build(){static{g(this,"CreateDeliveryCommand")}},kR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","CreateExportTask",{}).n("CloudWatchLogsClient","CreateExportTaskCommand").f(void 0,void 0).ser(lJ).de(V9).build(){static{g(this,"CreateExportTaskCommand")}},MR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","CreateLogAnomalyDetector",{}).n("CloudWatchLogsClient","CreateLogAnomalyDetectorCommand").f(void 0,void 0).ser(uJ).de(W9).build(){static{g(this,"CreateLogAnomalyDetectorCommand")}},FR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","CreateLogGroup",{}).n("CloudWatchLogsClient","CreateLogGroupCommand").f(void 0,void 0).ser(mJ).de(Z9).build(){static{g(this,"CreateLogGroupCommand")}},jR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","CreateLogStream",{}).n("CloudWatchLogsClient","CreateLogStreamCommand").f(void 0,void 0).ser(pJ).de(K9).build(){static{g(this,"CreateLogStreamCommand")}},UR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteAccountPolicy",{}).n("CloudWatchLogsClient","DeleteAccountPolicyCommand").f(void 0,void 0).ser(fJ).de(J9).build(){static{g(this,"DeleteAccountPolicyCommand")}},BR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteDataProtectionPolicy",{}).n("CloudWatchLogsClient","DeleteDataProtectionPolicyCommand").f(void 0,void 0).ser(gJ).de(Y9).build(){static{g(this,"DeleteDataProtectionPolicyCommand")}},$R=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteDelivery",{}).n("CloudWatchLogsClient","DeleteDeliveryCommand").f(void 0,void 0).ser(hJ).de(Q9).build(){static{g(this,"DeleteDeliveryCommand")}},zR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteDeliveryDestination",{}).n("CloudWatchLogsClient","DeleteDeliveryDestinationCommand").f(void 0,void 0).ser(yJ).de(X9).build(){static{g(this,"DeleteDeliveryDestinationCommand")}},HR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteDeliveryDestinationPolicy",{}).n("CloudWatchLogsClient","DeleteDeliveryDestinationPolicyCommand").f(void 0,void 0).ser(_J).de(eY).build(){static{g(this,"DeleteDeliveryDestinationPolicyCommand")}},qR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteDeliverySource",{}).n("CloudWatchLogsClient","DeleteDeliverySourceCommand").f(void 0,void 0).ser(vJ).de(tY).build(){static{g(this,"DeleteDeliverySourceCommand")}},GR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteDestination",{}).n("CloudWatchLogsClient","DeleteDestinationCommand").f(void 0,void 0).ser(SJ).de(rY).build(){static{g(this,"DeleteDestinationCommand")}},VR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteIndexPolicy",{}).n("CloudWatchLogsClient","DeleteIndexPolicyCommand").f(void 0,void 0).ser(EJ).de(nY).build(){static{g(this,"DeleteIndexPolicyCommand")}},WR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteIntegration",{}).n("CloudWatchLogsClient","DeleteIntegrationCommand").f(void 0,void 0).ser(CJ).de(sY).build(){static{g(this,"DeleteIntegrationCommand")}},ZR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteLogAnomalyDetector",{}).n("CloudWatchLogsClient","DeleteLogAnomalyDetectorCommand").f(void 0,void 0).ser(bJ).de(oY).build(){static{g(this,"DeleteLogAnomalyDetectorCommand")}},KR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteLogGroup",{}).n("CloudWatchLogsClient","DeleteLogGroupCommand").f(void 0,void 0).ser(wJ).de(iY).build(){static{g(this,"DeleteLogGroupCommand")}},JR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteLogStream",{}).n("CloudWatchLogsClient","DeleteLogStreamCommand").f(void 0,void 0).ser(TJ).de(aY).build(){static{g(this,"DeleteLogStreamCommand")}},YR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteMetricFilter",{}).n("CloudWatchLogsClient","DeleteMetricFilterCommand").f(void 0,void 0).ser(PJ).de(cY).build(){static{g(this,"DeleteMetricFilterCommand")}},QR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteQueryDefinition",{}).n("CloudWatchLogsClient","DeleteQueryDefinitionCommand").f(void 0,void 0).ser(xJ).de(dY).build(){static{g(this,"DeleteQueryDefinitionCommand")}},XR=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteResourcePolicy",{}).n("CloudWatchLogsClient","DeleteResourcePolicyCommand").f(void 0,void 0).ser(IJ).de(lY).build(){static{g(this,"DeleteResourcePolicyCommand")}},eN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteRetentionPolicy",{}).n("CloudWatchLogsClient","DeleteRetentionPolicyCommand").f(void 0,void 0).ser(AJ).de(uY).build(){static{g(this,"DeleteRetentionPolicyCommand")}},tN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteSubscriptionFilter",{}).n("CloudWatchLogsClient","DeleteSubscriptionFilterCommand").f(void 0,void 0).ser(OJ).de(mY).build(){static{g(this,"DeleteSubscriptionFilterCommand")}},rN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DeleteTransformer",{}).n("CloudWatchLogsClient","DeleteTransformerCommand").f(void 0,void 0).ser(DJ).de(pY).build(){static{g(this,"DeleteTransformerCommand")}},nN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DescribeAccountPolicies",{}).n("CloudWatchLogsClient","DescribeAccountPoliciesCommand").f(void 0,void 0).ser(RJ).de(fY).build(){static{g(this,"DescribeAccountPoliciesCommand")}},Ph=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DescribeConfigurationTemplates",{}).n("CloudWatchLogsClient","DescribeConfigurationTemplatesCommand").f(void 0,void 0).ser(NJ).de(gY).build(){static{g(this,"DescribeConfigurationTemplatesCommand")}},xh=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DescribeDeliveries",{}).n("CloudWatchLogsClient","DescribeDeliveriesCommand").f(void 0,void 0).ser(LJ).de(hY).build(){static{g(this,"DescribeDeliveriesCommand")}},Ih=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DescribeDeliveryDestinations",{}).n("CloudWatchLogsClient","DescribeDeliveryDestinationsCommand").f(void 0,void 0).ser(kJ).de(yY).build(){static{g(this,"DescribeDeliveryDestinationsCommand")}},Ah=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DescribeDeliverySources",{}).n("CloudWatchLogsClient","DescribeDeliverySourcesCommand").f(void 0,void 0).ser(MJ).de(_Y).build(){static{g(this,"DescribeDeliverySourcesCommand")}},Oh=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DescribeDestinations",{}).n("CloudWatchLogsClient","DescribeDestinationsCommand").f(void 0,void 0).ser(FJ).de(vY).build(){static{g(this,"DescribeDestinationsCommand")}},sN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DescribeExportTasks",{}).n("CloudWatchLogsClient","DescribeExportTasksCommand").f(void 0,void 0).ser(jJ).de(SY).build(){static{g(this,"DescribeExportTasksCommand")}},oN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DescribeFieldIndexes",{}).n("CloudWatchLogsClient","DescribeFieldIndexesCommand").f(void 0,void 0).ser(UJ).de(EY).build(){static{g(this,"DescribeFieldIndexesCommand")}},iN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DescribeIndexPolicies",{}).n("CloudWatchLogsClient","DescribeIndexPoliciesCommand").f(void 0,void 0).ser(BJ).de(CY).build(){static{g(this,"DescribeIndexPoliciesCommand")}},Dh=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DescribeLogGroups",{}).n("CloudWatchLogsClient","DescribeLogGroupsCommand").f(void 0,void 0).ser($J).de(bY).build(){static{g(this,"DescribeLogGroupsCommand")}},Rh=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DescribeLogStreams",{}).n("CloudWatchLogsClient","DescribeLogStreamsCommand").f(void 0,void 0).ser(zJ).de(wY).build(){static{g(this,"DescribeLogStreamsCommand")}},Nh=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DescribeMetricFilters",{}).n("CloudWatchLogsClient","DescribeMetricFiltersCommand").f(void 0,void 0).ser(HJ).de(TY).build(){static{g(this,"DescribeMetricFiltersCommand")}},aN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DescribeQueries",{}).n("CloudWatchLogsClient","DescribeQueriesCommand").f(void 0,void 0).ser(qJ).de(PY).build(){static{g(this,"DescribeQueriesCommand")}},cN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DescribeQueryDefinitions",{}).n("CloudWatchLogsClient","DescribeQueryDefinitionsCommand").f(void 0,void 0).ser(GJ).de(xY).build(){static{g(this,"DescribeQueryDefinitionsCommand")}},dN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DescribeResourcePolicies",{}).n("CloudWatchLogsClient","DescribeResourcePoliciesCommand").f(void 0,void 0).ser(VJ).de(IY).build(){static{g(this,"DescribeResourcePoliciesCommand")}},Lh=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DescribeSubscriptionFilters",{}).n("CloudWatchLogsClient","DescribeSubscriptionFiltersCommand").f(void 0,void 0).ser(WJ).de(AY).build(){static{g(this,"DescribeSubscriptionFiltersCommand")}},lN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","DisassociateKmsKey",{}).n("CloudWatchLogsClient","DisassociateKmsKeyCommand").f(void 0,void 0).ser(ZJ).de(OY).build(){static{g(this,"DisassociateKmsKeyCommand")}},kh=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","FilterLogEvents",{}).n("CloudWatchLogsClient","FilterLogEventsCommand").f(void 0,void 0).ser(KJ).de(DY).build(){static{g(this,"FilterLogEventsCommand")}},uN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","GetDataProtectionPolicy",{}).n("CloudWatchLogsClient","GetDataProtectionPolicyCommand").f(void 0,void 0).ser(JJ).de(RY).build(){static{g(this,"GetDataProtectionPolicyCommand")}},mN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","GetDelivery",{}).n("CloudWatchLogsClient","GetDeliveryCommand").f(void 0,void 0).ser(YJ).de(NY).build(){static{g(this,"GetDeliveryCommand")}},pN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","GetDeliveryDestination",{}).n("CloudWatchLogsClient","GetDeliveryDestinationCommand").f(void 0,void 0).ser(QJ).de(LY).build(){static{g(this,"GetDeliveryDestinationCommand")}},fN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","GetDeliveryDestinationPolicy",{}).n("CloudWatchLogsClient","GetDeliveryDestinationPolicyCommand").f(void 0,void 0).ser(XJ).de(kY).build(){static{g(this,"GetDeliveryDestinationPolicyCommand")}},gN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","GetDeliverySource",{}).n("CloudWatchLogsClient","GetDeliverySourceCommand").f(void 0,void 0).ser(e9).de(MY).build(){static{g(this,"GetDeliverySourceCommand")}},hN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","GetIntegration",{}).n("CloudWatchLogsClient","GetIntegrationCommand").f(void 0,void 0).ser(t9).de(FY).build(){static{g(this,"GetIntegrationCommand")}},yN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","GetLogAnomalyDetector",{}).n("CloudWatchLogsClient","GetLogAnomalyDetectorCommand").f(void 0,void 0).ser(r9).de(jY).build(){static{g(this,"GetLogAnomalyDetectorCommand")}},Mh=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","GetLogEvents",{}).n("CloudWatchLogsClient","GetLogEventsCommand").f(void 0,void 0).ser(n9).de(UY).build(){static{g(this,"GetLogEventsCommand")}},_N=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","GetLogGroupFields",{}).n("CloudWatchLogsClient","GetLogGroupFieldsCommand").f(void 0,void 0).ser(s9).de(BY).build(){static{g(this,"GetLogGroupFieldsCommand")}},vN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","GetLogRecord",{}).n("CloudWatchLogsClient","GetLogRecordCommand").f(void 0,void 0).ser(o9).de($Y).build(){static{g(this,"GetLogRecordCommand")}},SN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","GetQueryResults",{}).n("CloudWatchLogsClient","GetQueryResultsCommand").f(void 0,void 0).ser(i9).de(zY).build(){static{g(this,"GetQueryResultsCommand")}},EN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","GetTransformer",{}).n("CloudWatchLogsClient","GetTransformerCommand").f(void 0,void 0).ser(a9).de(HY).build(){static{g(this,"GetTransformerCommand")}},Fh=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","ListAnomalies",{}).n("CloudWatchLogsClient","ListAnomaliesCommand").f(void 0,void 0).ser(c9).de(qY).build(){static{g(this,"ListAnomaliesCommand")}},CN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","ListIntegrations",{}).n("CloudWatchLogsClient","ListIntegrationsCommand").f(void 0,void 0).ser(d9).de(GY).build(){static{g(this,"ListIntegrationsCommand")}},jh=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","ListLogAnomalyDetectors",{}).n("CloudWatchLogsClient","ListLogAnomalyDetectorsCommand").f(void 0,void 0).ser(l9).de(VY).build(){static{g(this,"ListLogAnomalyDetectorsCommand")}},bN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","ListLogGroups",{}).n("CloudWatchLogsClient","ListLogGroupsCommand").f(void 0,void 0).ser(u9).de(WY).build(){static{g(this,"ListLogGroupsCommand")}},Uh=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","ListLogGroupsForQuery",{}).n("CloudWatchLogsClient","ListLogGroupsForQueryCommand").f(void 0,void 0).ser(m9).de(ZY).build(){static{g(this,"ListLogGroupsForQueryCommand")}},wN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","ListTagsForResource",{}).n("CloudWatchLogsClient","ListTagsForResourceCommand").f(void 0,void 0).ser(p9).de(KY).build(){static{g(this,"ListTagsForResourceCommand")}},TN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","ListTagsLogGroup",{}).n("CloudWatchLogsClient","ListTagsLogGroupCommand").f(void 0,void 0).ser(f9).de(JY).build(){static{g(this,"ListTagsLogGroupCommand")}},PN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","PutAccountPolicy",{}).n("CloudWatchLogsClient","PutAccountPolicyCommand").f(void 0,void 0).ser(g9).de(YY).build(){static{g(this,"PutAccountPolicyCommand")}},xN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","PutDataProtectionPolicy",{}).n("CloudWatchLogsClient","PutDataProtectionPolicyCommand").f(void 0,void 0).ser(h9).de(QY).build(){static{g(this,"PutDataProtectionPolicyCommand")}},IN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","PutDeliveryDestination",{}).n("CloudWatchLogsClient","PutDeliveryDestinationCommand").f(void 0,void 0).ser(y9).de(XY).build(){static{g(this,"PutDeliveryDestinationCommand")}},AN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","PutDeliveryDestinationPolicy",{}).n("CloudWatchLogsClient","PutDeliveryDestinationPolicyCommand").f(void 0,void 0).ser(_9).de(eQ).build(){static{g(this,"PutDeliveryDestinationPolicyCommand")}},ON=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","PutDeliverySource",{}).n("CloudWatchLogsClient","PutDeliverySourceCommand").f(void 0,void 0).ser(v9).de(tQ).build(){static{g(this,"PutDeliverySourceCommand")}},DN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","PutDestination",{}).n("CloudWatchLogsClient","PutDestinationCommand").f(void 0,void 0).ser(S9).de(rQ).build(){static{g(this,"PutDestinationCommand")}},RN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","PutDestinationPolicy",{}).n("CloudWatchLogsClient","PutDestinationPolicyCommand").f(void 0,void 0).ser(E9).de(nQ).build(){static{g(this,"PutDestinationPolicyCommand")}},NN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","PutIndexPolicy",{}).n("CloudWatchLogsClient","PutIndexPolicyCommand").f(void 0,void 0).ser(C9).de(sQ).build(){static{g(this,"PutIndexPolicyCommand")}},LN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","PutIntegration",{}).n("CloudWatchLogsClient","PutIntegrationCommand").f(void 0,void 0).ser(b9).de(oQ).build(){static{g(this,"PutIntegrationCommand")}},kN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","PutLogEvents",{}).n("CloudWatchLogsClient","PutLogEventsCommand").f(void 0,void 0).ser(w9).de(iQ).build(){static{g(this,"PutLogEventsCommand")}},MN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","PutMetricFilter",{}).n("CloudWatchLogsClient","PutMetricFilterCommand").f(void 0,void 0).ser(T9).de(aQ).build(){static{g(this,"PutMetricFilterCommand")}},FN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","PutQueryDefinition",{}).n("CloudWatchLogsClient","PutQueryDefinitionCommand").f(void 0,void 0).ser(P9).de(cQ).build(){static{g(this,"PutQueryDefinitionCommand")}},jN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","PutResourcePolicy",{}).n("CloudWatchLogsClient","PutResourcePolicyCommand").f(void 0,void 0).ser(x9).de(dQ).build(){static{g(this,"PutResourcePolicyCommand")}},UN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","PutRetentionPolicy",{}).n("CloudWatchLogsClient","PutRetentionPolicyCommand").f(void 0,void 0).ser(I9).de(lQ).build(){static{g(this,"PutRetentionPolicyCommand")}},BN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","PutSubscriptionFilter",{}).n("CloudWatchLogsClient","PutSubscriptionFilterCommand").f(void 0,void 0).ser(A9).de(uQ).build(){static{g(this,"PutSubscriptionFilterCommand")}},$N=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","PutTransformer",{}).n("CloudWatchLogsClient","PutTransformerCommand").f(void 0,void 0).ser(O9).de(mQ).build(){static{g(this,"PutTransformerCommand")}},zN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","StartLiveTail",{eventStream:{output:!0}}).n("CloudWatchLogsClient","StartLiveTailCommand").f(void 0,DR).ser(D9).de(pQ).build(){static{g(this,"StartLiveTailCommand")}},HN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","StartQuery",{}).n("CloudWatchLogsClient","StartQueryCommand").f(void 0,void 0).ser(R9).de(fQ).build(){static{g(this,"StartQueryCommand")}},qN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","StopQuery",{}).n("CloudWatchLogsClient","StopQueryCommand").f(void 0,void 0).ser(N9).de(gQ).build(){static{g(this,"StopQueryCommand")}},GN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","TagLogGroup",{}).n("CloudWatchLogsClient","TagLogGroupCommand").f(void 0,void 0).ser(L9).de(hQ).build(){static{g(this,"TagLogGroupCommand")}},VN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","TagResource",{}).n("CloudWatchLogsClient","TagResourceCommand").f(void 0,void 0).ser(k9).de(yQ).build(){static{g(this,"TagResourceCommand")}},WN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","TestMetricFilter",{}).n("CloudWatchLogsClient","TestMetricFilterCommand").f(void 0,void 0).ser(M9).de(_Q).build(){static{g(this,"TestMetricFilterCommand")}},ZN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","TestTransformer",{}).n("CloudWatchLogsClient","TestTransformerCommand").f(void 0,void 0).ser(F9).de(vQ).build(){static{g(this,"TestTransformerCommand")}},KN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","UntagLogGroup",{}).n("CloudWatchLogsClient","UntagLogGroupCommand").f(void 0,void 0).ser(j9).de(SQ).build(){static{g(this,"UntagLogGroupCommand")}},JN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","UntagResource",{}).n("CloudWatchLogsClient","UntagResourceCommand").f(void 0,void 0).ser(U9).de(EQ).build(){static{g(this,"UntagResourceCommand")}},YN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","UpdateAnomaly",{}).n("CloudWatchLogsClient","UpdateAnomalyCommand").f(void 0,void 0).ser(B9).de(CQ).build(){static{g(this,"UpdateAnomalyCommand")}},QN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","UpdateDeliveryConfiguration",{}).n("CloudWatchLogsClient","UpdateDeliveryConfigurationCommand").f(void 0,void 0).ser($9).de(bQ).build(){static{g(this,"UpdateDeliveryConfigurationCommand")}},XN=class extends f.Command.classBuilder().ep(R).m(function(e,t,r,n){return[(0,N.getSerdePlugin)(r,this.serialize,this.deserialize),(0,O.getEndpointPlugin)(r,e.getEndpointParameterInstructions())]}).s("Logs_20140328","UpdateLogAnomalyDetector",{}).n("CloudWatchLogsClient","UpdateLogAnomalyDetectorCommand").f(void 0,void 0).ser(z9).de(wQ).build(){static{g(this,"UpdateLogAnomalyDetectorCommand")}},a7={AssociateKmsKeyCommand:RR,CancelExportTaskCommand:NR,CreateDeliveryCommand:LR,CreateExportTaskCommand:kR,CreateLogAnomalyDetectorCommand:MR,CreateLogGroupCommand:FR,CreateLogStreamCommand:jR,DeleteAccountPolicyCommand:UR,DeleteDataProtectionPolicyCommand:BR,DeleteDeliveryCommand:$R,DeleteDeliveryDestinationCommand:zR,DeleteDeliveryDestinationPolicyCommand:HR,DeleteDeliverySourceCommand:qR,DeleteDestinationCommand:GR,DeleteIndexPolicyCommand:VR,DeleteIntegrationCommand:WR,DeleteLogAnomalyDetectorCommand:ZR,DeleteLogGroupCommand:KR,DeleteLogStreamCommand:JR,DeleteMetricFilterCommand:YR,DeleteQueryDefinitionCommand:QR,DeleteResourcePolicyCommand:XR,DeleteRetentionPolicyCommand:eN,DeleteSubscriptionFilterCommand:tN,DeleteTransformerCommand:rN,DescribeAccountPoliciesCommand:nN,DescribeConfigurationTemplatesCommand:Ph,DescribeDeliveriesCommand:xh,DescribeDeliveryDestinationsCommand:Ih,DescribeDeliverySourcesCommand:Ah,DescribeDestinationsCommand:Oh,DescribeExportTasksCommand:sN,DescribeFieldIndexesCommand:oN,DescribeIndexPoliciesCommand:iN,DescribeLogGroupsCommand:Dh,DescribeLogStreamsCommand:Rh,DescribeMetricFiltersCommand:Nh,DescribeQueriesCommand:aN,DescribeQueryDefinitionsCommand:cN,DescribeResourcePoliciesCommand:dN,DescribeSubscriptionFiltersCommand:Lh,DisassociateKmsKeyCommand:lN,FilterLogEventsCommand:kh,GetDataProtectionPolicyCommand:uN,GetDeliveryCommand:mN,GetDeliveryDestinationCommand:pN,GetDeliveryDestinationPolicyCommand:fN,GetDeliverySourceCommand:gN,GetIntegrationCommand:hN,GetLogAnomalyDetectorCommand:yN,GetLogEventsCommand:Mh,GetLogGroupFieldsCommand:_N,GetLogRecordCommand:vN,GetQueryResultsCommand:SN,GetTransformerCommand:EN,ListAnomaliesCommand:Fh,ListIntegrationsCommand:CN,ListLogAnomalyDetectorsCommand:jh,ListLogGroupsCommand:bN,ListLogGroupsForQueryCommand:Uh,ListTagsForResourceCommand:wN,ListTagsLogGroupCommand:TN,PutAccountPolicyCommand:PN,PutDataProtectionPolicyCommand:xN,PutDeliveryDestinationCommand:IN,PutDeliveryDestinationPolicyCommand:AN,PutDeliverySourceCommand:ON,PutDestinationCommand:DN,PutDestinationPolicyCommand:RN,PutIndexPolicyCommand:NN,PutIntegrationCommand:LN,PutLogEventsCommand:kN,PutMetricFilterCommand:MN,PutQueryDefinitionCommand:FN,PutResourcePolicyCommand:jN,PutRetentionPolicyCommand:UN,PutSubscriptionFilterCommand:BN,PutTransformerCommand:$N,StartLiveTailCommand:zN,StartQueryCommand:HN,StopQueryCommand:qN,TagLogGroupCommand:GN,TagResourceCommand:VN,TestMetricFilterCommand:WN,TestTransformerCommand:ZN,UntagLogGroupCommand:KN,UntagResourceCommand:JN,UpdateAnomalyCommand:YN,UpdateDeliveryConfigurationCommand:QN,UpdateLogAnomalyDetectorCommand:XN},eL=class extends Ke{static{g(this,"CloudWatchLogs")}};(0,f.createAggregatedClient)(a7,eL);var c7=(0,ze.createPaginator)(Ke,Ph,"nextToken","nextToken","limit"),d7=(0,ze.createPaginator)(Ke,xh,"nextToken","nextToken","limit"),l7=(0,ze.createPaginator)(Ke,Ih,"nextToken","nextToken","limit"),u7=(0,ze.createPaginator)(Ke,Ah,"nextToken","nextToken","limit"),m7=(0,ze.createPaginator)(Ke,Oh,"nextToken","nextToken","limit"),p7=(0,ze.createPaginator)(Ke,Dh,"nextToken","nextToken","limit"),f7=(0,ze.createPaginator)(Ke,Rh,"nextToken","nextToken","limit"),g7=(0,ze.createPaginator)(Ke,Nh,"nextToken","nextToken","limit"),h7=(0,ze.createPaginator)(Ke,Lh,"nextToken","nextToken","limit"),y7=(0,ze.createPaginator)(Ke,kh,"nextToken","nextToken","limit"),_7=(0,ze.createPaginator)(Ke,Mh,"nextToken","nextForwardToken","limit"),v7=(0,ze.createPaginator)(Ke,Fh,"nextToken","nextToken","limit"),S7=(0,ze.createPaginator)(Ke,jh,"nextToken","nextToken","limit"),E7=(0,ze.createPaginator)(Ke,Uh,"nextToken","nextToken","maxResults")});var Bh=b(lr=>{"use strict";var C7=lr&&lr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),b7=lr&&lr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),w7=lr&&lr.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[n.length]=s);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),s=0;s<n.length;s++)n[s]!=="default"&&C7(r,t,n[s]);return b7(r,t),r}}();Object.defineProperty(lr,"__esModule",{value:!0});lr.createCloudWatchTransport=void 0;var T7=Ft(),Tn=zr(),P7=ur(),x7=(e={})=>{let t="CloudWatch";try{let r=e.level??T7.LogLevel.INFO,n=e.formatter||{format:T=>JSON.stringify(T)},s=e.logGroupName||process.env.CLOUDWATCH_LOG_GROUP||"/aws/lambda/my-function",o=e.logStreamName||process.env.CLOUDWATCH_LOG_STREAM,i=e.region||process.env.AWS_REGION||"us-east-1",a=e.maxStreamSize??45*1024*1024,c=e.maxStreamAge??23*60*60*1e3,d=e.batchSize||10,l=e.flushInterval||5e3,u=e.timeout||3e4;(0,Tn.validateEnvironmentVariable)("CLOUDWATCH_LOG_GROUP",s,!1),(0,Tn.validateEnvironmentVariable)("AWS_REGION",i,!1),(0,Tn.validateTransportConfig)(t,{logGroupName:s,region:i},["logGroupName","region"]);let m={currentStreamName:o||`${new Date().toISOString().split("T")[0]}-${Date.now()}`,currentStreamSize:0,streamStartTime:Date.now(),sequenceToken:void 0,batch:[]},p=null,h=()=>{let T=Date.now()-m.streamStartTime;return m.currentStreamSize>=a||T>=c},y=()=>{let T=new Date().toISOString().replace(/[:.]/g,"-");return o?`${o}-${T}`:`${new Date().toISOString().split("T")[0]}-${T}`},_=async T=>{try{let{CloudWatchLogsClient:A,PutLogEventsCommand:H,CreateLogStreamCommand:Z}=await Promise.resolve().then(()=>w7(rL())),V=new A({region:i,requestHandler:{requestTimeout:u}});try{await V.send(new Z({logGroupName:s,logStreamName:m.currentStreamName}))}catch(kr){if(kr instanceof Error&&kr.name!=="ResourceAlreadyExistsException")throw kr}let me=T.map(kr=>({timestamp:new Date(kr.timestamp).getTime(),message:n.format(kr)})),K=new H({logGroupName:s,logStreamName:m.currentStreamName,logEvents:me,sequenceToken:m.sequenceToken}),Ee=await V.send(K);Ee.nextSequenceToken&&(m.sequenceToken=Ee.nextSequenceToken);let Ns=me.reduce((kr,GL)=>kr+GL.message.length,0);m.currentStreamSize+=Ns}catch(A){if(A instanceof Error&&A.name==="InvalidSequenceTokenException"){let H=A.message.match(/sequenceToken is: (.+)/);if(H){m.sequenceToken=H[1],await _(T);return}}throw A instanceof Error&&A.name==="ResourceNotFoundException"?(0,Tn.createDetailedError)("CLOUDWATCH_LOG_GROUP_NOT_FOUND",t,{logGroupName:s,region:i,message:"Log group does not exist. Create it first in CloudWatch."}):(0,Tn.createDetailedError)("CLOUDWATCH_API_ERROR",t,{error:A instanceof Error?A.message:String(A),logGroupName:s,logStreamName:m.currentStreamName,region:i})}},w=async()=>{try{await E(),m.currentStreamName=y(),m.currentStreamSize=0,m.streamStartTime=Date.now(),m.sequenceToken=void 0,console.log(`[CLOUDWATCH] Rotated to stream: ${m.currentStreamName}`)}catch(T){(0,Tn.handleTransportError)(T,t,!0)}},E=async()=>{if(m.batch.length===0)return;let T=[...m.batch];m.batch=[],await _(T)};return(()=>{p||(p=setInterval(()=>{E().catch(T=>{(0,Tn.handleTransportError)(T,t,!0)})},l))})(),{log:async T=>{(0,P7.shouldLog)(T.level,r)&&(h()&&await w(),m.batch.push(T),m.batch.length>=d&&await E())},setLevel:T=>{r=T},getLevel:()=>r,rotateStream:async()=>{await w()},getCurrentStream:()=>m.currentStreamName,getCurrentStreamSize:()=>m.currentStreamSize,flush:async()=>{await E()},close:async()=>{p&&(clearInterval(p),p=null),await E()},getConfig:()=>({logGroupName:s,logStreamName:m.currentStreamName,region:i,maxStreamSize:a,maxStreamAge:c,batchSize:d,flushInterval:l,timeout:u}),getStats:()=>({currentStream:m.currentStreamName,currentStreamSize:m.currentStreamSize,streamAge:Date.now()-m.streamStartTime,batchSize:m.batch.length,sequenceToken:m.sequenceToken?"set":"not set",flushTimerActive:!!p})}}catch(r){throw(0,Tn.handleTransportError)(r,t,!1),r}};lr.createCloudWatchTransport=x7});var nL=b(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.createPerformanceMonitor=void 0;var I7=e=>{let t=e||{metrics:new Map},r=(u,m)=>{t.metrics.has(u)||t.metrics.set(u,[]);let p=t.metrics.get(u);p&&p.push(m)},n=u=>{let m=performance.now();return p=>{let h=performance.now(),y=h-m,_={functionName:u,duration:y,startTime:m,endTime:h,...p&&{metadata:p}};return r(u,_),_}},s=async(u,m,p)=>{let h=performance.now();try{let y=await m(),_=performance.now(),w=_-h,E={functionName:u,duration:w,startTime:h,endTime:_,...p&&{metadata:p}};return r(u,E),y}catch(y){let _=performance.now(),w=_-h,E={functionName:u,duration:w,startTime:h,endTime:_,...p&&{metadata:{...p,error:!0}}};throw r(u,E),y}},o=(u,m,p)=>{let h=performance.now();try{let y=m(),_=performance.now(),w=_-h,E={functionName:u,duration:w,startTime:h,endTime:_,...p&&{metadata:p}};return r(u,E),y}catch(y){let _=performance.now(),w=_-h,E={functionName:u,duration:w,startTime:h,endTime:_,...p&&{metadata:{...p,error:!0}}};throw r(u,E),y}},i=u=>{if(u)return t.metrics.get(u)||[];let m=[];for(let p of t.metrics.values())m.push(...p);return m},a=u=>{let m=i(u);return m.length===0?0:m.reduce((h,y)=>h+y.duration,0)/m.length};return{state:t,startTimer:n,timeAsync:s,timeSync:o,getMetrics:i,getAverageDuration:a,getSlowestExecution:u=>{let m=i(u);return m.length===0?null:m.reduce((p,h)=>h.duration>p.duration?h:p)},clearMetrics:u=>{u?t.metrics.delete(u):t.metrics.clear()},getMetricsSummary:()=>{let u={};for(let[m,p]of t.metrics.entries()){let h=p.length,y=a(m),_=Math.max(...p.map(w=>w.duration));u[m]={count:h,avgDuration:y,maxDuration:_}}return u}}};hu.createPerformanceMonitor=I7});var sL=b(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.stroggerWithFileTransport=Ds.createFileTransportExample=void 0;var yu=Rr(),A7=(e={})=>{let t=e.level??yu.LogLevel.INFO,r=e.maxFileSize??10*1024*1024,n=e.rotationInterval??24*60*60*1e3,s=0,o=Date.now(),i=()=>s>=r||Date.now()-o>=n,a=async()=>{s=0,o=Date.now(),console.log("[MOCK FILE] Rotated log file")},c=async d=>{i()&&await a(),s+=d.length,console.log(`[MOCK FILE] Writing: ${d}`)};return{log:async d=>{if(d.level<t)return;let l=JSON.stringify(d);await c(l)},setLevel:d=>{t=d},getLevel:()=>t}};Ds.createFileTransportExample=A7;var O7=(0,yu.getEnvironment)(),D7=(0,yu.createJsonFormatter)(),R7=(0,Ds.createFileTransportExample)({maxFileSize:1024,rotationInterval:1e4});Ds.stroggerWithFileTransport=(0,yu.createLogger)({config:{serviceName:"file-rotation-example"},transports:[R7],formatter:D7,env:O7})});var oL=b(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.loggerWithCloudWatchTransport=Rs.createCloudWatchTransportExample=void 0;var _u=Rr(),N7=(e={})=>{let t=e.level??_u.LogLevel.INFO,r=e.maxStreamSize??45*1024*1024,n=e.maxStreamAge??23*60*60*1e3,s=0,o=Date.now(),i=()=>s>=r||Date.now()-o>=n,a=async()=>{s=0,o=Date.now(),console.log("[MOCK CW] Rotated log stream")},c=async d=>{i()&&await a(),s+=d.length,console.log(`[MOCK CW] Sending: ${d}`)};return{log:async d=>{if(d.level<t)return;let l=JSON.stringify(d);await c(l)},setLevel:d=>{t=d},getLevel:()=>t}};Rs.createCloudWatchTransportExample=N7;var L7=(0,_u.getEnvironment)(),k7=(0,_u.createJsonFormatter)(),M7=(0,Rs.createCloudWatchTransportExample)({maxStreamSize:1024,maxStreamAge:1e4});Rs.loggerWithCloudWatchTransport=(0,_u.createLogger)({config:{serviceName:"cloudwatch-rotation-example"},transports:[M7],formatter:k7,env:L7})});var pL=b((He,mL)=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.demonstrateEnvironmentSpecificFileTransport=He.demonstrateCustomFileTransport=He.demonstrateMultipleFileTransports=He.demonstrateFileTransportWithSymlink=He.demonstrateCompressedFileTransport=He.demonstrateBasicFileTransport=He.runFileTransportExamples=void 0;var oe=Rr(),iL=()=>{console.log(`=== Basic File Transport ===
61
- `);let e=(0,oe.getEnvironment)(),t=(0,oe.createJsonFormatter)(),r=(0,oe.createFileTransport)({level:oe.LogLevel.INFO,filePath:"./logs/basic-app.log",maxFileSize:5*1024*1024,maxFiles:3}),n=(0,oe.createLogger)({config:{serviceName:"basic-file-example",stage:e.stage},transports:[r],formatter:t,env:e});return n.info("Application started with basic file transport"),n.warn("This is a warning message"),n.error("This is an error message",{userId:"user-123"}),n};He.demonstrateBasicFileTransport=iL;var aL=()=>{console.log(`
5
+ `,D=await fetch(F,{method:"POST",headers:{"Content-Type":"application/x-ndjson",...b()},body:k,signal:AbortSignal.timeout(p)});if(!D.ok){let $=await D.text().catch(()=>"Unable to read response body");throw(0,_t.createDetailedError)("ELASTICSEARCH_API_ERROR",e,{status:D.status,statusText:D.statusText,url:F,responseBody:$})}let J=await D.json().catch(()=>null);if(J?.errors&&Array.isArray(J.items)){let $=J.items.filter(me=>me.index?.error).map(me=>me.index?.error).slice(0,3);$?.length>0&&console.warn("[ELASTICSEARCH] Some documents failed to index:",$)}}catch(L){(0,_t.handleTransportError)(L,e,!0)}},T=y=>{switch(y){case yt.LogLevel.DEBUG:return"debug";case yt.LogLevel.INFO:return"info";case yt.LogLevel.WARN:return"warn";case yt.LogLevel.ERROR:return"error";case yt.LogLevel.FATAL:return"fatal";default:return"info"}},I=async()=>{if(d.length===0)return;let y=[...d];d=[],await E(y)};return(()=>{m||(m=setInterval(()=>{I().catch(y=>{(0,_t.handleTransportError)(y,e,!0)})},h))})(),{log:async y=>{(0,ho.shouldLog)(y.level,r)&&(d.push(y),d.length>=u&&await I())},setLevel:y=>{r=y},getLevel:()=>r,flush:async()=>{await I()},close:async()=>{m&&(clearInterval(m),m=null),await I()},getConfig:()=>({url:n,index:o,indexPattern:g,batchSize:u,flushInterval:h,timeout:p}),getCurrentIndex:()=>S()}}catch(r){throw(0,_t.handleTransportError)(r,e,!1),r}};Ht.createElasticsearchTransport=vo});var br=O(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.createNewRelicTransport=void 0;var yo=le(),nt=De(),_o=_e(),Io=(t={})=>{let e="New Relic";try{let r=t.level??yo.LogLevel.INFO,n=t.apiKey||process.env.NEW_RELIC_LICENSE_KEY,s=t.accountId||process.env.NEW_RELIC_ACCOUNT_ID,a=t.region||process.env.NEW_RELIC_REGION||"us",i=t.serviceName||process.env.NEW_RELIC_SERVICE_NAME,o=t.batchSize||10,g=t.flushInterval||5e3;(0,nt.validateEnvironmentVariable)("NEW_RELIC_LICENSE_KEY",n,!0),(0,nt.validateEnvironmentVariable)("NEW_RELIC_ACCOUNT_ID",s,!0),(0,nt.validateTransportConfig)(e,{apiKey:n,accountId:s},["apiKey","accountId"]);let u=[],h=null,p=async S=>{try{let b=`https://log-api.${a}.newrelic.com/log/v1`,E={timestamp:Date.now(),service:i,attributes:{logtype:"application",timestamp:new Date().toISOString()},logs:S.map(I=>({message:I.message,level:I.level,timestamp:new Date(I.timestamp).getTime(),attributes:{...I.context,...I.error&&{error_name:I.error.name,error_message:I.error.message,error_stack:I.error.stack},...I.metadata&&{metadata:I.metadata}}}))},T=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json","Api-Key":n,"X-License-Key":n},body:JSON.stringify(E)});if(!T.ok)throw(0,nt.createDetailedError)("NEW_RELIC_API_ERROR",e,{status:T.status,statusText:T.statusText,url:b,responseBody:await T.text().catch(()=>"Unable to read response body")})}catch(b){(0,nt.handleTransportError)(b,e,!0)}},d=async()=>{if(u.length===0)return;let S=[...u];u=[],await p(S)};return(()=>{h||(h=setInterval(()=>{d().catch(S=>{(0,nt.handleTransportError)(S,e,!0)})},g))})(),{log:async S=>{(0,_o.shouldLog)(S.level,r)&&(u.push(S),u.length>=o&&await d())},setLevel:S=>{r=S},getLevel:()=>r,flush:async()=>{await d()},close:async()=>{h&&(clearInterval(h),h=null),await d()}}}catch(r){throw(0,nt.handleTransportError)(r,e,!1),r}};Kt.createNewRelicTransport=Io});var cn=O(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.createFileTransport=void 0;var te=require("node:fs"),xt=require("node:path"),So=require("node:util"),To=require("node:zlib"),Co=le(),Pe=De(),bo=_e(),Eo=(0,So.promisify)(To.gzip),Lo=(t={})=>{let e="File";try{let r=t.level??Co.LogLevel.INFO,n=t.formatter||{format:k=>JSON.stringify(k)},s=t.filePath||process.env.LOG_FILE_PATH||"./logs/app.log",a=t.maxFileSize??10*1024*1024,i=t.maxFiles??5,o=t.rotationInterval??24*60*60*1e3,g=t.compressOldFiles??!1,u=t.dateFormat??"YYYY-MM-DD",h=t.encoding??"utf8",p=t.createSymlink??!1,d=t.symlinkName??"current.log";(0,Pe.validateEnvironmentVariable)("LOG_FILE_PATH",s,!1),(0,Pe.validateTransportConfig)(e,{filePath:s},["filePath"]);let m={currentFile:s,currentSize:0,lastRotation:Date.now()},S=null,b=async k=>{let D=(0,xt.dirname)(k);try{await te.promises.access(D)}catch{await te.promises.mkdir(D,{recursive:!0})}},E=(k,D)=>{let J=(0,xt.extname)(k),$=k.replace(J,""),me=new Date().toISOString().split("T")[0];return`${$}.${me}.${D}${J}${g?".gz":""}`},T=()=>{let k=Date.now()-m.lastRotation;return m.currentSize>=a||k>=o},I=async k=>{if(g)try{let D=await te.promises.readFile(k,h),J=await Eo(D);await te.promises.writeFile(`${k}.gz`,J),await te.promises.unlink(k)}catch(D){(0,Pe.handleTransportError)(D,e,!0)}},j=async()=>{try{m.fileHandle&&(await m.fileHandle.close(),m.fileHandle=void 0);for(let D=i-1;D>=1;D--){let J=E(s,D),$=E(s,D+1);try{await te.promises.access(J),await te.promises.rename(J,$)}catch{}}let k=E(s,1);try{await te.promises.access(s),await te.promises.rename(s,k),await I(k)}catch{}if(m.currentSize=0,m.lastRotation=Date.now(),await b(s),m.fileHandle=await te.promises.open(s,"a"),p){let D=(0,xt.join)((0,xt.dirname)(s),d);try{await te.promises.unlink(D)}catch{}await te.promises.symlink((0,xt.basename)(s),D)}console.log(`[FILE] Rotated log file to: ${k}`)}catch(k){(0,Pe.handleTransportError)(k,e,!0)}},y=async k=>{try{T()&&await j(),m.fileHandle||(await b(s),m.fileHandle=await te.promises.open(s,"a"));let D=`${k}
6
+ `;await m.fileHandle.write(D,void 0,h),m.currentSize+=D.length}catch(D){(0,Pe.handleTransportError)(D,e,!0)}},L=async()=>{try{m.fileHandle&&await m.fileHandle.sync()}catch(k){(0,Pe.handleTransportError)(k,e,!0)}};return(()=>{S||(S=setInterval(()=>{L().catch(k=>{(0,Pe.handleTransportError)(k,e,!0)})},5e3))})(),{log:async k=>{if(!(0,bo.shouldLog)(k.level,r))return;let D=n.format(k);await y(D)},setLevel:k=>{r=k},getLevel:()=>r,rotate:async()=>{await j()},getCurrentFile:()=>m.currentFile,getCurrentSize:()=>m.currentSize,flush:async()=>{await L()},close:async()=>{S&&(clearInterval(S),S=null),m.fileHandle&&(await m.fileHandle.close(),m.fileHandle=void 0)},getConfig:()=>({filePath:s,maxFileSize:a,maxFiles:i,rotationInterval:o,compressOldFiles:g,dateFormat:u,encoding:h,createSymlink:p,symlinkName:d}),getStats:()=>({currentFile:m.currentFile,currentSize:m.currentSize,lastRotation:m.lastRotation,fileHandleOpen:!!m.fileHandle,flushTimerActive:!!S})}}catch(r){throw(0,Pe.handleTransportError)(r,e,!1),r}};Jt.createFileTransport=Lo});var Er=O(ye=>{"use strict";var xo=ye&&ye.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),wo=ye&&ye.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),No=ye&&ye.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[n.length]=s);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),s=0;s<n.length;s++)n[s]!=="default"&&xo(r,e,n[s]);return wo(r,e),r}}();Object.defineProperty(ye,"__esModule",{value:!0});ye.createCloudWatchTransport=void 0;var Ao=le(),Ze=De(),ko=_e(),Oo=(t={})=>{let e="CloudWatch";try{let r=t.level??Ao.LogLevel.INFO,n=t.formatter||{format:y=>JSON.stringify(y)},s=t.logGroupName||process.env.CLOUDWATCH_LOG_GROUP||"/aws/lambda/my-function",a=t.logStreamName||process.env.CLOUDWATCH_LOG_STREAM,i=t.region||process.env.AWS_REGION||"us-east-1",o=t.maxStreamSize??45*1024*1024,g=t.maxStreamAge??23*60*60*1e3,u=t.batchSize||10,h=t.flushInterval||5e3,p=t.timeout||3e4;(0,Ze.validateEnvironmentVariable)("CLOUDWATCH_LOG_GROUP",s,!1),(0,Ze.validateEnvironmentVariable)("AWS_REGION",i,!1),(0,Ze.validateTransportConfig)(e,{logGroupName:s,region:i},["logGroupName","region"]);let d={currentStreamName:a||`${new Date().toISOString().split("T")[0]}-${Date.now()}`,currentStreamSize:0,streamStartTime:Date.now(),sequenceToken:void 0,batch:[]},m=null,S=()=>{let y=Date.now()-d.streamStartTime;return d.currentStreamSize>=o||y>=g},b=()=>{let y=new Date().toISOString().replace(/[:.]/g,"-");return a?`${a}-${y}`:`${new Date().toISOString().split("T")[0]}-${y}`},E=async y=>{try{let{CloudWatchLogsClient:L,PutLogEventsCommand:F,CreateLogStreamCommand:k}=await Promise.resolve().then(()=>No(require("@aws-sdk/client-cloudwatch-logs"))),D=new L({region:i,requestHandler:{requestTimeout:p}});try{await D.send(new k({logGroupName:s,logStreamName:d.currentStreamName}))}catch(xe){if(xe instanceof Error&&xe.name!=="ResourceAlreadyExistsException")throw xe}let J=y.map(xe=>({timestamp:new Date(xe.timestamp).getTime(),message:n.format(xe)})),$=new F({logGroupName:s,logStreamName:d.currentStreamName,logEvents:J,sequenceToken:d.sequenceToken}),me=await D.send($);me.nextSequenceToken&&(d.sequenceToken=me.nextSequenceToken);let kt=J.reduce((xe,Yn)=>xe+Yn.message.length,0);d.currentStreamSize+=kt}catch(L){if(L instanceof Error&&L.name==="InvalidSequenceTokenException"){let F=L.message.match(/sequenceToken is: (.+)/);if(F){d.sequenceToken=F[1],await E(y);return}}throw L instanceof Error&&L.name==="ResourceNotFoundException"?(0,Ze.createDetailedError)("CLOUDWATCH_LOG_GROUP_NOT_FOUND",e,{logGroupName:s,region:i,message:"Log group does not exist. Create it first in CloudWatch."}):(0,Ze.createDetailedError)("CLOUDWATCH_API_ERROR",e,{error:L instanceof Error?L.message:String(L),logGroupName:s,logStreamName:d.currentStreamName,region:i})}},T=async()=>{try{await I(),d.currentStreamName=b(),d.currentStreamSize=0,d.streamStartTime=Date.now(),d.sequenceToken=void 0,console.log(`[CLOUDWATCH] Rotated to stream: ${d.currentStreamName}`)}catch(y){(0,Ze.handleTransportError)(y,e,!0)}},I=async()=>{if(d.batch.length===0)return;let y=[...d.batch];d.batch=[],await E(y)};return(()=>{m||(m=setInterval(()=>{I().catch(y=>{(0,Ze.handleTransportError)(y,e,!0)})},h))})(),{log:async y=>{(0,ko.shouldLog)(y.level,r)&&(S()&&await T(),d.batch.push(y),d.batch.length>=u&&await I())},setLevel:y=>{r=y},getLevel:()=>r,rotateStream:async()=>{await T()},getCurrentStream:()=>d.currentStreamName,getCurrentStreamSize:()=>d.currentStreamSize,flush:async()=>{await I()},close:async()=>{m&&(clearInterval(m),m=null),await I()},getConfig:()=>({logGroupName:s,logStreamName:d.currentStreamName,region:i,maxStreamSize:o,maxStreamAge:g,batchSize:u,flushInterval:h,timeout:p}),getStats:()=>({currentStream:d.currentStreamName,currentStreamSize:d.currentStreamSize,streamAge:Date.now()-d.streamStartTime,batchSize:d.batch.length,sequenceToken:d.sequenceToken?"set":"not set",flushTimerActive:!!m})}}catch(r){throw(0,Ze.handleTransportError)(r,e,!1),r}};ye.createCloudWatchTransport=Oo});var ln=O(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.createPerformanceMonitor=void 0;var Ro=t=>{let e=t||{metrics:new Map},r=(p,d)=>{e.metrics.has(p)||e.metrics.set(p,[]);let m=e.metrics.get(p);m&&m.push(d)},n=p=>{let d=performance.now();return m=>{let S=performance.now(),b=S-d,E={functionName:p,duration:b,startTime:d,endTime:S,...m&&{metadata:m}};return r(p,E),E}},s=async(p,d,m)=>{let S=performance.now();try{let b=await d(),E=performance.now(),T=E-S,I={functionName:p,duration:T,startTime:S,endTime:E,...m&&{metadata:m}};return r(p,I),b}catch(b){let E=performance.now(),T=E-S,I={functionName:p,duration:T,startTime:S,endTime:E,...m&&{metadata:{...m,error:!0}}};throw r(p,I),b}},a=(p,d,m)=>{let S=performance.now();try{let b=d(),E=performance.now(),T=E-S,I={functionName:p,duration:T,startTime:S,endTime:E,...m&&{metadata:m}};return r(p,I),b}catch(b){let E=performance.now(),T=E-S,I={functionName:p,duration:T,startTime:S,endTime:E,...m&&{metadata:{...m,error:!0}}};throw r(p,I),b}},i=p=>{if(p)return e.metrics.get(p)||[];let d=[];for(let m of e.metrics.values())d.push(...m);return d},o=p=>{let d=i(p);return d.length===0?0:d.reduce((S,b)=>S+b.duration,0)/d.length};return{state:e,startTimer:n,timeAsync:s,timeSync:a,getMetrics:i,getAverageDuration:o,getSlowestExecution:p=>{let d=i(p);return d.length===0?null:d.reduce((m,S)=>S.duration>m.duration?S:m)},clearMetrics:p=>{p?e.metrics.delete(p):e.metrics.clear()},getMetricsSummary:()=>{let p={};for(let[d,m]of e.metrics.entries()){let S=m.length,b=o(d),E=Math.max(...m.map(T=>T.duration));p[d]={count:S,avgDuration:b,maxDuration:E}}return p}}};Yt.createPerformanceMonitor=Ro});var un=O(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.stroggerWithFileTransport=st.createFileTransportExample=void 0;var Qt=be(),Do=(t={})=>{let e=t.level??Qt.LogLevel.INFO,r=t.maxFileSize??10*1024*1024,n=t.rotationInterval??24*60*60*1e3,s=0,a=Date.now(),i=()=>s>=r||Date.now()-a>=n,o=async()=>{s=0,a=Date.now(),console.log("[MOCK FILE] Rotated log file")},g=async u=>{i()&&await o(),s+=u.length,console.log(`[MOCK FILE] Writing: ${u}`)};return{log:async u=>{if(u.level<e)return;let h=JSON.stringify(u);await g(h)},setLevel:u=>{e=u},getLevel:()=>e}};st.createFileTransportExample=Do;var Po=(0,Qt.getEnvironment)(),Zo=(0,Qt.createJsonFormatter)(),Fo=(0,st.createFileTransportExample)({maxFileSize:1024,rotationInterval:1e4});st.stroggerWithFileTransport=(0,Qt.createLogger)({config:{serviceName:"file-rotation-example"},transports:[Fo],formatter:Zo,env:Po})});var dn=O(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.loggerWithCloudWatchTransport=at.createCloudWatchTransportExample=void 0;var Xt=be(),Mo=(t={})=>{let e=t.level??Xt.LogLevel.INFO,r=t.maxStreamSize??45*1024*1024,n=t.maxStreamAge??23*60*60*1e3,s=0,a=Date.now(),i=()=>s>=r||Date.now()-a>=n,o=async()=>{s=0,a=Date.now(),console.log("[MOCK CW] Rotated log stream")},g=async u=>{i()&&await o(),s+=u.length,console.log(`[MOCK CW] Sending: ${u}`)};return{log:async u=>{if(u.level<e)return;let h=JSON.stringify(u);await g(h)},setLevel:u=>{e=u},getLevel:()=>e}};at.createCloudWatchTransportExample=Mo;var jo=(0,Xt.getEnvironment)(),Uo=(0,Xt.createJsonFormatter)(),Wo=(0,at.createCloudWatchTransportExample)({maxStreamSize:1024,maxStreamAge:1e4});at.loggerWithCloudWatchTransport=(0,Xt.createLogger)({config:{serviceName:"cloudwatch-rotation-example"},transports:[Wo],formatter:Uo,env:jo})});var _n=O((z,yn)=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.demonstrateEnvironmentSpecificFileTransport=z.demonstrateCustomFileTransport=z.demonstrateMultipleFileTransports=z.demonstrateFileTransportWithSymlink=z.demonstrateCompressedFileTransport=z.demonstrateBasicFileTransport=z.runFileTransportExamples=void 0;var R=be(),gn=()=>{console.log(`=== Basic File Transport ===
7
+ `);let t=(0,R.getEnvironment)(),e=(0,R.createJsonFormatter)(),r=(0,R.createFileTransport)({level:R.LogLevel.INFO,filePath:"./logs/basic-app.log",maxFileSize:5*1024*1024,maxFiles:3}),n=(0,R.createLogger)({config:{serviceName:"basic-file-example",stage:t.stage},transports:[r],formatter:e,env:t});return n.info("Application started with basic file transport"),n.warn("This is a warning message"),n.error("This is an error message",{userId:"user-123"}),n};z.demonstrateBasicFileTransport=gn;var pn=()=>{console.log(`
62
8
  === File Transport with Compression ===
63
- `);let e=(0,oe.getEnvironment)(),t=(0,oe.createJsonFormatter)(),r=(0,oe.createFileTransport)({level:oe.LogLevel.DEBUG,filePath:"./logs/compressed-app.log",maxFileSize:10*1024*1024,maxFiles:5,compressOldFiles:!0,rotationInterval:12*60*60*1e3}),n=(0,oe.createLogger)({config:{serviceName:"compressed-file-example",stage:e.stage},transports:[r],formatter:t,env:e});return n.info("Application started with compressed file transport"),n.debug("Debug message with compression enabled"),n.warn("Warning message",{component:"file-transport"}),n};He.demonstrateCompressedFileTransport=aL;var cL=()=>{console.log(`
9
+ `);let t=(0,R.getEnvironment)(),e=(0,R.createJsonFormatter)(),r=(0,R.createFileTransport)({level:R.LogLevel.DEBUG,filePath:"./logs/compressed-app.log",maxFileSize:10*1024*1024,maxFiles:5,compressOldFiles:!0,rotationInterval:12*60*60*1e3}),n=(0,R.createLogger)({config:{serviceName:"compressed-file-example",stage:t.stage},transports:[r],formatter:e,env:t});return n.info("Application started with compressed file transport"),n.debug("Debug message with compression enabled"),n.warn("Warning message",{component:"file-transport"}),n};z.demonstrateCompressedFileTransport=pn;var mn=()=>{console.log(`
64
10
  === File Transport with Symlink ===
65
- `);let e=(0,oe.getEnvironment)(),t=(0,oe.createJsonFormatter)(),r=(0,oe.createFileTransport)({level:oe.LogLevel.INFO,filePath:"./logs/symlink-app.log",maxFileSize:8*1024*1024,maxFiles:4,createSymlink:!0,symlinkName:"current.log"}),n=(0,oe.createLogger)({config:{serviceName:"symlink-file-example",stage:e.stage},transports:[r],formatter:t,env:e});return n.info("Application started with symlink file transport"),n.info("Current log file is always accessible via ./logs/current.log"),n};He.demonstrateFileTransportWithSymlink=cL;var dL=()=>{console.log(`
11
+ `);let t=(0,R.getEnvironment)(),e=(0,R.createJsonFormatter)(),r=(0,R.createFileTransport)({level:R.LogLevel.INFO,filePath:"./logs/symlink-app.log",maxFileSize:8*1024*1024,maxFiles:4,createSymlink:!0,symlinkName:"current.log"}),n=(0,R.createLogger)({config:{serviceName:"symlink-file-example",stage:t.stage},transports:[r],formatter:e,env:t});return n.info("Application started with symlink file transport"),n.info("Current log file is always accessible via ./logs/current.log"),n};z.demonstrateFileTransportWithSymlink=mn;var fn=()=>{console.log(`
66
12
  === Multiple File Transports ===
67
- `);let e=(0,oe.getEnvironment)(),t=(0,oe.createJsonFormatter)(),r=(0,oe.createFileTransport)({level:oe.LogLevel.ERROR,filePath:"./logs/errors.log",maxFileSize:2*1024*1024,maxFiles:10,compressOldFiles:!0}),n=(0,oe.createFileTransport)({level:oe.LogLevel.DEBUG,filePath:"./logs/debug.log",maxFileSize:20*1024*1024,maxFiles:2,rotationInterval:6*60*60*1e3}),s=(0,oe.createLogger)({config:{serviceName:"multi-file-example",stage:e.stage},transports:[r,n],formatter:t,env:e});return s.debug("Debug message - goes to debug.log"),s.info("Info message - goes to both files"),s.warn("Warning message - goes to both files"),s.error("Error message - goes to both files, but errors.log keeps more history"),s};He.demonstrateMultipleFileTransports=dL;var lL=()=>{console.log(`
13
+ `);let t=(0,R.getEnvironment)(),e=(0,R.createJsonFormatter)(),r=(0,R.createFileTransport)({level:R.LogLevel.ERROR,filePath:"./logs/errors.log",maxFileSize:2*1024*1024,maxFiles:10,compressOldFiles:!0}),n=(0,R.createFileTransport)({level:R.LogLevel.DEBUG,filePath:"./logs/debug.log",maxFileSize:20*1024*1024,maxFiles:2,rotationInterval:6*60*60*1e3}),s=(0,R.createLogger)({config:{serviceName:"multi-file-example",stage:t.stage},transports:[r,n],formatter:e,env:t});return s.debug("Debug message - goes to debug.log"),s.info("Info message - goes to both files"),s.warn("Warning message - goes to both files"),s.error("Error message - goes to both files, but errors.log keeps more history"),s};z.demonstrateMultipleFileTransports=fn;var hn=()=>{console.log(`
68
14
  === Custom File Transport Configuration ===
69
- `);let e=(0,oe.getEnvironment)(),t=(0,oe.createJsonFormatter)(),r=(0,oe.createFileTransport)({level:oe.LogLevel.INFO,filePath:"./logs/custom-app.log",maxFileSize:15*1024*1024,maxFiles:7,compressOldFiles:!0,rotationInterval:24*60*60*1e3,dateFormat:"YYYY-MM-DD",encoding:"utf8",createSymlink:!0,symlinkName:"latest.log"}),n=(0,oe.createLogger)({config:{serviceName:"custom-file-example",stage:e.stage},transports:[r],formatter:t,env:e});return n.info("Application started with custom file transport configuration"),n.info("This transport uses custom settings for rotation and compression"),console.log("Current file:",r.getCurrentFile()),console.log("Current size:",r.getCurrentSize()),console.log("Transport config:",r.getConfig()),console.log("Transport stats:",r.getStats()),n};He.demonstrateCustomFileTransport=lL;var uL=()=>{console.log(`
15
+ `);let t=(0,R.getEnvironment)(),e=(0,R.createJsonFormatter)(),r=(0,R.createFileTransport)({level:R.LogLevel.INFO,filePath:"./logs/custom-app.log",maxFileSize:15*1024*1024,maxFiles:7,compressOldFiles:!0,rotationInterval:24*60*60*1e3,dateFormat:"YYYY-MM-DD",encoding:"utf8",createSymlink:!0,symlinkName:"latest.log"}),n=(0,R.createLogger)({config:{serviceName:"custom-file-example",stage:t.stage},transports:[r],formatter:e,env:t});return n.info("Application started with custom file transport configuration"),n.info("This transport uses custom settings for rotation and compression"),console.log("Current file:",r.getCurrentFile()),console.log("Current size:",r.getCurrentSize()),console.log("Transport config:",r.getConfig()),console.log("Transport stats:",r.getStats()),n};z.demonstrateCustomFileTransport=hn;var vn=()=>{console.log(`
70
16
  === Environment-Specific File Transport ===
71
- `);let e=(0,oe.getEnvironment)(),t=(0,oe.createJsonFormatter)(),r=e.isProduction?{level:oe.LogLevel.INFO,filePath:"/var/log/production-app.log",maxFileSize:50*1024*1024,maxFiles:10,compressOldFiles:!0,createSymlink:!0,symlinkName:"production-current.log"}:{level:oe.LogLevel.DEBUG,filePath:"./logs/dev-app.log",maxFileSize:5*1024*1024,maxFiles:3,compressOldFiles:!1},n=(0,oe.createFileTransport)(r),s=(0,oe.createLogger)({config:{serviceName:"env-specific-file-example",stage:e.stage},transports:[n],formatter:t,env:e});return s.info(`Application started in ${e.stage} environment`),s.info(`Using ${e.isProduction?"production":"development"} file transport configuration`),s};He.demonstrateEnvironmentSpecificFileTransport=uL;var F7=async()=>{console.log(`\u{1F680} Running File Transport Examples
72
- `);try{iL(),aL(),cL(),dL(),lL(),uL(),console.log(`
17
+ `);let t=(0,R.getEnvironment)(),e=(0,R.createJsonFormatter)(),r=t.isProduction?{level:R.LogLevel.INFO,filePath:"/var/log/production-app.log",maxFileSize:50*1024*1024,maxFiles:10,compressOldFiles:!0,createSymlink:!0,symlinkName:"production-current.log"}:{level:R.LogLevel.DEBUG,filePath:"./logs/dev-app.log",maxFileSize:5*1024*1024,maxFiles:3,compressOldFiles:!1},n=(0,R.createFileTransport)(r),s=(0,R.createLogger)({config:{serviceName:"env-specific-file-example",stage:t.stage},transports:[n],formatter:e,env:t});return s.info(`Application started in ${t.stage} environment`),s.info(`Using ${t.isProduction?"production":"development"} file transport configuration`),s};z.demonstrateEnvironmentSpecificFileTransport=vn;var $o=async()=>{console.log(`\u{1F680} Running File Transport Examples
18
+ `);try{gn(),pn(),mn(),fn(),hn(),vn(),console.log(`
73
19
  \u2705 All file transport examples completed!`),console.log(`
74
- \u{1F4C1} Check the ./logs directory for generated log files`)}catch(e){console.error("\u274C Error running examples:",e)}};He.runFileTransportExamples=F7;require.main===mL&&(0,He.runFileTransportExamples)().catch(console.error)});var CL=b((De,EL)=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.demonstrateManualStreamRotation=De.demonstrateEnvironmentSpecificCloudWatchTransport=De.demonstrateCustomCloudWatchTransport=De.demonstrateMultipleCloudWatchTransports=De.demonstrateLambdaCloudWatchTransport=De.demonstrateCloudWatchWithRotation=De.demonstrateBasicCloudWatchTransport=De.runCloudWatchTransportExamples=void 0;var te=Rr(),fL=()=>{console.log(`=== Basic CloudWatch Transport ===
75
- `);let e=(0,te.getEnvironment)(),t=(0,te.createJsonFormatter)(),r=(0,te.createCloudWatchTransport)({level:te.LogLevel.INFO,logGroupName:"/aws/lambda/basic-example",region:"us-east-1",batchSize:5,flushInterval:3e3}),n=(0,te.createLogger)({config:{serviceName:"basic-cloudwatch-example",stage:e.stage},transports:[r],formatter:t,env:e});return n.info("Application started with basic CloudWatch transport"),n.warn("This is a warning message"),n.error("This is an error message",{userId:"user-123"}),n};De.demonstrateBasicCloudWatchTransport=fL;var gL=()=>{console.log(`
20
+ \u{1F4C1} Check the ./logs directory for generated log files`)}catch(t){console.error("\u274C Error running examples:",t)}};z.runFileTransportExamples=$o;require.main===yn&&(0,z.runFileTransportExamples)().catch(console.error)});var wn=O((B,xn)=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.demonstrateManualStreamRotation=B.demonstrateEnvironmentSpecificCloudWatchTransport=B.demonstrateCustomCloudWatchTransport=B.demonstrateMultipleCloudWatchTransports=B.demonstrateLambdaCloudWatchTransport=B.demonstrateCloudWatchWithRotation=B.demonstrateBasicCloudWatchTransport=B.runCloudWatchTransportExamples=void 0;var A=be(),In=()=>{console.log(`=== Basic CloudWatch Transport ===
21
+ `);let t=(0,A.getEnvironment)(),e=(0,A.createJsonFormatter)(),r=(0,A.createCloudWatchTransport)({level:A.LogLevel.INFO,logGroupName:"/aws/lambda/basic-example",region:"us-east-1",batchSize:5,flushInterval:3e3}),n=(0,A.createLogger)({config:{serviceName:"basic-cloudwatch-example",stage:t.stage},transports:[r],formatter:e,env:t});return n.info("Application started with basic CloudWatch transport"),n.warn("This is a warning message"),n.error("This is an error message",{userId:"user-123"}),n};B.demonstrateBasicCloudWatchTransport=In;var Sn=()=>{console.log(`
76
22
  === CloudWatch Transport with Stream Rotation ===
77
- `);let e=(0,te.getEnvironment)(),t=(0,te.createJsonFormatter)(),r=(0,te.createCloudWatchTransport)({level:te.LogLevel.DEBUG,logGroupName:"/aws/lambda/rotation-example",logStreamName:"rotation-stream",region:"us-east-1",maxStreamSize:40*1024*1024,maxStreamAge:20*60*60*1e3,batchSize:10,flushInterval:5e3}),n=(0,te.createLogger)({config:{serviceName:"rotation-cloudwatch-example",stage:e.stage},transports:[r],formatter:t,env:e});return n.info("Application started with CloudWatch stream rotation"),n.debug("Debug message with rotation enabled"),n.warn("Warning message",{component:"cloudwatch-transport"}),n};De.demonstrateCloudWatchWithRotation=gL;var hL=()=>{console.log(`
23
+ `);let t=(0,A.getEnvironment)(),e=(0,A.createJsonFormatter)(),r=(0,A.createCloudWatchTransport)({level:A.LogLevel.DEBUG,logGroupName:"/aws/lambda/rotation-example",logStreamName:"rotation-stream",region:"us-east-1",maxStreamSize:40*1024*1024,maxStreamAge:20*60*60*1e3,batchSize:10,flushInterval:5e3}),n=(0,A.createLogger)({config:{serviceName:"rotation-cloudwatch-example",stage:t.stage},transports:[r],formatter:e,env:t});return n.info("Application started with CloudWatch stream rotation"),n.debug("Debug message with rotation enabled"),n.warn("Warning message",{component:"cloudwatch-transport"}),n};B.demonstrateCloudWatchWithRotation=Sn;var Tn=()=>{console.log(`
78
24
  === Lambda-Specific CloudWatch Transport ===
79
- `);let e=(0,te.getEnvironment)(),t=(0,te.createJsonFormatter)(),r=(0,te.createCloudWatchTransport)({level:te.LogLevel.INFO,logGroupName:"/aws/lambda/my-lambda-function",logStreamName:`my-lambda-function-${Date.now()}`,region:"us-east-1",maxStreamSize:40*1024*1024,maxStreamAge:20*60*60*1e3,batchSize:5,flushInterval:2e3,timeout:15e3}),n=(0,te.createLogger)({config:{serviceName:"lambda-cloudwatch-example",stage:e.stage},transports:[r],formatter:t,env:e});return n.info("Lambda function started with CloudWatch transport"),n.info("This configuration is optimized for AWS Lambda environments"),n};De.demonstrateLambdaCloudWatchTransport=hL;var yL=()=>{console.log(`
25
+ `);let t=(0,A.getEnvironment)(),e=(0,A.createJsonFormatter)(),r=(0,A.createCloudWatchTransport)({level:A.LogLevel.INFO,logGroupName:"/aws/lambda/my-lambda-function",logStreamName:`my-lambda-function-${Date.now()}`,region:"us-east-1",maxStreamSize:40*1024*1024,maxStreamAge:20*60*60*1e3,batchSize:5,flushInterval:2e3,timeout:15e3}),n=(0,A.createLogger)({config:{serviceName:"lambda-cloudwatch-example",stage:t.stage},transports:[r],formatter:e,env:t});return n.info("Lambda function started with CloudWatch transport"),n.info("This configuration is optimized for AWS Lambda environments"),n};B.demonstrateLambdaCloudWatchTransport=Tn;var Cn=()=>{console.log(`
80
26
  === Multiple CloudWatch Transports ===
81
- `);let e=(0,te.getEnvironment)(),t=(0,te.createJsonFormatter)(),r=(0,te.createCloudWatchTransport)({level:te.LogLevel.ERROR,logGroupName:"/aws/lambda/errors",logStreamName:"error-stream",region:"us-east-1",maxStreamSize:10*1024*1024,batchSize:3}),n=(0,te.createCloudWatchTransport)({level:te.LogLevel.DEBUG,logGroupName:"/aws/lambda/debug",logStreamName:"debug-stream",region:"us-east-1",maxStreamSize:50*1024*1024,batchSize:15}),s=(0,te.createLogger)({config:{serviceName:"multi-cloudwatch-example",stage:e.stage},transports:[r,n],formatter:t,env:e});return s.debug("Debug message - goes to debug log group"),s.info("Info message - goes to both log groups"),s.warn("Warning message - goes to both log groups"),s.error("Error message - goes to both log groups, but errors log group is optimized for errors"),s};De.demonstrateMultipleCloudWatchTransports=yL;var _L=()=>{console.log(`
27
+ `);let t=(0,A.getEnvironment)(),e=(0,A.createJsonFormatter)(),r=(0,A.createCloudWatchTransport)({level:A.LogLevel.ERROR,logGroupName:"/aws/lambda/errors",logStreamName:"error-stream",region:"us-east-1",maxStreamSize:10*1024*1024,batchSize:3}),n=(0,A.createCloudWatchTransport)({level:A.LogLevel.DEBUG,logGroupName:"/aws/lambda/debug",logStreamName:"debug-stream",region:"us-east-1",maxStreamSize:50*1024*1024,batchSize:15}),s=(0,A.createLogger)({config:{serviceName:"multi-cloudwatch-example",stage:t.stage},transports:[r,n],formatter:e,env:t});return s.debug("Debug message - goes to debug log group"),s.info("Info message - goes to both log groups"),s.warn("Warning message - goes to both log groups"),s.error("Error message - goes to both log groups, but errors log group is optimized for errors"),s};B.demonstrateMultipleCloudWatchTransports=Cn;var bn=()=>{console.log(`
82
28
  === Custom CloudWatch Transport Configuration ===
83
- `);let e=(0,te.getEnvironment)(),t=(0,te.createJsonFormatter)(),r=(0,te.createCloudWatchTransport)({level:te.LogLevel.INFO,logGroupName:"/aws/lambda/custom-example",logStreamName:"custom-stream",region:"us-west-2",maxStreamSize:45*1024*1024,maxStreamAge:23*60*60*1e3,batchSize:20,flushInterval:1e4,timeout:3e4}),n=(0,te.createLogger)({config:{serviceName:"custom-cloudwatch-example",stage:e.stage},transports:[r],formatter:t,env:e});return n.info("Application started with custom CloudWatch transport configuration"),n.info("This transport uses custom settings for batching and timeouts"),console.log("Current stream:",r.getCurrentStream()),console.log("Current stream size:",r.getCurrentStreamSize()),console.log("Transport config:",r.getConfig()),console.log("Transport stats:",r.getStats()),n};De.demonstrateCustomCloudWatchTransport=_L;var vL=()=>{console.log(`
29
+ `);let t=(0,A.getEnvironment)(),e=(0,A.createJsonFormatter)(),r=(0,A.createCloudWatchTransport)({level:A.LogLevel.INFO,logGroupName:"/aws/lambda/custom-example",logStreamName:"custom-stream",region:"us-west-2",maxStreamSize:45*1024*1024,maxStreamAge:23*60*60*1e3,batchSize:20,flushInterval:1e4,timeout:3e4}),n=(0,A.createLogger)({config:{serviceName:"custom-cloudwatch-example",stage:t.stage},transports:[r],formatter:e,env:t});return n.info("Application started with custom CloudWatch transport configuration"),n.info("This transport uses custom settings for batching and timeouts"),console.log("Current stream:",r.getCurrentStream()),console.log("Current stream size:",r.getCurrentStreamSize()),console.log("Transport config:",r.getConfig()),console.log("Transport stats:",r.getStats()),n};B.demonstrateCustomCloudWatchTransport=bn;var En=()=>{console.log(`
84
30
  === Environment-Specific CloudWatch Transport ===
85
- `);let e=(0,te.getEnvironment)(),t=(0,te.createJsonFormatter)(),r=e.isProduction?{level:te.LogLevel.INFO,logGroupName:"/aws/lambda/production-app",logStreamName:"production-stream",region:"us-east-1",maxStreamSize:45*1024*1024,maxStreamAge:23*60*60*1e3,batchSize:15,flushInterval:5e3}:{level:te.LogLevel.DEBUG,logGroupName:"/aws/lambda/dev-app",logStreamName:"dev-stream",region:"us-east-1",maxStreamSize:20*1024*1024,maxStreamAge:12*60*60*1e3,batchSize:5,flushInterval:2e3},n=(0,te.createCloudWatchTransport)(r),s=(0,te.createLogger)({config:{serviceName:"env-specific-cloudwatch-example",stage:e.stage},transports:[n],formatter:t,env:e});return s.info(`Application started in ${e.stage} environment`),s.info(`Using ${e.isProduction?"production":"development"} CloudWatch configuration`),s};De.demonstrateEnvironmentSpecificCloudWatchTransport=vL;var SL=()=>{console.log(`
31
+ `);let t=(0,A.getEnvironment)(),e=(0,A.createJsonFormatter)(),r=t.isProduction?{level:A.LogLevel.INFO,logGroupName:"/aws/lambda/production-app",logStreamName:"production-stream",region:"us-east-1",maxStreamSize:45*1024*1024,maxStreamAge:23*60*60*1e3,batchSize:15,flushInterval:5e3}:{level:A.LogLevel.DEBUG,logGroupName:"/aws/lambda/dev-app",logStreamName:"dev-stream",region:"us-east-1",maxStreamSize:20*1024*1024,maxStreamAge:12*60*60*1e3,batchSize:5,flushInterval:2e3},n=(0,A.createCloudWatchTransport)(r),s=(0,A.createLogger)({config:{serviceName:"env-specific-cloudwatch-example",stage:t.stage},transports:[n],formatter:e,env:t});return s.info(`Application started in ${t.stage} environment`),s.info(`Using ${t.isProduction?"production":"development"} CloudWatch configuration`),s};B.demonstrateEnvironmentSpecificCloudWatchTransport=En;var Ln=()=>{console.log(`
86
32
  === CloudWatch Transport with Manual Stream Rotation ===
87
- `);let e=(0,te.getEnvironment)(),t=(0,te.createJsonFormatter)(),r=(0,te.createCloudWatchTransport)({level:te.LogLevel.INFO,logGroupName:"/aws/lambda/manual-rotation-example",logStreamName:"manual-rotation-stream",region:"us-east-1",batchSize:5,flushInterval:3e3}),n=(0,te.createLogger)({config:{serviceName:"manual-rotation-example",stage:e.stage},transports:[r],formatter:t,env:e});return n.info("Application started with manual stream rotation capability"),n.info("You can call cloudWatchTransport.rotateStream() to manually rotate the stream"),setTimeout(async()=>{console.log("Manually rotating CloudWatch stream..."),await r.rotateStream(),n.info("Stream rotated manually")},2e3),n};De.demonstrateManualStreamRotation=SL;var j7=async()=>{console.log(`\u{1F680} Running CloudWatch Transport Examples
88
- `);try{fL(),gL(),hL(),yL(),_L(),vL(),SL(),console.log(`
33
+ `);let t=(0,A.getEnvironment)(),e=(0,A.createJsonFormatter)(),r=(0,A.createCloudWatchTransport)({level:A.LogLevel.INFO,logGroupName:"/aws/lambda/manual-rotation-example",logStreamName:"manual-rotation-stream",region:"us-east-1",batchSize:5,flushInterval:3e3}),n=(0,A.createLogger)({config:{serviceName:"manual-rotation-example",stage:t.stage},transports:[r],formatter:e,env:t});return n.info("Application started with manual stream rotation capability"),n.info("You can call cloudWatchTransport.rotateStream() to manually rotate the stream"),setTimeout(async()=>{console.log("Manually rotating CloudWatch stream..."),await r.rotateStream(),n.info("Stream rotated manually")},2e3),n};B.demonstrateManualStreamRotation=Ln;var Vo=async()=>{console.log(`\u{1F680} Running CloudWatch Transport Examples
34
+ `);try{In(),Sn(),Tn(),Cn(),bn(),En(),Ln(),console.log(`
89
35
  \u2705 All CloudWatch transport examples completed!`),console.log(`
90
- \u2601\uFE0F Check your CloudWatch console for log groups and streams`)}catch(e){console.error("\u274C Error running examples:",e)}};De.runCloudWatchTransportExamples=j7;require.main===EL&&(0,De.runCloudWatchTransportExamples)().catch(console.error)});var bL=b(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.demonstrateManualGeneration=Mt.demonstrateInstanceIdInContexts=Mt.demonstrateMultipleInstances=Mt.demonstrateCustomInstanceId=Mt.demonstrateAutomaticInstanceId=void 0;var de=Rr(),U7=()=>{console.log(`=== Automatic Instance ID Generation ===
91
- `);let e=(0,de.getEnvironment)(),t=(0,de.createJsonFormatter)(),r=(0,de.createConsoleTransport)({formatter:t,level:de.LogLevel.DEBUG}),n=(0,de.createLogger)({config:{serviceName:"auto-id-example",stage:"dev"},transports:[r],formatter:t,env:e});return console.log("Generated Instance ID:",n.getInstanceId()),n.info("First log message",{requestId:"req-123"}),n.debug("Debug message",{userId:"user-456"}),n.error("Error message",{operation:"test"},new Error("Test error")),n};Mt.demonstrateAutomaticInstanceId=U7;var B7=()=>{console.log(`
36
+ \u2601\uFE0F Check your CloudWatch console for log groups and streams`)}catch(t){console.error("\u274C Error running examples:",t)}};B.runCloudWatchTransportExamples=Vo;require.main===xn&&(0,B.runCloudWatchTransportExamples)().catch(console.error)});var Nn=O(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.demonstrateManualGeneration=ce.demonstrateInstanceIdInContexts=ce.demonstrateMultipleInstances=ce.demonstrateCustomInstanceId=ce.demonstrateAutomaticInstanceId=void 0;var Z=be(),Go=()=>{console.log(`=== Automatic Instance ID Generation ===
37
+ `);let t=(0,Z.getEnvironment)(),e=(0,Z.createJsonFormatter)(),r=(0,Z.createConsoleTransport)({formatter:e,level:Z.LogLevel.DEBUG}),n=(0,Z.createLogger)({config:{serviceName:"auto-id-example",stage:"dev"},transports:[r],formatter:e,env:t});return console.log("Generated Instance ID:",n.getInstanceId()),n.info("First log message",{requestId:"req-123"}),n.debug("Debug message",{userId:"user-456"}),n.error("Error message",{operation:"test"},new Error("Test error")),n};ce.demonstrateAutomaticInstanceId=Go;var Bo=()=>{console.log(`
92
38
  === Custom Instance ID ===
93
- `);let e=(0,de.getEnvironment)(),t=(0,de.createJsonFormatter)(),r=(0,de.createConsoleTransport)({formatter:t,level:de.LogLevel.DEBUG}),s=(0,de.createLogger)({config:{serviceName:"custom-id-example",stage:"dev",instanceId:"my-custom-logger-123"},transports:[r],formatter:t,env:e});return console.log("Custom Instance ID:",s.getInstanceId()),s.info("Log with custom instance ID",{requestId:"req-456"}),s.warn("Warning with custom instance ID",{severity:"medium"}),s};Mt.demonstrateCustomInstanceId=B7;var $7=()=>{console.log(`
39
+ `);let t=(0,Z.getEnvironment)(),e=(0,Z.createJsonFormatter)(),r=(0,Z.createConsoleTransport)({formatter:e,level:Z.LogLevel.DEBUG}),s=(0,Z.createLogger)({config:{serviceName:"custom-id-example",stage:"dev",instanceId:"my-custom-logger-123"},transports:[r],formatter:e,env:t});return console.log("Custom Instance ID:",s.getInstanceId()),s.info("Log with custom instance ID",{requestId:"req-456"}),s.warn("Warning with custom instance ID",{severity:"medium"}),s};ce.demonstrateCustomInstanceId=Bo;var qo=()=>{console.log(`
94
40
  === Multiple Strogger Instances ===
95
- `);let e=(0,de.getEnvironment)(),t=(0,de.createJsonFormatter)(),r=(0,de.createConsoleTransport)({formatter:t,level:de.LogLevel.DEBUG}),n=(0,de.createLogger)({config:{serviceName:"multi-instance-1",stage:"dev"},transports:[r],formatter:t,env:e}),s=(0,de.createLogger)({config:{serviceName:"multi-instance-2",stage:"dev"},transports:[r],formatter:t,env:e}),o=(0,de.createLogger)({config:{serviceName:"multi-instance-3",stage:"dev",instanceId:"user-provided-id"},transports:[r],formatter:t,env:e});return console.log("Strogger 1 Instance ID:",n.getInstanceId()),console.log("Strogger 2 Instance ID:",s.getInstanceId()),console.log("Strogger 3 Instance ID:",o.getInstanceId()),n.info("Message from strogger 1",{source:"strogger1"}),s.info("Message from strogger 2",{source:"strogger2"}),o.info("Message from strogger 3",{source:"strogger3"}),{strogger1:n,strogger2:s,strogger3:o}};Mt.demonstrateMultipleInstances=$7;var z7=()=>{console.log(`
41
+ `);let t=(0,Z.getEnvironment)(),e=(0,Z.createJsonFormatter)(),r=(0,Z.createConsoleTransport)({formatter:e,level:Z.LogLevel.DEBUG}),n=(0,Z.createLogger)({config:{serviceName:"multi-instance-1",stage:"dev"},transports:[r],formatter:e,env:t}),s=(0,Z.createLogger)({config:{serviceName:"multi-instance-2",stage:"dev"},transports:[r],formatter:e,env:t}),a=(0,Z.createLogger)({config:{serviceName:"multi-instance-3",stage:"dev",instanceId:"user-provided-id"},transports:[r],formatter:e,env:t});return console.log("Strogger 1 Instance ID:",n.getInstanceId()),console.log("Strogger 2 Instance ID:",s.getInstanceId()),console.log("Strogger 3 Instance ID:",a.getInstanceId()),n.info("Message from strogger 1",{source:"strogger1"}),s.info("Message from strogger 2",{source:"strogger2"}),a.info("Message from strogger 3",{source:"strogger3"}),{strogger1:n,strogger2:s,strogger3:a}};ce.demonstrateMultipleInstances=qo;var zo=()=>{console.log(`
96
42
  === Instance ID in Different Contexts ===
97
- `);let e=(0,de.getEnvironment)(),t=(0,de.createJsonFormatter)(),r=(0,de.createConsoleTransport)({formatter:t,level:de.LogLevel.DEBUG}),n=(0,de.createLogger)({config:{serviceName:"context-example",stage:"dev"},transports:[r],formatter:t,env:e});return console.log("Strogger Instance ID:",n.getInstanceId()),n.logFunctionStart("processOrder",{orderId:"order-123"}),n.logDatabaseOperation("SELECT","users",{table:"users"}),n.logApiRequest("POST","/api/orders",201,{endpoint:"/api/orders"}),n.logFunctionEnd("processOrder",150,{orderId:"order-123"}),n};Mt.demonstrateInstanceIdInContexts=z7;var H7=()=>{console.log(`
43
+ `);let t=(0,Z.getEnvironment)(),e=(0,Z.createJsonFormatter)(),r=(0,Z.createConsoleTransport)({formatter:e,level:Z.LogLevel.DEBUG}),n=(0,Z.createLogger)({config:{serviceName:"context-example",stage:"dev"},transports:[r],formatter:e,env:t});return console.log("Strogger Instance ID:",n.getInstanceId()),n.logFunctionStart("processOrder",{orderId:"order-123"}),n.logDatabaseOperation("SELECT","users",{table:"users"}),n.logApiRequest("POST","/api/orders",201,{endpoint:"/api/orders"}),n.logFunctionEnd("processOrder",150,{orderId:"order-123"}),n};ce.demonstrateInstanceIdInContexts=zo;var Ho=()=>{console.log(`
98
44
  === Manual Instance ID Generation ===
99
- `);let e=(0,de.generateLoggerInstanceId)(),t=(0,de.generateLoggerInstanceId)();console.log("Manually generated ID 1:",e),console.log("Manually generated ID 2:",t);let r=(0,de.getEnvironment)(),n=(0,de.createJsonFormatter)(),s=(0,de.createConsoleTransport)({formatter:n,level:de.LogLevel.DEBUG}),o=(0,de.createLogger)({config:{serviceName:"manual-id-1",stage:"dev",instanceId:e},transports:[s],formatter:n,env:r}),i=(0,de.createLogger)({config:{serviceName:"manual-id-2",stage:"dev",instanceId:t},transports:[s],formatter:n,env:r});return o.info("Using manually generated ID 1"),i.info("Using manually generated ID 2"),{strogger1:o,strogger2:i}};Mt.demonstrateManualGeneration=H7});var NL=b((qe,RL)=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.demonstrateSchemaConsistency=qe.demonstrateErrorStructuredLogging=qe.demonstratePerformanceStructuredLogging=qe.demonstrateBusinessEventStructuredLogging=qe.demonstrateCorrelatedStructuredLogging=qe.demonstrateBasicStructuredLogging=qe.runStructuredLoggingDemo=void 0;var Ta=Rr(),wL=(0,Ta.getEnvironment)(),TL=(0,Ta.createJsonFormatter)(),ke=(0,Ta.createLogger)({config:{serviceName:"structured-logging-demo",stage:wL.stage,enableStructuredLogging:!0},transports:[(0,Ta.createConsoleTransport)({formatter:TL,level:Ta.LogLevel.DEBUG})],formatter:TL,env:wL}),PL=()=>{console.log(`=== Basic Structured Logging ===
100
- `),ke.info("User login successful",{userId:"user-123",email:"user@example.com",loginMethod:"password",ipAddress:"192.168.1.100"}),ke.debug("Processing request",{requestId:"req-456",endpoint:"/api/users",method:"GET",userAgent:"Mozilla/5.0..."}),ke.warn("High memory usage detected",{memoryUsage:"85%",threshold:"80%",serverId:"server-001",timestamp:new Date().toISOString()}),ke.error("Database connection failed",{database:"primary",retryAttempts:3,errorCode:"ECONNREFUSED"},new Error("Connection timeout after 30 seconds"))};qe.demonstrateBasicStructuredLogging=PL;var xL=()=>{console.log(`
45
+ `);let t=(0,Z.generateLoggerInstanceId)(),e=(0,Z.generateLoggerInstanceId)();console.log("Manually generated ID 1:",t),console.log("Manually generated ID 2:",e);let r=(0,Z.getEnvironment)(),n=(0,Z.createJsonFormatter)(),s=(0,Z.createConsoleTransport)({formatter:n,level:Z.LogLevel.DEBUG}),a=(0,Z.createLogger)({config:{serviceName:"manual-id-1",stage:"dev",instanceId:t},transports:[s],formatter:n,env:r}),i=(0,Z.createLogger)({config:{serviceName:"manual-id-2",stage:"dev",instanceId:e},transports:[s],formatter:n,env:r});return a.info("Using manually generated ID 1"),i.info("Using manually generated ID 2"),{strogger1:a,strogger2:i}};ce.demonstrateManualGeneration=Ho});var jn=O((H,Mn)=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.demonstrateSchemaConsistency=H.demonstrateErrorStructuredLogging=H.demonstratePerformanceStructuredLogging=H.demonstrateBusinessEventStructuredLogging=H.demonstrateCorrelatedStructuredLogging=H.demonstrateBasicStructuredLogging=H.runStructuredLoggingDemo=void 0;var wt=be(),An=(0,wt.getEnvironment)(),kn=(0,wt.createJsonFormatter)(),q=(0,wt.createLogger)({config:{serviceName:"structured-logging-demo",stage:An.stage,enableStructuredLogging:!0},transports:[(0,wt.createConsoleTransport)({formatter:kn,level:wt.LogLevel.DEBUG})],formatter:kn,env:An}),On=()=>{console.log(`=== Basic Structured Logging ===
46
+ `),q.info("User login successful",{userId:"user-123",email:"user@example.com",loginMethod:"password",ipAddress:"192.168.1.100"}),q.debug("Processing request",{requestId:"req-456",endpoint:"/api/users",method:"GET",userAgent:"Mozilla/5.0..."}),q.warn("High memory usage detected",{memoryUsage:"85%",threshold:"80%",serverId:"server-001",timestamp:new Date().toISOString()}),q.error("Database connection failed",{database:"primary",retryAttempts:3,errorCode:"ECONNREFUSED"},new Error("Connection timeout after 30 seconds"))};H.demonstrateBasicStructuredLogging=On;var Rn=()=>{console.log(`
101
47
  === Structured Logging with Correlation ===
102
- `);let e="corr-789",t="trace-abc123";ke.info("Request started",{correlationId:e,traceId:t,requestId:"req-789",userId:"user-456",endpoint:"/api/orders",method:"POST"}),ke.debug("Validating order data",{correlationId:e,traceId:t,orderId:"order-123",items:3,totalAmount:150}),ke.info("Order created successfully",{correlationId:e,traceId:t,orderId:"order-123",status:"confirmed",processingTime:150})};qe.demonstrateCorrelatedStructuredLogging=xL;var IL=()=>{console.log(`
48
+ `);let t="corr-789",e="trace-abc123";q.info("Request started",{correlationId:t,traceId:e,requestId:"req-789",userId:"user-456",endpoint:"/api/orders",method:"POST"}),q.debug("Validating order data",{correlationId:t,traceId:e,orderId:"order-123",items:3,totalAmount:150}),q.info("Order created successfully",{correlationId:t,traceId:e,orderId:"order-123",status:"confirmed",processingTime:150})};H.demonstrateCorrelatedStructuredLogging=Rn;var Dn=()=>{console.log(`
103
49
  === Business Event Structured Logging ===
104
- `),ke.info("Payment processing started",{paymentId:"pay-001",amount:99.99,currency:"USD",paymentMethod:"credit_card",customerId:"cust-123",orderId:"order-456"}),ke.info("Payment authorized",{paymentId:"pay-001",transactionId:"txn-789",authorizationCode:"AUTH123",processingTime:250}),ke.info("User action performed",{userId:"user-789",action:"product_view",productId:"prod-123",category:"electronics",sessionId:"sess-abc",timestamp:new Date().toISOString()})};qe.demonstrateBusinessEventStructuredLogging=IL;var AL=()=>{console.log(`
50
+ `),q.info("Payment processing started",{paymentId:"pay-001",amount:99.99,currency:"USD",paymentMethod:"credit_card",customerId:"cust-123",orderId:"order-456"}),q.info("Payment authorized",{paymentId:"pay-001",transactionId:"txn-789",authorizationCode:"AUTH123",processingTime:250}),q.info("User action performed",{userId:"user-789",action:"product_view",productId:"prod-123",category:"electronics",sessionId:"sess-abc",timestamp:new Date().toISOString()})};H.demonstrateBusinessEventStructuredLogging=Dn;var Pn=()=>{console.log(`
105
51
  === Performance Monitoring Structured Logging ===
106
- `);let e=Date.now();ke.logFunctionStart("processOrder",{orderId:"order-999",items:5,customerTier:"premium"}),setTimeout(()=>{let t=Date.now()-e;ke.logFunctionEnd("processOrder",t,{orderId:"order-999",success:!0,itemsProcessed:5}),ke.info("Performance metric recorded",{metricName:"order_processing_time",value:t,unit:"ms",threshold:1e3,status:t<1e3?"good":"slow"})},150)};qe.demonstratePerformanceStructuredLogging=AL;var OL=()=>{console.log(`
52
+ `);let t=Date.now();q.logFunctionStart("processOrder",{orderId:"order-999",items:5,customerTier:"premium"}),setTimeout(()=>{let e=Date.now()-t;q.logFunctionEnd("processOrder",e,{orderId:"order-999",success:!0,itemsProcessed:5}),q.info("Performance metric recorded",{metricName:"order_processing_time",value:e,unit:"ms",threshold:1e3,status:e<1e3?"good":"slow"})},150)};H.demonstratePerformanceStructuredLogging=Pn;var Zn=()=>{console.log(`
107
53
  === Error Analysis Structured Logging ===
108
- `);try{throw new Error("Database query timeout")}catch(e){ke.error("Database operation failed",{operation:"SELECT",table:"users",query:"SELECT * FROM users WHERE email = ?",parameters:["user@example.com"],timeout:5e3,retryAttempt:2,database:"primary",connectionPool:"pool-1"},e),ke.debug("Error context",{stackTrace:e.stack,errorCode:"DB_TIMEOUT",severity:"high",impact:"user_login_blocked"})}};qe.demonstrateErrorStructuredLogging=OL;var DL=()=>{console.log(`
54
+ `);try{throw new Error("Database query timeout")}catch(t){q.error("Database operation failed",{operation:"SELECT",table:"users",query:"SELECT * FROM users WHERE email = ?",parameters:["user@example.com"],timeout:5e3,retryAttempt:2,database:"primary",connectionPool:"pool-1"},t),q.debug("Error context",{stackTrace:t.stack,errorCode:"DB_TIMEOUT",severity:"high",impact:"user_login_blocked"})}};H.demonstrateErrorStructuredLogging=Zn;var Fn=()=>{console.log(`
109
55
  === Schema Consistency in Structured Logging ===
110
- `);let e=[{level:"INFO",message:"API request processed",context:{requestId:"req-001",endpoint:"/api/users",method:"GET",statusCode:200,responseTime:45}},{level:"ERROR",message:"Authentication failed",context:{requestId:"req-002",endpoint:"/api/login",method:"POST",statusCode:401,reason:"invalid_credentials"}},{level:"DEBUG",message:"Cache hit",context:{requestId:"req-003",cacheKey:"user:123:profile",cacheHit:!0,responseTime:2}}];for(let t of e){let r=t.level.toLowerCase();r==="info"?ke.info(t.message,t.context):r==="error"?ke.error(t.message,t.context):r==="debug"&&ke.debug(t.message,t.context)}};qe.demonstrateSchemaConsistency=DL;var q7=()=>{console.log(`\u{1F3AF} Structured Logging Demo - Core Focus
56
+ `);let t=[{level:"INFO",message:"API request processed",context:{requestId:"req-001",endpoint:"/api/users",method:"GET",statusCode:200,responseTime:45}},{level:"ERROR",message:"Authentication failed",context:{requestId:"req-002",endpoint:"/api/login",method:"POST",statusCode:401,reason:"invalid_credentials"}},{level:"DEBUG",message:"Cache hit",context:{requestId:"req-003",cacheKey:"user:123:profile",cacheHit:!0,responseTime:2}}];for(let e of t){let r=e.level.toLowerCase();r==="info"?q.info(e.message,e.context):r==="error"?q.error(e.message,e.context):r==="debug"&&q.debug(e.message,e.context)}};H.demonstrateSchemaConsistency=Fn;var Ko=()=>{console.log(`\u{1F3AF} Structured Logging Demo - Core Focus
111
57
  `),console.log(`This demo shows why structured JSON logging is the core focus of this library.
112
- `),PL(),xL(),IL(),AL(),OL(),DL(),console.log(`
58
+ `),On(),Rn(),Dn(),Pn(),Zn(),Fn(),console.log(`
113
59
  \u2705 Structured logging demo completed!`),console.log(`
114
- \u{1F4CA} Key Benefits of Structured Logging:`),console.log(" \u2022 Consistent JSON schema across all logs"),console.log(" \u2022 Machine-readable format for automation"),console.log(" \u2022 Easy correlation and tracing"),console.log(" \u2022 Powerful search and filtering capabilities"),console.log(" \u2022 Scalable for high-volume logging systems")};qe.runStructuredLoggingDemo=q7;require.main===RL&&(0,qe.runStructuredLoggingDemo)()});var kL=b((ct,LL)=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.runBrandedAPIExamples=ct.demonstrateMixedUsage=ct.demonstrateAPIComparison=ct.demonstrateBrandedAPI=void 0;var yt=Rr(),G7=()=>{let e=(0,yt.getEnvironment)(),t=(0,yt.createJsonFormatter)(),r=(0,yt.createStroggerConsoleTransport)({formatter:t,level:yt.LogLevel.DEBUG}),n=(0,yt.createStroggerDataDogTransport)({level:yt.LogLevel.INFO,serviceName:"branded-api-example",tags:["env:dev","team:backend"]}),s=(0,yt.createStrogger)({config:{serviceName:"branded-api-demo",stage:e.stage},transports:[r,n],formatter:t,env:e});return console.log(`=== Branded API Usage ===
115
- `),s.info("Application started with branded API"),s.debug("Debug message using branded functions"),s.warn("Warning message with brand consistency"),s.error("Error message",{userId:"user-123"}),s};ct.demonstrateBrandedAPI=G7;var V7=()=>{console.log(`
60
+ \u{1F4CA} Key Benefits of Structured Logging:`),console.log(" \u2022 Consistent JSON schema across all logs"),console.log(" \u2022 Machine-readable format for automation"),console.log(" \u2022 Easy correlation and tracing"),console.log(" \u2022 Powerful search and filtering capabilities"),console.log(" \u2022 Scalable for high-volume logging systems")};H.runStructuredLoggingDemo=Ko;require.main===Mn&&(0,H.runStructuredLoggingDemo)()});var Wn=O((X,Un)=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.runBrandedAPIExamples=X.demonstrateMixedUsage=X.demonstrateAPIComparison=X.demonstrateBrandedAPI=void 0;var re=be(),Jo=()=>{let t=(0,re.getEnvironment)(),e=(0,re.createJsonFormatter)(),r=(0,re.createStroggerConsoleTransport)({formatter:e,level:re.LogLevel.DEBUG}),n=(0,re.createStroggerDataDogTransport)({level:re.LogLevel.INFO,serviceName:"branded-api-example",tags:["env:dev","team:backend"]}),s=(0,re.createStrogger)({config:{serviceName:"branded-api-demo",stage:t.stage},transports:[r,n],formatter:e,env:t});return console.log(`=== Branded API Usage ===
61
+ `),s.info("Application started with branded API"),s.debug("Debug message using branded functions"),s.warn("Warning message with brand consistency"),s.error("Error message",{userId:"user-123"}),s};X.demonstrateBrandedAPI=Jo;var Yo=()=>{console.log(`
116
62
  === Branded vs Conventional API ===
117
- `),console.log("Both approaches work identically:"),console.log("- createLogger() === createStrogger()"),console.log("- createConsoleTransport() === createStroggerConsoleTransport()"),console.log("- createDataDogTransport() === createStroggerDataDogTransport()")};ct.demonstrateAPIComparison=V7;var W7=()=>{let e=(0,yt.getEnvironment)(),t=(0,yt.createJsonFormatter)(),r=(0,yt.createLogger)({config:{serviceName:"mixed-usage-demo"},transports:[(0,yt.createStroggerConsoleTransport)({formatter:t}),(0,yt.createStroggerDataDogTransport)({level:yt.LogLevel.INFO})],formatter:t,env:e});console.log(`
63
+ `),console.log("Both approaches work identically:"),console.log("- createLogger() === createStrogger()"),console.log("- createConsoleTransport() === createStroggerConsoleTransport()"),console.log("- createDataDogTransport() === createStroggerDataDogTransport()")};X.demonstrateAPIComparison=Yo;var Qo=()=>{let t=(0,re.getEnvironment)(),e=(0,re.createJsonFormatter)(),r=(0,re.createLogger)({config:{serviceName:"mixed-usage-demo"},transports:[(0,re.createStroggerConsoleTransport)({formatter:e}),(0,re.createStroggerDataDogTransport)({level:re.LogLevel.INFO})],formatter:e,env:t});console.log(`
118
64
  === Mixed Branded and Conventional ===
119
- `),r.info("Mixed approach - conventional createLogger with branded transports")};ct.demonstrateMixedUsage=W7;var Z7=()=>{console.log(`\u{1F3A8} Running Branded API Examples
120
- `);try{(0,ct.demonstrateBrandedAPI)(),(0,ct.demonstrateAPIComparison)(),(0,ct.demonstrateMixedUsage)(),console.log(`
65
+ `),r.info("Mixed approach - conventional createLogger with branded transports")};X.demonstrateMixedUsage=Qo;var Xo=()=>{console.log(`\u{1F3A8} Running Branded API Examples
66
+ `);try{(0,X.demonstrateBrandedAPI)(),(0,X.demonstrateAPIComparison)(),(0,X.demonstrateMixedUsage)(),console.log(`
121
67
  \u2705 All branded API examples completed!`),console.log(`
122
- \u{1F4A1} Benefits of Branded API:`),console.log(" \u2022 Clear brand ownership"),console.log(" \u2022 Consistent naming convention"),console.log(" \u2022 Easy to identify Strogger functions"),console.log(" \u2022 No breaking changes - conventional API still works")}catch(e){console.error("\u274C Error running branded API examples:",e)}};ct.runBrandedAPIExamples=Z7;require.main===LL&&(0,ct.runBrandedAPIExamples)()});var Rr=b(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.demonstrateAutomaticInstanceId=x.runCloudWatchTransportExamples=x.runFileTransportExamples=x.createCloudWatchTransportExample=x.createFileTransportExample=x.createBatchedLogger=x.createBatchedTransport=x.generateLoggerInstanceId=x.generateSpanId=x.generateTraceId=x.generateCorrelationId=x.createLoggerInstanceEnricher=x.createUserEnricher=x.createEnvironmentEnricher=x.createSessionEnricher=x.createCorrelationEnricher=x.createEnrichmentMiddleware=x.createDefaultEnrichmentMiddleware=x.createSampler=x.createRateLimiter=x.createLogFilter=x.validateTransportConfig=x.validateEnvironmentVariable=x.handleTransportError=x.createDetailedError=x.ERROR_MESSAGES=x.ValidationError=x.ConfigurationError=x.TransportError=x.LoggerError=x.createPerformanceMonitor=x.getEnvironment=x.createStroggerCloudWatchTransport=x.createStroggerNewRelicTransport=x.createStroggerElasticsearchTransport=x.createStroggerSplunkTransport=x.createStroggerDataDogTransport=x.createStroggerConsoleTransport=x.createCloudWatchTransport=x.createFileTransport=x.createNewRelicTransport=x.createElasticsearchTransport=x.createSplunkTransport=x.createDataDogTransport=x.createConsoleTransport=x.createJsonFormatter=x.LogLevel=x.strogger=x.createStrogger=x.createLogger=void 0;x.printLoggerConfig=x.shouldLog=x.runBrandedAPIExamples=x.runStructuredLoggingDemo=x.demonstrateManualGeneration=x.demonstrateInstanceIdInContexts=x.demonstrateMultipleInstances=x.demonstrateCustomInstanceId=void 0;var $h=Fu();Object.defineProperty(x,"createLogger",{enumerable:!0,get:function(){return $h.createLogger}});Object.defineProperty(x,"createStrogger",{enumerable:!0,get:function(){return $h.createStrogger}});Object.defineProperty(x,"strogger",{enumerable:!0,get:function(){return $h.strogger}});var K7=Ft();Object.defineProperty(x,"LogLevel",{enumerable:!0,get:function(){return K7.LogLevel}});var J7=bu();Object.defineProperty(x,"createJsonFormatter",{enumerable:!0,get:function(){return J7.createJsonFormatter}});var Y7=Ra();Object.defineProperty(x,"createConsoleTransport",{enumerable:!0,get:function(){return Y7.createConsoleTransport}});var Q7=Uu();Object.defineProperty(x,"createDataDogTransport",{enumerable:!0,get:function(){return Q7.createDataDogTransport}});var X7=Bu();Object.defineProperty(x,"createSplunkTransport",{enumerable:!0,get:function(){return X7.createSplunkTransport}});var eX=$u();Object.defineProperty(x,"createElasticsearchTransport",{enumerable:!0,get:function(){return eX.createElasticsearchTransport}});var tX=zu();Object.defineProperty(x,"createNewRelicTransport",{enumerable:!0,get:function(){return tX.createNewRelicTransport}});var rX=Cy();Object.defineProperty(x,"createFileTransport",{enumerable:!0,get:function(){return rX.createFileTransport}});var nX=Bh();Object.defineProperty(x,"createCloudWatchTransport",{enumerable:!0,get:function(){return nX.createCloudWatchTransport}});var sX=Ra();Object.defineProperty(x,"createStroggerConsoleTransport",{enumerable:!0,get:function(){return sX.createConsoleTransport}});var oX=Uu();Object.defineProperty(x,"createStroggerDataDogTransport",{enumerable:!0,get:function(){return oX.createDataDogTransport}});var iX=Bu();Object.defineProperty(x,"createStroggerSplunkTransport",{enumerable:!0,get:function(){return iX.createSplunkTransport}});var aX=$u();Object.defineProperty(x,"createStroggerElasticsearchTransport",{enumerable:!0,get:function(){return aX.createElasticsearchTransport}});var cX=zu();Object.defineProperty(x,"createStroggerNewRelicTransport",{enumerable:!0,get:function(){return cX.createNewRelicTransport}});var dX=Bh();Object.defineProperty(x,"createStroggerCloudWatchTransport",{enumerable:!0,get:function(){return dX.createCloudWatchTransport}});var lX=ku();Object.defineProperty(x,"getEnvironment",{enumerable:!0,get:function(){return lX.getEnvironment}});var uX=nL();Object.defineProperty(x,"createPerformanceMonitor",{enumerable:!0,get:function(){return uX.createPerformanceMonitor}});var Nr=zr();Object.defineProperty(x,"LoggerError",{enumerable:!0,get:function(){return Nr.LoggerError}});Object.defineProperty(x,"TransportError",{enumerable:!0,get:function(){return Nr.TransportError}});Object.defineProperty(x,"ConfigurationError",{enumerable:!0,get:function(){return Nr.ConfigurationError}});Object.defineProperty(x,"ValidationError",{enumerable:!0,get:function(){return Nr.ValidationError}});Object.defineProperty(x,"ERROR_MESSAGES",{enumerable:!0,get:function(){return Nr.ERROR_MESSAGES}});Object.defineProperty(x,"createDetailedError",{enumerable:!0,get:function(){return Nr.createDetailedError}});Object.defineProperty(x,"handleTransportError",{enumerable:!0,get:function(){return Nr.handleTransportError}});Object.defineProperty(x,"validateEnvironmentVariable",{enumerable:!0,get:function(){return Nr.validateEnvironmentVariable}});Object.defineProperty(x,"validateTransportConfig",{enumerable:!0,get:function(){return Nr.validateTransportConfig}});var zh=Mu();Object.defineProperty(x,"createLogFilter",{enumerable:!0,get:function(){return zh.createLogFilter}});Object.defineProperty(x,"createRateLimiter",{enumerable:!0,get:function(){return zh.createRateLimiter}});Object.defineProperty(x,"createSampler",{enumerable:!0,get:function(){return zh.createSampler}});var Ht=Pu();Object.defineProperty(x,"createDefaultEnrichmentMiddleware",{enumerable:!0,get:function(){return Ht.createDefaultEnrichmentMiddleware}});Object.defineProperty(x,"createEnrichmentMiddleware",{enumerable:!0,get:function(){return Ht.createEnrichmentMiddleware}});Object.defineProperty(x,"createCorrelationEnricher",{enumerable:!0,get:function(){return Ht.createCorrelationEnricher}});Object.defineProperty(x,"createSessionEnricher",{enumerable:!0,get:function(){return Ht.createSessionEnricher}});Object.defineProperty(x,"createEnvironmentEnricher",{enumerable:!0,get:function(){return Ht.createEnvironmentEnricher}});Object.defineProperty(x,"createUserEnricher",{enumerable:!0,get:function(){return Ht.createUserEnricher}});Object.defineProperty(x,"createLoggerInstanceEnricher",{enumerable:!0,get:function(){return Ht.createLoggerInstanceEnricher}});Object.defineProperty(x,"generateCorrelationId",{enumerable:!0,get:function(){return Ht.generateCorrelationId}});Object.defineProperty(x,"generateTraceId",{enumerable:!0,get:function(){return Ht.generateTraceId}});Object.defineProperty(x,"generateSpanId",{enumerable:!0,get:function(){return Ht.generateSpanId}});Object.defineProperty(x,"generateLoggerInstanceId",{enumerable:!0,get:function(){return Ht.generateLoggerInstanceId}});var ML=Tu();Object.defineProperty(x,"createBatchedTransport",{enumerable:!0,get:function(){return ML.createBatchedTransport}});Object.defineProperty(x,"createBatchedLogger",{enumerable:!0,get:function(){return ML.createBatchedLogger}});var mX=sL();Object.defineProperty(x,"createFileTransportExample",{enumerable:!0,get:function(){return mX.createFileTransportExample}});var pX=oL();Object.defineProperty(x,"createCloudWatchTransportExample",{enumerable:!0,get:function(){return pX.createCloudWatchTransportExample}});var fX=pL();Object.defineProperty(x,"runFileTransportExamples",{enumerable:!0,get:function(){return fX.runFileTransportExamples}});var gX=CL();Object.defineProperty(x,"runCloudWatchTransportExamples",{enumerable:!0,get:function(){return gX.runCloudWatchTransportExamples}});var Pa=bL();Object.defineProperty(x,"demonstrateAutomaticInstanceId",{enumerable:!0,get:function(){return Pa.demonstrateAutomaticInstanceId}});Object.defineProperty(x,"demonstrateCustomInstanceId",{enumerable:!0,get:function(){return Pa.demonstrateCustomInstanceId}});Object.defineProperty(x,"demonstrateMultipleInstances",{enumerable:!0,get:function(){return Pa.demonstrateMultipleInstances}});Object.defineProperty(x,"demonstrateInstanceIdInContexts",{enumerable:!0,get:function(){return Pa.demonstrateInstanceIdInContexts}});Object.defineProperty(x,"demonstrateManualGeneration",{enumerable:!0,get:function(){return Pa.demonstrateManualGeneration}});var hX=NL();Object.defineProperty(x,"runStructuredLoggingDemo",{enumerable:!0,get:function(){return hX.runStructuredLoggingDemo}});var yX=kL();Object.defineProperty(x,"runBrandedAPIExamples",{enumerable:!0,get:function(){return yX.runBrandedAPIExamples}});var _X=ur();Object.defineProperty(x,"shouldLog",{enumerable:!0,get:function(){return _X.shouldLog}});var vX=Fu();Object.defineProperty(x,"printLoggerConfig",{enumerable:!0,get:function(){return vX.printLoggerConfig}})});var WX={};dt(WX,{CDK_INSIGHTS_ANNOTATION_PREFIX:()=>BL,CDK_INSIGHTS_METADATA_VERSION:()=>UL,CdkInsightsAspect:()=>Vh,ExtremelyHelpfulConsoleLogger:()=>Cu,clearCaches:()=>GX,createCdkInsightsAspect:()=>qX,createCdkInsightsLogger:()=>zX,createExtremelyHelpfulConsoleLogger:()=>HX,getCacheStats:()=>VX,isCdkDebugEnabled:()=>$L});module.exports=re(WX);var Lr=require("aws-cdk-lib"),xa=require("cdk-nag"),Gt=P(require("node:fs")),_t=P(require("node:path"));var qt=P(Rr()),$o=process.env.NODE_ENV==="development",Hh=process.env.CDK_INSIGHTS_VERBOSE==="true",SX=$o||Hh||process.env.CDK_INSIGHTS_ENABLE_LOGGING==="true",FL=Hh?qt.LogLevel.DEBUG:$o?qt.LogLevel.INFO:qt.LogLevel.ERROR,EX=SX?[(0,qt.createConsoleTransport)({formatter:(0,qt.createJsonFormatter)(),level:FL,useColors:!$o})]:[],vu=(0,qt.createLogger)({config:{level:FL,serviceName:"cdk-insights",stage:$o?"dev":"prod"},formatter:(0,qt.createJsonFormatter)(),transports:EX,env:{STAGE:$o?"dev":"prod",LOG_LEVEL:Hh?"DEBUG":$o?"INFO":"ERROR"}}),zo=e=>({debug:(t,r,n)=>vu.debug(t,{component:e,...r},n),info:(t,r,n)=>vu.info(t,{component:e,...r},n),warn:(t,r,n,s)=>vu.warn(t,{component:e,...r},n,s),error:(t,r,n,s)=>vu.error(t,{component:e,...r},n,s)}),hpe=zo("cli"),ype=zo("analysis"),_pe=zo("license"),vpe=zo("cache"),Spe=zo("github"),Pe=zo("aspect");var UL="2.2.0",BL="cdk-insights::",$L=()=>process.env.CDK_DEBUG==="true"||(process.env.CDK_CONTEXT_JSON?.includes('"@aws-cdk/core:stackTrace":true')??!1)||(process.env.CDK_CONTEXT_JSON?.includes('"@aws-cdk/core:stackTrace": true')??!1),qh=!1,CX=()=>{qh||($L()||Pe.info("\u{1F4A1} Tip: Set CDK_DEBUG=true for more accurate source location detection. Run: CDK_DEBUG=true cdk synth"),qh=!0)},Eu=new Map,Ho=new Map,Pn=new Map,bX=e=>{let o={},i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let l=0;l<i.length;l++)o[i[l]]=l;let a=[],c=0,d=0;for(let l of e){let u=o[l];if(u!==void 0)if(d+=(u&31)<<c,(u&32)!==0)c+=5;else{let m=d&1;d>>=1,a.push(m?-d:d),d=0,c=0}}return a},wX=e=>{let t=e;if(Pn.has(t))return Pn.get(t)??null;try{let r=Gt.readFileSync(e,"utf-8"),n=r.match(/\/\/# sourceMappingURL=data:application\/json;base64,(.+)$/m);if(n){let i=Buffer.from(n[1],"base64").toString("utf-8"),a=JSON.parse(i);return Pn.set(t,a),a}let s=r.match(/\/\/# sourceMappingURL=(.+)$/m);if(s){let i=_t.resolve(_t.dirname(e),s[1]);if(Gt.existsSync(i)){let a=JSON.parse(Gt.readFileSync(i,"utf-8"));return Pn.set(t,a),a}}let o=`${e}.map`;if(Gt.existsSync(o)){let i=JSON.parse(Gt.readFileSync(o,"utf-8"));return Pn.set(t,i),i}}catch{}return Pn.set(t,null),null},TX=(e,t,r)=>{let n=wX(e);if(!n)return null;try{let s=n.mappings.split(";");if(t>s.length)return null;let o=0,i=0,a=0,c=0;for(let p=0;p<=Math.min(t-1,s.length-1);p++){let h=s[p].split(","),y=0;for(let _ of h){if(!_)continue;let w=bX(_);if(w.length!==0&&(y+=w[0],w.length>=4&&(o+=w[1],i+=w[2],a+=w[3],w.length>=5&&(c+=w[4])),p===t-1&&y>=r))break}}let d=n.sources[o];if(!d)return null;let l=_t.dirname(e),u=_t.resolve(l,d),m=_t.relative(process.cwd(),u);return{source:m.startsWith(".")?m:`./${m}`,line:i+1,column:a+1,name:n.names?.[c]}}catch{return null}},jL=(e,t="fallback")=>{let r=e.split(`
123
- `),n=null,s;for(let o of r){if(o.includes("node_modules")||o.includes("aws-cdk-lib")||o.includes("cdk-insights"))continue;let i=o.match(/at\s+(?:new\s+)?(\w+(?:\.\w+)*)\s+\(/);i&&!s&&(s=i[1]);let a=o.match(/\(?([^()]+\.(ts|js|tsx|jsx)):(\d+):(\d+)\)?/);if(a){let[,c,d,l,u]=a,m=c.trim();!m.startsWith("/")&&!m.startsWith(".")&&(m=`./${m}`);let p=Number(l),h=Number(u);if((d==="js"||d==="jsx")&&(m.includes("/dist/")||m.includes("\\dist\\"))){let _=_t.resolve(process.cwd(),m),w=TX(_,p,h);if(w)return{filePath:w.source,line:w.line,column:w.column,confidence:"high",method:"source_map",enclosingScope:w.name||s,originalFile:m}}let y={filePath:m,line:p,column:h,confidence:t==="creation_stack"?"high":"medium",method:t,enclosingScope:s};if(d==="ts"||d==="tsx")return y;n||(n=y)}}return n??void 0},PX=(e,t,r,n)=>{let s=`${r}:${t}`;if(Ho.has(s))return Ho.get(s)??void 0;try{let o=process.cwd(),i=["lib","cdk","src","bin","stacks","cdk/stacks","infrastructure","apps"],a=t.split("/"),c=a.length>1?a[a.length-2]:"",d=e==="Resource"||e==="Default"?n||c||e:e||t.split("/").pop()||"";for(let l of i){let u=_t.join(o,l);if(!Gt.existsSync(u))continue;let m=zL(u);for(let p of m){let h=AX(p,d,c,o);if(h)return Ho.set(s,h),h}}}catch{}Ho.set(s,null)},zL=(e,t=[])=>{try{let r=Gt.readdirSync(e,{withFileTypes:!0});for(let n of r){let s=_t.join(e,n.name);n.isDirectory()&&!n.name.startsWith(".")&&n.name!=="node_modules"?zL(s,t):n.isFile()&&(n.name.endsWith(".ts")||n.name.endsWith(".tsx"))&&t.push(s)}}catch{}return t},xX=(e,t,r=2)=>{let n=e.split(`
124
- `),s=Math.max(0,t-1-r),o=Math.min(n.length,t+r);return n.slice(s,o).map((i,a)=>{let c=s+a+1;return`${c===t?">":" "}${c.toString().padStart(4)} | ${i}`}).join(`
125
- `)},IX=(e,t)=>{let r=e.split(`
126
- `),n,s=0,o=0;for(let i=0;i<Math.min(t,r.length);i++){let a=r[i],c=a.match(/class\s+(\w+)/),d=a.match(/(?:function\s+(\w+)|(\w+)\s*[=:]\s*(?:async\s*)?\(|(\w+)\s*\([^)]*\)\s*(?:=>|\{))/);if(c)n=c[1],o=s;else if(d){let l=d[1]||d[2]||d[3];l&&n?n=`${n}.${l}`:l&&(n=l),o=s}if(s+=(a.match(/{/g)||[]).length,s-=(a.match(/}/g)||[]).length,s<=o&&n){let l=n.split(".");l.length>1&&(n=l.slice(0,-1).join("."))}}return n},AX=(e,t,r,n)=>{try{let s=Eu.get(e);s||(s=Gt.readFileSync(e,"utf-8"),Eu.set(e,s));let o=s.split(`
127
- `),i=[],a=new RegExp(`new\\s+(\\w+)\\s*\\(\\s*(?:this|\\w+)\\s*,\\s*['"\`]${Su(t)}['"\`]`,"g"),c=new RegExp(`(?:const|let|var)\\s+(${Su(t.replace(/[^a-zA-Z0-9]/g,""))})\\s*=\\s*new\\s+(\\w+)`,"gi"),d=new RegExp(`\\w+\\s*[=:]\\s*new\\s+(\\w+)\\s*\\(\\s*(?:this|\\w+)\\s*,\\s*['"\`]${Su(t)}['"\`]`,"g"),l=new RegExp(`\\.\\w+\\s*\\(\\s*['"\`]${Su(t)}['"\`]`,"g");for(let u=0;u<o.length;u++){let m=o[u],p=a.exec(m);if(p){i.push({line:u+1,column:p.index+1,constructorName:p[1],confidence:"high"}),a.lastIndex=0;continue}if(p=d.exec(m),p){i.push({line:u+1,column:p.index+1,constructorName:p[1],confidence:"high"}),d.lastIndex=0;continue}if(p=c.exec(m),p){i.push({line:u+1,column:p.index+1,constructorName:p[2],confidence:"medium"}),c.lastIndex=0;continue}p=l.exec(m),p&&(i.push({line:u+1,column:p.index+1,confidence:"low"}),l.lastIndex=0)}if(i.length>0){i.sort((B,T)=>{let A={high:0,medium:1,low:2};return A[B.confidence]-A[T.confidence]});let u=i[0],m=_t.relative(n,e),p=IX(s,u.line),h=xX(s,u.line),y=u.line,_=0,w=0,E=!1;for(let B=u.line-1;B<o.length&&B<u.line+50;B++){let T=o[B];for(let A of T)if(A==="("||A==="{")A==="("?w++:_++,E=!0;else if((A===")"||A==="}")&&(A===")"?w--:_--,E&&w<=0&&_<=0)){y=B+1;break}if(y>u.line)break}return{filePath:m.startsWith(".")?m:`./${m}`,line:u.line,column:u.column,endLine:y>u.line?y:void 0,confidence:u.confidence,method:"source_analysis",enclosingScope:p,codeSnippet:h}}}catch{}},Su=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),OX=e=>{let t=e;if(t._creationStack?.length)return t._creationStack;if(t.creationStack?.length)return t.creationStack;let r=e.node.defaultChild;if(r?._creationStack?.length)return r._creationStack;if(r?.creationStack?.length)return r.creationStack;let n=e.node.scope;for(;n;){let s=n;if(s._creationStack?.length)return s._creationStack;if(s.creationStack?.length)return s.creationStack;n=n.node?.scope}},HL=(e,t)=>{try{let r=OX(e);if(r?.length){let a=r.join(`
128
- `),c=jL(a,"creation_stack");if(c)return{...c,confidence:"high"}}for(let a of e.node.metadata)if(a.trace&&Array.isArray(a.trace)){let c=a.trace.join(`
129
- `),d=jL(c,"metadata_trace");if(d)return d}let n=e.node.id,s=e.node.path,o=Lr.Stack.of(e),i=PX(n,s,o.stackName,t);return i||void 0}catch{}},DX=(e,t=10)=>{let r=e.node.scope,n=0;for(;r&&n<t;){let s=r.node.id,o=r.constructor.name;if(o==="Stack"||o==="App"||!s){r=r.node.scope,n++;continue}let i=HL(r,s);if(i)return{location:i,ancestorId:s,ancestorType:o};r=r.node.scope,n++}},RX=(e,t,r)=>{let n=e.constructor.name,s={CfnSubnet:"Vpc",CfnRouteTable:"Vpc or Subnet",CfnRoute:"Vpc or Subnet",CfnSubnetRouteTableAssociation:"Subnet",CfnInternetGateway:"Vpc",CfnVPCGatewayAttachment:"Vpc",CfnNatGateway:"Vpc (public subnet)",CfnEIP:"Vpc (for NAT Gateway)",CfnSecurityGroup:"Vpc or other L2 construct",CfnSecurityGroupIngress:"SecurityGroup",CfnSecurityGroupEgress:"SecurityGroup",CfnDBSubnetGroup:"DatabaseInstance or DatabaseCluster",CfnLogGroup:"Lambda Function or other service",CfnRole:"Lambda Function, ECS Task, or other service",CfnPolicy:"Role or User",CfnInstanceProfile:"Role"};if(t&&r)return`Created by ${t.replace(/\d+$/,"")} construct '${r}'`;let o=s[n];if(o){let i=e.node.scope;if(i&&i.node){let a=i.node.id,c=i.constructor.name.replace(/\d+$/,"");if(a&&c!=="Stack")return`Created by ${c} construct '${a}'`}return`Implicitly created by ${o}`}},NX=(e,t,r,n)=>{let s=[];t&&s.push(`'${t}'`);let o=e.split("/").filter(a=>a&&a!=="Resource"&&a!=="Default"&&!a.startsWith("Cfn")),i=o[o.length-1];if(i&&i!==t&&s.push(`'${i}'`),o.length>1){let a=o[o.length-2];a&&a!==t&&a!==i&&s.push(`'${a}'`)}if(r){let a=r.replace(/\d+$/,"");s.push(`new ${a}(`)}if(n){let a=n.split("::").pop()??"";a&&!s.some(c=>c.includes(a))&&s.push(`${a}`)}return s.length===0?`Search for: ${e}`:`Search for: ${s.slice(0,3).join(" or ")}`},LX={"AWS::S3":"Storage","AWS::DynamoDB":"Database","AWS::RDS":"Database","AWS::Lambda":"Compute","AWS::EC2":"Compute","AWS::ECS":"Containers","AWS::EKS":"Containers","AWS::IAM":"Security","AWS::KMS":"Security","AWS::SecretsManager":"Security","AWS::CloudWatch":"Management","AWS::CloudTrail":"Management","AWS::SNS":"Messaging","AWS::SQS":"Messaging","AWS::EventBridge":"Messaging","AWS::ApiGateway":"Networking","AWS::CloudFront":"Networking","AWS::ELB":"Networking","AWS::ElasticLoadBalancing":"Networking","AWS::VPC":"Networking","AWS::Route53":"Networking","AWS::Cognito":"Security","AWS::WAF":"Security","AWS::StepFunctions":"Integration","AWS::Kinesis":"Analytics","AWS::Glue":"Analytics","AWS::Athena":"Analytics","AWS::Redshift":"Analytics"},kX=[{pattern:/encryption|encrypted|kmsKey|sseSpecification/i,recommendation:"Enable encryption for data at rest",checkDefault:e=>e===!1||e===void 0||e===null},{pattern:/publicAccess|publicRead|publiclyAccessible/i,recommendation:"Restrict public access unless explicitly required",checkDefault:e=>e===!0},{pattern:/logging|accessLog|trailName/i,recommendation:"Enable logging for audit and compliance",checkDefault:e=>e===!1||e===void 0},{pattern:/versioning|versioningConfiguration/i,recommendation:"Enable versioning for data protection",checkDefault:e=>e===void 0||typeof e=="object"&&e!==null&&e.status!=="Enabled"},{pattern:/backupRetention|deletionProtection|deleteProtection/i,recommendation:"Configure backup and deletion protection",checkDefault:e=>e===!1||e===0||e===void 0},{pattern:/multiAz|multiAZ/i,recommendation:"Enable Multi-AZ for high availability",checkDefault:e=>e===!1},{pattern:/securityGroup|ingressRules|egressRules/i,recommendation:"Review security group rules"},{pattern:/iamRole|assumeRolePolicy|policyDocument/i,recommendation:"Review IAM permissions for least privilege"}],MX=e=>{try{let t=e.node.scope;if(!t)return{};let r=t.constructor.name;if(r.startsWith("Cfn")){let n=t.node?.scope;if(n)return{l2Type:n.constructor.name,l2Id:n.node?.id,l2Fqn:Gh(n)}}else return{l2Type:r,l2Id:t.node?.id,l2Fqn:Gh(t)}}catch{}return{}},Gh=e=>{try{let t=e;if(t.constructor.__jsii__?.fqn)return t.constructor.__jsii__.fqn;if(typeof t.constructor.fqn=="string")return t.constructor.fqn;let r=e.constructor.name;return r.startsWith("Cfn")?`aws-cdk-lib.${r}`:r}catch{return}},FX=e=>{let t=[];try{let r=e;for(;r;)t.unshift({id:r.node.id,type:r.constructor.name,fqn:Gh(r)}),r=r.node.scope}catch{}return t},jX=e=>{for(let[t,r]of Object.entries(LX))if(e.startsWith(t))return r},UX=e=>{let t=[];try{let n=e.cfnProperties;if(!n)return t;let s=(i,a)=>{for(let{pattern:c,recommendation:d,checkDefault:l}of kX)if(c.test(i)){let u=l?l(a):void 0,m=null;typeof a=="boolean"||typeof a=="number"?m=a:a==null?m=null:typeof a=="string"&&!Lr.Token.isUnresolved(a)?m=a.length>50?`${a.substring(0,47)}...`:a:typeof a=="string"?m="[Token]":m="[Object]",t.push({path:i,value:m,isDefault:u,recommendation:u?d:void 0});break}},o=(i,a="")=>{for(let[c,d]of Object.entries(i)){let l=a?`${a}.${c}`:c;s(l,d),d&&typeof d=="object"&&!Array.isArray(d)&&!Lr.Token.isUnresolved(d)&&o(d,l)}};o(n)}catch{}return t},BX=e=>{try{let r=e.cfnProperties;if(!r)return!0;let n=0;for(let s of Object.values(r))s!==void 0&&!Lr.Token.isUnresolved(s)&&n++;return n<3}catch{return!1}},$X=(e,t={})=>{let{captureSourceLocation:r=!0,captureTags:n=!0,captureRelationships:s=!0,captureHierarchy:o=!0,captureDependencies:i=!0,captureSensitiveProperties:a=!0}=t;if(!("cfnResourceType"in e))return null;let c=Lr.Stack.of(e),d=e.node.path,l=e.constructor.name,u=e.node.id,m=e,p=m.cfnResourceType,h;try{h=c.getLogicalId(m)}catch{}let{l2Type:y,l2Id:_}=MX(e),w=_?`${_} (${y||l})`:`${u} (${l})`,E={source:"cdk_insights",version:UL,stackName:c.stackName,stackId:c.node.id,constructPath:d,constructType:l,friendlyName:w,timestamp:new Date().toISOString(),cfnResourceType:p};u&&(E.id=u),h&&(E.logicalId=h),y&&(E.l2ConstructType=y),_&&(E.l2ConstructId=_);let B=jX(p);if(B&&(E.serviceCategory=B),r){let T=HL(e,_);if(T)E.sourceLocation=T;else{let H=DX(e);H&&(E.rootSourceLocation=H.location),E.searchHint=NX(d,_,y,p)}let A=RX(e,y,_);A&&(E.createdBy=A)}if(s){let T=e.node.scope;T&&(E.parentPath=T.node.path),E.childCount=e.node.children.length}if(o){let T=FX(e);T.length>0&&(E.constructHierarchy=T)}if(i)try{let T=e.node.dependencies;if(T.length>0){let A=[];for(let H of T)if("cfnResourceType"in H)try{let Z=c.getLogicalId(H);Z&&A.push(Z)}catch{}A.length>0&&(E.dependencies=A)}}catch{}if(a){let T=UX(e);T.length>0&&(E.sensitiveProperties=T),E.usesDefaults=BX(e)}if(n)try{let T=m.tagsRaw;if(T&&Object.keys(T).length>0)E.tags=T;else{let A=m.tags;if(A&&typeof A.renderTags=="function"){let H=A.renderTags();H&&Object.keys(H).length>0&&(E.tags=H)}}}catch{}try{let T=c.cdkVersion;T&&(E.cdkVersion=T)}catch{}return E},qL=(e,t,r={})=>{if(CX(),t)try{t.visit(e)}catch(s){Pe.warn(`CDK-Nag error suppressed for ${e.node.path}: ${s.message}`)}let n=$X(e,{captureSourceLocation:r.captureSourceLocation,captureTags:r.captureTags,captureRelationships:r.captureRelationships,captureHierarchy:r.captureHierarchy,captureDependencies:r.captureDependencies,captureSensitiveProperties:r.captureSensitiveProperties});n&&Lr.Annotations.of(e).addInfo(`${BL}${JSON.stringify(n)}`)},zX=(e={})=>{let{logCompliance:t=!1,logNotApplicable:r=!1,verbose:n=!1}=e;return{onCompliance:s=>{t&&Pe.debug(`\u2713 ${s.resource.logicalId} is compliant with ${s.ruleId}`)},onNonCompliance:s=>{Pe.warn(`\u2717 ${s.resource.logicalId} is non-compliant with ${s.ruleId}: ${s.ruleInfo}`)},onSuppressed:s=>{n&&Pe.info(`\u2298 ${s.ruleId} suppressed on ${s.resource.logicalId}: ${s.suppressionReason}`)},onError:s=>{Pe.error(`\u26A0 ${s.ruleId} error during validation: ${s.errorMessage}`)},onSuppressedError:s=>{n&&Pe.warn(`\u2298 ${s.ruleId} error suppressed: ${s.errorSuppressionReason}`)},onNotApplicable:s=>{r&&n&&Pe.debug(`- ${s.ruleId} not applicable to ${s.resource.logicalId}`)}}},HX=(e={})=>{let{logCompliance:t=!0,logNotApplicable:r=!1,verbose:n=!1}=e;return{onCompliance:s=>{t&&Pe.info(`Yay! ${s.resource.logicalId} is compliant with ${s.ruleId}`)},onNonCompliance:s=>{Pe.warn(`Boo! ${s.resource.logicalId} is non-compliant with ${s.ruleId}`)},onSuppressed:s=>{n&&Pe.info(`Hmmmm... ${s.ruleId} has been suppressed on ${s.resource.logicalId} with reason: ${s.suppressionReason}`)},onError:s=>{Pe.error(`WHAT?!?! ${s.ruleId} encountered an error during validation!`)},onSuppressedError:s=>{n&&Pe.warn(`PHEW! ${s.ruleId} error was suppressed: ${s.errorSuppressionReason}`)},onNotApplicable:s=>{r&&n&&Pe.debug(`Meh. ${s.ruleId} and ${s.resource.logicalId} aren't related at all.`)}}},qX=(e={})=>{let{runNagChecks:t=!0,captureSourceLocation:r=!0,captureTags:n=!0,captureRelationships:s=!0,captureHierarchy:o=!0,captureDependencies:i=!0,captureSensitiveProperties:a=!0}=e,c=t?new xa.AwsSolutionsChecks:null;return{visit:d=>{qL(d,c,{captureSourceLocation:r,captureTags:n,captureRelationships:s,captureHierarchy:o,captureDependencies:i,captureSensitiveProperties:a})}}},Cu=class{options;constructor(t={}){this.options={logCompliance:!0,logNotApplicable:!1,verbose:!1,...t}}onCompliance(t){this.options.logCompliance&&Pe.info(`Yay! ${t.resource.logicalId} is compliant with ${t.ruleId}`)}onNonCompliance(t){Pe.warn(`Boo! ${t.resource.logicalId} is non-compliant with ${t.ruleId}`)}onSuppressed(t){this.options.verbose&&Pe.info(`Hmmmm... ${t.ruleId} has been suppressed on ${t.resource.logicalId} with reason: ${t.suppressionReason}`)}onError(t){Pe.error(`WHAT?!?! ${t.ruleId} encountered an error during validation!`)}onSuppressedError(t){this.options.verbose&&Pe.warn(`PHEW! ${t.ruleId} error was suppressed: ${t.errorSuppressionReason}`)}onNotApplicable(t){this.options.logNotApplicable&&this.options.verbose&&Pe.debug(`Meh. ${t.ruleId} and ${t.resource.logicalId} aren't related at all.`)}},Vh=class extends xa.NagPack{delegate;options;constructor(t){super(t),this.packName="CdkInsights",this.options={runNagChecks:t?.runNagChecks??!0,captureSourceLocation:t?.captureSourceLocation??!0,captureTags:t?.captureTags??!0,captureRelationships:t?.captureRelationships??!0,captureHierarchy:t?.captureHierarchy??!0,captureDependencies:t?.captureDependencies??!0,captureSensitiveProperties:t?.captureSensitiveProperties??!0,logger:t?.logger},this.loggers.push(new Cu(this.options.logger)),this.delegate=new xa.AwsSolutionsChecks}visit(t){qL(t,this.options.runNagChecks?this.delegate:null,this.options)}};var GX=()=>{Eu.clear(),Ho.clear(),Pn.clear(),qh=!1},VX=()=>({sourceFiles:Eu.size,constructLocations:Ho.size,sourceMaps:Pn.size});0&&(module.exports={CDK_INSIGHTS_ANNOTATION_PREFIX,CDK_INSIGHTS_METADATA_VERSION,CdkInsightsAspect,ExtremelyHelpfulConsoleLogger,clearCaches,createCdkInsightsAspect,createCdkInsightsLogger,createExtremelyHelpfulConsoleLogger,getCacheStats,isCdkDebugEnabled});
68
+ \u{1F4A1} Benefits of Branded API:`),console.log(" \u2022 Clear brand ownership"),console.log(" \u2022 Consistent naming convention"),console.log(" \u2022 Easy to identify Strogger functions"),console.log(" \u2022 No breaking changes - conventional API still works")}catch(t){console.error("\u274C Error running branded API examples:",t)}};X.runBrandedAPIExamples=Xo;require.main===Un&&(0,X.runBrandedAPIExamples)()});var be=O(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});f.demonstrateAutomaticInstanceId=f.runCloudWatchTransportExamples=f.runFileTransportExamples=f.createCloudWatchTransportExample=f.createFileTransportExample=f.createBatchedLogger=f.createBatchedTransport=f.generateLoggerInstanceId=f.generateSpanId=f.generateTraceId=f.generateCorrelationId=f.createLoggerInstanceEnricher=f.createUserEnricher=f.createEnvironmentEnricher=f.createSessionEnricher=f.createCorrelationEnricher=f.createEnrichmentMiddleware=f.createDefaultEnrichmentMiddleware=f.createSampler=f.createRateLimiter=f.createLogFilter=f.validateTransportConfig=f.validateEnvironmentVariable=f.handleTransportError=f.createDetailedError=f.ERROR_MESSAGES=f.ValidationError=f.ConfigurationError=f.TransportError=f.LoggerError=f.createPerformanceMonitor=f.getEnvironment=f.createStroggerCloudWatchTransport=f.createStroggerNewRelicTransport=f.createStroggerElasticsearchTransport=f.createStroggerSplunkTransport=f.createStroggerDataDogTransport=f.createStroggerConsoleTransport=f.createCloudWatchTransport=f.createFileTransport=f.createNewRelicTransport=f.createElasticsearchTransport=f.createSplunkTransport=f.createDataDogTransport=f.createConsoleTransport=f.createJsonFormatter=f.LogLevel=f.strogger=f.createStrogger=f.createLogger=void 0;f.printLoggerConfig=f.shouldLog=f.runBrandedAPIExamples=f.runStructuredLoggingDemo=f.demonstrateManualGeneration=f.demonstrateInstanceIdInContexts=f.demonstrateMultipleInstances=f.demonstrateCustomInstanceId=void 0;var Lr=_r();Object.defineProperty(f,"createLogger",{enumerable:!0,get:function(){return Lr.createLogger}});Object.defineProperty(f,"createStrogger",{enumerable:!0,get:function(){return Lr.createStrogger}});Object.defineProperty(f,"strogger",{enumerable:!0,get:function(){return Lr.strogger}});var ei=le();Object.defineProperty(f,"LogLevel",{enumerable:!0,get:function(){return ei.LogLevel}});var ti=ar();Object.defineProperty(f,"createJsonFormatter",{enumerable:!0,get:function(){return ti.createJsonFormatter}});var ri=Zt();Object.defineProperty(f,"createConsoleTransport",{enumerable:!0,get:function(){return ri.createConsoleTransport}});var ni=Sr();Object.defineProperty(f,"createDataDogTransport",{enumerable:!0,get:function(){return ni.createDataDogTransport}});var si=Tr();Object.defineProperty(f,"createSplunkTransport",{enumerable:!0,get:function(){return si.createSplunkTransport}});var ai=Cr();Object.defineProperty(f,"createElasticsearchTransport",{enumerable:!0,get:function(){return ai.createElasticsearchTransport}});var oi=br();Object.defineProperty(f,"createNewRelicTransport",{enumerable:!0,get:function(){return oi.createNewRelicTransport}});var ii=cn();Object.defineProperty(f,"createFileTransport",{enumerable:!0,get:function(){return ii.createFileTransport}});var ci=Er();Object.defineProperty(f,"createCloudWatchTransport",{enumerable:!0,get:function(){return ci.createCloudWatchTransport}});var li=Zt();Object.defineProperty(f,"createStroggerConsoleTransport",{enumerable:!0,get:function(){return li.createConsoleTransport}});var ui=Sr();Object.defineProperty(f,"createStroggerDataDogTransport",{enumerable:!0,get:function(){return ui.createDataDogTransport}});var di=Tr();Object.defineProperty(f,"createStroggerSplunkTransport",{enumerable:!0,get:function(){return di.createSplunkTransport}});var gi=Cr();Object.defineProperty(f,"createStroggerElasticsearchTransport",{enumerable:!0,get:function(){return gi.createElasticsearchTransport}});var pi=br();Object.defineProperty(f,"createStroggerNewRelicTransport",{enumerable:!0,get:function(){return pi.createNewRelicTransport}});var mi=Er();Object.defineProperty(f,"createStroggerCloudWatchTransport",{enumerable:!0,get:function(){return mi.createCloudWatchTransport}});var fi=vr();Object.defineProperty(f,"getEnvironment",{enumerable:!0,get:function(){return fi.getEnvironment}});var hi=ln();Object.defineProperty(f,"createPerformanceMonitor",{enumerable:!0,get:function(){return hi.createPerformanceMonitor}});var Ee=De();Object.defineProperty(f,"LoggerError",{enumerable:!0,get:function(){return Ee.LoggerError}});Object.defineProperty(f,"TransportError",{enumerable:!0,get:function(){return Ee.TransportError}});Object.defineProperty(f,"ConfigurationError",{enumerable:!0,get:function(){return Ee.ConfigurationError}});Object.defineProperty(f,"ValidationError",{enumerable:!0,get:function(){return Ee.ValidationError}});Object.defineProperty(f,"ERROR_MESSAGES",{enumerable:!0,get:function(){return Ee.ERROR_MESSAGES}});Object.defineProperty(f,"createDetailedError",{enumerable:!0,get:function(){return Ee.createDetailedError}});Object.defineProperty(f,"handleTransportError",{enumerable:!0,get:function(){return Ee.handleTransportError}});Object.defineProperty(f,"validateEnvironmentVariable",{enumerable:!0,get:function(){return Ee.validateEnvironmentVariable}});Object.defineProperty(f,"validateTransportConfig",{enumerable:!0,get:function(){return Ee.validateTransportConfig}});var xr=yr();Object.defineProperty(f,"createLogFilter",{enumerable:!0,get:function(){return xr.createLogFilter}});Object.defineProperty(f,"createRateLimiter",{enumerable:!0,get:function(){return xr.createRateLimiter}});Object.defineProperty(f,"createSampler",{enumerable:!0,get:function(){return xr.createSampler}});var de=cr();Object.defineProperty(f,"createDefaultEnrichmentMiddleware",{enumerable:!0,get:function(){return de.createDefaultEnrichmentMiddleware}});Object.defineProperty(f,"createEnrichmentMiddleware",{enumerable:!0,get:function(){return de.createEnrichmentMiddleware}});Object.defineProperty(f,"createCorrelationEnricher",{enumerable:!0,get:function(){return de.createCorrelationEnricher}});Object.defineProperty(f,"createSessionEnricher",{enumerable:!0,get:function(){return de.createSessionEnricher}});Object.defineProperty(f,"createEnvironmentEnricher",{enumerable:!0,get:function(){return de.createEnvironmentEnricher}});Object.defineProperty(f,"createUserEnricher",{enumerable:!0,get:function(){return de.createUserEnricher}});Object.defineProperty(f,"createLoggerInstanceEnricher",{enumerable:!0,get:function(){return de.createLoggerInstanceEnricher}});Object.defineProperty(f,"generateCorrelationId",{enumerable:!0,get:function(){return de.generateCorrelationId}});Object.defineProperty(f,"generateTraceId",{enumerable:!0,get:function(){return de.generateTraceId}});Object.defineProperty(f,"generateSpanId",{enumerable:!0,get:function(){return de.generateSpanId}});Object.defineProperty(f,"generateLoggerInstanceId",{enumerable:!0,get:function(){return de.generateLoggerInstanceId}});var $n=ir();Object.defineProperty(f,"createBatchedTransport",{enumerable:!0,get:function(){return $n.createBatchedTransport}});Object.defineProperty(f,"createBatchedLogger",{enumerable:!0,get:function(){return $n.createBatchedLogger}});var vi=un();Object.defineProperty(f,"createFileTransportExample",{enumerable:!0,get:function(){return vi.createFileTransportExample}});var yi=dn();Object.defineProperty(f,"createCloudWatchTransportExample",{enumerable:!0,get:function(){return yi.createCloudWatchTransportExample}});var _i=_n();Object.defineProperty(f,"runFileTransportExamples",{enumerable:!0,get:function(){return _i.runFileTransportExamples}});var Ii=wn();Object.defineProperty(f,"runCloudWatchTransportExamples",{enumerable:!0,get:function(){return Ii.runCloudWatchTransportExamples}});var Nt=Nn();Object.defineProperty(f,"demonstrateAutomaticInstanceId",{enumerable:!0,get:function(){return Nt.demonstrateAutomaticInstanceId}});Object.defineProperty(f,"demonstrateCustomInstanceId",{enumerable:!0,get:function(){return Nt.demonstrateCustomInstanceId}});Object.defineProperty(f,"demonstrateMultipleInstances",{enumerable:!0,get:function(){return Nt.demonstrateMultipleInstances}});Object.defineProperty(f,"demonstrateInstanceIdInContexts",{enumerable:!0,get:function(){return Nt.demonstrateInstanceIdInContexts}});Object.defineProperty(f,"demonstrateManualGeneration",{enumerable:!0,get:function(){return Nt.demonstrateManualGeneration}});var Si=jn();Object.defineProperty(f,"runStructuredLoggingDemo",{enumerable:!0,get:function(){return Si.runStructuredLoggingDemo}});var Ti=Wn();Object.defineProperty(f,"runBrandedAPIExamples",{enumerable:!0,get:function(){return Ti.runBrandedAPIExamples}});var Ci=_e();Object.defineProperty(f,"shouldLog",{enumerable:!0,get:function(){return Ci.shouldLog}});var bi=_r();Object.defineProperty(f,"printLoggerConfig",{enumerable:!0,get:function(){return bi.printLoggerConfig}})});var Qi={};ns(Qi,{CDK_INSIGHTS_ANNOTATION_PREFIX:()=>qn,CDK_INSIGHTS_METADATA_VERSION:()=>Bn,CdkInsightsAspect:()=>kr,ExtremelyHelpfulConsoleLogger:()=>nr,clearCaches:()=>Ji,createCdkInsightsAspect:()=>Ki,createCdkInsightsLogger:()=>zi,createExtremelyHelpfulConsoleLogger:()=>Hi,getCacheStats:()=>Yi,isCdkDebugEnabled:()=>zn});module.exports=ss(Qi);var Le=require("aws-cdk-lib"),At=require("cdk-nag"),pe=sr(require("node:fs")),ne=sr(require("node:path"));var ge=sr(be()),It=process.env.NODE_ENV==="development",wr=process.env.CDK_INSIGHTS_VERBOSE==="true",Ei=It||wr||process.env.CDK_INSIGHTS_ENABLE_LOGGING==="true",Vn=wr?ge.LogLevel.DEBUG:It?ge.LogLevel.INFO:ge.LogLevel.ERROR,Li=Ei?[(0,ge.createConsoleTransport)({formatter:(0,ge.createJsonFormatter)(),level:Vn,useColors:!It})]:[],er=(0,ge.createLogger)({config:{level:Vn,serviceName:"cdk-insights",stage:It?"dev":"prod"},formatter:(0,ge.createJsonFormatter)(),transports:Li,env:{STAGE:It?"dev":"prod",LOG_LEVEL:wr?"DEBUG":It?"INFO":"ERROR"}}),St=t=>({debug:(e,r,n)=>er.debug(e,{component:t,...r},n),info:(e,r,n)=>er.info(e,{component:t,...r},n),warn:(e,r,n,s)=>er.warn(e,{component:t,...r},n,s),error:(e,r,n,s)=>er.error(e,{component:t,...r},n,s)}),kc=St("cli"),Oc=St("analysis"),Rc=St("license"),Dc=St("cache"),Pc=St("github"),G=St("aspect");var Bn="2.2.0",qn="cdk-insights::",zn=()=>process.env.CDK_DEBUG==="true"||(process.env.CDK_CONTEXT_JSON?.includes('"@aws-cdk/core:stackTrace":true')??!1)||(process.env.CDK_CONTEXT_JSON?.includes('"@aws-cdk/core:stackTrace": true')??!1),Nr=!1,xi=()=>{Nr||(zn()||G.info("\u{1F4A1} Tip: Set CDK_DEBUG=true for more accurate source location detection. Run: CDK_DEBUG=true cdk synth"),Nr=!0)},rr=new Map,Tt=new Map,Fe=new Map,wi=t=>{let a={},i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let h=0;h<i.length;h++)a[i[h]]=h;let o=[],g=0,u=0;for(let h of t){let p=a[h];if(p!==void 0)if(u+=(p&31)<<g,(p&32)!==0)g+=5;else{let d=u&1;u>>=1,o.push(d?-u:u),u=0,g=0}}return o},Ni=t=>{let e=t;if(Fe.has(e))return Fe.get(e)??null;try{let r=pe.readFileSync(t,"utf-8"),n=r.match(/\/\/# sourceMappingURL=data:application\/json;base64,(.+)$/m);if(n){let i=Buffer.from(n[1],"base64").toString("utf-8"),o=JSON.parse(i);return Fe.set(e,o),o}let s=r.match(/\/\/# sourceMappingURL=(.+)$/m);if(s){let i=ne.resolve(ne.dirname(t),s[1]);if(pe.existsSync(i)){let o=JSON.parse(pe.readFileSync(i,"utf-8"));return Fe.set(e,o),o}}let a=`${t}.map`;if(pe.existsSync(a)){let i=JSON.parse(pe.readFileSync(a,"utf-8"));return Fe.set(e,i),i}}catch{}return Fe.set(e,null),null},Ai=(t,e,r)=>{let n=Ni(t);if(!n)return null;try{let s=n.mappings.split(";");if(e>s.length)return null;let a=0,i=0,o=0,g=0;for(let m=0;m<=Math.min(e-1,s.length-1);m++){let S=s[m].split(","),b=0;for(let E of S){if(!E)continue;let T=wi(E);if(T.length!==0&&(b+=T[0],T.length>=4&&(a+=T[1],i+=T[2],o+=T[3],T.length>=5&&(g+=T[4])),m===e-1&&b>=r))break}}let u=n.sources[a];if(!u)return null;let h=ne.dirname(t),p=ne.resolve(h,u),d=ne.relative(process.cwd(),p);return{source:d.startsWith(".")?d:`./${d}`,line:i+1,column:o+1,name:n.names?.[g]}}catch{return null}},Gn=(t,e="fallback")=>{let r=t.split(`
69
+ `),n=null,s;for(let a of r){if(a.includes("node_modules")||a.includes("aws-cdk-lib")||a.includes("cdk-insights"))continue;let i=a.match(/at\s+(?:new\s+)?(\w+(?:\.\w+)*)\s+\(/);i&&!s&&(s=i[1]);let o=a.match(/\(?([^()]+\.(ts|js|tsx|jsx)):(\d+):(\d+)\)?/);if(o){let[,g,u,h,p]=o,d=g.trim();!d.startsWith("/")&&!d.startsWith(".")&&(d=`./${d}`);let m=Number(h),S=Number(p);if((u==="js"||u==="jsx")&&(d.includes("/dist/")||d.includes("\\dist\\"))){let E=ne.resolve(process.cwd(),d),T=Ai(E,m,S);if(T)return{filePath:T.source,line:T.line,column:T.column,confidence:"high",method:"source_map",enclosingScope:T.name||s,originalFile:d}}let b={filePath:d,line:m,column:S,confidence:e==="creation_stack"?"high":"medium",method:e,enclosingScope:s};if(u==="ts"||u==="tsx")return b;n||(n=b)}}return n??void 0},ki=(t,e,r,n)=>{let s=`${r}:${e}`;if(Tt.has(s))return Tt.get(s)??void 0;try{let a=process.cwd(),i=["lib","cdk","src","bin","stacks","cdk/stacks","infrastructure","apps"],o=e.split("/"),g=o.length>1?o[o.length-2]:"",u=t==="Resource"||t==="Default"?n||g||t:t||e.split("/").pop()||"";for(let h of i){let p=ne.join(a,h);if(!pe.existsSync(p))continue;let d=Hn(p);for(let m of d){let S=Di(m,u,g,a);if(S)return Tt.set(s,S),S}}}catch{}Tt.set(s,null)},Hn=(t,e=[])=>{try{let r=pe.readdirSync(t,{withFileTypes:!0});for(let n of r){let s=ne.join(t,n.name);n.isDirectory()&&!n.name.startsWith(".")&&n.name!=="node_modules"?Hn(s,e):n.isFile()&&(n.name.endsWith(".ts")||n.name.endsWith(".tsx"))&&e.push(s)}}catch{}return e},Oi=(t,e,r=2)=>{let n=t.split(`
70
+ `),s=Math.max(0,e-1-r),a=Math.min(n.length,e+r);return n.slice(s,a).map((i,o)=>{let g=s+o+1;return`${g===e?">":" "}${g.toString().padStart(4)} | ${i}`}).join(`
71
+ `)},Ri=(t,e)=>{let r=t.split(`
72
+ `),n,s=0,a=0;for(let i=0;i<Math.min(e,r.length);i++){let o=r[i],g=o.match(/class\s+(\w+)/),u=o.match(/(?:function\s+(\w+)|(\w+)\s*[=:]\s*(?:async\s*)?\(|(\w+)\s*\([^)]*\)\s*(?:=>|\{))/);if(g)n=g[1],a=s;else if(u){let h=u[1]||u[2]||u[3];h&&n?n=`${n}.${h}`:h&&(n=h),a=s}if(s+=(o.match(/{/g)||[]).length,s-=(o.match(/}/g)||[]).length,s<=a&&n){let h=n.split(".");h.length>1&&(n=h.slice(0,-1).join("."))}}return n},Di=(t,e,r,n)=>{try{let s=rr.get(t);s||(s=pe.readFileSync(t,"utf-8"),rr.set(t,s));let a=s.split(`
73
+ `),i=[],o=new RegExp(`new\\s+(\\w+)\\s*\\(\\s*(?:this|\\w+)\\s*,\\s*['"\`]${tr(e)}['"\`]`,"g"),g=new RegExp(`(?:const|let|var)\\s+(${tr(e.replace(/[^a-zA-Z0-9]/g,""))})\\s*=\\s*new\\s+(\\w+)`,"gi"),u=new RegExp(`\\w+\\s*[=:]\\s*new\\s+(\\w+)\\s*\\(\\s*(?:this|\\w+)\\s*,\\s*['"\`]${tr(e)}['"\`]`,"g"),h=new RegExp(`\\.\\w+\\s*\\(\\s*['"\`]${tr(e)}['"\`]`,"g");for(let p=0;p<a.length;p++){let d=a[p],m=o.exec(d);if(m){i.push({line:p+1,column:m.index+1,constructorName:m[1],confidence:"high"}),o.lastIndex=0;continue}if(m=u.exec(d),m){i.push({line:p+1,column:m.index+1,constructorName:m[1],confidence:"high"}),u.lastIndex=0;continue}if(m=g.exec(d),m){i.push({line:p+1,column:m.index+1,constructorName:m[2],confidence:"medium"}),g.lastIndex=0;continue}m=h.exec(d),m&&(i.push({line:p+1,column:m.index+1,confidence:"low"}),h.lastIndex=0)}if(i.length>0){i.sort((j,y)=>{let L={high:0,medium:1,low:2};return L[j.confidence]-L[y.confidence]});let p=i[0],d=ne.relative(n,t),m=Ri(s,p.line),S=Oi(s,p.line),b=p.line,E=0,T=0,I=!1;for(let j=p.line-1;j<a.length&&j<p.line+50;j++){let y=a[j];for(let L of y)if(L==="("||L==="{")L==="("?T++:E++,I=!0;else if((L===")"||L==="}")&&(L===")"?T--:E--,I&&T<=0&&E<=0)){b=j+1;break}if(b>p.line)break}return{filePath:d.startsWith(".")?d:`./${d}`,line:p.line,column:p.column,endLine:b>p.line?b:void 0,confidence:p.confidence,method:"source_analysis",enclosingScope:m,codeSnippet:S}}}catch{}},tr=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Pi=t=>{let e=t;if(e._creationStack?.length)return e._creationStack;if(e.creationStack?.length)return e.creationStack;let r=t.node.defaultChild;if(r?._creationStack?.length)return r._creationStack;if(r?.creationStack?.length)return r.creationStack;let n=t.node.scope;for(;n;){let s=n;if(s._creationStack?.length)return s._creationStack;if(s.creationStack?.length)return s.creationStack;n=n.node?.scope}},Kn=(t,e)=>{try{let r=Pi(t);if(r?.length){let o=r.join(`
74
+ `),g=Gn(o,"creation_stack");if(g)return{...g,confidence:"high"}}for(let o of t.node.metadata)if(o.trace&&Array.isArray(o.trace)){let g=o.trace.join(`
75
+ `),u=Gn(g,"metadata_trace");if(u)return u}let n=t.node.id,s=t.node.path,a=Le.Stack.of(t),i=ki(n,s,a.stackName,e);return i||void 0}catch{}},Zi=(t,e=10)=>{let r=t.node.scope,n=0;for(;r&&n<e;){let s=r.node.id,a=r.constructor.name;if(a==="Stack"||a==="App"||!s){r=r.node.scope,n++;continue}let i=Kn(r,s);if(i)return{location:i,ancestorId:s,ancestorType:a};r=r.node.scope,n++}},Fi=(t,e,r)=>{let n=t.constructor.name,s={CfnSubnet:"Vpc",CfnRouteTable:"Vpc or Subnet",CfnRoute:"Vpc or Subnet",CfnSubnetRouteTableAssociation:"Subnet",CfnInternetGateway:"Vpc",CfnVPCGatewayAttachment:"Vpc",CfnNatGateway:"Vpc (public subnet)",CfnEIP:"Vpc (for NAT Gateway)",CfnSecurityGroup:"Vpc or other L2 construct",CfnSecurityGroupIngress:"SecurityGroup",CfnSecurityGroupEgress:"SecurityGroup",CfnDBSubnetGroup:"DatabaseInstance or DatabaseCluster",CfnLogGroup:"Lambda Function or other service",CfnRole:"Lambda Function, ECS Task, or other service",CfnPolicy:"Role or User",CfnInstanceProfile:"Role"};if(e&&r)return`Created by ${e.replace(/\d+$/,"")} construct '${r}'`;let a=s[n];if(a){let i=t.node.scope;if(i&&i.node){let o=i.node.id,g=i.constructor.name.replace(/\d+$/,"");if(o&&g!=="Stack")return`Created by ${g} construct '${o}'`}return`Implicitly created by ${a}`}},Mi=(t,e,r,n)=>{let s=[];e&&s.push(`'${e}'`);let a=t.split("/").filter(o=>o&&o!=="Resource"&&o!=="Default"&&!o.startsWith("Cfn")),i=a[a.length-1];if(i&&i!==e&&s.push(`'${i}'`),a.length>1){let o=a[a.length-2];o&&o!==e&&o!==i&&s.push(`'${o}'`)}if(r){let o=r.replace(/\d+$/,"");s.push(`new ${o}(`)}if(n){let o=n.split("::").pop()??"";o&&!s.some(g=>g.includes(o))&&s.push(`${o}`)}return s.length===0?`Search for: ${t}`:`Search for: ${s.slice(0,3).join(" or ")}`},ji={"AWS::S3":"Storage","AWS::DynamoDB":"Database","AWS::RDS":"Database","AWS::Lambda":"Compute","AWS::EC2":"Compute","AWS::ECS":"Containers","AWS::EKS":"Containers","AWS::IAM":"Security","AWS::KMS":"Security","AWS::SecretsManager":"Security","AWS::CloudWatch":"Management","AWS::CloudTrail":"Management","AWS::SNS":"Messaging","AWS::SQS":"Messaging","AWS::EventBridge":"Messaging","AWS::ApiGateway":"Networking","AWS::CloudFront":"Networking","AWS::ELB":"Networking","AWS::ElasticLoadBalancing":"Networking","AWS::VPC":"Networking","AWS::Route53":"Networking","AWS::Cognito":"Security","AWS::WAF":"Security","AWS::StepFunctions":"Integration","AWS::Kinesis":"Analytics","AWS::Glue":"Analytics","AWS::Athena":"Analytics","AWS::Redshift":"Analytics"},Ui=[{pattern:/encryption|encrypted|kmsKey|sseSpecification/i,recommendation:"Enable encryption for data at rest",checkDefault:t=>t===!1||t===void 0||t===null},{pattern:/publicAccess|publicRead|publiclyAccessible/i,recommendation:"Restrict public access unless explicitly required",checkDefault:t=>t===!0},{pattern:/logging|accessLog|trailName/i,recommendation:"Enable logging for audit and compliance",checkDefault:t=>t===!1||t===void 0},{pattern:/versioning|versioningConfiguration/i,recommendation:"Enable versioning for data protection",checkDefault:t=>t===void 0||typeof t=="object"&&t!==null&&t.status!=="Enabled"},{pattern:/backupRetention|deletionProtection|deleteProtection/i,recommendation:"Configure backup and deletion protection",checkDefault:t=>t===!1||t===0||t===void 0},{pattern:/multiAz|multiAZ/i,recommendation:"Enable Multi-AZ for high availability",checkDefault:t=>t===!1},{pattern:/securityGroup|ingressRules|egressRules/i,recommendation:"Review security group rules"},{pattern:/iamRole|assumeRolePolicy|policyDocument/i,recommendation:"Review IAM permissions for least privilege"}],Wi=t=>{try{let e=t.node.scope;if(!e)return{};let r=e.constructor.name;if(r.startsWith("Cfn")){let n=e.node?.scope;if(n)return{l2Type:n.constructor.name,l2Id:n.node?.id,l2Fqn:Ar(n)}}else return{l2Type:r,l2Id:e.node?.id,l2Fqn:Ar(e)}}catch{}return{}},Ar=t=>{try{let e=t;if(e.constructor.__jsii__?.fqn)return e.constructor.__jsii__.fqn;if(typeof e.constructor.fqn=="string")return e.constructor.fqn;let r=t.constructor.name;return r.startsWith("Cfn")?`aws-cdk-lib.${r}`:r}catch{return}},$i=t=>{let e=[];try{let r=t;for(;r;)e.unshift({id:r.node.id,type:r.constructor.name,fqn:Ar(r)}),r=r.node.scope}catch{}return e},Vi=t=>{for(let[e,r]of Object.entries(ji))if(t.startsWith(e))return r},Gi=t=>{let e=[];try{let n=t.cfnProperties;if(!n)return e;let s=(i,o)=>{for(let{pattern:g,recommendation:u,checkDefault:h}of Ui)if(g.test(i)){let p=h?h(o):void 0,d=null;typeof o=="boolean"||typeof o=="number"?d=o:o==null?d=null:typeof o=="string"&&!Le.Token.isUnresolved(o)?d=o.length>50?`${o.substring(0,47)}...`:o:typeof o=="string"?d="[Token]":d="[Object]",e.push({path:i,value:d,isDefault:p,recommendation:p?u:void 0});break}},a=(i,o="")=>{for(let[g,u]of Object.entries(i)){let h=o?`${o}.${g}`:g;s(h,u),u&&typeof u=="object"&&!Array.isArray(u)&&!Le.Token.isUnresolved(u)&&a(u,h)}};a(n)}catch{}return e},Bi=t=>{try{let r=t.cfnProperties;if(!r)return!0;let n=0;for(let s of Object.values(r))s!==void 0&&!Le.Token.isUnresolved(s)&&n++;return n<3}catch{return!1}},qi=(t,e={})=>{let{captureSourceLocation:r=!0,captureTags:n=!0,captureRelationships:s=!0,captureHierarchy:a=!0,captureDependencies:i=!0,captureSensitiveProperties:o=!0}=e;if(!("cfnResourceType"in t))return null;let g=Le.Stack.of(t),u=t.node.path,h=t.constructor.name,p=t.node.id,d=t,m=d.cfnResourceType,S;try{S=g.getLogicalId(d)}catch{}let{l2Type:b,l2Id:E}=Wi(t),T=E?`${E} (${b||h})`:`${p} (${h})`,I={source:"cdk_insights",version:Bn,stackName:g.stackName,stackId:g.node.id,constructPath:u,constructType:h,friendlyName:T,timestamp:new Date().toISOString(),cfnResourceType:m};p&&(I.id=p),S&&(I.logicalId=S),b&&(I.l2ConstructType=b),E&&(I.l2ConstructId=E);let j=Vi(m);if(j&&(I.serviceCategory=j),r){let y=Kn(t,E);if(y)I.sourceLocation=y;else{let F=Zi(t);F&&(I.rootSourceLocation=F.location),I.searchHint=Mi(u,E,b,m)}let L=Fi(t,b,E);L&&(I.createdBy=L)}if(s){let y=t.node.scope;y&&(I.parentPath=y.node.path),I.childCount=t.node.children.length}if(a){let y=$i(t);y.length>0&&(I.constructHierarchy=y)}if(i)try{let y=t.node.dependencies;if(y.length>0){let L=[];for(let F of y)if("cfnResourceType"in F)try{let k=g.getLogicalId(F);k&&L.push(k)}catch{}L.length>0&&(I.dependencies=L)}}catch{}if(o){let y=Gi(t);y.length>0&&(I.sensitiveProperties=y),I.usesDefaults=Bi(t)}if(n)try{let y=d.tagsRaw;if(y&&Object.keys(y).length>0)I.tags=y;else{let L=d.tags;if(L&&typeof L.renderTags=="function"){let F=L.renderTags();F&&Object.keys(F).length>0&&(I.tags=F)}}}catch{}try{let y=g.cdkVersion;y&&(I.cdkVersion=y)}catch{}return I},Jn=(t,e,r={})=>{if(xi(),e)try{e.visit(t)}catch(s){G.warn(`CDK-Nag error suppressed for ${t.node.path}: ${s.message}`)}let n=qi(t,{captureSourceLocation:r.captureSourceLocation,captureTags:r.captureTags,captureRelationships:r.captureRelationships,captureHierarchy:r.captureHierarchy,captureDependencies:r.captureDependencies,captureSensitiveProperties:r.captureSensitiveProperties});n&&Le.Annotations.of(t).addInfo(`${qn}${JSON.stringify(n)}`)},zi=(t={})=>{let{logCompliance:e=!1,logNotApplicable:r=!1,verbose:n=!1}=t;return{onCompliance:s=>{e&&G.debug(`\u2713 ${s.resource.logicalId} is compliant with ${s.ruleId}`)},onNonCompliance:s=>{G.warn(`\u2717 ${s.resource.logicalId} is non-compliant with ${s.ruleId}: ${s.ruleInfo}`)},onSuppressed:s=>{n&&G.info(`\u2298 ${s.ruleId} suppressed on ${s.resource.logicalId}: ${s.suppressionReason}`)},onError:s=>{G.error(`\u26A0 ${s.ruleId} error during validation: ${s.errorMessage}`)},onSuppressedError:s=>{n&&G.warn(`\u2298 ${s.ruleId} error suppressed: ${s.errorSuppressionReason}`)},onNotApplicable:s=>{r&&n&&G.debug(`- ${s.ruleId} not applicable to ${s.resource.logicalId}`)}}},Hi=(t={})=>{let{logCompliance:e=!0,logNotApplicable:r=!1,verbose:n=!1}=t;return{onCompliance:s=>{e&&G.info(`Yay! ${s.resource.logicalId} is compliant with ${s.ruleId}`)},onNonCompliance:s=>{G.warn(`Boo! ${s.resource.logicalId} is non-compliant with ${s.ruleId}`)},onSuppressed:s=>{n&&G.info(`Hmmmm... ${s.ruleId} has been suppressed on ${s.resource.logicalId} with reason: ${s.suppressionReason}`)},onError:s=>{G.error(`WHAT?!?! ${s.ruleId} encountered an error during validation!`)},onSuppressedError:s=>{n&&G.warn(`PHEW! ${s.ruleId} error was suppressed: ${s.errorSuppressionReason}`)},onNotApplicable:s=>{r&&n&&G.debug(`Meh. ${s.ruleId} and ${s.resource.logicalId} aren't related at all.`)}}},Ki=(t={})=>{let{runNagChecks:e=!0,captureSourceLocation:r=!0,captureTags:n=!0,captureRelationships:s=!0,captureHierarchy:a=!0,captureDependencies:i=!0,captureSensitiveProperties:o=!0}=t,g=e?new At.AwsSolutionsChecks:null;return{visit:u=>{Jn(u,g,{captureSourceLocation:r,captureTags:n,captureRelationships:s,captureHierarchy:a,captureDependencies:i,captureSensitiveProperties:o})}}},nr=class{options;constructor(e={}){this.options={logCompliance:!0,logNotApplicable:!1,verbose:!1,...e}}onCompliance(e){this.options.logCompliance&&G.info(`Yay! ${e.resource.logicalId} is compliant with ${e.ruleId}`)}onNonCompliance(e){G.warn(`Boo! ${e.resource.logicalId} is non-compliant with ${e.ruleId}`)}onSuppressed(e){this.options.verbose&&G.info(`Hmmmm... ${e.ruleId} has been suppressed on ${e.resource.logicalId} with reason: ${e.suppressionReason}`)}onError(e){G.error(`WHAT?!?! ${e.ruleId} encountered an error during validation!`)}onSuppressedError(e){this.options.verbose&&G.warn(`PHEW! ${e.ruleId} error was suppressed: ${e.errorSuppressionReason}`)}onNotApplicable(e){this.options.logNotApplicable&&this.options.verbose&&G.debug(`Meh. ${e.ruleId} and ${e.resource.logicalId} aren't related at all.`)}},kr=class extends At.NagPack{delegate;options;constructor(e){super(e),this.packName="CdkInsights",this.options={runNagChecks:e?.runNagChecks??!0,captureSourceLocation:e?.captureSourceLocation??!0,captureTags:e?.captureTags??!0,captureRelationships:e?.captureRelationships??!0,captureHierarchy:e?.captureHierarchy??!0,captureDependencies:e?.captureDependencies??!0,captureSensitiveProperties:e?.captureSensitiveProperties??!0,logger:e?.logger},this.loggers.push(new nr(this.options.logger)),this.delegate=new At.AwsSolutionsChecks}visit(e){Jn(e,this.options.runNagChecks?this.delegate:null,this.options)}};var Ji=()=>{rr.clear(),Tt.clear(),Fe.clear(),Nr=!1},Yi=()=>({sourceFiles:rr.size,constructLocations:Tt.size,sourceMaps:Fe.size});0&&(module.exports={CDK_INSIGHTS_ANNOTATION_PREFIX,CDK_INSIGHTS_METADATA_VERSION,CdkInsightsAspect,ExtremelyHelpfulConsoleLogger,clearCaches,createCdkInsightsAspect,createCdkInsightsLogger,createExtremelyHelpfulConsoleLogger,getCacheStats,isCdkDebugEnabled});