@thunderclient/cli 1.27.8 → 1.27.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/114.index.js CHANGED
@@ -1,3 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";exports.id=114,exports.ids=[114,876],exports.modules={836(e,r,t){t.d(r,{fromProcess:()=>f});var o=t(832),n=t(62),s=t(61),c=t(837),i=t(838),a=t(18),d=t(80);const l=async(e,r,t)=>{const o=r[e];if(!r[e])throw new s.C(`Profile ${e} could not be found in shared credentials file.`,{logger:t});{const n=o.credential_process;if(void 0===n)throw new s.C(`Profile ${e} did not contain credential_process.`,{logger:t});{const o=(0,a.promisify)(c.Z?.getTokenRecord?.().exec??i.exec);try{const{stdout:t}=await o(n);let s;try{s=JSON.parse(t.trim())}catch{throw Error(`Profile ${e} credential_process returned invalid JSON.`)}return((e,r,t)=>{if(1!==r.Version)throw Error(`Profile ${e} credential_process did not return Version 1.`);if(void 0===r.AccessKeyId||void 0===r.SecretAccessKey)throw Error(`Profile ${e} credential_process returned invalid credentials.`);if(r.Expiration){const t=new Date;if(new Date(r.Expiration)<t)throw Error(`Profile ${e} credential_process returned expired credentials.`)}let o=r.AccountId;!o&&t?.[e]?.aws_account_id&&(o=t[e].aws_account_id);const n={accessKeyId:r.AccessKeyId,secretAccessKey:r.SecretAccessKey,...r.SessionToken&&{sessionToken:r.SessionToken},...r.Expiration&&{expiration:new Date(r.Expiration)},...r.CredentialScope&&{credentialScope:r.CredentialScope},...o&&{accountId:o}};return(0,d.g)(n,"CREDENTIALS_PROCESS","w"),n})(e,s,r)}catch(e){throw new s.C(e.message,{logger:t})}}}},f=(e={})=>async({callerClientConfig:r}={})=>{e.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");const t=await(0,o.Y)(e);return l((0,n.Bz)({profile:e.profile??r?.profile}),t,e.logger)}},837(e,r,t){t.d(r,{Z:()=>s});var o=t(833),n=t(69);const s={getFileRecord:()=>n.Jj,interceptFile(e,r){n.Jj[e]=Promise.resolve(r)},getTokenRecord:()=>o.a,interceptToken(e,r){o.a[e]=r}}},834(e,r,t){t.d(r,{C:()=>c});var o=t(5),n=t(3),s=t(67);const c=e=>{const r=(0,o.createHash)("sha1").update(e).digest("hex");return(0,n.join)((0,s.R)(),".aws","sso","cache",`${r}.json`)}},833(e,r,t){t.d(r,{a:()=>s,v:()=>c});var o=t(27),n=t(834);const s={},c=async e=>{if(s[e])return s[e];const r=(0,n.C)(e),t=await(0,o.readFile)(r,"utf8");return JSON.parse(t)}},832(e,r,t){t.d(r,{Y:()=>n});var o=t(63);const n=async e=>{const r=await(0,o.p)(e);return((...e)=>{const r={};for(const t of e)for(const[e,o]of Object.entries(t))void 0!==r[e]?Object.assign(r[e],o):r[e]=o;return r})(r.configFile,r.credentialsFile)}}};
3
- //# sourceMappingURL=114.index.js.map
2
+ "use strict";exports.id=114,exports.ids=[114,876],exports.modules={844(e,r,t){t.d(r,{fromProcess:()=>f});var o=t(840),n=t(57),s=t(845),c=t(56),i=t(846),a=t(18),d=t(87);const l=async(e,r,t)=>{const o=r[e];if(!r[e])throw new c.C(`Profile ${e} could not be found in shared credentials file.`,{logger:t});{const n=o.credential_process;if(void 0===n)throw new c.C(`Profile ${e} did not contain credential_process.`,{logger:t});{const o=(0,a.promisify)(s.Z?.getTokenRecord?.().exec??i.exec);try{const{stdout:t}=await o(n);let s;try{s=JSON.parse(t.trim())}catch{throw Error(`Profile ${e} credential_process returned invalid JSON.`)}return((e,r,t)=>{if(1!==r.Version)throw Error(`Profile ${e} credential_process did not return Version 1.`);if(void 0===r.AccessKeyId||void 0===r.SecretAccessKey)throw Error(`Profile ${e} credential_process returned invalid credentials.`);if(r.Expiration){const t=new Date;if(new Date(r.Expiration)<t)throw Error(`Profile ${e} credential_process returned expired credentials.`)}let o=r.AccountId;!o&&t?.[e]?.aws_account_id&&(o=t[e].aws_account_id);const n={accessKeyId:r.AccessKeyId,secretAccessKey:r.SecretAccessKey,...r.SessionToken&&{sessionToken:r.SessionToken},...r.Expiration&&{expiration:new Date(r.Expiration)},...r.CredentialScope&&{credentialScope:r.CredentialScope},...o&&{accountId:o}};return(0,d.g)(n,"CREDENTIALS_PROCESS","w"),n})(e,s,r)}catch(e){throw new c.C(e.message,{logger:t})}}}},f=(e={})=>async({callerClientConfig:r}={})=>{e.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");const t=await(0,o.Y)(e);return l((0,n.Bz)({profile:e.profile??r?.profile}),t,e.logger)}},845(e,r,t){t.d(r,{Z:()=>s});var o=t(841),n=t(65);const s={getFileRecord:()=>n.Jj,interceptFile(e,r){n.Jj[e]=Promise.resolve(r)},getTokenRecord:()=>o.a,interceptToken(e,r){o.a[e]=r}}},842(e,r,t){t.d(r,{C:()=>c});var o=t(20),n=t(59),s=t(63);const c=e=>{const r=(0,o.createHash)("sha1").update(e).digest("hex");return(0,n.join)((0,s.R)(),".aws","sso","cache",`${r}.json`)}},841(e,r,t){t.d(r,{a:()=>s,v:()=>c});var o=t(28),n=t(842);const s={},c=async e=>{if(s[e])return s[e];const r=(0,n.C)(e),t=await(0,o.readFile)(r,"utf8");return JSON.parse(t)}},840(e,r,t){t.d(r,{Y:()=>n});var o=t(58);const n=async e=>{const r=await(0,o.p)(e);return((...e)=>{const r={};for(const t of e)for(const[e,o]of Object.entries(t))void 0!==r[e]?Object.assign(r[e],o):r[e]=o;return r})(r.configFile,r.credentialsFile)}}};
package/dist/224.index.js CHANGED
@@ -1,3 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";exports.id=224,exports.ids=[224],exports.modules={851(e,t,n){n.d(t,{CreateTokenCommand:()=>Ct,SSOOIDCClient:()=>Pt});var r=n(32),i=n(34),s=n(35),o=n(36),a=n(38),c=n(44),p=n(46),d=n(45),u=n(49),l=n(50),h=n(53),m=n(54),v=n(71),S=n(74),x=n(77),f=n(79),g=n(47),E=n(55);const y=async(e,t,n)=>({operation:(0,g.u)(t).operation,region:await(0,E.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});const I=e=>{const t=[];if("CreateToken"===e.operation)t.push({schemeId:"smithy.api#noAuth"});else t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e));return t},P={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var b=n(845),k=n(87),C=n(88),O=n(90),D=n(94),w=n(95),A=n(96),T=n(97),R=n(98),$=n(57),j=n(99),U=n(100),F=n(102),_=n(101),z=n(103),q=n(105),G=n(43),H=n(106),V=n(846),M=n(850),N=n(75),W=n(52),L=n(112),B=n(113),J=n(83),K=n(114),Q=n(39),X=n(128),Y=n(129),Z=n(40);const ee="required",te="fn",ne="argv",re="ref",ie=!0,se="isSet",oe="booleanEquals",ae="error",ce="endpoint",pe="tree",de="PartitionResult",ue="getAttr",le={[ee]:!1,type:"string"},he={[ee]:!0,default:!1,type:"boolean"},me={[re]:"Endpoint"},ve={[te]:oe,[ne]:[{[re]:"UseFIPS"},!0]},Se={[te]:oe,[ne]:[{[re]:"UseDualStack"},!0]},xe={},fe={[te]:ue,[ne]:[{[re]:de},"supportsFIPS"]},ge={[re]:de},Ee={[te]:oe,[ne]:[!0,{[te]:ue,[ne]:[ge,"supportsDualStack"]}]},ye=[ve],Ie=[Se],Pe=[{[re]:"Region"}],be={version:"1.0",parameters:{Region:le,UseDualStack:he,UseFIPS:he,Endpoint:le},rules:[{conditions:[{[te]:se,[ne]:[me]}],rules:[{conditions:ye,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:ae},{conditions:Ie,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:ae},{endpoint:{url:me,properties:xe,headers:xe},type:ce}],type:pe},{conditions:[{[te]:se,[ne]:Pe}],rules:[{conditions:[{[te]:"aws.partition",[ne]:Pe,assign:de}],rules:[{conditions:[ve,Se],rules:[{conditions:[{[te]:oe,[ne]:[ie,fe]},Ee],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:xe,headers:xe},type:ce}],type:pe},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:ae}],type:pe},{conditions:ye,rules:[{conditions:[{[te]:oe,[ne]:[fe,ie]}],rules:[{conditions:[{[te]:"stringEquals",[ne]:[{[te]:ue,[ne]:[ge,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:xe,headers:xe},type:ce},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:xe,headers:xe},type:ce}],type:pe},{error:"FIPS is enabled but this partition does not support FIPS",type:ae}],type:pe},{conditions:Ie,rules:[{conditions:[Ee],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:xe,headers:xe},type:ce}],type:pe},{error:"DualStack is enabled but this partition does not support DualStack",type:ae}],type:pe},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:xe,headers:xe},type:ce}],type:pe}],type:pe},{error:"Invalid Configuration: Missing Region",type:ae}]},ke=new X.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Ce=(e,t={})=>ke.get(e,()=>(0,Y.s)(be,{endpointParams:e,logger:t.logger}));Z.m.aws=Q.UF;var Oe=n(116),De=n(119);class we extends De.T{constructor(e){super(e),Object.setPrototypeOf(this,we.prototype)}}class Ae extends we{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,Ae.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class Te extends we{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e}),Object.setPrototypeOf(this,Te.prototype),this.error=e.error,this.error_description=e.error_description}}class Re extends we{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,Re.prototype),this.error=e.error,this.error_description=e.error_description}}class $e extends we{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,$e.prototype),this.error=e.error,this.error_description=e.error_description}}class je extends we{name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e}),Object.setPrototypeOf(this,je.prototype),this.error=e.error,this.error_description=e.error_description}}class Ue extends we{name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e}),Object.setPrototypeOf(this,Ue.prototype),this.error=e.error,this.error_description=e.error_description}}class Fe extends we{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),Object.setPrototypeOf(this,Fe.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class _e extends we{name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e}),Object.setPrototypeOf(this,_e.prototype),this.error=e.error,this.error_description=e.error_description}}class ze extends we{name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e}),Object.setPrototypeOf(this,ze.prototype),this.error=e.error,this.error_description=e.error_description}}class qe extends we{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e}),Object.setPrototypeOf(this,qe.prototype),this.error=e.error,this.error_description=e.error_description}}class Ge extends we{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e}),Object.setPrototypeOf(this,Ge.prototype),this.error=e.error,this.error_description=e.error_description}}const He="client",Ve="error",Me="error_description",Ne="http",We="httpError",Le="reason",Be="refreshToken",Je="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",Ke="com.amazonaws.ssooidc",Qe=Oe.O.for(Je);var Xe=[-3,Je,"SSOOIDCServiceException",0,[],[]];Qe.registerError(Xe,we);const Ye=Oe.O.for(Ke);var Ze=[-3,Ke,"AccessDeniedException",{[Ve]:He,[We]:400},[Ve,Le,Me],[0,0,0]];Ye.registerError(Ze,Ae);var et=[-3,Ke,"AuthorizationPendingException",{[Ve]:He,[We]:400},[Ve,Me],[0,0]];Ye.registerError(et,Te);var tt=[-3,Ke,"ExpiredTokenException",{[Ve]:He,[We]:400},[Ve,Me],[0,0]];Ye.registerError(tt,Re);var nt=[-3,Ke,"InternalServerException",{[Ve]:"server",[We]:500},[Ve,Me],[0,0]];Ye.registerError(nt,$e);var rt=[-3,Ke,"InvalidClientException",{[Ve]:He,[We]:401},[Ve,Me],[0,0]];Ye.registerError(rt,je);var it=[-3,Ke,"InvalidGrantException",{[Ve]:He,[We]:400},[Ve,Me],[0,0]];Ye.registerError(it,Ue);var st=[-3,Ke,"InvalidRequestException",{[Ve]:He,[We]:400},[Ve,Le,Me],[0,0,0]];Ye.registerError(st,Fe);var ot=[-3,Ke,"InvalidScopeException",{[Ve]:He,[We]:400},[Ve,Me],[0,0]];Ye.registerError(ot,_e);var at=[-3,Ke,"SlowDownException",{[Ve]:He,[We]:400},[Ve,Me],[0,0]];Ye.registerError(at,ze);var ct=[-3,Ke,"UnauthorizedClientException",{[Ve]:He,[We]:400},[Ve,Me],[0,0]];Ye.registerError(ct,qe);var pt=[-3,Ke,"UnsupportedGrantTypeException",{[Ve]:He,[We]:400},[Ve,Me],[0,0]];Ye.registerError(pt,Ge);const dt=[Qe,Ye];var ut=[0,Ke,"AccessToken",8,0],lt=[0,Ke,"ClientSecret",8,0],ht=[0,Ke,"CodeVerifier",8,0],mt=[0,Ke,"IdToken",8,0],vt=[0,Ke,"RefreshToken",8,0],St=[3,Ke,"CreateTokenRequest",0,["clientId","clientSecret","grantType","deviceCode","code",Be,"scope","redirectUri","codeVerifier"],[0,[()=>lt,0],0,0,0,[()=>vt,0],64,0,[()=>ht,0]],3],xt=[3,Ke,"CreateTokenResponse",0,["accessToken","tokenType","expiresIn",Be,"idToken"],[[()=>ut,0],0,1,[()=>vt,0],[()=>mt,0]]],ft=[9,Ke,"CreateToken",{[Ne]:["POST","/token",200]},()=>St,()=>xt];const gt=e=>{(0,F.I)(process.version);const t=(0,q.I)(e),n=()=>t().then(_.l),r=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??L.E,base64Encoder:e?.base64Encoder??B.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Ce,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??I,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new H.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new M.m}],logger:e?.logger??new N.N,protocol:e?.protocol??V.Y,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:dt,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??W.D,utf8Decoder:e?.utf8Decoder??J.a,utf8Encoder:e?.utf8Encoder??K.P}))(e);(0,k.I)(process.version);const i={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,$.Z)(C.$,i),bodyLengthChecker:e?.bodyLengthChecker??z.n,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,O.pf)({serviceId:r.serviceId,clientVersion:b.rE}),maxAttempts:e?.maxAttempts??(0,$.Z)(v.qs,e),region:e?.region??(0,$.Z)(w.GG,{...w.zH,...i}),requestHandler:j.$.create(e?.requestHandler??n),retryMode:e?.retryMode??(0,$.Z)({...v.kN,default:async()=>(await n()).retryMode||G.L0},e),sha256:e?.sha256??R.V.bind(null,"sha256"),streamCollector:e?.streamCollector??U.k,useDualstackEndpoint:e?.useDualstackEndpoint??(0,$.Z)(A.e$,i),useFipsEndpoint:e?.useFipsEndpoint??(0,$.Z)(T.Ko,i),userAgentAppId:e?.userAgentAppId??(0,$.Z)(D.hV,i)}};var Et=n(130),yt=n(131),It=n(132);class Pt extends x.K{config;constructor(...[e]){const t=gt(e||{});super(t),this.initConfig=t;const n=(x=t,Object.assign(x,{useDualstackEndpoint:x.useDualstackEndpoint??!1,useFipsEndpoint:x.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}));var x;const g=(0,o.D)(n),I=(0,v.$z)(g),P=(0,c.T)(I),b=(0,r.OV)(P),k=((e,t)=>{const n=Object.assign((0,Et.R)(e),(0,It.xA)(e),(0,yt.e)(e),(e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){const n=t.findIndex(t=>t.schemeId===e.schemeId);-1===n?t.push(e):t.splice(n,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider:()=>n,setCredentials(e){r=e},credentials:()=>r}})(e));return t.forEach(e=>e.configure(n)),Object.assign(e,(0,Et.$)(n),(0,It.uv)(n),(0,yt.j)(n),{httpAuthSchemes:(r=n).httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()});var r})((e=>{const t=(0,f.h)(e);return Object.assign(t,{authSchemePreference:(0,E.t)(e.authSchemePreference??[])})})((0,m.C)(b)),e?.extensions||[]);this.config=k,this.middlewareStack.use((0,l.wq)(this.config)),this.middlewareStack.use((0,a.sM)(this.config)),this.middlewareStack.use((0,S.ey)(this.config)),this.middlewareStack.use((0,h.vK)(this.config)),this.middlewareStack.use((0,r.TC)(this.config)),this.middlewareStack.use((0,i.Y7)(this.config)),this.middlewareStack.use((0,s.n)(this.config)),this.middlewareStack.use((0,p.w)(this.config,{httpAuthSchemeParametersProvider:y,identityProviderConfigProvider:async e=>new d.h({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use((0,u.l)(this.config))}destroy(){super.destroy()}}var bt=n(133),kt=n(134);class Ct extends(kt.u.classBuilder().ep(P).m(function(e,t,n,r){return[(0,bt.r)(n,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").sc(ft).build()){}}};
3
- //# sourceMappingURL=224.index.js.map
2
+ "use strict";exports.id=224,exports.ids=[224,843],exports.modules={839(e,o,s){s.d(o,{fromSSO:()=>N});var t=s(57),n=s(840),r=s(56),i=s(62),a=s(60),c=s(61);const l=e=>Object.entries(e).filter(([e])=>e.startsWith(a.I.SSO_SESSION+c.Q)).reduce((e,[o,s])=>({...e,[o.substring(o.indexOf(c.Q)+1)]:s}),{});var f=s(64),g=s(65);const w=()=>({}),h=async(e={})=>(0,g.TA)(e.configFilepath??(0,i.g)()).then(f.A).then(l).catch(w);var d=s(87),p=s(54);class u extends p.m{name="TokenProviderError";constructor(e,o=!0){super(e,o),Object.setPrototypeOf(this,u.prototype)}}var S=s(841);const C="To refresh this SSO session run 'aws sso login' with the corresponding profile.",y=async(e,o,t={},n)=>{const{CreateTokenCommand:r}=await Promise.all([s.e(350),s.e(485)]).then(s.bind(s,859)),i=await(async(e,o={},t)=>{const{SSOOIDCClient:n}=await Promise.all([s.e(350),s.e(485)]).then(s.bind(s,859)),r=e=>o.clientConfig?.[e]??o.parentClientConfig?.[e]??t?.[e];return new n(Object.assign({},o.clientConfig??{},{region:e??o.clientConfig?.region,logger:r("logger"),userAgentAppId:r("userAgentAppId")}))})(o,t,n);return i.send(new r({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))},k=e=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new u(`Token is expired. ${C}`,!1)},m=(e,o,s=!1)=>{if(void 0===o)throw new u(`Value not present for '${e}' in SSO Token${s?". Cannot refresh":""}. ${C}`,!1)};var _=s(842),O=s(106);const{writeFile:x}=O.promises,T=new Date(0),A=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");const s=await(0,n.Y)(e),r=(0,t.Bz)({profile:e.profile??o?.profile}),i=s[r];if(!i)throw new u(`Profile '${r}' could not be found in shared credentials file.`,!1);if(!i.sso_session)throw new u(`Profile '${r}' is missing required property 'sso_session'.`);const a=i.sso_session,c=(await h(e))[a];if(!c)throw new u(`Sso session '${a}' could not be found in shared credentials file.`,!1);for(const e of["sso_start_url","sso_region"])if(!c[e])throw new u(`Sso session '${a}' is missing required property '${e}'.`,!1);c.sso_start_url;const l=c.sso_region;let f;try{f=await(0,S.v)(a)}catch(e){throw new u(`The SSO session token associated with profile=${r} was not found or is invalid. ${C}`,!1)}m("accessToken",f.accessToken),m("expiresAt",f.expiresAt);const{accessToken:g,expiresAt:w}=f,d={token:g,expiration:new Date(w)};if(d.expiration.getTime()-Date.now()>3e5)return d;if(Date.now()-T.getTime()<3e4)return k(d),d;m("clientId",f.clientId,!0),m("clientSecret",f.clientSecret,!0),m("refreshToken",f.refreshToken,!0);try{T.setTime(Date.now());const s=await y(f,l,e,o);m("accessToken",s.accessToken),m("expiresIn",s.expiresIn);const t=new Date(Date.now()+1e3*s.expiresIn);try{await((e,o)=>{const s=(0,_.C)(e),t=JSON.stringify(o,null,2);return x(s,t)})(a,{...f,accessToken:s.accessToken,expiresAt:t.toISOString(),refreshToken:s.refreshToken})}catch(e){}return{token:s.accessToken,expiration:t}}catch(e){return k(d),d}},I=!1,v=async({ssoStartUrl:e,ssoSession:o,ssoAccountId:t,ssoRegion:n,ssoRoleName:i,ssoClient:a,clientConfig:c,parentClientConfig:l,callerClientConfig:f,profile:g,filepath:w,configFilepath:h,ignoreCache:p,logger:u})=>{let C;const y="To refresh this SSO session run aws sso login with the corresponding profile.";if(o)try{const e=await A({profile:g,filepath:w,configFilepath:h,ignoreCache:p})();C={accessToken:e.token,expiresAt:new Date(e.expiration).toISOString()}}catch(e){throw new r.C(e.message,{tryNextLink:I,logger:u})}else try{C=await(0,S.v)(e)}catch(e){throw new r.C(`The SSO session associated with this profile is invalid. ${y}`,{tryNextLink:I,logger:u})}if(new Date(C.expiresAt).getTime()-Date.now()<=0)throw new r.C(`The SSO session associated with this profile has expired. ${y}`,{tryNextLink:I,logger:u});const{accessToken:k}=C,{SSOClient:m,GetRoleCredentialsCommand:_}=await Promise.all([s.e(350),s.e(890)]).then(s.bind(s,852)),O=a||new m(Object.assign({},c??{},{logger:c?.logger??f?.logger??l?.logger,region:c?.region??n,userAgentAppId:c?.userAgentAppId??f?.userAgentAppId??l?.userAgentAppId}));let x;try{x=await O.send(new _({accountId:t,roleName:i,accessToken:k}))}catch(e){throw new r.C(e,{tryNextLink:I,logger:u})}const{roleCredentials:{accessKeyId:T,secretAccessKey:v,sessionToken:N,expiration:$,credentialScope:D,accountId:R}={}}=x;if(!(T&&v&&N&&$))throw new r.C("SSO returns an invalid temporary credential.",{tryNextLink:I,logger:u});const L={accessKeyId:T,secretAccessKey:v,sessionToken:N,expiration:new Date($),...D&&{credentialScope:D},...R&&{accountId:R}};return o?(0,d.g)(L,"CREDENTIALS_SSO","s"):(0,d.g)(L,"CREDENTIALS_SSO_LEGACY","u"),L},N=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");const{ssoStartUrl:s,ssoAccountId:i,ssoRegion:a,ssoRoleName:c,ssoSession:l}=e,{ssoClient:f}=e,g=(0,t.Bz)({profile:e.profile??o?.profile});if(s||i||a||c||l){if(s&&i&&a&&c)return v({ssoStartUrl:s,ssoSession:l,ssoAccountId:i,ssoRegion:a,ssoRoleName:c,ssoClient:f,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:g,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger});throw new r.C('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger})}{const o=(await(0,n.Y)(e))[g];if(!o)throw new r.C(`Profile ${g} was not found.`,{logger:e.logger});if(!(w=o)||"string"!=typeof w.sso_start_url&&"string"!=typeof w.sso_account_id&&"string"!=typeof w.sso_session&&"string"!=typeof w.sso_region&&"string"!=typeof w.sso_role_name)throw new r.C(`Profile ${g} is not configured with SSO credentials.`,{logger:e.logger});if(o?.sso_session){const t=(await h(e))[o.sso_session],n=` configurations in profile ${g} and sso-session ${o.sso_session}`;if(a&&a!==t.sso_region)throw new r.C("Conflicting SSO region"+n,{tryNextLink:!1,logger:e.logger});if(s&&s!==t.sso_start_url)throw new r.C("Conflicting SSO start_url"+n,{tryNextLink:!1,logger:e.logger});o.sso_region=t.sso_region,o.sso_start_url=t.sso_start_url}const{sso_start_url:t,sso_account_id:i,sso_region:c,sso_role_name:l,sso_session:d}=((e,o)=>{const{sso_start_url:s,sso_account_id:t,sso_region:n,sso_role_name:i}=e;if(!(s&&t&&n&&i))throw new r.C(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:o});return e})(o,e.logger);return v({ssoStartUrl:t,ssoSession:d,ssoAccountId:i,ssoRegion:c,ssoRoleName:l,ssoClient:f,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:g,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})}var w}},842(e,o,s){s.d(o,{C:()=>i});var t=s(20),n=s(59),r=s(63);const i=e=>{const o=(0,t.createHash)("sha1").update(e).digest("hex");return(0,n.join)((0,r.R)(),".aws","sso","cache",`${o}.json`)}},841(e,o,s){s.d(o,{a:()=>r,v:()=>i});var t=s(28),n=s(842);const r={},i=async e=>{if(r[e])return r[e];const o=(0,n.C)(e),s=await(0,t.readFile)(o,"utf8");return JSON.parse(s)}},840(e,o,s){s.d(o,{Y:()=>n});var t=s(58);const n=async e=>{const o=await(0,t.p)(e);return((...e)=>{const o={};for(const s of e)for(const[e,t]of Object.entries(s))void 0!==o[e]?Object.assign(o[e],t):o[e]=t;return o})(o.configFile,o.credentialsFile)}}};
package/dist/330.index.js CHANGED
@@ -1,3 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";exports.id=330,exports.ids=[330],exports.modules={840(e,t,a){a.d(t,{ENV_CMDS_FULL_URI:()=>m,ENV_CMDS_RELATIVE_URI:()=>p,fromContainerMetadata:()=>w,fromInstanceMetadata:()=>$,getInstanceMetadataEndpoint:()=>T,httpRequest:()=>c});var n=a(61),r=a(4),o=a(59),i=a(29),s=a(24);function c(e){return new Promise((t,a)=>{const n=(0,s.request)({method:"GET",...e,hostname:e.hostname?.replace(/^\[(.+)\]$/,"$1")});n.on("error",e=>{a(Object.assign(new o.m("Unable to connect to instance metadata service"),e)),n.destroy()}),n.on("timeout",()=>{a(new o.m("TimeoutError from instance metadata service")),n.destroy()}),n.on("response",e=>{const{statusCode:r=400}=e;(r<200||300<=r)&&(a(Object.assign(new o.m("Error response received from instance metadata service"),{statusCode:r})),n.destroy());const s=[];e.on("data",e=>{s.push(e)}),e.on("end",()=>{t(i.Buffer.concat(s)),n.destroy()})}),n.end()})}const l=e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.AccessKeyId&&"string"==typeof e.SecretAccessKey&&"string"==typeof e.Token&&"string"==typeof e.Expiration,d=e=>({accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:new Date(e.Expiration),...e.AccountId&&{accountId:e.AccountId}}),u=({maxRetries:e=0,timeout:t=1e3})=>({maxRetries:e,timeout:t}),f=(e,t)=>{let a=e();for(let n=0;n<t;n++)a=a.catch(e);return a},m="AWS_CONTAINER_CREDENTIALS_FULL_URI",p="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",h="AWS_CONTAINER_AUTHORIZATION_TOKEN",w=(e={})=>{const{timeout:t,maxRetries:a}=u(e);return()=>f(async()=>{const a=await E({logger:e.logger}),r=JSON.parse(await v(t,a));if(!l(r))throw new n.C("Invalid response received from instance metadata service.",{logger:e.logger});return d(r)},a)},v=async(e,t)=>{process.env[h]&&(t.headers={...t.headers,Authorization:process.env[h]});return(await c({...t,timeout:e})).toString()},g={localhost:!0,"127.0.0.1":!0},y={"http:":!0,"https:":!0},E=async({logger:e})=>{if(process.env[p])return{hostname:"169.254.170.2",path:process.env[p]};if(process.env[m]){const t=(0,r.parse)(process.env[m]);if(!t.hostname||!(t.hostname in g))throw new n.C(`${t.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:e});if(!t.protocol||!(t.protocol in y))throw new n.C(`${t.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:e});return{...t,port:t.port?parseInt(t.port,10):void 0}}throw new n.C(`The container metadata credential provider cannot be used unless the ${p} or ${m} environment variable is set`,{tryNextLink:!1,logger:e})};var I=a(57);class A extends n.C{tryNextLink;name="InstanceMetadataV1FallbackError";constructor(e,t=!0){super(e,t),this.tryNextLink=t,Object.setPrototypeOf(this,A.prototype)}}var S,b=a(52);!function(e){e.IPv4="http://169.254.169.254",e.IPv6="http://[fd00:ec2::254]"}(S||(S={}));const _={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:e=>e.ec2_metadata_service_endpoint,default:void 0};var x;!function(e){e.IPv4="IPv4",e.IPv6="IPv6"}(x||(x={}));const N={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE,configFileSelector:e=>e.ec2_metadata_service_endpoint_mode,default:x.IPv4},T=async()=>(0,b.D)(await k()||await R()),k=async()=>(0,I.Z)(_)(),R=async()=>{const e=await(0,I.Z)(N)();switch(e){case x.IPv4:return S.IPv4;case x.IPv6:return S.IPv6;default:throw new Error(`Unsupported endpoint mode: ${e}. Select from ${Object.values(x)}`)}},D=(e,t)=>{const a=300+Math.floor(300*Math.random()),n=new Date(Date.now()+1e3*a);t.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(n)}.\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);const r=e.originalExpiration??e.expiration;return{...e,...r?{originalExpiration:r}:{},expiration:n}},C="/latest/meta-data/iam/security-credentials/",M="AWS_EC2_METADATA_V1_DISABLED",L="ec2_metadata_v1_disabled",O="x-aws-ec2-metadata-token",$=(e={})=>((e,t={})=>{const a=t?.logger||console;let n;return async()=>{let t;try{t=await e(),t.expiration&&t.expiration.getTime()<Date.now()&&(t=D(t,a))}catch(e){if(!n)throw e;a.warn("Credential renew failed: ",e),t=D(n,a)}return n=t,t}})(U(e),{logger:e.logger}),U=(e={})=>{let t=!1;const{logger:a,profile:r}=e,{timeout:o,maxRetries:i}=u(e),s=async(a,o)=>{if(t||null==o.headers?.[O]){let t=!1,a=!1;const o=await(0,I.Z)({environmentVariableSelector:t=>{const r=t[M];if(a=!!r&&"false"!==r,void 0===r)throw new n.C(`${M} not set in env, checking config file next.`,{logger:e.logger});return a},configFileSelector:e=>{const a=e[L];return t=!!a&&"false"!==a,t},default:!1},{profile:r})();if(e.ec2MetadataV1Disabled||o){const n=[];throw e.ec2MetadataV1Disabled&&n.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"),t&&n.push(`config file profile (${L})`),a&&n.push(`process environment variable (${M})`),new A(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${n.join(", ")}].`)}}const i=(await f(async()=>{let e;try{e=await W(o)}catch(e){throw 401===e.statusCode&&(t=!1),e}return e},a)).trim();return f(async()=>{let a;try{a=await F(i,o,e)}catch(e){throw 401===e.statusCode&&(t=!1),e}return a},a)};return async()=>{const e=await T();if(t)return a?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),s(i,{...e,timeout:o});{let n;try{n=(await V({...e,timeout:o})).toString()}catch(n){if(400===n?.statusCode)throw Object.assign(n,{message:"EC2 Metadata token request returned error"});return("TimeoutError"===n.message||[403,404,405].includes(n.statusCode))&&(t=!0),a?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),s(i,{...e,timeout:o})}return s(i,{...e,headers:{[O]:n},timeout:o})}}},V=async e=>c({...e,path:"/latest/api/token",method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),W=async e=>(await c({...e,path:C})).toString(),F=async(e,t,a)=>{const r=JSON.parse((await c({...t,path:C+e})).toString());if(!l(r))throw new n.C("Invalid response received from instance metadata service.",{logger:a.logger});return d(r)}}};
3
- //# sourceMappingURL=330.index.js.map
2
+ "use strict";exports.id=330,exports.ids=[330],exports.modules={848(e,t,a){a.d(t,{ENV_CMDS_FULL_URI:()=>f,ENV_CMDS_RELATIVE_URI:()=>m,fromContainerMetadata:()=>h,fromInstanceMetadata:()=>$});var n=a(56);const r=e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.AccessKeyId&&"string"==typeof e.SecretAccessKey&&"string"==typeof e.Token&&"string"==typeof e.Expiration,o=e=>({accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:new Date(e.Expiration),...e.AccountId&&{accountId:e.AccountId}}),i=({maxRetries:e=0,timeout:t=1e3})=>({maxRetries:e,timeout:t});var s=a(54),c=a(13),l=a.n(c);function d(e){return new Promise((t,a)=>{const n=l().request({method:"GET",...e,hostname:e.hostname?.replace(/^\[(.+)\]$/,"$1")});n.on("error",e=>{a(Object.assign(new s.m("Unable to connect to instance metadata service"),e)),n.destroy()}),n.on("timeout",()=>{a(new s.m("TimeoutError from instance metadata service")),n.destroy()}),n.on("response",e=>{const{statusCode:r=400}=e;(r<200||300<=r)&&(a(Object.assign(new s.m("Error response received from instance metadata service"),{statusCode:r})),n.destroy());const o=[];e.on("data",e=>{o.push(e)}),e.on("end",()=>{t(Buffer.concat(o)),n.destroy()})}),n.end()})}const u=(e,t)=>{let a=e();for(let n=0;n<t;n++)a=a.catch(e);return a},f="AWS_CONTAINER_CREDENTIALS_FULL_URI",m="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",w="AWS_CONTAINER_AUTHORIZATION_TOKEN",h=(e={})=>{const{timeout:t,maxRetries:a}=i(e);return()=>u(async()=>{const a=await y({logger:e.logger}),i=JSON.parse(await p(t,a));if(!r(i))throw new n.C("Invalid response received from instance metadata service.",{logger:e.logger});return o(i)},a)},p=async(e,t)=>{process.env[w]&&(t.headers={...t.headers,Authorization:process.env[w]});return(await d({...t,timeout:e})).toString()},v=new Set(["localhost","127.0.0.1"]),g=new Set(["http:","https:"]),y=async({logger:e})=>{if(process.env[m])return{hostname:"169.254.170.2",path:process.env[m]};if(process.env[f]){let t;try{t=new URL(process.env[f])}catch{throw new n.C(`${process.env[f]} is not a valid container metadata service URL`,{tryNextLink:!1,logger:e})}if(!t.hostname||!v.has(t.hostname))throw new n.C(`${t.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:e});if(!t.protocol||!g.has(t.protocol))throw new n.C(`${t.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:e});return{protocol:t.protocol,hostname:t.hostname,path:t.pathname+t.search,port:t.port?parseInt(t.port,10):void 0}}throw new n.C(`The container metadata credential provider cannot be used unless the ${m} or ${f} environment variable is set`,{tryNextLink:!1,logger:e})};var S=a(52);class E extends n.C{tryNextLink;name="InstanceMetadataV1FallbackError";constructor(e,t=!0){super(e,t),this.tryNextLink=t,Object.setPrototypeOf(this,E.prototype)}}var A,I=a(68);!function(e){e.IPv4="http://169.254.169.254",e.IPv6="http://[fd00:ec2::254]"}(A||(A={}));const b={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:e=>e.ec2_metadata_service_endpoint,default:void 0};var _;!function(e){e.IPv4="IPv4",e.IPv6="IPv6"}(_||(_={}));const x={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE,configFileSelector:e=>e.ec2_metadata_service_endpoint_mode,default:_.IPv4},N=async()=>(0,S.Z)(b)(),k=async()=>{const e=await(0,S.Z)(x)();switch(e){case _.IPv4:return A.IPv4;case _.IPv6:return A.IPv6;default:throw new Error(`Unsupported endpoint mode: ${e}. Select from ${Object.values(_)}`)}},R=(e,t)=>{const a=300+Math.floor(300*Math.random()),n=new Date(Date.now()+1e3*a);t.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(n)}.\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);const r=e.originalExpiration??e.expiration;return{...e,...r?{originalExpiration:r}:{},expiration:n}},T="/latest/meta-data/iam/security-credentials/",D="AWS_EC2_METADATA_V1_DISABLED",L="ec2_metadata_v1_disabled",C="x-aws-ec2-metadata-token",$=(e={})=>((e,t={})=>{const a=t?.logger||console;let n;return async()=>{let t;try{t=await e(),t.expiration&&t.expiration.getTime()<Date.now()&&(t=R(t,a))}catch(e){if(!n)throw e;a.warn("Credential renew failed: ",e),t=R(n,a)}return n=t,t}})(M(e),{logger:e.logger}),M=(e={})=>{let t=!1;const{logger:a,profile:r}=e,{timeout:o,maxRetries:s}=i(e),c=async(a,o)=>{if(t||null==o.headers?.[C]){let t=!1,a=!1;const o=await(0,S.Z)({environmentVariableSelector:t=>{const r=t[D];if(a=!!r&&"false"!==r,void 0===r)throw new n.C(`${D} not set in env, checking config file next.`,{logger:e.logger});return a},configFileSelector:e=>{const a=e[L];return t=!!a&&"false"!==a,t},default:!1},{profile:r})();if(e.ec2MetadataV1Disabled||o){const n=[];throw e.ec2MetadataV1Disabled&&n.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"),t&&n.push(`config file profile (${L})`),a&&n.push(`process environment variable (${D})`),new E(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${n.join(", ")}].`)}}const i=(await u(async()=>{let e;try{e=await U(o)}catch(e){throw 401===e.statusCode&&(t=!1),e}return e},a)).trim();return u(async()=>{let a;try{a=await V(i,o,e)}catch(e){throw 401===e.statusCode&&(t=!1),e}return a},a)};return async()=>{const e=await(async()=>(0,I.D)(await N()||await k()))();if(t)return a?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),c(s,{...e,timeout:o});{let n;try{n=(await O({...e,timeout:o})).toString()}catch(n){if(400===n?.statusCode)throw Object.assign(n,{message:"EC2 Metadata token request returned error"});return("TimeoutError"===n.message||[403,404,405].includes(n.statusCode))&&(t=!0),a?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),c(s,{...e,timeout:o})}return c(s,{...e,headers:{[C]:n},timeout:o})}}},O=async e=>d({...e,path:"/latest/api/token",method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),U=async e=>(await d({...e,path:T})).toString(),V=async(e,t,a)=>{const i=JSON.parse((await d({...t,path:T+e})).toString());if(!r(i))throw new n.C("Invalid response received from instance metadata service.",{logger:a.logger});return o(i)}}};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ "use strict";exports.id=350,exports.ids=[350],exports.modules={854(e,t,r){r.d(t,{Y:()=>B});var n=r(113),s=r(115),o=r(850);function i(e,t,r){if(r<=0||!Number.isInteger(r))throw new Error("Invalid number of delimiters ("+r+") for splitEvery.");const n=e.split(t);if(1===r)return n;const s=[];let o="";for(let e=0;e<n.length;e++)""===o?o=n[e]:o+=t+n[e],(e+1)%r===0&&(s.push(o),o="");return""!==o&&s.push(o),s}var a=r(855),c=r(33),f=r(116),u=r(119),l=r(856);class h extends f.t{async serializeRequest(e,t,r){const o=t&&"object"==typeof t?t:{},i=this.serializer,a={},f={},u=await r.endpoint(),h=n.l1.of(e?.input),d=[],w=[];let p,m=!1;const y=new c.K({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:a,headers:f,body:void 0});if(u){this.updateServiceEndpoint(y,u),this.setHostPrefix(y,e,o);const t=(0,s.c)(e.traits);if(t.http){y.method=t.http[0];const[e,r]=t.http[1].split("?");"/"==y.path?y.path=e:y.path+=e;const n=new URLSearchParams(r??"");for(const[e,t]of n)a[e]=t}}for(const[e,t]of h.structIterator()){const r=t.getMergedTraits()??{},n=o[e];if(null!=n||t.isIdempotencyToken())if(r.httpPayload){if(t.isStreaming()){t.isStructSchema()?o[e]&&(p=await this.serializeEventStream({eventStream:o[e],requestSchema:h})):p=n}else i.write(t,n),p=i.flush()}else if(r.httpLabel){i.write(t,n);const r=i.flush();y.path.includes(`{${e}+}`)?y.path=y.path.replace(`{${e}+}`,r.split("/").map(l.$).join("/")):y.path.includes(`{${e}}`)&&(y.path=y.path.replace(`{${e}}`,(0,l.$)(r)))}else if(r.httpHeader)i.write(t,n),f[r.httpHeader.toLowerCase()]=String(i.flush());else if("string"==typeof r.httpPrefixHeaders)for(const e in n){const s=n[e],o=r.httpPrefixHeaders+e;i.write([t.getValueSchema(),{httpHeader:o}],s),f[o.toLowerCase()]=i.flush()}else r.httpQuery||r.httpQueryParams?this.serializeQuery(t,n,a):(m=!0,d.push(e),w.push(t));else if(r.httpLabel&&(y.path.includes(`{${e}+}`)||y.path.includes(`{${e}}`)))throw new Error(`No value provided for input HTTP label: ${e}.`)}if(m&&o){const[e,t]=(h.getName(!0)??"#Unknown").split("#"),r=h.getSchema()[6],n=[3,e,t,h.getMergedTraits(),d,w,void 0];r?n[6]=r:n.pop(),i.write(n,o),p=i.flush()}return y.headers=f,y.query=a,y.body=p,y}serializeQuery(e,t,r){const n=this.serializer,s=e.getMergedTraits();if(s.httpQueryParams){for(const n in t)if(!(n in r)){const o=t[n],i=e.getValueSchema();Object.assign(i.getMergedTraits(),{...s,httpQuery:n,httpQueryParams:void 0}),this.serializeQuery(i,o,r)}}else if(e.isListSchema()){const o=!!e.getMergedTraits().sparse,i=[];for(const r of t){n.write([e.getValueSchema(),s],r);const t=n.flush();(o||void 0!==t)&&i.push(t)}r[s.httpQuery]=i}else n.write([e,s],t),r[s.httpQuery]=n.flush()}async deserializeResponse(e,t,r){const s=this.deserializer,o=n.l1.of(e.output),i={};if(r.statusCode>=300){const n=await(0,u.P)(r.body,t);throw n.byteLength>0&&Object.assign(i,await s.read(15,n)),await this.handleError(e,t,r,i,this.deserializeMetadata(r)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(const e in r.headers){const t=r.headers[e];delete r.headers[e],r.headers[e.toLowerCase()]=t}const a=await this.deserializeHttpMessage(o,t,r,i);if(a.length){const e=await(0,u.P)(r.body,t);if(e.byteLength>0){const t=await s.read(o,e);for(const e of a)null!=t[e]&&(i[e]=t[e])}}else a.discardResponseBody&&await(0,u.P)(r.body,t);return i.$metadata=this.deserializeMetadata(r),i}async deserializeHttpMessage(e,t,r,s,c){let f;f=s instanceof Set?c:s;let l=!0;const h=this.deserializer,d=n.l1.of(e),w=[];for(const[e,n]of d.structIterator()){const s=n.getMemberTraits();if(s.httpPayload){l=!1;if(n.isStreaming()){const t=n.isStructSchema();f[e]=t?await this.deserializeEventStream({response:r,responseSchema:d}):(0,o.c)(r.body)}else if(r.body){const s=await(0,u.P)(r.body,t);s.byteLength>0&&(f[e]=await h.read(n,s))}}else if(s.httpHeader){const t=String(s.httpHeader).toLowerCase(),o=r.headers[t];if(null!=o)if(n.isListSchema()){const r=n.getValueSchema();let s;r.getMergedTraits().httpHeader=t,s=r.isTimestampSchema()&&4===r.getSchema()?i(o,",",2):(0,a.G)(o);const c=[];for(const e of s)c.push(await h.read(r,e.trim()));f[e]=c}else f[e]=await h.read(n,o)}else if(void 0!==s.httpPrefixHeaders){f[e]={};for(const t in r.headers)if(t.startsWith(s.httpPrefixHeaders)){const o=r.headers[t],i=n.getValueSchema();i.getMergedTraits().httpHeader=t,f[e][t.slice(s.httpPrefixHeaders.length)]=await h.read(i,o)}}else s.httpResponseCode?f[e]=r.statusCode:w.push(e)}return w.discardResponseBody=l,w}}var d=r(83),w=r(77);function p(e){return(e.includes(",")||e.includes('"'))&&(e=`"${e.replace(/"/g,'\\"')}"`),e}var m=r(125),y=r(73),b=r(118),g=r(124);class v extends b.f{settings;stringBuffer="";constructor(e){super(),this.settings=e}write(e,t){const r=n.l1.of(e);switch(typeof t){case"object":if(null===t)return void(this.stringBuffer="null");if(r.isTimestampSchema()){if(!(t instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${t} when schema expected Date in ${r.getName(!0)}`);switch((0,g.V)(r,this.settings)){case 5:this.stringBuffer=t.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=(0,d.JV)(t);break;case 7:this.stringBuffer=String(t.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",t),this.stringBuffer=String(t.getTime()/1e3)}return}if(r.isBlobSchema()&&"byteLength"in t)return void(this.stringBuffer=(this.serdeContext?.base64Encoder??w.n)(t));if(r.isListSchema()&&Array.isArray(t)){let e="";for(const n of t){this.write([r.getValueSchema(),r.getMergedTraits()],n);const t=this.flush();""!==e&&(e+=", "),e+=r.getValueSchema().isTimestampSchema()?t:p(t)}return void(this.stringBuffer=e)}this.stringBuffer=JSON.stringify(t,null,2);break;case"string":const e=r.getMergedTraits().mediaType;let n=t;if(e){if(("application/json"===e||e.endsWith("+json"))&&(n=m.A.from(n)),r.getMergedTraits().httpHeader)return void(this.stringBuffer=(this.serdeContext?.base64Encoder??w.n)(n.toString()))}this.stringBuffer=t;break;default:r.isIdempotencyToken()?this.stringBuffer=(0,y.ec)():this.stringBuffer=String(t)}}flush(){const e=this.stringBuffer;return this.stringBuffer="",e}}class ${codecSerializer;stringSerializer;buffer;constructor(e,t,r=new v(t)){this.codecSerializer=e,this.stringSerializer=r}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e)}write(e,t){const r=n.l1.of(e),s=r.getMergedTraits();return s.httpHeader||s.httpLabel||s.httpQuery?(this.stringSerializer.write(r,t),void(this.buffer=this.stringSerializer.flush())):this.codecSerializer.write(r,t)}flush(){if(void 0!==this.buffer){const e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}}var E=r(79),T=r(78),N=r(857);class S extends b.f{codecDeserializer;stringDeserializer;constructor(e,t){super(),this.codecDeserializer=e,this.stringDeserializer=new N.k(t)}setSerdeContext(e){this.stringDeserializer.setSerdeContext(e),this.codecDeserializer.setSerdeContext(e),this.serdeContext=e}read(e,t){const r=n.l1.of(e),s=r.getMergedTraits(),o=this.serdeContext?.utf8Encoder??E.P;if(s.httpHeader||s.httpResponseCode)return this.stringDeserializer.read(r,o(t));if(s.httpPayload){if(r.isBlobSchema()){const e=this.serdeContext?.utf8Decoder??T.a;return"string"==typeof t?e(t):t}if(r.isStringSchema())return"byteLength"in t?o(t):t}return this.codecDeserializer.read(r,t)}}var x=r(120),R=r(122),D=r(128);class B extends h{serializer;deserializer;codec;mixin=new x.U;constructor({defaultNamespace:e,errorTypeRegistries:t}){super({defaultNamespace:e,errorTypeRegistries:t});const r={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=new R.V(r),this.serializer=new $(this.codec.createSerializer(),r),this.deserializer=new S(this.codec.createDeserializer(),r)}getShapeId(){return"aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(e){this.codec.setSerdeContext(e),super.setSerdeContext(e)}async serializeRequest(e,t,r){const s=await super.serializeRequest(e,t,r),o=n.l1.of(e.input);if(!s.headers["content-type"]){const e=this.mixin.resolveRestContentType(this.getDefaultContentType(),o);e&&(s.headers["content-type"]=e)}return null==s.body&&s.headers["content-type"]===this.getDefaultContentType()&&(s.body="{}"),s}async deserializeResponse(e,t,r){const s=await super.deserializeResponse(e,t,r),o=n.l1.of(e.output);for(const[e,t]of o.structIterator())t.getMemberTraits().httpPayload&&!(e in s)&&(s[e]=null);return s}async handleError(e,t,r,s,o){const i=(0,D.cJ)(r,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,i,this.options.defaultNamespace);const{errorSchema:a,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,r,s,o),f=n.l1.of(a),u=s.message??s.Message??"UnknownError",l=new(this.compositeErrorRegistry.getErrorCtor(a)??Error)({});await this.deserializeHttpMessage(a,t,r,s);const h={},d=this.codec.createDeserializer();for(const[e,t]of f.structIterator()){const r=t.getMergedTraits().jsonName??e;h[e]=d.readObject(t,s[r])}throw this.mixin.decorateServiceException(Object.assign(l,c,{$fault:f.getMergedTraits().error,message:u},h),s)}getDefaultContentType(){return"application/json"}}},858(e,t,r){r.d(t,{m:()=>n});class n{async sign(e,t,r){return e}}},856(e,t,r){function n(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}r.d(t,{$:()=>n})},857(e,t,r){r.d(t,{k:()=>E});var n=r(113),s=r(855),o=r(74);const i="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",a="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",c="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",f="(\\d?\\d)",u="(\\d{4})",l=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),h=new RegExp(`^${i}, ${f} ${a} ${u} ${c} GMT$`),d=new RegExp(`^${i}, ${f}-${a}-(\\d\\d) ${c} GMT$`),w=new RegExp(`^${i} ${a} ( [1-9]|\\d\\d) ${c} ${u}$`),p=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function m(e,t,r){const n=Number(e);if(n<t||n>r)throw new Error(`Value ${n} out of range [${t}, ${r}]`)}var y=r(125),b=r(126),g=r(79),v=r(118),$=r(124);class E extends v.f{settings;constructor(e){super(),this.settings=e}read(e,t){const r=n.l1.of(e);if(r.isListSchema())return(0,s.G)(t).map(e=>this.read(r.getValueSchema(),e));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??o.E)(t);if(r.isTimestampSchema()){switch((0,$.V)(r,this.settings)){case 5:return(e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC3339 timestamps must be strings");const t=l.exec(e);if(!t)throw new TypeError(`Invalid RFC3339 timestamp format ${e}`);const[,r,n,s,o,i,a,,c,f]=t;m(n,1,12),m(s,1,31),m(o,0,23),m(i,0,59),m(a,0,60);const u=new Date(Date.UTC(Number(r),Number(n)-1,Number(s),Number(o),Number(i),Number(a),Number(c)?Math.round(1e3*parseFloat(`0.${c}`)):0));if(u.setUTCFullYear(Number(r)),"Z"!=f.toUpperCase()){const[,e,t,r]=/([+-])(\d\d):(\d\d)/.exec(f)||[void 0,"+",0,0],n="-"===e?1:-1;u.setTime(u.getTime()+n*(60*Number(t)*60*1e3+60*Number(r)*1e3))}return u})(t);case 6:return(e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC7231 timestamps must be strings.");let t,r,n,s,o,i,a,c;if((c=h.exec(e))?[,t,r,n,s,o,i,a]=c:(c=d.exec(e))?([,t,r,n,s,o,i,a]=c,n=(Number(n)+1900).toString()):(c=w.exec(e))&&([,r,t,s,o,i,a,n]=c),n&&i){const e=Date.UTC(Number(n),p.indexOf(r),Number(t),Number(s),Number(o),Number(i),a?Math.round(1e3*parseFloat(`0.${a}`)):0);m(t,1,31),m(s,0,23),m(o,0,59),m(i,0,60);const c=new Date(e);return c.setUTCFullYear(Number(n)),c}throw new TypeError(`Invalid RFC7231 date-time value ${e}.`)})(t);case 7:return(e=>{if(null==e)return;let t=NaN;if("number"==typeof e)t=e;else if("string"==typeof e){if(!/^-?\d*\.?\d+$/.test(e))throw new TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e)}else"object"==typeof e&&1===e.tag&&(t=e.value);if(isNaN(t)||Math.abs(t)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(1e3*t))})(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}}if(r.isStringSchema()){const e=r.getMergedTraits().mediaType;let n=t;if(e){r.getMergedTraits().httpHeader&&(n=this.base64ToUtf8(n));return("application/json"===e||e.endsWith("+json"))&&(n=y.A.from(n)),n}}return r.isNumericSchema()?Number(t):r.isBigIntegerSchema()?BigInt(t):r.isBigDecimalSchema()?new b.D(t,"bigDecimal"):r.isBooleanSchema()?"true"===String(t).toLowerCase():t}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??g.P)((this.serdeContext?.base64Decoder??o.E)(e))}}},855(e,t,r){r.d(t,{G:()=>n});const n=e=>{const t=e.length,r=[];let n,s=!1,o=0;for(let i=0;i<t;++i){const t=e[i];switch(t){case'"':"\\"!==n&&(s=!s);break;case",":s||(r.push(e.slice(o,i)),o=i+1)}n=t}return r.push(e.slice(o)),r.map(e=>{const t=(e=e.trim()).length;return t<2?e:('"'===e[0]&&'"'===e[t-1]&&(e=e.slice(1,t-1)),e.replace(/\\"/g,'"'))})}},850(e,t,r){r.d(t,{c:()=>b});var n=r(16),s=r(75);const o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=Object.entries(o).reduce((e,[t,r])=>(e[r]=Number(t),e),{}),a=o.split("");function c(e){let t;t="string"==typeof e?(e=>(new TextEncoder).encode(e))(e):e;const r="object"==typeof t&&"number"==typeof t.length,n="object"==typeof t&&"number"==typeof t.byteOffset&&"number"==typeof t.byteLength;if(!r&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let s="";for(let e=0;e<t.length;e+=3){let r=0,n=0;for(let s=e,o=Math.min(e+3,t.length);s<o;s++)r|=t[s]<<8*(o-s-1),n+=8;const o=Math.ceil(n/6);r<<=6*o-n;for(let e=1;e<=o;e++){const t=6*(o-e);s+=a[(r&63<<t)>>t]}s+="==".slice(0,4-o)}return s}var f=r(89);const u=async e=>"function"==typeof Blob&&e instanceof Blob||"Blob"===e.constructor?.name?void 0!==Blob.prototype.arrayBuffer?new Uint8Array(await e.arrayBuffer()):async function(e){const t=await function(e){return new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>{if(2!==n.readyState)return r(new Error("Reader aborted too early"));const e=n.result??"",s=e.indexOf(","),o=s>-1?s+1:e.length;t(e.substring(o))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(e)})}(e),r=(e=>{let t=e.length/4*3;"=="===e.slice(-2)?t-=2:"="===e.slice(-1)&&t--;const r=new ArrayBuffer(t),n=new DataView(r);for(let t=0;t<e.length;t+=4){let r=0,s=0;for(let n=t,o=t+3;n<=o;n++)if("="!==e[n]){if(!(e[n]in i))throw new TypeError(`Invalid character ${e[n]} in base64 string.`);r|=i[e[n]]<<6*(o-n),s+=6}else r>>=6;const o=t/4*3;r>>=s%8;const a=Math.floor(s/8);for(let e=0;e<a;e++){const t=8*(a-e-1);n.setUint8(o+e,(r&255<<t)>>t)}}return new Uint8Array(r)})(t);return new Uint8Array(r)}(e):async function(e){const t=[],r=e.getReader();let n=!1,s=0;for(;!n;){const{done:e,value:o}=await r.read();o&&(t.push(o),s+=o.length),n=e}const o=new Uint8Array(s);let i=0;for(const e of t)o.set(e,i),i+=e.length;return o}(e);const l=e=>"function"==typeof ReadableStream&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),h="The stream has already been transformed.",d=e=>{if(!w(e)&&!l(e)){throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${e?.__proto__?.constructor?.name||e}`)}let t=!1;const r=async()=>{if(t)throw new Error(h);return t=!0,await u(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async e=>{const t=await r();if("base64"===e)return c(t);if("hex"===e)return(0,f.n)(t);if(void 0===e||"utf8"===e||"utf-8"===e)return(e=>{if("string"==typeof e)return e;if("object"!=typeof e||"number"!=typeof e.byteOffset||"number"!=typeof e.byteLength)throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)})(t);if("function"==typeof TextDecoder)return new TextDecoder(e).decode(t);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw new Error(h);if(t=!0,w(e))return(e=>{if("function"!=typeof e.stream)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 e.stream()})(e);if(l(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},w=e=>"function"==typeof Blob&&e instanceof Blob;class p extends n.Writable{bufferedBytes=[];_write(e,t,r){this.bufferedBytes.push(e),r()}}const m=e=>(e=>"function"==typeof ReadableStream&&e instanceof ReadableStream)(e)?async function(e){const t=[],r=e.getReader();let n=!1,s=0;for(;!n;){const{done:e,value:o}=await r.read();o&&(t.push(o),s+=o.length),n=e}const o=new Uint8Array(s);let i=0;for(const e of t)o.set(e,i),i+=e.length;return o}(e):new Promise((t,r)=>{const n=new p;e.pipe(n),e.on("error",e=>{n.end(),r(e)}),n.on("error",r),n.on("finish",function(){const e=new Uint8Array(Buffer.concat(this.bufferedBytes));t(e)})}),y="The stream has already been transformed.",b=e=>{if(!(e instanceof n.Readable))try{return d(e)}catch(t){throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${e?.__proto__?.constructor?.name||e}`)}let t=!1;const r=async()=>{if(t)throw new Error(y);return t=!0,await m(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async e=>{const t=await r();if(void 0===e||Buffer.isEncoding(e))return(0,s.Q)(t.buffer,t.byteOffset,t.byteLength).toString(e);return new TextDecoder(e).decode(t)},transformToWebStream:()=>{if(t)throw new Error(y);if(null!==e.readableFlowing)throw new Error("The stream has been consumed by other callbacks.");if("function"!=typeof n.Readable.toWeb)throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return t=!0,n.Readable.toWeb(e)}})}},853(e){e.exports={rE:"3.997.17"}}};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ "use strict";exports.id=41,exports.ids=[41],exports.modules={860(t,e,n){n.d(e,{getDefaultRoleAssumer:()=>is,getDefaultRoleAssumerWithWebIdentity:()=>ss});var i=n(52),s=n(103);const r={silence:!1};var o=n(87),a=n(138),c=n(51);const u={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var l=n(117),h=n(121);class f extends h.T{constructor(t){super(t),Object.setPrototypeOf(this,f.prototype)}}class d extends f{name="ExpiredTokenException";$fault="client";constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,d.prototype)}}class p extends f{name="MalformedPolicyDocumentException";$fault="client";constructor(t){super({name:"MalformedPolicyDocumentException",$fault:"client",...t}),Object.setPrototypeOf(this,p.prototype)}}class g extends f{name="PackedPolicyTooLargeException";$fault="client";constructor(t){super({name:"PackedPolicyTooLargeException",$fault:"client",...t}),Object.setPrototypeOf(this,g.prototype)}}class m extends f{name="RegionDisabledException";$fault="client";constructor(t){super({name:"RegionDisabledException",$fault:"client",...t}),Object.setPrototypeOf(this,m.prototype)}}class w extends f{name="IDPRejectedClaimException";$fault="client";constructor(t){super({name:"IDPRejectedClaimException",$fault:"client",...t}),Object.setPrototypeOf(this,w.prototype)}}class y extends f{name="InvalidIdentityTokenException";$fault="client";constructor(t){super({name:"InvalidIdentityTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,y.prototype)}}class v extends f{name="IDPCommunicationErrorException";$fault="client";$retryable={};constructor(t){super({name:"IDPCommunicationErrorException",$fault:"client",...t}),Object.setPrototypeOf(this,v.prototype)}}const E="AssumedRoleUser",b="Credentials",x="DurationSeconds",S="Policy",I="PolicyArns",A="PackedPolicySize",$="RoleArn",T="RoleSessionName",N="SourceIdentity",P="awsQueryError",R="client",C="error",k="httpError",D="message",_="smithy.ts.sdk.synthetic.com.amazonaws.sts",O="com.amazonaws.sts",j=l.O.for(_);var M=[-3,_,"STSServiceException",0,[],[]];j.registerError(M,f);const F=l.O.for(O);var L=[-3,O,"ExpiredTokenException",{[P]:["ExpiredTokenException",400],[C]:R,[k]:400},[D],[0]];F.registerError(L,d);var U=[-3,O,"IDPCommunicationErrorException",{[P]:["IDPCommunicationError",400],[C]:R,[k]:400},[D],[0]];F.registerError(U,v);var q=[-3,O,"IDPRejectedClaimException",{[P]:["IDPRejectedClaim",403],[C]:R,[k]:403},[D],[0]];F.registerError(q,w);var V=[-3,O,"InvalidIdentityTokenException",{[P]:["InvalidIdentityToken",400],[C]:R,[k]:400},[D],[0]];F.registerError(V,y);var W=[-3,O,"MalformedPolicyDocumentException",{[P]:["MalformedPolicyDocument",400],[C]:R,[k]:400},[D],[0]];F.registerError(W,p);var z=[-3,O,"PackedPolicyTooLargeException",{[P]:["PackedPolicyTooLarge",400],[C]:R,[k]:400},[D],[0]];F.registerError(z,g);var Y=[-3,O,"RegionDisabledException",{[P]:["RegionDisabledException",403],[C]:R,[k]:403},[D],[0]];F.registerError(Y,m);const G=[j,F];var K=[0,O,"accessKeySecretType",8,0],X=[0,O,"clientTokenType",8,0],H=[3,O,E,0,["AssumedRoleId","Arn"],[0,0],2],J=[3,O,"AssumeRoleRequest",0,[$,T,I,S,x,"Tags","TransitiveTagKeys","ExternalId","SerialNumber","TokenCode",N,"ProvidedContexts"],[0,0,()=>st,0,1,()=>ot,64,0,0,0,0,()=>rt],2],B=[3,O,"AssumeRoleResponse",0,[b,E,A,N],[[()=>tt,0],()=>H,1,0]],Q=[3,O,"AssumeRoleWithWebIdentityRequest",0,[$,T,"WebIdentityToken","ProviderId",I,S,x],[0,0,[()=>X,0],0,()=>st,0,1],3],Z=[3,O,"AssumeRoleWithWebIdentityResponse",0,[b,"SubjectFromWebIdentityToken",E,A,"Provider","Audience",N],[[()=>tt,0],0,()=>H,1,0,0,0]],tt=[3,O,b,0,["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],[0,[()=>K,0],0,4],4],et=[3,O,"PolicyDescriptorType",0,["arn"],[0]],nt=[3,O,"ProvidedContext",0,["ProviderArn","ContextAssertion"],[0,0]],it=[3,O,"Tag",0,["Key","Value"],[0,0],2],st=[1,O,"policyDescriptorListType",0,()=>et],rt=[1,O,"ProvidedContextsListType",0,()=>nt],ot=[1,O,"tagListType",0,()=>it],at=[9,O,"AssumeRole",0,()=>J,()=>B],ct=[9,O,"AssumeRoleWithWebIdentity",0,()=>Q,()=>Z];class ut extends(a.u.classBuilder().ep(u).m(function(t,e,n,i){return[(0,c.rD)(n,t.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").sc(at).build()){}class lt extends(a.u.classBuilder().ep(u).m(function(t,e,n,i){return[(0,c.rD)(n,t.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").sc(ct).build()){}const ht=t=>{if("string"==typeof t?.Arn){const e=t.Arn.split(":");if(e.length>4&&""!==e[4])return e[4]}},ft=async(t,e,n,o={})=>{const a="function"==typeof t?await t():t,c="function"==typeof e?await e():e;let u="";const l=a??c??(u=await function(t={}){return(0,i.Z)({...s.GG,default:async()=>(r.silence||console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly."),"us-east-1")},{...s.zH,...t})}(o)());return n?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${a} (credential provider clientConfig)`,`${c} (contextual client)`,`${u} (STS default: AWS_REGION, profile region, or us-east-1)`),l},dt=t=>"h2"===t?.metadata?.handlerProtocol;var pt=n(36),gt=n(32),mt=n(38),wt=n(34),yt=n(35),vt=n(43),Et=n(42),bt=n(46),xt=n(47),St=n(49),It=n(70),At=n(84),$t=n(71),Tt=n(85),Nt=n(86),Pt=n(37),Rt=n(54);const Ct={environmentVariableSelector(t){if(t.AWS_SIGV4A_SIGNING_REGION_SET)return t.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map(t=>t.trim());throw new Rt.m("AWS_SIGV4A_SIGNING_REGION_SET not set in env.",{tryNextLink:!0})},configFileSelector(t){if(t.sigv4a_signing_region_set)return(t.sigv4a_signing_region_set??"").split(",").map(t=>t.trim());throw new Rt.m("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0},kt=null,Dt=null;var _t=n(88);const Ot="X-Amz-S3session-Token",jt=Ot.toLowerCase();class Mt extends _t.B{async signWithCredentials(t,e,n){const i=Ft(e);t.headers[jt]=e.sessionToken;return Lt(this,i),this.signRequest(t,n??{})}async presignWithCredentials(t,e,n){const i=Ft(e);delete t.headers[jt],t.headers[Ot]=e.sessionToken,t.query=t.query??{},t.query[Ot]=e.sessionToken;return Lt(this,i),this.presign(t,n)}}function Ft(t){return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,expiration:t.expiration}}function Lt(t,e){const n=t.credentialProvider;t.credentialProvider=()=>(t.credentialProvider=n,Promise.resolve(e))}class Ut{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){return"function"==typeof Dt?"crt":"function"==typeof kt?"js":"none"}constructor(t){this.sigv4Signer=new Mt(t),this.signerOptions=t}async sign(t,e={}){return"*"===e.signingRegion?this.getSigv4aSigner().sign(t,e):this.sigv4Signer.sign(t,e)}async signWithCredentials(t,e,n={}){if("*"===n.signingRegion){const i=this.getSigv4aSigner();if(Dt&&i instanceof Dt)return i.signWithCredentials(t,e,n);throw new Error('signWithCredentials with signingRegion \'*\' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt')}return this.sigv4Signer.signWithCredentials(t,e,n)}async presign(t,e={}){if("*"===e.signingRegion){const n=this.getSigv4aSigner();if(Dt&&n instanceof Dt)return n.presign(t,e);throw new Error('presign with signingRegion \'*\' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt')}return this.sigv4Signer.presign(t,e)}async presignWithCredentials(t,e,n={}){if("*"===n.signingRegion)throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(t,e,n)}getSigv4aSigner(){if(!this.sigv4aSigner){const t=Dt,e=kt;if("node"===this.signerOptions.runtime){if(!t&&!e)throw new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");if(t&&"function"==typeof t)this.sigv4aSigner=new t({...this.signerOptions,signingAlgorithm:1});else{if(!e||"function"!=typeof e)throw new Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");this.sigv4aSigner=new e({...this.signerOptions})}}else{if(!e||"function"!=typeof e)throw new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");this.sigv4aSigner=new e({...this.signerOptions})}}return this.sigv4aSigner}}var qt=n(44),Vt=n(69),Wt=n(66),zt=n(129),Yt=n(132),Gt=n(133),Kt=n(130),Xt=n(134);const Ht="ref",Jt=-1,Bt=!0,Qt="isSet",Zt="PartitionResult",te="booleanEquals",ee="stringEquals",ne="getAttr",ie="us-east-1",se="sigv4",re="https://sts.{Region}.{PartitionResult#dnsSuffix}",oe={[Ht]:"Endpoint"},ae={[Ht]:"Region"},ce={[Ht]:Zt},ue={},le=[ae],he={conditions:[[Qt,[oe]],[Qt,le],["aws.partition",le,Zt],[te,[{[Ht]:"UseFIPS"},Bt]],[te,[{[Ht]:"UseDualStack"},Bt]],[ee,[ae,"aws-global"]],[te,[{[Ht]:"UseGlobalEndpoint"},Bt]],[ee,[ae,"eu-central-1"]],[te,[{fn:ne,argv:[ce,"supportsDualStack"]},Bt]],[te,[{fn:ne,argv:[ce,"supportsFIPS"]},Bt]],[ee,[ae,"ap-south-1"]],[ee,[ae,"eu-north-1"]],[ee,[ae,"eu-west-1"]],[ee,[ae,"eu-west-2"]],[ee,[ae,"eu-west-3"]],[ee,[ae,"sa-east-1"]],[ee,[ae,ie]],[ee,[ae,"us-east-2"]],[ee,[ae,"us-west-2"]],[ee,[ae,"us-west-1"]],[ee,[ae,"ca-central-1"]],[ee,[ae,"ap-southeast-1"]],[ee,[ae,"ap-northeast-1"]],[ee,[ae,"ap-southeast-2"]],[ee,[{fn:ne,argv:[ce,"name"]},"aws-us-gov"]]],results:[[Jt],["https://sts.amazonaws.com",{authSchemes:[{name:se,signingName:"sts",signingRegion:ie}]}],[re,{authSchemes:[{name:se,signingName:"sts",signingRegion:"{Region}"}]}],[Jt,"Invalid Configuration: FIPS and custom endpoint are not supported"],[Jt,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[oe,ue],["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",ue],[Jt,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://sts.{Region}.amazonaws.com",ue],["https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",ue],[Jt,"FIPS is enabled but this partition does not support FIPS"],["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",ue],[Jt,"DualStack is enabled but this partition does not support DualStack"],[re,ue],[Jt,"Invalid Configuration: Missing Region"]]},fe=1e8,de=new Int32Array([-1,1,-1,0,30,3,1,4,fe+14,2,5,fe+14,3,25,6,4,24,7,5,fe+1,8,6,9,fe+13,7,fe+1,10,10,fe+1,11,11,fe+1,12,12,fe+1,13,13,fe+1,14,14,fe+1,15,15,fe+1,16,16,fe+1,17,17,fe+1,18,18,fe+1,19,19,fe+1,20,20,fe+1,21,21,fe+1,22,22,fe+1,23,23,fe+1,fe+2,8,fe+11,fe+12,4,28,26,9,27,fe+10,24,fe+8,fe+9,8,29,fe+7,9,fe+6,fe+7,3,fe+3,31,4,fe+4,fe+5]),pe=Xt.d.from(de,2,he.conditions,he.results),ge=new Yt.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),me=(t,e={})=>ge.get(t,()=>(0,Gt.c)(pe,{endpointParams:t,logger:e.logger}));Kt.m.aws=zt.U;const we=(ye=async(t,e,n)=>({operation:(0,qt.u)(e).operation,region:await(0,Vt.t)(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),async(t,e,n)=>{if(!n)throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");const i=await ye(t,e,n),s=(0,qt.u)(e)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!s)throw new Error(`getEndpointParameterInstructions() is not defined on '${e.commandName}'`);const r=await(0,Wt.x)(n,{getEndpointParameterInstructions:s},t);return Object.assign(i,r)});var ye;function ve(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(t,e)=>({signingProperties:{config:t,context:e}})}}function Ee(t){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(t,e)=>({signingProperties:{config:t,context:e}})}}function be(t){return{schemeId:"smithy.api#noAuth"}}const xe=((t,e,n)=>i=>{const s=t(i),r=s.properties?.authSchemes;if(!r)return e(i);const o=[];for(const t of r){const{name:e,properties:s={},...a}=t,c=e.toLowerCase();let u;if(e!==c&&console.warn(`HttpAuthScheme has been normalized with lowercasing: '${e}' to '${c}'`),"sigv4a"===c){u="aws.auth#sigv4a";const t=r.find(t=>{const e=t.name.toLowerCase();return"sigv4a"!==e&&e.startsWith("sigv4")});if("none"===Ut.sigv4aDependency()&&t)continue}else{if(!c.startsWith("sigv4"))throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${c}'`);u="aws.auth#sigv4"}const l=n[u];if(!l)throw new Error(`Could not find HttpAuthOption create function for '${u}'`);const h=l(i);h.schemeId=u,h.signingProperties={...h.signingProperties||{},...a,...s},o.push(h)}return o})(me,t=>{const e=[];if("AssumeRoleWithWebIdentity"===t.operation)e.push({schemeId:"smithy.api#noAuth"}),e.push(Ee(t));else e.push(ve(t)),e.push(Ee(t));return e},{"aws.auth#sigv4":ve,"aws.auth#sigv4a":Ee,"smithy.api#noAuth":be}),Se=t=>{const e=(t=>(t.sigv4aSigningRegionSet=(0,Pt.t)(t.sigv4aSigningRegionSet),t))((0,Nt.h)(t));return Object.assign(e,{authSchemePreference:(0,Vt.t)(t.authSchemePreference??[])})};var Ie=n(853),Ae=n(92),$e=n(93),Te=n(96),Ne=n(97),Pe=n(110),Re=n(33),Ce=n(111);class ke extends Pe.f2{async sign(t,e,n){if(!Re.K.isInstance(t))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:i,signer:s,signingRegion:r,signingRegionSet:o,signingName:a}=await(0,Pe.pz)(n),c=(await(i.sigv4aSigningRegionSet?.())??o??[r]).join(",");n._preRequestSystemClockOffset=i.systemClockOffset;return await s.sign(t,{signingDate:(0,Ce.C)(i.systemClockOffset),signingRegion:c,signingService:a})}}var De=n(858),_e=n(100),Oe=n(99),je=n(104),Me=n(101),Fe=n(102),Le=n(40),Ue=n(105),qe=n(107),Ve=n(108),We=n(109),ze=n(112),Ye=n(119),Ge=n(114),Ke=n(113),Xe=n(120);const He=":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",Je=new RegExp("^"+("["+He+"]["+(He+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*")+"$");function Be(t,e){const n=[];let i=e.exec(t);for(;i;){const s=[];s.startIndex=e.lastIndex-i[0].length;const r=i.length;for(let t=0;t<r;t++)s.push(i[t]);n.push(s),i=e.exec(t)}return n}const Qe=function(t){const e=Je.exec(t);return!(null==e)};const Ze=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],tn=["__proto__","constructor","prototype"],en=t=>Ze.includes(t)?"__"+t:t,nn={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(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:en};function sn(t,e){if("string"!=typeof t)return;const n=t.toLowerCase();if(Ze.some(t=>n===t.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);if(tn.some(t=>n===t.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`)}function rn(t,e){return"boolean"==typeof t?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:"object"==typeof t&&null!==t?{enabled:!1!==t.enabled,maxEntitySize:Math.max(1,t.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,t.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,t.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,t.maxExpandedLength??1e5),maxEntityCount:Math.max(1,t.maxEntityCount??1e3),allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null,appliesTo:t.appliesTo??"all"}:rn(!0)}const on=function(t){const e=Object.assign({},nn,t),n=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];for(const{value:t,name:e}of n)t&&sn(t,e);return null===e.onDangerousProperty&&(e.onDangerousProperty=en),e.processEntities=rn(e.processEntities,e.htmlEntities),e.unpairedTagsSet=new Set(e.unpairedTags),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(t=>"string"==typeof t&&t.startsWith("*.")?".."+t.substring(2):t)),e};let an;an="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class cn{constructor(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t,e){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),void 0!==e&&(this.child[this.child.length-1][an]={startIndex:e})}static getMetaDataSymbol(){return an}}class un{constructor(t){this.suppressValidationErr=!t,this.options=t}readDocType(t,e){const n=Object.create(null);let i=0;if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let s=1,r=!1,o=!1,a="";for(;e<t.length;e++)if("<"!==t[e]||o)if(">"===t[e]){if(o?"-"===t[e-1]&&"-"===t[e-2]&&(o=!1,s--):s--,0===s)break}else"["===t[e]?r=!0:a+=t[e];else{if(r&&hn(t,"!ENTITY",e)){let s,r;if(e+=7,[s,r,e]=this.readEntityExp(t,e+1,this.suppressValidationErr),-1===r.indexOf("&")){if(!1!==this.options.enabled&&null!=this.options.maxEntityCount&&i>=this.options.maxEntityCount)throw new Error(`Entity count (${i+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);n[s]=r,i++}}else if(r&&hn(t,"!ELEMENT",e)){e+=8;const{index:n}=this.readElementExp(t,e+1);e=n}else if(r&&hn(t,"!ATTLIST",e))e+=8;else if(r&&hn(t,"!NOTATION",e)){e+=9;const{index:n}=this.readNotationExp(t,e+1,this.suppressValidationErr);e=n}else{if(!hn(t,"!--",e))throw new Error("Invalid DOCTYPE");o=!0}s++,a=""}if(0!==s)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}readEntityExp(t,e){const n=e=ln(t,e);for(;e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)e++;let i=t.substring(n,e);if(fn(i),e=ln(t,e),!this.suppressValidationErr){if("SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported")}let s="";if([e,s]=this.readIdentifierVal(t,e,"entity"),!1!==this.options.enabled&&null!=this.options.maxEntitySize&&s.length>this.options.maxEntitySize)throw new Error(`Entity "${i}" size (${s.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[i,s,--e]}readNotationExp(t,e){const n=e=ln(t,e);for(;e<t.length&&!/\s/.test(t[e]);)e++;let i=t.substring(n,e);!this.suppressValidationErr&&fn(i),e=ln(t,e);const s=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&"SYSTEM"!==s&&"PUBLIC"!==s)throw new Error(`Expected SYSTEM or PUBLIC, found "${s}"`);e+=s.length,e=ln(t,e);let r=null,o=null;if("PUBLIC"===s)[e,r]=this.readIdentifierVal(t,e,"publicIdentifier"),'"'!==t[e=ln(t,e)]&&"'"!==t[e]||([e,o]=this.readIdentifierVal(t,e,"systemIdentifier"));else if("SYSTEM"===s&&([e,o]=this.readIdentifierVal(t,e,"systemIdentifier"),!this.suppressValidationErr&&!o))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:i,publicIdentifier:r,systemIdentifier:o,index:--e}}readIdentifierVal(t,e,n){let i="";const s=t[e];if('"'!==s&&"'"!==s)throw new Error(`Expected quoted string, found "${s}"`);const r=++e;for(;e<t.length&&t[e]!==s;)e++;if(i=t.substring(r,e),t[e]!==s)throw new Error(`Unterminated ${n} value`);return[++e,i]}readElementExp(t,e){const n=e=ln(t,e);for(;e<t.length&&!/\s/.test(t[e]);)e++;let i=t.substring(n,e);if(!this.suppressValidationErr&&!Qe(i))throw new Error(`Invalid element name: "${i}"`);let s="";if("E"===t[e=ln(t,e)]&&hn(t,"MPTY",e))e+=4;else if("A"===t[e]&&hn(t,"NY",e))e+=2;else if("("===t[e]){const n=++e;for(;e<t.length&&")"!==t[e];)e++;if(s=t.substring(n,e),")"!==t[e])throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[e]}"`);return{elementName:i,contentModel:s.trim(),index:e}}readAttlistExp(t,e){let n=e=ln(t,e);for(;e<t.length&&!/\s/.test(t[e]);)e++;let i=t.substring(n,e);for(fn(i),n=e=ln(t,e);e<t.length&&!/\s/.test(t[e]);)e++;let s=t.substring(n,e);if(!fn(s))throw new Error(`Invalid attribute name: "${s}"`);e=ln(t,e);let r="";if("NOTATION"===t.substring(e,e+8).toUpperCase()){if(r="NOTATION","("!==t[e=ln(t,e+=8)])throw new Error(`Expected '(', found "${t[e]}"`);e++;let n=[];for(;e<t.length&&")"!==t[e];){const i=e;for(;e<t.length&&"|"!==t[e]&&")"!==t[e];)e++;let s=t.substring(i,e);if(s=s.trim(),!fn(s))throw new Error(`Invalid notation name: "${s}"`);n.push(s),"|"===t[e]&&(e++,e=ln(t,e))}if(")"!==t[e])throw new Error("Unterminated list of notations");e++,r+=" ("+n.join("|")+")"}else{const n=e;for(;e<t.length&&!/\s/.test(t[e]);)e++;r+=t.substring(n,e);const i=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!i.includes(r.toUpperCase()))throw new Error(`Invalid attribute type: "${r}"`)}e=ln(t,e);let o="";return"#REQUIRED"===t.substring(e,e+8).toUpperCase()?(o="#REQUIRED",e+=8):"#IMPLIED"===t.substring(e,e+7).toUpperCase()?(o="#IMPLIED",e+=7):[e,o]=this.readIdentifierVal(t,e,"ATTLIST"),{elementName:i,attributeName:s,attributeType:r,defaultValue:o,index:e}}}const ln=(t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function hn(t,e,n){for(let i=0;i<e.length;i++)if(e[i]!==t[n+i+1])return!1;return!0}function fn(t){if(Qe(t))return t;throw new Error(`Invalid entity name ${t}`)}const dn=/^[-+]?0x[a-fA-F0-9]+$/,pn=/^0b[01]+$/,gn=/^0o[0-7]+$/,mn=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,wn={hex:!0,binary:!1,octal:!1,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"};function yn(t,e={}){if(e=Object.assign({},wn,e),!t||"string"!=typeof t)return t;let n=t.trim();if(0===n.length)return t;if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if("0"===n)return 0;if(e.hex&&dn.test(n))return En(n,16);if(e.binary&&pn.test(n))return En(n,2);if(e.octal&&gn.test(n))return En(n,8);if(isFinite(n)){if(n.includes("e")||n.includes("E"))return function(t,e,n){if(!n.eNotation)return t;const i=e.match(vn);if(i){let s=i[1]||"";const r=-1===i[3].indexOf("e")?"E":"e",o=i[2],a=s?t[o.length+1]===r:t[o.length]===r;return o.length>1&&a?t:(1!==o.length||!i[3].startsWith(`.${r}`)&&i[3][0]!==r)&&o.length>0?n.leadingZeros&&!a?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}return t}(t,n,e);{const i=mn.exec(n);if(i){const s=i[1]||"",r=i[2];let o=function(t){if(t&&-1!==t.indexOf("."))return"."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substring(0,t.length-1)),t;return t}(i[3]);const a=s?"."===t[r.length+1]:"."===t[r.length];if(!e.leadingZeros&&(r.length>1||1===r.length&&!a))return t;{const i=Number(n),a=String(i);if(0===i)return i;if(-1!==a.search(/[eE]/))return e.eNotation?i:t;if(-1!==n.indexOf("."))return"0"===a||a===o||a===`${s}${o}`?i:t;let c=r?o:n;return r?c===a||s+c===a?i:t:c===a||c===s+a?i:t}}return t}}return function(t,e,n){const i=e===1/0;switch(n.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return i?"Infinity":"-Infinity";default:return t}}(t,Number(n),e)}const vn=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function En(t,e){const n=t.trim();if(2!==e&&8!==e||(t=n.substring(2)),parseInt)return parseInt(t,e);if(Number.parseInt)return Number.parseInt(t,e);if(window&&window.parseInt)return window.parseInt(t,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}class bn{constructor(t){this._matcher=t}get separator(){return this._matcher.separator}getCurrentTag(){const t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}getCurrentNamespace(){const t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){const e=this._matcher.path;if(0!==e.length)return e[e.length-1].values?.[t]}hasAttr(t){const e=this._matcher.path;if(0===e.length)return!1;const n=e[e.length-1];return void 0!==n.values&&t in n.values}getPosition(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].position??0}getCounter(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t,e=!0){return this._matcher.toString(t,e)}toArray(){return this._matcher.path.map(t=>t.tag)}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}}class xn{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new bn(this)}push(t,e=null,n=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);const i=this.path.length;this.siblingStacks[i]||(this.siblingStacks[i]=new Map);const s=this.siblingStacks[i],r=n?`${n}:${t}`:t,o=s.get(r)||0;let a=0;for(const t of s.values())a+=t;s.set(r,o+1);const c={tag:t,position:a,counter:o};null!=n&&(c.namespace=n),null!=e&&(c.values=e),this.path.push(c)}pop(){if(0===this.path.length)return;this._pathStringCache=null;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0!==this.path.length)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const n=t||this.separator;if(n===this.separator&&!0===e){if(null!==this._pathStringCache)return this._pathStringCache;const t=this.path.map(t=>t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(n);return this._pathStringCache=t,t}return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(n)}toArray(){return this.path.map(t=>t.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e<t.length;e++)if(!this._matchSegment(t[e],this.path[e],e===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(t){let e=this.path.length-1,n=t.length-1;for(;n>=0&&e>=0;){const i=t[n];if("deep-wildcard"===i.type){if(n--,n<0)return!0;const i=t[n];let s=!1;for(let t=e;t>=0;t--)if(this._matchSegment(i,this.path[t],t===this.path.length-1)){e=t-1,n--,s=!0;break}if(!s)return!1}else{if(!this._matchSegment(i,this.path[e],e===this.path.length-1))return!1;e--,n--}}return n<0}_matchSegment(t,e,n){if("*"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&"*"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!n)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue&&String(e.values[t.attrName])!==String(t.attrValue))return!1}if(void 0!==t.position){if(!n)return!1;const i=e.counter??0;if("first"===t.position&&0!==i)return!1;if("odd"===t.position&&i%2!=1)return!1;if("even"===t.position&&i%2!=0)return!1;if("nth"===t.position&&i!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this._pathStringCache=null,this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}readOnly(){return this._view}}class Sn{constructor(t,e={},n){this.pattern=t,this.separator=e.separator||".",this.segments=this._parse(t),this.data=n,this._hasDeepWildcard=this.segments.some(t=>"deep-wildcard"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let n=0,i="";for(;n<t.length;)t[n]===this.separator?n+1<t.length&&t[n+1]===this.separator?(i.trim()&&(e.push(this._parseSegment(i.trim())),i=""),e.push({type:"deep-wildcard"}),n+=2):(i.trim()&&e.push(this._parseSegment(i.trim())),i="",n++):(i+=t[n],n++);return i.trim()&&e.push(this._parseSegment(i.trim())),e}_parseSegment(t){const e={type:"tag"};let n=null,i=t;const s=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(s&&(i=s[1]+s[3],s[2])){const t=s[2].slice(1,-1);t&&(n=t)}let r,o,a=i;if(i.includes("::")){const e=i.indexOf("::");if(r=i.substring(0,e).trim(),a=i.substring(e+2).trim(),!r)throw new Error(`Invalid namespace in pattern: ${t}`)}let c=null;if(a.includes(":")){const t=a.lastIndexOf(":"),e=a.substring(0,t).trim(),n=a.substring(t+1).trim();["first","last","odd","even"].includes(n)||/^nth\(\d+\)$/.test(n)?(o=e,c=n):o=a}else o=a;if(!o)throw new Error(`Invalid segment pattern: ${t}`);if(e.tag=o,r&&(e.namespace=r),n)if(n.includes("=")){const t=n.indexOf("=");e.attrName=n.substring(0,t).trim(),e.attrValue=n.substring(t+1).trim()}else e.attrName=n.trim();if(c){const t=c.match(/^nth\((\d+)\)$/);t?(e.position="nth",e.positionValue=parseInt(t[1],10)):e.position=c}return e}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class In{constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._patterns=new Set,this._sealed=!1}add(t){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(t.pattern))return this;if(this._patterns.add(t.pattern),t.hasDeepWildcard())return this._deepWildcards.push(t),this;const e=t.length,n=t.segments[t.segments.length-1],i=n?.tag;if(i&&"*"!==i){const n=`${e}:${i}`;this._byDepthAndTag.has(n)||this._byDepthAndTag.set(n,[]),this._byDepthAndTag.get(n).push(t)}else this._wildcardByDepth.has(e)||this._wildcardByDepth.set(e,[]),this._wildcardByDepth.get(e).push(t);return this}addAll(t){for(const e of t)this.add(e);return this}has(t){return this._patterns.has(t.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(t){return null!==this.findMatch(t)}findMatch(t){const e=t.getDepth(),n=`${e}:${t.getCurrentTag()}`,i=this._byDepthAndTag.get(n);if(i)for(let e=0;e<i.length;e++)if(t.matches(i[e]))return i[e];const s=this._wildcardByDepth.get(e);if(s)for(let e=0;e<s.length;e++)if(t.matches(s[e]))return s[e];for(let e=0;e<this._deepWildcards.length;e++)if(t.matches(this._deepWildcards[e]))return this._deepWildcards[e];return null}}const An={cent:"¢",pound:"£",curren:"¤",yen:"¥",euro:"€",dollar:"$",fnof:"ƒ",inr:"₹",af:"؋",birr:"ብር",peso:"₱",rub:"₽",won:"₩",yuan:"¥",cedil:"¸"},$n={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},Tn={nbsp:" ",copy:"©",reg:"®",trade:"™",mdash:"—",ndash:"–",hellip:"…",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",bull:"•",para:"¶",sect:"§",deg:"°",frac12:"½",frac14:"¼",frac34:"¾"},Nn=new Set("!?\\\\/[]$%{}^&*()<>|+");function Pn(t){if("#"===t[0])throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${t}"`);for(const e of t)if(Nn.has(e))throw new Error(`[EntityReplacer] Invalid character '${e}' in entity name: "${t}"`);return t}function Rn(...t){const e=Object.create(null);for(const n of t)if(n)for(const t of Object.keys(n)){const i=n[t];if("string"==typeof i)e[t]=i;else if(i&&"object"==typeof i&&void 0!==i.val){const n=i.val;"string"==typeof n&&(e[t]=n)}}return e}const Cn="external",kn="base",Dn="all";const _n=Object.freeze({allow:0,leave:1,remove:2,throw:3}),On=new Set([9,10,13]);class jn{constructor(t={}){var e;this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck="function"==typeof t.postCheck?t.postCheck:t=>t,this._limitTiers=(e=this._limit.applyLimitsTo??Cn)&&e!==Cn?e===Dn?new Set([Dn]):e===kn?new Set([kn]):Array.isArray(e)?new Set(e):new Set([Cn]):new Set([Cn]),this._numericAllowed=t.numericAllowed??!0,this._baseMap=Rn($n,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);const n=function(t){if(!t)return{xmlVersion:1,onLevel:_n.allow,nullLevel:_n.remove};const e=1.1===t.xmlVersion?1.1:1,n=_n[t.onNCR]??_n.allow,i=_n[t.nullNCR]??_n.remove;return{xmlVersion:e,onLevel:n,nullLevel:Math.max(i,_n.remove)}}(t.ncr);this._ncrXmlVersion=n.xmlVersion,this._ncrOnLevel=n.onLevel,this._ncrNullLevel=n.nullLevel}setExternalEntities(t){if(t)for(const e of Object.keys(t))Pn(e);this._externalMap=Rn(t)}addExternalEntity(t,e){Pn(t),"string"==typeof e&&-1===e.indexOf("&")&&(this._externalMap[t]=e)}addInputEntities(t){this._totalExpansions=0,this._expandedLength=0,this._inputMap=Rn(t)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(t){this._ncrXmlVersion=1.1===t?1.1:1}decode(t){if("string"!=typeof t||0===t.length)return t;if(-1===t.indexOf("&"))return t;const e=t,n=[],i=t.length;let s=0,r=0;const o=this._maxTotalExpansions>0,a=this._maxExpandedLength>0,c=o||a;for(;r<i;){if(38!==t.charCodeAt(r)){r++;continue}let e=r+1;for(;e<i&&59!==t.charCodeAt(e)&&e-r<=32;)e++;if(e>=i||59!==t.charCodeAt(e)){r++;continue}const u=t.slice(r+1,e);if(0===u.length){r++;continue}let l,h;if(this._removeSet.has(u))l="",void 0===h&&(h=Cn);else{if(this._leaveSet.has(u)){r++;continue}if(35===u.charCodeAt(0)){const t=this._resolveNCR(u);if(void 0===t){r++;continue}l=t,h=kn}else{const t=this._resolveName(u);l=t?.value,h=t?.tier}}if(void 0!==l){if(r>s&&n.push(t.slice(s,r)),n.push(l),s=e+1,r=s,c&&this._tierCounts(h)){if(o&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(a){const t=l.length-(u.length+2);if(t>0&&(this._expandedLength+=t,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}else r++}s<i&&n.push(t.slice(s));const u=0===n.length?t:n.join("");return this._postCheck(u,e)}_tierCounts(t){return!!this._limitTiers.has(Dn)||this._limitTiers.has(t)}_resolveName(t){return t in this._inputMap?{value:this._inputMap[t],tier:Cn}:t in this._externalMap?{value:this._externalMap[t],tier:Cn}:t in this._baseMap?{value:this._baseMap[t],tier:kn}:void 0}_classifyNCR(t){return 0===t?this._ncrNullLevel:t>=55296&&t<=57343||1===this._ncrXmlVersion&&t>=1&&t<=31&&!On.has(t)?_n.remove:-1}_applyNCRAction(t,e,n){switch(t){case _n.allow:return String.fromCodePoint(n);case _n.remove:return"";case _n.leave:return;case _n.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${e}; (U+${n.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(n)}}_resolveNCR(t){const e=t.charCodeAt(1);let n;if(n=120===e||88===e?parseInt(t.slice(2),16):parseInt(t.slice(1),10),Number.isNaN(n)||n<0||n>1114111)return;const i=this._classifyNCR(n);if(!this._numericAllowed&&i<_n.remove)return;const s=-1===i?this._ncrOnLevel:Math.max(this._ncrOnLevel,i);return this._applyNCRAction(s,t,n)}}function Mn(t,e){if(!t)return{};const n=e.attributesGroupName?t[e.attributesGroupName]:t;if(!n)return{};const i={};for(const t in n)if(t.startsWith(e.attributeNamePrefix)){i[t.substring(e.attributeNamePrefix.length)]=n[t]}else i[t]=n[t];return i}function Fn(t){if(!t||"string"!=typeof t)return;const e=t.indexOf(":");if(-1!==e&&e>0){const n=t.substring(0,e);if("xmlns"!==n)return n}}class Ln{constructor(t,e){var n;this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=zn,this.parseTextData=Un,this.resolveNameSpace=qn,this.buildAttributesMap=Wn,this.isItStopNode=Xn,this.replaceEntitiesValue=Gn,this.readStopNodeData=Qn,this.saveTextToParentTag=Kn,this.addChild=Yn,this.ignoreAttributesFn="function"==typeof(n=this.options.ignoreAttributes)?n:Array.isArray(n)?t=>{for(const e of n){if("string"==typeof e&&t===e)return!0;if(e instanceof RegExp&&e.test(t))return!0}}:()=>!1,this.entityExpansionCount=0,this.currentExpandedLength=0;let i={...$n};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:("object"==typeof this.options.htmlEntities?i=this.options.htmlEntities:!0===this.options.htmlEntities&&(i={...Tn,...An}),this.entityDecoder=new jn({namedEntities:{...i,...e},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo}})),this.matcher=new xn,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new In;const s=this.options.stopNodes;if(s&&s.length>0){for(let t=0;t<s.length;t++){const e=s[t];"string"==typeof e?this.stopNodeExpressionsSet.add(new Sn(e)):e instanceof Sn&&this.stopNodeExpressionsSet.add(e)}this.stopNodeExpressionsSet.seal()}}}function Un(t,e,n,i,s,r,o){const a=this.options;if(void 0!==t&&(a.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t,e,n));const i=a.jPath?n.toString():n,c=a.tagValueProcessor(e,t,i,s,r);if(null==c)return t;if(typeof c!=typeof t||c!==t)return c;if(a.trimValues)return Zn(t,a.parseTagValue,a.numberParseOptions);return t.trim()===t?Zn(t,a.parseTagValue,a.numberParseOptions):t}}function qn(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const Vn=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function Wn(t,e,n,i=!1){const s=this.options;if(!0===i||!0!==s.ignoreAttributes&&"string"==typeof t){const i=Be(t,Vn),r=i.length,o={},a=new Array(r);let c=!1;const u={};for(let t=0;t<r;t++){const e=this.resolveNameSpace(i[t][1]),r=i[t][4];if(e.length&&void 0!==r){let i=r;s.trimValues&&(i=i.trim()),i=this.replaceEntitiesValue(i,n,this.readonlyMatcher),a[t]=i,u[e]=i,c=!0}}c&&"object"==typeof e&&e.updateCurrent&&e.updateCurrent(u);const l=s.jPath?e.toString():this.readonlyMatcher;let h=!1;for(let t=0;t<r;t++){const e=this.resolveNameSpace(i[t][1]);if(this.ignoreAttributesFn(e,l))continue;let n=s.attributeNamePrefix+e;if(e.length)if(s.transformAttributeName&&(n=s.transformAttributeName(n)),n=ei(n,s),void 0!==i[t][4]){const i=a[t],r=s.attributeValueProcessor(e,i,l);o[n]=null==r?i:typeof r!=typeof i||r!==i?r:Zn(i,s.parseAttributeValue,s.numberParseOptions),h=!0}else s.allowBooleanAttributes&&(o[n]=!0,h=!0)}if(!h)return;if(s.attributesGroupName&&!s.preserveOrder){const t={};return t[s.attributesGroupName]=o,t}return o}}const zn=function(t){t=t.replace(/\r\n?/g,"\n");const e=new cn("!xml");let n=e,i="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;const s=this.options,r=new un(s.processEntities),o=t.length;for(let a=0;a<o;a++){if("<"===t[a]){const c=t.charCodeAt(a+1);if(47===c){const e=Hn(t,">",a,"Closing Tag is not closed.");let r=t.substring(a+2,e).trim();if(s.removeNSPrefix){const t=r.indexOf(":");-1!==t&&(r=r.substr(t+1))}r=ti(s.transformTagName,r,"",s).tagName,n&&(i=this.saveTextToParentTag(i,n,this.readonlyMatcher));const o=this.matcher.getCurrentTag();if(r&&s.unpairedTagsSet.has(r))throw new Error(`Unpaired tag can not be used as closing tag: </${r}>`);o&&s.unpairedTagsSet.has(o)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),i="",a=e}else if(63===c){let e=Bn(t,a,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");i=this.saveTextToParentTag(i,n,this.readonlyMatcher);const r=this.buildAttributesMap(e.tagExp,this.matcher,e.tagName,!0);if(r){const t=r[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(t)||1)}if(s.ignoreDeclaration&&"?xml"===e.tagName||s.ignorePiTags);else{const t=new cn(e.tagName);t.add(s.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&!0!==s.ignoreAttributes&&(t[":@"]=r),this.addChild(n,t,this.readonlyMatcher,a)}a=e.closeIndex+1}else if(33===c&&45===t.charCodeAt(a+2)&&45===t.charCodeAt(a+3)){const e=Hn(t,"--\x3e",a+4,"Comment is not closed.");if(s.commentPropName){const r=t.substring(a+4,e-2);i=this.saveTextToParentTag(i,n,this.readonlyMatcher),n.add(s.commentPropName,[{[s.textNodeName]:r}])}a=e}else if(33===c&&68===t.charCodeAt(a+2)){const e=r.readDocType(t,a);this.entityDecoder.addInputEntities(e.entities),a=e.i}else if(33===c&&91===t.charCodeAt(a+2)){const e=Hn(t,"]]>",a,"CDATA is not closed.")-2,r=t.substring(a+9,e);i=this.saveTextToParentTag(i,n,this.readonlyMatcher);let o=this.parseTextData(r,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);null==o&&(o=""),s.cdataPropName?n.add(s.cdataPropName,[{[s.textNodeName]:r}]):n.add(s.textNodeName,o),a=e+2}else{let r=Bn(t,a,s.removeNSPrefix);if(!r){const e=t.substring(Math.max(0,a-50),Math.min(o,a+50));throw new Error(`readTagExp returned undefined at position ${a}. Context: "${e}"`)}let c=r.tagName;const u=r.rawTagName;let l=r.tagExp,h=r.attrExpPresent,f=r.closeIndex;if(({tagName:c,tagExp:l}=ti(s.transformTagName,c,l,s)),s.strictReservedNames&&(c===s.commentPropName||c===s.cdataPropName||c===s.textNodeName||c===s.attributesGroupName))throw new Error(`Invalid tag name: ${c}`);n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,this.readonlyMatcher,!1));const d=n;d&&s.unpairedTagsSet.has(d.tagname)&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let p=!1;l.length>0&&l.lastIndexOf("/")===l.length-1&&(p=!0,"/"===c[c.length-1]?(c=c.substr(0,c.length-1),l=c):l=l.substr(0,l.length-1),h=c!==l);let g,m=null,w={};g=Fn(u),c!==e.tagname&&this.matcher.push(c,{},g),c!==l&&h&&(m=this.buildAttributesMap(l,this.matcher,c),m&&(w=Mn(m,s))),c!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());const y=a;if(this.isCurrentNodeStopNode){let e="";if(p)a=r.closeIndex;else if(s.unpairedTagsSet.has(c))a=r.closeIndex;else{const n=this.readStopNodeData(t,u,f+1);if(!n)throw new Error(`Unexpected end of ${u}`);a=n.i,e=n.tagContent}const i=new cn(c);m&&(i[":@"]=m),i.add(s.textNodeName,e),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,i,this.readonlyMatcher,y)}else{if(p){({tagName:c,tagExp:l}=ti(s.transformTagName,c,l,s));const t=new cn(c);m&&(t[":@"]=m),this.addChild(n,t,this.readonlyMatcher,y),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(s.unpairedTagsSet.has(c)){const t=new cn(c);m&&(t[":@"]=m),this.addChild(n,t,this.readonlyMatcher,y),this.matcher.pop(),this.isCurrentNodeStopNode=!1,a=r.closeIndex;continue}{const t=new cn(c);if(this.tagsNodeStack.length>s.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(n),m&&(t[":@"]=m),this.addChild(n,t,this.readonlyMatcher,y),n=t}}i="",a=f}}}else i+=t[a]}return e.child};function Yn(t,e,n,i){this.options.captureMetaData||(i=void 0);const s=this.options.jPath?n.toString():n,r=this.options.updateTag(e.tagname,s,e[":@"]);!1===r||("string"==typeof r?(e.tagname=r,t.addChild(e,i)):t.addChild(e,i))}function Gn(t,e,n){const i=this.options.processEntities;if(!i||!i.enabled)return t;if(i.allowedTags){const s=this.options.jPath?n.toString():n;if(!(Array.isArray(i.allowedTags)?i.allowedTags.includes(e):i.allowedTags(e,s)))return t}if(i.tagFilter){const s=this.options.jPath?n.toString():n;if(!i.tagFilter(e,s))return t}return this.entityDecoder.decode(t)}function Kn(t,e,n,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function Xn(){return 0!==this.stopNodeExpressionsSet.size&&this.matcher.matchesAny(this.stopNodeExpressionsSet)}function Hn(t,e,n,i){const s=t.indexOf(e,n);if(-1===s)throw new Error(i);return s+e.length-1}function Jn(t,e,n,i){const s=t.indexOf(e,n);if(-1===s)throw new Error(i);return s}function Bn(t,e,n,i=">"){const s=function(t,e,n=">"){let i=0;const s=t.length,r=n.charCodeAt(0),o=n.length>1?n.charCodeAt(1):-1;let a="",c=e;for(let n=e;n<s;n++){const e=t.charCodeAt(n);if(i)e===i&&(i=0);else if(34===e||39===e)i=e;else if(e===r){if(-1===o)return a+=t.substring(c,n),{data:a,index:n};if(t.charCodeAt(n+1)===o)return a+=t.substring(c,n),{data:a,index:n}}else 9!==e||i||(a+=t.substring(c,n)+" ",c=n+1)}}(t,e+1,i);if(!s)return;let r=s.data;const o=s.index,a=r.search(/\s/);let c=r,u=!0;-1!==a&&(c=r.substring(0,a),r=r.substring(a+1).trimStart());const l=c;if(n){const t=c.indexOf(":");-1!==t&&(c=c.substr(t+1),u=c!==s.data.substr(t+1))}return{tagName:c,tagExp:r,closeIndex:o,attrExpPresent:u,rawTagName:l}}function Qn(t,e,n){const i=n;let s=1;const r=t.length;for(;n<r;n++)if("<"===t[n]){const r=t.charCodeAt(n+1);if(47===r){const r=Jn(t,">",n,`${e} is not closed`);if(t.substring(n+2,r).trim()===e&&(s--,0===s))return{tagContent:t.substring(i,n),i:r};n=r}else if(63===r){n=Hn(t,"?>",n+1,"StopNode is not closed.")}else if(33===r&&45===t.charCodeAt(n+2)&&45===t.charCodeAt(n+3)){n=Hn(t,"--\x3e",n+3,"StopNode is not closed.")}else if(33===r&&91===t.charCodeAt(n+2)){n=Hn(t,"]]>",n,"StopNode is not closed.")-2}else{const i=Bn(t,n,!1);if(i){(i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&s++,n=i.closeIndex}}}}function Zn(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&yn(t,n)}return void 0!==t?t:""}function ti(t,e,n,i){if(t){const i=t(e);n===e&&(n=i),e=i}return{tagName:e=ei(e,i),tagExp:n}}function ei(t,e){if(tn.includes(t))throw new Error(`[SECURITY] Invalid name: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);return Ze.includes(t)?e.onDangerousProperty(t):t}const ni=cn.getMetaDataSymbol();function ii(t,e){if(!t||"object"!=typeof t)return{};if(!e)return t;const n={};for(const i in t)if(i.startsWith(e)){n[i.substring(e.length)]=t[i]}else n[i]=t[i];return n}function si(t,e,n,i){return ri(t,e,n,i)}function ri(t,e,n,i){let s;const r={};for(let o=0;o<t.length;o++){const a=t[o],c=oi(a);if(void 0!==c&&c!==e.textNodeName){const t=ii(a[":@"]||{},e.attributeNamePrefix);n.push(c,t)}if(c===e.textNodeName)void 0===s?s=a[c]:s+=""+a[c];else{if(void 0===c)continue;if(a[c]){let t=ri(a[c],e,n,i);const s=ci(t,e);if(0===Object.keys(t).length&&e.alwaysCreateTextNode&&(t[e.textNodeName]=""),a[":@"]?ai(t,a[":@"],i,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==a[ni]&&"object"==typeof t&&null!==t&&(t[ni]=a[ni]),void 0!==r[c]&&Object.prototype.hasOwnProperty.call(r,c))Array.isArray(r[c])||(r[c]=[r[c]]),r[c].push(t);else{const n=e.jPath?i.toString():i;e.isArray(c,n,s)?r[c]=[t]:r[c]=t}void 0!==c&&c!==e.textNodeName&&n.pop()}}}return"string"==typeof s?s.length>0&&(r[e.textNodeName]=s):void 0!==s&&(r[e.textNodeName]=s),r}function oi(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function ai(t,e,n,i){if(e){const s=Object.keys(e),r=s.length;for(let o=0;o<r;o++){const r=s[o],a=r.startsWith(i.attributeNamePrefix)?r.substring(i.attributeNamePrefix.length):r,c=i.jPath?n.toString()+"."+a:n;i.isArray(r,c,!0,!0)?t[r]=[e[r]]:t[r]=e[r]}}}function ci(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&"boolean"!=typeof t[n]&&0!==t[n])}const ui={allowBooleanAttributes:!1,unpairedTags:[]};function li(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function hi(t,e){const n=e;for(;e<t.length;e++)if("?"==t[e]||" "==t[e]){const i=t.substr(n,e-n);if(e>5&&"xml"===i)return wi("InvalidXml","XML declaration allowed only at the start of the document.",Ei(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}continue}return e}function fi(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}function di(t,e){let n="",i="",s=!1;for(;e<t.length;e++){if('"'===t[e]||"'"===t[e])""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){s=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:s}}const pi=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function gi(t,e){const n=Be(t,pi),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return wi("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",bi(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return wi("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",bi(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return wi("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",bi(n[t]));const s=n[t][2];if(!yi(s))return wi("InvalidAttr","Attribute '"+s+"' is an invalid name.",bi(n[t]));if(Object.prototype.hasOwnProperty.call(i,s))return wi("InvalidAttr","Attribute '"+s+"' is repeated.",bi(n[t]));i[s]=1}return!0}function mi(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function wi(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function yi(t){return Qe(t)}function vi(t){return Qe(t)}function Ei(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function bi(t){return t.startIndex+t[1].length}const xi={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},Si=new Set("!?\\/[]$%{}^&*()<>|+");function Ii(t){if("#"===t[0])throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${t}"`);for(const e of t)if(Si.has(e))throw new Error(`[EntityReplacer] Invalid character '${e}' in entity name: "${t}"`);return t}function Ai(...t){const e=Object.create(null);for(const n of t)if(n)for(const t of Object.keys(n)){const i=n[t];if("string"==typeof i)e[t]=i;else if(i&&"object"==typeof i&&void 0!==i.val){const n=i.val;"string"==typeof n&&(e[t]=n)}}return e}const $i="external",Ti="base",Ni="all";const Pi=Object.freeze({allow:0,leave:1,remove:2,throw:3}),Ri=new Set([9,10,13]);const Ci=new class{_limit;_maxTotalExpansions;_maxExpandedLength;_postCheck;_limitTiers;_numericAllowed;_baseMap;_externalMap;_inputMap;_totalExpansions;_expandedLength;_removeSet;_leaveSet;_ncrXmlVersion;_ncrOnLevel;_ncrNullLevel;constructor(t={}){var e;this._limit=t.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck="function"==typeof t.postCheck?t.postCheck:t=>t,this._limitTiers=(e=this._limit.applyLimitsTo??$i)&&e!==$i?e===Ni?new Set([Ni]):e===Ti?new Set([Ti]):Array.isArray(e)?new Set(e):new Set([$i]):new Set([$i]),this._numericAllowed=t.numericAllowed??!0,this._baseMap=Ai(xi,t.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(t.remove&&Array.isArray(t.remove)?t.remove:[]),this._leaveSet=new Set(t.leave&&Array.isArray(t.leave)?t.leave:[]);const n=function(t){if(!t)return{xmlVersion:1,onLevel:Pi.allow,nullLevel:Pi.remove};const e=1.1===t.xmlVersion?1.1:1,n=Pi[t.onNCR??"allow"]??Pi.allow,i=Pi[t.nullNCR??"remove"]??Pi.remove;return{xmlVersion:e,onLevel:n,nullLevel:Math.max(i,Pi.remove)}}(t.ncr);this._ncrXmlVersion=n.xmlVersion,this._ncrOnLevel=n.onLevel,this._ncrNullLevel=n.nullLevel}setExternalEntities(t){if(t)for(const e of Object.keys(t))Ii(e);this._externalMap=Ai(t)}addExternalEntity(t,e){Ii(t),"string"==typeof e&&-1===e.indexOf("&")&&(this._externalMap[t]=e)}addInputEntities(t){this._totalExpansions=0,this._expandedLength=0,this._inputMap=Ai(t)}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(t){this._ncrXmlVersion="1.1"===t||1.1===t?1.1:1}decode(t){if("string"!=typeof t||0===t.length)return t;const e=t,n=[],i=t.length;let s=0,r=0;const o=this._maxTotalExpansions>0,a=this._maxExpandedLength>0,c=o||a;for(;r<i;){if(38!==t.charCodeAt(r)){r++;continue}let e=r+1;for(;e<i&&59!==t.charCodeAt(e)&&e-r<=32;)e++;if(e>=i||59!==t.charCodeAt(e)){r++;continue}const u=t.slice(r+1,e);if(0===u.length){r++;continue}let l,h;if(this._removeSet.has(u))l="",void 0===h&&(h=$i);else{if(this._leaveSet.has(u)){r++;continue}if(35===u.charCodeAt(0)){const t=this._resolveNCR(u);if(void 0===t){r++;continue}l=t,h=Ti}else{const t=this._resolveName(u);l=t?.value,h=t?.tier}}if(void 0!==l){if(r>s&&n.push(t.slice(s,r)),n.push(l),s=e+1,r=s,c&&this._tierCounts(h)){if(o&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(a){const t=l.length-(u.length+2);if(t>0&&(this._expandedLength+=t,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}else r++}s<i&&n.push(t.slice(s));const u=0===n.length?t:n.join("");return this._postCheck(u,e)}_tierCounts(t){return!!this._limitTiers.has(Ni)||this._limitTiers.has(t)}_resolveName(t){return t in this._inputMap?{value:this._inputMap[t],tier:$i}:t in this._externalMap?{value:this._externalMap[t],tier:$i}:t in this._baseMap?{value:this._baseMap[t],tier:Ti}:void 0}_classifyNCR(t){return 0===t?this._ncrNullLevel:t>=55296&&t<=57343||1===this._ncrXmlVersion&&t>=1&&t<=31&&!Ri.has(t)?Pi.remove:-1}_applyNCRAction(t,e,n){switch(t){case Pi.allow:return String.fromCodePoint(n);case Pi.remove:return"";case Pi.leave:return;case Pi.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${e}; (U+${n.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(n)}}_resolveNCR(t){const e=t.charCodeAt(1);let n;if(n=120===e||88===e?parseInt(t.slice(2),16):parseInt(t.slice(1),10),Number.isNaN(n)||n<0||n>1114111)return;const i=this._classifyNCR(n);if(!this._numericAllowed&&i<Pi.remove)return;const s=-1===i?this._ncrOnLevel:Math.max(this._ncrOnLevel,i);return this._applyNCRAction(s,t,n)}}({namedEntities:{...xi,nbsp:" ",copy:"©",reg:"®",trade:"™",mdash:"—",ndash:"–",hellip:"…",laquo:"«",raquo:"»",lsquo:"‘",rsquo:"’",ldquo:"“",rdquo:"”",bull:"•",para:"¶",sect:"§",deg:"°",frac12:"½",frac14:"¼",frac34:"¾",cent:"¢",pound:"£",curren:"¤",yen:"¥",euro:"€",dollar:"$",fnof:"ƒ",inr:"₹",af:"؋",birr:"ብር",peso:"₱",rub:"₽",won:"₩",yuan:"¥",cedil:"¸"},numericAllowed:!0,limit:{maxTotalExpansions:1/0},ncr:{xmlVersion:1.1}}),ki=new class{constructor(t){this.externalEntities={},this.options=on(t)}parse(t,e){if("string"!=typeof t&&t.toString)t=t.toString();else if("string"!=typeof t)throw new Error("XML data is accepted in String or Bytes[] form.");if(e){!0===e&&(e={});const n=function(t,e){e=Object.assign({},ui,e);const n=[];let i=!1,s=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let r=0;r<t.length;r++)if("<"===t[r]&&"?"===t[r+1]){if(r+=2,r=hi(t,r),r.err)return r}else{if("<"!==t[r]){if(li(t[r]))continue;return wi("InvalidChar","char '"+t[r]+"' is not expected.",Ei(t,r))}{let o=r;if(r++,"!"===t[r]){r=fi(t,r);continue}{let a=!1;"/"===t[r]&&(a=!0,r++);let c="";for(;r<t.length&&">"!==t[r]&&" "!==t[r]&&"\t"!==t[r]&&"\n"!==t[r]&&"\r"!==t[r];r++)c+=t[r];if(c=c.trim(),"/"===c[c.length-1]&&(c=c.substring(0,c.length-1),r--),!vi(c)){let e;return e=0===c.trim().length?"Invalid space after '<'.":"Tag '"+c+"' is an invalid name.",wi("InvalidTag",e,Ei(t,r))}const u=di(t,r);if(!1===u)return wi("InvalidAttr","Attributes for '"+c+"' have open quote.",Ei(t,r));let l=u.value;if(r=u.index,"/"===l[l.length-1]){const n=r-l.length;l=l.substring(0,l.length-1);const s=gi(l,e);if(!0!==s)return wi(s.err.code,s.err.msg,Ei(t,n+s.err.line));i=!0}else if(a){if(!u.tagClosed)return wi("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",Ei(t,r));if(l.trim().length>0)return wi("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",Ei(t,o));if(0===n.length)return wi("InvalidTag","Closing tag '"+c+"' has not been opened.",Ei(t,o));{const e=n.pop();if(c!==e.tagName){let n=Ei(t,e.tagStartPos);return wi("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+c+"'.",Ei(t,o))}0==n.length&&(s=!0)}}else{const a=gi(l,e);if(!0!==a)return wi(a.err.code,a.err.msg,Ei(t,r-l.length+a.err.line));if(!0===s)return wi("InvalidXml","Multiple possible root nodes found.",Ei(t,r));-1!==e.unpairedTags.indexOf(c)||n.push({tagName:c,tagStartPos:o}),i=!0}for(r++;r<t.length;r++)if("<"===t[r]){if("!"===t[r+1]){r++,r=fi(t,r);continue}if("?"!==t[r+1])break;if(r=hi(t,++r),r.err)return r}else if("&"===t[r]){const e=mi(t,r);if(-1==e)return wi("InvalidChar","char '&' is not expected.",Ei(t,r));r=e}else if(!0===s&&!li(t[r]))return wi("InvalidXml","Extra text at the end",Ei(t,r));"<"===t[r]&&r--}}}return i?1==n.length?wi("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",Ei(t,n[0].tagStartPos)):!(n.length>0)||wi("InvalidXml","Invalid '"+JSON.stringify(n.map(t=>t.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):wi("InvalidXml","Start tag expected.",1)}(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new Ln(this.options,this.externalEntities),i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:si(i,this.options,n.matcher,n.readonlyMatcher)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}static getMetaDataSymbol(){return cn.getMetaDataSymbol()}}({attributeNamePrefix:"",processEntities:{enabled:!0,maxTotalExpansions:1/0},htmlEntities:!0,entityDecoder:{setExternalEntities:t=>{Ci.setExternalEntities(t)},addInputEntities:t=>{Ci.addInputEntities(t)},reset:()=>{Ci.reset()},decode:t=>Ci.decode(t),setXmlVersion:t=>{}},ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(t,e)=>""===e.trim()&&e.includes("\n")?"":void 0,maxNestedTags:1/0});const Di=t=>{const e="#text";for(const n in t)t.hasOwnProperty(n)&&void 0!==t[n][e]?t[n]=t[n][e]:"object"==typeof t[n]&&null!==t[n]&&(t[n]=Di(t[n]));return t};var _i=n(857),Oi=n(79),ji=n(123),Mi=n(127);class Fi extends ji.B{settings;stringDeserializer;constructor(t){super(),this.settings=t,this.stringDeserializer=new _i.k(t)}setSerdeContext(t){this.serdeContext=t,this.stringDeserializer.setSerdeContext(t)}read(t,e,n){const i=Ke.l1.of(t),s=i.getMemberSchemas();if(i.isStructSchema()&&i.isMemberSchema()&&!!Object.values(s).find(t=>!!t.getMemberTraits().eventPayload)){const t={},n=Object.keys(s)[0];return s[n].isBlobSchema()?t[n]=e:t[n]=this.read(s[n],e),t}const r=(this.serdeContext?.utf8Encoder??Oi.P)(e),o=this.parseXml(r);return this.readSchema(t,n?o[n]:o)}readSchema(t,e){const n=Ke.l1.of(t);if(n.isUnitSchema())return;const i=n.getMergedTraits();if(n.isListSchema()&&!Array.isArray(e))return this.readSchema(n,[e]);if(null==e)return e;if("object"==typeof e){const t=!!i.xmlFlattened;if(n.isListSchema()){const i=n.getValueSchema(),s=[],r=i.getMergedTraits().xmlName??"member",o=t?e:(e[0]??e)[r];if(null==o)return s;const a=Array.isArray(o)?o:[o];for(const t of a)s.push(this.readSchema(i,t));return s}const s={};if(n.isMapSchema()){const i=n.getKeySchema(),r=n.getValueSchema();let o;o=t?Array.isArray(e)?e:[e]:Array.isArray(e.entry)?e.entry:[e.entry];const a=i.getMergedTraits().xmlName??"key",c=r.getMergedTraits().xmlName??"value";for(const t of o){const e=t[a],n=t[c];s[e]=this.readSchema(r,n)}return s}if(n.isStructSchema()){const t=n.isUnionSchema();let i;t&&(i=new Mi.F(e,s));for(const[r,o]of n.structIterator()){const n=o.getMergedTraits(),a=n.httpPayload?n.xmlName??o.getName():o.getMemberTraits().xmlName??r;t&&i.mark(a),null!=e[a]&&(s[r]=this.readSchema(o,e[a]))}return t&&i.writeUnknown(),s}if(n.isDocumentSchema())return e;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${n.getName(!0)}`)}return n.isListSchema()?[]:n.isMapSchema()||n.isStructSchema()?{}:this.stringDeserializer.read(n,e)}parseXml(t){if(t.length){let n;try{e=t,n=ki.parse(e,!0)}catch(e){throw e&&"object"==typeof e&&Object.defineProperty(e,"$responseBodyText",{value:t}),e}const i="#text",s=Object.keys(n)[0],r=n[s];return r[i]&&(r[s]=r[i],delete r[i]),Di(r)}var e;return{}}}var Li=n(124),Ui=n(856),qi=n(83),Vi=n(77),Wi=n(73),zi=n(126);class Yi extends ji.B{settings;buffer;constructor(t){super(),this.settings=t}write(t,e,n=""){void 0===this.buffer&&(this.buffer="");const i=Ke.l1.of(t);if(n&&!n.endsWith(".")&&(n+="."),i.isBlobSchema())("string"==typeof e||e instanceof Uint8Array)&&(this.writeKey(n),this.writeValue((this.serdeContext?.base64Encoder??Vi.n)(e)));else if(i.isBooleanSchema()||i.isNumericSchema()||i.isStringSchema())null!=e?(this.writeKey(n),this.writeValue(String(e))):i.isIdempotencyToken()&&(this.writeKey(n),this.writeValue((0,Wi.ec)()));else if(i.isBigIntegerSchema())null!=e&&(this.writeKey(n),this.writeValue(String(e)));else if(i.isBigDecimalSchema())null!=e&&(this.writeKey(n),this.writeValue(e instanceof zi.D?e.string:String(e)));else if(i.isTimestampSchema()){if(e instanceof Date){this.writeKey(n);switch((0,Li.V)(i,this.settings)){case 5:this.writeValue(e.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue((0,qi.JV)(e));break;case 7:this.writeValue(String(e.getTime()/1e3))}}}else if(i.isDocumentSchema())Array.isArray(e)?this.write(79,e,n):e instanceof Date?this.write(4,e,n):e instanceof Uint8Array?this.write(21,e,n):e&&"object"==typeof e?this.write(143,e,n):(this.writeKey(n),this.writeValue(String(e)));else if(i.isListSchema()){if(Array.isArray(e))if(0===e.length)this.settings.serializeEmptyLists&&(this.writeKey(n),this.writeValue(""));else{const t=i.getValueSchema(),s=this.settings.flattenLists||i.getMergedTraits().xmlFlattened;let r=1;for(const i of e){if(null==i)continue;const e=t.getMergedTraits(),o=this.getKey("member",e.xmlName,e.ec2QueryName),a=s?`${n}${r}`:`${n}${o}.${r}`;this.write(t,i,a),++r}}}else if(i.isMapSchema()){if(e&&"object"==typeof e){const t=i.getKeySchema(),s=i.getValueSchema(),r=i.getMergedTraits().xmlFlattened;let o=1;for(const i in e){const a=e[i];if(null==a)continue;const c=t.getMergedTraits(),u=this.getKey("key",c.xmlName,c.ec2QueryName),l=r?`${n}${o}.${u}`:`${n}entry.${o}.${u}`,h=s.getMergedTraits(),f=this.getKey("value",h.xmlName,h.ec2QueryName),d=r?`${n}${o}.${f}`:`${n}entry.${o}.${f}`;this.write(t,i,l),this.write(s,a,d),++o}}}else if(i.isStructSchema()){if(e&&"object"==typeof e){let t=!1;for(const[s,r]of i.structIterator()){if(null==e[s]&&!r.isIdempotencyToken())continue;const i=r.getMergedTraits(),o=`${n}${this.getKey(s,i.xmlName,i.ec2QueryName,"struct")}`;this.write(r,e[s],o),t=!0}if(!t&&i.isUnionSchema()){const{$unknown:t}=e;if(Array.isArray(t)){const[e,i]=t,s=`${n}${e}`;this.write(15,i,s)}}}}else if(!i.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${i.getName(!0)}`)}flush(){if(void 0===this.buffer)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");const t=this.buffer;return delete this.buffer,t}getKey(t,e,n,i){const{ec2:s,capitalizeKeys:r}=this.settings;if(s&&n)return n;const o=e??t;return r&&"struct"===i?o[0].toUpperCase()+o.slice(1):o}writeKey(t){t.endsWith(".")&&(t=t.slice(0,t.length-1)),this.buffer+=`&${(0,Ui.$)(t)}=`}writeValue(t){this.buffer+=(0,Ui.$)(t)}}class Gi extends ze.M{options;serializer;deserializer;mixin=new Xe.U;constructor(t){super({defaultNamespace:t.defaultNamespace,errorTypeRegistries:t.errorTypeRegistries}),this.options=t;const e={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace,serializeEmptyLists:!0};this.serializer=new Yi(e),this.deserializer=new Fi(e)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(t){this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t)}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(t,e,n){const i=await super.serializeRequest(t,e,n);i.path.endsWith("/")||(i.path+="/"),i.headers["content-type"]="application/x-www-form-urlencoded","unit"!==(0,Ge.L)(t.input)&&i.body||(i.body="");const s=t.name.split("#")[1]??t.name;return i.body=`Action=${s}&Version=${this.options.version}`+i.body,i.body.endsWith("&")&&(i.body=i.body.slice(-1)),i}async deserializeResponse(t,e,n){const i=this.deserializer,s=Ke.l1.of(t.output),r={};if(n.statusCode>=300){const s=await(0,Ye.P)(n.body,e);s.byteLength>0&&Object.assign(r,await i.read(15,s)),await this.handleError(t,e,n,r,this.deserializeMetadata(n))}for(const t in n.headers){const e=n.headers[t];delete n.headers[t],n.headers[t.toLowerCase()]=e}const o=t.name.split("#")[1]??t.name,a=s.isStructSchema()&&this.useNestedResult()?o+"Result":void 0,c=await(0,Ye.P)(n.body,e);return c.byteLength>0&&Object.assign(r,await i.read(s,c,a)),r.$metadata=this.deserializeMetadata(n),r}useNestedResult(){return!0}async handleError(t,e,n,i,s){const r=this.loadQueryErrorCode(n,i)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,r,this.options.defaultNamespace);const o=this.loadQueryError(i)??{},a=this.loadQueryErrorMessage(i);o.message=a,o.Error={Type:o.Type,Code:o.Code,Message:a};const{errorSchema:c,errorMetadata:u}=await this.mixin.getErrorSchemaOrThrowBaseException(r,this.options.defaultNamespace,n,o,s,this.mixin.findQueryCompatibleError),l=Ke.l1.of(c),h=new(this.compositeErrorRegistry.getErrorCtor(c)??Error)({}),f={Type:o.Error.Type,Code:o.Error.Code,Error:o.Error};for(const[t,e]of l.structIterator()){const n=e.getMergedTraits().xmlName??t,s=o[n]??i[n];f[t]=this.deserializer.readSchema(e,s)}throw this.mixin.decorateServiceException(Object.assign(h,u,{$fault:l.getMergedTraits().error,message:a},f),i)}loadQueryErrorCode(t,e){const n=(e.Errors?.[0]?.Error??e.Errors?.Error??e.Error)?.Code;return void 0!==n?n:404==t.statusCode?"NotFound":void 0}loadQueryError(t){return t.Errors?.[0]?.Error??t.Errors?.Error??t.Error}loadQueryErrorMessage(t){const e=this.loadQueryError(t);return e?.message??e?.Message??t.message??t.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}}var Ki=n(72),Xi=n(68),Hi=n(74),Ji=n(78);const Bi=t=>{(0,_e.I)(process.version);const e=(0,je.I)(t),n=()=>e().then(Oe.l),r=(t=>({apiVersion:"2011-06-15",base64Decoder:t?.base64Decoder??Hi.E,base64Encoder:t?.base64Encoder??Vi.n,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??me,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??xe,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new Pe.f2},{schemeId:"aws.auth#sigv4a",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4a"),signer:new ke},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new De.m}],logger:t?.logger??new Ki.N,protocol:t?.protocol??Gi,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.sts",errorTypeRegistries:G,xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/",version:"2011-06-15",serviceTarget:"AWSSecurityTokenServiceV20110615"},serviceId:t?.serviceId??"STS",signerConstructor:t?.signerConstructor??Ut,urlParser:t?.urlParser??Xi.D,utf8Decoder:t?.utf8Decoder??Ji.a,utf8Encoder:t?.utf8Encoder??Oi.P}))(t);(0,Ae.I)(process.version);const o={profile:t?.profile,logger:r.logger};return{...r,...t,runtime:"node",defaultsMode:e,authSchemePreference:t?.authSchemePreference??(0,i.Z)(Ne.$,o),bodyLengthChecker:t?.bodyLengthChecker??Ue.n,defaultUserAgentProvider:t?.defaultUserAgentProvider??(0,$e.pf)({serviceId:r.serviceId,clientVersion:Ie.rE}),httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4")||(async e=>await t.credentialDefaultProvider(e?.o||{})()),signer:new Pe.f2},{schemeId:"aws.auth#sigv4a",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4a"),signer:new ke},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new De.m}],maxAttempts:t?.maxAttempts??(0,i.Z)(At.qs,t),region:t?.region??(0,i.Z)(s.GG,{...s.zH,...o}),requestHandler:Ve.$.create(t?.requestHandler??n),retryMode:t?.retryMode??(0,i.Z)({...At.kN,default:async()=>(await n()).retryMode||Le.L0},t),sha256:t?.sha256??qe.V.bind(null,"sha256"),sigv4aSigningRegionSet:t?.sigv4aSigningRegionSet??(0,i.Z)(Ct,o),streamCollector:t?.streamCollector??We.k,useDualstackEndpoint:t?.useDualstackEndpoint??(0,i.Z)(Me.e$,o),useFipsEndpoint:t?.useFipsEndpoint??(0,i.Z)(Fe.Ko,o),userAgentAppId:t?.userAgentAppId??(0,i.Z)(Te.hV,o)}};var Qi=n(135),Zi=n(136),ts=n(137);class es extends xt.K{config;constructor(...[t]){const e=Bi(t||{});super(e),this.initConfig=e;const n=(i=e,Object.assign(i,{useDualstackEndpoint:i.useDualstackEndpoint??!1,useFipsEndpoint:i.useFipsEndpoint??!1,useGlobalEndpoint:i.useGlobalEndpoint??!1,defaultSigningName:"sts"}));var i;const s=(0,pt.D)(n),r=(0,At.$z)(s),o=(0,St.T)(r),a=(0,gt.OV)(o),u=(0,c.Co)(a),l=((t,e)=>{const n=Object.assign((0,Qi.R)(t),(0,Zi.xA)(t),(0,ts.e)(t),(t=>{const e=t.httpAuthSchemes;let n=t.httpAuthSchemeProvider,i=t.credentials;return{setHttpAuthScheme(t){const n=e.findIndex(e=>e.schemeId===t.schemeId);-1===n?e.push(t):e.splice(n,1,t)},httpAuthSchemes:()=>e,setHttpAuthSchemeProvider(t){n=t},httpAuthSchemeProvider:()=>n,setCredentials(t){i=t},credentials:()=>i}})(t));return e.forEach(t=>t.configure(n)),Object.assign(t,(0,Qi.$)(n),(0,Zi.uv)(n),(0,ts.j)(n),{httpAuthSchemes:(i=n).httpAuthSchemes(),httpAuthSchemeProvider:i.httpAuthSchemeProvider(),credentials:i.credentials()});var i})(Se(u),t?.extensions||[]);this.config=l,this.middlewareStack.use((0,Tt.wq)(this.config)),this.middlewareStack.use((0,mt.sM)(this.config)),this.middlewareStack.use((0,$t.ey)(this.config)),this.middlewareStack.use((0,It.vK)(this.config)),this.middlewareStack.use((0,gt.TC)(this.config)),this.middlewareStack.use((0,wt.Y7)(this.config)),this.middlewareStack.use((0,yt.n)(this.config)),this.middlewareStack.use((0,vt.w)(this.config,{httpAuthSchemeParametersProvider:we,identityProviderConfigProvider:async t=>new Et.h({"aws.auth#sigv4":t.credentials,"aws.auth#sigv4a":t.credentials})})),this.middlewareStack.use((0,bt.l)(this.config))}destroy(){super.destroy()}}const ns=(t,e)=>e?class extends t{constructor(t){super(t);for(const t of e)this.middlewareStack.use(t)}}:t,is=(t={},e)=>((t,e)=>{let n,i;return async(s,r)=>{if(i=s,!n){const{logger:s=t?.parentClientConfig?.logger,profile:r=t?.parentClientConfig?.profile,region:o,requestHandler:a=t?.parentClientConfig?.requestHandler,credentialProviderLogger:c,userAgentAppId:u=t?.parentClientConfig?.userAgentAppId}=t,l=await ft(o,t?.parentClientConfig?.region,c,{logger:s,profile:r}),h=!dt(a);n=new e({...t,userAgentAppId:u,profile:r,credentialDefaultProvider:()=>async()=>i,region:l,requestHandler:h?a:void 0,logger:s})}const{Credentials:a,AssumedRoleUser:c}=await n.send(new ut(r));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${r.RoleArn}`);const u=ht(c),l={accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration,...a.CredentialScope&&{credentialScope:a.CredentialScope},...u&&{accountId:u}};return(0,o.g)(l,"CREDENTIALS_STS_ASSUME_ROLE","i"),l}})(t,ns(es,e)),ss=(t={},e)=>((t,e)=>{let n;return async i=>{if(!n){const{logger:i=t?.parentClientConfig?.logger,profile:s=t?.parentClientConfig?.profile,region:r,requestHandler:o=t?.parentClientConfig?.requestHandler,credentialProviderLogger:a,userAgentAppId:c=t?.parentClientConfig?.userAgentAppId}=t,u=await ft(r,t?.parentClientConfig?.region,a,{logger:i,profile:s}),l=!dt(o);n=new e({...t,userAgentAppId:c,profile:s,region:u,requestHandler:l?o:void 0,logger:i})}const{Credentials:s,AssumedRoleUser:r}=await n.send(new lt(i));if(!s||!s.AccessKeyId||!s.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${i.RoleArn}`);const a=ht(r),c={accessKeyId:s.AccessKeyId,secretAccessKey:s.SecretAccessKey,sessionToken:s.SessionToken,expiration:s.Expiration,...s.CredentialScope&&{credentialScope:s.CredentialScope},...a&&{accountId:a}};return a&&(0,o.g)(c,"RESOLVED_ACCOUNT_ID","T"),(0,o.g)(c,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),c}})(t,ns(es,e))},858(t,e,n){n.d(e,{m:()=>i});class i{async sign(t,e,n){return t}}},856(t,e,n){function i(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}n.d(e,{$:()=>i})},857(t,e,n){n.d(e,{k:()=>x});var i=n(113),s=n(855),r=n(74);const o="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",a="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",c="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",u="(\\d?\\d)",l="(\\d{4})",h=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),f=new RegExp(`^${o}, ${u} ${a} ${l} ${c} GMT$`),d=new RegExp(`^${o}, ${u}-${a}-(\\d\\d) ${c} GMT$`),p=new RegExp(`^${o} ${a} ( [1-9]|\\d\\d) ${c} ${l}$`),g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function m(t,e,n){const i=Number(t);if(i<e||i>n)throw new Error(`Value ${i} out of range [${e}, ${n}]`)}var w=n(125),y=n(126),v=n(79),E=n(118),b=n(124);class x extends E.f{settings;constructor(t){super(),this.settings=t}read(t,e){const n=i.l1.of(t);if(n.isListSchema())return(0,s.G)(e).map(t=>this.read(n.getValueSchema(),t));if(n.isBlobSchema())return(this.serdeContext?.base64Decoder??r.E)(e);if(n.isTimestampSchema()){switch((0,b.V)(n,this.settings)){case 5:return(t=>{if(null==t)return;if("string"!=typeof t)throw new TypeError("RFC3339 timestamps must be strings");const e=h.exec(t);if(!e)throw new TypeError(`Invalid RFC3339 timestamp format ${t}`);const[,n,i,s,r,o,a,,c,u]=e;m(i,1,12),m(s,1,31),m(r,0,23),m(o,0,59),m(a,0,60);const l=new Date(Date.UTC(Number(n),Number(i)-1,Number(s),Number(r),Number(o),Number(a),Number(c)?Math.round(1e3*parseFloat(`0.${c}`)):0));if(l.setUTCFullYear(Number(n)),"Z"!=u.toUpperCase()){const[,t,e,n]=/([+-])(\d\d):(\d\d)/.exec(u)||[void 0,"+",0,0],i="-"===t?1:-1;l.setTime(l.getTime()+i*(60*Number(e)*60*1e3+60*Number(n)*1e3))}return l})(e);case 6:return(t=>{if(null==t)return;if("string"!=typeof t)throw new TypeError("RFC7231 timestamps must be strings.");let e,n,i,s,r,o,a,c;if((c=f.exec(t))?[,e,n,i,s,r,o,a]=c:(c=d.exec(t))?([,e,n,i,s,r,o,a]=c,i=(Number(i)+1900).toString()):(c=p.exec(t))&&([,n,e,s,r,o,a,i]=c),i&&o){const t=Date.UTC(Number(i),g.indexOf(n),Number(e),Number(s),Number(r),Number(o),a?Math.round(1e3*parseFloat(`0.${a}`)):0);m(e,1,31),m(s,0,23),m(r,0,59),m(o,0,60);const c=new Date(t);return c.setUTCFullYear(Number(i)),c}throw new TypeError(`Invalid RFC7231 date-time value ${t}.`)})(e);case 7:return(t=>{if(null==t)return;let e=NaN;if("number"==typeof t)e=t;else if("string"==typeof t){if(!/^-?\d*\.?\d+$/.test(t))throw new TypeError("parseEpochTimestamp - numeric string invalid.");e=Number.parseFloat(t)}else"object"==typeof t&&1===t.tag&&(e=t.value);if(isNaN(e)||Math.abs(e)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(1e3*e))})(e);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",e),new Date(e)}}if(n.isStringSchema()){const t=n.getMergedTraits().mediaType;let i=e;if(t){n.getMergedTraits().httpHeader&&(i=this.base64ToUtf8(i));return("application/json"===t||t.endsWith("+json"))&&(i=w.A.from(i)),i}}return n.isNumericSchema()?Number(e):n.isBigIntegerSchema()?BigInt(e):n.isBigDecimalSchema()?new y.D(e,"bigDecimal"):n.isBooleanSchema()?"true"===String(e).toLowerCase():e}base64ToUtf8(t){return(this.serdeContext?.utf8Encoder??v.P)((this.serdeContext?.base64Decoder??r.E)(t))}}},855(t,e,n){n.d(e,{G:()=>i});const i=t=>{const e=t.length,n=[];let i,s=!1,r=0;for(let o=0;o<e;++o){const e=t[o];switch(e){case'"':"\\"!==i&&(s=!s);break;case",":s||(n.push(t.slice(r,o)),r=o+1)}i=e}return n.push(t.slice(r)),n.map(t=>{const e=(t=t.trim()).length;return e<2?t:('"'===t[0]&&'"'===t[e-1]&&(t=t.slice(1,e-1)),t.replace(/\\"/g,'"'))})}},853(t){t.exports={rE:"3.997.17"}}};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ "use strict";exports.id=485,exports.ids=[485],exports.modules={859(e,t,n){n.d(t,{CreateTokenCommand:()=>xt,SSOOIDCClient:()=>mt});var r=n(36),s=n(32),i=n(38),o=n(34),a=n(35),c=n(43),p=n(42),u=n(46),d=n(47),l=n(49),h=n(51),m=n(70),v=n(84),x=n(71),S=n(85),f=n(86),g=n(44),E=n(69);const I=async(e,t,n)=>({operation:(0,g.u)(t).operation,region:await(0,E.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});const P=e=>{const t=[];if("CreateToken"===e.operation)t.push({schemeId:"smithy.api#noAuth"});else t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e));return t},b={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var k=n(853),C=n(92),O=n(93),w=n(96),A=n(97),D=n(100),y=n(99),T=n(104),$=n(52),R=n(103),j=n(101),U=n(102),_=n(40),z=n(105),F=n(107),q=n(108),G=n(109),H=n(110),V=n(854),M=n(858),N=n(72),W=n(68),L=n(74),B=n(77),J=n(78),K=n(79),Q=n(129),X=n(132),Y=n(133),Z=n(130),ee=n(134);const te="ref",ne=-1,re=!0,se="isSet",ie="PartitionResult",oe="booleanEquals",ae="getAttr",ce={[te]:"Endpoint"},pe={[te]:ie},ue={},de=[{[te]:"Region"}],le={conditions:[[se,[ce]],[se,de],["aws.partition",de,ie],[oe,[{[te]:"UseFIPS"},re]],[oe,[{[te]:"UseDualStack"},re]],[oe,[{fn:ae,argv:[pe,"supportsDualStack"]},re]],[oe,[{fn:ae,argv:[pe,"supportsFIPS"]},re]],["stringEquals",[{fn:ae,argv:[pe,"name"]},"aws-us-gov"]]],results:[[ne],[ne,"Invalid Configuration: FIPS and custom endpoint are not supported"],[ne,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[ce,ue],["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",ue],[ne,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://oidc.{Region}.amazonaws.com",ue],["https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",ue],[ne,"FIPS is enabled but this partition does not support FIPS"],["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",ue],[ne,"DualStack is enabled but this partition does not support DualStack"],["https://oidc.{Region}.{PartitionResult#dnsSuffix}",ue],[ne,"Invalid Configuration: Missing Region"]]},he=1e8,me=new Int32Array([-1,1,-1,0,13,3,1,4,he+12,2,5,he+12,3,8,6,4,7,he+11,5,he+9,he+10,4,11,9,6,10,he+8,7,he+6,he+7,5,12,he+5,6,he+4,he+5,3,he+1,14,4,he+2,he+3]),ve=ee.d.from(me,2,le.conditions,le.results),xe=new X.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Se=(e,t={})=>xe.get(e,()=>(0,Y.c)(ve,{endpointParams:e,logger:t.logger}));Z.m.aws=Q.U;var fe=n(117),ge=n(121);class Ee extends ge.T{constructor(e){super(e),Object.setPrototypeOf(this,Ee.prototype)}}class Ie extends Ee{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,Ie.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class Pe extends Ee{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e}),Object.setPrototypeOf(this,Pe.prototype),this.error=e.error,this.error_description=e.error_description}}class be extends Ee{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,be.prototype),this.error=e.error,this.error_description=e.error_description}}class ke extends Ee{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,ke.prototype),this.error=e.error,this.error_description=e.error_description}}class Ce extends Ee{name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e}),Object.setPrototypeOf(this,Ce.prototype),this.error=e.error,this.error_description=e.error_description}}class Oe extends Ee{name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e}),Object.setPrototypeOf(this,Oe.prototype),this.error=e.error,this.error_description=e.error_description}}class we extends Ee{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e}),Object.setPrototypeOf(this,we.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class Ae extends Ee{name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e}),Object.setPrototypeOf(this,Ae.prototype),this.error=e.error,this.error_description=e.error_description}}class De extends Ee{name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e}),Object.setPrototypeOf(this,De.prototype),this.error=e.error,this.error_description=e.error_description}}class ye extends Ee{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e}),Object.setPrototypeOf(this,ye.prototype),this.error=e.error,this.error_description=e.error_description}}class Te extends Ee{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e}),Object.setPrototypeOf(this,Te.prototype),this.error=e.error,this.error_description=e.error_description}}const $e="client",Re="error",je="error_description",Ue="http",_e="httpError",ze="reason",Fe="refreshToken",qe="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",Ge="com.amazonaws.ssooidc",He=fe.O.for(qe);var Ve=[-3,qe,"SSOOIDCServiceException",0,[],[]];He.registerError(Ve,Ee);const Me=fe.O.for(Ge);var Ne=[-3,Ge,"AccessDeniedException",{[Re]:$e,[_e]:400},[Re,ze,je],[0,0,0]];Me.registerError(Ne,Ie);var We=[-3,Ge,"AuthorizationPendingException",{[Re]:$e,[_e]:400},[Re,je],[0,0]];Me.registerError(We,Pe);var Le=[-3,Ge,"ExpiredTokenException",{[Re]:$e,[_e]:400},[Re,je],[0,0]];Me.registerError(Le,be);var Be=[-3,Ge,"InternalServerException",{[Re]:"server",[_e]:500},[Re,je],[0,0]];Me.registerError(Be,ke);var Je=[-3,Ge,"InvalidClientException",{[Re]:$e,[_e]:401},[Re,je],[0,0]];Me.registerError(Je,Ce);var Ke=[-3,Ge,"InvalidGrantException",{[Re]:$e,[_e]:400},[Re,je],[0,0]];Me.registerError(Ke,Oe);var Qe=[-3,Ge,"InvalidRequestException",{[Re]:$e,[_e]:400},[Re,ze,je],[0,0,0]];Me.registerError(Qe,we);var Xe=[-3,Ge,"InvalidScopeException",{[Re]:$e,[_e]:400},[Re,je],[0,0]];Me.registerError(Xe,Ae);var Ye=[-3,Ge,"SlowDownException",{[Re]:$e,[_e]:400},[Re,je],[0,0]];Me.registerError(Ye,De);var Ze=[-3,Ge,"UnauthorizedClientException",{[Re]:$e,[_e]:400},[Re,je],[0,0]];Me.registerError(Ze,ye);var et=[-3,Ge,"UnsupportedGrantTypeException",{[Re]:$e,[_e]:400},[Re,je],[0,0]];Me.registerError(et,Te);const tt=[He,Me];var nt=[0,Ge,"AccessToken",8,0],rt=[0,Ge,"ClientSecret",8,0],st=[0,Ge,"CodeVerifier",8,0],it=[0,Ge,"IdToken",8,0],ot=[0,Ge,"RefreshToken",8,0],at=[3,Ge,"CreateTokenRequest",0,["clientId","clientSecret","grantType","deviceCode","code",Fe,"scope","redirectUri","codeVerifier"],[0,[()=>rt,0],0,0,0,[()=>ot,0],64,0,[()=>st,0]],3],ct=[3,Ge,"CreateTokenResponse",0,["accessToken","tokenType","expiresIn",Fe,"idToken"],[[()=>nt,0],0,1,[()=>ot,0],[()=>it,0]]],pt=[9,Ge,"CreateToken",{[Ue]:["POST","/token",200]},()=>at,()=>ct];const ut=e=>{(0,D.I)(process.version);const t=(0,T.I)(e),n=()=>t().then(y.l),r=(e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??L.E,base64Encoder:e?.base64Encoder??B.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Se,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??P,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new H.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new M.m}],logger:e?.logger??new N.N,protocol:e?.protocol??V.Y,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:tt,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??W.D,utf8Decoder:e?.utf8Decoder??J.a,utf8Encoder:e?.utf8Encoder??K.P}))(e);(0,C.I)(process.version);const s={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,$.Z)(A.$,s),bodyLengthChecker:e?.bodyLengthChecker??z.n,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,O.pf)({serviceId:r.serviceId,clientVersion:k.rE}),maxAttempts:e?.maxAttempts??(0,$.Z)(v.qs,e),region:e?.region??(0,$.Z)(R.GG,{...R.zH,...s}),requestHandler:q.$.create(e?.requestHandler??n),retryMode:e?.retryMode??(0,$.Z)({...v.kN,default:async()=>(await n()).retryMode||_.L0},e),sha256:e?.sha256??F.V.bind(null,"sha256"),streamCollector:e?.streamCollector??G.k,useDualstackEndpoint:e?.useDualstackEndpoint??(0,$.Z)(j.e$,s),useFipsEndpoint:e?.useFipsEndpoint??(0,$.Z)(U.Ko,s),userAgentAppId:e?.userAgentAppId??(0,$.Z)(w.hV,s)}};var dt=n(135),lt=n(136),ht=n(137);class mt extends d.K{config;constructor(...[e]){const t=ut(e||{});super(t),this.initConfig=t;const n=(d=t,Object.assign(d,{useDualstackEndpoint:d.useDualstackEndpoint??!1,useFipsEndpoint:d.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}));var d;const g=(0,r.D)(n),P=(0,v.$z)(g),b=(0,l.T)(P),k=(0,s.OV)(b),C=((e,t)=>{const n=Object.assign((0,dt.R)(e),(0,lt.xA)(e),(0,ht.e)(e),(e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){const n=t.findIndex(t=>t.schemeId===e.schemeId);-1===n?t.push(e):t.splice(n,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider:()=>n,setCredentials(e){r=e},credentials:()=>r}})(e));return t.forEach(e=>e.configure(n)),Object.assign(e,(0,dt.$)(n),(0,lt.uv)(n),(0,ht.j)(n),{httpAuthSchemes:(r=n).httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()});var r})((e=>{const t=(0,f.h)(e);return Object.assign(t,{authSchemePreference:(0,E.t)(e.authSchemePreference??[])})})((0,h.Co)(k)),e?.extensions||[]);this.config=C,this.middlewareStack.use((0,S.wq)(this.config)),this.middlewareStack.use((0,i.sM)(this.config)),this.middlewareStack.use((0,x.ey)(this.config)),this.middlewareStack.use((0,m.vK)(this.config)),this.middlewareStack.use((0,s.TC)(this.config)),this.middlewareStack.use((0,o.Y7)(this.config)),this.middlewareStack.use((0,a.n)(this.config)),this.middlewareStack.use((0,c.w)(this.config,{httpAuthSchemeParametersProvider:I,identityProviderConfigProvider:async e=>new p.h({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use((0,u.l)(this.config))}destroy(){super.destroy()}}var vt=n(138);class xt extends(vt.u.classBuilder().ep(b).m(function(e,t,n,r){return[(0,h.rD)(n,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").sc(pt).build()){}}};
package/dist/522.index.js CHANGED
@@ -1,3 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";exports.id=522,exports.ids=[522],exports.modules={839(e,o,n){n.d(o,{fromTokenFile:()=>a});var r=n(80),t=n(61),s=n(837),i=n(104);const c="AWS_WEB_IDENTITY_TOKEN_FILE",a=(e={})=>async o=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");const a=e?.webIdentityTokenFile??process.env[c],d=e?.roleArn??process.env.AWS_ROLE_ARN,l=e?.roleSessionName??process.env.AWS_ROLE_SESSION_NAME;if(!a||!d)throw new t.C("Web identity configuration not specified",{logger:e.logger});const p=await(e=>async o=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");const{roleArn:r,roleSessionName:t,webIdentityToken:s,providerId:i,policyArns:c,policy:a,durationSeconds:d}=e;let{roleAssumerWithWebIdentity:l}=e;if(!l){const{getDefaultRoleAssumerWithWebIdentity:r}=await n.e(953).then(n.bind(n,852));l=r({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...o?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return l({RoleArn:r,RoleSessionName:t??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:s,ProviderId:i,PolicyArns:c,Policy:a,DurationSeconds:d})})({...e,webIdentityToken:s.Z?.getTokenRecord?.()[a]??(0,i.readFileSync)(a,{encoding:"ascii"}),roleArn:d,roleSessionName:l})(o);return a===process.env[c]&&(0,r.g)(p,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h"),p}},837(e,o,n){n.d(o,{Z:()=>s});var r=n(833),t=n(69);const s={getFileRecord:()=>t.Jj,interceptFile(e,o){t.Jj[e]=Promise.resolve(o)},getTokenRecord:()=>r.a,interceptToken(e,o){r.a[e]=o}}},834(e,o,n){n.d(o,{C:()=>i});var r=n(5),t=n(3),s=n(67);const i=e=>{const o=(0,r.createHash)("sha1").update(e).digest("hex");return(0,t.join)((0,s.R)(),".aws","sso","cache",`${o}.json`)}},833(e,o,n){n.d(o,{a:()=>s,v:()=>i});var r=n(27),t=n(834);const s={},i=async e=>{if(s[e])return s[e];const o=(0,t.C)(e),n=await(0,r.readFile)(o,"utf8");return JSON.parse(n)}}};
3
- //# sourceMappingURL=522.index.js.map
2
+ "use strict";exports.id=522,exports.ids=[522],exports.modules={847(e,o,n){n.d(o,{fromTokenFile:()=>a});var r=n(87),t=n(56),s=n(845),i=n(106);const c="AWS_WEB_IDENTITY_TOKEN_FILE",a=(e={})=>async o=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");const a=e?.webIdentityTokenFile??process.env[c],d=e?.roleArn??process.env.AWS_ROLE_ARN,l=e?.roleSessionName??process.env.AWS_ROLE_SESSION_NAME;if(!a||!d)throw new t.C("Web identity configuration not specified",{logger:e.logger});const p=await(e=>async o=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");const{roleArn:r,roleSessionName:t,webIdentityToken:s,providerId:i,policyArns:c,policy:a,durationSeconds:d}=e;let{roleAssumerWithWebIdentity:l}=e;if(!l){const{getDefaultRoleAssumerWithWebIdentity:r}=await n.e(41).then(n.bind(n,860));l=r({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...o?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return l({RoleArn:r,RoleSessionName:t??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:s,ProviderId:i,PolicyArns:c,Policy:a,DurationSeconds:d})})({...e,webIdentityToken:s.Z?.getTokenRecord?.()[a]??(0,i.readFileSync)(a,{encoding:"ascii"}),roleArn:d,roleSessionName:l})(o);return a===process.env[c]&&(0,r.g)(p,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h"),p}},845(e,o,n){n.d(o,{Z:()=>s});var r=n(841),t=n(65);const s={getFileRecord:()=>t.Jj,interceptFile(e,o){t.Jj[e]=Promise.resolve(o)},getTokenRecord:()=>r.a,interceptToken(e,o){r.a[e]=o}}},842(e,o,n){n.d(o,{C:()=>i});var r=n(20),t=n(59),s=n(63);const i=e=>{const o=(0,r.createHash)("sha1").update(e).digest("hex");return(0,t.join)((0,s.R)(),".aws","sso","cache",`${o}.json`)}},841(e,o,n){n.d(o,{a:()=>s,v:()=>i});var r=n(28),t=n(842);const s={},i=async e=>{if(s[e])return s[e];const o=(0,t.C)(e),n=await(0,r.readFile)(o,"utf8");return JSON.parse(n)}}};
package/dist/733.index.js CHANGED
@@ -1,3 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";exports.id=733,exports.ids=[733],exports.modules={835(e,t,r){r.d(t,{fromIni:()=>T});var n=r(832),i=r(62),o=r(61),s=r(80),a=r(58);const c=e=>(0,s.g)(e,"CREDENTIALS_PROFILE_NAMED_PROVIDER","p"),l=(e,{profile:t,logger:r})=>{const n="string"==typeof e.source_profile&&void 0===e.credential_source;return n&&r?.debug?.(` ${t} isAssumeRoleWithSourceProfile source_profile=${e.source_profile}`),n},f=(e,{profile:t,logger:r})=>{const n="string"==typeof e.credential_source&&void 0===e.source_profile;return n&&r?.debug?.(` ${t} isCredentialSourceProfile credential_source=${e.credential_source}`),n},d=async(e,t,n,l,f={},d)=>{n.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");const u=t[e],{source_profile:p,region:h}=u;if(!n.roleAssumer){const{getDefaultRoleAssumer:e}=await r.e(953).then(r.bind(r,852));n.roleAssumer=e({...n.clientConfig,credentialProviderLogger:n.logger,parentClientConfig:{...l,...n?.parentClientConfig,region:h??n?.parentClientConfig?.region??l?.region}},n.clientPlugins)}if(p&&p in f)throw new o.C(`Detected a cycle attempting to resolve credentials for profile ${(0,i.Bz)(n)}. Profiles visited: `+Object.keys(f).join(", "),{logger:n.logger});n.logger?.debug("@aws-sdk/credential-provider-ini - finding credential resolver using "+(p?`source_profile=[${p}]`:`profile=[${e}]`));const y=p?d(p,t,n,l,{...f,[p]:!0},g(t[p]??{})):(await((e,t,n)=>{const i={EcsContainer:async e=>{const{fromHttp:t}=await r.e(963).then(r.bind(r,841)),{fromContainerMetadata:i}=await r.e(330).then(r.bind(r,840));return n?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),async()=>(0,a.c)(t(e??{}),i(e))().then(c)},Ec2InstanceMetadata:async e=>{n?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");const{fromInstanceMetadata:t}=await r.e(330).then(r.bind(r,840));return async()=>t(e)().then(c)},Environment:async e=>{n?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");const{fromEnv:t}=await r.e(960).then(r.bind(r,853));return async()=>t(e)().then(c)}};if(e in i)return i[e];throw new o.C(`Unsupported credential source in profile ${t}. Got ${e}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:n})})(u.credential_source,e,n.logger)(n))();if(g(u))return y.then(e=>(0,s.g)(e,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"));{const t={RoleArn:u.role_arn,RoleSessionName:u.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:u.external_id,DurationSeconds:parseInt(u.duration_seconds||"3600",10)},{mfa_serial:r}=u;if(r){if(!n.mfaCodeProvider)throw new o.C(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:n.logger,tryNextLink:!1});t.SerialNumber=r,t.TokenCode=await n.mfaCodeProvider(r)}const i=await y;return n.roleAssumer(i,t).then(e=>(0,s.g)(e,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"))}},g=e=>!e.role_arn&&!!e.credential_source;var u=r(33),p=r(69),h=r(20),y=r(104),w=r(17),E=r(93);class I{profileData;init;callerClientConfig;static REFRESH_THRESHOLD=3e5;constructor(e,t,r){this.profileData=e,this.init=t,this.callerClientConfig=r}async loadCredentials(){const e=await this.loadToken();if(!e)throw new o.C(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`,{tryNextLink:!1,logger:this.logger});const t=e.accessToken,r=Date.now();return new Date(t.expiresAt).getTime()-r<=I.REFRESH_THRESHOLD?this.refresh(e):{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,sessionToken:t.sessionToken,accountId:t.accountId,expiration:new Date(t.expiresAt)}}get logger(){return this.init?.logger}get loginSession(){return this.profileData.login_session}async refresh(e){const{SigninClient:t,CreateOAuth2TokenCommand:n}=await Promise.all([r.e(905),r.e(780)]).then(r.bind(r,854)),{logger:i,userAgentAppId:s}=this.callerClientConfig??{},a=(e=>"h2"===e?.metadata?.handlerProtocol)(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,c=new t({credentials:{accessKeyId:"",secretAccessKey:""},region:this.profileData.region??await(this.callerClientConfig?.region?.())??process.env.AWS_REGION,requestHandler:a,logger:i,userAgentAppId:s,...this.init?.clientConfig});this.createDPoPInterceptor(c.middlewareStack);const l={tokenInput:{clientId:e.clientId,refreshToken:e.refreshToken,grantType:"refresh_token"}};try{const t=await c.send(new n(l)),{accessKeyId:r,secretAccessKey:i,sessionToken:s}=t.tokenOutput?.accessToken??{},{refreshToken:a,expiresIn:f}=t.tokenOutput??{};if(!(r&&i&&s&&a))throw new o.C("Token refresh response missing required fields",{logger:this.logger,tryNextLink:!1});const d=1e3*(f??900),g=new Date(Date.now()+d),u={...e,accessToken:{...e.accessToken,accessKeyId:r,secretAccessKey:i,sessionToken:s,expiresAt:g.toISOString()},refreshToken:a};await this.saveToken(u);const p=u.accessToken;return{accessKeyId:p.accessKeyId,secretAccessKey:p.secretAccessKey,sessionToken:p.sessionToken,accountId:p.accountId,expiration:g}}catch(e){if("AccessDeniedException"===e.name){let t;switch(e.error){case"TOKEN_EXPIRED":t="Your session has expired. Please reauthenticate.";break;case"USER_CREDENTIALS_CHANGED":t="Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";break;case"INSUFFICIENT_PERMISSIONS":t="Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";break;default:t=`Failed to refresh token: ${String(e)}. Please re-authenticate using \`aws login\``}throw new o.C(t,{logger:this.logger,tryNextLink:!1})}throw new o.C(`Failed to refresh token: ${String(e)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){const e=this.getTokenFilePath();try{let t;try{t=await(0,p.TA)(e,{ignoreCache:this.init?.ignoreCache})}catch{t=await y.promises.readFile(e,"utf8")}const r=JSON.parse(t),n=["accessToken","clientId","refreshToken","dpopKey"].filter(e=>!r[e]);if(r.accessToken?.accountId||n.push("accountId"),n.length>0)throw new o.C(`Token validation failed, missing fields: ${n.join(", ")}`,{logger:this.logger,tryNextLink:!1});return r}catch(t){throw new o.C(`Failed to load token from ${e}: ${String(t)}`,{logger:this.logger,tryNextLink:!1})}}async saveToken(e){const t=this.getTokenFilePath(),r=(0,E.dirname)(t);try{await y.promises.mkdir(r,{recursive:!0})}catch(e){}await y.promises.writeFile(t,JSON.stringify(e,null,2),"utf8")}getTokenFilePath(){const e=process.env.AWS_LOGIN_CACHE_DIRECTORY??(0,E.join)((0,w.homedir)(),".aws","login","cache"),t=Buffer.from(this.loginSession,"utf8"),r=(0,h.createHash)("sha256").update(t).digest("hex");return(0,E.join)(e,`${r}.json`)}derToRawSignature(e){let t=2;if(2!==e[t])throw new Error("Invalid DER signature");t++;const r=e[t++];let n=e.subarray(t,t+r);if(t+=r,2!==e[t])throw new Error("Invalid DER signature");t++;const i=e[t++];let o=e.subarray(t,t+i);n=0===n[0]?n.subarray(1):n,o=0===o[0]?o.subarray(1):o;const s=Buffer.concat([Buffer.alloc(32-n.length),n]),a=Buffer.concat([Buffer.alloc(32-o.length),o]);return Buffer.concat([s,a])}createDPoPInterceptor(e){e.add(e=>async t=>{if(u.K.isInstance(t.request)){const e=t.request,r=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}${e.path}`,n=await this.generateDpop(e.method,r);e.headers={...e.headers,DPoP:n}}return e(t)},{step:"finalizeRequest",name:"dpopInterceptor",override:!0})}async generateDpop(e="POST",t){const r=await this.loadToken();try{const n=(0,h.createPrivateKey)({key:r.dpopKey,format:"pem",type:"sec1"}),i=(0,h.createPublicKey)(n).export({format:"der",type:"spki"});let o=-1;for(let e=0;e<i.length;e++)if(4===i[e]){o=e;break}const s=i.slice(o+1,o+33),a=i.slice(o+33,o+65),c={alg:"ES256",typ:"dpop+jwt",jwk:{kty:"EC",crv:"P-256",x:s.toString("base64url"),y:a.toString("base64url")}},l={jti:crypto.randomUUID(),htm:e,htu:t,iat:Math.floor(Date.now()/1e3)},f=Buffer.from(JSON.stringify(c)).toString("base64url"),d=`${f}.${Buffer.from(JSON.stringify(l)).toString("base64url")}`,g=(0,h.sign)("sha256",Buffer.from(d),n),u=this.derToRawSignature(g);return`${d}.${u.toString("base64url")}`}catch(e){throw new o.C(`Failed to generate Dpop proof: ${e instanceof Error?e.message:String(e)}`,{logger:this.logger,tryNextLink:!1})}}}const C=async(e,t,r)=>{const a=await(c={...t,profile:e},async({callerClientConfig:e}={})=>{c?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");const t=await(0,n.Y)(c||{}),r=(0,i.Bz)({profile:c?.profile??e?.profile}),a=t[r];if(!a?.login_session)throw new o.C(`Profile ${r} does not contain login_session.`,{tryNextLink:!0,logger:c?.logger});const l=new I(a,c,e),f=await l.loadCredentials();return(0,s.g)(f,"CREDENTIALS_LOGIN","AD")})({callerClientConfig:r});var c;return(0,s.g)(a,"CREDENTIALS_PROFILE_LOGIN","AC")},k=e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.aws_access_key_id&&"string"==typeof e.aws_secret_access_key&&["undefined","string"].indexOf(typeof e.aws_session_token)>-1&&["undefined","string"].indexOf(typeof e.aws_account_id)>-1,S=async(e,t)=>{t?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");const r={accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token,...e.aws_credential_scope&&{credentialScope:e.aws_credential_scope},...e.aws_account_id&&{accountId:e.aws_account_id}};return(0,s.g)(r,"CREDENTIALS_PROFILE","n")},R=async(e,t,n,i,a={},c=!1)=>{const g=t[e];if(Object.keys(a).length>0&&k(g))return S(g,n);if(c||((e,{profile:t="default",logger:r}={})=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.role_arn&&["undefined","string"].indexOf(typeof e.role_session_name)>-1&&["undefined","string"].indexOf(typeof e.external_id)>-1&&["undefined","string"].indexOf(typeof e.mfa_serial)>-1&&(l(e,{profile:t,logger:r})||f(e,{profile:t,logger:r})))(g,{profile:e,logger:n.logger}))return d(e,t,n,i,a,R);if(k(g))return S(g,n);if(u=g,Boolean(u)&&"object"==typeof u&&"string"==typeof u.web_identity_token_file&&"string"==typeof u.role_arn&&["undefined","string"].indexOf(typeof u.role_session_name)>-1)return(async(e,t,n)=>r.e(522).then(r.bind(r,839)).then(({fromTokenFile:r})=>r({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:t.roleAssumerWithWebIdentity,logger:t.logger,parentClientConfig:t.parentClientConfig})({callerClientConfig:n}).then(e=>(0,s.g)(e,"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN","q"))))(g,n,i);var u;if((e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.credential_process)(g))return(async(e,t)=>r.e(876).then(r.bind(r,836)).then(({fromProcess:r})=>r({...e,profile:t})().then(e=>(0,s.g)(e,"CREDENTIALS_PROFILE_PROCESS","v"))))(n,e);if((e=>e&&("string"==typeof e.sso_start_url||"string"==typeof e.sso_account_id||"string"==typeof e.sso_session||"string"==typeof e.sso_region||"string"==typeof e.sso_role_name))(g))return await(async(e,t,n={},i)=>{const{fromSSO:o}=await r.e(593).then(r.bind(r,831));return o({profile:e,logger:n.logger,parentClientConfig:n.parentClientConfig,clientConfig:n.clientConfig})({callerClientConfig:i}).then(e=>t.sso_session?(0,s.g)(e,"CREDENTIALS_PROFILE_SSO","r"):(0,s.g)(e,"CREDENTIALS_PROFILE_SSO_LEGACY","t"))})(e,g,n,i);if((e=>Boolean(e&&e.login_session))(g))return C(e,n,i);throw new o.C(`Could not resolve credentials using profile: [${e}] in configuration/credentials file(s).`,{logger:n.logger})},T=(e={})=>async({callerClientConfig:t}={})=>{e.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");const r=await(0,n.Y)(e);return R((0,i.Bz)({profile:e.profile??t?.profile}),r,e,t)}},832(e,t,r){r.d(t,{Y:()=>i});var n=r(63);const i=async e=>{const t=await(0,n.p)(e);return((...e)=>{const t={};for(const r of e)for(const[e,n]of Object.entries(r))void 0!==t[e]?Object.assign(t[e],n):t[e]=n;return t})(t.configFile,t.credentialsFile)}}};
3
- //# sourceMappingURL=733.index.js.map
2
+ "use strict";exports.id=733,exports.ids=[733],exports.modules={843(e,t,r){r.d(t,{fromIni:()=>T});var n=r(840),i=r(57),o=r(56),s=r(87),a=r(53);const c=e=>(0,s.g)(e,"CREDENTIALS_PROFILE_NAMED_PROVIDER","p"),l=(e,{profile:t,logger:r})=>{const n="string"==typeof e.source_profile&&void 0===e.credential_source;return n&&r?.debug?.(` ${t} isAssumeRoleWithSourceProfile source_profile=${e.source_profile}`),n},f=(e,{profile:t,logger:r})=>{const n="string"==typeof e.credential_source&&void 0===e.source_profile;return n&&r?.debug?.(` ${t} isCredentialSourceProfile credential_source=${e.credential_source}`),n},d=async(e,t,n,l,f={},d)=>{n.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");const u=t[e],{source_profile:p,region:h}=u;if(!n.roleAssumer){const{getDefaultRoleAssumer:e}=await r.e(41).then(r.bind(r,860));n.roleAssumer=e({...n.clientConfig,credentialProviderLogger:n.logger,parentClientConfig:{...l,...n?.parentClientConfig,region:h??n?.parentClientConfig?.region??l?.region}},n.clientPlugins)}if(p&&p in f)throw new o.C(`Detected a cycle attempting to resolve credentials for profile ${(0,i.Bz)(n)}. Profiles visited: `+Object.keys(f).join(", "),{logger:n.logger});n.logger?.debug("@aws-sdk/credential-provider-ini - finding credential resolver using "+(p?`source_profile=[${p}]`:`profile=[${e}]`));const y=p?d(p,t,n,l,{...f,[p]:!0},g(t[p]??{})):(await((e,t,n)=>{const i={EcsContainer:async e=>{const{fromHttp:t}=await r.e(963).then(r.bind(r,849)),{fromContainerMetadata:i}=await r.e(330).then(r.bind(r,848));return n?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),async()=>(0,a.c)(t(e??{}),i(e))().then(c)},Ec2InstanceMetadata:async e=>{n?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");const{fromInstanceMetadata:t}=await r.e(330).then(r.bind(r,848));return async()=>t(e)().then(c)},Environment:async e=>{n?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");const{fromEnv:t}=await r.e(960).then(r.bind(r,861));return async()=>t(e)().then(c)}};if(e in i)return i[e];throw new o.C(`Unsupported credential source in profile ${t}. Got ${e}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:n})})(u.credential_source,e,n.logger)(n))();if(g(u))return y.then(e=>(0,s.g)(e,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"));{const t={RoleArn:u.role_arn,RoleSessionName:u.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:u.external_id,DurationSeconds:parseInt(u.duration_seconds||"3600",10)},{mfa_serial:r}=u;if(r){if(!n.mfaCodeProvider)throw new o.C(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:n.logger,tryNextLink:!1});t.SerialNumber=r,t.TokenCode=await n.mfaCodeProvider(r)}const i=await y;return n.roleAssumer(i,t).then(e=>(0,s.g)(e,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"))}},g=e=>!e.role_arn&&!!e.credential_source;var u=r(65),p=r(33),h=r(20),y=r(106),w=r(17),E=r(59);class I{profileData;init;callerClientConfig;static REFRESH_THRESHOLD=3e5;constructor(e,t,r){this.profileData=e,this.init=t,this.callerClientConfig=r}async loadCredentials(){const e=await this.loadToken();if(!e)throw new o.C(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`,{tryNextLink:!1,logger:this.logger});const t=e.accessToken,r=Date.now();return new Date(t.expiresAt).getTime()-r<=I.REFRESH_THRESHOLD?this.refresh(e):{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,sessionToken:t.sessionToken,accountId:t.accountId,expiration:new Date(t.expiresAt)}}get logger(){return this.init?.logger}get loginSession(){return this.profileData.login_session}async refresh(e){const{SigninClient:t,CreateOAuth2TokenCommand:n}=await Promise.all([r.e(350),r.e(785)]).then(r.bind(r,862)),{logger:i,userAgentAppId:s}=this.callerClientConfig??{},a=(e=>"h2"===e?.metadata?.handlerProtocol)(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,c=new t({credentials:{accessKeyId:"",secretAccessKey:""},region:this.profileData.region??await(this.callerClientConfig?.region?.())??process.env.AWS_REGION,requestHandler:a,logger:i,userAgentAppId:s,...this.init?.clientConfig});this.createDPoPInterceptor(c.middlewareStack);const l={tokenInput:{clientId:e.clientId,refreshToken:e.refreshToken,grantType:"refresh_token"}};try{const t=await c.send(new n(l)),{accessKeyId:r,secretAccessKey:i,sessionToken:s}=t.tokenOutput?.accessToken??{},{refreshToken:a,expiresIn:f}=t.tokenOutput??{};if(!(r&&i&&s&&a))throw new o.C("Token refresh response missing required fields",{logger:this.logger,tryNextLink:!1});const d=1e3*(f??900),g=new Date(Date.now()+d),u={...e,accessToken:{...e.accessToken,accessKeyId:r,secretAccessKey:i,sessionToken:s,expiresAt:g.toISOString()},refreshToken:a};await this.saveToken(u);const p=u.accessToken;return{accessKeyId:p.accessKeyId,secretAccessKey:p.secretAccessKey,sessionToken:p.sessionToken,accountId:p.accountId,expiration:g}}catch(e){if("AccessDeniedException"===e.name){let t;switch(e.error){case"TOKEN_EXPIRED":t="Your session has expired. Please reauthenticate.";break;case"USER_CREDENTIALS_CHANGED":t="Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";break;case"INSUFFICIENT_PERMISSIONS":t="Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";break;default:t=`Failed to refresh token: ${String(e)}. Please re-authenticate using \`aws login\``}throw new o.C(t,{logger:this.logger,tryNextLink:!1})}throw new o.C(`Failed to refresh token: ${String(e)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){const e=this.getTokenFilePath();try{let t;try{t=await(0,u.TA)(e,{ignoreCache:this.init?.ignoreCache})}catch{t=await y.promises.readFile(e,"utf8")}const r=JSON.parse(t),n=["accessToken","clientId","refreshToken","dpopKey"].filter(e=>!r[e]);if(r.accessToken?.accountId||n.push("accountId"),n.length>0)throw new o.C(`Token validation failed, missing fields: ${n.join(", ")}`,{logger:this.logger,tryNextLink:!1});return r}catch(t){throw new o.C(`Failed to load token from ${e}: ${String(t)}`,{logger:this.logger,tryNextLink:!1})}}async saveToken(e){const t=this.getTokenFilePath(),r=(0,E.dirname)(t);try{await y.promises.mkdir(r,{recursive:!0})}catch(e){}await y.promises.writeFile(t,JSON.stringify(e,null,2),"utf8")}getTokenFilePath(){const e=process.env.AWS_LOGIN_CACHE_DIRECTORY??(0,E.join)((0,w.homedir)(),".aws","login","cache"),t=Buffer.from(this.loginSession,"utf8"),r=(0,h.createHash)("sha256").update(t).digest("hex");return(0,E.join)(e,`${r}.json`)}derToRawSignature(e){let t=2;if(2!==e[t])throw new Error("Invalid DER signature");t++;const r=e[t++];let n=e.subarray(t,t+r);if(t+=r,2!==e[t])throw new Error("Invalid DER signature");t++;const i=e[t++];let o=e.subarray(t,t+i);n=0===n[0]?n.subarray(1):n,o=0===o[0]?o.subarray(1):o;const s=Buffer.concat([Buffer.alloc(32-n.length),n]),a=Buffer.concat([Buffer.alloc(32-o.length),o]);return Buffer.concat([s,a])}createDPoPInterceptor(e){e.add(e=>async t=>{if(p.K.isInstance(t.request)){const e=t.request,r=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}${e.path}`,n=await this.generateDpop(e.method,r);e.headers={...e.headers,DPoP:n}}return e(t)},{step:"finalizeRequest",name:"dpopInterceptor",override:!0})}async generateDpop(e="POST",t){const r=await this.loadToken();try{const n=(0,h.createPrivateKey)({key:r.dpopKey,format:"pem",type:"sec1"}),i=(0,h.createPublicKey)(n).export({format:"der",type:"spki"});let o=-1;for(let e=0;e<i.length;e++)if(4===i[e]){o=e;break}const s=i.slice(o+1,o+33),a=i.slice(o+33,o+65),c={alg:"ES256",typ:"dpop+jwt",jwk:{kty:"EC",crv:"P-256",x:s.toString("base64url"),y:a.toString("base64url")}},l={jti:crypto.randomUUID(),htm:e,htu:t,iat:Math.floor(Date.now()/1e3)},f=Buffer.from(JSON.stringify(c)).toString("base64url"),d=`${f}.${Buffer.from(JSON.stringify(l)).toString("base64url")}`,g=(0,h.sign)("sha256",Buffer.from(d),n),u=this.derToRawSignature(g);return`${d}.${u.toString("base64url")}`}catch(e){throw new o.C(`Failed to generate Dpop proof: ${e instanceof Error?e.message:String(e)}`,{logger:this.logger,tryNextLink:!1})}}}const C=async(e,t,r)=>{const a=await(c={...t,profile:e},async({callerClientConfig:e}={})=>{c?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");const t=await(0,n.Y)(c||{}),r=(0,i.Bz)({profile:c?.profile??e?.profile}),a=t[r];if(!a?.login_session)throw new o.C(`Profile ${r} does not contain login_session.`,{tryNextLink:!0,logger:c?.logger});const l=new I(a,c,e),f=await l.loadCredentials();return(0,s.g)(f,"CREDENTIALS_LOGIN","AD")})({callerClientConfig:r});var c;return(0,s.g)(a,"CREDENTIALS_PROFILE_LOGIN","AC")},k=e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.aws_access_key_id&&"string"==typeof e.aws_secret_access_key&&["undefined","string"].indexOf(typeof e.aws_session_token)>-1&&["undefined","string"].indexOf(typeof e.aws_account_id)>-1,S=async(e,t)=>{t?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");const r={accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token,...e.aws_credential_scope&&{credentialScope:e.aws_credential_scope},...e.aws_account_id&&{accountId:e.aws_account_id}};return(0,s.g)(r,"CREDENTIALS_PROFILE","n")},R=async(e,t,n,i,a={},c=!1)=>{const g=t[e];if(Object.keys(a).length>0&&k(g))return S(g,n);if(c||((e,{profile:t="default",logger:r}={})=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.role_arn&&["undefined","string"].indexOf(typeof e.role_session_name)>-1&&["undefined","string"].indexOf(typeof e.external_id)>-1&&["undefined","string"].indexOf(typeof e.mfa_serial)>-1&&(l(e,{profile:t,logger:r})||f(e,{profile:t,logger:r})))(g,{profile:e,logger:n.logger}))return d(e,t,n,i,a,R);if(k(g))return S(g,n);if(u=g,Boolean(u)&&"object"==typeof u&&"string"==typeof u.web_identity_token_file&&"string"==typeof u.role_arn&&["undefined","string"].indexOf(typeof u.role_session_name)>-1)return(async(e,t,n)=>r.e(522).then(r.bind(r,847)).then(({fromTokenFile:r})=>r({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:t.roleAssumerWithWebIdentity,logger:t.logger,parentClientConfig:t.parentClientConfig})({callerClientConfig:n}).then(e=>(0,s.g)(e,"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN","q"))))(g,n,i);var u;if((e=>Boolean(e)&&"object"==typeof e&&"string"==typeof e.credential_process)(g))return(async(e,t)=>r.e(876).then(r.bind(r,844)).then(({fromProcess:r})=>r({...e,profile:t})().then(e=>(0,s.g)(e,"CREDENTIALS_PROFILE_PROCESS","v"))))(n,e);if((e=>e&&("string"==typeof e.sso_start_url||"string"==typeof e.sso_account_id||"string"==typeof e.sso_session||"string"==typeof e.sso_region||"string"==typeof e.sso_role_name))(g))return await(async(e,t,n={},i)=>{const{fromSSO:o}=await r.e(843).then(r.bind(r,839));return o({profile:e,logger:n.logger,parentClientConfig:n.parentClientConfig,clientConfig:n.clientConfig})({callerClientConfig:i}).then(e=>t.sso_session?(0,s.g)(e,"CREDENTIALS_PROFILE_SSO","r"):(0,s.g)(e,"CREDENTIALS_PROFILE_SSO_LEGACY","t"))})(e,g,n,i);if((e=>Boolean(e&&e.login_session))(g))return C(e,n,i);throw new o.C(`Could not resolve credentials using profile: [${e}] in configuration/credentials file(s).`,{logger:n.logger})},T=(e={})=>async({callerClientConfig:t}={})=>{e.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");const r=await(0,n.Y)(e);return R((0,i.Bz)({profile:e.profile??t?.profile}),r,e,t)}},840(e,t,r){r.d(t,{Y:()=>i});var n=r(58);const i=async e=>{const t=await(0,n.p)(e);return((...e)=>{const t={};for(const r of e)for(const[e,n]of Object.entries(r))void 0!==t[e]?Object.assign(t[e],n):t[e]=n;return t})(t.configFile,t.credentialsFile)}}};
package/dist/782.index.js CHANGED
@@ -1,3 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";exports.id=782,exports.ids=[782],exports.modules={843(e,t,n){n.d(t,{EventStreamSerde:()=>r});var s=n(114),i=n(83);class r{marshaller;serializer;deserializer;serdeContext;defaultContentType;constructor({marshaller:e,serializer:t,deserializer:n,serdeContext:s,defaultContentType:i}){this.marshaller=e,this.serializer=t,this.deserializer=n,this.serdeContext=s,this.defaultContentType=i}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n}){const s=this.marshaller,i=t.getEventStreamMember(),r=t.getMemberSchema(i),o=this.serializer,a=this.defaultContentType,l=Symbol("initialRequestMarker"),y={async*[Symbol.asyncIterator](){if(n){const e={":event-type":{type:"string",value:"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:a}};o.write(t,n);const s=o.flush();yield{[l]:!0,headers:e,body:s}}for await(const t of e)yield t}};return s.serialize(y,e=>{if(e[l])return{headers:e.headers,body:e.body};const t=Object.keys(e).find(e=>"__type"!==e)??"",{additionalHeaders:n,body:s,eventType:i,explicitPayloadContentType:o}=this.writeEventBody(t,r,e);return{headers:{":event-type":{type:"string",value:i},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:o??a},...n},body:s}})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n}){const i=this.marshaller,r=t.getEventStreamMember(),o=t.getMemberSchema(r).getMemberSchemas(),a=Symbol("initialResponseMarker"),l=i.deserialize(e.body,async e=>{const n=Object.keys(e).find(e=>"__type"!==e)??"",i=e[n].body;if("initial-response"===n){const e=await this.deserializer.read(t,i);return delete e[r],{[a]:!0,...e}}if(n in o){const t=o[n];if(t.isStructSchema()){const r={};let o=!1;for(const[a,l]of t.structIterator()){const{eventHeader:t,eventPayload:y}=l.getMergedTraits();if(o=o||Boolean(t||y),y)l.isBlobSchema()?r[a]=i:l.isStringSchema()?r[a]=(this.serdeContext?.utf8Encoder??s.P)(i):l.isStructSchema()&&(r[a]=await this.deserializer.read(l,i));else if(t){const t=e[n].headers[a]?.value;null!=t&&(l.isNumericSchema()?r[a]=t&&"object"==typeof t&&"bytes"in t?BigInt(t.toString()):Number(t):r[a]=t)}}if(o)return{[n]:r};if(0===i.byteLength)return{[n]:{}}}return{[n]:await this.deserializer.read(t,i)}}return{$unknown:e}}),y=l[Symbol.asyncIterator](),c=await y.next();if(c.done)return l;if(c.value?.[a]){if(!t)throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(const[e,t]of Object.entries(c.value))n[e]=t}return{async*[Symbol.asyncIterator](){for(c?.value?.[a]||(yield c.value);;){const{done:e,value:t}=await y.next();if(e)break;yield t}}}}writeEventBody(e,t,n){const s=this.serializer;let r,o=e,a=null;const l={};if(t.getSchema()[4].includes(e)){const i=t.getMemberSchema(e);if(i.isStructSchema()){for(const[t,s]of i.structIterator()){const{eventHeader:i,eventPayload:r}=s.getMergedTraits();if(r)a=t;else if(i){const i=n[e][t];let r="binary";s.isNumericSchema()?r=(-2)**31<=i&&i<=2**31-1?"integer":"long":s.isTimestampSchema()?r="timestamp":s.isStringSchema()?r="string":s.isBooleanSchema()&&(r="boolean"),null!=i&&(l[t]={type:r,value:i},delete n[e][t])}}if(null!==a){const t=i.getMemberSchema(a);t.isBlobSchema()?r="application/octet-stream":t.isStringSchema()&&(r="text/plain"),s.write(t,n[e][a])}else s.write(i,n[e])}else{if(!i.isUnitSchema())throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.");s.write(i,{})}}else{const[t,i]=n[e];o=t,s.write(15,i)}const y=s.flush()??new Uint8Array;return{body:"string"==typeof y?(this.serdeContext?.utf8Decoder??i.a)(y):y,eventType:o,explicitPayloadContentType:r,additionalHeaders:l}}}}};
3
- //# sourceMappingURL=782.index.js.map
2
+ "use strict";exports.id=782,exports.ids=[782],exports.modules={851(e,t,n){n.d(t,{EventStreamSerde:()=>r});var i=n(79),s=n(78);class r{marshaller;serializer;deserializer;serdeContext;defaultContentType;constructor({marshaller:e,serializer:t,deserializer:n,serdeContext:i,defaultContentType:s}){this.marshaller=e,this.serializer=t,this.deserializer=n,this.serdeContext=i,this.defaultContentType=s}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n}){const i=this.marshaller,s=t.getEventStreamMember(),r=t.getMemberSchema(s),o=this.serializer,a=this.defaultContentType,l=Symbol("initialRequestMarker"),y={async*[Symbol.asyncIterator](){if(n){const e={":event-type":{type:"string",value:"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:a}};o.write(t,n);const i=o.flush();yield{[l]:!0,headers:e,body:i}}for await(const t of e)yield t}};return i.serialize(y,e=>{if(e[l])return{headers:e.headers,body:e.body};let t="";for(const n in e)if("__type"!==n){t=n;break}const{additionalHeaders:n,body:i,eventType:s,explicitPayloadContentType:o}=this.writeEventBody(t,r,e);return{headers:{":event-type":{type:"string",value:s},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:o??a},...n},body:i}})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n}){const s=this.marshaller,r=t.getEventStreamMember(),o=t.getMemberSchema(r).getMemberSchemas(),a=Symbol("initialResponseMarker"),l=s.deserialize(e.body,async e=>{let n="";for(const t in e)if("__type"!==t){n=t;break}const s=e[n].body;if("initial-response"===n){const e=await this.deserializer.read(t,s);return delete e[r],{[a]:!0,...e}}if(n in o){const t=o[n];if(t.isStructSchema()){const r={};let o=!1;for(const[a,l]of t.structIterator()){const{eventHeader:t,eventPayload:y}=l.getMergedTraits();if(o=o||Boolean(t||y),y)l.isBlobSchema()?r[a]=s:l.isStringSchema()?r[a]=(this.serdeContext?.utf8Encoder??i.P)(s):l.isStructSchema()&&(r[a]=await this.deserializer.read(l,s));else if(t){const t=e[n].headers[a]?.value;null!=t&&(l.isNumericSchema()?r[a]=t&&"object"==typeof t&&"bytes"in t?BigInt(t.toString()):Number(t):r[a]=t)}}if(o)return{[n]:r};if(0===s.byteLength)return{[n]:{}}}return{[n]:await this.deserializer.read(t,s)}}return{$unknown:e}}),y=l[Symbol.asyncIterator](),c=await y.next();if(c.done)return l;if(c.value?.[a]){if(!t)throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(const e in c.value)n[e]=c.value[e]}return{async*[Symbol.asyncIterator](){for(c?.value?.[a]||(yield c.value);;){const{done:e,value:t}=await y.next();if(e)break;yield t}}}}writeEventBody(e,t,n){const i=this.serializer;let r,o=e,a=null;const l={};if(t.getSchema()[4].includes(e)){const s=t.getMemberSchema(e);if(s.isStructSchema()){for(const[t,i]of s.structIterator()){const{eventHeader:s,eventPayload:r}=i.getMergedTraits();if(r)a=t;else if(s){const s=n[e][t];let r="binary";i.isNumericSchema()?r=(-2)**31<=s&&s<=2**31-1?"integer":"long":i.isTimestampSchema()?r="timestamp":i.isStringSchema()?r="string":i.isBooleanSchema()&&(r="boolean"),null!=s&&(l[t]={type:r,value:s},delete n[e][t])}}if(null!==a){const t=s.getMemberSchema(a);t.isBlobSchema()?r="application/octet-stream":t.isStringSchema()&&(r="text/plain"),i.write(t,n[e][a])}else i.write(s,n[e])}else{if(!s.isUnitSchema())throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.");i.write(s,{})}}else{const[t,s]=n[e];o=t,i.write(15,s)}const y=i.flush()??new Uint8Array;return{body:"string"==typeof y?(this.serdeContext?.utf8Decoder??s.a)(y):y,eventType:o,explicitPayloadContentType:r,additionalHeaders:l}}}}};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ "use strict";exports.id=785,exports.ids=[785],exports.modules={862(e,t,n){n.d(t,{CreateOAuth2TokenCommand:()=>gt,SigninClient:()=>dt});var s=n(36),i=n(32),r=n(38),o=n(34),a=n(35),c=n(43),u=n(42),p=n(46),h=n(47),d=n(49),l=n(51),g=n(70),m=n(84),v=n(71),f=n(85),S=n(86),P=n(44),k=n(69);const A=async(e,t,n)=>({operation:(0,P.u)(t).operation,region:await(0,k.t)(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});const x=e=>{const t=[];if("CreateOAuth2Token"===e.operation)t.push({schemeId:"smithy.api#noAuth"});else t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e));return t},y={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var I=n(853),E=n(92),b=n(93),w=n(96),R=n(97),T=n(100),C=n(99),O=n(104),D=n(52),F=n(103),j=n(101),q=n(102),U=n(40),$=n(105),z=n(107),M=n(108),V=n(109),H=n(110),N=n(854),B=n(858),K=n(72),L=n(68),G=n(74),J=n(77),Q=n(78),W=n(79),X=n(129),Y=n(132),Z=n(133),_=n(130),ee=n(134);const te="ref",ne=-1,se=!0,ie="isSet",re="PartitionResult",oe="booleanEquals",ae="getAttr",ce="stringEquals",ue={[te]:"Endpoint"},pe={[te]:re},he={fn:ae,argv:[pe,"name"]},de={},le=[{[te]:"Region"}],ge={conditions:[[ie,[ue]],[ie,le],["aws.partition",le,re],[oe,[{[te]:"UseFIPS"},se]],[oe,[{[te]:"UseDualStack"},se]],[oe,[{fn:ae,argv:[pe,"supportsDualStack"]},se]],[oe,[{fn:ae,argv:[pe,"supportsFIPS"]},se]],[ce,[he,"aws"]],[ce,[he,"aws-cn"]],[ce,[he,"aws-us-gov"]]],results:[[ne],[ne,"Invalid Configuration: FIPS and custom endpoint are not supported"],[ne,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[ue,de],["https://{Region}.signin.aws.amazon.com",de],["https://{Region}.signin.amazonaws.cn",de],["https://{Region}.signin.amazonaws-us-gov.com",de],["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",de],[ne,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",de],[ne,"FIPS is enabled but this partition does not support FIPS"],["https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",de],[ne,"DualStack is enabled but this partition does not support DualStack"],["https://signin.{Region}.{PartitionResult#dnsSuffix}",de],[ne,"Invalid Configuration: Missing Region"]]},me=1e8,ve=new Int32Array([-1,1,-1,0,15,3,1,4,me+14,2,5,me+14,3,11,6,4,10,7,7,me+4,8,8,me+5,9,9,me+6,me+13,5,me+11,me+12,4,13,12,6,me+9,me+10,5,14,me+8,6,me+7,me+8,3,me+1,16,4,me+2,me+3]),fe=ee.d.from(ve,2,ge.conditions,ge.results),Se=new Y.k({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Pe=(e,t={})=>Se.get(e,()=>(0,Z.c)(fe,{endpointParams:e,logger:t.logger}));_.m.aws=X.U;var ke=n(117),Ae=n(121);class xe extends Ae.T{constructor(e){super(e),Object.setPrototypeOf(this,xe.prototype)}}class ye extends xe{name="AccessDeniedException";$fault="client";error;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,ye.prototype),this.error=e.error}}class Ie extends xe{name="InternalServerException";$fault="server";error;constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,Ie.prototype),this.error=e.error}}class Ee extends xe{name="TooManyRequestsError";$fault="client";error;constructor(e){super({name:"TooManyRequestsError",$fault:"client",...e}),Object.setPrototypeOf(this,Ee.prototype),this.error=e.error}}class be extends xe{name="ValidationException";$fault="client";error;constructor(e){super({name:"ValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,be.prototype),this.error=e.error}}const we="accessKeyId",Re="accessToken",Te="client",Ce="clientId",Oe="codeVerifier",De="error",Fe="expiresIn",je="grantType",qe="http",Ue="httpError",$e="idToken",ze="jsonName",Me="message",Ve="refreshToken",He="redirectUri",Ne="smithy.ts.sdk.synthetic.com.amazonaws.signin",Be="secretAccessKey",Ke="sessionToken",Le="tokenType",Ge="com.amazonaws.signin",Je=ke.O.for(Ne);var Qe=[-3,Ne,"SigninServiceException",0,[],[]];Je.registerError(Qe,xe);const We=ke.O.for(Ge);var Xe=[-3,Ge,"AccessDeniedException",{[De]:Te},[De,Me],[0,0],2];We.registerError(Xe,ye);var Ye=[-3,Ge,"InternalServerException",{[De]:"server",[Ue]:500},[De,Me],[0,0],2];We.registerError(Ye,Ie);var Ze=[-3,Ge,"TooManyRequestsError",{[De]:Te,[Ue]:429},[De,Me],[0,0],2];We.registerError(Ze,Ee);var _e=[-3,Ge,"ValidationException",{[De]:Te,[Ue]:400},[De,Me],[0,0],2];We.registerError(_e,be);const et=[Je,We];var tt=[0,Ge,"RefreshToken",8,0],nt=[3,Ge,"AccessToken",8,[we,Be,Ke],[[0,{[ze]:we}],[0,{[ze]:Be}],[0,{[ze]:Ke}]],3],st=[3,Ge,"CreateOAuth2TokenRequest",0,["tokenInput"],[[()=>it,16]],1],it=[3,Ge,"CreateOAuth2TokenRequestBody",0,[Ce,je,"code",He,Oe,Ve],[[0,{[ze]:Ce}],[0,{[ze]:je}],0,[0,{[ze]:He}],[0,{[ze]:Oe}],[()=>tt,{[ze]:Ve}]],2],rt=[3,Ge,"CreateOAuth2TokenResponse",0,["tokenOutput"],[[()=>ot,16]],1],ot=[3,Ge,"CreateOAuth2TokenResponseBody",0,[Re,Le,Fe,Ve,$e],[[()=>nt,{[ze]:Re}],[0,{[ze]:Le}],[1,{[ze]:Fe}],[()=>tt,{[ze]:Ve}],[0,{[ze]:$e}]],4],at=[9,Ge,"CreateOAuth2Token",{[qe]:["POST","/v1/token",200]},()=>st,()=>rt];const ct=e=>{(0,T.I)(process.version);const t=(0,O.I)(e),n=()=>t().then(C.l),s=(e=>({apiVersion:"2023-01-01",base64Decoder:e?.base64Decoder??G.E,base64Encoder:e?.base64Encoder??J.n,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Pe,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??x,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new H.f2},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new B.m}],logger:e?.logger??new K.N,protocol:e?.protocol??N.Y,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:et,version:"2023-01-01",serviceTarget:"Signin"},serviceId:e?.serviceId??"Signin",urlParser:e?.urlParser??L.D,utf8Decoder:e?.utf8Decoder??Q.a,utf8Encoder:e?.utf8Encoder??W.P}))(e);(0,E.I)(process.version);const i={profile:e?.profile,logger:s.logger};return{...s,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,D.Z)(R.$,i),bodyLengthChecker:e?.bodyLengthChecker??$.n,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,b.pf)({serviceId:s.serviceId,clientVersion:I.rE}),maxAttempts:e?.maxAttempts??(0,D.Z)(m.qs,e),region:e?.region??(0,D.Z)(F.GG,{...F.zH,...i}),requestHandler:M.$.create(e?.requestHandler??n),retryMode:e?.retryMode??(0,D.Z)({...m.kN,default:async()=>(await n()).retryMode||U.L0},e),sha256:e?.sha256??z.V.bind(null,"sha256"),streamCollector:e?.streamCollector??V.k,useDualstackEndpoint:e?.useDualstackEndpoint??(0,D.Z)(j.e$,i),useFipsEndpoint:e?.useFipsEndpoint??(0,D.Z)(q.Ko,i),userAgentAppId:e?.userAgentAppId??(0,D.Z)(w.hV,i)}};var ut=n(135),pt=n(136),ht=n(137);class dt extends h.K{config;constructor(...[e]){const t=ct(e||{});super(t),this.initConfig=t;const n=(h=t,Object.assign(h,{useDualstackEndpoint:h.useDualstackEndpoint??!1,useFipsEndpoint:h.useFipsEndpoint??!1,defaultSigningName:"signin"}));var h;const P=(0,s.D)(n),x=(0,m.$z)(P),y=(0,d.T)(x),I=(0,i.OV)(y),E=((e,t)=>{const n=Object.assign((0,ut.R)(e),(0,pt.xA)(e),(0,ht.e)(e),(e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,s=e.credentials;return{setHttpAuthScheme(e){const n=t.findIndex(t=>t.schemeId===e.schemeId);-1===n?t.push(e):t.splice(n,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider:()=>n,setCredentials(e){s=e},credentials:()=>s}})(e));return t.forEach(e=>e.configure(n)),Object.assign(e,(0,ut.$)(n),(0,pt.uv)(n),(0,ht.j)(n),{httpAuthSchemes:(s=n).httpAuthSchemes(),httpAuthSchemeProvider:s.httpAuthSchemeProvider(),credentials:s.credentials()});var s})((e=>{const t=(0,S.h)(e);return Object.assign(t,{authSchemePreference:(0,k.t)(e.authSchemePreference??[])})})((0,l.Co)(I)),e?.extensions||[]);this.config=E,this.middlewareStack.use((0,f.wq)(this.config)),this.middlewareStack.use((0,r.sM)(this.config)),this.middlewareStack.use((0,v.ey)(this.config)),this.middlewareStack.use((0,g.vK)(this.config)),this.middlewareStack.use((0,i.TC)(this.config)),this.middlewareStack.use((0,o.Y7)(this.config)),this.middlewareStack.use((0,a.n)(this.config)),this.middlewareStack.use((0,c.w)(this.config,{httpAuthSchemeParametersProvider:A,identityProviderConfigProvider:async e=>new u.h({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use((0,p.l)(this.config))}destroy(){super.destroy()}}var lt=n(138);class gt extends(lt.u.classBuilder().ep(y).m(function(e,t,n,s){return[(0,l.rD)(n,e.getEndpointParameterInstructions())]}).s("Signin","CreateOAuth2Token",{}).n("SigninClient","CreateOAuth2TokenCommand").sc(at).build()){}}};