create-sailor 1.3.5 → 1.4.0

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.
Files changed (44) hide show
  1. package/README.md +22 -3
  2. package/dist/index.js +189 -172
  3. package/package.json +14 -15
  4. package/dist/aws-kms-ZX6CTY62.js +0 -1
  5. package/dist/chunk-4NVBWJ2Q.js +0 -1
  6. package/dist/chunk-7DCGNQSQ.js +0 -5
  7. package/dist/chunk-7HOF72FC.js +0 -1
  8. package/dist/chunk-7VJYOZUP.js +0 -2
  9. package/dist/chunk-A2KGYHAM.js +0 -1
  10. package/dist/chunk-A75AMTOI.js +0 -1
  11. package/dist/chunk-B5RLHF2U.js +0 -40
  12. package/dist/chunk-DIXI4M5O.js +0 -1
  13. package/dist/chunk-EXLRPVEX.js +0 -1
  14. package/dist/chunk-FGJ5K4WM.js +0 -1
  15. package/dist/chunk-FSRPMVAS.js +0 -1
  16. package/dist/chunk-J7NVVT5I.js +0 -20
  17. package/dist/chunk-LDOHSEAR.js +0 -9
  18. package/dist/chunk-NK255JZN.js +0 -1
  19. package/dist/chunk-OJM5Y4UT.js +0 -1
  20. package/dist/chunk-PXU2OOBT.js +0 -1
  21. package/dist/chunk-QEIMNOY2.js +0 -1
  22. package/dist/chunk-QMKVUKS6.js +0 -1
  23. package/dist/chunk-RR5R4AKJ.js +0 -1
  24. package/dist/chunk-SDX64WW4.js +0 -23
  25. package/dist/chunk-XSSPJU77.js +0 -1
  26. package/dist/chunk-YR32FZAX.js +0 -1
  27. package/dist/credits-6AUSU6X6.js +0 -1787
  28. package/dist/dist-B4YTE2SQ.js +0 -5
  29. package/dist/dist-es-4EORLV5B.js +0 -1
  30. package/dist/dist-es-7IMKW7US.js +0 -1
  31. package/dist/dist-es-FJUQ4DBK.js +0 -2
  32. package/dist/dist-es-GP7DK3S3.js +0 -5
  33. package/dist/dist-es-JXNWCJHW.js +0 -1
  34. package/dist/dist-es-YKXA2GQ2.js +0 -1
  35. package/dist/dist-es-ZA2NRM7G.js +0 -2
  36. package/dist/event-streams-T5RU6C4N.js +0 -1
  37. package/dist/loadSso-YQ73JVR6.js +0 -1
  38. package/dist/local-WW37QOXE.js +0 -1
  39. package/dist/query_compiler_fast_bg.postgresql-PN2AWLCP.js +0 -2
  40. package/dist/query_compiler_fast_bg.postgresql.wasm-base64-CASS54LO.js +0 -1
  41. package/dist/signin-LD4OP44K.js +0 -1
  42. package/dist/src-MVDQLN5F.js +0 -1
  43. package/dist/sso-oidc-4BAF7BYK.js +0 -1
  44. package/dist/sts-3V5Q4UTA.js +0 -6
@@ -1 +0,0 @@
1
- import{a as xe}from"./chunk-NK255JZN.js";import{a as he}from"./chunk-OJM5Y4UT.js";import{d as re,e as Ue}from"./chunk-A75AMTOI.js";import"./chunk-YR32FZAX.js";import{$ as we,A as ae,B as pe,C as ce,D as ue,E as me,F as de,G as le,H as ge,I as fe,J as Ee,K as Se,L as ve,M as _e,Q as Ae,R as Pe,S as Ie,T as Ce,U as Re,V as ye,W as Oe,X as Te,Y as ke,Z as De,_ as Ne,a as M,aa as He,b as V,ba as be,c as q,ca as Fe,d as L,da as $e,e as j,ea as Me,f as B,fa as Ve,g as k,ga as qe,h as G,ha as Le,i as z,ia as je,l as ee,o as D,v as te,w as oe,x as ne,y as se,z as ie}from"./chunk-J7NVVT5I.js";import{a as Z,c as m}from"./chunk-PXU2OOBT.js";import"./chunk-DIXI4M5O.js";import"./chunk-FGJ5K4WM.js";import"./chunk-7VJYOZUP.js";import{b as K,c as W,e as Y,f as J}from"./chunk-7DCGNQSQ.js";import"./chunk-XSSPJU77.js";import{d as X,e as Q}from"./chunk-QEIMNOY2.js";import"./chunk-QMKVUKS6.js";import"./chunk-EXLRPVEX.js";import"./chunk-FSRPMVAS.js";var Be=async(e,t,r)=>({operation:B(t).operation,region:await k(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Dt(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:e.region},propertiesExtractor:(t,r)=>({signingProperties:{config:t,context:r}})}}function Nt(e){return{schemeId:"smithy.api#noAuth"}}var Ge=e=>{let t=[];return e.operation==="CreateOAuth2Token"?t.push(Nt(e)):t.push(Dt(e)),t},ze=e=>{let t=me(e);return Object.assign(t,{authSchemePreference:k(e.authSchemePreference??[])})};var Ke=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"signin"}),Xe={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var rt="required";var s="argv";var Qe="isSet",h="booleanEquals",g="error",d="endpoint",c="tree",_="PartitionResult",N="stringEquals",We={[rt]:!0,default:!1,type:"boolean"},Ye={[rt]:!1,type:"string"},Je={ref:"Endpoint"},w={fn:h,[s]:[{ref:"UseFIPS"},!0]},H={fn:h,[s]:[{ref:"UseDualStack"},!0]},n={},b={fn:"getAttr",[s]:[{ref:_},"name"]},S={fn:h,[s]:[{ref:"UseFIPS"},!1]},v={fn:h,[s]:[{ref:"UseDualStack"},!1]},Ze={fn:"getAttr",[s]:[{ref:_},"supportsFIPS"]},et={fn:h,[s]:[!0,{fn:"getAttr",[s]:[{ref:_},"supportsDualStack"]}]},tt=[{ref:"Region"}],wt={version:"1.0",parameters:{UseDualStack:We,UseFIPS:We,Endpoint:Ye,Region:Ye},rules:[{conditions:[{fn:Qe,[s]:[Je]}],rules:[{conditions:[w],error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:g},{rules:[{conditions:[H],error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:g},{endpoint:{url:Je,properties:n,headers:n},type:d}],type:c}],type:c},{rules:[{conditions:[{fn:Qe,[s]:tt}],rules:[{conditions:[{fn:"aws.partition",[s]:tt,assign:_}],rules:[{conditions:[{fn:N,[s]:[b,"aws"]},S,v],endpoint:{url:"https://{Region}.signin.aws.amazon.com",properties:n,headers:n},type:d},{conditions:[{fn:N,[s]:[b,"aws-cn"]},S,v],endpoint:{url:"https://{Region}.signin.amazonaws.cn",properties:n,headers:n},type:d},{conditions:[{fn:N,[s]:[b,"aws-us-gov"]},S,v],endpoint:{url:"https://{Region}.signin.amazonaws-us-gov.com",properties:n,headers:n},type:d},{conditions:[w,H],rules:[{conditions:[{fn:h,[s]:[!0,Ze]},et],rules:[{endpoint:{url:"https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:d}],type:c},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:g}],type:c},{conditions:[w,v],rules:[{conditions:[{fn:h,[s]:[Ze,!0]}],rules:[{endpoint:{url:"https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:d}],type:c},{error:"FIPS is enabled but this partition does not support FIPS",type:g}],type:c},{conditions:[S,H],rules:[{conditions:[et],rules:[{endpoint:{url:"https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:d}],type:c},{error:"DualStack is enabled but this partition does not support DualStack",type:g}],type:c},{endpoint:{url:"https://signin.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:d}],type:c}],type:c},{error:"Invalid Configuration: Missing Region",type:g}],type:c}]},ot=wt;var Ht=new ne({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),nt=(e,t={})=>Ht.get(e,()=>ie(ot,{endpointParams:e,logger:t.logger}));se.aws=ae;var u=class e extends ge{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};var x=class e extends u{name="AccessDeniedException";$fault="client";error;constructor(t){super({name:"AccessDeniedException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error}},A=class e extends u{name="InternalServerException";$fault="server";error;constructor(t){super({name:"InternalServerException",$fault:"server",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error}},P=class e extends u{name="TooManyRequestsError";$fault="client";error;constructor(t){super({name:"TooManyRequestsError",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error}},I=class e extends u{name="ValidationException";$fault="client";error;constructor(t){super({name:"ValidationException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error}};var bt="AccessDeniedException",Ut="AccessToken",Ft="CreateOAuth2Token",$t="CreateOAuth2TokenRequest",Mt="CreateOAuth2TokenRequestBody",Vt="CreateOAuth2TokenResponseBody",qt="CreateOAuth2TokenResponse",Lt="InternalServerException",jt="RefreshToken",Bt="TooManyRequestsError",Gt="ValidationException",st="accessKeyId",it="accessToken",U="client",at="clientId",pt="codeVerifier",zt="code",l="error",ct="expiresIn",ut="grantType",Kt="http",F="httpError",mt="idToken",i="jsonName",R="message",C="refreshToken",dt="redirectUri",ft="smithy.ts.sdk.synthetic.com.amazonaws.signin",lt="secretAccessKey",ht="sessionToken",Xt="server",Qt="tokenInput",Wt="tokenOutput",gt="tokenType",p="com.amazonaws.signin",Et=D.for(ft),Yt=[-3,ft,"SigninServiceException",0,[],[]];Et.registerError(Yt,u);var f=D.for(p),Jt=[-3,p,bt,{[l]:U},[l,R],[0,0],2];f.registerError(Jt,x);var Zt=[-3,p,Lt,{[l]:Xt,[F]:500},[l,R],[0,0],2];f.registerError(Zt,A);var er=[-3,p,Bt,{[l]:U,[F]:429},[l,R],[0,0],2];f.registerError(er,P);var tr=[-3,p,Gt,{[l]:U,[F]:400},[l,R],[0,0],2];f.registerError(tr,I);var St=[Et,f],vt=[0,p,jt,8,0],rr=[3,p,Ut,8,[st,lt,ht],[[0,{[i]:st}],[0,{[i]:lt}],[0,{[i]:ht}]],3],or=[3,p,$t,0,[Qt],[[()=>nr,16]],1],nr=[3,p,Mt,0,[at,ut,zt,dt,pt,C],[[0,{[i]:at}],[0,{[i]:ut}],0,[0,{[i]:dt}],[0,{[i]:pt}],[()=>vt,{[i]:C}]],2],sr=[3,p,qt,0,[Wt],[[()=>ir,16]],1],ir=[3,p,Vt,0,[it,gt,ct,C,mt],[[()=>rr,{[i]:it}],[0,{[i]:gt}],[1,{[i]:ct}],[()=>vt,{[i]:C}],[0,{[i]:mt}]],4],_t=[9,p,Ft,{[Kt]:["POST","/v1/token",200]},()=>or,()=>sr];var xt=e=>({apiVersion:"2023-01-01",base64Decoder:e?.base64Decoder??K,base64Encoder:e?.base64Encoder??W,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??nt,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Ge,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new ce},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new re}],logger:e?.logger??new _e,protocol:e?.protocol??xe,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:St,version:"2023-01-01",serviceTarget:"Signin"},serviceId:e?.serviceId??"Signin",urlParser:e?.urlParser??Z,utf8Decoder:e?.utf8Decoder??X,utf8Encoder:e?.utf8Encoder??Q});var At=e=>{Ee(process.version);let t=qe(e),r=()=>t().then(fe),a=xt(e);pe(process.version);let o={profile:e?.profile,logger:a.logger};return{...a,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??m(ue,o),bodyLengthChecker:e?.bodyLengthChecker??Ve,defaultUserAgentProvider:e?.defaultUserAgentProvider??Fe({serviceId:a.serviceId,clientVersion:Ue.version}),maxAttempts:e?.maxAttempts??m(Ne,e),region:e?.region??m(Re,{...ye,...o}),requestHandler:Y.create(e?.requestHandler??r),retryMode:e?.retryMode??m({...He,default:async()=>(await r()).retryMode||Ae},e),sha256:e?.sha256??Me.bind(null,"sha256"),streamCollector:e?.streamCollector??J,useDualstackEndpoint:e?.useDualstackEndpoint??m(Ie,o),useFipsEndpoint:e?.useFipsEndpoint??m(Ce,o),userAgentAppId:e?.userAgentAppId??m($e,o)}};var Pt=e=>{let t=e.httpAuthSchemes,r=e.httpAuthSchemeProvider,a=e.credentials;return{setHttpAuthScheme(o){let E=t.findIndex(T=>T.schemeId===o.schemeId);E===-1?t.push(o):t.splice(E,1,o)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(o){r=o},httpAuthSchemeProvider(){return r},setCredentials(o){a=o},credentials(){return a}}},It=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()});var Ct=(e,t)=>{let r=Object.assign(Le(e),Se(e),M(e),Pt(e));return t.forEach(a=>a.configure(r)),Object.assign(e,je(r),ve(r),V(r),It(r))};var y=class extends de{config;constructor(...[t]){let r=At(t||{});super(r),this.initConfig=r;let a=Ke(r),o=oe(a),E=we(o),T=Oe(E),Rt=T,yt=De(Rt),Ot=ze(yt),Tt=Ct(Ot,t?.extensions||[]);this.config=Tt,this.middlewareStack.use(ee(this.config)),this.middlewareStack.use(Pe(this.config)),this.middlewareStack.use(be(this.config)),this.middlewareStack.use(Te(this.config)),this.middlewareStack.use(q(this.config)),this.middlewareStack.use(L(this.config)),this.middlewareStack.use(j(this.config)),this.middlewareStack.use(G(this.config,{httpAuthSchemeParametersProvider:Be,identityProviderConfigProvider:async kt=>new te({"aws.auth#sigv4":kt.credentials})})),this.middlewareStack.use(z(this.config))}destroy(){super.destroy()}};var O=class extends le.classBuilder().ep(Xe).m(function(t,r,a,o){return[ke(a,t.getEndpointParameterInstructions())]}).s("Signin","CreateOAuth2Token",{}).n("SigninClient","CreateOAuth2TokenCommand").sc(_t).build(){};var ar={CreateOAuth2TokenCommand:O},$=class extends y{};he(ar,$);var ko={AUTHCODE_EXPIRED:"AUTHCODE_EXPIRED",INSUFFICIENT_PERMISSIONS:"INSUFFICIENT_PERMISSIONS",INVALID_REQUEST:"INVALID_REQUEST",SERVER_ERROR:"server_error",TOKEN_EXPIRED:"TOKEN_EXPIRED",USER_CREDENTIALS_CHANGED:"USER_CREDENTIALS_CHANGED"};export{le as $Command,x as AccessDeniedException,Jt as AccessDeniedException$,rr as AccessToken$,_t as CreateOAuth2Token$,O as CreateOAuth2TokenCommand,or as CreateOAuth2TokenRequest$,nr as CreateOAuth2TokenRequestBody$,sr as CreateOAuth2TokenResponse$,ir as CreateOAuth2TokenResponseBody$,A as InternalServerException,Zt as InternalServerException$,ko as OAuth2ErrorCode,$ as Signin,y as SigninClient,u as SigninServiceException,Yt as SigninServiceException$,P as TooManyRequestsError,er as TooManyRequestsError$,I as ValidationException,tr as ValidationException$,de as __Client,St as errorTypeRegistries};
@@ -1 +0,0 @@
1
- import{a as x}from"./chunk-A2KGYHAM.js";import{a as e}from"./chunk-B5RLHF2U.js";import{a as v}from"./chunk-LDOHSEAR.js";import{a as y,b as l,c as u,d as f,e as g,f as m,g as S}from"./chunk-RR5R4AKJ.js";import{a as p}from"./chunk-SDX64WW4.js";import"./chunk-4NVBWJ2Q.js";import"./chunk-7HOF72FC.js";import"./chunk-YR32FZAX.js";import"./chunk-J7NVVT5I.js";import"./chunk-PXU2OOBT.js";import"./chunk-DIXI4M5O.js";import"./chunk-FGJ5K4WM.js";import"./chunk-7DCGNQSQ.js";import"./chunk-XSSPJU77.js";import"./chunk-QEIMNOY2.js";import"./chunk-QMKVUKS6.js";import"./chunk-EXLRPVEX.js";import"./chunk-FSRPMVAS.js";var o=null;function V(){if(process.env.AWS_KMS_KEY_ID||process.env.AWS_KMS_KEY_ARN)return"aws-kms";if(process.env.VAULT_LOCAL_MASTER_KEY||process.env.VAULT_MASTER_KEY)return"local";throw new Error("No vault provider detected. Set AWS_KMS_KEY_ID/AWS_KMS_KEY_ARN (for AWS KMS) or VAULT_LOCAL_MASTER_KEY/VAULT_MASTER_KEY (for local). Or pass explicit config to createVault().")}async function d(n){let r=n?.provider??process.env.VAULT_PROVIDER??V();switch(p.info("[vault] Creating provider",{provider:r}),r){case"aws-kms":{let{AWSKMSProvider:i}=await import("./aws-kms-ZX6CTY62.js"),t=n;return new i({provider:"aws-kms",...t?.keyId!==void 0?{keyId:t.keyId}:{},...t?.region!==void 0?{region:t.region}:{},...t?.credentials!==void 0?{credentials:t.credentials}:{},...t?.keyVersion!==void 0?{keyVersion:t.keyVersion}:{}})}case"local":{let{LocalProvider:i}=await import("./local-WW37QOXE.js"),t=n;return new i({provider:"local",...t?.masterKey!==void 0?{masterKey:t.masterKey}:{},...t?.salt!==void 0?{salt:t.salt}:{},...t?.keyVersion!==void 0?{keyVersion:t.keyVersion}:{}})}default:throw new Error(`Unknown vault provider: ${r}`)}}async function s(){return o||(o=await d()),o}function E(n){o=n}async function k(){o&&(await o.close(),o=null)}async function P(n,r={}){let i=JSON.stringify(n);if(i===void 0)throw new Error("[vault] Cannot encrypt undefined \u2014 value must be JSON-serializable");let t=await s(),c=r.context?.tenantId,a=r.context?.kind;return t.encrypt(i,{...r.id!==void 0?{id:r.id}:{},...c!==void 0?{tenantId:c}:{},metadata:{name:a??"json",type:"credential"}})}async function A(n,r={}){let i=await s(),t=r.context?.tenantId,c=await i.decrypt(n,t!==void 0?{tenantId:t}:void 0);try{return JSON.parse(c)}catch(a){throw new Error(`[vault] decryptJSON: failed to parse decrypted payload as JSON: ${a instanceof Error?a.message:String(a)}`)}}function O(n){if(!n||typeof n!="object")return!1;let r=n;return typeof r.ciphertext=="string"&&typeof r.encryptedDek=="string"&&typeof r.iv=="string"&&typeof r.authTag=="string"&&typeof r.keyVersion=="number"&&r.algorithm==="aes-256-gcm"}var _=e.object({id:e.string(),ciphertext:e.string(),encryptedDek:e.string(),iv:e.string(),authTag:e.string(),dekIv:e.string().optional(),dekAuthTag:e.string().optional(),keyVersion:e.number().int().min(1),algorithm:e.literal("aes-256-gcm"),tenantId:e.string().optional(),metadata:e.object({name:e.string(),type:e.enum(["api_key","oauth_token","credential","certificate","generic"]),expiresAt:e.string().datetime().optional()}).optional(),createdAt:e.string().datetime(),rotatedAt:e.string().datetime().optional()}),w=e.object({id:e.string(),name:e.string(),tenantId:e.string().optional(),type:e.enum(["api_key","oauth_token","credential","certificate","generic"]),createdAt:e.string().datetime(),rotatedAt:e.string().datetime().optional(),expiresAt:e.string().datetime().optional()});export{v as AWSKMSProvider,_ as EncryptedSecretSchema,x as LocalProvider,w as SecretMetadataSchema,l as aesDecrypt,y as aesEncrypt,k as closeVault,d as createVault,A as decryptJSON,u as deriveKey,P as encryptJSON,S as fromBase64,g as generateIv,f as generateKey,s as getVault,O as isEncryptedSecret,E as setVault,m as toBase64};
@@ -1 +0,0 @@
1
- import{a as ve}from"./chunk-NK255JZN.js";import{a as he}from"./chunk-OJM5Y4UT.js";import{d as re,e as Ue}from"./chunk-A75AMTOI.js";import"./chunk-YR32FZAX.js";import{$ as be,A as pe,B as ce,C as ae,D as de,E as ue,F as le,G as me,H as fe,I as ge,J as Ee,K as xe,L as Se,M as _e,Q as Ie,R as Pe,S as Ce,T as Oe,U as ye,V as Ae,W as De,X as Te,Y as Re,Z as ke,_ as we,a as M,aa as Ne,b as G,ba as $e,c as j,ca as He,d as K,da as Fe,e as V,ea as Me,f as q,fa as Ge,g as N,ga as je,h as z,ha as Ke,i as L,ia as Ve,l as ee,o as $,v as te,w as oe,x as ne,y as ie,z as se}from"./chunk-J7NVVT5I.js";import{a as Z,c as f}from"./chunk-PXU2OOBT.js";import"./chunk-DIXI4M5O.js";import"./chunk-FGJ5K4WM.js";import"./chunk-7VJYOZUP.js";import{b as B,c as J,e as X,f as Q}from"./chunk-7DCGNQSQ.js";import"./chunk-XSSPJU77.js";import{d as Y,e as W}from"./chunk-QEIMNOY2.js";import"./chunk-QMKVUKS6.js";import"./chunk-EXLRPVEX.js";import"./chunk-FSRPMVAS.js";var qe=async(e,t,n)=>({operation:q(t).operation,region:await N(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function At(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(t,n)=>({signingProperties:{config:t,context:n}})}}function Dt(e){return{schemeId:"smithy.api#noAuth"}}var ze=e=>{let t=[];return e.operation==="CreateToken"?t.push(Dt(e)):t.push(At(e)),t},Le=e=>{let t=ue(e);return Object.assign(t,{authSchemePreference:N(e.authSchemePreference??[])})};var Be=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),Ye={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var nt="required";var a="argv";var We="isSet",x="booleanEquals",g="error",E="endpoint",h="tree",U="PartitionResult",H="getAttr",Je={[nt]:!1,type:"string"},Xe={[nt]:!0,default:!1,type:"boolean"},Qe={ref:"Endpoint"},it={fn:x,[a]:[{ref:"UseFIPS"},!0]},st={fn:x,[a]:[{ref:"UseDualStack"},!0]},c={},Ze={fn:H,[a]:[{ref:U},"supportsFIPS"]},pt={ref:U},et={fn:x,[a]:[!0,{fn:H,[a]:[pt,"supportsDualStack"]}]},tt=[it],rt=[st],ot=[{ref:"Region"}],Tt={version:"1.0",parameters:{Region:Je,UseDualStack:Xe,UseFIPS:Xe,Endpoint:Je},rules:[{conditions:[{fn:We,[a]:[Qe]}],rules:[{conditions:tt,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:g},{conditions:rt,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:g},{endpoint:{url:Qe,properties:c,headers:c},type:E}],type:h},{conditions:[{fn:We,[a]:ot}],rules:[{conditions:[{fn:"aws.partition",[a]:ot,assign:U}],rules:[{conditions:[it,st],rules:[{conditions:[{fn:x,[a]:[!0,Ze]},et],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:c,headers:c},type:E}],type:h},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:g}],type:h},{conditions:tt,rules:[{conditions:[{fn:x,[a]:[Ze,!0]}],rules:[{conditions:[{fn:"stringEquals",[a]:[{fn:H,[a]:[pt,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:c,headers:c},type:E},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:c,headers:c},type:E}],type:h},{error:"FIPS is enabled but this partition does not support FIPS",type:g}],type:h},{conditions:rt,rules:[{conditions:[et],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:c,headers:c},type:E}],type:h},{error:"DualStack is enabled but this partition does not support DualStack",type:g}],type:h},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:c,headers:c},type:E}],type:h}],type:h},{error:"Invalid Configuration: Missing Region",type:g}]},ct=Tt;var Rt=new ne({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),at=(e,t={})=>Rt.get(e,()=>se(ct,{endpointParams:e,logger:t.logger}));ie.aws=pe;var i=class e extends fe{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};var _=class e extends i{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(t){super({name:"AccessDeniedException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.reason=t.reason,this.error_description=t.error_description}},v=class e extends i{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(t){super({name:"AuthorizationPendingException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},I=class e extends i{name="ExpiredTokenException";$fault="client";error;error_description;constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},P=class e extends i{name="InternalServerException";$fault="server";error;error_description;constructor(t){super({name:"InternalServerException",$fault:"server",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},C=class e extends i{name="InvalidClientException";$fault="client";error;error_description;constructor(t){super({name:"InvalidClientException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},O=class e extends i{name="InvalidGrantException";$fault="client";error;error_description;constructor(t){super({name:"InvalidGrantException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},y=class e extends i{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(t){super({name:"InvalidRequestException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.reason=t.reason,this.error_description=t.error_description}},A=class e extends i{name="InvalidScopeException";$fault="client";error;error_description;constructor(t){super({name:"InvalidScopeException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},D=class e extends i{name="SlowDownException";$fault="client";error;error_description;constructor(t){super({name:"SlowDownException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},T=class e extends i{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(t){super({name:"UnauthorizedClientException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},R=class e extends i{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(t){super({name:"UnsupportedGrantTypeException",$fault:"client",...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}};var kt="AccessDeniedException",wt="AuthorizationPendingException",bt="AccessToken",Nt="ClientSecret",$t="CreateToken",Ut="CreateTokenRequest",Ht="CreateTokenResponse",Ft="CodeVerifier",Mt="ExpiredTokenException",Gt="InvalidClientException",jt="InvalidGrantException",Kt="InvalidRequestException",Vt="InternalServerException",qt="InvalidScopeException",zt="IdToken",Lt="RefreshToken",Bt="SlowDownException",Yt="UnauthorizedClientException",Wt="UnsupportedGrantTypeException",Jt="accessToken",m="client",Xt="clientId",Qt="clientSecret",Zt="codeVerifier",er="code",tr="deviceCode",r="error",rr="expiresIn",u="error_description",or="grantType",nr="http",l="httpError",ir="idToken",dt="reason",ut="refreshToken",sr="redirectUri",lt="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",pr="scope",cr="server",ar="tokenType",o="com.amazonaws.ssooidc",mt=$.for(lt),dr=[-3,lt,"SSOOIDCServiceException",0,[],[]];mt.registerError(dr,i);var d=$.for(o),ur=[-3,o,kt,{[r]:m,[l]:400},[r,dt,u],[0,0,0]];d.registerError(ur,_);var lr=[-3,o,wt,{[r]:m,[l]:400},[r,u],[0,0]];d.registerError(lr,v);var mr=[-3,o,Mt,{[r]:m,[l]:400},[r,u],[0,0]];d.registerError(mr,I);var hr=[-3,o,Vt,{[r]:cr,[l]:500},[r,u],[0,0]];d.registerError(hr,P);var fr=[-3,o,Gt,{[r]:m,[l]:401},[r,u],[0,0]];d.registerError(fr,C);var gr=[-3,o,jt,{[r]:m,[l]:400},[r,u],[0,0]];d.registerError(gr,O);var Er=[-3,o,Kt,{[r]:m,[l]:400},[r,dt,u],[0,0,0]];d.registerError(Er,y);var xr=[-3,o,qt,{[r]:m,[l]:400},[r,u],[0,0]];d.registerError(xr,A);var Sr=[-3,o,Bt,{[r]:m,[l]:400},[r,u],[0,0]];d.registerError(Sr,D);var _r=[-3,o,Yt,{[r]:m,[l]:400},[r,u],[0,0]];d.registerError(_r,T);var vr=[-3,o,Wt,{[r]:m,[l]:400},[r,u],[0,0]];d.registerError(vr,R);var ht=[mt,d],Ir=[0,o,bt,8,0],Pr=[0,o,Nt,8,0],Cr=[0,o,Ft,8,0],Or=[0,o,zt,8,0],ft=[0,o,Lt,8,0],yr=[3,o,Ut,0,[Xt,Qt,or,tr,er,ut,pr,sr,Zt],[0,[()=>Pr,0],0,0,0,[()=>ft,0],64,0,[()=>Cr,0]],3],Ar=[3,o,Ht,0,[Jt,ar,rr,ut,ir],[[()=>Ir,0],0,1,[()=>ft,0],[()=>Or,0]]];var gt=[9,o,$t,{[nr]:["POST","/token",200]},()=>yr,()=>Ar];var Et=e=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??B,base64Encoder:e?.base64Encoder??J,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??at,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??ze,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new ae},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new re}],logger:e?.logger??new _e,protocol:e?.protocol??ve,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:ht,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??Z,utf8Decoder:e?.utf8Decoder??Y,utf8Encoder:e?.utf8Encoder??W});var xt=e=>{Ee(process.version);let t=je(e),n=()=>t().then(ge),p=Et(e);ce(process.version);let s={profile:e?.profile,logger:p.logger};return{...p,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??f(de,s),bodyLengthChecker:e?.bodyLengthChecker??Ge,defaultUserAgentProvider:e?.defaultUserAgentProvider??He({serviceId:p.serviceId,clientVersion:Ue.version}),maxAttempts:e?.maxAttempts??f(we,e),region:e?.region??f(ye,{...Ae,...s}),requestHandler:X.create(e?.requestHandler??n),retryMode:e?.retryMode??f({...Ne,default:async()=>(await n()).retryMode||Ie},e),sha256:e?.sha256??Me.bind(null,"sha256"),streamCollector:e?.streamCollector??Q,useDualstackEndpoint:e?.useDualstackEndpoint??f(Ce,s),useFipsEndpoint:e?.useFipsEndpoint??f(Oe,s),userAgentAppId:e?.userAgentAppId??f(Fe,s)}};var St=e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,p=e.credentials;return{setHttpAuthScheme(s){let S=t.findIndex(b=>b.schemeId===s.schemeId);S===-1?t.push(s):t.splice(S,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){n=s},httpAuthSchemeProvider(){return n},setCredentials(s){p=s},credentials(){return p}}},_t=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()});var vt=(e,t)=>{let n=Object.assign(Ke(e),xe(e),M(e),St(e));return t.forEach(p=>p.configure(n)),Object.assign(e,Ve(n),Se(n),G(n),_t(n))};var k=class extends le{config;constructor(...[t]){let n=xt(t||{});super(n),this.initConfig=n;let p=Be(n),s=oe(p),S=be(s),b=De(S),It=b,Pt=ke(It),Ct=Le(Pt),Ot=vt(Ct,t?.extensions||[]);this.config=Ot,this.middlewareStack.use(ee(this.config)),this.middlewareStack.use(Pe(this.config)),this.middlewareStack.use($e(this.config)),this.middlewareStack.use(Te(this.config)),this.middlewareStack.use(j(this.config)),this.middlewareStack.use(K(this.config)),this.middlewareStack.use(V(this.config)),this.middlewareStack.use(z(this.config,{httpAuthSchemeParametersProvider:qe,identityProviderConfigProvider:async yt=>new te({"aws.auth#sigv4":yt.credentials})})),this.middlewareStack.use(L(this.config))}destroy(){super.destroy()}};var w=class extends me.classBuilder().ep(Ye).m(function(t,n,p,s){return[Re(p,t.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").sc(gt).build(){};var Dr={CreateTokenCommand:w},F=class extends k{};he(Dr,F);var Xo={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},Qo={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"};export{me as $Command,_ as AccessDeniedException,ur as AccessDeniedException$,Xo as AccessDeniedExceptionReason,v as AuthorizationPendingException,lr as AuthorizationPendingException$,gt as CreateToken$,w as CreateTokenCommand,yr as CreateTokenRequest$,Ar as CreateTokenResponse$,I as ExpiredTokenException,mr as ExpiredTokenException$,P as InternalServerException,hr as InternalServerException$,C as InvalidClientException,fr as InvalidClientException$,O as InvalidGrantException,gr as InvalidGrantException$,y as InvalidRequestException,Er as InvalidRequestException$,Qo as InvalidRequestExceptionReason,A as InvalidScopeException,xr as InvalidScopeException$,F as SSOOIDC,k as SSOOIDCClient,i as SSOOIDCServiceException,dr as SSOOIDCServiceException$,D as SlowDownException,Sr as SlowDownException$,T as UnauthorizedClientException,_r as UnauthorizedClientException$,R as UnsupportedGrantTypeException,vr as UnsupportedGrantTypeException$,le as __Client,ht as errorTypeRegistries};
@@ -1,6 +0,0 @@
1
- import{a as ht}from"./chunk-4NVBWJ2Q.js";import{a as Ct}from"./chunk-OJM5Y4UT.js";import{a as Oe,c as mt,d as ie,e as qt}from"./chunk-A75AMTOI.js";import{$ as Kt,A as Nt,B as xt,C as ce,D as Tt,E as Pt,F as It,G as le,H as At,I as _t,J as Rt,K as vt,L as Ot,M as kt,N as $t,O as ue,P as Mt,Q as Ft,R as Vt,S as Lt,T as Ht,U as de,V as fe,W as Wt,X as Ut,Y as pe,Z as jt,_ as zt,a as Xe,aa as Bt,b as Je,ba as Gt,c as Ze,ca as Yt,d as De,da as Qt,e as et,ea as Xt,f as tt,fa as Jt,g as Re,ga as Zt,h as rt,ha as Dt,i as nt,ia as er,j as ve,k as ct,l as ut,n as $,o as ke,p as ft,r as pt,u as gt,v as Et,w as yt,x as St,y as wt,z as bt}from"./chunk-J7NVVT5I.js";import{a as lt,c as R}from"./chunk-PXU2OOBT.js";import"./chunk-DIXI4M5O.js";import"./chunk-FGJ5K4WM.js";import{b as st,c as oe,e as it,f as at,i as dt}from"./chunk-7DCGNQSQ.js";import"./chunk-XSSPJU77.js";import{d as ot,e as se}from"./chunk-QEIMNOY2.js";import{a as ae}from"./chunk-QMKVUKS6.js";import"./chunk-EXLRPVEX.js";import"./chunk-FSRPMVAS.js";var $e=r=>{let e="#text";for(let t in r)r.hasOwnProperty(t)&&r[t][e]!==void 0?r[t]=r[t][e]:typeof r[t]=="object"&&r[t]!==null&&(r[t]=$e(r[t]));return r};var tr=":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",fn=tr+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",pn="["+tr+"]["+fn+"]*",hn=new RegExp("^"+pn+"$");function he(r,e){let t=[],n=e.exec(r);for(;n;){let o=[];o.startIndex=e.lastIndex-n[0].length;let s=n.length;for(let c=0;c<s;c++)o.push(n[c]);t.push(o),n=e.exec(r)}return t}var q=function(r){let e=hn.exec(r);return!(e===null||typeof e>"u")};function rr(r){return typeof r<"u"}var D=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],ge=["__proto__","constructor","prototype"];var gn={allowBooleanAttributes:!1,unpairedTags:[]};function ar(r,e){e=Object.assign({},gn,e);let t=[],n=!1,o=!1;r[0]==="\uFEFF"&&(r=r.substr(1));for(let s=0;s<r.length;s++)if(r[s]==="<"&&r[s+1]==="?"){if(s+=2,s=sr(r,s),s.err)return s}else if(r[s]==="<"){let c=s;if(s++,r[s]==="!"){s=or(r,s);continue}else{let a=!1;r[s]==="/"&&(a=!0,s++);let i="";for(;s<r.length&&r[s]!==">"&&r[s]!==" "&&r[s]!==" "&&r[s]!==`
2
- `&&r[s]!=="\r";s++)i+=r[s];if(i=i.trim(),i[i.length-1]==="/"&&(i=i.substring(0,i.length-1),s--),!xn(i)){let d;return i.trim().length===0?d="Invalid space after '<'.":d="Tag '"+i+"' is an invalid name.",y("InvalidTag",d,T(r,s))}let u=yn(r,s);if(u===!1)return y("InvalidAttr","Attributes for '"+i+"' have open quote.",T(r,s));let l=u.value;if(s=u.index,l[l.length-1]==="/"){let d=s-l.length;l=l.substring(0,l.length-1);let p=ir(l,e);if(p===!0)n=!0;else return y(p.err.code,p.err.msg,T(r,d+p.err.line))}else if(a)if(u.tagClosed){if(l.trim().length>0)return y("InvalidTag","Closing tag '"+i+"' can't have attributes or invalid starting.",T(r,c));if(t.length===0)return y("InvalidTag","Closing tag '"+i+"' has not been opened.",T(r,c));{let d=t.pop();if(i!==d.tagName){let p=T(r,d.tagStartPos);return y("InvalidTag","Expected closing tag '"+d.tagName+"' (opened in line "+p.line+", col "+p.col+") instead of closing tag '"+i+"'.",T(r,c))}t.length==0&&(o=!0)}}else return y("InvalidTag","Closing tag '"+i+"' doesn't have proper closing.",T(r,s));else{let d=ir(l,e);if(d!==!0)return y(d.err.code,d.err.msg,T(r,s-l.length+d.err.line));if(o===!0)return y("InvalidXml","Multiple possible root nodes found.",T(r,s));e.unpairedTags.indexOf(i)!==-1||t.push({tagName:i,tagStartPos:c}),n=!0}for(s++;s<r.length;s++)if(r[s]==="<")if(r[s+1]==="!"){s++,s=or(r,s);continue}else if(r[s+1]==="?"){if(s=sr(r,++s),s.err)return s}else break;else if(r[s]==="&"){let d=bn(r,s);if(d==-1)return y("InvalidChar","char '&' is not expected.",T(r,s));s=d}else if(o===!0&&!nr(r[s]))return y("InvalidXml","Extra text at the end",T(r,s));r[s]==="<"&&s--}}else{if(nr(r[s]))continue;return y("InvalidChar","char '"+r[s]+"' is not expected.",T(r,s))}if(n){if(t.length==1)return y("InvalidTag","Unclosed tag '"+t[0].tagName+"'.",T(r,t[0].tagStartPos));if(t.length>0)return y("InvalidXml","Invalid '"+JSON.stringify(t.map(s=>s.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return y("InvalidXml","Start tag expected.",1);return!0}function nr(r){return r===" "||r===" "||r===`
3
- `||r==="\r"}function sr(r,e){let t=e;for(;e<r.length;e++)if(r[e]=="?"||r[e]==" "){let n=r.substr(t,e-t);if(e>5&&n==="xml")return y("InvalidXml","XML declaration allowed only at the start of the document.",T(r,e));if(r[e]=="?"&&r[e+1]==">"){e++;break}else continue}return e}function or(r,e){if(r.length>e+5&&r[e+1]==="-"&&r[e+2]==="-"){for(e+=3;e<r.length;e++)if(r[e]==="-"&&r[e+1]==="-"&&r[e+2]===">"){e+=2;break}}else if(r.length>e+8&&r[e+1]==="D"&&r[e+2]==="O"&&r[e+3]==="C"&&r[e+4]==="T"&&r[e+5]==="Y"&&r[e+6]==="P"&&r[e+7]==="E"){let t=1;for(e+=8;e<r.length;e++)if(r[e]==="<")t++;else if(r[e]===">"&&(t--,t===0))break}else if(r.length>e+9&&r[e+1]==="["&&r[e+2]==="C"&&r[e+3]==="D"&&r[e+4]==="A"&&r[e+5]==="T"&&r[e+6]==="A"&&r[e+7]==="["){for(e+=8;e<r.length;e++)if(r[e]==="]"&&r[e+1]==="]"&&r[e+2]===">"){e+=2;break}}return e}var mn='"',En="'";function yn(r,e){let t="",n="",o=!1;for(;e<r.length;e++){if(r[e]===mn||r[e]===En)n===""?n=r[e]:n!==r[e]||(n="");else if(r[e]===">"&&n===""){o=!0;break}t+=r[e]}return n!==""?!1:{value:t,index:e,tagClosed:o}}var Sn=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function ir(r,e){let t=he(r,Sn),n={};for(let o=0;o<t.length;o++){if(t[o][1].length===0)return y("InvalidAttr","Attribute '"+t[o][2]+"' has no space in starting.",ee(t[o]));if(t[o][3]!==void 0&&t[o][4]===void 0)return y("InvalidAttr","Attribute '"+t[o][2]+"' is without value.",ee(t[o]));if(t[o][3]===void 0&&!e.allowBooleanAttributes)return y("InvalidAttr","boolean attribute '"+t[o][2]+"' is not allowed.",ee(t[o]));let s=t[o][2];if(!Nn(s))return y("InvalidAttr","Attribute '"+s+"' is an invalid name.",ee(t[o]));if(!Object.prototype.hasOwnProperty.call(n,s))n[s]=1;else return y("InvalidAttr","Attribute '"+s+"' is repeated.",ee(t[o]))}return!0}function wn(r,e){let t=/\d/;for(r[e]==="x"&&(e++,t=/[\da-fA-F]/);e<r.length;e++){if(r[e]===";")return e;if(!r[e].match(t))break}return-1}function bn(r,e){if(e++,r[e]===";")return-1;if(r[e]==="#")return e++,wn(r,e);let t=0;for(;e<r.length;e++,t++)if(!(r[e].match(/\w/)&&t<20)){if(r[e]===";")break;return-1}return e}function y(r,e,t){return{err:{code:r,msg:e,line:t.line||t,col:t.col}}}function Nn(r){return q(r)}function xn(r){return q(r)}function T(r,e){let t=r.substring(0,e).split(/\r?\n/);return{line:t.length,col:t[t.length-1].length+1}}function ee(r){return r.startIndex+r[1].length}var cr=r=>D.includes(r)?"__"+r:r,Tn={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(r,e){return e},attributeValueProcessor:function(r,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,e,t){return r},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:cr};function Pn(r,e){if(typeof r!="string")return;let t=r.toLowerCase();if(D.some(n=>t===n.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${r}" is a reserved JavaScript keyword that could cause prototype pollution`);if(ge.some(n=>t===n.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${r}" is a reserved JavaScript keyword that could cause prototype pollution`)}function lr(r){return typeof r=="boolean"?{enabled:r,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,maxEntityCount:100,allowedTags:null,tagFilter:null}:typeof r=="object"&&r!==null?{enabled:r.enabled!==!1,maxEntitySize:r.maxEntitySize??1e4,maxExpansionDepth:r.maxExpansionDepth??10,maxTotalExpansions:r.maxTotalExpansions??1e3,maxExpandedLength:r.maxExpandedLength??1e5,maxEntityCount:r.maxEntityCount??100,allowedTags:r.allowedTags??null,tagFilter:r.tagFilter??null}:lr(!0)}var ur=function(r){let e=Object.assign({},Tn,r),t=[{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(let{value:n,name:o}of t)n&&Pn(n,o);return e.onDangerousProperty===null&&(e.onDangerousProperty=cr),e.processEntities=lr(e.processEntities),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(n=>typeof n=="string"&&n.startsWith("*.")?".."+n.substring(2):n)),e};var me;typeof Symbol!="function"?me="@@xmlMetadata":me=Symbol("XML Node Metadata");var I=class{constructor(e){this.tagname=e,this.child=[],this[":@"]=Object.create(null)}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e,t){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][me]={startIndex:t})}static getMetaDataSymbol(){return me}};var re=class{constructor(e){this.suppressValidationErr=!e,this.options=e}readDocType(e,t){let n=Object.create(null),o=0;if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let s=1,c=!1,a=!1,i="";for(;t<e.length;t++)if(e[t]==="<"&&!a){if(c&&L(e,"!ENTITY",t)){t+=7;let u,l;if([u,l,t]=this.readEntityExp(e,t+1,this.suppressValidationErr),l.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount&&o>=this.options.maxEntityCount)throw new Error(`Entity count (${o+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);let d=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n[u]={regx:RegExp(`&${d};`,"g"),val:l},o++}}else if(c&&L(e,"!ELEMENT",t)){t+=8;let{index:u}=this.readElementExp(e,t+1);t=u}else if(c&&L(e,"!ATTLIST",t))t+=8;else if(c&&L(e,"!NOTATION",t)){t+=9;let{index:u}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=u}else if(L(e,"!--",t))a=!0;else throw new Error("Invalid DOCTYPE");s++,i=""}else if(e[t]===">"){if(a?e[t-1]==="-"&&e[t-2]==="-"&&(a=!1,s--):s--,s===0)break}else e[t]==="["?c=!0:i+=e[t];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:n,i:t}}readEntityExp(e,t){t=C(e,t);let n="";for(;t<e.length&&!/\s/.test(e[t])&&e[t]!=='"'&&e[t]!=="'";)n+=e[t],t++;if(te(n),t=C(e,t),!this.suppressValidationErr){if(e.substring(t,t+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(e[t]==="%")throw new Error("Parameter entities are not supported")}let o="";if([t,o]=this.readIdentifierVal(e,t,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize&&o.length>this.options.maxEntitySize)throw new Error(`Entity "${n}" size (${o.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return t--,[n,o,t]}readNotationExp(e,t){t=C(e,t);let n="";for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;!this.suppressValidationErr&&te(n),t=C(e,t);let o=e.substring(t,t+6).toUpperCase();if(!this.suppressValidationErr&&o!=="SYSTEM"&&o!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${o}"`);t+=o.length,t=C(e,t);let s=null,c=null;if(o==="PUBLIC")[t,s]=this.readIdentifierVal(e,t,"publicIdentifier"),t=C(e,t),(e[t]==='"'||e[t]==="'")&&([t,c]=this.readIdentifierVal(e,t,"systemIdentifier"));else if(o==="SYSTEM"&&([t,c]=this.readIdentifierVal(e,t,"systemIdentifier"),!this.suppressValidationErr&&!c))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:n,publicIdentifier:s,systemIdentifier:c,index:--t}}readIdentifierVal(e,t,n){let o="",s=e[t];if(s!=='"'&&s!=="'")throw new Error(`Expected quoted string, found "${s}"`);for(t++;t<e.length&&e[t]!==s;)o+=e[t],t++;if(e[t]!==s)throw new Error(`Unterminated ${n} value`);return t++,[t,o]}readElementExp(e,t){t=C(e,t);let n="";for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;if(!this.suppressValidationErr&&!q(n))throw new Error(`Invalid element name: "${n}"`);t=C(e,t);let o="";if(e[t]==="E"&&L(e,"MPTY",t))t+=4;else if(e[t]==="A"&&L(e,"NY",t))t+=2;else if(e[t]==="("){for(t++;t<e.length&&e[t]!==")";)o+=e[t],t++;if(e[t]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:n,contentModel:o.trim(),index:t}}readAttlistExp(e,t){t=C(e,t);let n="";for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;te(n),t=C(e,t);let o="";for(;t<e.length&&!/\s/.test(e[t]);)o+=e[t],t++;if(!te(o))throw new Error(`Invalid attribute name: "${o}"`);t=C(e,t);let s="";if(e.substring(t,t+8).toUpperCase()==="NOTATION"){if(s="NOTATION",t+=8,t=C(e,t),e[t]!=="(")throw new Error(`Expected '(', found "${e[t]}"`);t++;let a=[];for(;t<e.length&&e[t]!==")";){let i="";for(;t<e.length&&e[t]!=="|"&&e[t]!==")";)i+=e[t],t++;if(i=i.trim(),!te(i))throw new Error(`Invalid notation name: "${i}"`);a.push(i),e[t]==="|"&&(t++,t=C(e,t))}if(e[t]!==")")throw new Error("Unterminated list of notations");t++,s+=" ("+a.join("|")+")"}else{for(;t<e.length&&!/\s/.test(e[t]);)s+=e[t],t++;let a=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!a.includes(s.toUpperCase()))throw new Error(`Invalid attribute type: "${s}"`)}t=C(e,t);let c="";return e.substring(t,t+8).toUpperCase()==="#REQUIRED"?(c="#REQUIRED",t+=8):e.substring(t,t+7).toUpperCase()==="#IMPLIED"?(c="#IMPLIED",t+=7):[t,c]=this.readIdentifierVal(e,t,"ATTLIST"),{elementName:n,attributeName:o,attributeType:s,defaultValue:c,index:t}}},C=(r,e)=>{for(;e<r.length&&/\s/.test(r[e]);)e++;return e};function L(r,e,t){for(let n=0;n<e.length;n++)if(e[n]!==r[t+n+1])return!1;return!0}function te(r){if(q(r))return r;throw new Error(`Invalid entity name ${r}`)}var In=/^[-+]?0x[a-fA-F0-9]+$/,Cn=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,An={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"};function Me(r,e={}){if(e=Object.assign({},An,e),!r||typeof r!="string")return r;let t=r.trim();if(e.skipLike!==void 0&&e.skipLike.test(t))return r;if(r==="0")return 0;if(e.hex&&In.test(t))return On(t,16);if(isFinite(t)){if(t.includes("e")||t.includes("E"))return Rn(r,t,e);{let n=Cn.exec(t);if(n){let o=n[1]||"",s=n[2],c=vn(n[3]),a=o?r[s.length+1]===".":r[s.length]===".";if(!e.leadingZeros&&(s.length>1||s.length===1&&!a))return r;{let i=Number(t),u=String(i);if(i===0)return i;if(u.search(/[eE]/)!==-1)return e.eNotation?i:r;if(t.indexOf(".")!==-1)return u==="0"||u===c||u===`${o}${c}`?i:r;let l=s?c:t;return s?l===u||o+l===u?i:r:l===u||l===o+u?i:r}}else return r}}else return kn(r,Number(t),e)}var _n=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Rn(r,e,t){if(!t.eNotation)return r;let n=e.match(_n);if(n){let o=n[1]||"",s=n[3].indexOf("e")===-1?"E":"e",c=n[2],a=o?r[c.length+1]===s:r[c.length]===s;return c.length>1&&a?r:c.length===1&&(n[3].startsWith(`.${s}`)||n[3][0]===s)?Number(e):t.leadingZeros&&!a?(e=(n[1]||"")+n[3],Number(e)):r}else return r}function vn(r){return r&&r.indexOf(".")!==-1&&(r=r.replace(/0+$/,""),r==="."?r="0":r[0]==="."?r="0"+r:r[r.length-1]==="."&&(r=r.substring(0,r.length-1))),r}function On(r,e){if(parseInt)return parseInt(r,e);if(Number.parseInt)return Number.parseInt(r,e);if(window&&window.parseInt)return window.parseInt(r,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function kn(r,e,t){let n=e===1/0;switch(t.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return n?"Infinity":"-Infinity";default:return r}}function Fe(r){return typeof r=="function"?r:Array.isArray(r)?e=>{for(let t of r)if(typeof t=="string"&&e===t||t instanceof RegExp&&t.test(e))return!0}:()=>!1}var H=class{constructor(e,t={}){this.pattern=e,this.separator=t.separator||".",this.segments=this._parse(e),this._hasDeepWildcard=this.segments.some(n=>n.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some(n=>n.attrName!==void 0),this._hasPositionSelector=this.segments.some(n=>n.position!==void 0)}_parse(e){let t=[],n=0,o="";for(;n<e.length;)e[n]===this.separator?n+1<e.length&&e[n+1]===this.separator?(o.trim()&&(t.push(this._parseSegment(o.trim())),o=""),t.push({type:"deep-wildcard"}),n+=2):(o.trim()&&t.push(this._parseSegment(o.trim())),o="",n++):(o+=e[n],n++);return o.trim()&&t.push(this._parseSegment(o.trim())),t}_parseSegment(e){let t={type:"tag"},n=null,o=e,s=e.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(s&&(o=s[1]+s[3],s[2])){let l=s[2].slice(1,-1);l&&(n=l)}let c,a=o;if(o.includes("::")){let l=o.indexOf("::");if(c=o.substring(0,l).trim(),a=o.substring(l+2).trim(),!c)throw new Error(`Invalid namespace in pattern: ${e}`)}let i,u=null;if(a.includes(":")){let l=a.lastIndexOf(":"),d=a.substring(0,l).trim(),p=a.substring(l+1).trim();["first","last","odd","even"].includes(p)||/^nth\(\d+\)$/.test(p)?(i=d,u=p):i=a}else i=a;if(!i)throw new Error(`Invalid segment pattern: ${e}`);if(t.tag=i,c&&(t.namespace=c),n)if(n.includes("=")){let l=n.indexOf("=");t.attrName=n.substring(0,l).trim(),t.attrValue=n.substring(l+1).trim()}else t.attrName=n.trim();if(u){let l=u.match(/^nth\((\d+)\)$/);l?(t.position="nth",t.positionValue=parseInt(l[1],10)):t.position=u}return t}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}};var Y=class{constructor(e={}){this.separator=e.separator||".",this.path=[],this.siblingStacks=[]}push(e,t=null,n=null){if(this.path.length>0){let l=this.path[this.path.length-1];l.values=void 0}let o=this.path.length;this.siblingStacks[o]||(this.siblingStacks[o]=new Map);let s=this.siblingStacks[o],c=n?`${n}:${e}`:e,a=s.get(c)||0,i=0;for(let l of s.values())i+=l;s.set(c,a+1);let u={tag:e,position:i,counter:a};n!=null&&(u.namespace=n),t!=null&&(u.values=t),this.path.push(u)}pop(){if(this.path.length===0)return;let e=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),e}updateCurrent(e){if(this.path.length>0){let t=this.path[this.path.length-1];e!=null&&(t.values=e)}}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(e){return this.path.length===0?void 0:this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;let t=this.path[this.path.length-1];return t.values!==void 0&&e in t.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,t=!0){let n=e||this.separator;return this.path.map(o=>t&&o.namespace?`${o.namespace}:${o.tag}`:o.tag).join(n)}toArray(){return this.path.map(e=>e.tag)}reset(){this.path=[],this.siblingStacks=[]}matches(e){let t=e.segments;return t.length===0?!1:e.hasDeepWildcard()?this._matchWithDeepWildcard(t):this._matchSimple(t)}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let t=0;t<e.length;t++){let n=e[t],o=this.path[t],s=t===this.path.length-1;if(!this._matchSegment(n,o,s))return!1}return!0}_matchWithDeepWildcard(e){let t=this.path.length-1,n=e.length-1;for(;n>=0&&t>=0;){let o=e[n];if(o.type==="deep-wildcard"){if(n--,n<0)return!0;let s=e[n],c=!1;for(let a=t;a>=0;a--){let i=a===this.path.length-1;if(this._matchSegment(s,this.path[a],i)){t=a-1,n--,c=!0;break}}if(!c)return!1}else{let s=t===this.path.length-1;if(!this._matchSegment(o,this.path[t],s))return!1;t--,n--}}return n<0}_matchSegment(e,t,n){if(e.tag!=="*"&&e.tag!==t.tag||e.namespace!==void 0&&e.namespace!=="*"&&e.namespace!==t.namespace)return!1;if(e.attrName!==void 0){if(!n||!t.values||!(e.attrName in t.values))return!1;if(e.attrValue!==void 0){let o=t.values[e.attrName];if(String(o)!==String(e.attrValue))return!1}}if(e.position!==void 0){if(!n)return!1;let o=t.counter??0;if(e.position==="first"&&o!==0)return!1;if(e.position==="odd"&&o%2!==1)return!1;if(e.position==="even"&&o%2!==0)return!1;if(e.position==="nth"&&o!==e.positionValue)return!1}return!0}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e))}}restore(e){this.path=e.path.map(t=>({...t})),this.siblingStacks=e.siblingStacks.map(t=>new Map(t))}};function $n(r,e){if(!r)return{};let t=e.attributesGroupName?r[e.attributesGroupName]:r;if(!t)return{};let n={};for(let o in t)if(o.startsWith(e.attributeNamePrefix)){let s=o.substring(e.attributeNamePrefix.length);n[s]=t[o]}else n[o]=t[o];return n}function Mn(r){if(!r||typeof r!="string")return;let e=r.indexOf(":");if(e!==-1&&e>0){let t=r.substring(0,e);if(t!=="xmlns")return t}}var ne=class{constructor(e){if(this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,n)=>dr(n,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,n)=>dr(n,16,"&#x")}},this.addExternalEntities=Fn,this.parseXml=Un,this.parseTextData=Vn,this.resolveNameSpace=Ln,this.buildAttributesMap=Wn,this.isItStopNode=Bn,this.replaceEntitiesValue=zn,this.readStopNodeData=qn,this.saveTextToParentTag=Kn,this.addChild=jn,this.ignoreAttributesFn=Fe(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.matcher=new Y,this.isCurrentNodeStopNode=!1,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodeExpressions=[];for(let t=0;t<this.options.stopNodes.length;t++){let n=this.options.stopNodes[t];typeof n=="string"?this.stopNodeExpressions.push(new H(n)):n instanceof H&&this.stopNodeExpressions.push(n)}}}};function Fn(r){let e=Object.keys(r);for(let t=0;t<e.length;t++){let n=e[t],o=n.replace(/[.\-+*:]/g,"\\.");this.lastEntities[n]={regex:new RegExp("&"+o+";","g"),val:r[n]}}}function Vn(r,e,t,n,o,s,c){if(r!==void 0&&(this.options.trimValues&&!n&&(r=r.trim()),r.length>0)){c||(r=this.replaceEntitiesValue(r,e,t));let a=this.options.jPath?t.toString():t,i=this.options.tagValueProcessor(e,r,a,o,s);return i==null?r:typeof i!=typeof r||i!==r?i:this.options.trimValues?He(r,this.options.parseTagValue,this.options.numberParseOptions):r.trim()===r?He(r,this.options.parseTagValue,this.options.numberParseOptions):r}}function Ln(r){if(this.options.removeNSPrefix){let e=r.split(":"),t=r.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(r=t+e[1])}return r}var Hn=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Wn(r,e,t){if(this.options.ignoreAttributes!==!0&&typeof r=="string"){let n=he(r,Hn),o=n.length,s={},c={};for(let a=0;a<o;a++){let i=this.resolveNameSpace(n[a][1]),u=n[a][4];if(i.length&&u!==void 0){let l=u;this.options.trimValues&&(l=l.trim()),l=this.replaceEntitiesValue(l,t,e),c[i]=l}}Object.keys(c).length>0&&typeof e=="object"&&e.updateCurrent&&e.updateCurrent(c);for(let a=0;a<o;a++){let i=this.resolveNameSpace(n[a][1]),u=this.options.jPath?e.toString():e;if(this.ignoreAttributesFn(i,u))continue;let l=n[a][4],d=this.options.attributeNamePrefix+i;if(i.length)if(this.options.transformAttributeName&&(d=this.options.transformAttributeName(d)),d=fr(d,this.options),l!==void 0){this.options.trimValues&&(l=l.trim()),l=this.replaceEntitiesValue(l,t,e);let p=this.options.jPath?e.toString():e,S=this.options.attributeValueProcessor(i,l,p);S==null?s[d]=l:typeof S!=typeof l||S!==l?s[d]=S:s[d]=He(l,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[d]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){let a={};return a[this.options.attributesGroupName]=s,a}return s}}var Un=function(r){r=r.replace(/\r\n?/g,`
4
- `);let e=new I("!xml"),t=e,n="";this.matcher.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let o=new re(this.options.processEntities);for(let s=0;s<r.length;s++)if(r[s]==="<")if(r[s+1]==="/"){let a=W(r,">",s,"Closing Tag is not closed."),i=r.substring(s+2,a).trim();if(this.options.removeNSPrefix){let l=i.indexOf(":");l!==-1&&(i=i.substr(l+1))}i=Ve(this.options.transformTagName,i,"",this.options).tagName,t&&(n=this.saveTextToParentTag(n,t,this.matcher));let u=this.matcher.getCurrentTag();if(i&&this.options.unpairedTags.indexOf(i)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${i}>`);u&&this.options.unpairedTags.indexOf(u)!==-1&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,t=this.tagsNodeStack.pop(),n="",s=a}else if(r[s+1]==="?"){let a=Le(r,s,!1,"?>");if(!a)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,t,this.matcher),!(this.options.ignoreDeclaration&&a.tagName==="?xml"||this.options.ignorePiTags)){let i=new I(a.tagName);i.add(this.options.textNodeName,""),a.tagName!==a.tagExp&&a.attrExpPresent&&(i[":@"]=this.buildAttributesMap(a.tagExp,this.matcher,a.tagName)),this.addChild(t,i,this.matcher,s)}s=a.closeIndex+1}else if(r.substr(s+1,3)==="!--"){let a=W(r,"-->",s+4,"Comment is not closed.");if(this.options.commentPropName){let i=r.substring(s+4,a-2);n=this.saveTextToParentTag(n,t,this.matcher),t.add(this.options.commentPropName,[{[this.options.textNodeName]:i}])}s=a}else if(r.substr(s+1,2)==="!D"){let a=o.readDocType(r,s);this.docTypeEntities=a.entities,s=a.i}else if(r.substr(s+1,2)==="!["){let a=W(r,"]]>",s,"CDATA is not closed.")-2,i=r.substring(s+9,a);n=this.saveTextToParentTag(n,t,this.matcher);let u=this.parseTextData(i,t.tagname,this.matcher,!0,!1,!0,!0);u==null&&(u=""),this.options.cdataPropName?t.add(this.options.cdataPropName,[{[this.options.textNodeName]:i}]):t.add(this.options.textNodeName,u),s=a+2}else{let a=Le(r,s,this.options.removeNSPrefix);if(!a){let P=r.substring(Math.max(0,s-50),Math.min(r.length,s+50));throw new Error(`readTagExp returned undefined at position ${s}. Context: "${P}"`)}let i=a.tagName,u=a.rawTagName,l=a.tagExp,d=a.attrExpPresent,p=a.closeIndex;if({tagName:i,tagExp:l}=Ve(this.options.transformTagName,i,l,this.options),this.options.strictReservedNames&&(i===this.options.commentPropName||i===this.options.cdataPropName))throw new Error(`Invalid tag name: ${i}`);t&&n&&t.tagname!=="!xml"&&(n=this.saveTextToParentTag(n,t,this.matcher,!1));let S=t;S&&this.options.unpairedTags.indexOf(S.tagname)!==-1&&(t=this.tagsNodeStack.pop(),this.matcher.pop());let x=!1;l.length>0&&l.lastIndexOf("/")===l.length-1&&(x=!0,i[i.length-1]==="/"?(i=i.substr(0,i.length-1),l=i):l=l.substr(0,l.length-1),d=i!==l);let E=null,k={},V;V=Mn(u),i!==e.tagname&&this.matcher.push(i,{},V),i!==l&&d&&(E=this.buildAttributesMap(l,this.matcher,i),E&&(k=$n(E,this.options))),i!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode(this.stopNodeExpressions,this.matcher));let G=s;if(this.isCurrentNodeStopNode){let P="";if(x)s=a.closeIndex;else if(this.options.unpairedTags.indexOf(i)!==-1)s=a.closeIndex;else{let _e=this.readStopNodeData(r,u,p+1);if(!_e)throw new Error(`Unexpected end of ${u}`);s=_e.i,P=_e.tagContent}let Ae=new I(i);E&&(Ae[":@"]=E),Ae.add(this.options.textNodeName,P),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(t,Ae,this.matcher,G)}else{if(x){({tagName:i,tagExp:l}=Ve(this.options.transformTagName,i,l,this.options));let P=new I(i);E&&(P[":@"]=E),this.addChild(t,P,this.matcher,G),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(this.options.unpairedTags.indexOf(i)!==-1){let P=new I(i);E&&(P[":@"]=E),this.addChild(t,P,this.matcher,G),this.matcher.pop(),this.isCurrentNodeStopNode=!1,s=a.closeIndex;continue}else{let P=new I(i);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(t),E&&(P[":@"]=E),this.addChild(t,P,this.matcher,G),t=P}n="",s=p}}else n+=r[s];return e.child};function jn(r,e,t,n){this.options.captureMetaData||(n=void 0);let o=this.options.jPath?t.toString():t,s=this.options.updateTag(e.tagname,o,e[":@"]);s===!1||(typeof s=="string"&&(e.tagname=s),r.addChild(e,n))}function zn(r,e,t){let n=this.options.processEntities;if(!n||!n.enabled)return r;if(n.allowedTags){let o=this.options.jPath?t.toString():t;if(!(Array.isArray(n.allowedTags)?n.allowedTags.includes(e):n.allowedTags(e,o)))return r}if(n.tagFilter){let o=this.options.jPath?t.toString():t;if(!n.tagFilter(e,o))return r}for(let o of Object.keys(this.docTypeEntities)){let s=this.docTypeEntities[o],c=r.match(s.regx);if(c){if(this.entityExpansionCount+=c.length,n.maxTotalExpansions&&this.entityExpansionCount>n.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n.maxTotalExpansions}`);let a=r.length;if(r=r.replace(s.regx,s.val),n.maxExpandedLength&&(this.currentExpandedLength+=r.length-a,this.currentExpandedLength>n.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${n.maxExpandedLength}`)}}for(let o of Object.keys(this.lastEntities)){let s=this.lastEntities[o],c=r.match(s.regex);if(c&&(this.entityExpansionCount+=c.length,n.maxTotalExpansions&&this.entityExpansionCount>n.maxTotalExpansions))throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n.maxTotalExpansions}`);r=r.replace(s.regex,s.val)}if(r.indexOf("&")===-1)return r;if(this.options.htmlEntities)for(let o of Object.keys(this.htmlEntities)){let s=this.htmlEntities[o],c=r.match(s.regex);if(c&&(this.entityExpansionCount+=c.length,n.maxTotalExpansions&&this.entityExpansionCount>n.maxTotalExpansions))throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${n.maxTotalExpansions}`);r=r.replace(s.regex,s.val)}return r=r.replace(this.ampEntity.regex,this.ampEntity.val),r}function Kn(r,e,t,n){return r&&(n===void 0&&(n=e.child.length===0),r=this.parseTextData(r,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,n),r!==void 0&&r!==""&&e.add(this.options.textNodeName,r),r=""),r}function Bn(r,e){if(!r||r.length===0)return!1;for(let t=0;t<r.length;t++)if(e.matches(r[t]))return!0;return!1}function Gn(r,e,t=">"){let n,o="";for(let s=e;s<r.length;s++){let c=r[s];if(n)c===n&&(n="");else if(c==='"'||c==="'")n=c;else if(c===t[0])if(t[1]){if(r[s+1]===t[1])return{data:o,index:s}}else return{data:o,index:s};else c===" "&&(c=" ");o+=c}}function W(r,e,t,n){let o=r.indexOf(e,t);if(o===-1)throw new Error(n);return o+e.length-1}function Le(r,e,t,n=">"){let o=Gn(r,e+1,n);if(!o)return;let s=o.data,c=o.index,a=s.search(/\s/),i=s,u=!0;a!==-1&&(i=s.substring(0,a),s=s.substring(a+1).trimStart());let l=i;if(t){let d=i.indexOf(":");d!==-1&&(i=i.substr(d+1),u=i!==o.data.substr(d+1))}return{tagName:i,tagExp:s,closeIndex:c,attrExpPresent:u,rawTagName:l}}function qn(r,e,t){let n=t,o=1;for(;t<r.length;t++)if(r[t]==="<")if(r[t+1]==="/"){let s=W(r,">",t,`${e} is not closed`);if(r.substring(t+2,s).trim()===e&&(o--,o===0))return{tagContent:r.substring(n,t),i:s};t=s}else if(r[t+1]==="?")t=W(r,"?>",t+1,"StopNode is not closed.");else if(r.substr(t+1,3)==="!--")t=W(r,"-->",t+3,"StopNode is not closed.");else if(r.substr(t+1,2)==="![")t=W(r,"]]>",t,"StopNode is not closed.")-2;else{let s=Le(r,t,">");s&&((s&&s.tagName)===e&&s.tagExp[s.tagExp.length-1]!=="/"&&o++,t=s.closeIndex)}}function He(r,e,t){if(e&&typeof r=="string"){let n=r.trim();return n==="true"?!0:n==="false"?!1:Me(r,t)}else return rr(r)?r:""}function dr(r,e,t){let n=Number.parseInt(r,e);return n>=0&&n<=1114111?String.fromCodePoint(n):t+r+";"}function Ve(r,e,t,n){if(r){let o=r(e);t===e&&(t=o),e=o}return e=fr(e,n),{tagName:e,tagExp:t}}function fr(r,e){if(ge.includes(r))throw new Error(`[SECURITY] Invalid name: "${r}" is a reserved JavaScript keyword that could cause prototype pollution`);return D.includes(r)?e.onDangerousProperty(r):r}var We=I.getMetaDataSymbol();function Yn(r,e){if(!r||typeof r!="object")return{};if(!e)return r;let t={};for(let n in r)if(n.startsWith(e)){let o=n.substring(e.length);t[o]=r[n]}else t[n]=r[n];return t}function Ue(r,e,t){return pr(r,e,t)}function pr(r,e,t){let n,o={};for(let s=0;s<r.length;s++){let c=r[s],a=Qn(c);if(a!==void 0&&a!==e.textNodeName){let i=Yn(c[":@"]||{},e.attributeNamePrefix);t.push(a,i)}if(a===e.textNodeName)n===void 0?n=c[a]:n+=""+c[a];else{if(a===void 0)continue;if(c[a]){let i=pr(c[a],e,t),u=Jn(i,e);if(c[":@"]?Xn(i,c[":@"],t,e):Object.keys(i).length===1&&i[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?i=i[e.textNodeName]:Object.keys(i).length===0&&(e.alwaysCreateTextNode?i[e.textNodeName]="":i=""),c[We]!==void 0&&typeof i=="object"&&i!==null&&(i[We]=c[We]),o[a]!==void 0&&Object.prototype.hasOwnProperty.call(o,a))Array.isArray(o[a])||(o[a]=[o[a]]),o[a].push(i);else{let l=e.jPath?t.toString():t;e.isArray(a,l,u)?o[a]=[i]:o[a]=i}a!==void 0&&a!==e.textNodeName&&t.pop()}}}return typeof n=="string"?n.length>0&&(o[e.textNodeName]=n):n!==void 0&&(o[e.textNodeName]=n),o}function Qn(r){let e=Object.keys(r);for(let t=0;t<e.length;t++){let n=e[t];if(n!==":@")return n}}function Xn(r,e,t,n){if(e){let o=Object.keys(e),s=o.length;for(let c=0;c<s;c++){let a=o[c],i=a.startsWith(n.attributeNamePrefix)?a.substring(n.attributeNamePrefix.length):a,u=n.jPath?t.toString()+"."+i:t;n.isArray(a,u,!0,!0)?r[a]=[e[a]]:r[a]=e[a]}}}function Jn(r,e){let{textNodeName:t}=e,n=Object.keys(r).length;return!!(n===0||n===1&&(r[t]||typeof r[t]=="boolean"||r[t]===0))}var Q=class{constructor(e){this.externalEntities={},this.options=ur(e)}parse(e,t){if(typeof e!="string"&&e.toString)e=e.toString();else if(typeof e!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(t){t===!0&&(t={});let s=ar(e,t);if(s!==!0)throw Error(`${s.err.msg}:${s.err.line}:${s.err.col}`)}let n=new ne(this.options);n.addExternalEntities(this.externalEntities);let o=n.parseXml(e);return this.options.preserveOrder||o===void 0?o:Ue(o,this.options,n.matcher)}addEntity(e,t){if(t.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(t==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}static getMetaDataSymbol(){return I.getMetaDataSymbol()}};var je=new Q({attributeNamePrefix:"",processEntities:{enabled:!0,maxTotalExpansions:1/0},htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(r,e)=>e.trim()===""&&e.includes(`
5
- `)?"":void 0,maxNestedTags:1/0});je.addEntity("#xD","\r");je.addEntity("#10",`
6
- `);function ze(r){return je.parse(r,!0)}var Ee=class extends ue{settings;stringDeserializer;constructor(e){super(),this.settings=e,this.stringDeserializer=new mt(e)}setSerdeContext(e){this.serdeContext=e,this.stringDeserializer.setSerdeContext(e)}read(e,t,n){let o=$.of(e),s=o.getMemberSchemas();if(o.isStructSchema()&&o.isMemberSchema()&&!!Object.values(s).find(u=>!!u.getMemberTraits().eventPayload)){let u={},l=Object.keys(s)[0];return s[l].isBlobSchema()?u[l]=t:u[l]=this.read(s[l],t),u}let a=(this.serdeContext?.utf8Encoder??se)(t),i=this.parseXml(a);return this.readSchema(e,n?i[n]:i)}readSchema(e,t){let n=$.of(e);if(n.isUnitSchema())return;let o=n.getMergedTraits();if(n.isListSchema()&&!Array.isArray(t))return this.readSchema(n,[t]);if(t==null)return t;if(typeof t=="object"){let s=!!o.xmlFlattened;if(n.isListSchema()){let a=n.getValueSchema(),i=[],u=a.getMergedTraits().xmlName??"member",l=s?t:(t[0]??t)[u];if(l==null)return i;let d=Array.isArray(l)?l:[l];for(let p of d)i.push(this.readSchema(a,p));return i}let c={};if(n.isMapSchema()){let a=n.getKeySchema(),i=n.getValueSchema(),u;s?u=Array.isArray(t)?t:[t]:u=Array.isArray(t.entry)?t.entry:[t.entry];let l=a.getMergedTraits().xmlName??"key",d=i.getMergedTraits().xmlName??"value";for(let p of u){let S=p[l],x=p[d];c[S]=this.readSchema(i,x)}return c}if(n.isStructSchema()){let a=n.isUnionSchema(),i;a&&(i=new Mt(t,c));for(let[u,l]of n.structIterator()){let d=l.getMergedTraits(),p=d.httpPayload?d.xmlName??l.getName():l.getMemberTraits().xmlName??u;a&&i.mark(p),t[p]!=null&&(c[u]=this.readSchema(l,t[p]))}return a&&i.writeUnknown(),c}if(n.isDocumentSchema())return t;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,t)}parseXml(e){if(e.length){let t;try{t=ze(e)}catch(c){throw c&&typeof c=="object"&&Object.defineProperty(c,"$responseBodyText",{value:e}),c}let n="#text",o=Object.keys(t)[0],s=t[o];return s[n]&&(s[o]=s[n],delete s[n]),$e(s)}return{}}};var ye=class extends ue{settings;buffer;constructor(e){super(),this.settings=e}write(e,t,n=""){this.buffer===void 0&&(this.buffer="");let o=$.of(e);if(n&&!n.endsWith(".")&&(n+="."),o.isBlobSchema())(typeof t=="string"||t instanceof Uint8Array)&&(this.writeKey(n),this.writeValue((this.serdeContext?.base64Encoder??oe)(t)));else if(o.isBooleanSchema()||o.isNumericSchema()||o.isStringSchema())t!=null?(this.writeKey(n),this.writeValue(String(t))):o.isIdempotencyToken()&&(this.writeKey(n),this.writeValue(ft()));else if(o.isBigIntegerSchema())t!=null&&(this.writeKey(n),this.writeValue(String(t)));else if(o.isBigDecimalSchema())t!=null&&(this.writeKey(n),this.writeValue(t instanceof pt?t.string:String(t)));else if(o.isTimestampSchema()){if(t instanceof Date)switch(this.writeKey(n),gt(o,this.settings)){case 5:this.writeValue(t.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue(dt(t));break;case 7:this.writeValue(String(t.getTime()/1e3));break}}else if(o.isDocumentSchema())Array.isArray(t)?this.write(79,t,n):t instanceof Date?this.write(4,t,n):t instanceof Uint8Array?this.write(21,t,n):t&&typeof t=="object"?this.write(143,t,n):(this.writeKey(n),this.writeValue(String(t)));else if(o.isListSchema()){if(Array.isArray(t))if(t.length===0)this.settings.serializeEmptyLists&&(this.writeKey(n),this.writeValue(""));else{let s=o.getValueSchema(),c=this.settings.flattenLists||o.getMergedTraits().xmlFlattened,a=1;for(let i of t){if(i==null)continue;let u=s.getMergedTraits(),l=this.getKey("member",u.xmlName,u.ec2QueryName),d=c?`${n}${a}`:`${n}${l}.${a}`;this.write(s,i,d),++a}}}else if(o.isMapSchema()){if(t&&typeof t=="object"){let s=o.getKeySchema(),c=o.getValueSchema(),a=o.getMergedTraits().xmlFlattened,i=1;for(let[u,l]of Object.entries(t)){if(l==null)continue;let d=s.getMergedTraits(),p=this.getKey("key",d.xmlName,d.ec2QueryName),S=a?`${n}${i}.${p}`:`${n}entry.${i}.${p}`,x=c.getMergedTraits(),E=this.getKey("value",x.xmlName,x.ec2QueryName),k=a?`${n}${i}.${E}`:`${n}entry.${i}.${E}`;this.write(s,u,S),this.write(c,l,k),++i}}}else if(o.isStructSchema()){if(t&&typeof t=="object"){let s=!1;for(let[c,a]of o.structIterator()){if(t[c]==null&&!a.isIdempotencyToken())continue;let i=a.getMergedTraits(),u=this.getKey(c,i.xmlName,i.ec2QueryName,"struct"),l=`${n}${u}`;this.write(a,t[c],l),s=!0}if(!s&&o.isUnionSchema()){let{$unknown:c}=t;if(Array.isArray(c)){let[a,i]=c,u=`${n}${a}`;this.write(15,i,u)}}}}else if(!o.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${o.getName(!0)}`)}flush(){if(this.buffer===void 0)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");let e=this.buffer;return delete this.buffer,e}getKey(e,t,n,o){let{ec2:s,capitalizeKeys:c}=this.settings;if(s&&n)return n;let a=t??e;return c&&o==="struct"?a[0].toUpperCase()+a.slice(1):a}writeKey(e){e.endsWith(".")&&(e=e.slice(0,e.length-1)),this.buffer+=`&${Oe(e)}=`}writeValue(e){this.buffer+=Oe(e)}};var Se=class extends ht{options;serializer;deserializer;mixin=new $t;constructor(e){super({defaultNamespace:e.defaultNamespace,errorTypeRegistries:e.errorTypeRegistries}),this.options=e;let t={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace,serializeEmptyLists:!0};this.serializer=new ye(t),this.deserializer=new Ee(t)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(e){this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e)}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(e,t,n){let o=await super.serializeRequest(e,t,n);o.path.endsWith("/")||(o.path+="/"),Object.assign(o.headers,{"content-type":"application/x-www-form-urlencoded"}),(ct(e.input)==="unit"||!o.body)&&(o.body="");let s=e.name.split("#")[1]??e.name;return o.body=`Action=${s}&Version=${this.options.version}`+o.body,o.body.endsWith("&")&&(o.body=o.body.slice(-1)),o}async deserializeResponse(e,t,n){let o=this.deserializer,s=$.of(e.output),c={};if(n.statusCode>=300){let d=await ve(n.body,t);d.byteLength>0&&Object.assign(c,await o.read(15,d)),await this.handleError(e,t,n,c,this.deserializeMetadata(n))}for(let d in n.headers){let p=n.headers[d];delete n.headers[d],n.headers[d.toLowerCase()]=p}let a=e.name.split("#")[1]??e.name,i=s.isStructSchema()&&this.useNestedResult()?a+"Result":void 0,u=await ve(n.body,t);return u.byteLength>0&&Object.assign(c,await o.read(s,u,i)),{$metadata:this.deserializeMetadata(n),...c}}useNestedResult(){return!0}async handleError(e,t,n,o,s){let c=this.loadQueryErrorCode(n,o)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,c,this.options.defaultNamespace);let a=this.loadQueryError(o)??{},i=this.loadQueryErrorMessage(o);a.message=i,a.Error={Type:a.Type,Code:a.Code,Message:i};let{errorSchema:u,errorMetadata:l}=await this.mixin.getErrorSchemaOrThrowBaseException(c,this.options.defaultNamespace,n,a,s,this.mixin.findQueryCompatibleError),d=$.of(u),p=this.compositeErrorRegistry.getErrorCtor(u)??Error,S=new p(i),x={Type:a.Error.Type,Code:a.Error.Code,Error:a.Error};for(let[E,k]of d.structIterator()){let V=k.getMergedTraits().xmlName??E,G=a[V]??o[V];x[E]=this.deserializer.readSchema(k,G)}throw this.mixin.decorateServiceException(Object.assign(S,l,{$fault:d.getMergedTraits().error,message:i},x),o)}loadQueryErrorCode(e,t){let n=(t.Errors?.[0]?.Error??t.Errors?.Error??t.Error)?.Code;if(n!==void 0)return n;if(e.statusCode==404)return"NotFound"}loadQueryError(e){return e.Errors?.[0]?.Error??e.Errors?.Error??e.Error}loadQueryErrorMessage(e){let t=this.loadQueryError(e);return t?.message??t?.Message??e.message??e.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}};var hr=async(r,e,t)=>({operation:tt(e).operation,region:await Re(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Zn(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:r.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function Dn(r){return{schemeId:"smithy.api#noAuth"}}var gr=r=>{let e=[];return r.operation==="AssumeRoleWithWebIdentity"?e.push(Dn(r)):e.push(Zn(r)),e},es=r=>Object.assign(r,{stsClientCtor:O}),mr=r=>{let e=es(r),t=Pt(e);return Object.assign(t,{authSchemePreference:Re(r.authSchemePreference??[])})};var Er=r=>Object.assign(r,{useDualstackEndpoint:r.useDualstackEndpoint??!1,useFipsEndpoint:r.useFipsEndpoint??!1,useGlobalEndpoint:r.useGlobalEndpoint??!1,defaultSigningName:"sts"}),we={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 Ar="required",f="type";var h="argv";var M="booleanEquals",w="stringEquals",_r="sigv4";var Rr="us-east-1",g="endpoint",yr="https://sts.{Region}.{PartitionResult#dnsSuffix}",v="tree",X="error",Be="getAttr",Sr={[Ar]:!1,[f]:"string"},Ke={[Ar]:!0,default:!1,[f]:"boolean"},vr={ref:"Endpoint"},wr={fn:"isSet",[h]:[{ref:"Region"}]},b={ref:"Region"},br={fn:"aws.partition",[h]:[b],assign:"PartitionResult"},Or={ref:"UseFIPS"},kr={ref:"UseDualStack"},N={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:_r,signingName:"sts",signingRegion:Rr}]},headers:{}},A={},Nr={conditions:[{fn:w,[h]:[b,"aws-global"]}],[g]:N,[f]:g},$r={fn:M,[h]:[Or,!0]},Mr={fn:M,[h]:[kr,!0]},xr={fn:Be,[h]:[{ref:"PartitionResult"},"supportsFIPS"]},Fr={ref:"PartitionResult"},Tr={fn:M,[h]:[!0,{fn:Be,[h]:[Fr,"supportsDualStack"]}]},Pr=[{fn:"isSet",[h]:[vr]}],Ir=[$r],Cr=[Mr],ts={version:"1.0",parameters:{Region:Sr,UseDualStack:Ke,UseFIPS:Ke,Endpoint:Sr,UseGlobalEndpoint:Ke},rules:[{conditions:[{fn:M,[h]:[{ref:"UseGlobalEndpoint"},!0]},{fn:"not",[h]:Pr},wr,br,{fn:M,[h]:[Or,!1]},{fn:M,[h]:[kr,!1]}],rules:[{conditions:[{fn:w,[h]:[b,"ap-northeast-1"]}],endpoint:N,[f]:g},{conditions:[{fn:w,[h]:[b,"ap-south-1"]}],endpoint:N,[f]:g},{conditions:[{fn:w,[h]:[b,"ap-southeast-1"]}],endpoint:N,[f]:g},{conditions:[{fn:w,[h]:[b,"ap-southeast-2"]}],endpoint:N,[f]:g},Nr,{conditions:[{fn:w,[h]:[b,"ca-central-1"]}],endpoint:N,[f]:g},{conditions:[{fn:w,[h]:[b,"eu-central-1"]}],endpoint:N,[f]:g},{conditions:[{fn:w,[h]:[b,"eu-north-1"]}],endpoint:N,[f]:g},{conditions:[{fn:w,[h]:[b,"eu-west-1"]}],endpoint:N,[f]:g},{conditions:[{fn:w,[h]:[b,"eu-west-2"]}],endpoint:N,[f]:g},{conditions:[{fn:w,[h]:[b,"eu-west-3"]}],endpoint:N,[f]:g},{conditions:[{fn:w,[h]:[b,"sa-east-1"]}],endpoint:N,[f]:g},{conditions:[{fn:w,[h]:[b,Rr]}],endpoint:N,[f]:g},{conditions:[{fn:w,[h]:[b,"us-east-2"]}],endpoint:N,[f]:g},{conditions:[{fn:w,[h]:[b,"us-west-1"]}],endpoint:N,[f]:g},{conditions:[{fn:w,[h]:[b,"us-west-2"]}],endpoint:N,[f]:g},{endpoint:{url:yr,properties:{authSchemes:[{name:_r,signingName:"sts",signingRegion:"{Region}"}]},headers:A},[f]:g}],[f]:v},{conditions:Pr,rules:[{conditions:Ir,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[f]:X},{conditions:Cr,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[f]:X},{endpoint:{url:vr,properties:A,headers:A},[f]:g}],[f]:v},{conditions:[wr],rules:[{conditions:[br],rules:[{conditions:[$r,Mr],rules:[{conditions:[{fn:M,[h]:[!0,xr]},Tr],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:A,headers:A},[f]:g}],[f]:v},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[f]:X}],[f]:v},{conditions:Ir,rules:[{conditions:[{fn:M,[h]:[xr,!0]}],rules:[{conditions:[{fn:w,[h]:[{fn:Be,[h]:[Fr,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:A,headers:A},[f]:g},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:A,headers:A},[f]:g}],[f]:v},{error:"FIPS is enabled but this partition does not support FIPS",[f]:X}],[f]:v},{conditions:Cr,rules:[{conditions:[Tr],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:A,headers:A},[f]:g}],[f]:v},{error:"DualStack is enabled but this partition does not support DualStack",[f]:X}],[f]:v},Nr,{endpoint:{url:yr,properties:A,headers:A},[f]:g}],[f]:v}],[f]:v},{error:"Invalid Configuration: Missing Region",[f]:X}]},Vr=ts;var rs=new St({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),Lr=(r,e={})=>rs.get(r,()=>bt(Vr,{endpointParams:r,logger:e.logger}));wt.aws=Nt;var _=class r extends At{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}};var be=class r extends _{name="ExpiredTokenException";$fault="client";constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,r.prototype)}},Ne=class r extends _{name="MalformedPolicyDocumentException";$fault="client";constructor(e){super({name:"MalformedPolicyDocumentException",$fault:"client",...e}),Object.setPrototypeOf(this,r.prototype)}},xe=class r extends _{name="PackedPolicyTooLargeException";$fault="client";constructor(e){super({name:"PackedPolicyTooLargeException",$fault:"client",...e}),Object.setPrototypeOf(this,r.prototype)}},Te=class r extends _{name="RegionDisabledException";$fault="client";constructor(e){super({name:"RegionDisabledException",$fault:"client",...e}),Object.setPrototypeOf(this,r.prototype)}},Pe=class r extends _{name="IDPRejectedClaimException";$fault="client";constructor(e){super({name:"IDPRejectedClaimException",$fault:"client",...e}),Object.setPrototypeOf(this,r.prototype)}},Ie=class r extends _{name="InvalidIdentityTokenException";$fault="client";constructor(e){super({name:"InvalidIdentityTokenException",$fault:"client",...e}),Object.setPrototypeOf(this,r.prototype)}},Ce=class r extends _{name="IDPCommunicationErrorException";$fault="client";constructor(e){super({name:"IDPCommunicationErrorException",$fault:"client",...e}),Object.setPrototypeOf(this,r.prototype)}};var ns="Arn",ss="AccessKeyId",os="AssumeRole",is="AssumedRoleId",as="AssumeRoleRequest",cs="AssumeRoleResponse",Ge="AssumedRoleUser",ls="AssumeRoleWithWebIdentity",us="AssumeRoleWithWebIdentityRequest",ds="AssumeRoleWithWebIdentityResponse",fs="Audience",qe="Credentials",ps="ContextAssertion",Hr="DurationSeconds",hs="Expiration",gs="ExternalId",ms="ExpiredTokenException",Es="IDPCommunicationErrorException",ys="IDPRejectedClaimException",Ss="InvalidIdentityTokenException",ws="Key",bs="MalformedPolicyDocumentException",Wr="Policy",Ur="PolicyArns",Ns="ProviderArn",xs="ProvidedContexts",Ts="ProvidedContextsListType",Ps="ProvidedContext",Is="PolicyDescriptorType",Cs="ProviderId",jr="PackedPolicySize",As="PackedPolicyTooLargeException",_s="Provider",zr="RoleArn",Rs="RegionDisabledException",Kr="RoleSessionName",vs="SecretAccessKey",Os="SubjectFromWebIdentityToken",Ye="SourceIdentity",ks="SerialNumber",$s="SessionToken",Ms="Tags",Fs="TokenCode",Vs="TransitiveTagKeys",Ls="Tag",Hs="Value",Ws="WebIdentityToken",Us="arn",js="accessKeySecretType",U="awsQueryError",j="client",zs="clientTokenType",z="error",K="httpError",B="message",Ks="policyDescriptorListType",Br="smithy.ts.sdk.synthetic.com.amazonaws.sts",Bs="tagListType",m="com.amazonaws.sts",Gr=ke.for(Br),Gs=[-3,Br,"STSServiceException",0,[],[]];Gr.registerError(Gs,_);var F=ke.for(m),qs=[-3,m,ms,{[U]:["ExpiredTokenException",400],[z]:j,[K]:400},[B],[0]];F.registerError(qs,be);var Ys=[-3,m,Es,{[U]:["IDPCommunicationError",400],[z]:j,[K]:400},[B],[0]];F.registerError(Ys,Ce);var Qs=[-3,m,ys,{[U]:["IDPRejectedClaim",403],[z]:j,[K]:403},[B],[0]];F.registerError(Qs,Pe);var Xs=[-3,m,Ss,{[U]:["InvalidIdentityToken",400],[z]:j,[K]:400},[B],[0]];F.registerError(Xs,Ie);var Js=[-3,m,bs,{[U]:["MalformedPolicyDocument",400],[z]:j,[K]:400},[B],[0]];F.registerError(Js,Ne);var Zs=[-3,m,As,{[U]:["PackedPolicyTooLarge",400],[z]:j,[K]:400},[B],[0]];F.registerError(Zs,xe);var Ds=[-3,m,Rs,{[U]:["RegionDisabledException",403],[z]:j,[K]:403},[B],[0]];F.registerError(Ds,Te);var qr=[Gr,F],eo=[0,m,js,8,0],to=[0,m,zs,8,0],Yr=[3,m,Ge,0,[is,ns],[0,0],2],ro=[3,m,as,0,[zr,Kr,Ur,Wr,Hr,Ms,Vs,gs,ks,Fs,Ye,xs],[0,0,()=>Xr,0,1,()=>uo,64,0,0,0,0,()=>lo],2],no=[3,m,cs,0,[qe,Ge,jr,Ye],[[()=>Qr,0],()=>Yr,1,0]],so=[3,m,us,0,[zr,Kr,Ws,Cs,Ur,Wr,Hr],[0,0,[()=>to,0],0,()=>Xr,0,1],3],oo=[3,m,ds,0,[qe,Os,Ge,jr,_s,fs,Ye],[[()=>Qr,0],0,()=>Yr,1,0,0,0]],Qr=[3,m,qe,0,[ss,vs,$s,hs],[0,[()=>eo,0],0,4],4],io=[3,m,Is,0,[Us],[0]],ao=[3,m,Ps,0,[Ns,ps],[0,0]],co=[3,m,Ls,0,[ws,Hs],[0,0],2],Xr=[1,m,Ks,0,()=>io],lo=[1,m,Ts,0,()=>ao];var uo=[1,m,Bs,0,()=>co],Jr=[9,m,os,0,()=>ro,()=>no],Zr=[9,m,ls,0,()=>so,()=>oo];var Dr=r=>({apiVersion:"2011-06-15",base64Decoder:r?.base64Decoder??st,base64Encoder:r?.base64Encoder??oe,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??Lr,extensions:r?.extensions??[],httpAuthSchemeProvider:r?.httpAuthSchemeProvider??gr,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new ce},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new ie}],logger:r?.logger??new kt,protocol:r?.protocol??Se,protocolSettings:r?.protocolSettings??{defaultNamespace:"com.amazonaws.sts",errorTypeRegistries:qr,xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/",version:"2011-06-15",serviceTarget:"AWSSecurityTokenServiceV20110615"},serviceId:r?.serviceId??"STS",urlParser:r?.urlParser??lt,utf8Decoder:r?.utf8Decoder??ot,utf8Encoder:r?.utf8Encoder??se});var en=r=>{Rt(process.version);let e=Zt(r),t=()=>e().then(_t),n=Dr(r);xt(process.version);let o={profile:r?.profile,logger:n.logger};return{...n,...r,runtime:"node",defaultsMode:e,authSchemePreference:r?.authSchemePreference??R(Tt,o),bodyLengthChecker:r?.bodyLengthChecker??Jt,defaultUserAgentProvider:r?.defaultUserAgentProvider??Yt({serviceId:n.serviceId,clientVersion:qt.version}),httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:s=>s.getIdentityProvider("aws.auth#sigv4")||(async c=>await r.credentialDefaultProvider(c?.__config||{})()),signer:new ce},{schemeId:"smithy.api#noAuth",identityProvider:s=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new ie}],maxAttempts:r?.maxAttempts??R(zt,r),region:r?.region??R(de,{...fe,...o}),requestHandler:it.create(r?.requestHandler??t),retryMode:r?.retryMode??R({...Bt,default:async()=>(await t()).retryMode||Ft},r),sha256:r?.sha256??Xt.bind(null,"sha256"),streamCollector:r?.streamCollector??at,useDualstackEndpoint:r?.useDualstackEndpoint??R(Lt,o),useFipsEndpoint:r?.useFipsEndpoint??R(Ht,o),userAgentAppId:r?.userAgentAppId??R(Qt,o)}};function tn(r={}){return R({...de,async default(){return fo.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"}},{...fe,...r})}var fo={silence:!1};var rn=r=>{let e=r.httpAuthSchemes,t=r.httpAuthSchemeProvider,n=r.credentials;return{setHttpAuthScheme(o){let s=e.findIndex(c=>c.schemeId===o.schemeId);s===-1?e.push(o):e.splice(s,1,o)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(o){t=o},httpAuthSchemeProvider(){return t},setCredentials(o){n=o},credentials(){return n}}},nn=r=>({httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()});var sn=(r,e)=>{let t=Object.assign(Dt(r),vt(r),Xe(r),rn(r));return e.forEach(n=>n.configure(t)),Object.assign(r,er(t),Ot(t),Je(t),nn(t))};var O=class extends It{config;constructor(...[e]){let t=en(e||{});super(t),this.initConfig=t;let n=Er(t),o=yt(n),s=Kt(o),c=Wt(s),a=c,i=jt(a),u=mr(i),l=sn(u,e?.extensions||[]);this.config=l,this.middlewareStack.use(ut(this.config)),this.middlewareStack.use(Vt(this.config)),this.middlewareStack.use(Gt(this.config)),this.middlewareStack.use(Ut(this.config)),this.middlewareStack.use(Ze(this.config)),this.middlewareStack.use(De(this.config)),this.middlewareStack.use(et(this.config)),this.middlewareStack.use(rt(this.config,{httpAuthSchemeParametersProvider:hr,identityProviderConfigProvider:async d=>new Et({"aws.auth#sigv4":d.credentials})})),this.middlewareStack.use(nt(this.config))}destroy(){super.destroy()}};var J=class extends le.classBuilder().ep(we).m(function(e,t,n,o){return[pe(n,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").sc(Jr).build(){};var Z=class extends le.classBuilder().ep(we).m(function(e,t,n,o){return[pe(n,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").sc(Zr).build(){};var po={AssumeRoleCommand:J,AssumeRoleWithWebIdentityCommand:Z},Qe=class extends O{};Ct(po,Qe);var on=r=>{if(typeof r?.Arn=="string"){let e=r.Arn.split(":");if(e.length>4&&e[4]!=="")return e[4]}},an=async(r,e,t,n={})=>{let o=typeof r=="function"?await r():r,s=typeof e=="function"?await e():e,c="",a=o??s??(c=await tn(n)());return t?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${o} (credential provider clientConfig)`,`${s} (contextual client)`,`${c} (STS default: AWS_REGION, profile region, or us-east-1)`),a},cn=(r,e)=>{let t,n;return async(o,s)=>{if(n=o,!t){let{logger:l=r?.parentClientConfig?.logger,profile:d=r?.parentClientConfig?.profile,region:p,requestHandler:S=r?.parentClientConfig?.requestHandler,credentialProviderLogger:x,userAgentAppId:E=r?.parentClientConfig?.userAgentAppId}=r,k=await an(p,r?.parentClientConfig?.region,x,{logger:l,profile:d}),V=!un(S);t=new e({...r,userAgentAppId:E,profile:d,credentialDefaultProvider:()=>async()=>n,region:k,requestHandler:V?S:void 0,logger:l})}let{Credentials:c,AssumedRoleUser:a}=await t.send(new J(s));if(!c||!c.AccessKeyId||!c.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${s.RoleArn}`);let i=on(a),u={accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.SessionToken,expiration:c.Expiration,...c.CredentialScope&&{credentialScope:c.CredentialScope},...i&&{accountId:i}};return ae(u,"CREDENTIALS_STS_ASSUME_ROLE","i"),u}},ln=(r,e)=>{let t;return async n=>{if(!t){let{logger:i=r?.parentClientConfig?.logger,profile:u=r?.parentClientConfig?.profile,region:l,requestHandler:d=r?.parentClientConfig?.requestHandler,credentialProviderLogger:p,userAgentAppId:S=r?.parentClientConfig?.userAgentAppId}=r,x=await an(l,r?.parentClientConfig?.region,p,{logger:i,profile:u}),E=!un(d);t=new e({...r,userAgentAppId:S,profile:u,region:x,requestHandler:E?d:void 0,logger:i})}let{Credentials:o,AssumedRoleUser:s}=await t.send(new Z(n));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${n.RoleArn}`);let c=on(s),a={accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration,...o.CredentialScope&&{credentialScope:o.CredentialScope},...c&&{accountId:c}};return c&&ae(a,"RESOLVED_ACCOUNT_ID","T"),ae(a,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),a}};var un=r=>r?.metadata?.handlerProtocol==="h2";var dn=(r,e)=>e?class extends r{constructor(n){super(n);for(let o of e)this.middlewareStack.use(o)}}:r,ho=(r={},e)=>cn(r,dn(O,e)),go=(r={},e)=>ln(r,dn(O,e)),cc=r=>e=>r({roleAssumer:ho(e),roleAssumerWithWebIdentity:go(e),...e});export{le as $Command,Jr as AssumeRole$,J as AssumeRoleCommand,ro as AssumeRoleRequest$,no as AssumeRoleResponse$,Zr as AssumeRoleWithWebIdentity$,Z as AssumeRoleWithWebIdentityCommand,so as AssumeRoleWithWebIdentityRequest$,oo as AssumeRoleWithWebIdentityResponse$,Yr as AssumedRoleUser$,Qr as Credentials$,be as ExpiredTokenException,qs as ExpiredTokenException$,Ce as IDPCommunicationErrorException,Ys as IDPCommunicationErrorException$,Pe as IDPRejectedClaimException,Qs as IDPRejectedClaimException$,Ie as InvalidIdentityTokenException,Xs as InvalidIdentityTokenException$,Ne as MalformedPolicyDocumentException,Js as MalformedPolicyDocumentException$,xe as PackedPolicyTooLargeException,Zs as PackedPolicyTooLargeException$,io as PolicyDescriptorType$,ao as ProvidedContext$,Te as RegionDisabledException,Ds as RegionDisabledException$,Qe as STS,O as STSClient,_ as STSServiceException,Gs as STSServiceException$,co as Tag$,It as __Client,cc as decorateDefaultCredentialProvider,qr as errorTypeRegistries,ho as getDefaultRoleAssumer,go as getDefaultRoleAssumerWithWebIdentity};