@stacksjs/buddy 0.64.2 → 0.64.3

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.
@@ -6,7 +6,7 @@ import{a as $,b as w,c as z}from"./chunk-t49ytmk0.js";import{sb as q,ub as G,wb
6
6
  However, a future version may change this behavior to prefer the ENV static credentials.
7
7
  Please ensure that your environment only sets either the AWS_PROFILE or the
8
8
  AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
9
- `),X=!0}throw new q("AWS_PROFILE is set, skipping fromEnv provider.",{logger:b.logger,tryNextLink:!0})}return b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),z(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");const{ssoStartUrl:j,ssoAccountId:x,ssoRegion:y,ssoRoleName:J,ssoSession:K}=b;if(!j&&!x&&!y&&!J&&!K)throw new q("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:b.logger});const{fromSSO:B}=await import("./chunk-avkq27n0.js");return B(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");const{fromIni:j}=await import("./chunk-h56ed3b1.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");const{fromProcess:j}=await import("./chunk-gqfh2x89.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");const{fromTokenFile:j}=await import("./chunk-4mvg6ah4.js");return j(b)()},async()=>{return b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await Q(b))()},async()=>{throw new q("Could not load credentials from any providers",{tryNextLink:!1,logger:b.logger})}),v,k),k=(b)=>b?.expiration!==void 0,v=(b)=>b?.expiration!==void 0&&b.expiration.getTime()-Date.now()<300000;export{W as xb};
9
+ `),X=!0}throw new q("AWS_PROFILE is set, skipping fromEnv provider.",{logger:b.logger,tryNextLink:!0})}return b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),z(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");const{ssoStartUrl:j,ssoAccountId:x,ssoRegion:y,ssoRoleName:J,ssoSession:K}=b;if(!j&&!x&&!y&&!J&&!K)throw new q("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:b.logger});const{fromSSO:B}=await import("./chunk-nnneyqej.js");return B(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");const{fromIni:j}=await import("./chunk-pj6d7hvk.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");const{fromProcess:j}=await import("./chunk-gqfh2x89.js");return j(b)()},async()=>{b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");const{fromTokenFile:j}=await import("./chunk-cpn7yy6s.js");return j(b)()},async()=>{return b.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await Q(b))()},async()=>{throw new q("Could not load credentials from any providers",{tryNextLink:!1,logger:b.logger})}),v,k),k=(b)=>b?.expiration!==void 0,v=(b)=>b?.expiration!==void 0&&b.expiration.getTime()-Date.now()<300000;export{W as xb};
10
10
 
11
11
  //# debugId=306C2219024B958364756E2164756E21
12
- //# sourceMappingURL=chunk-cfxjdvny.js.map
12
+ //# sourceMappingURL=chunk-vc4pnt6y.js.map
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-t49ytmk0.js";import{A,B as D,C as k,D as f,E as j,F as J,I,J as g,L as p,M as a,d as M,e as N,f as O,g as Q,h as R,i as S,k as T,l as U,n as V,o as W,p as X,q as Y,r as Z,s as _,t as $,u as x,v as z,w as C,x as F,y as P,z as h}from"./chunk-z4bfqebt.js";import"./chunk-wmfxrbxe.js";import"./chunk-a6jhzhht.js";import"./chunk-e36y42vg.js";import"./chunk-5bf9sq7t.js";import"./chunk-ac1gbd0g.js";import"./chunk-agapayce.js";import"./chunk-cfxjdvny.js";import"./chunk-59vbpar7.js";import w from"process";import{runAction as m}from"@stacksjs/actions";import{cli as n,log as v}from"@stacksjs/cli";import{Action as l}from"@stacksjs/enums";import{path as L}from"@stacksjs/path";import{fs as i}from"@stacksjs/storage";import{ensureProjectIsInitialized as c}from"@stacksjs/utils";async function t(){const q=n("buddy");if(J(q),z(q),await c())v.debug("Project is initialized");else{v.info("Your `APP_KEY` is not yet set"),v.info("Generating application key...");const B=await m(l.KeyGenerate);if(B.isErr())v.error("Failed to set random application key.",B.error),w.exit()}M(q),N(q),O(q),Q(q),R(q),S(q),U(q),V(q),T(q),W(q),h(q),D(q),X(q),Y(q),Z(q),x(q),_(q),$(q),C(q),F(q),P(q),k(q),f(q),j(q),J(q),I(q),g(q),a(q),A(q),p(q),await e(q),q.help(),q.parse()}async function e(q){const G=L.appPath("Commands"),B=i.readdirSync(G).filter((E)=>E.endsWith(".ts"));for(let E of B){const H=await import(`${G}/${E}`);if(typeof H.default==="function")H.default(q);else console.error(`Expected a default export function in ${E}, but got:`,H.default)}const K=await import(L.listenersPath("Console.ts"));if(typeof K.default==="function")K.default(q)}w.on("uncaughtException",(q)=>{v.debug("uncaughtException"),v.error(q),w.exit(1)});w.on("unhandledRejection",(q)=>{v.debug("unhandledRejection",q),v.error(q),w.exit(1)});await t();
2
+ import"./chunk-t49ytmk0.js";import{A,B as D,C as k,D as f,E as j,F as J,I,J as g,L as p,M as a,d as M,e as N,f as O,g as Q,h as R,i as S,k as T,l as U,n as V,o as W,p as X,q as Y,r as Z,s as _,t as $,u as x,v as z,w as C,x as F,y as P,z as h}from"./chunk-pf356ggx.js";import"./chunk-wmfxrbxe.js";import"./chunk-a6jhzhht.js";import"./chunk-v1w6bgfy.js";import"./chunk-5bf9sq7t.js";import"./chunk-ac1gbd0g.js";import"./chunk-agapayce.js";import"./chunk-vc4pnt6y.js";import"./chunk-59vbpar7.js";import w from"process";import{runAction as m}from"@stacksjs/actions";import{cli as n,log as v}from"@stacksjs/cli";import{Action as l}from"@stacksjs/enums";import{path as L}from"@stacksjs/path";import{fs as i}from"@stacksjs/storage";import{ensureProjectIsInitialized as c}from"@stacksjs/utils";async function t(){const q=n("buddy");if(J(q),z(q),await c())v.debug("Project is initialized");else{v.info("Your `APP_KEY` is not yet set"),v.info("Generating application key...");const B=await m(l.KeyGenerate);if(B.isErr())v.error("Failed to set random application key.",B.error),w.exit()}M(q),N(q),O(q),Q(q),R(q),S(q),U(q),V(q),T(q),W(q),h(q),D(q),X(q),Y(q),Z(q),x(q),_(q),$(q),C(q),F(q),P(q),k(q),f(q),j(q),J(q),I(q),g(q),a(q),A(q),p(q),await e(q),q.help(),q.parse()}async function e(q){const G=L.appPath("Commands"),B=i.readdirSync(G).filter((E)=>E.endsWith(".ts"));for(let E of B){const H=await import(`${G}/${E}`);if(typeof H.default==="function")H.default(q);else console.error(`Expected a default export function in ${E}, but got:`,H.default)}const K=await import(L.listenersPath("Console.ts"));if(typeof K.default==="function")K.default(q)}w.on("uncaughtException",(q)=>{v.debug("uncaughtException"),v.error(q),w.exit(1)});w.on("unhandledRejection",(q)=>{v.debug("unhandledRejection",q),v.error(q),w.exit(1)});await t();
3
3
 
4
4
  //# debugId=98CD31F4F04EAB8C64756E2164756E21
5
5
  //# sourceMappingURL=cli.js.map
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-t49ytmk0.js";import{A as z,B as A,C as B,D as C,E as D,F as E,G as F,H as G,I as H,J as I,K as J,L as K,M as L,d as e,e as f,f as m,g as p,h as t,i as x,j as a,k as b,l as c,m as d,n as g,o as h,p as i,q as j,r as k,s as l,t as n,u as q,v as s,w as u,x as v,y as w,z as y}from"./chunk-z4bfqebt.js";import"./chunk-wmfxrbxe.js";import"./chunk-a6jhzhht.js";import"./chunk-e36y42vg.js";import"./chunk-5bf9sq7t.js";import"./chunk-ac1gbd0g.js";import"./chunk-agapayce.js";import"./chunk-cfxjdvny.js";import"./chunk-59vbpar7.js";export{L as version,K as upgrade,J as types,I as tinker,H as test,d as startDevelopmentServer,E as setup,D as seed,C as route,B as release,A as projects,z as prepublish,y as ports,w as outdated,F as optimizePkgxDeps,v as migrate,u as make,n as list,l as lint,s as key,q as install,k as http,j as generate,i as fresh,G as ensureEnvIsSet,g as domains,h as dns,c as dev,b as deploy,a as create,x as configure,t as commit,p as cloud,m as clean,f as changelog,e as build};
2
+ import"./chunk-t49ytmk0.js";import{A as z,B as A,C as B,D as C,E as D,F as E,G as F,H as G,I as H,J as I,K as J,L as K,M as L,d as e,e as f,f as m,g as p,h as t,i as x,j as a,k as b,l as c,m as d,n as g,o as h,p as i,q as j,r as k,s as l,t as n,u as q,v as s,w as u,x as v,y as w,z as y}from"./chunk-pf356ggx.js";import"./chunk-wmfxrbxe.js";import"./chunk-a6jhzhht.js";import"./chunk-v1w6bgfy.js";import"./chunk-5bf9sq7t.js";import"./chunk-ac1gbd0g.js";import"./chunk-agapayce.js";import"./chunk-vc4pnt6y.js";import"./chunk-59vbpar7.js";export{L as version,K as upgrade,J as types,I as tinker,H as test,d as startDevelopmentServer,E as setup,D as seed,C as route,B as release,A as projects,z as prepublish,y as ports,w as outdated,F as optimizePkgxDeps,v as migrate,u as make,n as list,l as lint,s as key,q as install,k as http,j as generate,i as fresh,G as ensureEnvIsSet,g as domains,h as dns,c as dev,b as deploy,a as create,x as configure,t as commit,p as cloud,m as clean,f as changelog,e as build};
3
3
 
4
4
  //# debugId=5D1A1157F85CB69864756E2164756E21
5
5
  //# sourceMappingURL=index.js.map
package/dist/stacks CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/buddy",
3
3
  "type": "module",
4
- "version": "0.64.2",
4
+ "version": "0.64.3",
5
5
  "description": "Meet Buddy. The Stacks runtime.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -1,21 +0,0 @@
1
- import{N as Uf,O as T}from"./chunk-wmfxrbxe.js";import{$ as UE,R as v,S as M$,T as I0,U as U5,V as GX,W as B0,X as $E,Y as w5,Z as j4,_ as a4,aa as L8,ca as k$,da as GI,ga as EI}from"./chunk-a6jhzhht.js";import{ob as J0}from"./chunk-5bf9sq7t.js";import{pb as X0,qb as R$}from"./chunk-ac1gbd0g.js";import{wb as XI}from"./chunk-agapayce.js";import{Cb as I$}from"./chunk-59vbpar7.js";var c0=T((UM,XU)=>{var{defineProperty:X1,getOwnPropertyDescriptor:kI,getOwnPropertyNames:cI}=Object,uI=Object.prototype.hasOwnProperty,RU=(f,$)=>X1(f,"name",{value:$,configurable:!0}),vI=(f,$)=>{for(var U in $)X1(f,U,{get:$[U],enumerable:!0})},xI=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of cI($))if(!uI.call(f,w)&&w!==U)X1(f,w,{get:()=>$[w],enumerable:!(G=kI($,w))||G.enumerable})}return f},_I=(f)=>xI(X1({},"__esModule",{value:!0}),f),FU={};vI(FU,{getSmithyContext:()=>yI,normalizeProvider:()=>pI});XU.exports=_I(FU);var IU=J0(),yI=RU((f)=>f[IU.SMITHY_CONTEXT_KEY]||(f[IU.SMITHY_CONTEXT_KEY]={}),"getSmithyContext"),pI=RU((f)=>{if(typeof f==="function")return f;const $=Promise.resolve(f);return()=>$},"normalizeProvider")});var Xf=T((wM,JU)=>{var{defineProperty:Z1,getOwnPropertyDescriptor:dI,getOwnPropertyNames:gI}=Object,nI=Object.prototype.hasOwnProperty,E0=(f,$)=>Z1(f,"name",{value:$,configurable:!0}),sI=(f,$)=>{for(var U in $)Z1(f,U,{get:$[U],enumerable:!0})},lI=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of gI($))if(!nI.call(f,w)&&w!==U)Z1(f,w,{get:()=>$[w],enumerable:!(G=dI($,w))||G.enumerable})}return f},mI=(f)=>lI(Z1({},"__esModule",{value:!0}),f),ZU={};sI(ZU,{CredentialsProviderError:()=>iI,ProviderError:()=>Y1,TokenProviderError:()=>rI,chain:()=>oI,fromStatic:()=>tI,memoize:()=>aI});JU.exports=mI(ZU);var YU=class f extends Error{constructor($,U=!0){var G;let w,E=!0;if(typeof U==="boolean")w=void 0,E=U;else if(U!=null&&typeof U==="object")w=U.logger,E=U.tryNextLink??!0;super($);this.name="ProviderError",this.tryNextLink=E,Object.setPrototypeOf(this,f.prototype),(G=w==null?void 0:w.debug)==null||G.call(w,`@smithy/property-provider ${E?"->":"(!)"} ${$}`)}static from($,U=!0){return Object.assign(new this($.message,U),$)}};E0(YU,"ProviderError");var Y1=YU,QU=class f extends Y1{constructor($,U=!0){super($,U);this.name="CredentialsProviderError",Object.setPrototypeOf(this,f.prototype)}};E0(QU,"CredentialsProviderError");var iI=QU,zU=class f extends Y1{constructor($,U=!0){super($,U);this.name="TokenProviderError",Object.setPrototypeOf(this,f.prototype)}};E0(zU,"TokenProviderError");var rI=zU,oI=E0((...f)=>async()=>{if(f.length===0)throw new Y1("No providers in chain");let $;for(let U of f)try{return await U()}catch(G){if($=G,G==null?void 0:G.tryNextLink)continue;throw G}throw $},"chain"),tI=E0((f)=>()=>Promise.resolve(f),"fromStatic"),aI=E0((f,$,U)=>{let G,w,E,W=!1;const L=E0(async()=>{if(!w)w=f();try{G=await w,E=!0,W=!1}finally{w=void 0}return G},"coalesceProvider");if($===void 0)return async(I)=>{if(!E||(I==null?void 0:I.forceRefresh))G=await L();return G};return async(I)=>{if(!E||(I==null?void 0:I.forceRefresh))G=await L();if(W)return G;if(U&&!U(G))return W=!0,G;if($(G))return await L(),G;return G}},"memoize")});var O0=T((MU)=>{Object.defineProperty(MU,"__esModule",{value:!0});MU.getHomeDir=void 0;var eI=import.meta.require("os"),fR=import.meta.require("path"),Zf={},$R=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},UR=()=>{const{HOME:f,USERPROFILE:$,HOMEPATH:U,HOMEDRIVE:G=`C:${fR.sep}`}=process.env;if(f)return f;if($)return $;if(U)return`${G}${U}`;const w=$R();if(!Zf[w])Zf[w]=eI.homedir();return Zf[w]};MU.getHomeDir=UR});var Yf=T((OU)=>{Object.defineProperty(OU,"__esModule",{value:!0});OU.getSSOTokenFilepath=void 0;var wR=import.meta.require("crypto"),GR=import.meta.require("path"),ER=O0(),WR=(f)=>{const U=wR.createHash("sha1").update(f).digest("hex");return GR.join(ER.getHomeDir(),".aws","sso","cache",`${U}.json`)};OU.getSSOTokenFilepath=WR});var VU=T((AU)=>{Object.defineProperty(AU,"__esModule",{value:!0});AU.getSSOTokenFromFile=void 0;var LR=import.meta.require("fs"),IR=Yf(),{readFile:RR}=LR.promises,FR=async(f)=>{const $=IR.getSSOTokenFilepath(f),U=await RR($,"utf8");return JSON.parse(U)};AU.getSSOTokenFromFile=FR});var zf=T((HU)=>{Object.defineProperty(HU,"__esModule",{value:!0});HU.slurpFile=void 0;var XR=import.meta.require("fs"),{readFile:ZR}=XR.promises,Qf={},YR=(f,$)=>{if(!Qf[f]||($===null||$===void 0?void 0:$.ignoreCache))Qf[f]=ZR(f,"utf8");return Qf[f]};HU.slurpFile=YR});var Of=T((IM,v0)=>{var{defineProperty:J1,getOwnPropertyDescriptor:QR,getOwnPropertyNames:zR}=Object,JR=Object.prototype.hasOwnProperty,_=(f,$)=>J1(f,"name",{value:$,configurable:!0}),MR=(f,$)=>{for(var U in $)J1(f,U,{get:$[U],enumerable:!0})},Jf=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of zR($))if(!JR.call(f,w)&&w!==U)J1(f,w,{get:()=>$[w],enumerable:!(G=QR($,w))||G.enumerable})}return f},Tf=(f,$,U)=>(Jf(f,$,"default"),U&&Jf(U,$,"default")),TR=(f)=>Jf(J1({},"__esModule",{value:!0}),f),u0={};MR(u0,{CONFIG_PREFIX_SEPARATOR:()=>W0,DEFAULT_PROFILE:()=>jU,ENV_PROFILE:()=>PU,getProfileName:()=>OR,loadSharedConfigFiles:()=>bU,loadSsoSessionData:()=>hR,parseKnownFiles:()=>kR});v0.exports=TR(u0);Tf(u0,O0(),v0.exports);var PU="AWS_PROFILE",jU="default",OR=_((f)=>f.profile||process.env[PU]||jU,"getProfileName");Tf(u0,Yf(),v0.exports);Tf(u0,VU(),v0.exports);var Q1=J0(),KR=_((f)=>Object.entries(f).filter(([$])=>{const U=$.indexOf(W0);if(U===-1)return!1;return Object.values(Q1.IniSectionType).includes($.substring(0,U))}).reduce(($,[U,G])=>{const w=U.indexOf(W0),E=U.substring(0,w)===Q1.IniSectionType.PROFILE?U.substring(w+1):U;return $[E]=G,$},{...f.default&&{default:f.default}}),"getConfigData"),z1=import.meta.require("path"),AR=O0(),BR="AWS_CONFIG_FILE",SU=_(()=>process.env[BR]||z1.join(AR.getHomeDir(),".aws","config"),"getConfigFilepath"),VR=O0(),HR="AWS_SHARED_CREDENTIALS_FILE",CR=_(()=>process.env[HR]||z1.join(VR.getHomeDir(),".aws","credentials"),"getCredentialsFilepath"),qR=O0(),NR=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,PR=["__proto__","profile __proto__"],Mf=_((f)=>{const $={};let U,G;for(let w of f.split(/\r?\n/)){const E=w.split(/(^|\s)[;#]/)[0].trim();if(E[0]==="["&&E[E.length-1]==="]"){U=void 0,G=void 0;const L=E.substring(1,E.length-1),I=NR.exec(L);if(I){const[,R,,F]=I;if(Object.values(Q1.IniSectionType).includes(R))U=[R,F].join(W0)}else U=L;if(PR.includes(L))throw new Error(`Found invalid profile name "${L}"`)}else if(U){const L=E.indexOf("=");if(![0,-1].includes(L)){const[I,R]=[E.substring(0,L).trim(),E.substring(L+1).trim()];if(R==="")G=I;else{if(G&&w.trimStart()===w)G=void 0;$[U]=$[U]||{};const F=G?[G,I].join(W0):I;$[U][F]=R}}}}return $},"parseIni"),qU=zf(),NU=_(()=>({}),"swallowError"),W0=".",bU=_(async(f={})=>{const{filepath:$=CR(),configFilepath:U=SU()}=f,G=qR.getHomeDir();let E=$;if($.startsWith("~/"))E=z1.join(G,$.slice(2));let W=U;if(U.startsWith("~/"))W=z1.join(G,U.slice(2));const L=await Promise.all([qU.slurpFile(W,{ignoreCache:f.ignoreCache}).then(Mf).then(KR).catch(NU),qU.slurpFile(E,{ignoreCache:f.ignoreCache}).then(Mf).catch(NU)]);return{configFile:L[0],credentialsFile:L[1]}},"loadSharedConfigFiles"),jR=_((f)=>Object.entries(f).filter(([$])=>$.startsWith(Q1.IniSectionType.SSO_SESSION+W0)).reduce(($,[U,G])=>({...$,[U.substring(U.indexOf(W0)+1)]:G}),{}),"getSsoSessionData"),SR=zf(),bR=_(()=>({}),"swallowError"),hR=_(async(f={})=>SR.slurpFile(f.configFilepath??SU()).then(Mf).then(jR).catch(bR),"loadSsoSessionData"),DR=_((...f)=>{const $={};for(let U of f)for(let[G,w]of Object.entries(U))if($[G]!==void 0)Object.assign($[G],w);else $[G]=w;return $},"mergeConfigFiles"),kR=_(async(f)=>{const $=await bU(f);return DR($.configFile,$.credentialsFile)},"parseKnownFiles")});var cU=T((RM,kU)=>{function Kf(f){try{const $=new Set(Array.from(f.match(/([A-Z_]){3,}/g)??[]));return $.delete("CONFIG"),$.delete("CONFIG_PREFIX_SEPARATOR"),$.delete("ENV"),[...$].join(", ")}catch($){return f}}var{defineProperty:M1,getOwnPropertyDescriptor:cR,getOwnPropertyNames:uR}=Object,vR=Object.prototype.hasOwnProperty,K0=(f,$)=>M1(f,"name",{value:$,configurable:!0}),xR=(f,$)=>{for(var U in $)M1(f,U,{get:$[U],enumerable:!0})},_R=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of uR($))if(!vR.call(f,w)&&w!==U)M1(f,w,{get:()=>$[w],enumerable:!(G=cR($,w))||G.enumerable})}return f},yR=(f)=>_R(M1({},"__esModule",{value:!0}),f),DU={};xR(DU,{loadConfig:()=>sR});kU.exports=yR(DU);var x0=Xf();K0(Kf,"getSelectorName");var pR=K0((f,$)=>async()=>{try{const U=f(process.env);if(U===void 0)throw new Error;return U}catch(U){throw new x0.CredentialsProviderError(U.message||`Not found in ENV: ${Kf(f.toString())}`,{logger:$})}},"fromEnv"),hU=Of(),dR=K0((f,{preferredFile:$="config",...U}={})=>async()=>{const G=hU.getProfileName(U),{configFile:w,credentialsFile:E}=await hU.loadSharedConfigFiles(U),W=E[G]||{},L=w[G]||{},I=$==="config"?{...W,...L}:{...L,...W};try{const F=f(I,$==="config"?w:E);if(F===void 0)throw new Error;return F}catch(R){throw new x0.CredentialsProviderError(R.message||`Not found in config files w/ profile [${G}]: ${Kf(f.toString())}`,{logger:U.logger})}},"fromSharedConfigFiles"),gR=K0((f)=>typeof f==="function","isFunction"),nR=K0((f)=>gR(f)?async()=>await f():x0.fromStatic(f),"fromStatic"),sR=K0(({environmentVariableSelector:f,configFileSelector:$,default:U},G={})=>x0.memoize(x0.chain(pR(f),dR($,G),nR(U))),"loadConfig")});var pU=T((_U)=>{Object.defineProperty(_U,"__esModule",{value:!0});_U.getEndpointUrlConfig=void 0;var uU=Of(),vU="AWS_ENDPOINT_URL",xU="endpoint_url",lR=(f)=>({environmentVariableSelector:($)=>{const U=f.split(" ").map((E)=>E.toUpperCase()),G=$[[vU,...U].join("_")];if(G)return G;const w=$[vU];if(w)return w;return},configFileSelector:($,U)=>{if(U&&$.services){const w=U[["services",$.services].join(uU.CONFIG_PREFIX_SEPARATOR)];if(w){const E=f.split(" ").map((L)=>L.toLowerCase()),W=w[[E.join("_"),xU].join(uU.CONFIG_PREFIX_SEPARATOR)];if(W)return W}}const G=$[xU];if(G)return G;return},default:void 0});_U.getEndpointUrlConfig=lR});var nU=T((dU)=>{Object.defineProperty(dU,"__esModule",{value:!0});dU.getEndpointFromConfig=void 0;var mR=cU(),iR=pU(),rR=async(f)=>mR.loadConfig(iR.getEndpointUrlConfig(f))();dU.getEndpointFromConfig=rR});var iU=T((ZM,mU)=>{function lU(f){const $={};if(f=f.replace(/^\?/,""),f)for(let U of f.split("&")){let[G,w=null]=U.split("=");if(G=decodeURIComponent(G),w)w=decodeURIComponent(w);if(!(G in $))$[G]=w;else if(Array.isArray($[G]))$[G].push(w);else $[G]=[$[G],w]}return $}var{defineProperty:T1,getOwnPropertyDescriptor:oR,getOwnPropertyNames:tR}=Object,aR=Object.prototype.hasOwnProperty,eR=(f,$)=>T1(f,"name",{value:$,configurable:!0}),fF=(f,$)=>{for(var U in $)T1(f,U,{get:$[U],enumerable:!0})},$F=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of tR($))if(!aR.call(f,w)&&w!==U)T1(f,w,{get:()=>$[w],enumerable:!(G=oR($,w))||G.enumerable})}return f},UF=(f)=>$F(T1({},"__esModule",{value:!0}),f),sU={};fF(sU,{parseQueryString:()=>lU});mU.exports=UF(sU);eR(lU,"parseQueryString")});var aU=T((YM,tU)=>{var{defineProperty:O1,getOwnPropertyDescriptor:wF,getOwnPropertyNames:GF}=Object,EF=Object.prototype.hasOwnProperty,WF=(f,$)=>O1(f,"name",{value:$,configurable:!0}),LF=(f,$)=>{for(var U in $)O1(f,U,{get:$[U],enumerable:!0})},IF=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of GF($))if(!EF.call(f,w)&&w!==U)O1(f,w,{get:()=>$[w],enumerable:!(G=wF($,w))||G.enumerable})}return f},RF=(f)=>IF(O1({},"__esModule",{value:!0}),f),rU={};LF(rU,{parseUrl:()=>oU});tU.exports=RF(rU);var FF=iU(),oU=WF((f)=>{if(typeof f==="string")return oU(new URL(f));const{hostname:$,pathname:U,port:G,protocol:w,search:E}=f;let W;if(E)W=FF.parseQueryString(E);return{hostname:$,port:G?parseInt(G):void 0,protocol:w,path:U,query:W}},"parseUrl")});var Bf=T((QM,Ew)=>{function Gw(f,$,U){return{applyToStack:(G)=>{G.add(fw(f,U),Uw),G.add($w(f,$),ww)}}}var{defineProperty:K1,getOwnPropertyDescriptor:XF,getOwnPropertyNames:ZF}=Object,YF=Object.prototype.hasOwnProperty,Af=(f,$)=>K1(f,"name",{value:$,configurable:!0}),QF=(f,$)=>{for(var U in $)K1(f,U,{get:$[U],enumerable:!0})},zF=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of ZF($))if(!YF.call(f,w)&&w!==U)K1(f,w,{get:()=>$[w],enumerable:!(G=XF($,w))||G.enumerable})}return f},JF=(f)=>zF(K1({},"__esModule",{value:!0}),f),eU={};QF(eU,{deserializerMiddleware:()=>fw,deserializerMiddlewareOption:()=>Uw,getSerdePlugin:()=>Gw,serializerMiddleware:()=>$w,serializerMiddlewareOption:()=>ww});Ew.exports=JF(eU);var fw=Af((f,$)=>(U)=>async(G)=>{const{response:w}=await U(G);try{const E=await $(w,f);return{response:w,output:E}}catch(E){if(Object.defineProperty(E,"$response",{value:w}),!("$metadata"in E)){if(E.message+="\n Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.",typeof E.$responseBodyText!=="undefined"){if(E.$response)E.$response.body=E.$responseBodyText}}throw E}},"deserializerMiddleware"),$w=Af((f,$)=>(U,G)=>async(w)=>{var E;const W=((E=G.endpointV2)==null?void 0:E.url)&&f.urlParser?async()=>f.urlParser(G.endpointV2.url):f.endpoint;if(!W)throw new Error("No valid endpoint provider available.");const L=await $(w.input,{...f,endpoint:W});return U({...w,request:L})},"serializerMiddleware"),Uw={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},ww={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};Af(Gw,"getSerdePlugin")});var Yw=T((zM,Zw)=>{var{defineProperty:B1,getOwnPropertyDescriptor:MF,getOwnPropertyNames:TF}=Object,OF=Object.prototype.hasOwnProperty,g=(f,$)=>B1(f,"name",{value:$,configurable:!0}),KF=(f,$)=>{for(var U in $)B1(f,U,{get:$[U],enumerable:!0})},AF=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of TF($))if(!OF.call(f,w)&&w!==U)B1(f,w,{get:()=>$[w],enumerable:!(G=MF($,w))||G.enumerable})}return f},BF=(f)=>AF(B1({},"__esModule",{value:!0}),f),Lw={};KF(Lw,{endpointMiddleware:()=>Fw,endpointMiddlewareOptions:()=>Xw,getEndpointFromInstructions:()=>Iw,getEndpointPlugin:()=>hF,resolveEndpointConfig:()=>DF,resolveParams:()=>Rw,toEndpointV1:()=>Vf});Zw.exports=BF(Lw);var VF=g(async(f)=>{const $=(f==null?void 0:f.Bucket)||"";if(typeof f.Bucket==="string")f.Bucket=$.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(PF($)){if(f.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!NF($)||$.indexOf(".")!==-1&&!String(f.Endpoint).startsWith("http:")||$.toLowerCase()!==$||$.length<3)f.ForcePathStyle=!0;if(f.DisableMultiRegionAccessPoints)f.disableMultiRegionAccessPoints=!0,f.DisableMRAP=!0;return f},"resolveParamsForS3"),HF=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,CF=/(\d+\.){3}\d+/,qF=/\.\./,NF=g((f)=>HF.test(f)&&!CF.test(f)&&!qF.test(f),"isDnsCompatibleBucketName"),PF=g((f)=>{const[$,U,G,,,w]=f.split(":"),E=$==="arn"&&f.split(":").length>=6,W=Boolean(E&&U&&G&&w);if(E&&!W)throw new Error(`Invalid ARN: ${f} was an invalid ARN.`);return W},"isArnBucketName"),jF=g((f,$,U)=>{const G=g(async()=>{const w=U[f]??U[$];if(typeof w==="function")return w();return w},"configProvider");if(f==="credentialScope"||$==="CredentialScope")return async()=>{const w=typeof U.credentials==="function"?await U.credentials():U.credentials;return(w==null?void 0:w.credentialScope)??(w==null?void 0:w.CredentialScope)};if(f==="accountId"||$==="AccountId")return async()=>{const w=typeof U.credentials==="function"?await U.credentials():U.credentials;return(w==null?void 0:w.accountId)??(w==null?void 0:w.AccountId)};if(f==="endpoint"||$==="endpoint")return async()=>{const w=await G();if(w&&typeof w==="object"){if("url"in w)return w.url.href;if("hostname"in w){const{protocol:E,hostname:W,port:L,path:I}=w;return`${E}//${W}${L?":"+L:""}${I}`}}return w};return G},"createConfigValueProvider"),SF=nU(),Ww=aU(),Vf=g((f)=>{if(typeof f==="object"){if("url"in f)return Ww.parseUrl(f.url);return f}return Ww.parseUrl(f)},"toEndpointV1"),Iw=g(async(f,$,U,G)=>{if(!U.endpoint){const W=await SF.getEndpointFromConfig(U.serviceId||"");if(W)U.endpoint=()=>Promise.resolve(Vf(W))}const w=await Rw(f,$,U);if(typeof U.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return U.endpointProvider(w,G)},"getEndpointFromInstructions"),Rw=g(async(f,$,U)=>{var G;const w={},E=((G=$==null?void 0:$.getEndpointParameterInstructions)==null?void 0:G.call($))||{};for(let[W,L]of Object.entries(E))switch(L.type){case"staticContextParams":w[W]=L.value;break;case"contextParams":w[W]=f[L.name];break;case"clientContextParams":case"builtInParams":w[W]=await jF(L.name,W,U)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(L))}if(Object.keys(E).length===0)Object.assign(w,U);if(String(U.serviceId).toLowerCase()==="s3")await VF(w);return w},"resolveParams"),A1=c0(),Fw=g(({config:f,instructions:$})=>{return(U,G)=>async(w)=>{var E,W,L;const I=await Iw(w.input,{getEndpointParameterInstructions(){return $}},{...f},G);G.endpointV2=I,G.authSchemes=(E=I.properties)==null?void 0:E.authSchemes;const R=(W=G.authSchemes)==null?void 0:W[0];if(R){G.signing_region=R.signingRegion,G.signing_service=R.signingName;const F=A1.getSmithyContext(G),X=(L=F==null?void 0:F.selectedHttpAuthScheme)==null?void 0:L.httpAuthOption;if(X)X.signingProperties=Object.assign(X.signingProperties||{},{signing_region:R.signingRegion,signingRegion:R.signingRegion,signing_service:R.signingName,signingName:R.signingName,signingRegionSet:R.signingRegionSet},R.properties)}return U({...w})}},"endpointMiddleware"),bF=Bf(),Xw={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:bF.serializerMiddlewareOption.name},hF=g((f,$)=>({applyToStack:(U)=>{U.addRelativeTo(Fw({config:f,instructions:$}),Xw)}}),"getEndpointPlugin"),DF=g((f)=>{const $=f.tls??!0,{endpoint:U}=f,G=U!=null?async()=>Vf(await A1.normalizeProvider(U)()):void 0;return{...f,endpoint:G,tls:$,isCustomEndpoint:!!U,useDualstackEndpoint:A1.normalizeProvider(f.useDualstackEndpoint??!1),useFipsEndpoint:A1.normalizeProvider(f.useFipsEndpoint??!1)}},"resolveEndpointConfig")});var Hf=T((Qw)=>{function cF(f){return f&&f.__esModule?f:{default:f}}function uF(){if(V1>H1.length-16)kF.default.randomFillSync(H1),V1=0;return H1.slice(V1,V1+=16)}Object.defineProperty(Qw,"__esModule",{value:!0});Qw.default=uF;var kF=cF(import.meta.require("crypto")),H1=new Uint8Array(256),V1=H1.length});var Mw=T((zw)=>{Object.defineProperty(zw,"__esModule",{value:!0});zw.default=void 0;var xF=/^(?:[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;zw.default=xF});var _0=T((Tw)=>{function yF(f){return f&&f.__esModule?f:{default:f}}function pF(f){return typeof f==="string"&&_F.default.test(f)}Object.defineProperty(Tw,"__esModule",{value:!0});Tw.default=void 0;var _F=yF(Mw()),dF=pF;Tw.default=dF});var y0=T((Aw)=>{function nF(f){return f&&f.__esModule?f:{default:f}}function Kw(f,$=0){return h[f[$+0]]+h[f[$+1]]+h[f[$+2]]+h[f[$+3]]+"-"+h[f[$+4]]+h[f[$+5]]+"-"+h[f[$+6]]+h[f[$+7]]+"-"+h[f[$+8]]+h[f[$+9]]+"-"+h[f[$+10]]+h[f[$+11]]+h[f[$+12]]+h[f[$+13]]+h[f[$+14]]+h[f[$+15]]}function sF(f,$=0){const U=Kw(f,$);if(!gF.default(U))throw TypeError("Stringified UUID is invalid");return U}Object.defineProperty(Aw,"__esModule",{value:!0});Aw.default=void 0;Aw.unsafeStringify=Kw;var gF=nF(_0()),h=[];for(let f=0;f<256;++f)h.push((f+256).toString(16).slice(1));var lF=sF;Aw.default=lF});var qw=T((Hw)=>{function oF(f){return f&&f.__esModule?f:{default:f}}function tF(f,$,U){let G=$&&U||0;const w=$||new Array(16);f=f||{};let E=f.node||Vw,W=f.clockseq!==void 0?f.clockseq:Cf;if(E==null||W==null){const Y=f.random||(f.rng||iF.default)();if(E==null)E=Vw=[Y[0]|1,Y[1],Y[2],Y[3],Y[4],Y[5]];if(W==null)W=Cf=(Y[6]<<8|Y[7])&16383}let L=f.msecs!==void 0?f.msecs:Date.now(),I=f.nsecs!==void 0?f.nsecs:Nf+1;const R=L-qf+(I-Nf)/1e4;if(R<0&&f.clockseq===void 0)W=W+1&16383;if((R<0||L>qf)&&f.nsecs===void 0)I=0;if(I>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");qf=L,Nf=I,Cf=W,L+=12219292800000;const F=((L&268435455)*1e4+I)%4294967296;w[G++]=F>>>24&255,w[G++]=F>>>16&255,w[G++]=F>>>8&255,w[G++]=F&255;const X=L/4294967296*1e4&268435455;w[G++]=X>>>8&255,w[G++]=X&255,w[G++]=X>>>24&15|16,w[G++]=X>>>16&255,w[G++]=W>>>8|128,w[G++]=W&255;for(let Y=0;Y<6;++Y)w[G+Y]=E[Y];return $||rF.unsafeStringify(w)}Object.defineProperty(Hw,"__esModule",{value:!0});Hw.default=void 0;var iF=oF(Hf()),rF=y0(),Vw,Cf,qf=0,Nf=0,aF=tF;Hw.default=aF});var Pf=T((Nw)=>{function f2(f){return f&&f.__esModule?f:{default:f}}function $2(f){if(!eF.default(f))throw TypeError("Invalid UUID");let $;const U=new Uint8Array(16);return U[0]=($=parseInt(f.slice(0,8),16))>>>24,U[1]=$>>>16&255,U[2]=$>>>8&255,U[3]=$&255,U[4]=($=parseInt(f.slice(9,13),16))>>>8,U[5]=$&255,U[6]=($=parseInt(f.slice(14,18),16))>>>8,U[7]=$&255,U[8]=($=parseInt(f.slice(19,23),16))>>>8,U[9]=$&255,U[10]=($=parseInt(f.slice(24,36),16))/1099511627776&255,U[11]=$/4294967296&255,U[12]=$>>>24&255,U[13]=$>>>16&255,U[14]=$>>>8&255,U[15]=$&255,U}Object.defineProperty(Nw,"__esModule",{value:!0});Nw.default=void 0;var eF=f2(_0()),U2=$2;Nw.default=U2});var jf=T((bw)=>{function E2(f){return f&&f.__esModule?f:{default:f}}function W2(f){f=unescape(encodeURIComponent(f));const $=[];for(let U=0;U<f.length;++U)$.push(f.charCodeAt(U));return $}function L2(f,$,U){function G(w,E,W,L){var I;if(typeof w==="string")w=W2(w);if(typeof E==="string")E=G2.default(E);if(((I=E)===null||I===void 0?void 0:I.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let R=new Uint8Array(16+w.length);if(R.set(E),R.set(w,E.length),R=U(R),R[6]=R[6]&15|$,R[8]=R[8]&63|128,W){L=L||0;for(let F=0;F<16;++F)W[L+F]=R[F];return W}return w2.unsafeStringify(R)}try{G.name=f}catch(w){}return G.DNS=jw,G.URL=Sw,G}Object.defineProperty(bw,"__esModule",{value:!0});bw.URL=bw.DNS=void 0;bw.default=L2;var w2=y0(),G2=E2(Pf()),jw="6ba7b810-9dad-11d1-80b4-00c04fd430c8";bw.DNS=jw;var Sw="6ba7b811-9dad-11d1-80b4-00c04fd430c8";bw.URL=Sw});var cw=T((Dw)=>{function X2(f){return f&&f.__esModule?f:{default:f}}function Z2(f){if(Array.isArray(f))f=Buffer.from(f);else if(typeof f==="string")f=Buffer.from(f,"utf8");return F2.default.createHash("md5").update(f).digest()}Object.defineProperty(Dw,"__esModule",{value:!0});Dw.default=void 0;var F2=X2(import.meta.require("crypto")),Y2=Z2;Dw.default=Y2});var _w=T((vw)=>{function uw(f){return f&&f.__esModule?f:{default:f}}Object.defineProperty(vw,"__esModule",{value:!0});vw.default=void 0;var Q2=uw(jf()),z2=uw(cw()),J2=Q2.default("v3",48,z2.default),M2=J2;vw.default=M2});var dw=T((yw)=>{function O2(f){return f&&f.__esModule?f:{default:f}}Object.defineProperty(yw,"__esModule",{value:!0});yw.default=void 0;var T2=O2(import.meta.require("crypto")),K2={randomUUID:T2.default.randomUUID};yw.default=K2});var mw=T((sw)=>{function nw(f){return f&&f.__esModule?f:{default:f}}function V2(f,$,U){if(gw.default.randomUUID&&!$&&!f)return gw.default.randomUUID();f=f||{};const G=f.random||(f.rng||A2.default)();if(G[6]=G[6]&15|64,G[8]=G[8]&63|128,$){U=U||0;for(let w=0;w<16;++w)$[U+w]=G[w];return $}return B2.unsafeStringify(G)}Object.defineProperty(sw,"__esModule",{value:!0});sw.default=void 0;var gw=nw(dw()),A2=nw(Hf()),B2=y0(),H2=V2;sw.default=H2});var ow=T((iw)=>{function q2(f){return f&&f.__esModule?f:{default:f}}function N2(f){if(Array.isArray(f))f=Buffer.from(f);else if(typeof f==="string")f=Buffer.from(f,"utf8");return C2.default.createHash("sha1").update(f).digest()}Object.defineProperty(iw,"__esModule",{value:!0});iw.default=void 0;var C2=q2(import.meta.require("crypto")),P2=N2;iw.default=P2});var fG=T((aw)=>{function tw(f){return f&&f.__esModule?f:{default:f}}Object.defineProperty(aw,"__esModule",{value:!0});aw.default=void 0;var j2=tw(jf()),S2=tw(ow()),b2=j2.default("v5",80,S2.default),h2=b2;aw.default=h2});var wG=T(($G)=>{Object.defineProperty($G,"__esModule",{value:!0});$G.default=void 0;var D2="00000000-0000-0000-0000-000000000000";$G.default=D2});var WG=T((GG)=>{function c2(f){return f&&f.__esModule?f:{default:f}}function u2(f){if(!k2.default(f))throw TypeError("Invalid UUID");return parseInt(f.slice(14,15),16)}Object.defineProperty(GG,"__esModule",{value:!0});GG.default=void 0;var k2=c2(_0()),v2=u2;GG.default=v2});var Sf=T((n)=>{function o(f){return f&&f.__esModule?f:{default:f}}Object.defineProperty(n,"__esModule",{value:!0});Object.defineProperty(n,"NIL",{enumerable:!0,get:function(){return d2.default}});Object.defineProperty(n,"parse",{enumerable:!0,get:function(){return l2.default}});Object.defineProperty(n,"stringify",{enumerable:!0,get:function(){return s2.default}});Object.defineProperty(n,"v1",{enumerable:!0,get:function(){return x2.default}});Object.defineProperty(n,"v3",{enumerable:!0,get:function(){return _2.default}});Object.defineProperty(n,"v4",{enumerable:!0,get:function(){return y2.default}});Object.defineProperty(n,"v5",{enumerable:!0,get:function(){return p2.default}});Object.defineProperty(n,"validate",{enumerable:!0,get:function(){return n2.default}});Object.defineProperty(n,"version",{enumerable:!0,get:function(){return g2.default}});var x2=o(qw()),_2=o(_w()),y2=o(mw()),p2=o(fG()),d2=o(wG()),g2=o(WG()),n2=o(_0()),s2=o(y0()),l2=o(Pf())});var bf=T((hM,FG)=>{var{defineProperty:C1,getOwnPropertyDescriptor:m2,getOwnPropertyNames:i2}=Object,r2=Object.prototype.hasOwnProperty,A0=(f,$)=>C1(f,"name",{value:$,configurable:!0}),o2=(f,$)=>{for(var U in $)C1(f,U,{get:$[U],enumerable:!0})},t2=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of i2($))if(!r2.call(f,w)&&w!==U)C1(f,w,{get:()=>$[w],enumerable:!(G=m2($,w))||G.enumerable})}return f},a2=(f)=>t2(C1({},"__esModule",{value:!0}),f),LG={};o2(LG,{isClockSkewCorrectedError:()=>IG,isClockSkewError:()=>E4,isRetryableByTrait:()=>G4,isServerError:()=>L4,isThrottlingError:()=>W4,isTransientError:()=>RG});FG.exports=a2(LG);var e2=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],f4=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],$4=["TimeoutError","RequestTimeout","RequestTimeoutException"],U4=[500,502,503,504],w4=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],G4=A0((f)=>f.$retryable!==void 0,"isRetryableByTrait"),E4=A0((f)=>e2.includes(f.name),"isClockSkewError"),IG=A0((f)=>{var $;return($=f.$metadata)==null?void 0:$.clockSkewCorrected},"isClockSkewCorrectedError"),W4=A0((f)=>{var $,U;return(($=f.$metadata)==null?void 0:$.httpStatusCode)===429||f4.includes(f.name)||((U=f.$retryable)==null?void 0:U.throttling)==!0},"isThrottlingError"),RG=A0((f)=>{var $;return IG(f)||$4.includes(f.name)||w4.includes((f==null?void 0:f.code)||"")||U4.includes((($=f.$metadata)==null?void 0:$.httpStatusCode)||0)},"isTransientError"),L4=A0((f)=>{var $;if((($=f.$metadata)==null?void 0:$.httpStatusCode)!==void 0){const U=f.$metadata.httpStatusCode;if(500<=U&&U<=599&&!RG(f))return!0;return!1}return!1},"isServerError")});var HG=T((DM,VG)=>{var{defineProperty:q1,getOwnPropertyDescriptor:I4,getOwnPropertyNames:R4}=Object,F4=Object.prototype.hasOwnProperty,s=(f,$)=>q1(f,"name",{value:$,configurable:!0}),X4=(f,$)=>{for(var U in $)q1(f,U,{get:$[U],enumerable:!0})},Z4=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of R4($))if(!F4.call(f,w)&&w!==U)q1(f,w,{get:()=>$[w],enumerable:!(G=I4($,w))||G.enumerable})}return f},Y4=(f)=>Z4(q1({},"__esModule",{value:!0}),f),ZG={};X4(ZG,{AdaptiveRetryStrategy:()=>O4,ConfiguredRetryStrategy:()=>K4,DEFAULT_MAX_ATTEMPTS:()=>hf,DEFAULT_RETRY_DELAY_BASE:()=>p0,DEFAULT_RETRY_MODE:()=>Q4,DefaultRateLimiter:()=>zG,INITIAL_RETRY_TOKENS:()=>Df,INVOCATION_ID_HEADER:()=>J4,MAXIMUM_RETRY_DELAY:()=>kf,NO_RETRY_INCREMENT:()=>OG,REQUEST_HEADER:()=>M4,RETRY_COST:()=>MG,RETRY_MODES:()=>YG,StandardRetryStrategy:()=>cf,THROTTLING_RETRY_DELAY_BASE:()=>JG,TIMEOUT_RETRY_COST:()=>TG});VG.exports=Y4(ZG);var YG=((f)=>{return f.STANDARD="standard",f.ADAPTIVE="adaptive",f})(YG||{}),hf=3,Q4="standard",z4=bf(),QG=class f{constructor($){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=($==null?void 0:$.beta)??0.7,this.minCapacity=($==null?void 0:$.minCapacity)??1,this.minFillRate=($==null?void 0:$.minFillRate)??0.5,this.scaleConstant=($==null?void 0:$.scaleConstant)??0.4,this.smooth=($==null?void 0:$.smooth)??0.8;const U=this.getCurrentTimeInSeconds();this.lastThrottleTime=U,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1000}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket($){if(!this.enabled)return;if(this.refillTokenBucket(),$>this.currentCapacity){const U=($-this.currentCapacity)/this.fillRate*1000;await new Promise((G)=>setTimeout(G,U))}this.currentCapacity=this.currentCapacity-$}refillTokenBucket(){const $=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=$;return}const U=($-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+U),this.lastTimestamp=$}updateClientSendingRate($){let U;if(this.updateMeasuredRate(),z4.isThrottlingError($)){const w=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=w,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),U=this.cubicThrottle(w),this.enableTokenBucket()}else this.calculateTimeWindow(),U=this.cubicSuccess(this.getCurrentTimeInSeconds());const G=Math.min(U,2*this.measuredTxRate);this.updateTokenBucketRate(G)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle($){return this.getPrecise($*this.beta)}cubicSuccess($){return this.getPrecise(this.scaleConstant*Math.pow($-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate($){this.refillTokenBucket(),this.fillRate=Math.max($,this.minFillRate),this.maxCapacity=Math.max($,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const $=this.getCurrentTimeInSeconds(),U=Math.floor($*2)/2;if(this.requestCount++,U>this.lastTxRateBucket){const G=this.requestCount/(U-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(G*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=U}}getPrecise($){return parseFloat($.toFixed(8))}};s(QG,"DefaultRateLimiter");var zG=QG,p0=100,kf=20000,JG=500,Df=500,MG=5,TG=10,OG=1,J4="amz-sdk-invocation-id",M4="amz-sdk-request",T4=s(()=>{let f=p0;return{computeNextBackoffDelay:s((G)=>{return Math.floor(Math.min(kf,Math.random()*2**G*f))},"computeNextBackoffDelay"),setDelayBase:s((G)=>{f=G},"setDelayBase")}},"getDefaultRetryBackoffStrategy"),XG=s(({retryDelay:f,retryCount:$,retryCost:U})=>{return{getRetryCount:s(()=>$,"getRetryCount"),getRetryDelay:s(()=>Math.min(kf,f),"getRetryDelay"),getRetryCost:s(()=>U,"getRetryCost")}},"createDefaultRetryToken"),KG=class f{constructor($){this.maxAttempts=$,this.mode="standard",this.capacity=Df,this.retryBackoffStrategy=T4(),this.maxAttemptsProvider=typeof $==="function"?$:async()=>$}async acquireInitialRetryToken($){return XG({retryDelay:p0,retryCount:0})}async refreshRetryTokenForRetry($,U){const G=await this.getMaxAttempts();if(this.shouldRetry($,U,G)){const w=U.errorType;this.retryBackoffStrategy.setDelayBase(w==="THROTTLING"?JG:p0);const E=this.retryBackoffStrategy.computeNextBackoffDelay($.getRetryCount()),W=U.retryAfterHint?Math.max(U.retryAfterHint.getTime()-Date.now()||0,E):E,L=this.getCapacityCost(w);return this.capacity-=L,XG({retryDelay:W,retryCount:$.getRetryCount()+1,retryCost:L})}throw new Error("No retry token available")}recordSuccess($){this.capacity=Math.max(Df,this.capacity+($.getRetryCost()??OG))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch($){return console.warn(`Max attempts provider could not resolve. Using default of ${hf}`),hf}}shouldRetry($,U,G){return $.getRetryCount()+1<G&&this.capacity>=this.getCapacityCost(U.errorType)&&this.isRetryableError(U.errorType)}getCapacityCost($){return $==="TRANSIENT"?TG:MG}isRetryableError($){return $==="THROTTLING"||$==="TRANSIENT"}};s(KG,"StandardRetryStrategy");var cf=KG,AG=class f{constructor($,U){this.maxAttemptsProvider=$,this.mode="adaptive";const{rateLimiter:G}=U??{};this.rateLimiter=G??new zG,this.standardRetryStrategy=new cf($)}async acquireInitialRetryToken($){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken($)}async refreshRetryTokenForRetry($,U){return this.rateLimiter.updateClientSendingRate(U),this.standardRetryStrategy.refreshRetryTokenForRetry($,U)}recordSuccess($){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess($)}};s(AG,"AdaptiveRetryStrategy");var O4=AG,BG=class f extends cf{constructor($,U=p0){super(typeof $==="function"?$:async()=>$);if(typeof U==="number")this.computeNextBackoffDelay=()=>U;else this.computeNextBackoffDelay=U}async refreshRetryTokenForRetry($,U){const G=await super.refreshRetryTokenForRetry($,U);return G.getRetryDelay=()=>this.computeNextBackoffDelay(G.getRetryCount()),G}};s(BG,"ConfiguredRetryStrategy");var K4=BG});var jG=T((kM,PG)=>{var{defineProperty:N1,getOwnPropertyDescriptor:A4,getOwnPropertyNames:B4}=Object,V4=Object.prototype.hasOwnProperty,y=(f,$)=>N1(f,"name",{value:$,configurable:!0}),H4=(f,$)=>{for(var U in $)N1(f,U,{get:$[U],enumerable:!0})},C4=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of B4($))if(!V4.call(f,w)&&w!==U)N1(f,w,{get:()=>$[w],enumerable:!(G=A4($,w))||G.enumerable})}return f},q4=(f)=>C4(N1({},"__esModule",{value:!0}),f),NG={};H4(NG,{constructStack:()=>uf});PG.exports=q4(NG);var L0=y((f,$)=>{const U=[];if(f)U.push(f);if($)for(let G of $)U.push(G);return U},"getAllAliases"),f0=y((f,$)=>{return`${f||"anonymous"}${$&&$.length>0?` (a.k.a. ${$.join(",")})`:""}`},"getMiddlewareNameWithAliases"),uf=y(()=>{let f=[],$=[],U=!1;const G=new Set,w=y((X)=>X.sort((Y,Z)=>CG[Z.step]-CG[Y.step]||qG[Z.priority||"normal"]-qG[Y.priority||"normal"]),"sort"),E=y((X)=>{let Y=!1;const Z=y((Q)=>{const M=L0(Q.name,Q.aliases);if(M.includes(X)){Y=!0;for(let J of M)G.delete(J);return!1}return!0},"filterCb");return f=f.filter(Z),$=$.filter(Z),Y},"removeByName"),W=y((X)=>{let Y=!1;const Z=y((Q)=>{if(Q.middleware===X){Y=!0;for(let M of L0(Q.name,Q.aliases))G.delete(M);return!1}return!0},"filterCb");return f=f.filter(Z),$=$.filter(Z),Y},"removeByReference"),L=y((X)=>{var Y;return f.forEach((Z)=>{X.add(Z.middleware,{...Z})}),$.forEach((Z)=>{X.addRelativeTo(Z.middleware,{...Z})}),(Y=X.identifyOnResolve)==null||Y.call(X,F.identifyOnResolve()),X},"cloneTo"),I=y((X)=>{const Y=[];return X.before.forEach((Z)=>{if(Z.before.length===0&&Z.after.length===0)Y.push(Z);else Y.push(...I(Z))}),Y.push(X),X.after.reverse().forEach((Z)=>{if(Z.before.length===0&&Z.after.length===0)Y.push(Z);else Y.push(...I(Z))}),Y},"expandRelativeMiddlewareList"),R=y((X=!1)=>{const Y=[],Z=[],Q={};return f.forEach((J)=>{const O={...J,before:[],after:[]};for(let K of L0(O.name,O.aliases))Q[K]=O;Y.push(O)}),$.forEach((J)=>{const O={...J,before:[],after:[]};for(let K of L0(O.name,O.aliases))Q[K]=O;Z.push(O)}),Z.forEach((J)=>{if(J.toMiddleware){const O=Q[J.toMiddleware];if(O===void 0){if(X)return;throw new Error(`${J.toMiddleware} is not found when adding ${f0(J.name,J.aliases)} middleware ${J.relation} ${J.toMiddleware}`)}if(J.relation==="after")O.after.push(J);if(J.relation==="before")O.before.push(J)}}),w(Y).map(I).reduce((J,O)=>{return J.push(...O),J},[])},"getMiddlewareList"),F={add:(X,Y={})=>{const{name:Z,override:Q,aliases:M}=Y,J={step:"initialize",priority:"normal",middleware:X,...Y},O=L0(Z,M);if(O.length>0){if(O.some((K)=>G.has(K))){if(!Q)throw new Error(`Duplicate middleware name '${f0(Z,M)}'`);for(let K of O){const A=f.findIndex((j)=>{var t;return j.name===K||((t=j.aliases)==null?void 0:t.some((G0)=>G0===K))});if(A===-1)continue;const B=f[A];if(B.step!==J.step||J.priority!==B.priority)throw new Error(`"${f0(B.name,B.aliases)}" middleware with ${B.priority} priority in ${B.step} step cannot be overridden by "${f0(Z,M)}" middleware with ${J.priority} priority in ${J.step} step.`);f.splice(A,1)}}for(let K of O)G.add(K)}f.push(J)},addRelativeTo:(X,Y)=>{const{name:Z,override:Q,aliases:M}=Y,J={middleware:X,...Y},O=L0(Z,M);if(O.length>0){if(O.some((K)=>G.has(K))){if(!Q)throw new Error(`Duplicate middleware name '${f0(Z,M)}'`);for(let K of O){const A=$.findIndex((j)=>{var t;return j.name===K||((t=j.aliases)==null?void 0:t.some((G0)=>G0===K))});if(A===-1)continue;const B=$[A];if(B.toMiddleware!==J.toMiddleware||B.relation!==J.relation)throw new Error(`"${f0(B.name,B.aliases)}" middleware ${B.relation} "${B.toMiddleware}" middleware cannot be overridden by "${f0(Z,M)}" middleware ${J.relation} "${J.toMiddleware}" middleware.`);$.splice(A,1)}}for(let K of O)G.add(K)}$.push(J)},clone:()=>L(uf()),use:(X)=>{X.applyToStack(F)},remove:(X)=>{if(typeof X==="string")return E(X);else return W(X)},removeByTag:(X)=>{let Y=!1;const Z=y((Q)=>{const{tags:M,name:J,aliases:O}=Q;if(M&&M.includes(X)){const K=L0(J,O);for(let A of K)G.delete(A);return Y=!0,!1}return!0},"filterCb");return f=f.filter(Z),$=$.filter(Z),Y},concat:(X)=>{var Y;const Z=L(uf());return Z.use(X),Z.identifyOnResolve(U||Z.identifyOnResolve()||(((Y=X.identifyOnResolve)==null?void 0:Y.call(X))??!1)),Z},applyToStack:L,identify:()=>{return R(!0).map((X)=>{const Y=X.step??X.relation+" "+X.toMiddleware;return f0(X.name,X.aliases)+" - "+Y})},identifyOnResolve(X){if(typeof X==="boolean")U=X;return U},resolve:(X,Y)=>{for(let Z of R().map((Q)=>Q.middleware).reverse())X=Z(X,Y);if(U)console.log(F.identify());return X}};return F},"constructStack"),CG={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},qG={high:3,normal:2,low:1}});var hG=T((SG)=>{Object.defineProperty(SG,"__esModule",{value:!0});SG.getAwsChunkedEncodingStream=void 0;var N4=import.meta.require("stream"),P4=(f,$)=>{const{base64Encoder:U,bodyLengthChecker:G,checksumAlgorithmFn:w,checksumLocationName:E,streamHasher:W}=$,L=U!==void 0&&w!==void 0&&E!==void 0&&W!==void 0,I=L?W(w,f):void 0,R=new N4.Readable({read:()=>{}});return f.on("data",(F)=>{const X=G(F)||0;R.push(`${X.toString(16)}\r\n`),R.push(F),R.push("\r\n")}),f.on("end",async()=>{if(R.push("0\r\n"),L){const F=U(await I);R.push(`${E}:${F}\r\n`),R.push("\r\n")}R.push(null)}),R};SG.getAwsChunkedEncodingStream=P4});var rG=T((uM,iG)=>{async function _f(f,$,U=DG){const G=$.headers??{},w=G.Expect||G.expect;let E=-1,W=!1;if(w==="100-continue")await Promise.race([new Promise((L)=>{E=Number(setTimeout(L,Math.max(DG,U)))}),new Promise((L)=>{f.on("continue",()=>{clearTimeout(E),L()}),f.on("error",()=>{W=!0,clearTimeout(E),L()})})]);if(!W)pG(f,$.body)}function pG(f,$){if($ instanceof yG.Readable){$.pipe(f);return}if($){if(Buffer.isBuffer($)||typeof $==="string"){f.end($);return}const U=$;if(typeof U==="object"&&U.buffer&&typeof U.byteOffset==="number"&&typeof U.byteLength==="number"){f.end(Buffer.from(U.buffer,U.byteOffset,U.byteLength));return}f.end(Buffer.from($));return}f.end()}async function mG(f){const $=[],U=f.getReader();let G=!1,w=0;while(!G){const{done:L,value:I}=await U.read();if(I)$.push(I),w+=I.length;G=L}const E=new Uint8Array(w);let W=0;for(let L of $)E.set(L,W),W+=L.length;return E}var{create:S4,defineProperty:d0,getOwnPropertyDescriptor:b4,getOwnPropertyNames:h4,getPrototypeOf:D4}=Object,k4=Object.prototype.hasOwnProperty,N=(f,$)=>d0(f,"name",{value:$,configurable:!0}),c4=(f,$)=>{for(var U in $)d0(f,U,{get:$[U],enumerable:!0})},cG=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of h4($))if(!k4.call(f,w)&&w!==U)d0(f,w,{get:()=>$[w],enumerable:!(G=b4($,w))||G.enumerable})}return f},u4=(f,$,U)=>(U=f!=null?S4(D4(f)):{},cG($||!f||!f.__esModule?d0(U,"default",{value:f,enumerable:!0}):U,f)),v4=(f)=>cG(d0({},"__esModule",{value:!0}),f),uG={};c4(uG,{DEFAULT_REQUEST_TIMEOUT:()=>d4,NodeHttp2Handler:()=>m4,NodeHttpHandler:()=>g4,streamCollector:()=>r4});iG.exports=v4(uG);var vG=I0(),xG=j4(),vf=import.meta.require("http"),xf=import.meta.require("https"),x4=["ECONNRESET","EPIPE","ETIMEDOUT"],_G=N((f)=>{const $={};for(let U of Object.keys(f)){const G=f[U];$[U]=Array.isArray(G)?G.join(","):G}return $},"getTransformedHeaders"),_4=N((f,$,U=0)=>{if(!U)return;const G=setTimeout(()=>{f.destroy(),$(Object.assign(new Error(`Socket timed out without establishing a connection within ${U} ms`),{name:"TimeoutError"}))},U);f.on("socket",(w)=>{if(w.connecting)w.on("connect",()=>{clearTimeout(G)});else clearTimeout(G)})},"setConnectionTimeout"),y4=N((f,{keepAlive:$,keepAliveMsecs:U})=>{if($!==!0)return;f.on("socket",(G)=>{G.setKeepAlive($,U||0)})},"setSocketKeepAlive"),p4=N((f,$,U=0)=>{f.setTimeout(U,()=>{f.destroy(),$(Object.assign(new Error(`Connection timed out after ${U} ms`),{name:"TimeoutError"}))})},"setSocketTimeout"),yG=import.meta.require("stream"),DG=1000;N(_f,"writeRequestBody");N(pG,"writeBody");var d4=0,dG=class f{constructor($){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((U,G)=>{if(typeof $==="function")$().then((w)=>{U(this.resolveDefaultConfig(w))}).catch(G);else U(this.resolveDefaultConfig($))})}static create($){if(typeof($==null?void 0:$.handle)==="function")return $;return new f($)}static checkSocketUsage($,U,G=console){var w,E,W;const{sockets:L,requests:I,maxSockets:R}=$;if(typeof R!=="number"||R===1/0)return U;const F=15000;if(Date.now()-F<U)return U;if(L&&I)for(let X in L){const Y=((w=L[X])==null?void 0:w.length)??0,Z=((E=I[X])==null?void 0:E.length)??0;if(Y>=R&&Z>=2*R)return(W=G==null?void 0:G.warn)==null||W.call(G,`@smithy/node-http-handler:WARN - socket usage at capacity=${Y} and ${Z} additional requests are enqueued.
2
- See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
3
- or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return U}resolveDefaultConfig($){const{requestTimeout:U,connectionTimeout:G,socketTimeout:w,httpAgent:E,httpsAgent:W}=$||{};return{connectionTimeout:G,requestTimeout:U??w,httpAgent:(()=>{if(E instanceof vf.Agent||typeof(E==null?void 0:E.destroy)==="function")return E;return new vf.Agent({keepAlive:!0,maxSockets:50,...E})})(),httpsAgent:(()=>{if(W instanceof xf.Agent||typeof(W==null?void 0:W.destroy)==="function")return W;return new xf.Agent({keepAlive:!0,maxSockets:50,...W})})(),logger:console}}destroy(){var $,U,G,w;(U=($=this.config)==null?void 0:$.httpAgent)==null||U.destroy(),(w=(G=this.config)==null?void 0:G.httpsAgent)==null||w.destroy()}async handle($,{abortSignal:U}={}){if(!this.config)this.config=await this.configProvider;let G;return new Promise((w,E)=>{let W=void 0;const L=N(async(K)=>{await W,clearTimeout(G),w(K)},"resolve"),I=N(async(K)=>{await W,clearTimeout(G),E(K)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(U==null?void 0:U.aborted){const K=new Error("Request aborted");K.name="AbortError",I(K);return}const R=$.protocol==="https:",F=R?this.config.httpsAgent:this.config.httpAgent;G=setTimeout(()=>{this.socketWarningTimestamp=f.checkSocketUsage(F,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000));const X=xG.buildQueryString($.query||{});let Y=void 0;if($.username!=null||$.password!=null){const K=$.username??"",A=$.password??"";Y=`${K}:${A}`}let Z=$.path;if(X)Z+=`?${X}`;if($.fragment)Z+=`#${$.fragment}`;const Q={headers:$.headers,host:$.hostname,method:$.method,path:Z,port:$.port,agent:F,auth:Y},J=(R?xf.request:vf.request)(Q,(K)=>{const A=new vG.HttpResponse({statusCode:K.statusCode||-1,reason:K.statusMessage,headers:_G(K.headers),body:K});L({response:A})});if(J.on("error",(K)=>{if(x4.includes(K.code))I(Object.assign(K,{name:"TimeoutError"}));else I(K)}),_4(J,I,this.config.connectionTimeout),p4(J,I,this.config.requestTimeout),U){const K=N(()=>{J.destroy();const A=new Error("Request aborted");A.name="AbortError",I(A)},"onAbort");if(typeof U.addEventListener==="function"){const A=U;A.addEventListener("abort",K,{once:!0}),J.once("close",()=>A.removeEventListener("abort",K))}else U.onabort=K}const O=Q.agent;if(typeof O==="object"&&"keepAlive"in O)y4(J,{keepAlive:O.keepAlive,keepAliveMsecs:O.keepAliveMsecs});W=_f(J,$,this.config.requestTimeout).catch((K)=>{return clearTimeout(G),E(K)})})}updateHttpClientConfig($,U){this.config=void 0,this.configProvider=this.configProvider.then((G)=>{return{...G,[$]:U}})}httpHandlerConfigs(){return this.config??{}}};N(dG,"NodeHttpHandler");var g4=dG,kG=import.meta.require("http2"),n4=u4(import.meta.require("http2")),gG=class f{constructor($){this.sessions=[],this.sessions=$??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast($){this.sessions.push($)}contains($){return this.sessions.includes($)}remove($){this.sessions=this.sessions.filter((U)=>U!==$)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy($){for(let U of this.sessions)if(U===$){if(!U.destroyed)U.destroy()}}};N(gG,"NodeHttp2ConnectionPool");var s4=gG,nG=class f{constructor($){if(this.sessionCache=new Map,this.config=$,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease($,U){const G=this.getUrlString($),w=this.sessionCache.get(G);if(w){const I=w.poll();if(I&&!this.config.disableConcurrency)return I}const E=n4.default.connect(G);if(this.config.maxConcurrency)E.settings({maxConcurrentStreams:this.config.maxConcurrency},(I)=>{if(I)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+$.destination.toString())});E.unref();const W=N(()=>{E.destroy(),this.deleteSession(G,E)},"destroySessionCb");if(E.on("goaway",W),E.on("error",W),E.on("frameError",W),E.on("close",()=>this.deleteSession(G,E)),U.requestTimeout)E.setTimeout(U.requestTimeout,W);const L=this.sessionCache.get(G)||new s4;return L.offerLast(E),this.sessionCache.set(G,L),E}deleteSession($,U){const G=this.sessionCache.get($);if(!G)return;if(!G.contains(U))return;G.remove(U),this.sessionCache.set($,G)}release($,U){var G;const w=this.getUrlString($);(G=this.sessionCache.get(w))==null||G.offerLast(U)}destroy(){for(let[$,U]of this.sessionCache){for(let G of U){if(!G.destroyed)G.destroy();U.remove(G)}this.sessionCache.delete($)}}setMaxConcurrentStreams($){if(this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=$}setDisableConcurrentStreams($){this.config.disableConcurrency=$}getUrlString($){return $.destination.toString()}};N(nG,"NodeHttp2ConnectionManager");var l4=nG,sG=class f{constructor($){this.metadata={handlerProtocol:"h2"},this.connectionManager=new l4({}),this.configProvider=new Promise((U,G)=>{if(typeof $==="function")$().then((w)=>{U(w||{})}).catch(G);else U($||{})})}static create($){if(typeof($==null?void 0:$.handle)==="function")return $;return new f($)}destroy(){this.connectionManager.destroy()}async handle($,{abortSignal:U}={}){if(!this.config){if(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams)this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams)}const{requestTimeout:G,disableConcurrentStreams:w}=this.config;return new Promise((E,W)=>{var L;let I=!1,R=void 0;const F=N(async(q)=>{await R,E(q)},"resolve"),X=N(async(q)=>{await R,W(q)},"reject");if(U==null?void 0:U.aborted){I=!0;const q=new Error("Request aborted");q.name="AbortError",X(q);return}const{hostname:Y,method:Z,port:Q,protocol:M,query:J}=$;let O="";if($.username!=null||$.password!=null){const q=$.username??"",d=$.password??"";O=`${q}:${d}@`}const K=`${M}//${O}${Y}${Q?`:${Q}`:""}`,A={destination:new URL(K)},B=this.connectionManager.lease(A,{requestTimeout:(L=this.config)==null?void 0:L.sessionTimeout,disableConcurrentStreams:w||!1}),j=N((q)=>{if(w)this.destroySession(B);I=!0,X(q)},"rejectWithDestroy"),t=xG.buildQueryString(J||{});let G0=$.path;if(t)G0+=`?${t}`;if($.fragment)G0+=`#${$.fragment}`;const u=B.request({...$.headers,[kG.constants.HTTP2_HEADER_PATH]:G0,[kG.constants.HTTP2_HEADER_METHOD]:Z});if(B.ref(),u.on("response",(q)=>{const d=new vG.HttpResponse({statusCode:q[":status"]||-1,headers:_G(q),body:u});if(I=!0,F({response:d}),w)B.close(),this.connectionManager.deleteSession(K,B)}),G)u.setTimeout(G,()=>{u.close();const q=new Error(`Stream timed out because of no activity for ${G} ms`);q.name="TimeoutError",j(q)});if(U){const q=N(()=>{u.close();const d=new Error("Request aborted");d.name="AbortError",j(d)},"onAbort");if(typeof U.addEventListener==="function"){const d=U;d.addEventListener("abort",q,{once:!0}),u.once("close",()=>d.removeEventListener("abort",q))}else U.onabort=q}u.on("frameError",(q,d,ZI)=>{j(new Error(`Frame type id ${q} in stream id ${ZI} has failed with code ${d}.`))}),u.on("error",j),u.on("aborted",()=>{j(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${u.rstCode}.`))}),u.on("close",()=>{if(B.unref(),w)B.destroy();if(!I)j(new Error("Unexpected error: http2 request did not get a response"))}),R=_f(u,$,G)})}updateHttpClientConfig($,U){this.config=void 0,this.configProvider=this.configProvider.then((G)=>{return{...G,[$]:U}})}httpHandlerConfigs(){return this.config??{}}destroySession($){if(!$.destroyed)$.destroy()}};N(sG,"NodeHttp2Handler");var m4=sG,lG=class f extends yG.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}_write($,U,G){this.bufferedBytes.push($),G()}};N(lG,"Collector");var i4=lG,r4=N((f)=>{if(o4(f))return mG(f);return new Promise(($,U)=>{const G=new i4;f.pipe(G),f.on("error",(w)=>{G.end(),U(w)}),G.on("error",U),G.on("finish",function(){const w=new Uint8Array(Buffer.concat(this.bufferedBytes));$(w)})})},"streamCollector"),o4=N((f)=>typeof ReadableStream==="function"&&f instanceof ReadableStream,"isReadableStreamInstance");N(mG,"collectReadableStream")});var g0=T((oG)=>{Object.defineProperty(oG,"__esModule",{value:!0});oG.isReadableStream=void 0;var t4=(f)=>{var $;return typeof ReadableStream==="function"&&((($=f===null||f===void 0?void 0:f.constructor)===null||$===void 0?void 0:$.name)===ReadableStream.name||f instanceof ReadableStream)};oG.isReadableStream=t4});var EE=T((wE)=>{Object.defineProperty(wE,"__esModule",{value:!0});wE.sdkStreamMixin=void 0;var e4=a4(),fX=$E(),$X=UE(),UX=B0(),aG=g0(),eG="The stream has already been transformed.",wX=(f)=>{var $,U;if(!fE(f)&&!aG.isReadableStream(f)){const W=((U=($=f===null||f===void 0?void 0:f.__proto__)===null||$===void 0?void 0:$.constructor)===null||U===void 0?void 0:U.name)||f;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${W}`)}let G=!1;const w=async()=>{if(G)throw new Error(eG);return G=!0,await e4.streamCollector(f)},E=(W)=>{if(typeof W.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return W.stream()};return Object.assign(f,{transformToByteArray:w,transformToString:async(W)=>{const L=await w();if(W==="base64")return fX.toBase64(L);else if(W==="hex")return $X.toHex(L);else if(W===void 0||W==="utf8"||W==="utf-8")return UX.toUtf8(L);else if(typeof TextDecoder==="function")return new TextDecoder(W).decode(L);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(G)throw new Error(eG);if(G=!0,fE(f))return E(f);else if(aG.isReadableStream(f))return f;else throw new Error(`Cannot transform payload to web stream, got ${f}`)}})};wE.sdkStreamMixin=wX;var fE=(f)=>typeof Blob==="function"&&f instanceof Blob});var RE=T((LE)=>{Object.defineProperty(LE,"__esModule",{value:!0});LE.sdkStreamMixin=void 0;var EX=rG(),WX=GX(),yf=import.meta.require("stream"),LX=import.meta.require("util"),IX=EE(),WE="The stream has already been transformed.",RX=(f)=>{var $,U;if(!(f instanceof yf.Readable))try{return IX.sdkStreamMixin(f)}catch(E){const W=((U=($=f===null||f===void 0?void 0:f.__proto__)===null||$===void 0?void 0:$.constructor)===null||U===void 0?void 0:U.name)||f;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${W}`)}let G=!1;const w=async()=>{if(G)throw new Error(WE);return G=!0,await EX.streamCollector(f)};return Object.assign(f,{transformToByteArray:w,transformToString:async(E)=>{const W=await w();if(E===void 0||Buffer.isEncoding(E))return WX.fromArrayBuffer(W.buffer,W.byteOffset,W.byteLength).toString(E);else return new LX.TextDecoder(E).decode(W)},transformToWebStream:()=>{if(G)throw new Error(WE);if(f.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof yf.Readable.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return G=!0,yf.Readable.toWeb(f)}})};LE.sdkStreamMixin=RX});var ZE=T((FE)=>{async function FX(f){if(typeof f.stream==="function")f=f.stream();return f.tee()}Object.defineProperty(FE,"__esModule",{value:!0});FE.splitStream=void 0;FE.splitStream=FX});var JE=T((QE)=>{async function YX(f){if(ZX.isReadableStream(f))return XX.splitStream(f);const $=new YE.PassThrough,U=new YE.PassThrough;return f.pipe($),f.pipe(U),[$,U]}Object.defineProperty(QE,"__esModule",{value:!0});QE.splitStream=void 0;var YE=import.meta.require("stream"),XX=ZE(),ZX=g0();QE.splitStream=YX});var OE=T((ME)=>{async function QX(f,$){var U;let G=0;const w=[],E=f.getReader();let W=!1;while(!W){const{done:R,value:F}=await E.read();if(F)w.push(F),G+=(U=F===null||F===void 0?void 0:F.byteLength)!==null&&U!==void 0?U:0;if(G>=$)break;W=R}E.releaseLock();const L=new Uint8Array(Math.min($,G));let I=0;for(let R of w){if(R.byteLength>L.byteLength-I){L.set(R.subarray(0,L.byteLength-I),I);break}else L.set(R,I);I+=R.length}return L}Object.defineProperty(ME,"__esModule",{value:!0});ME.headStream=void 0;ME.headStream=QX});var VE=T((AE)=>{Object.defineProperty(AE,"__esModule",{value:!0});AE.headStream=void 0;var zX=import.meta.require("stream"),JX=OE(),MX=g0(),TX=(f,$)=>{if(MX.isReadableStream(f))return JX.headStream(f,$);return new Promise((U,G)=>{const w=new KE;w.limit=$,f.pipe(w),f.on("error",(E)=>{w.end(),G(E)}),w.on("error",G),w.on("finish",function(){const E=new Uint8Array(Buffer.concat(this.buffers));U(E)})})};AE.headStream=TX;class KE extends zX.Writable{constructor(){super(...arguments);this.buffers=[],this.limit=1/0,this.bytesBuffered=0}_write(f,$,U){var G;if(this.buffers.push(f),this.bytesBuffered+=(G=f.byteLength)!==null&&G!==void 0?G:0,this.bytesBuffered>=this.limit){const w=this.bytesBuffered-this.limit,E=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=E.subarray(0,E.byteLength-w),this.emit("finish")}U()}}});var jE=T((nM,F0)=>{function qE(f,$="utf-8"){if($==="base64")return HE.toBase64(f);return CE.toUtf8(f)}function NE(f,$){if($==="base64")return df.mutate(HE.fromBase64(f));return df.mutate(CE.fromUtf8(f))}var{defineProperty:P1,getOwnPropertyDescriptor:OX,getOwnPropertyNames:KX}=Object,AX=Object.prototype.hasOwnProperty,gf=(f,$)=>P1(f,"name",{value:$,configurable:!0}),BX=(f,$)=>{for(var U in $)P1(f,U,{get:$[U],enumerable:!0})},pf=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of KX($))if(!AX.call(f,w)&&w!==U)P1(f,w,{get:()=>$[w],enumerable:!(G=OX($,w))||G.enumerable})}return f},n0=(f,$,U)=>(pf(f,$,"default"),U&&pf(U,$,"default")),VX=(f)=>pf(P1({},"__esModule",{value:!0}),f),R0={};BX(R0,{Uint8ArrayBlobAdapter:()=>df});F0.exports=VX(R0);var HE=$E(),CE=B0();gf(qE,"transformToString");gf(NE,"transformFromString");var PE=class f extends Uint8Array{static fromString($,U="utf-8"){switch(typeof $){case"string":return NE($,U);default:throw new Error(`Unsupported conversion from ${typeof $} to Uint8ArrayBlobAdapter.`)}}static mutate($){return Object.setPrototypeOf($,f.prototype),$}transformToString($="utf-8"){return qE(this,$)}};gf(PE,"Uint8ArrayBlobAdapter");var df=PE;n0(R0,hG(),F0.exports);n0(R0,RE(),F0.exports);n0(R0,JE(),F0.exports);n0(R0,VE(),F0.exports);n0(R0,g0(),F0.exports)});var q0=T((sM,aE)=>{function gE(f){const $=f.getUTCFullYear(),U=f.getUTCMonth(),G=f.getUTCDay(),w=f.getUTCDate(),E=f.getUTCHours(),W=f.getUTCMinutes(),L=f.getUTCSeconds(),I=w<10?`0${w}`:`${w}`,R=E<10?`0${E}`:`${E}`,F=W<10?`0${W}`:`${W}`,X=L<10?`0${L}`:`${L}`;return`${tX[G]}, ${I} ${$$[U]} ${$} ${R}:${F}:${X} GMT`}function b1(f){return encodeURIComponent(f).replace(/[!'()*]/g,function($){return"%"+$.charCodeAt(0).toString(16).toUpperCase()})}function U$(f,$,U){let G,w,E;if(typeof $==="undefined"&&typeof U==="undefined")G={},E=f;else if(G=f,typeof $==="function")return w=$,E=U,S6(G,w,E);else E=$;for(let W of Object.keys(E)){if(!Array.isArray(E[W])){G[W]=E[W];continue}oE(G,null,E,W)}return G}function tE(f,$,U){if(U<=0||!Number.isInteger(U))throw new Error("Invalid number of delimiters ("+U+") for splitEvery.");const G=f.split($);if(U===1)return G;const w=[];let E="";for(let W=0;W<G.length;W++){if(E==="")E=G[W];else E+=$+G[W];if((W+1)%U===0)w.push(E),E=""}if(E!=="")w.push(E);return w}var{defineProperty:h1,getOwnPropertyDescriptor:HX,getOwnPropertyNames:CX}=Object,qX=Object.prototype.hasOwnProperty,z=(f,$)=>h1(f,"name",{value:$,configurable:!0}),NX=(f,$)=>{for(var U in $)h1(f,U,{get:$[U],enumerable:!0})},PX=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of CX($))if(!qX.call(f,w)&&w!==U)h1(f,w,{get:()=>$[w],enumerable:!(G=HX($,w))||G.enumerable})}return f},jX=(f)=>PX(h1({},"__esModule",{value:!0}),f),bE={};NX(bE,{Client:()=>bX,Command:()=>uE,LazyJsonString:()=>N6,NoOpLogger:()=>SX,SENSITIVE_STRING:()=>kX,ServiceException:()=>z6,StringWrapper:()=>r0,_json:()=>tf,collectBody:()=>hX,convertMap:()=>P6,createAggregatedClient:()=>cX,dateToUtcString:()=>gE,decorateServiceException:()=>sE,emitWarningIfUnsupportedVersion:()=>O6,expectBoolean:()=>vX,expectByte:()=>of,expectFloat32:()=>j1,expectInt:()=>_X,expectInt32:()=>mf,expectLong:()=>m0,expectNonNull:()=>pX,expectNumber:()=>l0,expectObject:()=>xE,expectShort:()=>rf,expectString:()=>dX,expectUnion:()=>gX,extendedEncodeURIComponent:()=>b1,getArrayIfSingleItem:()=>q6,getDefaultClientConfiguration:()=>H6,getDefaultExtensionConfiguration:()=>mE,getValueFromTextNode:()=>iE,handleFloat:()=>lX,limitedParseDouble:()=>f$,limitedParseFloat:()=>mX,limitedParseFloat32:()=>iX,loadConfigsForDefaultMode:()=>T6,logger:()=>i0,map:()=>U$,parseBoolean:()=>uX,parseEpochTimestamp:()=>W6,parseRfc3339DateTime:()=>eX,parseRfc3339DateTimeWithOffset:()=>$6,parseRfc7231DateTime:()=>E6,resolveDefaultRuntimeConfig:()=>C6,resolvedPath:()=>D6,serializeDateTime:()=>c6,serializeFloat:()=>k6,splitEvery:()=>tE,strictParseByte:()=>dE,strictParseDouble:()=>ef,strictParseFloat:()=>nX,strictParseFloat32:()=>_E,strictParseInt:()=>rX,strictParseInt32:()=>oX,strictParseLong:()=>pE,strictParseShort:()=>V0,take:()=>j6,throwDefaultError:()=>lE,withBaseException:()=>J6});aE.exports=jX(bE);var hE=class f{trace(){}debug(){}info(){}warn(){}error(){}};z(hE,"NoOpLogger");var SX=hE,DE=jG(),kE=class f{constructor($){this.middlewareStack=DE.constructStack(),this.config=$}send($,U,G){const w=typeof U!=="function"?U:void 0,E=typeof U==="function"?U:G,W=$.resolveMiddleware(this.middlewareStack,this.config,w);if(E)W($).then((L)=>E(null,L.output),(L)=>E(L)).catch(()=>{});else return W($).then((L)=>L.output)}destroy(){if(this.config.requestHandler.destroy)this.config.requestHandler.destroy()}};z(kE,"Client");var bX=kE,nf=jE(),hX=z(async(f=new Uint8Array,$)=>{if(f instanceof Uint8Array)return nf.Uint8ArrayBlobAdapter.mutate(f);if(!f)return nf.Uint8ArrayBlobAdapter.mutate(new Uint8Array);const U=$.streamCollector(f);return nf.Uint8ArrayBlobAdapter.mutate(await U)},"collectBody"),lf=J0(),cE=class f{constructor(){this.middlewareStack=DE.constructStack()}static classBuilder(){return new DX}resolveMiddlewareWithContext($,U,G,{middlewareFn:w,clientName:E,commandName:W,inputFilterSensitiveLog:L,outputFilterSensitiveLog:I,smithyContext:R,additionalContext:F,CommandCtor:X}){for(let J of w.bind(this)(X,$,U,G))this.middlewareStack.use(J);const Y=$.concat(this.middlewareStack),{logger:Z}=U,Q={logger:Z,clientName:E,commandName:W,inputFilterSensitiveLog:L,outputFilterSensitiveLog:I,[lf.SMITHY_CONTEXT_KEY]:{commandInstance:this,...R},...F},{requestHandler:M}=U;return Y.resolve((J)=>M.handle(J.request,G||{}),Q)}};z(cE,"Command");var uE=cE,vE=class f{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=($)=>$,this._outputFilterSensitiveLog=($)=>$,this._serializer=null,this._deserializer=null}init($){this._init=$}ep($){return this._ep=$,this}m($){return this._middlewareFn=$,this}s($,U,G={}){return this._smithyContext={service:$,operation:U,...G},this}c($={}){return this._additionalContext=$,this}n($,U){return this._clientName=$,this._commandName=U,this}f($=(G)=>G,U=(G)=>G){return this._inputFilterSensitiveLog=$,this._outputFilterSensitiveLog=U,this}ser($){return this._serializer=$,this}de($){return this._deserializer=$,this}build(){var $;const U=this;let G;return G=($=class extends uE{constructor(...[w]){super();this.serialize=U._serializer,this.deserialize=U._deserializer,this.input=w??{},U._init(this)}static getEndpointParameterInstructions(){return U._ep}resolveMiddleware(w,E,W){return this.resolveMiddlewareWithContext(w,E,W,{CommandCtor:G,middlewareFn:U._middlewareFn,clientName:U._clientName,commandName:U._commandName,inputFilterSensitiveLog:U._inputFilterSensitiveLog,outputFilterSensitiveLog:U._outputFilterSensitiveLog,smithyContext:U._smithyContext,additionalContext:U._additionalContext})}},z($,"CommandRef"),$)}};z(vE,"ClassBuilder");var DX=vE,kX="***SensitiveInformation***",cX=z((f,$)=>{for(let U of Object.keys(f)){const G=f[U],w=z(async function(W,L,I){const R=new G(W);if(typeof L==="function")this.send(R,L);else if(typeof I==="function"){if(typeof L!=="object")throw new Error(`Expected http options but got ${typeof L}`);this.send(R,L||{},I)}else return this.send(R,L)},"methodImpl"),E=(U[0].toLowerCase()+U.slice(1)).replace(/Command$/,"");$.prototype[E]=w}},"createAggregatedClient"),uX=z((f)=>{switch(f){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${f}"`)}},"parseBoolean"),vX=z((f)=>{if(f===null||f===void 0)return;if(typeof f==="number"){if(f===0||f===1)i0.warn(S1(`Expected boolean, got ${typeof f}: ${f}`));if(f===0)return!1;if(f===1)return!0}if(typeof f==="string"){const $=f.toLowerCase();if($==="false"||$==="true")i0.warn(S1(`Expected boolean, got ${typeof f}: ${f}`));if($==="false")return!1;if($==="true")return!0}if(typeof f==="boolean")return f;throw new TypeError(`Expected boolean, got ${typeof f}: ${f}`)},"expectBoolean"),l0=z((f)=>{if(f===null||f===void 0)return;if(typeof f==="string"){const $=parseFloat(f);if(!Number.isNaN($)){if(String($)!==String(f))i0.warn(S1(`Expected number but observed string: ${f}`));return $}}if(typeof f==="number")return f;throw new TypeError(`Expected number, got ${typeof f}: ${f}`)},"expectNumber"),xX=Math.ceil(340282346638528860000000000000000000000),j1=z((f)=>{const $=l0(f);if($!==void 0&&!Number.isNaN($)&&$!==1/0&&$!==-1/0){if(Math.abs($)>xX)throw new TypeError(`Expected 32-bit float, got ${f}`)}return $},"expectFloat32"),m0=z((f)=>{if(f===null||f===void 0)return;if(Number.isInteger(f)&&!Number.isNaN(f))return f;throw new TypeError(`Expected integer, got ${typeof f}: ${f}`)},"expectLong"),_X=m0,mf=z((f)=>af(f,32),"expectInt32"),rf=z((f)=>af(f,16),"expectShort"),of=z((f)=>af(f,8),"expectByte"),af=z((f,$)=>{const U=m0(f);if(U!==void 0&&yX(U,$)!==U)throw new TypeError(`Expected ${$}-bit integer, got ${f}`);return U},"expectSizedInt"),yX=z((f,$)=>{switch($){case 32:return Int32Array.of(f)[0];case 16:return Int16Array.of(f)[0];case 8:return Int8Array.of(f)[0]}},"castInt"),pX=z((f,$)=>{if(f===null||f===void 0){if($)throw new TypeError(`Expected a non-null value for ${$}`);throw new TypeError("Expected a non-null value")}return f},"expectNonNull"),xE=z((f)=>{if(f===null||f===void 0)return;if(typeof f==="object"&&!Array.isArray(f))return f;const $=Array.isArray(f)?"array":typeof f;throw new TypeError(`Expected object, got ${$}: ${f}`)},"expectObject"),dX=z((f)=>{if(f===null||f===void 0)return;if(typeof f==="string")return f;if(["boolean","number","bigint"].includes(typeof f))return i0.warn(S1(`Expected string, got ${typeof f}: ${f}`)),String(f);throw new TypeError(`Expected string, got ${typeof f}: ${f}`)},"expectString"),gX=z((f)=>{if(f===null||f===void 0)return;const $=xE(f),U=Object.entries($).filter(([,G])=>G!=null).map(([G])=>G);if(U.length===0)throw new TypeError("Unions must have exactly one non-null member. None were found.");if(U.length>1)throw new TypeError(`Unions must have exactly one non-null member. Keys ${U} were not null.`);return $},"expectUnion"),ef=z((f)=>{if(typeof f=="string")return l0(C0(f));return l0(f)},"strictParseDouble"),nX=ef,_E=z((f)=>{if(typeof f=="string")return j1(C0(f));return j1(f)},"strictParseFloat32"),sX=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,C0=z((f)=>{const $=f.match(sX);if($===null||$[0].length!==f.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(f)},"parseNumber"),f$=z((f)=>{if(typeof f=="string")return yE(f);return l0(f)},"limitedParseDouble"),lX=f$,mX=f$,iX=z((f)=>{if(typeof f=="string")return yE(f);return j1(f)},"limitedParseFloat32"),yE=z((f)=>{switch(f){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error(`Unable to parse float value: ${f}`)}},"parseFloatString"),pE=z((f)=>{if(typeof f==="string")return m0(C0(f));return m0(f)},"strictParseLong"),rX=pE,oX=z((f)=>{if(typeof f==="string")return mf(C0(f));return mf(f)},"strictParseInt32"),V0=z((f)=>{if(typeof f==="string")return rf(C0(f));return rf(f)},"strictParseShort"),dE=z((f)=>{if(typeof f==="string")return of(C0(f));return of(f)},"strictParseByte"),S1=z((f)=>{return String(new TypeError(f).stack||f).split("\n").slice(0,5).filter(($)=>!$.includes("stackTraceWarning")).join("\n")},"stackTraceWarning"),i0={warn:console.warn},tX=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],$$=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];z(gE,"dateToUtcString");var aX=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),eX=z((f)=>{if(f===null||f===void 0)return;if(typeof f!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const $=aX.exec(f);if(!$)throw new TypeError("Invalid RFC-3339 date-time value");const[U,G,w,E,W,L,I,R]=$,F=V0(H0(G)),X=l(w,"month",1,12),Y=l(E,"day",1,31);return s0(F,X,Y,{hours:W,minutes:L,seconds:I,fractionalMilliseconds:R})},"parseRfc3339DateTime"),f6=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),$6=z((f)=>{if(f===null||f===void 0)return;if(typeof f!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const $=f6.exec(f);if(!$)throw new TypeError("Invalid RFC-3339 date-time value");const[U,G,w,E,W,L,I,R,F]=$,X=V0(H0(G)),Y=l(w,"month",1,12),Z=l(E,"day",1,31),Q=s0(X,Y,Z,{hours:W,minutes:L,seconds:I,fractionalMilliseconds:R});if(F.toUpperCase()!="Z")Q.setTime(Q.getTime()-Q6(F));return Q},"parseRfc3339DateTimeWithOffset"),U6=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$/),w6=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$/),G6=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})$/),E6=z((f)=>{if(f===null||f===void 0)return;if(typeof f!=="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let $=U6.exec(f);if($){const[U,G,w,E,W,L,I,R]=$;return s0(V0(H0(E)),sf(w),l(G,"day",1,31),{hours:W,minutes:L,seconds:I,fractionalMilliseconds:R})}if($=w6.exec(f),$){const[U,G,w,E,W,L,I,R]=$;return R6(s0(L6(E),sf(w),l(G,"day",1,31),{hours:W,minutes:L,seconds:I,fractionalMilliseconds:R}))}if($=G6.exec(f),$){const[U,G,w,E,W,L,I,R]=$;return s0(V0(H0(R)),sf(G),l(w.trimLeft(),"day",1,31),{hours:E,minutes:W,seconds:L,fractionalMilliseconds:I})}throw new TypeError("Invalid RFC-7231 date-time value")},"parseRfc7231DateTime"),W6=z((f)=>{if(f===null||f===void 0)return;let $;if(typeof f==="number")$=f;else if(typeof f==="string")$=ef(f);else if(typeof f==="object"&&f.tag===1)$=f.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN($)||$===1/0||$===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round($*1000))},"parseEpochTimestamp"),s0=z((f,$,U,G)=>{const w=$-1;return X6(f,w,U),new Date(Date.UTC(f,w,U,l(G.hours,"hour",0,23),l(G.minutes,"minute",0,59),l(G.seconds,"seconds",0,60),Y6(G.fractionalMilliseconds)))},"buildDate"),L6=z((f)=>{const $=new Date().getUTCFullYear(),U=Math.floor($/100)*100+V0(H0(f));if(U<$)return U+100;return U},"parseTwoDigitYear"),I6=1576800000000,R6=z((f)=>{if(f.getTime()-new Date().getTime()>I6)return new Date(Date.UTC(f.getUTCFullYear()-100,f.getUTCMonth(),f.getUTCDate(),f.getUTCHours(),f.getUTCMinutes(),f.getUTCSeconds(),f.getUTCMilliseconds()));return f},"adjustRfc850Year"),sf=z((f)=>{const $=$$.indexOf(f);if($<0)throw new TypeError(`Invalid month: ${f}`);return $+1},"parseMonthByShortName"),F6=[31,28,31,30,31,30,31,31,30,31,30,31],X6=z((f,$,U)=>{let G=F6[$];if($===1&&Z6(f))G=29;if(U>G)throw new TypeError(`Invalid day for ${$$[$]} in ${f}: ${U}`)},"validateDayOfMonth"),Z6=z((f)=>{return f%4===0&&(f%100!==0||f%400===0)},"isLeapYear"),l=z((f,$,U,G)=>{const w=dE(H0(f));if(w<U||w>G)throw new TypeError(`${$} must be between ${U} and ${G}, inclusive`);return w},"parseDateValue"),Y6=z((f)=>{if(f===null||f===void 0)return 0;return _E("0."+f)*1000},"parseMilliseconds"),Q6=z((f)=>{const $=f[0];let U=1;if($=="+")U=1;else if($=="-")U=-1;else throw new TypeError(`Offset direction, ${$}, must be "+" or "-"`);const G=Number(f.substring(1,3)),w=Number(f.substring(4,6));return U*(G*60+w)*60*1000},"parseOffsetToMilliseconds"),H0=z((f)=>{let $=0;while($<f.length-1&&f.charAt($)==="0")$++;if($===0)return f;return f.slice($)},"stripLeadingZeroes"),nE=class f extends Error{constructor($){super($.message);Object.setPrototypeOf(this,f.prototype),this.name=$.name,this.$fault=$.$fault,this.$metadata=$.$metadata}};z(nE,"ServiceException");var z6=nE,sE=z((f,$={})=>{Object.entries($).filter(([,G])=>G!==void 0).forEach(([G,w])=>{if(f[G]==null||f[G]==="")f[G]=w});const U=f.message||f.Message||"UnknownError";return f.message=U,delete f.Message,f},"decorateServiceException"),lE=z(({output:f,parsedBody:$,exceptionCtor:U,errorCode:G})=>{const w=M6(f),E=w.httpStatusCode?w.httpStatusCode+"":void 0,W=new U({name:($==null?void 0:$.code)||($==null?void 0:$.Code)||G||E||"UnknownError",$fault:"client",$metadata:w});throw sE(W,$)},"throwDefaultError"),J6=z((f)=>{return({output:$,parsedBody:U,errorCode:G})=>{lE({output:$,parsedBody:U,exceptionCtor:f,errorCode:G})}},"withBaseException"),M6=z((f)=>({httpStatusCode:f.statusCode,requestId:f.headers["x-amzn-requestid"]??f.headers["x-amzn-request-id"]??f.headers["x-amz-request-id"],extendedRequestId:f.headers["x-amz-id-2"],cfId:f.headers["x-amz-cf-id"]}),"deserializeMetadata"),T6=z((f)=>{switch(f){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:30000};default:return{}}},"loadConfigsForDefaultMode"),SE=!1,O6=z((f)=>{if(f&&!SE&&parseInt(f.substring(1,f.indexOf(".")))<16)SE=!0},"emitWarningIfUnsupportedVersion"),K6=z((f)=>{const $=[];for(let U in lf.AlgorithmId){const G=lf.AlgorithmId[U];if(f[G]===void 0)continue;$.push({algorithmId:()=>G,checksumConstructor:()=>f[G]})}return{_checksumAlgorithms:$,addChecksumAlgorithm(U){this._checksumAlgorithms.push(U)},checksumAlgorithms(){return this._checksumAlgorithms}}},"getChecksumConfiguration"),A6=z((f)=>{const $={};return f.checksumAlgorithms().forEach((U)=>{$[U.algorithmId()]=U.checksumConstructor()}),$},"resolveChecksumRuntimeConfig"),B6=z((f)=>{let $=f.retryStrategy;return{setRetryStrategy(U){$=U},retryStrategy(){return $}}},"getRetryConfiguration"),V6=z((f)=>{const $={};return $.retryStrategy=f.retryStrategy(),$},"resolveRetryRuntimeConfig"),mE=z((f)=>{return{...K6(f),...B6(f)}},"getDefaultExtensionConfiguration"),H6=mE,C6=z((f)=>{return{...A6(f),...V6(f)}},"resolveDefaultRuntimeConfig");z(b1,"extendedEncodeURIComponent");var q6=z((f)=>Array.isArray(f)?f:[f],"getArrayIfSingleItem"),iE=z((f)=>{for(let U in f)if(f.hasOwnProperty(U)&&f[U]["#text"]!==void 0)f[U]=f[U]["#text"];else if(typeof f[U]==="object"&&f[U]!==null)f[U]=iE(f[U]);return f},"getValueFromTextNode"),r0=z(function(){const f=Object.getPrototypeOf(this).constructor,U=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(U,f.prototype),U},"StringWrapper");r0.prototype=Object.create(String.prototype,{constructor:{value:r0,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(r0,String);var rE=class f extends r0{deserializeJSON(){return JSON.parse(super.toString())}toJSON(){return super.toString()}static fromObject($){if($ instanceof f)return $;else if($ instanceof String||typeof $==="string")return new f($);return new f(JSON.stringify($))}};z(rE,"LazyJsonString");var N6=rE;z(U$,"map");var P6=z((f)=>{const $={};for(let[U,G]of Object.entries(f||{}))$[U]=[,G];return $},"convertMap"),j6=z((f,$)=>{const U={};for(let G in $)oE(U,f,$,G);return U},"take"),S6=z((f,$,U)=>{return U$(f,Object.entries(U).reduce((G,[w,E])=>{if(Array.isArray(E))G[w]=E;else if(typeof E==="function")G[w]=[$,E()];else G[w]=[$,E];return G},{}))},"mapWithFilter"),oE=z((f,$,U,G)=>{if($!==null){let W=U[G];if(typeof W==="function")W=[,W];const[L=b6,I=h6,R=G]=W;if(typeof L==="function"&&L($[R])||typeof L!=="function"&&!!L)f[G]=I($[R]);return}let[w,E]=U[G];if(typeof E==="function"){let W;const L=w===void 0&&(W=E())!=null,I=typeof w==="function"&&!!w(void 0)||typeof w!=="function"&&!!w;if(L)f[G]=W;else if(I)f[G]=E()}else{const W=w===void 0&&E!=null,L=typeof w==="function"&&!!w(E)||typeof w!=="function"&&!!w;if(W||L)f[G]=E}},"applyInstruction"),b6=z((f)=>f!=null,"nonNullish"),h6=z((f)=>f,"pass"),D6=z((f,$,U,G,w,E)=>{if($!=null&&$[U]!==void 0){const W=G();if(W.length<=0)throw new Error("Empty value provided for input HTTP label: "+U+".");f=f.replace(w,E?W.split("/").map((L)=>b1(L)).join("/"):b1(W))}else throw new Error("No value provided for input HTTP label: "+U+".");return f},"resolvedPath"),k6=z((f)=>{if(f!==f)return"NaN";switch(f){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return f}},"serializeFloat"),c6=z((f)=>f.toISOString().replace(".000Z","Z"),"serializeDateTime"),tf=z((f)=>{if(f==null)return{};if(Array.isArray(f))return f.filter(($)=>$!=null).map(tf);if(typeof f==="object"){const $={};for(let U of Object.keys(f)){if(f[U]==null)continue;$[U]=tf(f[U])}return $}return f},"_json");z(tE,"splitEvery")});var $W=T((eE)=>{Object.defineProperty(eE,"__esModule",{value:!0});eE.isStreamingPayload=void 0;var u6=import.meta.require("stream"),v6=(f)=>(f===null||f===void 0?void 0:f.body)instanceof u6.Readable||typeof ReadableStream!=="undefined"&&(f===null||f===void 0?void 0:f.body)instanceof ReadableStream;eE.isStreamingPayload=v6});var OW=T((iM,TW)=>{var{defineProperty:D1,getOwnPropertyDescriptor:x6,getOwnPropertyNames:_6}=Object,y6=Object.prototype.hasOwnProperty,S=(f,$)=>D1(f,"name",{value:$,configurable:!0}),p6=(f,$)=>{for(var U in $)D1(f,U,{get:$[U],enumerable:!0})},d6=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of _6($))if(!y6.call(f,w)&&w!==U)D1(f,w,{get:()=>$[w],enumerable:!(G=x6($,w))||G.enumerable})}return f},g6=(f)=>d6(D1({},"__esModule",{value:!0}),f),wW={};p6(wW,{AdaptiveRetryStrategy:()=>l6,CONFIG_MAX_ATTEMPTS:()=>G$,CONFIG_RETRY_MODE:()=>ZW,ENV_MAX_ATTEMPTS:()=>w$,ENV_RETRY_MODE:()=>XW,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:()=>m6,NODE_RETRY_MODE_CONFIG_OPTIONS:()=>r6,StandardRetryStrategy:()=>RW,defaultDelayDecider:()=>EW,defaultRetryDecider:()=>WW,getOmitRetryHeadersPlugin:()=>o6,getRetryAfterHint:()=>MW,getRetryPlugin:()=>UZ,omitRetryHeadersMiddleware:()=>YW,omitRetryHeadersMiddlewareOptions:()=>QW,resolveRetryConfig:()=>i6,retryMiddleware:()=>zW,retryMiddlewareOptions:()=>JW});TW.exports=g6(wW);var N0=I0(),GW=Sf(),C=HG(),n6=S((f,$)=>{const U=f,G=($==null?void 0:$.noRetryIncrement)??C.NO_RETRY_INCREMENT,w=($==null?void 0:$.retryCost)??C.RETRY_COST,E=($==null?void 0:$.timeoutRetryCost)??C.TIMEOUT_RETRY_COST;let W=f;const L=S((X)=>X.name==="TimeoutError"?E:w,"getCapacityAmount"),I=S((X)=>L(X)<=W,"hasRetryTokens");return Object.freeze({hasRetryTokens:I,retrieveRetryTokens:S((X)=>{if(!I(X))throw new Error("No retry token available");const Y=L(X);return W-=Y,Y},"retrieveRetryTokens"),releaseRetryTokens:S((X)=>{W+=X??G,W=Math.min(W,U)},"releaseRetryTokens")})},"getDefaultRetryQuota"),EW=S((f,$)=>Math.floor(Math.min(C.MAXIMUM_RETRY_DELAY,Math.random()*2**$*f)),"defaultDelayDecider"),$0=bf(),WW=S((f)=>{if(!f)return!1;return $0.isRetryableByTrait(f)||$0.isClockSkewError(f)||$0.isThrottlingError(f)||$0.isTransientError(f)},"defaultRetryDecider"),LW=S((f)=>{if(f instanceof Error)return f;if(f instanceof Object)return Object.assign(new Error,f);if(typeof f==="string")return new Error(f);return new Error(`AWS SDK error wrapper for ${f}`)},"asSdkError"),IW=class f{constructor($,U){this.maxAttemptsProvider=$,this.mode=C.RETRY_MODES.STANDARD,this.retryDecider=(U==null?void 0:U.retryDecider)??WW,this.delayDecider=(U==null?void 0:U.delayDecider)??EW,this.retryQuota=(U==null?void 0:U.retryQuota)??n6(C.INITIAL_RETRY_TOKENS)}shouldRetry($,U,G){return U<G&&this.retryDecider($)&&this.retryQuota.hasRetryTokens($)}async getMaxAttempts(){let $;try{$=await this.maxAttemptsProvider()}catch(U){$=C.DEFAULT_MAX_ATTEMPTS}return $}async retry($,U,G){let w,E=0,W=0;const L=await this.getMaxAttempts(),{request:I}=U;if(N0.HttpRequest.isInstance(I))I.headers[C.INVOCATION_ID_HEADER]=GW.v4();while(!0)try{if(N0.HttpRequest.isInstance(I))I.headers[C.REQUEST_HEADER]=`attempt=${E+1}; max=${L}`;if(G==null?void 0:G.beforeRequest)await G.beforeRequest();const{response:R,output:F}=await $(U);if(G==null?void 0:G.afterRequest)G.afterRequest(R);return this.retryQuota.releaseRetryTokens(w),F.$metadata.attempts=E+1,F.$metadata.totalRetryDelay=W,{response:R,output:F}}catch(R){const F=LW(R);if(E++,this.shouldRetry(F,E,L)){w=this.retryQuota.retrieveRetryTokens(F);const X=this.delayDecider($0.isThrottlingError(F)?C.THROTTLING_RETRY_DELAY_BASE:C.DEFAULT_RETRY_DELAY_BASE,E),Y=s6(F.$response),Z=Math.max(Y||0,X);W+=Z,await new Promise((Q)=>setTimeout(Q,Z));continue}if(!F.$metadata)F.$metadata={};throw F.$metadata.attempts=E,F.$metadata.totalRetryDelay=W,F}}};S(IW,"StandardRetryStrategy");var RW=IW,s6=S((f)=>{if(!N0.HttpResponse.isInstance(f))return;const $=Object.keys(f.headers).find((E)=>E.toLowerCase()==="retry-after");if(!$)return;const U=f.headers[$],G=Number(U);if(!Number.isNaN(G))return G*1000;return new Date(U).getTime()-Date.now()},"getDelayFromRetryAfterHeader"),FW=class f extends RW{constructor($,U){const{rateLimiter:G,...w}=U??{};super($,w);this.rateLimiter=G??new C.DefaultRateLimiter,this.mode=C.RETRY_MODES.ADAPTIVE}async retry($,U){return super.retry($,U,{beforeRequest:async()=>{return this.rateLimiter.getSendToken()},afterRequest:(G)=>{this.rateLimiter.updateClientSendingRate(G)}})}};S(FW,"AdaptiveRetryStrategy");var l6=FW,UW=c0(),w$="AWS_MAX_ATTEMPTS",G$="max_attempts",m6={environmentVariableSelector:(f)=>{const $=f[w$];if(!$)return;const U=parseInt($);if(Number.isNaN(U))throw new Error(`Environment variable ${w$} mast be a number, got "${$}"`);return U},configFileSelector:(f)=>{const $=f[G$];if(!$)return;const U=parseInt($);if(Number.isNaN(U))throw new Error(`Shared config file entry ${G$} mast be a number, got "${$}"`);return U},default:C.DEFAULT_MAX_ATTEMPTS},i6=S((f)=>{const{retryStrategy:$}=f,U=UW.normalizeProvider(f.maxAttempts??C.DEFAULT_MAX_ATTEMPTS);return{...f,maxAttempts:U,retryStrategy:async()=>{if($)return $;if(await UW.normalizeProvider(f.retryMode)()===C.RETRY_MODES.ADAPTIVE)return new C.AdaptiveRetryStrategy(U);return new C.StandardRetryStrategy(U)}}},"resolveRetryConfig"),XW="AWS_RETRY_MODE",ZW="retry_mode",r6={environmentVariableSelector:(f)=>f[XW],configFileSelector:(f)=>f[ZW],default:C.DEFAULT_RETRY_MODE},YW=S(()=>(f)=>async($)=>{const{request:U}=$;if(N0.HttpRequest.isInstance(U))delete U.headers[C.INVOCATION_ID_HEADER],delete U.headers[C.REQUEST_HEADER];return f($)},"omitRetryHeadersMiddleware"),QW={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},o6=S((f)=>({applyToStack:($)=>{$.addRelativeTo(YW(),QW)}}),"getOmitRetryHeadersPlugin"),t6=q0(),a6=$W(),zW=S((f)=>($,U)=>async(G)=>{var w;let E=await f.retryStrategy();const W=await f.maxAttempts();if(e6(E)){E=E;let L=await E.acquireInitialRetryToken(U.partition_id),I=new Error,R=0,F=0;const{request:X}=G,Y=N0.HttpRequest.isInstance(X);if(Y)X.headers[C.INVOCATION_ID_HEADER]=GW.v4();while(!0)try{if(Y)X.headers[C.REQUEST_HEADER]=`attempt=${R+1}; max=${W}`;const{response:Z,output:Q}=await $(G);return E.recordSuccess(L),Q.$metadata.attempts=R+1,Q.$metadata.totalRetryDelay=F,{response:Z,output:Q}}catch(Z){const Q=fZ(Z);if(I=LW(Z),Y&&a6.isStreamingPayload(X))throw(w=U.logger instanceof t6.NoOpLogger?console:U.logger)==null||w.warn("An error was encountered in a non-retryable streaming request."),I;try{L=await E.refreshRetryTokenForRetry(L,Q)}catch(J){if(!I.$metadata)I.$metadata={};throw I.$metadata.attempts=R+1,I.$metadata.totalRetryDelay=F,I}R=L.getRetryCount();const M=L.getRetryDelay();F+=M,await new Promise((J)=>setTimeout(J,M))}}else{if(E=E,E==null?void 0:E.mode)U.userAgent=[...U.userAgent||[],["cfg/retry-mode",E.mode]];return E.retry($,G)}},"retryMiddleware"),e6=S((f)=>typeof f.acquireInitialRetryToken!=="undefined"&&typeof f.refreshRetryTokenForRetry!=="undefined"&&typeof f.recordSuccess!=="undefined","isRetryStrategyV2"),fZ=S((f)=>{const $={error:f,errorType:$Z(f)},U=MW(f.$response);if(U)$.retryAfterHint=U;return $},"getRetryErrorInfo"),$Z=S((f)=>{if($0.isThrottlingError(f))return"THROTTLING";if($0.isTransientError(f))return"TRANSIENT";if($0.isServerError(f))return"SERVER_ERROR";return"CLIENT_ERROR"},"getRetryErrorType"),JW={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},UZ=S((f)=>({applyToStack:($)=>{$.add(zW(f),JW)}}),"getRetryPlugin"),MW=S((f)=>{if(!N0.HttpResponse.isInstance(f))return;const $=Object.keys(f.headers).find((E)=>E.toLowerCase()==="retry-after");if(!$)return;const U=f.headers[$],G=Number(U);if(!Number.isNaN(G))return new Date(G*1000);return new Date(U)},"getRetryAfterHint")});var W$=T((rM,xW)=>{function BW(f){const $=new Map;for(let U of f)$.set(U.schemeId,U);return $}function kW(f,$){return new uW(f,$)}function vW(f,$,U,G,w){return H(async function*E(W,L,...I){let R=W.startingToken||void 0,F=!0,X;while(F){if(L[U]=R,w)L[w]=L[w]??W.pageSize;if(W.client instanceof f)X=await qZ($,W.client,L,...I);else throw new Error(`Invalid client, expected instance of ${f.name}`);yield X;const Y=R;R=NZ(X,G),F=!!(R&&(!W.stopOnSameToken||R!==Y))}return},"paginateOperation")}var{defineProperty:c1,getOwnPropertyDescriptor:wZ,getOwnPropertyNames:GZ}=Object,EZ=Object.prototype.hasOwnProperty,H=(f,$)=>c1(f,"name",{value:$,configurable:!0}),WZ=(f,$)=>{for(var U in $)c1(f,U,{get:$[U],enumerable:!0})},LZ=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of GZ($))if(!EZ.call(f,w)&&w!==U)c1(f,w,{get:()=>$[w],enumerable:!(G=wZ($,w))||G.enumerable})}return f},IZ=(f)=>LZ(c1({},"__esModule",{value:!0}),f),KW={};WZ(KW,{DefaultIdentityProviderConfig:()=>MZ,EXPIRATION_MS:()=>hW,HttpApiKeyAuthSigner:()=>TZ,HttpBearerAuthSigner:()=>OZ,NoAuthSigner:()=>KZ,RequestBuilder:()=>uW,createIsIdentityExpiredFunction:()=>bW,createPaginator:()=>vW,doesIdentityRequireRefresh:()=>DW,getHttpAuthSchemeEndpointRuleSetPlugin:()=>FZ,getHttpAuthSchemePlugin:()=>ZZ,getHttpSigningPlugin:()=>JZ,getSmithyContext:()=>VZ,httpAuthSchemeEndpointRuleSetMiddlewareOptions:()=>VW,httpAuthSchemeMiddleware:()=>E$,httpAuthSchemeMiddlewareOptions:()=>HW,httpSigningMiddleware:()=>CW,httpSigningMiddlewareOptions:()=>qW,isIdentityExpired:()=>AZ,memoizeIdentityProvider:()=>BZ,normalizeProvider:()=>HZ,requestBuilder:()=>kW});xW.exports=IZ(KW);var AW=c0();H(BW,"convertHttpAuthSchemesToMap");var E$=H((f,$)=>(U,G)=>async(w)=>{var E;const W=f.httpAuthSchemeProvider(await $.httpAuthSchemeParametersProvider(f,G,w.input)),L=BW(f.httpAuthSchemes),I=AW.getSmithyContext(G),R=[];for(let F of W){const X=L.get(F.schemeId);if(!X){R.push(`HttpAuthScheme \`${F.schemeId}\` was not enabled for this service.`);continue}const Y=X.identityProvider(await $.identityProviderConfigProvider(f));if(!Y){R.push(`HttpAuthScheme \`${F.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:Z={},signingProperties:Q={}}=((E=F.propertiesExtractor)==null?void 0:E.call(F,f,G))||{};F.identityProperties=Object.assign(F.identityProperties||{},Z),F.signingProperties=Object.assign(F.signingProperties||{},Q),I.selectedHttpAuthScheme={httpAuthOption:F,identity:await Y(F.identityProperties),signer:X.signer};break}if(!I.selectedHttpAuthScheme)throw new Error(R.join("\n"));return U(w)},"httpAuthSchemeMiddleware"),RZ=Yw(),VW={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:RZ.endpointMiddlewareOptions.name},FZ=H((f,{httpAuthSchemeParametersProvider:$,identityProviderConfigProvider:U})=>({applyToStack:(G)=>{G.addRelativeTo(E$(f,{httpAuthSchemeParametersProvider:$,identityProviderConfigProvider:U}),VW)}}),"getHttpAuthSchemeEndpointRuleSetPlugin"),XZ=Bf(),HW={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:XZ.serializerMiddlewareOption.name},ZZ=H((f,{httpAuthSchemeParametersProvider:$,identityProviderConfigProvider:U})=>({applyToStack:(G)=>{G.addRelativeTo(E$(f,{httpAuthSchemeParametersProvider:$,identityProviderConfigProvider:U}),HW)}}),"getHttpAuthSchemePlugin"),u1=I0(),YZ=H((f)=>($)=>{throw $},"defaultErrorHandler"),QZ=H((f,$)=>{},"defaultSuccessHandler"),CW=H((f)=>($,U)=>async(G)=>{if(!u1.HttpRequest.isInstance(G.request))return $(G);const E=AW.getSmithyContext(U).selectedHttpAuthScheme;if(!E)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:W={}},identity:L,signer:I}=E,R=await $({...G,request:await I.sign(G.request,L,W)}).catch((I.errorHandler||YZ)(W));return(I.successHandler||QZ)(R.response,W),R},"httpSigningMiddleware"),zZ=OW(),qW={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:zZ.retryMiddlewareOptions.name},JZ=H((f)=>({applyToStack:($)=>{$.addRelativeTo(CW(f),qW)}}),"getHttpSigningPlugin"),NW=class f{constructor($){this.authSchemes=new Map;for(let[U,G]of Object.entries($))if(G!==void 0)this.authSchemes.set(U,G)}getIdentityProvider($){return this.authSchemes.get($)}};H(NW,"DefaultIdentityProviderConfig");var MZ=NW,k1=J0(),PW=class f{async sign($,U,G){if(!G)throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!G.name)throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!G.in)throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!U.apiKey)throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");const w=u1.HttpRequest.clone($);if(G.in===k1.HttpApiKeyAuthLocation.QUERY)w.query[G.name]=U.apiKey;else if(G.in===k1.HttpApiKeyAuthLocation.HEADER)w.headers[G.name]=G.scheme?`${G.scheme} ${U.apiKey}`:U.apiKey;else throw new Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+G.in+"`");return w}};H(PW,"HttpApiKeyAuthSigner");var TZ=PW,jW=class f{async sign($,U,G){const w=u1.HttpRequest.clone($);if(!U.token)throw new Error("request could not be signed with `token` since the `token` is not defined");return w.headers.Authorization=`Bearer ${U.token}`,w}};H(jW,"HttpBearerAuthSigner");var OZ=jW,SW=class f{async sign($,U,G){return $}};H(SW,"NoAuthSigner");var KZ=SW,bW=H((f)=>($)=>DW($)&&$.expiration.getTime()-Date.now()<f,"createIsIdentityExpiredFunction"),hW=300000,AZ=bW(hW),DW=H((f)=>f.expiration!==void 0,"doesIdentityRequireRefresh"),BZ=H((f,$,U)=>{if(f===void 0)return;const G=typeof f!=="function"?async()=>Promise.resolve(f):f;let w,E,W,L=!1;const I=H(async(R)=>{if(!E)E=G(R);try{w=await E,W=!0,L=!1}finally{E=void 0}return w},"coalesceProvider");if($===void 0)return async(R)=>{if(!W||(R==null?void 0:R.forceRefresh))w=await I(R);return w};return async(R)=>{if(!W||(R==null?void 0:R.forceRefresh))w=await I(R);if(L)return w;if(!U(w))return L=!0,w;if($(w))return await I(R),w;return w}},"memoizeIdentityProvider"),VZ=H((f)=>f[k1.SMITHY_CONTEXT_KEY]||(f[k1.SMITHY_CONTEXT_KEY]={}),"getSmithyContext"),HZ=H((f)=>{if(typeof f==="function")return f;const $=Promise.resolve(f);return()=>$},"normalizeProvider"),CZ=q0();H(kW,"requestBuilder");var cW=class f{constructor($,U){this.input=$,this.context=U,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){const{hostname:$,protocol:U="https",port:G,path:w}=await this.context.endpoint();this.path=w;for(let E of this.resolvePathStack)E(this.path);return new u1.HttpRequest({protocol:U,hostname:this.hostname||$,port:G,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn($){return this.hostname=$,this}bp($){return this.resolvePathStack.push((U)=>{this.path=`${(U==null?void 0:U.endsWith("/"))?U.slice(0,-1):U||""}`+$}),this}p($,U,G,w){return this.resolvePathStack.push((E)=>{this.path=CZ.resolvedPath(E,this.input,$,U,G,w)}),this}h($){return this.headers=$,this}q($){return this.query=$,this}b($){return this.body=$,this}m($){return this.method=$,this}};H(cW,"RequestBuilder");var uW=cW,qZ=H(async(f,$,U,...G)=>{return await $.send(new f(U),...G)},"makePagedClientRequest");H(vW,"createPaginator");var NZ=H((f,$)=>{let U=f;const G=$.split(".");for(let w of G){if(!U||typeof U!=="object")return;U=U[w]}return U},"get")});var c8=T((SK,s1)=>{var I8,R8,F8,X8,Z8,Y8,Q8,z8,J8,M8,T8,O8,K8,g1,T$,A8,B8,V8,S0,H8,C8,q8,N8,P8,j8,S8,b8,h8,n1,D8,k8;(function(f){var $=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd)define("tslib",["exports"],function(G){f(U($,U(G)))});else if(typeof s1==="object"&&typeof SK==="object")f(U($,U(SK)));else f(U($));function U(G,w){if(G!==$)if(typeof Object.create==="function")Object.defineProperty(G,"__esModule",{value:!0});else G.__esModule=!0;return function(E,W){return G[E]=w?w(E,W):W}}})(function(f){var $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,E){w.__proto__=E}||function(w,E){for(var W in E)if(Object.prototype.hasOwnProperty.call(E,W))w[W]=E[W]};I8=function(w,E){if(typeof E!=="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");$(w,E);function W(){this.constructor=w}w.prototype=E===null?Object.create(E):(W.prototype=E.prototype,new W)},R8=Object.assign||function(w){for(var E,W=1,L=arguments.length;W<L;W++){E=arguments[W];for(var I in E)if(Object.prototype.hasOwnProperty.call(E,I))w[I]=E[I]}return w},F8=function(w,E){var W={};for(var L in w)if(Object.prototype.hasOwnProperty.call(w,L)&&E.indexOf(L)<0)W[L]=w[L];if(w!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var I=0,L=Object.getOwnPropertySymbols(w);I<L.length;I++)if(E.indexOf(L[I])<0&&Object.prototype.propertyIsEnumerable.call(w,L[I]))W[L[I]]=w[L[I]]}return W},X8=function(w,E,W,L){var I=arguments.length,R=I<3?E:L===null?L=Object.getOwnPropertyDescriptor(E,W):L,F;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")R=Reflect.decorate(w,E,W,L);else for(var X=w.length-1;X>=0;X--)if(F=w[X])R=(I<3?F(R):I>3?F(E,W,R):F(E,W))||R;return I>3&&R&&Object.defineProperty(E,W,R),R},Z8=function(w,E){return function(W,L){E(W,L,w)}},Y8=function(w,E,W,L,I,R){function F(j){if(j!==void 0&&typeof j!=="function")throw new TypeError("Function expected");return j}var X=L.kind,Y=X==="getter"?"get":X==="setter"?"set":"value",Z=!E&&w?L.static?w:w.prototype:null,Q=E||(Z?Object.getOwnPropertyDescriptor(Z,L.name):{}),M,J=!1;for(var O=W.length-1;O>=0;O--){var K={};for(var A in L)K[A]=A==="access"?{}:L[A];for(var A in L.access)K.access[A]=L.access[A];K.addInitializer=function(j){if(J)throw new TypeError("Cannot add initializers after decoration has completed");R.push(F(j||null))};var B=W[O](X==="accessor"?{get:Q.get,set:Q.set}:Q[Y],K);if(X==="accessor"){if(B===void 0)continue;if(B===null||typeof B!=="object")throw new TypeError("Object expected");if(M=F(B.get))Q.get=M;if(M=F(B.set))Q.set=M;if(M=F(B.init))I.unshift(M)}else if(M=F(B))if(X==="field")I.unshift(M);else Q[Y]=M}if(Z)Object.defineProperty(Z,L.name,Q);J=!0},Q8=function(w,E,W){var L=arguments.length>2;for(var I=0;I<E.length;I++)W=L?E[I].call(w,W):E[I].call(w);return L?W:void 0},z8=function(w){return typeof w==="symbol"?w:"".concat(w)},J8=function(w,E,W){if(typeof E==="symbol")E=E.description?"[".concat(E.description,"]"):"";return Object.defineProperty(w,"name",{configurable:!0,value:W?"".concat(W," ",E):E})},M8=function(w,E){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(w,E)},T8=function(w,E,W,L){function I(R){return R instanceof W?R:new W(function(F){F(R)})}return new(W||(W=Promise))(function(R,F){function X(Q){try{Z(L.next(Q))}catch(M){F(M)}}function Y(Q){try{Z(L.throw(Q))}catch(M){F(M)}}function Z(Q){Q.done?R(Q.value):I(Q.value).then(X,Y)}Z((L=L.apply(w,E||[])).next())})},O8=function(w,E){var W={label:0,sent:function(){if(R[0]&1)throw R[1];return R[1]},trys:[],ops:[]},L,I,R,F;return F={next:X(0),throw:X(1),return:X(2)},typeof Symbol==="function"&&(F[Symbol.iterator]=function(){return this}),F;function X(Z){return function(Q){return Y([Z,Q])}}function Y(Z){if(L)throw new TypeError("Generator is already executing.");while(F&&(F=0,Z[0]&&(W=0)),W)try{if(L=1,I&&(R=Z[0]&2?I.return:Z[0]?I.throw||((R=I.return)&&R.call(I),0):I.next)&&!(R=R.call(I,Z[1])).done)return R;if(I=0,R)Z=[Z[0]&2,R.value];switch(Z[0]){case 0:case 1:R=Z;break;case 4:return W.label++,{value:Z[1],done:!1};case 5:W.label++,I=Z[1],Z=[0];continue;case 7:Z=W.ops.pop(),W.trys.pop();continue;default:if((R=W.trys,!(R=R.length>0&&R[R.length-1]))&&(Z[0]===6||Z[0]===2)){W=0;continue}if(Z[0]===3&&(!R||Z[1]>R[0]&&Z[1]<R[3])){W.label=Z[1];break}if(Z[0]===6&&W.label<R[1]){W.label=R[1],R=Z;break}if(R&&W.label<R[2]){W.label=R[2],W.ops.push(Z);break}if(R[2])W.ops.pop();W.trys.pop();continue}Z=E.call(w,W)}catch(Q){Z=[6,Q],I=0}finally{L=R=0}if(Z[0]&5)throw Z[1];return{value:Z[0]?Z[1]:void 0,done:!0}}},K8=function(w,E){for(var W in w)if(W!=="default"&&!Object.prototype.hasOwnProperty.call(E,W))n1(E,w,W)},n1=Object.create?function(w,E,W,L){if(L===void 0)L=W;var I=Object.getOwnPropertyDescriptor(E,W);if(!I||("get"in I?!E.__esModule:I.writable||I.configurable))I={enumerable:!0,get:function(){return E[W]}};Object.defineProperty(w,L,I)}:function(w,E,W,L){if(L===void 0)L=W;w[L]=E[W]},g1=function(w){var E=typeof Symbol==="function"&&Symbol.iterator,W=E&&w[E],L=0;if(W)return W.call(w);if(w&&typeof w.length==="number")return{next:function(){if(w&&L>=w.length)w=void 0;return{value:w&&w[L++],done:!w}}};throw new TypeError(E?"Object is not iterable.":"Symbol.iterator is not defined.")},T$=function(w,E){var W=typeof Symbol==="function"&&w[Symbol.iterator];if(!W)return w;var L=W.call(w),I,R=[],F;try{while((E===void 0||E-- >0)&&!(I=L.next()).done)R.push(I.value)}catch(X){F={error:X}}finally{try{if(I&&!I.done&&(W=L.return))W.call(L)}finally{if(F)throw F.error}}return R},A8=function(){for(var w=[],E=0;E<arguments.length;E++)w=w.concat(T$(arguments[E]));return w},B8=function(){for(var w=0,E=0,W=arguments.length;E<W;E++)w+=arguments[E].length;for(var L=Array(w),I=0,E=0;E<W;E++)for(var R=arguments[E],F=0,X=R.length;F<X;F++,I++)L[I]=R[F];return L},V8=function(w,E,W){if(W||arguments.length===2){for(var L=0,I=E.length,R;L<I;L++)if(R||!(L in E)){if(!R)R=Array.prototype.slice.call(E,0,L);R[L]=E[L]}}return w.concat(R||Array.prototype.slice.call(E))},S0=function(w){return this instanceof S0?(this.v=w,this):new S0(w)},H8=function(w,E,W){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var L=W.apply(w,E||[]),I,R=[];return I={},X("next"),X("throw"),X("return",F),I[Symbol.asyncIterator]=function(){return this},I;function F(O){return function(K){return Promise.resolve(K).then(O,M)}}function X(O,K){if(L[O]){if(I[O]=function(A){return new Promise(function(B,j){R.push([O,A,B,j])>1||Y(O,A)})},K)I[O]=K(I[O])}}function Y(O,K){try{Z(L[O](K))}catch(A){J(R[0][3],A)}}function Z(O){O.value instanceof S0?Promise.resolve(O.value.v).then(Q,M):J(R[0][2],O)}function Q(O){Y("next",O)}function M(O){Y("throw",O)}function J(O,K){if(O(K),R.shift(),R.length)Y(R[0][0],R[0][1])}},C8=function(w){var E,W;return E={},L("next"),L("throw",function(I){throw I}),L("return"),E[Symbol.iterator]=function(){return this},E;function L(I,R){E[I]=w[I]?function(F){return(W=!W)?{value:S0(w[I](F)),done:!1}:R?R(F):F}:R}},q8=function(w){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var E=w[Symbol.asyncIterator],W;return E?E.call(w):(w=typeof g1==="function"?g1(w):w[Symbol.iterator](),W={},L("next"),L("throw"),L("return"),W[Symbol.asyncIterator]=function(){return this},W);function L(R){W[R]=w[R]&&function(F){return new Promise(function(X,Y){F=w[R](F),I(X,Y,F.done,F.value)})}}function I(R,F,X,Y){Promise.resolve(Y).then(function(Z){R({value:Z,done:X})},F)}},N8=function(w,E){if(Object.defineProperty)Object.defineProperty(w,"raw",{value:E});else w.raw=E;return w};var U=Object.create?function(w,E){Object.defineProperty(w,"default",{enumerable:!0,value:E})}:function(w,E){w.default=E};P8=function(w){if(w&&w.__esModule)return w;var E={};if(w!=null){for(var W in w)if(W!=="default"&&Object.prototype.hasOwnProperty.call(w,W))n1(E,w,W)}return U(E,w),E},j8=function(w){return w&&w.__esModule?w:{default:w}},S8=function(w,E,W,L){if(W==="a"&&!L)throw new TypeError("Private accessor was defined without a getter");if(typeof E==="function"?w!==E||!L:!E.has(w))throw new TypeError("Cannot read private member from an object whose class did not declare it");return W==="m"?L:W==="a"?L.call(w):L?L.value:E.get(w)},b8=function(w,E,W,L,I){if(L==="m")throw new TypeError("Private method is not writable");if(L==="a"&&!I)throw new TypeError("Private accessor was defined without a setter");if(typeof E==="function"?w!==E||!I:!E.has(w))throw new TypeError("Cannot write private member to an object whose class did not declare it");return L==="a"?I.call(w,W):I?I.value=W:E.set(w,W),W},h8=function(w,E){if(E===null||typeof E!=="object"&&typeof E!=="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof w==="function"?E===w:w.has(E)},D8=function(w,E,W){if(E!==null&&E!==void 0){if(typeof E!=="object"&&typeof E!=="function")throw new TypeError("Object expected.");var L,I;if(W){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");L=E[Symbol.asyncDispose]}if(L===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");if(L=E[Symbol.dispose],W)I=L}if(typeof L!=="function")throw new TypeError("Object not disposable.");if(I)L=function(){try{I.call(this)}catch(R){return Promise.reject(R)}};w.stack.push({value:E,dispose:L,async:W})}else if(W)w.stack.push({async:!0});return E};var G=typeof SuppressedError==="function"?SuppressedError:function(w,E,W){var L=new Error(W);return L.name="SuppressedError",L.error=w,L.suppressed=E,L};k8=function(w){function E(L){w.error=w.hasError?new G(L,w.error,"An error was suppressed during disposal."):L,w.hasError=!0}function W(){while(w.stack.length){var L=w.stack.pop();try{var I=L.dispose&&L.dispose.call(L.value);if(L.async)return Promise.resolve(I).then(W,function(R){return E(R),W()})}catch(R){E(R)}}if(w.hasError)throw w.error}return W()},f("__extends",I8),f("__assign",R8),f("__rest",F8),f("__decorate",X8),f("__param",Z8),f("__esDecorate",Y8),f("__runInitializers",Q8),f("__propKey",z8),f("__setFunctionName",J8),f("__metadata",M8),f("__awaiter",T8),f("__generator",O8),f("__exportStar",K8),f("__createBinding",n1),f("__values",g1),f("__read",T$),f("__spread",A8),f("__spreadArrays",B8),f("__spreadArray",V8),f("__await",S0),f("__asyncGenerator",H8),f("__asyncDelegator",C8),f("__asyncValues",q8),f("__makeTemplateObject",N8),f("__importStar",P8),f("__importDefault",j8),f("__classPrivateFieldGet",S8),f("__classPrivateFieldSet",b8),f("__classPrivateFieldIn",h8),f("__addDisposableResource",D8),f("__disposeResources",k8)})});var _8=T((bK,x8)=>{var{defineProperty:l1,getOwnPropertyDescriptor:iZ,getOwnPropertyNames:rZ}=Object,oZ=Object.prototype.hasOwnProperty,tZ=(f,$)=>l1(f,"name",{value:$,configurable:!0}),aZ=(f,$)=>{for(var U in $)l1(f,U,{get:$[U],enumerable:!0})},eZ=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of rZ($))if(!oZ.call(f,w)&&w!==U)l1(f,w,{get:()=>$[w],enumerable:!(G=iZ($,w))||G.enumerable})}return f},f5=(f)=>eZ(l1({},"__esModule",{value:!0}),f),v8={};aZ(v8,{emitWarningIfUnsupportedVersion:()=>$5});x8.exports=f5(v8);var u8=!1,$5=tZ((f)=>{if(f&&!u8&&parseInt(f.substring(1,f.indexOf(".")))<18)u8=!0,process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
4
- no longer support Node.js 16.x on January 6, 2025.
5
-
6
- To continue receiving updates to AWS services, bug fixes, and security
7
- updates please upgrade to a supported Node.js LTS version.
8
-
9
- More information can be found at: https://a.co/74kJMmI`)},"emitWarningIfUnsupportedVersion")});var EL=T((hK,GL)=>{function V$(f){for(let $=0;$<8;$++)f[$]^=255;for(let $=7;$>-1;$--)if(f[$]++,f[$]!==0)break}var{defineProperty:t1,getOwnPropertyDescriptor:G5,getOwnPropertyNames:E5}=Object,W5=Object.prototype.hasOwnProperty,b=(f,$)=>t1(f,"name",{value:$,configurable:!0}),L5=(f,$)=>{for(var U in $)t1(f,U,{get:$[U],enumerable:!0})},I5=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of E5($))if(!W5.call(f,w)&&w!==U)t1(f,w,{get:()=>$[w],enumerable:!(G=G5($,w))||G.enumerable})}return f},R5=(f)=>I5(t1({},"__esModule",{value:!0}),f),n8={};L5(n8,{SignatureV4:()=>c5,clearCredentialCache:()=>q5,createScope:()=>r1,getCanonicalHeaders:()=>B$,getCanonicalQuery:()=>a8,getPayloadHash:()=>o1,getSigningKey:()=>t8,moveHeadersToQuery:()=>UL,prepareRequest:()=>H$});GL.exports=R5(n8);var y8=c0(),O$=B0(),F5="X-Amz-Algorithm",X5="X-Amz-Credential",s8="X-Amz-Date",Z5="X-Amz-SignedHeaders",Y5="X-Amz-Expires",l8="X-Amz-Signature",m8="X-Amz-Security-Token",i8="authorization",r8=s8.toLowerCase(),Q5="date",z5=[i8,r8,Q5],J5=l8.toLowerCase(),A$="x-amz-content-sha256",M5=m8.toLowerCase(),T5={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},O5=/^proxy-/,K5=/^sec-/,K$="AWS4-HMAC-SHA256",A5="AWS4-HMAC-SHA256-PAYLOAD",B5="UNSIGNED-PAYLOAD",V5=50,o8="aws4_request",H5=604800,U0=UE(),C5=B0(),b0={},i1=[],r1=b((f,$,U)=>`${f}/${$}/${U}/${o8}`,"createScope"),t8=b(async(f,$,U,G,w)=>{const E=await p8(f,$.secretAccessKey,$.accessKeyId),W=`${U}:${G}:${w}:${U0.toHex(E)}:${$.sessionToken}`;if(W in b0)return b0[W];i1.push(W);while(i1.length>V5)delete b0[i1.shift()];let L=`AWS4${$.secretAccessKey}`;for(let I of[U,G,w,o8])L=await p8(f,L,I);return b0[W]=L},"getSigningKey"),q5=b(()=>{i1.length=0,Object.keys(b0).forEach((f)=>{delete b0[f]})},"clearCredentialCache"),p8=b((f,$,U)=>{const G=new f($);return G.update(C5.toUint8Array(U)),G.digest()},"hmac"),B$=b(({headers:f},$,U)=>{const G={};for(let w of Object.keys(f).sort()){if(f[w]==null)continue;const E=w.toLowerCase();if(E in T5||($==null?void 0:$.has(E))||O5.test(E)||K5.test(E)){if(!U||U&&!U.has(E))continue}G[E]=f[w].trim().replace(/\s+/g," ")}return G},"getCanonicalHeaders"),t0=w5(),a8=b(({query:f={}})=>{const $=[],U={};for(let G of Object.keys(f).sort()){if(G.toLowerCase()===J5)continue;$.push(G);const w=f[G];if(typeof w==="string")U[G]=`${t0.escapeUri(G)}=${t0.escapeUri(w)}`;else if(Array.isArray(w))U[G]=w.slice(0).reduce((E,W)=>E.concat([`${t0.escapeUri(G)}=${t0.escapeUri(W)}`]),[]).sort().join("&")}return $.map((G)=>U[G]).filter((G)=>G).join("&")},"getCanonicalQuery"),N5=U5(),P5=B0(),o1=b(async({headers:f,body:$},U)=>{for(let G of Object.keys(f))if(G.toLowerCase()===A$)return f[G];if($==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof $==="string"||ArrayBuffer.isView($)||N5.isArrayBuffer($)){const G=new U;return G.update(P5.toUint8Array($)),U0.toHex(await G.digest())}return B5},"getPayloadHash"),d8=B0(),e8=class f{format($){const U=[];for(let E of Object.keys($)){const W=d8.fromUtf8(E);U.push(Uint8Array.from([W.byteLength]),W,this.formatHeaderValue($[E]))}const G=new Uint8Array(U.reduce((E,W)=>E+W.byteLength,0));let w=0;for(let E of U)G.set(E,w),w+=E.byteLength;return G}formatHeaderValue($){switch($.type){case"boolean":return Uint8Array.from([$.value?0:1]);case"byte":return Uint8Array.from([2,$.value]);case"short":const U=new DataView(new ArrayBuffer(3));return U.setUint8(0,3),U.setInt16(1,$.value,!1),new Uint8Array(U.buffer);case"integer":const G=new DataView(new ArrayBuffer(5));return G.setUint8(0,4),G.setInt32(1,$.value,!1),new Uint8Array(G.buffer);case"long":const w=new Uint8Array(9);return w[0]=5,w.set($.value.bytes,1),w;case"binary":const E=new DataView(new ArrayBuffer(3+$.value.byteLength));E.setUint8(0,6),E.setUint16(1,$.value.byteLength,!1);const W=new Uint8Array(E.buffer);return W.set($.value,3),W;case"string":const L=d8.fromUtf8($.value),I=new DataView(new ArrayBuffer(3+L.byteLength));I.setUint8(0,7),I.setUint16(1,L.byteLength,!1);const R=new Uint8Array(I.buffer);return R.set(L,3),R;case"timestamp":const F=new Uint8Array(9);return F[0]=8,F.set(b5.fromNumber($.value.valueOf()).bytes,1),F;case"uuid":if(!S5.test($.value))throw new Error(`Invalid UUID received: ${$.value}`);const X=new Uint8Array(17);return X[0]=9,X.set(U0.fromHex($.value.replace(/\-/g,"")),1),X}}};b(e8,"HeaderFormatter");var j5=e8,S5=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,fL=class f{constructor($){if(this.bytes=$,$.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber($){if($>9223372036854776000||$<-9223372036854776000)throw new Error(`${$} is too large (or, if negative, too small) to represent as an Int64`);const U=new Uint8Array(8);for(let G=7,w=Math.abs(Math.round($));G>-1&&w>0;G--,w/=256)U[G]=w;if($<0)V$(U);return new f(U)}valueOf(){const $=this.bytes.slice(0),U=$[0]&128;if(U)V$($);return parseInt(U0.toHex($),16)*(U?-1:1)}toString(){return String(this.valueOf())}};b(fL,"Int64");var b5=fL;b(V$,"negate");var h5=b((f,$)=>{f=f.toLowerCase();for(let U of Object.keys($))if(f===U.toLowerCase())return!0;return!1},"hasHeader"),$L=I0(),UL=b((f,$={})=>{var U;const{headers:G,query:w={}}=$L.HttpRequest.clone(f);for(let E of Object.keys(G)){const W=E.toLowerCase();if(W.slice(0,6)==="x-amz-"&&!((U=$.unhoistableHeaders)==null?void 0:U.has(W)))w[E]=G[E],delete G[E]}return{...f,headers:G,query:w}},"moveHeadersToQuery"),H$=b((f)=>{f=$L.HttpRequest.clone(f);for(let $ of Object.keys(f.headers))if(z5.indexOf($.toLowerCase())>-1)delete f.headers[$];return f},"prepareRequest"),D5=b((f)=>k5(f).toISOString().replace(/\.\d{3}Z$/,"Z"),"iso8601"),k5=b((f)=>{if(typeof f==="number")return new Date(f*1000);if(typeof f==="string"){if(Number(f))return new Date(Number(f)*1000);return new Date(f)}return f},"toDate"),wL=class f{constructor({applyChecksum:$,credentials:U,region:G,service:w,sha256:E,uriEscapePath:W=!0}){this.headerFormatter=new j5,this.service=w,this.sha256=E,this.uriEscapePath=W,this.applyChecksum=typeof $==="boolean"?$:!0,this.regionProvider=y8.normalizeProvider(G),this.credentialProvider=y8.normalizeProvider(U)}async presign($,U={}){const{signingDate:G=new Date,expiresIn:w=3600,unsignableHeaders:E,unhoistableHeaders:W,signableHeaders:L,signingRegion:I,signingService:R}=U,F=await this.credentialProvider();this.validateResolvedCredentials(F);const X=I??await this.regionProvider(),{longDate:Y,shortDate:Z}=m1(G);if(w>H5)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const Q=r1(Z,X,R??this.service),M=UL(H$($),{unhoistableHeaders:W});if(F.sessionToken)M.query[m8]=F.sessionToken;M.query[F5]=K$,M.query[X5]=`${F.accessKeyId}/${Q}`,M.query[s8]=Y,M.query[Y5]=w.toString(10);const J=B$(M,E,L);return M.query[Z5]=g8(J),M.query[l8]=await this.getSignature(Y,Q,this.getSigningKey(F,X,Z,R),this.createCanonicalRequest(M,J,await o1($,this.sha256))),M}async sign($,U){if(typeof $==="string")return this.signString($,U);else if($.headers&&$.payload)return this.signEvent($,U);else if($.message)return this.signMessage($,U);else return this.signRequest($,U)}async signEvent({headers:$,payload:U},{signingDate:G=new Date,priorSignature:w,signingRegion:E,signingService:W}){const L=E??await this.regionProvider(),{shortDate:I,longDate:R}=m1(G),F=r1(I,L,W??this.service),X=await o1({headers:{},body:U},this.sha256),Y=new this.sha256;Y.update($);const Z=U0.toHex(await Y.digest()),Q=[A5,R,F,w,Z,X].join("\n");return this.signString(Q,{signingDate:G,signingRegion:L,signingService:W})}async signMessage($,{signingDate:U=new Date,signingRegion:G,signingService:w}){return this.signEvent({headers:this.headerFormatter.format($.message.headers),payload:$.message.body},{signingDate:U,signingRegion:G,signingService:w,priorSignature:$.priorSignature}).then((W)=>{return{message:$.message,signature:W}})}async signString($,{signingDate:U=new Date,signingRegion:G,signingService:w}={}){const E=await this.credentialProvider();this.validateResolvedCredentials(E);const W=G??await this.regionProvider(),{shortDate:L}=m1(U),I=new this.sha256(await this.getSigningKey(E,W,L,w));return I.update(O$.toUint8Array($)),U0.toHex(await I.digest())}async signRequest($,{signingDate:U=new Date,signableHeaders:G,unsignableHeaders:w,signingRegion:E,signingService:W}={}){const L=await this.credentialProvider();this.validateResolvedCredentials(L);const I=E??await this.regionProvider(),R=H$($),{longDate:F,shortDate:X}=m1(U),Y=r1(X,I,W??this.service);if(R.headers[r8]=F,L.sessionToken)R.headers[M5]=L.sessionToken;const Z=await o1(R,this.sha256);if(!h5(A$,R.headers)&&this.applyChecksum)R.headers[A$]=Z;const Q=B$(R,w,G),M=await this.getSignature(F,Y,this.getSigningKey(L,I,X,W),this.createCanonicalRequest(R,Q,Z));return R.headers[i8]=`${K$} Credential=${L.accessKeyId}/${Y}, SignedHeaders=${g8(Q)}, Signature=${M}`,R}createCanonicalRequest($,U,G){const w=Object.keys(U).sort();return`${$.method}
10
- ${this.getCanonicalPath($)}
11
- ${a8($)}
12
- ${w.map((E)=>`${E}:${U[E]}`).join("\n")}
13
-
14
- ${w.join(";")}
15
- ${G}`}async createStringToSign($,U,G){const w=new this.sha256;w.update(O$.toUint8Array(G));const E=await w.digest();return`${K$}
16
- ${$}
17
- ${U}
18
- ${U0.toHex(E)}`}getCanonicalPath({path:$}){if(this.uriEscapePath){const U=[];for(let E of $.split("/")){if((E==null?void 0:E.length)===0)continue;if(E===".")continue;if(E==="..")U.pop();else U.push(E)}const G=`${($==null?void 0:$.startsWith("/"))?"/":""}${U.join("/")}${U.length>0&&($==null?void 0:$.endsWith("/"))?"/":""}`;return t0.escapeUri(G).replace(/%2F/g,"/")}return $}async getSignature($,U,G,w){const E=await this.createStringToSign($,U,w),W=new this.sha256(await G);return W.update(O$.toUint8Array(E)),U0.toHex(await W.digest())}getSigningKey($,U,G,w){return t8(this.sha256,$,G,U,w||this.service)}validateResolvedCredentials($){if(typeof $!=="object"||typeof $.accessKeyId!=="string"||typeof $.secretAccessKey!=="string")throw new Error("Resolved credential object is not valid")}};b(wL,"SignatureV4");var c5=wL,m1=b((f)=>{const $=D5(f).replace(/[\-:]/g,"");return{longDate:$,shortDate:$.slice(0,8)}},"formatDate"),g8=b((f)=>Object.keys(f).sort().join(";"),"getCanonicalHeaderList")});var zL=T((DK,QL)=>{var{defineProperty:a1,getOwnPropertyDescriptor:u5,getOwnPropertyNames:v5}=Object,x5=Object.prototype.hasOwnProperty,k=(f,$)=>a1(f,"name",{value:$,configurable:!0}),_5=(f,$)=>{for(var U in $)a1(f,U,{get:$[U],enumerable:!0})},y5=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of v5($))if(!x5.call(f,w)&&w!==U)a1(f,w,{get:()=>$[w],enumerable:!(G=u5($,w))||G.enumerable})}return f},p5=(f)=>y5(a1({},"__esModule",{value:!0}),f),FL={};_5(FL,{AWSSDKSigV4Signer:()=>s5,AwsSdkSigV4ASigner:()=>m5,AwsSdkSigV4Signer:()=>N$,NODE_SIGV4A_CONFIG_OPTIONS:()=>o5,resolveAWSSDKSigV4Config:()=>t5,resolveAwsSdkSigV4AConfig:()=>r5,resolveAwsSdkSigV4Config:()=>YL,validateSigningProperties:()=>q$});QL.exports=p5(FL);var d5=I0(),g5=I0(),WL=k((f)=>{var $,U;return g5.HttpResponse.isInstance(f)?(($=f.headers)==null?void 0:$.date)??((U=f.headers)==null?void 0:U.Date):void 0},"getDateHeader"),C$=k((f)=>new Date(Date.now()+f),"getSkewCorrectedDate"),n5=k((f,$)=>Math.abs(C$($).getTime()-f)>=300000,"isClockSkewed"),LL=k((f,$)=>{const U=Date.parse(f);if(n5(U,$))return U-Date.now();return $},"getUpdatedSystemClockOffset"),a0=k((f,$)=>{if(!$)throw new Error(`Property \`${f}\` is not resolved for AWS SDK SigV4Auth`);return $},"throwSigningPropertyError"),q$=k(async(f)=>{var $,U,G;const w=a0("context",f.context),E=a0("config",f.config),W=(G=(U=($=w.endpointV2)==null?void 0:$.properties)==null?void 0:U.authSchemes)==null?void 0:G[0],I=await a0("signer",E.signer)(W),R=f==null?void 0:f.signingRegion,F=f==null?void 0:f.signingRegionSet,X=f==null?void 0:f.signingName;return{config:E,signer:I,signingRegion:R,signingRegionSet:F,signingName:X}},"validateSigningProperties"),XL=class f{async sign($,U,G){var w;if(!d5.HttpRequest.isInstance($))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const E=await q$(G),{config:W,signer:L}=E;let{signingRegion:I,signingName:R}=E;const F=G.context;if(((w=F==null?void 0:F.authSchemes)==null?void 0:w.length)??0>1){const[Y,Z]=F.authSchemes;if((Y==null?void 0:Y.name)==="sigv4a"&&(Z==null?void 0:Z.name)==="sigv4")I=(Z==null?void 0:Z.signingRegion)??I,R=(Z==null?void 0:Z.signingName)??R}return await L.sign($,{signingDate:C$(W.systemClockOffset),signingRegion:I,signingService:R})}errorHandler($){return(U)=>{const G=U.ServerTime??WL(U.$response);if(G){const w=a0("config",$.config),E=w.systemClockOffset;if(w.systemClockOffset=LL(G,w.systemClockOffset),w.systemClockOffset!==E&&U.$metadata)U.$metadata.clockSkewCorrected=!0}throw U}}successHandler($,U){const G=WL($);if(G){const w=a0("config",U.config);w.systemClockOffset=LL(G,w.systemClockOffset)}}};k(XL,"AwsSdkSigV4Signer");var N$=XL,s5=N$,l5=I0(),ZL=class f extends N${async sign($,U,G){var w;if(!l5.HttpRequest.isInstance($))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:E,signer:W,signingRegion:L,signingRegionSet:I,signingName:R}=await q$(G),X=(await((w=E.sigv4aSigningRegionSet)==null?void 0:w.call(E))??I??[L]).join(",");return await W.sign($,{signingDate:C$(E.systemClockOffset),signingRegion:X,signingService:R})}};k(ZL,"AwsSdkSigV4ASigner");var m5=ZL,i5=W$(),IL=Xf(),r5=k((f)=>{return f.sigv4aSigningRegionSet=i5.normalizeProvider(f.sigv4aSigningRegionSet),f},"resolveAwsSdkSigV4AConfig"),o5={environmentVariableSelector(f){if(f.AWS_SIGV4A_SIGNING_REGION_SET)return f.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map(($)=>$.trim());throw new IL.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.",{tryNextLink:!0})},configFileSelector(f){if(f.sigv4a_signing_region_set)return(f.sigv4a_signing_region_set??"").split(",").map(($)=>$.trim());throw new IL.ProviderError("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0},Q0=W$(),RL=EL(),YL=k((f)=>{let $;if(f.credentials)$=Q0.memoizeIdentityProvider(f.credentials,Q0.isIdentityExpired,Q0.doesIdentityRequireRefresh);if(!$)if(f.credentialDefaultProvider)$=Q0.normalizeProvider(f.credentialDefaultProvider(Object.assign({},f,{parentClientConfig:f})));else $=k(async()=>{throw new Error("`credentials` is missing")},"normalizedCreds");const{signingEscapePath:U=!0,systemClockOffset:G=f.systemClockOffset||0,sha256:w}=f;let E;if(f.signer)E=Q0.normalizeProvider(f.signer);else if(f.regionInfoProvider)E=k(()=>Q0.normalizeProvider(f.region)().then(async(W)=>[await f.regionInfoProvider(W,{useFipsEndpoint:await f.useFipsEndpoint(),useDualstackEndpoint:await f.useDualstackEndpoint()})||{},W]).then(([W,L])=>{const{signingRegion:I,signingService:R}=W;f.signingRegion=f.signingRegion||I||L,f.signingName=f.signingName||R||f.serviceId;const F={...f,credentials:$,region:f.signingRegion,service:f.signingName,sha256:w,uriEscapePath:U};return new(f.signerConstructor||RL.SignatureV4)(F)}),"signer");else E=k(async(W)=>{W=Object.assign({},{name:"sigv4",signingName:f.signingName||f.defaultSigningName,signingRegion:await Q0.normalizeProvider(f.region)(),properties:{}},W);const{signingRegion:L,signingName:I}=W;f.signingRegion=f.signingRegion||L,f.signingName=f.signingName||I||f.serviceId;const R={...f,credentials:$,region:f.signingRegion,service:f.signingName,sha256:w,uriEscapePath:U};return new(f.signerConstructor||RL.SignatureV4)(R)},"signer");return{...f,systemClockOffset:G,signingEscapePath:U,credentials:$,signer:E}},"resolveAwsSdkSigV4Config"),t5=YL});var e1=T((UY)=>{var a5=":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\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",JL="[: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]["+a5+"]*",e5=new RegExp("^"+JL+"$"),fY=function(f,$){const U=[];let G=$.exec(f);while(G){const w=[];w.startIndex=$.lastIndex-G[0].length;const E=G.length;for(let W=0;W<E;W++)w.push(G[W]);U.push(w),G=$.exec(f)}return U},$Y=function(f){const $=e5.exec(f);return!($===null||typeof $==="undefined")};UY.isExist=function(f){return typeof f!=="undefined"};UY.isEmptyObject=function(f){return Object.keys(f).length===0};UY.merge=function(f,$,U){if($){const G=Object.keys($),w=G.length;for(let E=0;E<w;E++)if(U==="strict")f[G[E]]=[$[G[E]]];else f[G[E]]=$[G[E]]}};UY.getValue=function(f){if(UY.isExist(f))return f;else return""};UY.isName=$Y;UY.getAllMatches=fY;UY.nameRegexp=JL});var j$=T((TY)=>{function TL(f){return f===" "||f==="\t"||f==="\n"||f==="\r"}function OL(f,$){const U=$;for(;$<f.length;$++)if(f[$]=="?"||f[$]==" "){const G=f.substr(U,$-U);if($>5&&G==="xml")return P("InvalidXml","XML declaration allowed only at the start of the document.",D(f,$));else if(f[$]=="?"&&f[$+1]==">"){$++;break}else continue}return $}function KL(f,$){if(f.length>$+5&&f[$+1]==="-"&&f[$+2]==="-"){for($+=3;$<f.length;$++)if(f[$]==="-"&&f[$+1]==="-"&&f[$+2]===">"){$+=2;break}}else if(f.length>$+8&&f[$+1]==="D"&&f[$+2]==="O"&&f[$+3]==="C"&&f[$+4]==="T"&&f[$+5]==="Y"&&f[$+6]==="P"&&f[$+7]==="E"){let U=1;for($+=8;$<f.length;$++)if(f[$]==="<")U++;else if(f[$]===">"){if(U--,U===0)break}}else if(f.length>$+9&&f[$+1]==="["&&f[$+2]==="C"&&f[$+3]==="D"&&f[$+4]==="A"&&f[$+5]==="T"&&f[$+6]==="A"&&f[$+7]==="["){for($+=8;$<f.length;$++)if(f[$]==="]"&&f[$+1]==="]"&&f[$+2]===">"){$+=2;break}}return $}function ZY(f,$){let U="",G="",w=!1;for(;$<f.length;$++){if(f[$]===FY||f[$]===XY)if(G==="")G=f[$];else if(G!==f[$]);else G="";else if(f[$]===">"){if(G===""){w=!0;break}}U+=f[$]}if(G!=="")return!1;return{value:U,index:$,tagClosed:w}}function AL(f,$){const U=P$.getAllMatches(f,YY),G={};for(let w=0;w<U.length;w++){if(U[w][1].length===0)return P("InvalidAttr","Attribute '"+U[w][2]+"' has no space in starting.",e0(U[w]));else if(U[w][3]!==void 0&&U[w][4]===void 0)return P("InvalidAttr","Attribute '"+U[w][2]+"' is without value.",e0(U[w]));else if(U[w][3]===void 0&&!$.allowBooleanAttributes)return P("InvalidAttr","boolean attribute '"+U[w][2]+"' is not allowed.",e0(U[w]));const E=U[w][2];if(!JY(E))return P("InvalidAttr","Attribute '"+E+"' is an invalid name.",e0(U[w]));if(!G.hasOwnProperty(E))G[E]=1;else return P("InvalidAttr","Attribute '"+E+"' is repeated.",e0(U[w]))}return!0}function QY(f,$){let U=/\d/;if(f[$]==="x")$++,U=/[\da-fA-F]/;for(;$<f.length;$++){if(f[$]===";")return $;if(!f[$].match(U))break}return-1}function zY(f,$){if($++,f[$]===";")return-1;if(f[$]==="#")return $++,QY(f,$);let U=0;for(;$<f.length;$++,U++){if(f[$].match(/\w/)&&U<20)continue;if(f[$]===";")break;return-1}return $}function P(f,$,U){return{err:{code:f,msg:$,line:U.line||U,col:U.col}}}function JY(f){return P$.isName(f)}function MY(f){return P$.isName(f)}function D(f,$){const U=f.substring(0,$).split(/\r?\n/);return{line:U.length,col:U[U.length-1].length+1}}function e0(f){return f.startIndex+f[1].length}var P$=e1(),RY={allowBooleanAttributes:!1,unpairedTags:[]};TY.validate=function(f,$){$=Object.assign({},RY,$);const U=[];let G=!1,w=!1;if(f[0]==="\uFEFF")f=f.substr(1);for(let E=0;E<f.length;E++)if(f[E]==="<"&&f[E+1]==="?"){if(E+=2,E=OL(f,E),E.err)return E}else if(f[E]==="<"){let W=E;if(E++,f[E]==="!"){E=KL(f,E);continue}else{let L=!1;if(f[E]==="/")L=!0,E++;let I="";for(;E<f.length&&f[E]!==">"&&f[E]!==" "&&f[E]!=="\t"&&f[E]!=="\n"&&f[E]!=="\r";E++)I+=f[E];if(I=I.trim(),I[I.length-1]==="/")I=I.substring(0,I.length-1),E--;if(!MY(I)){let X;if(I.trim().length===0)X="Invalid space after '<'.";else X="Tag '"+I+"' is an invalid name.";return P("InvalidTag",X,D(f,E))}const R=ZY(f,E);if(R===!1)return P("InvalidAttr","Attributes for '"+I+"' have open quote.",D(f,E));let F=R.value;if(E=R.index,F[F.length-1]==="/"){const X=E-F.length;F=F.substring(0,F.length-1);const Y=AL(F,$);if(Y===!0)G=!0;else return P(Y.err.code,Y.err.msg,D(f,X+Y.err.line))}else if(L)if(!R.tagClosed)return P("InvalidTag","Closing tag '"+I+"' doesn't have proper closing.",D(f,E));else if(F.trim().length>0)return P("InvalidTag","Closing tag '"+I+"' can't have attributes or invalid starting.",D(f,W));else if(U.length===0)return P("InvalidTag","Closing tag '"+I+"' has not been opened.",D(f,W));else{const X=U.pop();if(I!==X.tagName){let Y=D(f,X.tagStartPos);return P("InvalidTag","Expected closing tag '"+X.tagName+"' (opened in line "+Y.line+", col "+Y.col+") instead of closing tag '"+I+"'.",D(f,W))}if(U.length==0)w=!0}else{const X=AL(F,$);if(X!==!0)return P(X.err.code,X.err.msg,D(f,E-F.length+X.err.line));if(w===!0)return P("InvalidXml","Multiple possible root nodes found.",D(f,E));else if($.unpairedTags.indexOf(I)!==-1);else U.push({tagName:I,tagStartPos:W});G=!0}for(E++;E<f.length;E++)if(f[E]==="<")if(f[E+1]==="!"){E++,E=KL(f,E);continue}else if(f[E+1]==="?"){if(E=OL(f,++E),E.err)return E}else break;else if(f[E]==="&"){const X=zY(f,E);if(X==-1)return P("InvalidChar","char '&' is not expected.",D(f,E));E=X}else if(w===!0&&!TL(f[E]))return P("InvalidXml","Extra text at the end",D(f,E));if(f[E]==="<")E--}}else{if(TL(f[E]))continue;return P("InvalidChar","char '"+f[E]+"' is not expected.",D(f,E))}if(!G)return P("InvalidXml","Start tag expected.",1);else if(U.length==1)return P("InvalidTag","Unclosed tag '"+U[0].tagName+"'.",D(f,U[0].tagStartPos));else if(U.length>0)return P("InvalidXml","Invalid '"+JSON.stringify(U.map((E)=>E.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1});return!0};var FY='"',XY="'",YY=new RegExp('(\\s*)([^\\s=]+)(\\s*=)?(\\s*([\'"])(([\\s\\S])*?)\\5)?',"g")});var VL=T((AY)=>{var BL={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(f,$){return $},attributeValueProcessor:function(f,$){return $},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(f,$,U){return f}},KY=function(f){return Object.assign({},BL,f)};AY.buildOptions=KY;AY.defaultOptions=BL});var qL=T((vK,CL)=>{class HL{constructor(f){this.tagname=f,this.child=[],this[":@"]={}}add(f,$){if(f==="__proto__")f="#__proto__";this.child.push({[f]:$})}addChild(f){if(f.tagname==="__proto__")f.tagname="#__proto__";if(f[":@"]&&Object.keys(f[":@"]).length>0)this.child.push({[f.tagname]:f.child,[":@"]:f[":@"]});else this.child.push({[f.tagname]:f.child})}}CL.exports=HL});var PL=T((xK,NL)=>{function CY(f,$){const U={};if(f[$+3]==="O"&&f[$+4]==="C"&&f[$+5]==="T"&&f[$+6]==="Y"&&f[$+7]==="P"&&f[$+8]==="E"){$=$+9;let G=1,w=!1,E=!1,W="";for(;$<f.length;$++)if(f[$]==="<"&&!E){if(w&&PY(f,$)){if($+=7,[entityName,val,$]=qY(f,$+1),val.indexOf("&")===-1)U[hY(entityName)]={regx:RegExp(`&${entityName};`,"g"),val}}else if(w&&jY(f,$))$+=8;else if(w&&SY(f,$))$+=8;else if(w&&bY(f,$))$+=9;else if(NY)E=!0;else throw new Error("Invalid DOCTYPE");G++,W=""}else if(f[$]===">"){if(E){if(f[$-1]==="-"&&f[$-2]==="-")E=!1,G--}else G--;if(G===0)break}else if(f[$]==="[")w=!0;else W+=f[$];if(G!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:U,i:$}}function qY(f,$){let U="";for(;$<f.length&&(f[$]!=="'"&&f[$]!=='"');$++)U+=f[$];if(U=U.trim(),U.indexOf(" ")!==-1)throw new Error("External entites are not supported");const G=f[$++];let w="";for(;$<f.length&&f[$]!==G;$++)w+=f[$];return[U,w,$]}function NY(f,$){if(f[$+1]==="!"&&f[$+2]==="-"&&f[$+3]==="-")return!0;return!1}function PY(f,$){if(f[$+1]==="!"&&f[$+2]==="E"&&f[$+3]==="N"&&f[$+4]==="T"&&f[$+5]==="I"&&f[$+6]==="T"&&f[$+7]==="Y")return!0;return!1}function jY(f,$){if(f[$+1]==="!"&&f[$+2]==="E"&&f[$+3]==="L"&&f[$+4]==="E"&&f[$+5]==="M"&&f[$+6]==="E"&&f[$+7]==="N"&&f[$+8]==="T")return!0;return!1}function SY(f,$){if(f[$+1]==="!"&&f[$+2]==="A"&&f[$+3]==="T"&&f[$+4]==="T"&&f[$+5]==="L"&&f[$+6]==="I"&&f[$+7]==="S"&&f[$+8]==="T")return!0;return!1}function bY(f,$){if(f[$+1]==="!"&&f[$+2]==="N"&&f[$+3]==="O"&&f[$+4]==="T"&&f[$+5]==="A"&&f[$+6]==="T"&&f[$+7]==="I"&&f[$+8]==="O"&&f[$+9]==="N")return!0;return!1}function hY(f){if(HY.isName(f))return f;else throw new Error(`Invalid entity name ${f}`)}var HY=e1();NL.exports=CY});var SL=T((_K,jL)=>{function uY(f,$={}){if($=Object.assign({},cY,$),!f||typeof f!=="string")return f;let U=f.trim();if($.skipLike!==void 0&&$.skipLike.test(U))return f;else if($.hex&&DY.test(U))return Number.parseInt(U,16);else{const G=kY.exec(U);if(G){const w=G[1],E=G[2];let W=vY(G[3]);const L=G[4]||G[6];if(!$.leadingZeros&&E.length>0&&w&&U[2]!==".")return f;else if(!$.leadingZeros&&E.length>0&&!w&&U[1]!==".")return f;else{const I=Number(U),R=""+I;if(R.search(/[eE]/)!==-1)if($.eNotation)return I;else return f;else if(L)if($.eNotation)return I;else return f;else if(U.indexOf(".")!==-1)if(R==="0"&&W==="")return I;else if(R===W)return I;else if(w&&R==="-"+W)return I;else return f;if(E)if(W===R)return I;else if(w+W===R)return I;else return f;if(U===R)return I;else if(U===w+R)return I;return f}}else return f}}function vY(f){if(f&&f.indexOf(".")!==-1){if(f=f.replace(/0+$/,""),f===".")f="0";else if(f[0]===".")f="0"+f;else if(f[f.length-1]===".")f=f.substr(0,f.length-1);return f}return f}var DY=/^[-+]?0x[a-fA-F0-9]+$/,kY=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;if(!Number.parseInt&&window.parseInt)Number.parseInt=window.parseInt;if(!Number.parseFloat&&window.parseFloat)Number.parseFloat=window.parseFloat;var cY={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};jL.exports=uY});var kL=T((yK,DL)=>{function yY(f){const $=Object.keys(f);for(let U=0;U<$.length;U++){const G=$[U];this.lastEntities[G]={regex:new RegExp("&"+G+";","g"),val:f[G]}}}function pY(f,$,U,G,w,E,W){if(f!==void 0){if(this.options.trimValues&&!G)f=f.trim();if(f.length>0){if(!W)f=this.replaceEntitiesValue(f);const L=this.options.tagValueProcessor($,f,U,w,E);if(L===null||L===void 0)return f;else if(typeof L!==typeof f||L!==f)return L;else if(this.options.trimValues)return b$(f,this.options.parseTagValue,this.options.numberParseOptions);else if(f.trim()===f)return b$(f,this.options.parseTagValue,this.options.numberParseOptions);else return f}}}function dY(f){if(this.options.removeNSPrefix){const $=f.split(":"),U=f.charAt(0)==="/"?"/":"";if($[0]==="xmlns")return"";if($.length===2)f=U+$[1]}return f}function nY(f,$,U){if(!this.options.ignoreAttributes&&typeof f==="string"){const G=bL.getAllMatches(f,gY),w=G.length,E={};for(let W=0;W<w;W++){const L=this.resolveNameSpace(G[W][1]);let I=G[W][4],R=this.options.attributeNamePrefix+L;if(L.length){if(this.options.transformAttributeName)R=this.options.transformAttributeName(R);if(R==="__proto__")R="#__proto__";if(I!==void 0){if(this.options.trimValues)I=I.trim();I=this.replaceEntitiesValue(I);const F=this.options.attributeValueProcessor(L,I,$);if(F===null||F===void 0)E[R]=I;else if(typeof F!==typeof I||F!==I)E[R]=F;else E[R]=b$(I,this.options.parseAttributeValue,this.options.numberParseOptions)}else if(this.options.allowBooleanAttributes)E[R]=!0}}if(!Object.keys(E).length)return;if(this.options.attributesGroupName){const W={};return W[this.options.attributesGroupName]=E,W}return E}}function lY(f,$,U){const G=this.options.updateTag($.tagname,U,$[":@"]);if(G===!1);else if(typeof G==="string")$.tagname=G,f.addChild($);else f.addChild($)}function iY(f,$,U,G){if(f){if(G===void 0)G=Object.keys($.child).length===0;if(f=this.parseTextData(f,$.tagname,U,!1,$[":@"]?Object.keys($[":@"]).length!==0:!1,G),f!==void 0&&f!=="")$.add(this.options.textNodeName,f);f=""}return f}function rY(f,$,U){const G="*."+U;for(let w in f){const E=f[w];if(G===E||$===E)return!0}return!1}function oY(f,$,U=">"){let G,w="";for(let E=$;E<f.length;E++){let W=f[E];if(G){if(W===G)G=""}else if(W==='"'||W==="'")G=W;else if(W===U[0])if(U[1]){if(f[E+1]===U[1])return{data:w,index:E}}else return{data:w,index:E};else if(W==="\t")W=" ";w+=W}}function z0(f,$,U,G){const w=f.indexOf($,U);if(w===-1)throw new Error(G);else return w+$.length-1}function S$(f,$,U,G=">"){const w=oY(f,$+1,G);if(!w)return;let E=w.data;const W=w.index,L=E.search(/\s/);let I=E,R=!0;if(L!==-1)I=E.substring(0,L),E=E.substring(L+1).trimStart();const F=I;if(U){const X=I.indexOf(":");if(X!==-1)I=I.substr(X+1),R=I!==w.data.substr(X+1)}return{tagName:I,tagExp:E,closeIndex:W,attrExpPresent:R,rawTagName:F}}function tY(f,$,U){const G=U;let w=1;for(;U<f.length;U++)if(f[U]==="<")if(f[U+1]==="/"){const E=z0(f,">",U,`${$} is not closed`);if(f.substring(U+2,E).trim()===$){if(w--,w===0)return{tagContent:f.substring(G,U),i:E}}U=E}else if(f[U+1]==="?")U=z0(f,"?>",U+1,"StopNode is not closed.");else if(f.substr(U+1,3)==="!--")U=z0(f,"-->",U+3,"StopNode is not closed.");else if(f.substr(U+1,2)==="![")U=z0(f,"]]>",U,"StopNode is not closed.")-2;else{const E=S$(f,U,">");if(E){if((E&&E.tagName)===$&&E.tagExp[E.tagExp.length-1]!=="/")w++;U=E.closeIndex}}}function b$(f,$,U){if($&&typeof f==="string"){const G=f.trim();if(G==="true")return!0;else if(G==="false")return!1;else return _Y(f,U)}else if(bL.isExist(f))return f;else return""}var bL=e1(),f1=qL(),xY=PL(),_Y=SL();class hL{constructor(f){this.options=f,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:($,U)=>String.fromCharCode(Number.parseInt(U,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:($,U)=>String.fromCharCode(Number.parseInt(U,16))}},this.addExternalEntities=yY,this.parseXml=sY,this.parseTextData=pY,this.resolveNameSpace=dY,this.buildAttributesMap=nY,this.isItStopNode=rY,this.replaceEntitiesValue=mY,this.readStopNodeData=tY,this.saveTextToParentTag=iY,this.addChild=lY}}var gY=new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?',"gm"),sY=function(f){f=f.replace(/\r\n?/g,"\n");const $=new f1("!xml");let U=$,G="",w="";for(let E=0;E<f.length;E++)if(f[E]==="<")if(f[E+1]==="/"){const L=z0(f,">",E,"Closing Tag is not closed.");let I=f.substring(E+2,L).trim();if(this.options.removeNSPrefix){const X=I.indexOf(":");if(X!==-1)I=I.substr(X+1)}if(this.options.transformTagName)I=this.options.transformTagName(I);if(U)G=this.saveTextToParentTag(G,U,w);const R=w.substring(w.lastIndexOf(".")+1);if(I&&this.options.unpairedTags.indexOf(I)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${I}>`);let F=0;if(R&&this.options.unpairedTags.indexOf(R)!==-1)F=w.lastIndexOf(".",w.lastIndexOf(".")-1),this.tagsNodeStack.pop();else F=w.lastIndexOf(".");w=w.substring(0,F),U=this.tagsNodeStack.pop(),G="",E=L}else if(f[E+1]==="?"){let L=S$(f,E,!1,"?>");if(!L)throw new Error("Pi Tag is not closed.");if(G=this.saveTextToParentTag(G,U,w),this.options.ignoreDeclaration&&L.tagName==="?xml"||this.options.ignorePiTags);else{const I=new f1(L.tagName);if(I.add(this.options.textNodeName,""),L.tagName!==L.tagExp&&L.attrExpPresent)I[":@"]=this.buildAttributesMap(L.tagExp,w,L.tagName);this.addChild(U,I,w)}E=L.closeIndex+1}else if(f.substr(E+1,3)==="!--"){const L=z0(f,"-->",E+4,"Comment is not closed.");if(this.options.commentPropName){const I=f.substring(E+4,L-2);G=this.saveTextToParentTag(G,U,w),U.add(this.options.commentPropName,[{[this.options.textNodeName]:I}])}E=L}else if(f.substr(E+1,2)==="!D"){const L=xY(f,E);this.docTypeEntities=L.entities,E=L.i}else if(f.substr(E+1,2)==="!["){const L=z0(f,"]]>",E,"CDATA is not closed.")-2,I=f.substring(E+9,L);G=this.saveTextToParentTag(G,U,w);let R=this.parseTextData(I,U.tagname,w,!0,!1,!0,!0);if(R==null)R="";if(this.options.cdataPropName)U.add(this.options.cdataPropName,[{[this.options.textNodeName]:I}]);else U.add(this.options.textNodeName,R);E=L+2}else{let L=S$(f,E,this.options.removeNSPrefix),I=L.tagName;const R=L.rawTagName;let{tagExp:F,attrExpPresent:X,closeIndex:Y}=L;if(this.options.transformTagName)I=this.options.transformTagName(I);if(U&&G){if(U.tagname!=="!xml")G=this.saveTextToParentTag(G,U,w,!1)}const Z=U;if(Z&&this.options.unpairedTags.indexOf(Z.tagname)!==-1)U=this.tagsNodeStack.pop(),w=w.substring(0,w.lastIndexOf("."));if(I!==$.tagname)w+=w?"."+I:I;if(this.isItStopNode(this.options.stopNodes,w,I)){let Q="";if(F.length>0&&F.lastIndexOf("/")===F.length-1){if(I[I.length-1]==="/")I=I.substr(0,I.length-1),w=w.substr(0,w.length-1),F=I;else F=F.substr(0,F.length-1);E=L.closeIndex}else if(this.options.unpairedTags.indexOf(I)!==-1)E=L.closeIndex;else{const J=this.readStopNodeData(f,R,Y+1);if(!J)throw new Error(`Unexpected end of ${R}`);E=J.i,Q=J.tagContent}const M=new f1(I);if(I!==F&&X)M[":@"]=this.buildAttributesMap(F,w,I);if(Q)Q=this.parseTextData(Q,I,w,!0,X,!0,!0);w=w.substr(0,w.lastIndexOf(".")),M.add(this.options.textNodeName,Q),this.addChild(U,M,w)}else{if(F.length>0&&F.lastIndexOf("/")===F.length-1){if(I[I.length-1]==="/")I=I.substr(0,I.length-1),w=w.substr(0,w.length-1),F=I;else F=F.substr(0,F.length-1);if(this.options.transformTagName)I=this.options.transformTagName(I);const Q=new f1(I);if(I!==F&&X)Q[":@"]=this.buildAttributesMap(F,w,I);this.addChild(U,Q,w),w=w.substr(0,w.lastIndexOf("."))}else{const Q=new f1(I);if(this.tagsNodeStack.push(U),I!==F&&X)Q[":@"]=this.buildAttributesMap(F,w,I);this.addChild(U,Q,w),U=Q}G="",E=Y}}else G+=f[E];return $.child},mY=function(f){if(this.options.processEntities){for(let $ in this.docTypeEntities){const U=this.docTypeEntities[$];f=f.replace(U.regx,U.val)}for(let $ in this.lastEntities){const U=this.lastEntities[$];f=f.replace(U.regex,U.val)}if(this.options.htmlEntities)for(let $ in this.htmlEntities){const U=this.htmlEntities[$];f=f.replace(U.regex,U.val)}f=f.replace(this.ampEntity.regex,this.ampEntity.val)}return f};DL.exports=hL});var uL=T((U9)=>{function aY(f,$){return cL(f,$)}function cL(f,$,U){let G;const w={};for(let E=0;E<f.length;E++){const W=f[E],L=eY(W);let I="";if(U===void 0)I=L;else I=U+"."+L;if(L===$.textNodeName)if(G===void 0)G=W[L];else G+=""+W[L];else if(L===void 0)continue;else if(W[L]){let R=cL(W[L],$,I);const F=$9(R,$);if(W[":@"])f9(R,W[":@"],I,$);else if(Object.keys(R).length===1&&R[$.textNodeName]!==void 0&&!$.alwaysCreateTextNode)R=R[$.textNodeName];else if(Object.keys(R).length===0)if($.alwaysCreateTextNode)R[$.textNodeName]="";else R="";if(w[L]!==void 0&&w.hasOwnProperty(L)){if(!Array.isArray(w[L]))w[L]=[w[L]];w[L].push(R)}else if($.isArray(L,I,F))w[L]=[R];else w[L]=R}}if(typeof G==="string"){if(G.length>0)w[$.textNodeName]=G}else if(G!==void 0)w[$.textNodeName]=G;return w}function eY(f){const $=Object.keys(f);for(let U=0;U<$.length;U++){const G=$[U];if(G!==":@")return G}}function f9(f,$,U,G){if($){const w=Object.keys($),E=w.length;for(let W=0;W<E;W++){const L=w[W];if(G.isArray(L,U+"."+L,!0,!0))f[L]=[$[L]];else f[L]=$[L]}}}function $9(f,$){const{textNodeName:U}=$,G=Object.keys(f).length;if(G===0)return!0;if(G===1&&(f[U]||typeof f[U]==="boolean"||f[U]===0))return!0;return!1}U9.prettify=aY});var _L=T((dK,xL)=>{var{buildOptions:G9}=VL(),E9=kL(),{prettify:W9}=uL(),L9=j$();class vL{constructor(f){this.externalEntities={},this.options=G9(f)}parse(f,$){if(typeof f==="string");else if(f.toString)f=f.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if($){if($===!0)$={};const w=L9.validate(f,$);if(w!==!0)throw Error(`${w.err.msg}:${w.err.line}:${w.err.col}`)}const U=new E9(this.options);U.addExternalEntities(this.externalEntities);const G=U.parseXml(f);if(this.options.preserveOrder||G===void 0)return G;else return W9(G,this.options)}addEntity(f,$){if($.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");else if(f.indexOf("&")!==-1||f.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");else if($==="&")throw new Error("An entity with value '&' is not permitted");else this.externalEntities[f]=$}}xL.exports=vL});var nL=T((gK,gL)=>{function I9(f,$){let U="";if($.format&&$.indentBy.length>0)U="\n";return pL(f,$,"",U)}function pL(f,$,U,G){let w="",E=!1;for(let W=0;W<f.length;W++){const L=f[W],I=R9(L);if(I===void 0)continue;let R="";if(U.length===0)R=I;else R=`${U}.${I}`;if(I===$.textNodeName){let Q=L[I];if(!F9(R,$))Q=$.tagValueProcessor(I,Q),Q=dL(Q,$);if(E)w+=G;w+=Q,E=!1;continue}else if(I===$.cdataPropName){if(E)w+=G;w+=`<![CDATA[${L[I][0][$.textNodeName]}]]>`,E=!1;continue}else if(I===$.commentPropName){w+=G+`<!--${L[I][0][$.textNodeName]}-->`,E=!0;continue}else if(I[0]==="?"){const Q=yL(L[":@"],$),M=I==="?xml"?"":G;let J=L[I][0][$.textNodeName];J=J.length!==0?" "+J:"",w+=M+`<${I}${J}${Q}?>`,E=!0;continue}let F=G;if(F!=="")F+=$.indentBy;const X=yL(L[":@"],$),Y=G+`<${I}${X}`,Z=pL(L[I],$,R,F);if($.unpairedTags.indexOf(I)!==-1)if($.suppressUnpairedNode)w+=Y+">";else w+=Y+"/>";else if((!Z||Z.length===0)&&$.suppressEmptyNode)w+=Y+"/>";else if(Z&&Z.endsWith(">"))w+=Y+`>${Z}${G}</${I}>`;else{if(w+=Y+">",Z&&G!==""&&(Z.includes("/>")||Z.includes("</")))w+=G+$.indentBy+Z+G;else w+=Z;w+=`</${I}>`}E=!0}return w}function R9(f){const $=Object.keys(f);for(let U=0;U<$.length;U++){const G=$[U];if(!f.hasOwnProperty(G))continue;if(G!==":@")return G}}function yL(f,$){let U="";if(f&&!$.ignoreAttributes)for(let G in f){if(!f.hasOwnProperty(G))continue;let w=$.attributeValueProcessor(G,f[G]);if(w=dL(w,$),w===!0&&$.suppressBooleanAttributes)U+=` ${G.substr($.attributeNamePrefix.length)}`;else U+=` ${G.substr($.attributeNamePrefix.length)}="${w}"`}return U}function F9(f,$){f=f.substr(0,f.length-$.textNodeName.length-1);let U=f.substr(f.lastIndexOf(".")+1);for(let G in $.stopNodes)if($.stopNodes[G]===f||$.stopNodes[G]==="*."+U)return!0;return!1}function dL(f,$){if(f&&f.length>0&&$.processEntities)for(let U=0;U<$.entities.length;U++){const G=$.entities[U];f=f.replace(G.regex,G.val)}return f}gL.exports=I9});var lL=T((nK,sL)=>{function w0(f){if(this.options=Object.assign({},Z9,f),this.options.ignoreAttributes||this.options.attributesGroupName)this.isAttribute=function(){return!1};else this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=z9;if(this.processTextOrObjNode=Y9,this.options.format)this.indentate=Q9,this.tagEndChar=">\n",this.newLine="\n";else this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""}function Y9(f,$,U){const G=this.j2x(f,U+1);if(f[this.options.textNodeName]!==void 0&&Object.keys(f).length===1)return this.buildTextValNode(f[this.options.textNodeName],$,G.attrStr,U);else return this.buildObjectNode(G.val,$,G.attrStr,U)}function Q9(f){return this.options.indentBy.repeat(f)}function z9(f){if(f.startsWith(this.options.attributeNamePrefix)&&f!==this.options.textNodeName)return f.substr(this.attrPrefixLen);else return!1}var X9=nL(),Z9={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(f,$){return $},attributeValueProcessor:function(f,$){return $},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};w0.prototype.build=function(f){if(this.options.preserveOrder)return X9(f,this.options);else{if(Array.isArray(f)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1)f={[this.options.arrayNodeName]:f};return this.j2x(f,0).val}};w0.prototype.j2x=function(f,$){let U="",G="";for(let w in f){if(!Object.prototype.hasOwnProperty.call(f,w))continue;if(typeof f[w]==="undefined"){if(this.isAttribute(w))G+=""}else if(f[w]===null)if(this.isAttribute(w))G+="";else if(w[0]==="?")G+=this.indentate($)+"<"+w+"?"+this.tagEndChar;else G+=this.indentate($)+"<"+w+"/"+this.tagEndChar;else if(f[w]instanceof Date)G+=this.buildTextValNode(f[w],w,"",$);else if(typeof f[w]!=="object"){const E=this.isAttribute(w);if(E)U+=this.buildAttrPairStr(E,""+f[w]);else if(w===this.options.textNodeName){let W=this.options.tagValueProcessor(w,""+f[w]);G+=this.replaceEntitiesValue(W)}else G+=this.buildTextValNode(f[w],w,"",$)}else if(Array.isArray(f[w])){const E=f[w].length;let W="",L="";for(let I=0;I<E;I++){const R=f[w][I];if(typeof R==="undefined");else if(R===null)if(w[0]==="?")G+=this.indentate($)+"<"+w+"?"+this.tagEndChar;else G+=this.indentate($)+"<"+w+"/"+this.tagEndChar;else if(typeof R==="object")if(this.options.oneListGroup){const F=this.j2x(R,$+1);if(W+=F.val,this.options.attributesGroupName&&R.hasOwnProperty(this.options.attributesGroupName))L+=F.attrStr}else W+=this.processTextOrObjNode(R,w,$);else if(this.options.oneListGroup){let F=this.options.tagValueProcessor(w,R);F=this.replaceEntitiesValue(F),W+=F}else W+=this.buildTextValNode(R,w,"",$)}if(this.options.oneListGroup)W=this.buildObjectNode(W,w,L,$);G+=W}else if(this.options.attributesGroupName&&w===this.options.attributesGroupName){const E=Object.keys(f[w]),W=E.length;for(let L=0;L<W;L++)U+=this.buildAttrPairStr(E[L],""+f[w][E[L]])}else G+=this.processTextOrObjNode(f[w],w,$)}return{attrStr:U,val:G}};w0.prototype.buildAttrPairStr=function(f,$){if($=this.options.attributeValueProcessor(f,""+$),$=this.replaceEntitiesValue($),this.options.suppressBooleanAttributes&&$==="true")return" "+f;else return" "+f+'="'+$+'"'};w0.prototype.buildObjectNode=function(f,$,U,G){if(f==="")if($[0]==="?")return this.indentate(G)+"<"+$+U+"?"+this.tagEndChar;else return this.indentate(G)+"<"+$+U+this.closeTag($)+this.tagEndChar;else{let w="</"+$+this.tagEndChar,E="";if($[0]==="?")E="?",w="";if((U||U==="")&&f.indexOf("<")===-1)return this.indentate(G)+"<"+$+U+E+">"+f+w;else if(this.options.commentPropName!==!1&&$===this.options.commentPropName&&E.length===0)return this.indentate(G)+`<!--${f}-->`+this.newLine;else return this.indentate(G)+"<"+$+U+E+this.tagEndChar+f+this.indentate(G)+w}};w0.prototype.closeTag=function(f){let $="";if(this.options.unpairedTags.indexOf(f)!==-1){if(!this.options.suppressUnpairedNode)$="/"}else if(this.options.suppressEmptyNode)$="/";else $=`></${f}`;return $};w0.prototype.buildTextValNode=function(f,$,U,G){if(this.options.cdataPropName!==!1&&$===this.options.cdataPropName)return this.indentate(G)+`<![CDATA[${f}]]>`+this.newLine;else if(this.options.commentPropName!==!1&&$===this.options.commentPropName)return this.indentate(G)+`<!--${f}-->`+this.newLine;else if($[0]==="?")return this.indentate(G)+"<"+$+U+"?"+this.tagEndChar;else{let w=this.options.tagValueProcessor($,f);if(w=this.replaceEntitiesValue(w),w==="")return this.indentate(G)+"<"+$+U+this.closeTag($)+this.tagEndChar;else return this.indentate(G)+"<"+$+U+">"+w+"</"+$+this.tagEndChar}};w0.prototype.replaceEntitiesValue=function(f){if(f&&f.length>0&&this.options.processEntities)for(let $=0;$<this.options.entities.length;$++){const U=this.options.entities[$];f=f.replace(U.regex,U.val)}return f};sL.exports=w0});var iL=T((sK,mL)=>{var J9=j$(),M9=_L(),T9=lL();mL.exports={XMLParser:M9,XMLValidator:J9,XMLBuilder:T9}});var fI=T((lK,eL)=>{var{defineProperty:ff,getOwnPropertyDescriptor:O9,getOwnPropertyNames:K9}=Object,A9=Object.prototype.hasOwnProperty,c=(f,$)=>ff(f,"name",{value:$,configurable:!0}),B9=(f,$)=>{for(var U in $)ff(f,U,{get:$[U],enumerable:!0})},V9=(f,$,U,G)=>{if($&&typeof $==="object"||typeof $==="function"){for(let w of K9($))if(!A9.call(f,w)&&w!==U)ff(f,w,{get:()=>$[w],enumerable:!(G=O9($,w))||G.enumerable})}return f},H9=(f)=>V9(ff({},"__esModule",{value:!0}),f),rL={};B9(rL,{_toBool:()=>q9,_toNum:()=>N9,_toStr:()=>C9,awsExpectUnion:()=>j9,loadRestJsonErrorCode:()=>h9,loadRestXmlErrorCode:()=>u9,parseJsonBody:()=>tL,parseJsonErrorBody:()=>b9,parseXmlBody:()=>aL,parseXmlErrorBody:()=>c9});eL.exports=H9(rL);var C9=c((f)=>{if(f==null)return f;if(typeof f==="number"||typeof f==="bigint"){const $=new Error(`Received number ${f} where a string was expected.`);return $.name="Warning",console.warn($),String(f)}if(typeof f==="boolean"){const $=new Error(`Received boolean ${f} where a string was expected.`);return $.name="Warning",console.warn($),String(f)}return f},"_toStr"),q9=c((f)=>{if(f==null)return f;if(typeof f==="string"){const $=f.toLowerCase();if(f!==""&&$!=="false"&&$!=="true"){const U=new Error(`Received string "${f}" where a boolean was expected.`);U.name="Warning",console.warn(U)}return f!==""&&$!=="false"}return f},"_toBool"),N9=c((f)=>{if(f==null)return f;if(typeof f==="string"){const $=Number(f);if($.toString()!==f){const U=new Error(`Received string "${f}" where a number was expected.`);return U.name="Warning",console.warn(U),f}return $}return f},"_toNum"),P9=q0(),j9=c((f)=>{if(f==null)return;if(typeof f==="object"&&"__type"in f)delete f.__type;return P9.expectUnion(f)},"awsExpectUnion"),S9=q0(),oL=c((f,$)=>S9.collectBody(f,$).then((U)=>$.utf8Encoder(U)),"collectBodyString"),tL=c((f,$)=>oL(f,$).then((U)=>{if(U.length)try{return JSON.parse(U)}catch(G){if((G==null?void 0:G.name)==="SyntaxError")Object.defineProperty(G,"$responseBodyText",{value:U});throw G}return{}}),"parseJsonBody"),b9=c(async(f,$)=>{const U=await tL(f,$);return U.message=U.message??U.Message,U},"parseJsonErrorBody"),h9=c((f,$)=>{const U=c((E,W)=>Object.keys(E).find((L)=>L.toLowerCase()===W.toLowerCase()),"findKey"),G=c((E)=>{let W=E;if(typeof W==="number")W=W.toString();if(W.indexOf(",")>=0)W=W.split(",")[0];if(W.indexOf(":")>=0)W=W.split(":")[0];if(W.indexOf("#")>=0)W=W.split("#")[1];return W},"sanitizeErrorCode"),w=U(f.headers,"x-amzn-errortype");if(w!==void 0)return G(f.headers[w]);if($.code!==void 0)return G($.code);if($.__type!==void 0)return G($.__type)},"loadRestJsonErrorCode"),D9=q0(),k9=iL(),aL=c((f,$)=>oL(f,$).then((U)=>{if(U.length){const G=new k9.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(I,R)=>R.trim()===""&&R.includes("\n")?"":void 0});G.addEntity("#xD","\r"),G.addEntity("#10","\n");let w;try{w=G.parse(U,!0)}catch(I){if(I&&typeof I==="object")Object.defineProperty(I,"$responseBodyText",{value:U});throw I}const E="#text",W=Object.keys(w)[0],L=w[W];if(L[E])L[W]=L[E],delete L[E];return D9.getValueFromTextNode(L)}return{}}),"parseXmlBody"),c9=c(async(f,$)=>{const U=await aL(f,$);if(U.Error)U.Error.message=U.Error.message??U.Error.Message;return U},"parseXmlErrorBody"),u9=c((f,$)=>{var U;if(((U=$==null?void 0:$.Error)==null?void 0:U.Code)!==void 0)return $.Error.Code;if(($==null?void 0:$.Code)!==void 0)return $.Code;if(f.statusCode==404)return"NotFound"},"loadRestXmlErrorCode")});var v9=T(($1)=>{Object.defineProperty($1,"__esModule",{value:!0});var h$=c8();h$.__exportStar(_8(),$1);h$.__exportStar(zL(),$1);h$.__exportStar(fI(),$1)});function e9(f){return f}var YI=(f)=>($)=>async(U)=>{if(!v.isInstance(U.request))return $(U);const{request:G}=U,{handlerProtocol:w=""}=f.requestHandler.metadata||{};if(w.indexOf("h2")>=0&&!G.headers[":authority"])delete G.headers.host,G.headers[":authority"]=G.hostname+(G.port?":"+G.port:"");else if(!G.headers.host){let E=G.hostname;if(G.port!=null)E+=`:${G.port}`;G.headers.host=E}return $(U)},QI={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},f7=(f)=>({applyToStack:($)=>{$.add(YI(f),QI)}});var zI=()=>(f,$)=>async(U)=>{try{const G=await f(U),{clientName:w,commandName:E,logger:W,dynamoDbDocumentClientOptions:L={}}=$,{overrideInputFilterSensitiveLog:I,overrideOutputFilterSensitiveLog:R}=L,F=I??$.inputFilterSensitiveLog,X=R??$.outputFilterSensitiveLog,{$metadata:Y,...Z}=G.output;return W?.info?.({clientName:w,commandName:E,input:F(U.input),output:X(Z),metadata:Y}),G}catch(G){const{clientName:w,commandName:E,logger:W,dynamoDbDocumentClientOptions:L={}}=$,{overrideInputFilterSensitiveLog:I}=L,R=I??$.inputFilterSensitiveLog;throw W?.error?.({clientName:w,commandName:E,input:R(U.input),error:G,metadata:G.$metadata}),G}},JI={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},U7=(f)=>({applyToStack:($)=>{$.add(zI(),JI)}});var v$="X-Amzn-Trace-Id",MI="AWS_LAMBDA_FUNCTION_NAME",TI="_X_AMZN_TRACE_ID",OI=(f)=>($)=>async(U)=>{const{request:G}=U;if(!v.isInstance(G)||f.runtime!=="node"||G.headers.hasOwnProperty(v$))return $(U);const w=process.env[MI],E=process.env[TI],W=(L)=>typeof L==="string"&&L.length>0;if(W(w)&&W(E))G.headers[v$]=E;return $({...U,request:G})},KI={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},L7=(f)=>({applyToStack:($)=>{$.add(OI(f),KI)}});function R7(f){return{...f,customUserAgent:typeof f.customUserAgent==="string"?[[f.customUserAgent]]:f.customUserAgent}}var AI=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}$"),h0=(f)=>AI.test(f)||f.startsWith("[")&&f.endsWith("]");var BI=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),D0=(f,$=!1)=>{if(!$)return BI.test(f);const U=f.split(".");for(let G of U)if(!D0(G))return!1;return!0};var k0={};var i="endpoints";function x(f){if(typeof f!=="object"||f==null)return f;if("ref"in f)return`\$${x(f.ref)}`;if("fn"in f)return`${f.fn}(${(f.argv||[]).map(x).join(", ")})`;return JSON.stringify(f,null,2)}class V extends Error{constructor(f){super(f);this.name="EndpointError"}}var x$=(f,$)=>f===$;var _$=(f)=>{const $=f.split("."),U=[];for(let G of $){const w=G.indexOf("[");if(w!==-1){if(G.indexOf("]")!==G.length-1)throw new V(`Path: '${f}' does not end with ']'`);const E=G.slice(w+1,-1);if(Number.isNaN(parseInt(E)))throw new V(`Invalid array index: '${E}' in path: '${f}'`);if(w!==0)U.push(G.slice(0,w));U.push(E)}else U.push(G)}return U};var U1=(f,$)=>_$($).reduce((U,G)=>{if(typeof U!=="object")throw new V(`Index '${G}' in '${$}' not found in '${JSON.stringify(f)}'`);else if(Array.isArray(U))return U[parseInt(G)];return U[G]},f);var y$=(f)=>f!=null;var p$=(f)=>!f;var w1=Uf(J0(),1);var $f={[w1.EndpointURLScheme.HTTP]:80,[w1.EndpointURLScheme.HTTPS]:443},d$=(f)=>{const $=(()=>{try{if(f instanceof URL)return f;if(typeof f==="object"&&"hostname"in f){const{hostname:Y,port:Z,protocol:Q="",path:M="",query:J={}}=f,O=new URL(`${Q}//${Y}${Z?`:${Z}`:""}${M}`);return O.search=Object.entries(J).map(([K,A])=>`${K}=${A}`).join("&"),O}return new URL(f)}catch(Y){return null}})();if(!$)return console.error(`Unable to parse ${JSON.stringify(f)} as a whatwg URL.`),null;const U=$.href,{host:G,hostname:w,pathname:E,protocol:W,search:L}=$;if(L)return null;const I=W.slice(0,-1);if(!Object.values(w1.EndpointURLScheme).includes(I))return null;const R=h0(w),F=U.includes(`${G}:${$f[I]}`)||typeof f==="string"&&f.includes(`${G}:${$f[I]}`),X=`${G}${F?`:${$f[I]}`:""}`;return{scheme:I,authority:X,path:E,normalizedPath:E.endsWith("/")?E:`${E}/`,isIp:R}};var g$=(f,$)=>f===$;var n$=(f,$,U,G)=>{if($>=U||f.length<U)return null;if(!G)return f.substring($,U);return f.substring(f.length-U,f.length-$)};var s$=(f)=>encodeURIComponent(f).replace(/[!*'()]/g,($)=>`%${$.charCodeAt(0).toString(16).toUpperCase()}`);var l$={booleanEquals:x$,getAttr:U1,isSet:y$,isValidHostLabel:D0,not:p$,parseURL:d$,stringEquals:g$,substring:n$,uriEncode:s$};var G1=(f,$)=>{const U=[],G={...$.endpointParams,...$.referenceRecord};let w=0;while(w<f.length){const E=f.indexOf("{",w);if(E===-1){U.push(f.slice(w));break}U.push(f.slice(w,E));const W=f.indexOf("}",E);if(W===-1){U.push(f.slice(E));break}if(f[E+1]==="{"&&f[W+1]==="}")U.push(f.slice(E+1,W)),w=W+2;const L=f.substring(E+1,W);if(L.includes("#")){const[I,R]=L.split("#");U.push(U1(G[I],R))}else U.push(G[L]);w=W+1}return U.join("")};var m$=({ref:f},$)=>{return{...$.endpointParams,...$.referenceRecord}[f]};var a=(f,$,U)=>{if(typeof f==="string")return G1(f,U);else if(f.fn)return E1(f,U);else if(f.ref)return m$(f,U);throw new V(`'${$}': ${String(f)} is not a string, function or reference.`)};var E1=({fn:f,argv:$},U)=>{const G=$.map((E)=>["boolean","number"].includes(typeof E)?E:a(E,"arg",U)),w=f.split(".");if(w[0]in k0&&w[1]!=null)return k0[w[0]][w[1]](...G);return l$[f](...G)};var i$=({assign:f,...$},U)=>{if(f&&f in U.referenceRecord)throw new V(`'${f}' is already defined in Reference Record.`);const G=E1($,U);return U.logger?.debug?.(`${i} evaluateCondition: ${x($)} = ${x(G)}`),{result:G===""?!0:!!G,...f!=null&&{toAssign:{name:f,value:G}}}};var M0=(f=[],$)=>{const U={};for(let G of f){const{result:w,toAssign:E}=i$(G,{...$,referenceRecord:{...$.referenceRecord,...U}});if(!w)return{result:w};if(E)U[E.name]=E.value,$.logger?.debug?.(`${i} assign: ${E.name} := ${x(E.value)}`)}return{result:!0,referenceRecord:U}};var r$=(f,$)=>Object.entries(f).reduce((U,[G,w])=>({...U,[G]:w.map((E)=>{const W=a(E,"Header value entry",$);if(typeof W!=="string")throw new V(`Header '${G}' value '${W}' is not a string`);return W})}),{});var wf=(f,$)=>{if(Array.isArray(f))return f.map((U)=>wf(U,$));switch(typeof f){case"string":return G1(f,$);case"object":if(f===null)throw new V(`Unexpected endpoint property: ${f}`);return W1(f,$);case"boolean":return f;default:throw new V(`Unexpected endpoint property type: ${typeof f}`)}};var W1=(f,$)=>Object.entries(f).reduce((U,[G,w])=>({...U,[G]:wf(w,$)}),{});var o$=(f,$)=>{const U=a(f,"Endpoint URL",$);if(typeof U==="string")try{return new URL(U)}catch(G){throw console.error(`Failed to construct URL with ${U}`,G),G}throw new V(`Endpoint URL must be a string, got ${typeof U}`)};var t$=(f,$)=>{const{conditions:U,endpoint:G}=f,{result:w,referenceRecord:E}=M0(U,$);if(!w)return;const W={...$,referenceRecord:{...$.referenceRecord,...E}},{url:L,properties:I,headers:R}=G;return $.logger?.debug?.(`${i} Resolving endpoint from template: ${x(G)}`),{...R!=null&&{headers:r$(R,W)},...I!=null&&{properties:W1(I,W)},url:o$(L,W)}};var a$=(f,$)=>{const{conditions:U,error:G}=f,{result:w,referenceRecord:E}=M0(U,$);if(!w)return;throw new V(a(G,"Error",{...$,referenceRecord:{...$.referenceRecord,...E}}))};var e$=(f,$)=>{const{conditions:U,rules:G}=f,{result:w,referenceRecord:E}=M0(U,$);if(!w)return;return L1(G,{...$,referenceRecord:{...$.referenceRecord,...E}})};var L1=(f,$)=>{for(let U of f)if(U.type==="endpoint"){const G=t$(U,$);if(G)return G}else if(U.type==="error")a$(U,$);else if(U.type==="tree"){const G=e$(U,$);if(G)return G}else throw new V(`Unknown endpoint rule: ${U}`);throw new V("Rules evaluation failed")};var VI=(f,$)=>{const{endpointParams:U,logger:G}=$,{parameters:w,rules:E}=f;$.logger?.debug?.(`${i} Initial EndpointParams: ${x(U)}`);const W=Object.entries(w).filter(([,R])=>R.default!=null).map(([R,F])=>[R,F.default]);if(W.length>0)for(let[R,F]of W)U[R]=U[R]??F;const L=Object.entries(w).filter(([,R])=>R.required).map(([R])=>R);for(let R of L)if(U[R]==null)throw new V(`Missing required parameter: '${R}'`);const I=L1(E,{endpointParams:U,logger:G,referenceRecord:{}});if($.endpointParams?.Endpoint)try{const R=new URL($.endpointParams.Endpoint),{protocol:F,port:X}=R;I.url.protocol=F,I.url.port=X}catch(R){}return $.logger?.debug?.(`${i} Resolved endpoint: ${x(I)}`),I};var Gf=(f,$=!1)=>{if($){for(let U of f.split("."))if(!Gf(U))return!1;return!0}if(!D0(f))return!1;if(f.length<3||f.length>63)return!1;if(f!==f.toLowerCase())return!1;if(h0(f))return!1;return!0};var fU=(f)=>{const $=f.split(":");if($.length<6)return null;const[U,G,w,E,W,...L]=$;if(U!=="arn"||G===""||w===""||L.join(":")==="")return null;const I=L.map((R)=>R.split("/")).flat();return{partition:G,service:w,region:E,accountId:W,resourceId:I}};var $U={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)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"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)"},"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)"},"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:{"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:{}}],version:"1.1"};var CI=$U,qI="",UU=(f)=>{const{partitions:$}=CI;for(let G of $){const{regions:w,outputs:E}=G;for(let[W,L]of Object.entries(w))if(W===f)return{...E,...L}}for(let G of $){const{regionRegex:w,outputs:E}=G;if(new RegExp(w).test(f))return{...E}}const U=$.find((G)=>G.id==="aws");if(!U)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...U.outputs}};var wU=()=>qI;var NI={isVirtualHostableS3Bucket:Gf,parseArn:fU,partition:UU};k0.aws=NI;var Ef="user-agent",I1="x-amz-user-agent",Wf=" ",R1="/",GU=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,EU=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,Lf="-";var PI=(f)=>($,U)=>async(G)=>{const{request:w}=G;if(!v.isInstance(w))return $(G);const{headers:E}=w,W=U?.userAgent?.map(If)||[],L=(await f.defaultUserAgentProvider()).map(If),I=f?.customUserAgent?.map(If)||[],R=wU(),F=(R?[R]:[]).concat([...L,...W,...I]).join(Wf),X=[...L.filter((Y)=>Y.startsWith("aws-sdk-")),...I].join(Wf);if(f.runtime!=="browser"){if(X)E[I1]=E[I1]?`${E[Ef]} ${X}`:X;E[Ef]=F}else E[I1]=F;return $({...G,request:w})},If=(f)=>{const $=f[0].split(R1).map((W)=>W.replace(GU,Lf)).join(R1),U=f[1]?.replace(EU,Lf),G=$.indexOf(R1),w=$.substring(0,G);let E=$.substring(G+1);if(w==="api")E=E.toLowerCase();return[w,E,U].filter((W)=>W&&W.length>0).reduce((W,L,I)=>{switch(I){case 0:return L;case 1:return`${W}/${L}`;default:return`${W}#${L}`}},"")},jI={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},dz=(f)=>({applyToStack:($)=>{$.add(PI(f),jI)}});var F1=(f)=>typeof f==="string"&&(f.startsWith("fips-")||f.endsWith("-fips"));var Rf=(f)=>F1(f)?["fips-aws-global","aws-fips"].includes(f)?"us-east-1":f.replace(/fips-(dkr-|prod-)?|-fips/,""):f;var az=(f)=>{const{region:$,useFipsEndpoint:U}=f;if(!$)throw new Error("Region is missing");return{...f,region:async()=>{if(typeof $==="string")return Rf($);const G=await $();return Rf(G)},useFipsEndpoint:async()=>{const G=typeof $==="string"?$:await $();if(F1(G))return!0;return typeof U!=="function"?Promise.resolve(!!U):U()}}};var T0=(f,$,U)=>{if(!($ in f))return;if(f[$]==="true")return!0;if(f[$]==="false")return!1;throw new Error(`Cannot load ${U} "${$}". Expected "true" or "false", got ${f[$]}.`)};var e;(function(f){f.ENV="env",f.CONFIG="shared config entry"})(e||(e={}));var SI="AWS_USE_DUALSTACK_ENDPOINT",bI="use_dualstack_endpoint";var IJ={environmentVariableSelector:(f)=>T0(f,SI,e.ENV),configFileSelector:(f)=>T0(f,bI,e.CONFIG),default:!1};var hI="AWS_USE_FIPS_ENDPOINT",DI="use_fips_endpoint";var XJ={environmentVariableSelector:(f)=>T0(f,hI,e.ENV),configFileSelector:(f)=>T0(f,DI,e.CONFIG),default:!1};var Ff=Uf(J0(),1),WU=(f)=>f[Ff.SMITHY_CONTEXT_KEY]||(f[Ff.SMITHY_CONTEXT_KEY]={});var r=(f)=>{if(typeof f==="function")return f;const $=Promise.resolve(f);return()=>$};var LU={environmentVariableSelector:(f)=>f.AWS_REGION,configFileSelector:(f)=>f.region,default:()=>{throw new Error("Region is missing")}},SJ={preferredFile:"credentials"};function PZ(f){return($)=>async(U)=>{const G=U.request;if(v.isInstance(G)){const{body:w,headers:E}=G;if(w&&Object.keys(E).map((W)=>W.toLowerCase()).indexOf(_W)===-1)try{const W=f(w);G.headers={...G.headers,[_W]:String(W)}}catch(W){}}return $({...U,request:G})}}var _W="content-length",jZ={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},tM=(f)=>({applyToStack:($)=>{$.add(PZ(f.bodyLengthChecker),jZ)}});var yW=(f,$)=>(U)=>async(G)=>{const{response:w}=await U(G);try{const E=await $(w,f);return{response:w,output:E}}catch(E){if(Object.defineProperty(E,"$response",{value:w}),!("$metadata"in E)){if(E.message+="\n Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.",typeof E.$responseBodyText!=="undefined"){if(E.$response)E.$response.body=E.$responseBodyText}}throw E}};var pW=(f,$)=>(U,G)=>async(w)=>{const E=G.endpointV2?.url&&f.urlParser?async()=>f.urlParser(G.endpointV2.url):f.endpoint;if(!E)throw new Error("No valid endpoint provider available.");const W=await $(w.input,{...f,endpoint:E});return U({...w,request:W})};function wT(f,$,U){return{applyToStack:(G)=>{G.add(yW(f,U),SZ),G.add(pW(f,$),L$)}}}var SZ={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},L$={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};var dW=async(f)=>{const $=f?.Bucket||"";if(typeof f.Bucket==="string")f.Bucket=$.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(cZ($)){if(f.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!kZ($)||$.indexOf(".")!==-1&&!String(f.Endpoint).startsWith("http:")||$.toLowerCase()!==$||$.length<3)f.ForcePathStyle=!0;if(f.DisableMultiRegionAccessPoints)f.disableMultiRegionAccessPoints=!0,f.DisableMRAP=!0;return f},bZ=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,hZ=/(\d+\.){3}\d+/,DZ=/\.\./;var kZ=(f)=>bZ.test(f)&&!hZ.test(f)&&!DZ.test(f),cZ=(f)=>{const[$,U,G,,,w]=f.split(":"),E=$==="arn"&&f.split(":").length>=6,W=Boolean(E&&U&&G&&w);if(E&&!W)throw new Error(`Invalid ARN: ${f} was an invalid ARN.`);return W};var gW=(f,$,U)=>{const G=async()=>{const w=U[f]??U[$];if(typeof w==="function")return w();return w};if(f==="credentialScope"||$==="CredentialScope")return async()=>{const w=typeof U.credentials==="function"?await U.credentials():U.credentials;return w?.credentialScope??w?.CredentialScope};if(f==="accountId"||$==="AccountId")return async()=>{const w=typeof U.credentials==="function"?await U.credentials():U.credentials;return w?.accountId??w?.AccountId};if(f==="endpoint"||$==="endpoint")return async()=>{const w=await G();if(w&&typeof w==="object"){if("url"in w)return w.url.href;if("hostname"in w){const{protocol:E,hostname:W,port:L,path:I}=w;return`${E}//${W}${L?":"+L:""}${I}`}}return w};return G};var nW="AWS_ENDPOINT_URL",sW="endpoint_url",lW=(f)=>({environmentVariableSelector:($)=>{const U=f.split(" ").map((E)=>E.toUpperCase()),G=$[[nW,...U].join("_")];if(G)return G;const w=$[nW];if(w)return w;return},configFileSelector:($,U)=>{if(U&&$.services){const w=U[["services",$.services].join(I$)];if(w){const E=f.split(" ").map((L)=>L.toLowerCase()),W=w[[E.join("_"),sW].join(I$)];if(W)return W}}const G=$[sW];if(G)return G;return},default:void 0});var mW=async(f)=>X0(lW(f))();var v1=(f)=>{if(typeof f==="object"){if("url"in f)return R$(f.url);return f}return R$(f)};var iW=async(f,$,U,G)=>{if(!U.endpoint){const W=await mW(U.serviceId||"");if(W)U.endpoint=()=>Promise.resolve(v1(W))}const w=await uZ(f,$,U);if(typeof U.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return U.endpointProvider(w,G)},uZ=async(f,$,U)=>{const G={},w=$?.getEndpointParameterInstructions?.()||{};for(let[E,W]of Object.entries(w))switch(W.type){case"staticContextParams":G[E]=W.value;break;case"contextParams":G[E]=f[W.name];break;case"clientContextParams":case"builtInParams":G[E]=await gW(W.name,E,U)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(W))}if(Object.keys(w).length===0)Object.assign(G,U);if(String(U.serviceId).toLowerCase()==="s3")await dW(G);return G};var rW=({config:f,instructions:$})=>{return(U,G)=>async(w)=>{const E=await iW(w.input,{getEndpointParameterInstructions(){return $}},{...f},G);G.endpointV2=E,G.authSchemes=E.properties?.authSchemes;const W=G.authSchemes?.[0];if(W){G.signing_region=W.signingRegion,G.signing_service=W.signingName;const I=WU(G)?.selectedHttpAuthScheme?.httpAuthOption;if(I)I.signingProperties=Object.assign(I.signingProperties||{},{signing_region:W.signingRegion,signingRegion:W.signingRegion,signing_service:W.signingName,signingName:W.signingName,signingRegionSet:W.signingRegionSet},W.properties)}return U({...w})}};var vZ={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:L$.name},ST=(f,$)=>({applyToStack:(U)=>{U.addRelativeTo(rW({config:f,instructions:$}),vZ)}});var kT=(f)=>{const $=f.tls??!0,{endpoint:U}=f,G=U!=null?async()=>v1(await r(U)()):void 0;return{...f,endpoint:G,tls:$,isCustomEndpoint:!!U,useDualstackEndpoint:r(f.useDualstackEndpoint??!1),useFipsEndpoint:r(f.useFipsEndpoint??!1)}};var p;(function(f){f.STANDARD="standard",f.ADAPTIVE="adaptive"})(p||(p={}));var Z0=3,oW=p.STANDARD;var tW=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],aW=["TimeoutError","RequestTimeout","RequestTimeoutException"],eW=[500,502,503,504],f8=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"];var xZ=(f)=>f.$metadata?.clockSkewCorrected,P0=(f)=>f.$metadata?.httpStatusCode===429||tW.includes(f.name)||f.$retryable?.throttling==!0,x1=(f)=>xZ(f)||aW.includes(f.name)||f8.includes(f?.code||"")||eW.includes(f.$metadata?.httpStatusCode||0),$8=(f)=>{if(f.$metadata?.httpStatusCode!==void 0){const $=f.$metadata.httpStatusCode;if(500<=$&&$<=599&&!x1(f))return!0;return!1}return!1};class _1{constructor(f){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=f?.beta??0.7,this.minCapacity=f?.minCapacity??1,this.minFillRate=f?.minFillRate??0.5,this.scaleConstant=f?.scaleConstant??0.4,this.smooth=f?.smooth??0.8;const $=this.getCurrentTimeInSeconds();this.lastThrottleTime=$,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1000}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(f){if(!this.enabled)return;if(this.refillTokenBucket(),f>this.currentCapacity){const $=(f-this.currentCapacity)/this.fillRate*1000;await new Promise((U)=>setTimeout(U,$))}this.currentCapacity=this.currentCapacity-f}refillTokenBucket(){const f=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=f;return}const $=(f-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+$),this.lastTimestamp=f}updateClientSendingRate(f){let $;if(this.updateMeasuredRate(),P0(f)){const G=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=G,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),$=this.cubicThrottle(G),this.enableTokenBucket()}else this.calculateTimeWindow(),$=this.cubicSuccess(this.getCurrentTimeInSeconds());const U=Math.min($,2*this.measuredTxRate);this.updateTokenBucketRate(U)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle(f){return this.getPrecise(f*this.beta)}cubicSuccess(f){return this.getPrecise(this.scaleConstant*Math.pow(f-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(f){this.refillTokenBucket(),this.fillRate=Math.max(f,this.minFillRate),this.maxCapacity=Math.max(f,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const f=this.getCurrentTimeInSeconds(),$=Math.floor(f*2)/2;if(this.requestCount++,$>this.lastTxRateBucket){const U=this.requestCount/($-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(U*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=$}}getPrecise(f){return parseFloat(f.toFixed(8))}}var Y0=100,o0=20000,F$=500,y1=500,X$=5,Z$=10,Y$=1,p1="amz-sdk-invocation-id",d1="amz-sdk-request";var U8=()=>{let f=Y0;return{computeNextBackoffDelay:(G)=>{return Math.floor(Math.min(o0,Math.random()*2**G*f))},setDelayBase:(G)=>{f=G}}};var Q$=({retryDelay:f,retryCount:$,retryCost:U})=>{return{getRetryCount:()=>$,getRetryDelay:()=>Math.min(o0,f),getRetryCost:()=>U}};class j0{constructor(f){this.maxAttempts=f,this.mode=p.STANDARD,this.capacity=y1,this.retryBackoffStrategy=U8(),this.maxAttemptsProvider=typeof f==="function"?f:async()=>f}async acquireInitialRetryToken(f){return Q$({retryDelay:Y0,retryCount:0})}async refreshRetryTokenForRetry(f,$){const U=await this.getMaxAttempts();if(this.shouldRetry(f,$,U)){const G=$.errorType;this.retryBackoffStrategy.setDelayBase(G==="THROTTLING"?F$:Y0);const w=this.retryBackoffStrategy.computeNextBackoffDelay(f.getRetryCount()),E=$.retryAfterHint?Math.max($.retryAfterHint.getTime()-Date.now()||0,w):w,W=this.getCapacityCost(G);return this.capacity-=W,Q$({retryDelay:E,retryCount:f.getRetryCount()+1,retryCost:W})}throw new Error("No retry token available")}recordSuccess(f){this.capacity=Math.max(y1,this.capacity+(f.getRetryCost()??Y$))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(f){return console.warn(`Max attempts provider could not resolve. Using default of ${Z0}`),Z0}}shouldRetry(f,$,U){return f.getRetryCount()+1<U&&this.capacity>=this.getCapacityCost($.errorType)&&this.isRetryableError($.errorType)}getCapacityCost(f){return f==="TRANSIENT"?Z$:X$}isRetryableError(f){return f==="THROTTLING"||f==="TRANSIENT"}}class z${constructor(f,$){this.maxAttemptsProvider=f,this.mode=p.ADAPTIVE;const{rateLimiter:U}=$??{};this.rateLimiter=U??new _1,this.standardRetryStrategy=new j0(f)}async acquireInitialRetryToken(f){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(f)}async refreshRetryTokenForRetry(f,$){return this.rateLimiter.updateClientSendingRate($),this.standardRetryStrategy.refreshRetryTokenForRetry(f,$)}recordSuccess(f){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(f)}}var w8="AWS_MAX_ATTEMPTS",G8="max_attempts",CO={environmentVariableSelector:(f)=>{const $=f[w8];if(!$)return;const U=parseInt($);if(Number.isNaN(U))throw new Error(`Environment variable ${w8} mast be a number, got "${$}"`);return U},configFileSelector:(f)=>{const $=f[G8];if(!$)return;const U=parseInt($);if(Number.isNaN(U))throw new Error(`Shared config file entry ${G8} mast be a number, got "${$}"`);return U},default:Z0},qO=(f)=>{const{retryStrategy:$}=f,U=r(f.maxAttempts??Z0);return{...f,maxAttempts:U,retryStrategy:async()=>{if($)return $;if(await r(f.retryMode)()===p.ADAPTIVE)return new z$(U);return new j0(U)}}},_Z="AWS_RETRY_MODE",yZ="retry_mode",NO={environmentVariableSelector:(f)=>f[_Z],configFileSelector:(f)=>f[yZ],default:oW};var m=Uf(Sf(),1),jO=m.default.v1,SO=m.default.v3,E8=m.default.v4,bO=m.default.v5,hO=m.default.NIL,DO=m.default.version,kO=m.default.validate,cO=m.default.stringify,uO=m.default.parse;import{Readable as pZ}from"stream";var W8=(f)=>f?.body instanceof pZ||typeof ReadableStream!=="undefined"&&f?.body instanceof ReadableStream;var J$=(f)=>{if(f instanceof Error)return f;if(f instanceof Object)return Object.assign(new Error,f);if(typeof f==="string")return new Error(f);return new Error(`AWS SDK error wrapper for ${f}`)};var dZ=(f)=>($,U)=>async(G)=>{let w=await f.retryStrategy();const E=await f.maxAttempts();if(gZ(w)){w=w;let W=await w.acquireInitialRetryToken(U.partition_id),L=new Error,I=0,R=0;const{request:F}=G,X=v.isInstance(F);if(X)F.headers[p1]=E8();while(!0)try{if(X)F.headers[d1]=`attempt=${I+1}; max=${E}`;const{response:Y,output:Z}=await $(G);return w.recordSuccess(W),Z.$metadata.attempts=I+1,Z.$metadata.totalRetryDelay=R,{response:Y,output:Z}}catch(Y){const Z=nZ(Y);if(L=J$(Y),X&&W8(F))throw(U.logger instanceof L8?console:U.logger)?.warn("An error was encountered in a non-retryable streaming request."),L;try{W=await w.refreshRetryTokenForRetry(W,Z)}catch(M){if(!L.$metadata)L.$metadata={};throw L.$metadata.attempts=I+1,L.$metadata.totalRetryDelay=R,L}I=W.getRetryCount();const Q=W.getRetryDelay();R+=Q,await new Promise((M)=>setTimeout(M,Q))}}else{if(w=w,w?.mode)U.userAgent=[...U.userAgent||[],["cfg/retry-mode",w.mode]];return w.retry($,G)}},gZ=(f)=>typeof f.acquireInitialRetryToken!=="undefined"&&typeof f.refreshRetryTokenForRetry!=="undefined"&&typeof f.recordSuccess!=="undefined",nZ=(f)=>{const $={error:f,errorType:sZ(f)},U=mZ(f.$response);if(U)$.retryAfterHint=U;return $},sZ=(f)=>{if(P0(f))return"THROTTLING";if(x1(f))return"TRANSIENT";if($8(f))return"SERVER_ERROR";return"CLIENT_ERROR"},lZ={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},iO=(f)=>({applyToStack:($)=>{$.add(dZ(f),lZ)}}),mZ=(f)=>{if(!M$.isInstance(f))return;const $=Object.keys(f.headers).find((E)=>E.toLowerCase()==="retry-after");if(!$)return;const U=f.headers[$],G=Number(U);if(!Number.isNaN(G))return new Date(G*1000);return new Date(U)};import{platform as x9,release as _9}from"os";import{env as UI,versions as y9}from"process";var D$={isCrtAvailable:!1};var $I=()=>{if(D$.isCrtAvailable)return["md/crt-avail"];return null};var p9="AWS_SDK_UA_APP_ID",d9="sdk-ua-app-id",$3=({serviceId:f,clientVersion:$})=>{const U=[["aws-sdk-js",$],["ua","2.0"],[`os/${x9()}`,_9()],["lang/js"],["md/nodejs",`${y9.node}`]],G=$I();if(G)U.push(G);if(f)U.push([`api/${f}`,$]);if(UI.AWS_EXECUTION_ENV)U.push([`exec-env/${UI.AWS_EXECUTION_ENV}`]);const w=X0({environmentVariableSelector:(W)=>W[p9],configFileSelector:(W)=>W[d9],default:void 0})();let E=void 0;return async()=>{if(!E){const W=await w;E=W?[...U,[`app/${W}`]]:[...U]}return E}};import{Buffer as g9}from"buffer";import{createHash as n9,createHmac as s9}from"crypto";function wI(f,$){if(g9.isBuffer(f))return f;if(typeof f==="string")return GI(f,$);if(ArrayBuffer.isView(f))return k$(f.buffer,f.byteOffset,f.byteLength);return k$(f)}class l9{constructor(f,$){this.algorithmIdentifier=f,this.secret=$,this.reset()}update(f,$){this.hash.update(EI(wI(f,$)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?s9(this.algorithmIdentifier,wI(this.secret)):n9(this.algorithmIdentifier)}}import{fstatSync as m9,lstatSync as i9}from"fs";var F3=(f)=>{if(!f)return 0;if(typeof f==="string")return Buffer.byteLength(f);else if(typeof f.byteLength==="number")return f.byteLength;else if(typeof f.size==="number")return f.size;else if(typeof f.start==="number"&&typeof f.end==="number")return f.end+1-f.start;else if(typeof f.path==="string"||Buffer.isBuffer(f.path))return i9(f.path).size;else if(typeof f.fd==="number")return m9(f.fd).size;throw new Error(`Body Length computation failed for ${f}`)};var WI="AWS_EXECUTION_ENV",c$="AWS_REGION",u$="AWS_DEFAULT_REGION",LI="AWS_EC2_METADATA_DISABLED",II=["in-region","cross-region","mobile","standard","legacy"],RI="/latest/meta-data/placement/region";var FI={environmentVariableSelector:(f)=>{return f.AWS_DEFAULTS_MODE},configFileSelector:(f)=>{return f.defaults_mode},default:"legacy"};var A3=({region:f=X0(LU),defaultsMode:$=X0(FI)}={})=>XI(async()=>{const U=typeof $==="function"?await $():$;switch(U?.toLowerCase()){case"auto":return r9(f);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(U?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${II.join(", ")}, got ${U}`)}}),r9=async(f)=>{if(f){const $=typeof f==="function"?await f():f,U=await o9();if(!U)return"standard";if($===U)return"in-region";else return"cross-region"}return"standard"},o9=async()=>{if(process.env[WI]&&(process.env[c$]||process.env[u$]))return process.env[c$]??process.env[u$];if(!process.env[LI])try{const{getInstanceMetadataEndpoint:f,httpRequest:$}=await import("./chunk-zpm61fm8.js"),U=await f();return(await $({...U,path:RI})).toString()}catch(f){}};var C3=(f)=>{let $=async()=>{if(f.region===void 0)throw new Error("Region is missing from runtimeConfig");const U=f.region;if(typeof U==="string")return U;return U()};return{setRegion(U){$=U},region(){return $}}},q3=(f)=>{return{region:f.region()}};export{e9 as Ja,f7 as Ka,U7 as La,L7 as Ma,R7 as Na,k0 as Oa,VI as Pa,NI as Qa,dz as Ra,IJ as Sa,XJ as Ta,WU as Ua,r as Va,LU as Wa,SJ as Xa,az as Ya,W$ as Za,tM as _a,wT as $a,ST as ab,kT as bb,oW as cb,CO as db,qO as eb,NO as fb,iO as gb,v9 as hb,$3 as ib,l9 as jb,F3 as kb,A3 as lb,C3 as mb,q3 as nb};
19
-
20
- //# debugId=50FBFA875D6DBBB564756E2164756E21
21
- //# sourceMappingURL=chunk-e36y42vg.js.map