django-vue3-admin-web/dist/assets/uploader-s3-77927a69.DdqL3JA9.js
2025-10-20 21:21:14 +08:00

35 lines
211 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{f as cc,m as uc,h as lc,i as dc,y as hc}from"./index.Ct5zz34E.js";import"./vue.CZk_9PbR.js";var Jn={},fc=Object.defineProperty,pc=(e,t,r)=>t in e?fc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,O=(e,t,r)=>(pc(e,typeof t!="symbol"?t+"":t,r),r);const gc=e=>({setHttpHandler(t){e.httpHandler=t},httpHandler(){return e.httpHandler},updateHttpClientConfig(t,r){var n;(n=e.httpHandler)==null||n.updateHttpClientConfig(t,r)},httpHandlerConfigs(){return e.httpHandler.httpHandlerConfigs()}}),mc=e=>({httpHandler:e.httpHandler()});var es;(function(e){e.HEADER="header",e.QUERY="query"})(es||(es={}));var ts;(function(e){e.HEADER="header",e.QUERY="query"})(ts||(ts={}));var Mt;(function(e){e.HTTP="http",e.HTTPS="https"})(Mt||(Mt={}));var Gt;(function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"})(Gt||(Gt={}));var rs;(function(e){e[e.HEADER=0]="HEADER",e[e.TRAILER=1]="TRAILER"})(rs||(rs={}));const rn="__smithy_context";var ns;(function(e){e.PROFILE="profile",e.SSO_SESSION="sso-session",e.SERVICES="services"})(ns||(ns={}));var ss;(function(e){e.HTTP_0_9="http/0.9",e.HTTP_1_0="http/1.0",e.TDS_8_0="tds/8.0"})(ss||(ss={}));class se{constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){const r=new se({...t,headers:{...t.headers}});return r.query&&(r.query=yc(r.query)),r}static isInstance(t){if(!t)return!1;const r=t;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return se.clone(this)}}function yc(e){return Object.keys(e).reduce((t,r)=>{const n=e[r];return{...t,[r]:Array.isArray(n)?[...n]:n}},{})}class pt{constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;const r=t;return typeof r.statusCode=="number"&&typeof r.headers=="object"}}function wc(e){return t=>async r=>{var n,s;const{request:i}=r;return se.isInstance(i)&&i.body&&e.runtime==="node"&&((s=(n=e.requestHandler)==null?void 0:n.constructor)==null?void 0:s.name)!=="FetchHttpHandler"&&(i.headers={...i.headers,Expect:"100-continue"}),t({...r,request:i})}}const bc={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},vc=e=>({applyToStack:t=>{t.add(wc(e),bc)}}),gt={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},Sc=gt.WHEN_SUPPORTED,mr={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},Ec=gt.WHEN_SUPPORTED;var z;(function(e){e.MD5="MD5",e.CRC32="CRC32",e.CRC32C="CRC32C",e.CRC64NVME="CRC64NVME",e.SHA1="SHA1",e.SHA256="SHA256"})(z||(z={}));var is;(function(e){e.HEADER="header",e.TRAILER="trailer"})(is||(is={}));const nn=z.CRC32;var os;(function(e){e.ENV="env",e.CONFIG="shared config entry"})(os||(os={}));function Ac(e,t,r){return e.$source||(e.$source={}),e.$source[t]=r,e}function re(e,t,r){e.__aws_sdk_context?e.__aws_sdk_context.features||(e.__aws_sdk_context.features={}):e.__aws_sdk_context={features:{}},e.__aws_sdk_context.features[t]=r}const as=e=>{var t,r;return pt.isInstance(e)?((t=e.headers)==null?void 0:t.date)??((r=e.headers)==null?void 0:r.Date):void 0},yn=e=>new Date(Date.now()+e),xc=(e,t)=>Math.abs(yn(t).getTime()-e)>=3e5,cs=(e,t)=>{const r=Date.parse(e);return xc(r,t)?r-Date.now():t},Rt=(e,t)=>{if(!t)throw new Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return t},ho=async e=>{var t,r,n;const s=Rt("context",e.context),i=Rt("config",e.config),o=(n=(r=(t=s.endpointV2)==null?void 0:t.properties)==null?void 0:r.authSchemes)==null?void 0:n[0],a=await Rt("signer",i.signer)(o),c=e==null?void 0:e.signingRegion,u=e==null?void 0:e.signingRegionSet,f=e==null?void 0:e.signingName;return{config:i,signer:a,signingRegion:c,signingRegionSet:u,signingName:f}};class fo{async sign(t,r,n){var s;if(!se.isInstance(t))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const i=await ho(n),{config:o,signer:a}=i;let{signingRegion:c,signingName:u}=i;const f=n.context;if(((s=f==null?void 0:f.authSchemes)==null?void 0:s.length)??!1){const[h,p]=f.authSchemes;(h==null?void 0:h.name)==="sigv4a"&&(p==null?void 0:p.name)==="sigv4"&&(c=(p==null?void 0:p.signingRegion)??c,u=(p==null?void 0:p.signingName)??u)}return await a.sign(t,{signingDate:yn(o.systemClockOffset),signingRegion:c,signingService:u})}errorHandler(t){return r=>{const n=r.ServerTime??as(r.$response);if(n){const s=Rt("config",t.config),i=s.systemClockOffset;s.systemClockOffset=cs(n,s.systemClockOffset),s.systemClockOffset!==i&&r.$metadata&&(r.$metadata.clockSkewCorrected=!0)}throw r}}successHandler(t,r){const n=as(t);if(n){const s=Rt("config",r.config);s.systemClockOffset=cs(n,s.systemClockOffset)}}}class kc extends fo{async sign(t,r,n){var s;if(!se.isInstance(t))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:i,signer:o,signingRegion:a,signingRegionSet:c,signingName:u}=await ho(n),f=(await((s=i.sigv4aSigningRegionSet)==null?void 0:s.call(i))??c??[a]).join(",");return await o.sign(t,{signingDate:yn(i.systemClockOffset),signingRegion:f,signingService:u})}}const St=e=>e[rn]||(e[rn]={}),Me=e=>{if(typeof e=="function")return e;const t=Promise.resolve(e);return()=>t},Rc=(e,t)=>{if(!t||t.length===0)return e;const r=[];for(const n of t)for(const s of e)s.schemeId.split("#")[1]===n&&r.push(s);for(const n of e)r.find(({schemeId:s})=>s===n.schemeId)||r.push(n);return r};function Cc(e){const t=new Map;for(const r of e)t.set(r.schemeId,r);return t}const Pc=(e,t)=>(r,n)=>async s=>{var i;const o=e.httpAuthSchemeProvider(await t.httpAuthSchemeParametersProvider(e,n,s.input)),a=e.authSchemePreference?await e.authSchemePreference():[],c=Rc(o,a),u=Cc(e.httpAuthSchemes),f=St(n),h=[];for(const p of c){const y=u.get(p.schemeId);if(!y){h.push(`HttpAuthScheme \`${p.schemeId}\` was not enabled for this service.`);continue}const E=y.identityProvider(await t.identityProviderConfigProvider(e));if(!E){h.push(`HttpAuthScheme \`${p.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:x={},signingProperties:A={}}=((i=p.propertiesExtractor)==null?void 0:i.call(p,e,n))||{};p.identityProperties=Object.assign(p.identityProperties||{},x),p.signingProperties=Object.assign(p.signingProperties||{},A),f.selectedHttpAuthScheme={httpAuthOption:p,identity:await E(p.identityProperties),signer:y.signer};break}if(!f.selectedHttpAuthScheme)throw new Error(h.join(`
`));return r(s)},Tc={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},Ic=(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:r})=>({applyToStack:n=>{n.addRelativeTo(Pc(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:r}),Tc)}}),Nc=(e,t)=>(r,n)=>async s=>{var i,o,a,c;const{response:u}=await r(s);try{const f=await t(u,e);return{response:u,output:f}}catch(f){if(Object.defineProperty(f,"$response",{value:u}),!("$metadata"in f)){const h="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{f.message+=`
`+h}catch{!n.logger||((o=(i=n.logger)==null?void 0:i.constructor)==null?void 0:o.name)==="NoOpLogger"||(c=(a=n.logger)==null?void 0:a.warn)==null||c.call(a,h)}typeof f.$responseBodyText<"u"&&f.$response&&(f.$response.body=f.$responseBodyText);try{if(pt.isInstance(u)){const{headers:p={}}=u,y=Object.entries(p);f.$metadata={httpStatusCode:u.statusCode,requestId:yr(/^x-[\w-]+-request-?id$/,y),extendedRequestId:yr(/^x-[\w-]+-id-2$/,y),cfId:yr(/^x-[\w-]+-cf-id$/,y)}}}catch{}}throw f}},yr=(e,t)=>(t.find(([r])=>r.match(e))||[void 0,void 0])[1],Oc=(e,t)=>(r,n)=>async s=>{var i;const o=e,a=(i=n.endpointV2)!=null&&i.url&&o.urlParser?async()=>o.urlParser(n.endpointV2.url):o.endpoint;if(!a)throw new Error("No valid endpoint provider available.");const c=await t(s.input,{...e,endpoint:a});return r({...s,request:c})},Mc={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},po={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function go(e,t,r){return{applyToStack:n=>{n.add(Nc(e,r),Mc),n.add(Oc(e,t),po)}}}const Uc=e=>t=>{throw t},$c=(e,t)=>{},Dc=e=>(t,r)=>async n=>{if(!se.isInstance(n.request))return t(n);const s=St(r).selectedHttpAuthScheme;if(!s)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:i={}},identity:o,signer:a}=s,c=await t({...n,request:await a.sign(n.request,o,i)}).catch((a.errorHandler||Uc)(i));return(a.successHandler||$c)(c.response,i),c},mo={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},_c=e=>({applyToStack:t=>{t.addRelativeTo(Dc(),mo)}}),ht=e=>{if(typeof e=="function")return e;const t=Promise.resolve(e);return()=>t},Ke={},Et=new Array(64);for(let e=0,t=65,r=90;e+t<=r;e++){const n=String.fromCharCode(e+t);Ke[n]=e,Et[e]=n}for(let e=0,t=97,r=122;e+t<=r;e++){const n=String.fromCharCode(e+t),s=e+26;Ke[n]=s,Et[s]=n}for(let e=0;e<10;e++){Ke[e.toString(10)]=e+52;const t=e.toString(10),r=e+52;Ke[t]=r,Et[r]=t}Ke["+"]=62;Et[62]="+";Ke["/"]=63;Et[63]="/";const ft=6,Ct=8,Bc=63,wn=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 s=0;s<e.length;s+=4){let i=0,o=0;for(let u=s,f=s+3;u<=f;u++)if(e[u]!=="="){if(!(e[u]in Ke))throw new TypeError(`Invalid character ${e[u]} in base64 string.`);i|=Ke[e[u]]<<(f-u)*ft,o+=ft}else i>>=ft;const a=s/4*3;i>>=o%Ct;const c=Math.floor(o/Ct);for(let u=0;u<c;u++){const f=(c-u-1)*Ct;n.setUint8(a+u,(i&255<<f)>>f)}}return new Uint8Array(r)},it=e=>new TextEncoder().encode(e),mt=e=>typeof e=="string"?it(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),bn=e=>{if(typeof e=="string")return e;if(typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)};function sr(e){let t;typeof e=="string"?t=it(e):t=e;const r=typeof t=="object"&&typeof t.length=="number",n=typeof t=="object"&&typeof t.byteOffset=="number"&&typeof t.byteLength=="number";if(!r&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let s="";for(let i=0;i<t.length;i+=3){let o=0,a=0;for(let u=i,f=Math.min(i+3,t.length);u<f;u++)o|=t[u]<<(f-u-1)*Ct,a+=Ct;const c=Math.ceil(a/ft);o<<=c*ft-a;for(let u=1;u<=c;u++){const f=(c-u)*ft;s+=Et[(o&Bc<<f)>>f]}s+="==".slice(0,4-c)}return s}function Lc(e,t="utf-8"){return t==="base64"?sr(e):bn(e)}function Fc(e,t){return t==="base64"?nt.mutate(wn(e)):nt.mutate(it(e))}class nt extends Uint8Array{static fromString(t,r="utf-8"){switch(typeof t){case"string":return Fc(t,r);default:throw new Error(`Unsupported conversion from ${typeof t} to Uint8ArrayBlobAdapter.`)}}static mutate(t){return Object.setPrototypeOf(t,nt.prototype),t}transformToString(t="utf-8"){return Lc(this,t)}}const Hc=typeof ReadableStream=="function"?ReadableStream:function(){};class qc extends Hc{}const sn=e=>{var t;return typeof ReadableStream=="function"&&(((t=e==null?void 0:e.constructor)==null?void 0:t.name)===ReadableStream.name||e instanceof ReadableStream)},jc=({expectedChecksum:e,checksum:t,source:r,checksumSourceLocation:n,base64Encoder:s})=>{var i;if(!sn(r))throw new Error(`@smithy/util-stream: unsupported source type ${((i=r==null?void 0:r.constructor)==null?void 0:i.name)??r} in ChecksumStream.`);const o=s??sr;if(typeof TransformStream!="function")throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");const a=new TransformStream({start(){},async transform(u,f){t.update(u),f.enqueue(u)},async flush(u){const f=await t.digest(),h=o(f);if(e!==h){const p=new Error(`Checksum mismatch: expected "${e}" but received "${h}" in response header "${n}".`);u.error(p)}else u.terminate()}});r.pipeThrough(a);const c=a.readable;return Object.setPrototypeOf(c,qc.prototype),c};class zc{constructor(t){this.allocByteArray=t,this.byteLength=0,this.byteArrays=[]}push(t){this.byteArrays.push(t),this.byteLength+=t.byteLength}flush(){if(this.byteArrays.length===1){const n=this.byteArrays[0];return this.reset(),n}const t=this.allocByteArray(this.byteLength);let r=0;for(let n=0;n<this.byteArrays.length;++n){const s=this.byteArrays[n];t.set(s,r),r+=s.byteLength}return this.reset(),t}reset(){this.byteArrays=[],this.byteLength=0}}function Vc(e,t,r){const n=e.getReader();let s=!1,i=0;const o=["",new zc(u=>new Uint8Array(u))];let a=-1;const c=async u=>{const{value:f,done:h}=await n.read(),p=f;if(h){if(a!==-1){const y=wr(o,a);Pt(y)>0&&u.enqueue(y)}u.close()}else{const y=Gc(p,!1);if(a!==y&&(a>=0&&u.enqueue(wr(o,a)),a=y),a===-1){u.enqueue(p);return}const E=Pt(p);i+=E;const x=Pt(o[a]);if(E>=t&&x===0)u.enqueue(p);else{const A=Kc(o,a,p);!s&&i>t*2&&(s=!0,r==null||r.warn(`@smithy/util-stream - stream chunk size ${E} is below threshold of ${t}, automatically buffering.`)),A>=t?u.enqueue(wr(o,a)):await c(u)}}};return new ReadableStream({pull:c})}const Wc=Vc;function Kc(e,t,r){switch(t){case 0:return e[0]+=r,Pt(e[0]);case 1:case 2:return e[t].push(r),Pt(e[t])}}function wr(e,t){switch(t){case 0:const r=e[0];return e[0]="",r;case 1:case 2:return e[t].flush()}throw new Error(`@smithy/util-stream - invalid index ${t} given to flush()`)}function Pt(e){return(e==null?void 0:e.byteLength)??(e==null?void 0:e.length)??0}function Gc(e,t=!0){return t&&typeof Buffer<"u"&&e instanceof Buffer?2:e instanceof Uint8Array?1:typeof e=="string"?0:-1}const Zc=(e,t)=>{const{base64Encoder:r,bodyLengthChecker:n,checksumAlgorithmFn:s,checksumLocationName:i,streamHasher:o}=t,a=r!==void 0&&n!==void 0&&s!==void 0&&i!==void 0&&o!==void 0,c=a?o(s,e):void 0,u=e.getReader();return new ReadableStream({async pull(f){const{value:h,done:p}=await u.read();if(p){if(f.enqueue(`0\r
`),a){const y=r(await c);f.enqueue(`${i}:${y}\r
`),f.enqueue(`\r
`)}f.close()}else f.enqueue(`${(n(h)||0).toString(16)}\r
${h}\r
`)}})};async function Yc(e,t){let r=0;const n=[],s=e.getReader();let i=!1;for(;!i;){const{done:c,value:u}=await s.read();if(u&&(n.push(u),r+=(u==null?void 0:u.byteLength)??0),r>=t)break;i=c}s.releaseLock();const o=new Uint8Array(Math.min(t,r));let a=0;for(const c of n){if(c.byteLength>o.byteLength-a){o.set(c.subarray(0,o.byteLength-a),a);break}else o.set(c,a);a+=c.length}return o}const st=e=>encodeURIComponent(e).replace(/[!'()*]/g,Xc),Xc=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function Qc(e){const t=[];for(let r of Object.keys(e).sort()){const n=e[r];if(r=st(r),Array.isArray(n))for(let s=0,i=n.length;s<i;s++)t.push(`${r}=${st(n[s])}`);else{let s=r;(n||typeof n=="string")&&(s+=`=${st(n)}`),t.push(s)}}return t.join("&")}function us(e,t){return new Request(e,t)}function Jc(e=0){return new Promise((t,r)=>{e&&setTimeout(()=>{const n=new Error(`Request did not complete within ${e} ms`);n.name="TimeoutError",r(n)},e)})}const br={supported:void 0};class vn{static create(t){return typeof(t==null?void 0:t.handle)=="function"?t:new vn(t)}constructor(t){typeof t=="function"?this.configProvider=t().then(r=>r||{}):(this.config=t??{},this.configProvider=Promise.resolve(this.config)),br.supported===void 0&&(br.supported=typeof Request<"u"&&"keepalive"in us("https://[::1]"))}destroy(){}async handle(t,{abortSignal:r,requestTimeout:n}={}){var s;this.config||(this.config=await this.configProvider);const i=n??this.config.requestTimeout,o=this.config.keepAlive===!0,a=this.config.credentials;if(r!=null&&r.aborted){const F=new Error("Request aborted");return F.name="AbortError",Promise.reject(F)}let c=t.path;const u=Qc(t.query||{});u&&(c+=`?${u}`),t.fragment&&(c+=`#${t.fragment}`);let f="";if(t.username!=null||t.password!=null){const F=t.username??"",G=t.password??"";f=`${F}:${G}@`}const{port:h,method:p}=t,y=`${t.protocol}//${f}${t.hostname}${h?`:${h}`:""}${c}`,E=p==="GET"||p==="HEAD"?void 0:t.body,x={body:E,headers:new Headers(t.headers),method:p,credentials:a};(s=this.config)!=null&&s.cache&&(x.cache=this.config.cache),E&&(x.duplex="half"),typeof AbortController<"u"&&(x.signal=r),br.supported&&(x.keepalive=o),typeof this.config.requestInit=="function"&&Object.assign(x,this.config.requestInit(t));let A=()=>{};const L=us(y,x),W=[fetch(L).then(F=>{const G=F.headers,he={};for(const oe of G.entries())he[oe[0]]=oe[1];return F.body!=null?{response:new pt({headers:he,reason:F.statusText,statusCode:F.status,body:F.body})}:F.blob().then(oe=>({response:new pt({headers:he,reason:F.statusText,statusCode:F.status,body:oe})}))}),Jc(i)];return r&&W.push(new Promise((F,G)=>{const he=()=>{const oe=new Error("Request aborted");oe.name="AbortError",G(oe)};if(typeof r.addEventListener=="function"){const oe=r;oe.addEventListener("abort",he,{once:!0}),A=()=>oe.removeEventListener("abort",he)}else r.onabort=he})),Promise.race(W).finally(A)}updateHttpClientConfig(t,r){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[t]=r,n))}httpHandlerConfigs(){return this.config??{}}}const yo=async e=>{var t;return typeof Blob=="function"&&e instanceof Blob||((t=e.constructor)==null?void 0:t.name)==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await e.arrayBuffer()):eu(e):tu(e)};async function eu(e){const t=await ru(e),r=wn(t);return new Uint8Array(r)}async function tu(e){const t=[],r=e.getReader();let n=!1,s=0;for(;!n;){const{done:a,value:c}=await r.read();c&&(t.push(c),s+=c.length),n=a}const i=new Uint8Array(s);let o=0;for(const a of t)i.set(a,o),o+=a.length;return i}function ru(e){return new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const s=n.result??"",i=s.indexOf(","),o=i>-1?i+1:s.length;t(s.substring(o))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(e)})}const wo={},on={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),wo[e]=t,on[t]=e}function bo(e){if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2){const n=e.slice(r,r+2).toLowerCase();if(n in on)t[r/2]=on[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return t}function Re(e){let t="";for(let r=0;r<e.byteLength;r++)t+=wo[e[r]];return t}const ls="The stream has already been transformed.",nu=e=>{var t,r;if(!ds(e)&&!sn(e)){const o=((r=(t=e==null?void 0:e.__proto__)==null?void 0:t.constructor)==null?void 0:r.name)||e;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${o}`)}let n=!1;const s=async()=>{if(n)throw new Error(ls);return n=!0,await yo(e)},i=o=>{if(typeof o.stream!="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return o.stream()};return Object.assign(e,{transformToByteArray:s,transformToString:async o=>{const a=await s();if(o==="base64")return sr(a);if(o==="hex")return Re(a);if(o===void 0||o==="utf8"||o==="utf-8")return bn(a);if(typeof TextDecoder=="function")return new TextDecoder(o).decode(a);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(n)throw new Error(ls);if(n=!0,ds(e))return i(e);if(sn(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},ds=e=>typeof Blob=="function"&&e instanceof Blob;async function su(e){return typeof e.stream=="function"&&(e=e.stream()),e.tee()}const vo=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return nt.mutate(e);if(!e)return nt.mutate(new Uint8Array);const r=t.streamCollector(e);return nt.mutate(await r)};function hs(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}const So=e=>{switch(e){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${e}"`)}},iu=e=>{if(e!=null){if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&Ro.warn(ko(`Expected number but observed string: ${e}`)),t}if(typeof e=="number")return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},ou=Math.ceil(2**127*(2-2**-23)),au=e=>{const t=iu(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>ou)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},Eo=e=>{if(e!=null){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}},cu=e=>Ao(e,16),uu=e=>Ao(e,8),Ao=(e,t)=>{const r=Eo(e);if(r!==void 0&&lu(r,t)!==r)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return r},lu=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},xo=(e,t)=>{if(e==null)throw t?new TypeError(`Expected a non-null value for ${t}`):new TypeError("Expected a non-null value");return e},du=e=>{if(e==null)return;if(typeof e=="object"&&!Array.isArray(e))return e;const t=Array.isArray(e)?"array":typeof e;throw new TypeError(`Expected object, got ${t}: ${e}`)},Tt=e=>{if(e!=null){if(typeof e=="string")return e;if(["boolean","number","bigint"].includes(typeof e))return Ro.warn(ko(`Expected string, got ${typeof e}: ${e}`)),String(e);throw new TypeError(`Expected string, got ${typeof e}: ${e}`)}},hu=e=>au(typeof e=="string"?ir(e):e),fu=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,ir=e=>{const t=e.match(fu);if(t===null||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},pu=e=>Eo(typeof e=="string"?ir(e):e),gu=e=>cu(typeof e=="string"?ir(e):e),mu=e=>uu(typeof e=="string"?ir(e):e),ko=e=>String(new TypeError(e).stack||e).split(`
`).slice(0,5).filter(t=>!t.includes("stackTraceWarning")).join(`
`),Ro={warn:console.warn},yu=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Co=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function wu(e){const t=e.getUTCFullYear(),r=e.getUTCMonth(),n=e.getUTCDay(),s=e.getUTCDate(),i=e.getUTCHours(),o=e.getUTCMinutes(),a=e.getUTCSeconds(),c=s<10?`0${s}`:`${s}`,u=i<10?`0${i}`:`${i}`,f=o<10?`0${o}`:`${o}`,h=a<10?`0${a}`:`${a}`;return`${yu[n]}, ${c} ${Co[r]} ${t} ${u}:${f}:${h} GMT`}const bu=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),vu=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=bu.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,s,i,o,a,c,u,f]=t,h=gu(Po(n)),p=It(s,"month",1,12),y=It(i,"day",1,31),E=Su(h,p,y,{hours:o,minutes:a,seconds:c,fractionalMilliseconds:u});return f.toUpperCase()!="Z"&&E.setTime(E.getTime()-Ru(f)),E},Su=(e,t,r,n)=>{const s=t-1;return Au(e,s,r),new Date(Date.UTC(e,s,r,It(n.hours,"hour",0,23),It(n.minutes,"minute",0,59),It(n.seconds,"seconds",0,60),ku(n.fractionalMilliseconds)))},Eu=[31,28,31,30,31,30,31,31,30,31,30,31],Au=(e,t,r)=>{let n=Eu[t];if(t===1&&xu(e)&&(n=29),r>n)throw new TypeError(`Invalid day for ${Co[t]} in ${e}: ${r}`)},xu=e=>e%4===0&&(e%100!==0||e%400===0),It=(e,t,r,n)=>{const s=mu(Po(e));if(s<r||s>n)throw new TypeError(`${t} must be between ${r} and ${n}, inclusive`);return s},ku=e=>e==null?0:hu("0."+e)*1e3,Ru=e=>{const t=e[0];let r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);const n=Number(e.substring(1,3)),s=Number(e.substring(4,6));return r*(n*60+s)*60*1e3},Po=e=>{let t=0;for(;t<e.length-1&&e.charAt(t)==="0";)t++;return t===0?e:e.slice(t)},Cu=(e,t,r,n,s,i)=>{if(t!=null&&t[r]!==void 0){const o=n();if(o.length<=0)throw new Error("Empty value provided for input HTTP label: "+r+".");e=e.replace(s,i?o.split("/").map(a=>hs(a)).join("/"):hs(o))}else throw new Error("No value provided for input HTTP label: "+r+".");return e};function To(e,t){return new Pu(e,t)}class Pu{constructor(t,r){this.input=t,this.context=r,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){const{hostname:t,protocol:r="https",port:n,path:s}=await this.context.endpoint();this.path=s;for(const i of this.resolvePathStack)i(this.path);return new se({protocol:r,hostname:this.hostname||t,port:n,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(t){return this.hostname=t,this}bp(t){return this.resolvePathStack.push(r=>{this.path=`${r!=null&&r.endsWith("/")?r.slice(0,-1):r||""}`+t}),this}p(t,r,n,s){return this.resolvePathStack.push(i=>{this.path=Cu(i,this.input,t,r,n,s)}),this}h(t){return this.headers=t,this}q(t){return this.query=t,this}b(t){return this.body=t,this}m(t){return this.method=t,this}}function Tu(e,t,r){e.__smithy_context?e.__smithy_context.features||(e.__smithy_context.features={}):e.__smithy_context={features:{}},e.__smithy_context.features[t]=r}class Iu{constructor(t){this.authSchemes=new Map;for(const[r,n]of Object.entries(t))n!==void 0&&this.authSchemes.set(r,n)}getIdentityProvider(t){return this.authSchemes.get(t)}}const Nu=e=>t=>Io(t)&&t.expiration.getTime()-Date.now()<e,Ou=3e5,Mu=Nu(Ou),Io=e=>e.expiration!==void 0,Uu=(e,t,r)=>{if(e===void 0)return;const n=typeof e!="function"?async()=>Promise.resolve(e):e;let s,i,o,a=!1;const c=async u=>{i||(i=n(u));try{s=await i,o=!0,a=!1}finally{i=void 0}return s};return t===void 0?async u=>((!o||u!=null&&u.forceRefresh)&&(s=await c(u)),s):async u=>((!o||u!=null&&u.forceRefresh)&&(s=await c(u)),a?s:r(s)?(t(s)&&await c(u),s):(a=!0,s))},$u=(e,t,r)=>{let n,s,i,o=!1;const a=async()=>{s||(s=e());try{n=await s,i=!0,o=!1}finally{s=void 0}return n};return t===void 0?async c=>((!i||c!=null&&c.forceRefresh)&&(n=await a()),n):async c=>((!i||c!=null&&c.forceRefresh)&&(n=await a()),o?n:r&&!r(n)?(o=!0,n):(t(n)&&await a(),n))},Du=e=>(e.sigv4aSigningRegionSet=ht(e.sigv4aSigningRegionSet),e),_u="X-Amz-Algorithm",Bu="X-Amz-Credential",No="X-Amz-Date",Lu="X-Amz-SignedHeaders",Fu="X-Amz-Expires",Oo="X-Amz-Signature",Mo="X-Amz-Security-Token",Uo="authorization",$o=No.toLowerCase(),Hu="date",qu=[Uo,$o,Hu],ju=Oo.toLowerCase(),an="x-amz-content-sha256",zu=Mo.toLowerCase(),Vu={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Wu=/^proxy-/,Ku=/^sec-/,vr="AWS4-HMAC-SHA256",Gu="AWS4-HMAC-SHA256-PAYLOAD",Zu="UNSIGNED-PAYLOAD",Yu=50,Do="aws4_request",Xu=60*60*24*7,_t={},Sr=[],Er=(e,t,r)=>`${e}/${t}/${r}/${Do}`,Qu=async(e,t,r,n,s)=>{const i=await fs(e,t.secretAccessKey,t.accessKeyId),o=`${r}:${n}:${s}:${Re(i)}:${t.sessionToken}`;if(o in _t)return _t[o];for(Sr.push(o);Sr.length>Yu;)delete _t[Sr.shift()];let a=`AWS4${t.secretAccessKey}`;for(const c of[r,n,s,Do])a=await fs(e,a,c);return _t[o]=a},fs=(e,t,r)=>{const n=new e(t);return n.update(mt(r)),n.digest()},ps=({headers:e},t,r)=>{const n={};for(const s of Object.keys(e).sort()){if(e[s]==null)continue;const i=s.toLowerCase();(i in Vu||t!=null&&t.has(i)||Wu.test(i)||Ku.test(i))&&(!r||r&&!r.has(i))||(n[i]=e[s].trim().replace(/\s+/g," "))}return n},_o=e=>typeof ArrayBuffer=="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]",Ar=async({headers:e,body:t},r)=>{for(const n of Object.keys(e))if(n.toLowerCase()===an)return e[n];if(t==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof t=="string"||ArrayBuffer.isView(t)||_o(t)){const n=new r;return n.update(mt(t)),Re(await n.digest())}return Zu};class Ju{format(t){const r=[];for(const i of Object.keys(t)){const o=it(i);r.push(Uint8Array.from([o.byteLength]),o,this.formatHeaderValue(t[i]))}const n=new Uint8Array(r.reduce((i,o)=>i+o.byteLength,0));let s=0;for(const i of r)n.set(i,s),s+=i.byteLength;return n}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,t.value,!1),new Uint8Array(r.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,t.value,!1),new Uint8Array(n.buffer);case"long":const s=new Uint8Array(9);return s[0]=5,s.set(t.value.bytes,1),s;case"binary":const i=new DataView(new ArrayBuffer(3+t.value.byteLength));i.setUint8(0,6),i.setUint16(1,t.value.byteLength,!1);const o=new Uint8Array(i.buffer);return o.set(t.value,3),o;case"string":const a=it(t.value),c=new DataView(new ArrayBuffer(3+a.byteLength));c.setUint8(0,7),c.setUint16(1,a.byteLength,!1);const u=new Uint8Array(c.buffer);return u.set(a,3),u;case"timestamp":const f=new Uint8Array(9);return f[0]=8,f.set(tl.fromNumber(t.value.valueOf()).bytes,1),f;case"uuid":if(!el.test(t.value))throw new Error(`Invalid UUID received: ${t.value}`);const h=new Uint8Array(17);return h[0]=9,h.set(bo(t.value.replace(/\-/g,"")),1),h}}}var gs;(function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"})(gs||(gs={}));const el=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;let tl=class Bo{constructor(t){if(this.bytes=t,t.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let n=7,s=Math.abs(Math.round(t));n>-1&&s>0;n--,s/=256)r[n]=s;return t<0&&ms(r),new Bo(r)}valueOf(){const t=this.bytes.slice(0),r=t[0]&128;return r&&ms(t),parseInt(Re(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}};function ms(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}const rl=(e,t)=>{e=e.toLowerCase();for(const r of Object.keys(t))if(e===r.toLowerCase())return!0;return!1},nl=(e,t={})=>{var r,n;const{headers:s,query:i={}}=se.clone(e);for(const o of Object.keys(s)){const a=o.toLowerCase();(a.slice(0,6)==="x-amz-"&&!((r=t.unhoistableHeaders)!=null&&r.has(a))||(n=t.hoistableHeaders)!=null&&n.has(a))&&(i[o]=s[o],delete s[o])}return{...e,headers:s,query:i}},ys=e=>{e=se.clone(e);for(const t of Object.keys(e.headers))qu.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},sl=({query:e={}})=>{const t=[],r={};for(const n of Object.keys(e)){if(n.toLowerCase()===ju)continue;const s=st(n);t.push(s);const i=e[n];typeof i=="string"?r[s]=`${s}=${st(i)}`:Array.isArray(i)&&(r[s]=i.slice(0).reduce((o,a)=>o.concat([`${s}=${st(a)}`]),[]).sort().join("&"))}return t.sort().map(n=>r[n]).filter(n=>n).join("&")},il=e=>ol(e).toISOString().replace(/\.\d{3}Z$/,"Z"),ol=e=>typeof e=="number"?new Date(e*1e3):typeof e=="string"?Number(e)?new Date(Number(e)*1e3):new Date(e):e;class al{constructor({applyChecksum:t,credentials:r,region:n,service:s,sha256:i,uriEscapePath:o=!0}){this.service=s,this.sha256=i,this.uriEscapePath=o,this.applyChecksum=typeof t=="boolean"?t:!0,this.regionProvider=Me(n),this.credentialProvider=Me(r)}createCanonicalRequest(t,r,n){const s=Object.keys(r).sort();return`${t.method}
${this.getCanonicalPath(t)}
${sl(t)}
${s.map(i=>`${i}:${r[i]}`).join(`
`)}
${s.join(";")}
${n}`}async createStringToSign(t,r,n,s){const i=new this.sha256;i.update(mt(n));const o=await i.digest();return`${s}
${t}
${r}
${Re(o)}`}getCanonicalPath({path:t}){if(this.uriEscapePath){const r=[];for(const s of t.split("/"))(s==null?void 0:s.length)!==0&&s!=="."&&(s===".."?r.pop():r.push(s));const n=`${t!=null&&t.startsWith("/")?"/":""}${r.join("/")}${r.length>0&&t!=null&&t.endsWith("/")?"/":""}`;return st(n).replace(/%2F/g,"/")}return t}validateResolvedCredentials(t){if(typeof t!="object"||typeof t.accessKeyId!="string"||typeof t.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(t){const r=il(t).replace(/[\-:]/g,"");return{longDate:r,shortDate:r.slice(0,8)}}getCanonicalHeaderList(t){return Object.keys(t).sort().join(";")}}class cn extends al{constructor({applyChecksum:t,credentials:r,region:n,service:s,sha256:i,uriEscapePath:o=!0}){super({applyChecksum:t,credentials:r,region:n,service:s,sha256:i,uriEscapePath:o}),this.headerFormatter=new Ju}async presign(t,r={}){const{signingDate:n=new Date,expiresIn:s=3600,unsignableHeaders:i,unhoistableHeaders:o,signableHeaders:a,hoistableHeaders:c,signingRegion:u,signingService:f}=r,h=await this.credentialProvider();this.validateResolvedCredentials(h);const p=u??await this.regionProvider(),{longDate:y,shortDate:E}=this.formatDate(n);if(s>Xu)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const x=Er(E,p,f??this.service),A=nl(ys(t),{unhoistableHeaders:o,hoistableHeaders:c});h.sessionToken&&(A.query[Mo]=h.sessionToken),A.query[_u]=vr,A.query[Bu]=`${h.accessKeyId}/${x}`,A.query[No]=y,A.query[Fu]=s.toString(10);const L=ps(A,i,a);return A.query[Lu]=this.getCanonicalHeaderList(L),A.query[Oo]=await this.getSignature(y,x,this.getSigningKey(h,p,E,f),this.createCanonicalRequest(A,L,await Ar(t,this.sha256))),A}async sign(t,r){return typeof t=="string"?this.signString(t,r):t.headers&&t.payload?this.signEvent(t,r):t.message?this.signMessage(t,r):this.signRequest(t,r)}async signEvent({headers:t,payload:r},{signingDate:n=new Date,priorSignature:s,signingRegion:i,signingService:o}){const a=i??await this.regionProvider(),{shortDate:c,longDate:u}=this.formatDate(n),f=Er(c,a,o??this.service),h=await Ar({headers:{},body:r},this.sha256),p=new this.sha256;p.update(t);const y=Re(await p.digest()),E=[Gu,u,f,s,y,h].join(`
`);return this.signString(E,{signingDate:n,signingRegion:a,signingService:o})}async signMessage(t,{signingDate:r=new Date,signingRegion:n,signingService:s}){return this.signEvent({headers:this.headerFormatter.format(t.message.headers),payload:t.message.body},{signingDate:r,signingRegion:n,signingService:s,priorSignature:t.priorSignature}).then(i=>({message:t.message,signature:i}))}async signString(t,{signingDate:r=new Date,signingRegion:n,signingService:s}={}){const i=await this.credentialProvider();this.validateResolvedCredentials(i);const o=n??await this.regionProvider(),{shortDate:a}=this.formatDate(r),c=new this.sha256(await this.getSigningKey(i,o,a,s));return c.update(mt(t)),Re(await c.digest())}async signRequest(t,{signingDate:r=new Date,signableHeaders:n,unsignableHeaders:s,signingRegion:i,signingService:o}={}){const a=await this.credentialProvider();this.validateResolvedCredentials(a);const c=i??await this.regionProvider(),u=ys(t),{longDate:f,shortDate:h}=this.formatDate(r),p=Er(h,c,o??this.service);u.headers[$o]=f,a.sessionToken&&(u.headers[zu]=a.sessionToken);const y=await Ar(u,this.sha256);!rl(an,u.headers)&&this.applyChecksum&&(u.headers[an]=y);const E=ps(u,s,n),x=await this.getSignature(f,p,this.getSigningKey(a,c,h,o),this.createCanonicalRequest(u,E,y));return u.headers[Uo]=`${vr} Credential=${a.accessKeyId}/${p}, SignedHeaders=${this.getCanonicalHeaderList(E)}, Signature=${x}`,u}async getSignature(t,r,n,s){const i=await this.createStringToSign(t,r,s,vr),o=new this.sha256(await n);return o.update(mt(i)),Re(await o.digest())}getSigningKey(t,r,n,s){return Qu(this.sha256,t,n,r,s||this.service)}}const cl=e=>{let t=e.credentials,r=!!e.credentials,n;Object.defineProperty(e,"credentials",{set(c){c&&c!==t&&c!==n&&(r=!0),t=c;const u=ul(e,{credentials:t,credentialDefaultProvider:e.credentialDefaultProvider}),f=ll(e,u);r&&!f.attributed?(n=async h=>f(h).then(p=>Ac(p,"CREDENTIALS_CODE","e")),n.memoized=f.memoized,n.configBound=f.configBound,n.attributed=!0):n=f},get(){return n},enumerable:!0,configurable:!0}),e.credentials=t;const{signingEscapePath:s=!0,systemClockOffset:i=e.systemClockOffset||0,sha256:o}=e;let a;return e.signer?a=ht(e.signer):e.regionInfoProvider?a=()=>ht(e.region)().then(async c=>[await e.regionInfoProvider(c,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},c]).then(([c,u])=>{const{signingRegion:f,signingService:h}=c;e.signingRegion=e.signingRegion||f||u,e.signingName=e.signingName||h||e.serviceId;const p={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:s},y=e.signerConstructor||cn;return new y(p)}):a=async c=>{c=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await ht(e.region)(),properties:{}},c);const u=c.signingRegion,f=c.signingName;e.signingRegion=e.signingRegion||u,e.signingName=e.signingName||f||e.serviceId;const h={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:s},p=e.signerConstructor||cn;return new p(h)},Object.assign(e,{systemClockOffset:i,signingEscapePath:s,signer:a})};function ul(e,{credentials:t,credentialDefaultProvider:r}){let n;return t?t!=null&&t.memoized?n=t:n=Uu(t,Mu,Io):r?n=ht(r(Object.assign({},e,{parentClientConfig:e}))):n=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},n.memoized=!0,n}function ll(e,t){if(t.configBound)return t;const r=async n=>t({...n,callerClientConfig:e});return r.memoized=t.memoized,r.configBound=!0,r}const ws=typeof TextEncoder=="function"?new TextEncoder:null,dl=e=>{if(typeof e=="string"){if(ws)return ws.encode(e).byteLength;let t=e.length;for(let r=t-1;r>=0;r--){const n=e.charCodeAt(r);n>127&&n<=2047?t++:n>2047&&n<=65535&&(t+=2),n>=56320&&n<=57343&&r--}return t}else{if(typeof e.byteLength=="number")return e.byteLength;if(typeof e.size=="number")return e.size}throw new Error(`Body Length computation failed for ${e}`)},Ye=(e,t)=>{const r=[];if(e&&r.push(e),t)for(const n of t)r.push(n);return r},Le=(e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,Zt=()=>{let e=[],t=[],r=!1;const n=new Set,s=h=>h.sort((p,y)=>bs[y.step]-bs[p.step]||vs[y.priority||"normal"]-vs[p.priority||"normal"]),i=h=>{let p=!1;const y=E=>{const x=Ye(E.name,E.aliases);if(x.includes(h)){p=!0;for(const A of x)n.delete(A);return!1}return!0};return e=e.filter(y),t=t.filter(y),p},o=h=>{let p=!1;const y=E=>{if(E.middleware===h){p=!0;for(const x of Ye(E.name,E.aliases))n.delete(x);return!1}return!0};return e=e.filter(y),t=t.filter(y),p},a=h=>{var p;return e.forEach(y=>{h.add(y.middleware,{...y})}),t.forEach(y=>{h.addRelativeTo(y.middleware,{...y})}),(p=h.identifyOnResolve)==null||p.call(h,f.identifyOnResolve()),h},c=h=>{const p=[];return h.before.forEach(y=>{y.before.length===0&&y.after.length===0?p.push(y):p.push(...c(y))}),p.push(h),h.after.reverse().forEach(y=>{y.before.length===0&&y.after.length===0?p.push(y):p.push(...c(y))}),p},u=(h=!1)=>{const p=[],y=[],E={};return e.forEach(x=>{const A={...x,before:[],after:[]};for(const L of Ye(A.name,A.aliases))E[L]=A;p.push(A)}),t.forEach(x=>{const A={...x,before:[],after:[]};for(const L of Ye(A.name,A.aliases))E[L]=A;y.push(A)}),y.forEach(x=>{if(x.toMiddleware){const A=E[x.toMiddleware];if(A===void 0){if(h)return;throw new Error(`${x.toMiddleware} is not found when adding ${Le(x.name,x.aliases)} middleware ${x.relation} ${x.toMiddleware}`)}x.relation==="after"&&A.after.push(x),x.relation==="before"&&A.before.push(x)}}),s(p).map(c).reduce((x,A)=>(x.push(...A),x),[])},f={add:(h,p={})=>{const{name:y,override:E,aliases:x}=p,A={step:"initialize",priority:"normal",middleware:h,...p},L=Ye(y,x);if(L.length>0){if(L.some(W=>n.has(W))){if(!E)throw new Error(`Duplicate middleware name '${Le(y,x)}'`);for(const W of L){const F=e.findIndex(he=>{var oe;return he.name===W||((oe=he.aliases)==null?void 0:oe.some(gr=>gr===W))});if(F===-1)continue;const G=e[F];if(G.step!==A.step||A.priority!==G.priority)throw new Error(`"${Le(G.name,G.aliases)}" middleware with ${G.priority} priority in ${G.step} step cannot be overridden by "${Le(y,x)}" middleware with ${A.priority} priority in ${A.step} step.`);e.splice(F,1)}}for(const W of L)n.add(W)}e.push(A)},addRelativeTo:(h,p)=>{const{name:y,override:E,aliases:x}=p,A={middleware:h,...p},L=Ye(y,x);if(L.length>0){if(L.some(W=>n.has(W))){if(!E)throw new Error(`Duplicate middleware name '${Le(y,x)}'`);for(const W of L){const F=t.findIndex(he=>{var oe;return he.name===W||((oe=he.aliases)==null?void 0:oe.some(gr=>gr===W))});if(F===-1)continue;const G=t[F];if(G.toMiddleware!==A.toMiddleware||G.relation!==A.relation)throw new Error(`"${Le(G.name,G.aliases)}" middleware ${G.relation} "${G.toMiddleware}" middleware cannot be overridden by "${Le(y,x)}" middleware ${A.relation} "${A.toMiddleware}" middleware.`);t.splice(F,1)}}for(const W of L)n.add(W)}t.push(A)},clone:()=>a(Zt()),use:h=>{h.applyToStack(f)},remove:h=>typeof h=="string"?i(h):o(h),removeByTag:h=>{let p=!1;const y=E=>{const{tags:x,name:A,aliases:L}=E;if(x&&x.includes(h)){const W=Ye(A,L);for(const F of W)n.delete(F);return p=!0,!1}return!0};return e=e.filter(y),t=t.filter(y),p},concat:h=>{var p;const y=a(Zt());return y.use(h),y.identifyOnResolve(r||y.identifyOnResolve()||(((p=h.identifyOnResolve)==null?void 0:p.call(h))??!1)),y},applyToStack:a,identify:()=>u(!0).map(h=>{const p=h.step??h.relation+" "+h.toMiddleware;return Le(h.name,h.aliases)+" - "+p}),identifyOnResolve(h){return typeof h=="boolean"&&(r=h),r},resolve:(h,p)=>{for(const y of u().map(E=>E.middleware).reverse())h=y(h,p);return h}};return f},bs={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},vs={high:3,normal:2,low:1};class hl{constructor(t){this.config=t,this.middlewareStack=Zt()}send(t,r,n){const s=typeof r!="function"?r:void 0,i=typeof r=="function"?r:n,o=s===void 0&&this.config.cacheMiddleware===!0;let a;if(o){this.handlers||(this.handlers=new WeakMap);const c=this.handlers;c.has(t.constructor)?a=c.get(t.constructor):(a=t.resolveMiddleware(this.middlewareStack,this.config,s),c.set(t.constructor,a))}else delete this.handlers,a=t.resolveMiddleware(this.middlewareStack,this.config,s);if(i)a(t).then(c=>i(null,c.output),c=>i(c)).catch(()=>{});else return a(t).then(c=>c.output)}destroy(){var t,r,n;(n=(r=(t=this.config)==null?void 0:t.requestHandler)==null?void 0:r.destroy)==null||n.call(r),delete this.handlers}}class Sn{constructor(){this.middlewareStack=Zt()}static classBuilder(){return new fl}resolveMiddlewareWithContext(t,r,n,{middlewareFn:s,clientName:i,commandName:o,inputFilterSensitiveLog:a,outputFilterSensitiveLog:c,smithyContext:u,additionalContext:f,CommandCtor:h}){for(const A of s.bind(this)(h,t,r,n))this.middlewareStack.use(A);const p=t.concat(this.middlewareStack),{logger:y}=r,E={logger:y,clientName:i,commandName:o,inputFilterSensitiveLog:a,outputFilterSensitiveLog:c,[rn]:{commandInstance:this,...u},...f},{requestHandler:x}=r;return p.resolve(A=>x.handle(A.request,n||{}),E)}}class fl{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=t=>t,this._outputFilterSensitiveLog=t=>t,this._serializer=null,this._deserializer=null}init(t){this._init=t}ep(t){return this._ep=t,this}m(t){return this._middlewareFn=t,this}s(t,r,n={}){return this._smithyContext={service:t,operation:r,...n},this}c(t={}){return this._additionalContext=t,this}n(t,r){return this._clientName=t,this._commandName=r,this}f(t=n=>n,r=n=>n){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=r,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}sc(t){return this._operationSchema=t,this._smithyContext.operationSchema=t,this}build(){const t=this;let r;return r=class extends Sn{static getEndpointParameterInstructions(){return t._ep}constructor(...[n]){super(),this.serialize=t._serializer,this.deserialize=t._deserializer,this.input=n??{},t._init(this),this.schema=t._operationSchema}resolveMiddleware(n,s,i){return this.resolveMiddlewareWithContext(n,s,i,{CommandCtor:r,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog,outputFilterSensitiveLog:t._outputFilterSensitiveLog,smithyContext:t._smithyContext,additionalContext:t._additionalContext})}}}}const Ue="***SensitiveInformation***";class dt extends Error{constructor(t){super(t.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}static isInstance(t){if(!t)return!1;const r=t;return dt.prototype.isPrototypeOf(r)||!!r.$fault&&!!r.$metadata&&(r.$fault==="client"||r.$fault==="server")}static[Symbol.hasInstance](t){if(!t)return!1;const r=t;return this===dt?dt.isInstance(t):dt.isInstance(t)?r.name&&this.name?this.prototype.isPrototypeOf(t)||r.name===this.name:this.prototype.isPrototypeOf(t):!1}}const ke=(e,t={})=>{Object.entries(t).filter(([,n])=>n!==void 0).forEach(([n,s])=>{(e[n]==null||e[n]==="")&&(e[n]=s)});const r=e.message||e.Message||"UnknownError";return e.message=r,delete e.Message,e},pl=({output:e,parsedBody:t,exceptionCtor:r,errorCode:n})=>{const s=ml(e),i=s.httpStatusCode?s.httpStatusCode+"":void 0,o=new r({name:(t==null?void 0:t.code)||(t==null?void 0:t.Code)||n||i||"UnknownError",$fault:"client",$metadata:s});throw ke(o,t)},gl=e=>({output:t,parsedBody:r,errorCode:n})=>{pl({output:t,parsedBody:r,exceptionCtor:e,errorCode:n})},ml=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),yl=e=>{switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},wl=e=>{const t=[];for(const r in Gt){const n=Gt[r];e[n]!==void 0&&t.push({algorithmId:()=>n,checksumConstructor:()=>e[n]})}return{addChecksumAlgorithm(r){t.push(r)},checksumAlgorithms(){return t}}},bl=e=>{const t={};return e.checksumAlgorithms().forEach(r=>{t[r.algorithmId()]=r.checksumConstructor()}),t},vl=e=>({setRetryStrategy(t){e.retryStrategy=t},retryStrategy(){return e.retryStrategy}}),Sl=e=>{const t={};return t.retryStrategy=e.retryStrategy(),t},El=e=>Object.assign(wl(e),vl(e)),Al=e=>Object.assign(bl(e),Sl(e)),Lo=e=>{const t="#text";for(const r in e)e.hasOwnProperty(r)&&e[r][t]!==void 0?e[r]=e[r][t]:typeof e[r]=="object"&&e[r]!==null&&(e[r]=Lo(e[r]));return e},ze=e=>e!=null;class En{trace(){}debug(){}info(){}warn(){}error(){}}function ee(e,t,r){let n,s,i;if(typeof t>"u"&&typeof r>"u")n={},i=e;else{if(n=e,typeof t=="function")return s=t,i=r,xl(n,s,i);i=t}for(const o of Object.keys(i)){if(!Array.isArray(i[o])){n[o]=i[o];continue}kl(n,null,i,o)}return n}const xl=(e,t,r)=>ee(e,Object.entries(r).reduce((n,[s,i])=>(Array.isArray(i)?n[s]=i:typeof i=="function"?n[s]=[t,i()]:n[s]=[t,i],n),{})),kl=(e,t,r,n)=>{let[s,i]=r[n];if(typeof i=="function"){let o;const a=s===void 0&&(o=i())!=null,c=typeof s=="function"&&!!s(void 0)||typeof s!="function"&&!!s;a?e[n]=o:c&&(e[n]=i())}else{const o=s===void 0&&i!=null,a=typeof s=="function"&&!!s(i)||typeof s!="function"&&!!s;(o||a)&&(e[n]=i)}},Rl=e=>e.toISOString().replace(".000Z","Z"),Cl=(e,t)=>vo(e,t).then(r=>t.utf8Encoder(r)),Fo=":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",Pl=Fo+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Tl="["+Fo+"]["+Pl+"]*",Il=new RegExp("^"+Tl+"$");function Ho(e,t){const r=[];let n=t.exec(e);for(;n;){const s=[];s.startIndex=t.lastIndex-n[0].length;const i=n.length;for(let o=0;o<i;o++)s.push(n[o]);r.push(s),n=t.exec(e)}return r}const An=function(e){const t=Il.exec(e);return!(t===null||typeof t>"u")};function Nl(e){return typeof e<"u"}const Ol={allowBooleanAttributes:!1,unpairedTags:[]};function Ml(e,t){t=Object.assign({},Ol,t);const r=[];let n=!1,s=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let i=0;i<e.length;i++)if(e[i]==="<"&&e[i+1]==="?"){if(i+=2,i=Es(e,i),i.err)return i}else if(e[i]==="<"){let o=i;if(i++,e[i]==="!"){i=As(e,i);continue}else{let a=!1;e[i]==="/"&&(a=!0,i++);let c="";for(;i<e.length&&e[i]!==">"&&e[i]!==" "&&e[i]!==" "&&e[i]!==`
`&&e[i]!=="\r";i++)c+=e[i];if(c=c.trim(),c[c.length-1]==="/"&&(c=c.substring(0,c.length-1),i--),!Hl(c)){let h;return c.trim().length===0?h="Invalid space after '<'.":h="Tag '"+c+"' is an invalid name.",X("InvalidTag",h,Se(e,i))}const u=Dl(e,i);if(u===!1)return X("InvalidAttr","Attributes for '"+c+"' have open quote.",Se(e,i));let f=u.value;if(i=u.index,f[f.length-1]==="/"){const h=i-f.length;f=f.substring(0,f.length-1);const p=xs(f,t);if(p===!0)n=!0;else return X(p.err.code,p.err.msg,Se(e,h+p.err.line))}else if(a)if(u.tagClosed){if(f.trim().length>0)return X("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",Se(e,o));if(r.length===0)return X("InvalidTag","Closing tag '"+c+"' has not been opened.",Se(e,o));{const h=r.pop();if(c!==h.tagName){let p=Se(e,h.tagStartPos);return X("InvalidTag","Expected closing tag '"+h.tagName+"' (opened in line "+p.line+", col "+p.col+") instead of closing tag '"+c+"'.",Se(e,o))}r.length==0&&(s=!0)}}else return X("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",Se(e,i));else{const h=xs(f,t);if(h!==!0)return X(h.err.code,h.err.msg,Se(e,i-f.length+h.err.line));if(s===!0)return X("InvalidXml","Multiple possible root nodes found.",Se(e,i));t.unpairedTags.indexOf(c)!==-1||r.push({tagName:c,tagStartPos:o}),n=!0}for(i++;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="!"){i++,i=As(e,i);continue}else if(e[i+1]==="?"){if(i=Es(e,++i),i.err)return i}else break;else if(e[i]==="&"){const h=Ll(e,i);if(h==-1)return X("InvalidChar","char '&' is not expected.",Se(e,i));i=h}else if(s===!0&&!Ss(e[i]))return X("InvalidXml","Extra text at the end",Se(e,i));e[i]==="<"&&i--}}else{if(Ss(e[i]))continue;return X("InvalidChar","char '"+e[i]+"' is not expected.",Se(e,i))}if(n){if(r.length==1)return X("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",Se(e,r[0].tagStartPos));if(r.length>0)return X("InvalidXml","Invalid '"+JSON.stringify(r.map(i=>i.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return X("InvalidXml","Start tag expected.",1);return!0}function Ss(e){return e===" "||e===" "||e===`
`||e==="\r"}function Es(e,t){const r=t;for(;t<e.length;t++)if(e[t]=="?"||e[t]==" "){const n=e.substr(r,t-r);if(t>5&&n==="xml")return X("InvalidXml","XML declaration allowed only at the start of the document.",Se(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function As(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let r=1;for(t+=8;t<e.length;t++)if(e[t]==="<")r++;else if(e[t]===">"&&(r--,r===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}const Ul='"',$l="'";function Dl(e,t){let r="",n="",s=!1;for(;t<e.length;t++){if(e[t]===Ul||e[t]===$l)n===""?n=e[t]:n!==e[t]||(n="");else if(e[t]===">"&&n===""){s=!0;break}r+=e[t]}return n!==""?!1:{value:r,index:t,tagClosed:s}}const _l=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function xs(e,t){const r=Ho(e,_l),n={};for(let s=0;s<r.length;s++){if(r[s][1].length===0)return X("InvalidAttr","Attribute '"+r[s][2]+"' has no space in starting.",At(r[s]));if(r[s][3]!==void 0&&r[s][4]===void 0)return X("InvalidAttr","Attribute '"+r[s][2]+"' is without value.",At(r[s]));if(r[s][3]===void 0&&!t.allowBooleanAttributes)return X("InvalidAttr","boolean attribute '"+r[s][2]+"' is not allowed.",At(r[s]));const i=r[s][2];if(!Fl(i))return X("InvalidAttr","Attribute '"+i+"' is an invalid name.",At(r[s]));if(!n.hasOwnProperty(i))n[i]=1;else return X("InvalidAttr","Attribute '"+i+"' is repeated.",At(r[s]))}return!0}function Bl(e,t){let r=/\d/;for(e[t]==="x"&&(t++,r=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(r))break}return-1}function Ll(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,Bl(e,t);let r=0;for(;t<e.length;t++,r++)if(!(e[t].match(/\w/)&&r<20)){if(e[t]===";")break;return-1}return t}function X(e,t,r){return{err:{code:e,msg:t,line:r.line||r,col:r.col}}}function Fl(e){return An(e)}function Hl(e){return An(e)}function Se(e,t){const r=e.substring(0,t).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function At(e){return e.startIndex+e[1].length}const ql={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,r){return e},captureMetaData:!1},jl=function(e){return Object.assign({},ql,e)};let Yt;typeof Symbol!="function"?Yt="@@xmlMetadata":Yt=Symbol("XML Node Metadata");class Qe{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,r){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:r})}addChild(t,r){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),r!==void 0&&(this.child[this.child.length-1][Yt]={startIndex:r})}static getMetaDataSymbol(){return Yt}}function zl(e,t){const r={};if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let n=1,s=!1,i=!1,o="";for(;t<e.length;t++)if(e[t]==="<"&&!i){if(s&&Je(e,"!ENTITY",t)){t+=7;let a,c;[a,c,t]=Vl(e,t+1),c.indexOf("&")===-1&&(r[a]={regx:RegExp(`&${a};`,"g"),val:c})}else if(s&&Je(e,"!ELEMENT",t)){t+=8;const{index:a}=Kl(e,t+1);t=a}else if(s&&Je(e,"!ATTLIST",t))t+=8;else if(s&&Je(e,"!NOTATION",t)){t+=9;const{index:a}=Wl(e,t+1);t=a}else if(Je(e,"!--",t))i=!0;else throw new Error("Invalid DOCTYPE");n++,o=""}else if(e[t]===">"){if(i?e[t-1]==="-"&&e[t-2]==="-"&&(i=!1,n--):n--,n===0)break}else e[t]==="["?s=!0:o+=e[t];if(n!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:r,i:t}}const Ve=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function Vl(e,t){t=Ve(e,t);let r="";for(;t<e.length&&!/\s/.test(e[t])&&e[t]!=='"'&&e[t]!=="'";)r+=e[t],t++;if(xn(r),t=Ve(e,t),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 n="";return[t,n]=jt(e,t,"entity"),t--,[r,n,t]}function Wl(e,t){t=Ve(e,t);let r="";for(;t<e.length&&!/\s/.test(e[t]);)r+=e[t],t++;xn(r),t=Ve(e,t);const n=e.substring(t,t+6).toUpperCase();if(n!=="SYSTEM"&&n!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${n}"`);t+=n.length,t=Ve(e,t);let s=null,i=null;if(n==="PUBLIC")[t,s]=jt(e,t,"publicIdentifier"),t=Ve(e,t),(e[t]==='"'||e[t]==="'")&&([t,i]=jt(e,t,"systemIdentifier"));else if(n==="SYSTEM"&&([t,i]=jt(e,t,"systemIdentifier"),!i))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:r,publicIdentifier:s,systemIdentifier:i,index:--t}}function jt(e,t,r){let n="";const s=e[t];if(s!=='"'&&s!=="'")throw new Error(`Expected quoted string, found "${s}"`);for(t++;t<e.length&&e[t]!==s;)n+=e[t],t++;if(e[t]!==s)throw new Error(`Unterminated ${r} value`);return t++,[t,n]}function Kl(e,t){t=Ve(e,t);let r="";for(;t<e.length&&!/\s/.test(e[t]);)r+=e[t],t++;if(!xn(r))throw new Error(`Invalid element name: "${r}"`);t=Ve(e,t);let n="";if(e[t]==="E"&&Je(e,"MPTY",t))t+=4;else if(e[t]==="A"&&Je(e,"NY",t))t+=2;else if(e[t]==="("){for(t++;t<e.length&&e[t]!==")";)n+=e[t],t++;if(e[t]!==")")throw new Error("Unterminated content model")}else throw new Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:r,contentModel:n.trim(),index:t}}function Je(e,t,r){for(let n=0;n<t.length;n++)if(t[n]!==e[r+n+1])return!1;return!0}function xn(e){if(An(e))return e;throw new Error(`Invalid entity name ${e}`)}const Gl=/^[-+]?0x[a-fA-F0-9]+$/,Zl=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Yl={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function Xl(e,t={}){if(t=Object.assign({},Yl,t),!e||typeof e!="string")return e;let r=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(r))return e;if(e==="0")return 0;if(t.hex&&Gl.test(r))return td(r,16);if(r.search(/.+[eE].+/)!==-1)return Jl(e,r,t);{const n=Zl.exec(r);if(n){const s=n[1]||"",i=n[2];let o=ed(n[3]);const a=s?e[i.length+1]===".":e[i.length]===".";if(!t.leadingZeros&&(i.length>1||i.length===1&&!a))return e;{const c=Number(r),u=String(c);if(c===0)return c;if(u.search(/[eE]/)!==-1)return t.eNotation?c:e;if(r.indexOf(".")!==-1)return u==="0"||u===o||u===`${s}${o}`?c:e;let f=i?o:r;return i?f===u||s+f===u?c:e:f===u||f===s+u?c:e}}else return e}}const Ql=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Jl(e,t,r){if(!r.eNotation)return e;const n=t.match(Ql);if(n){let s=n[1]||"";const i=n[3].indexOf("e")===-1?"E":"e",o=n[2],a=s?e[o.length+1]===i:e[o.length]===i;return o.length>1&&a?e:o.length===1&&(n[3].startsWith(`.${i}`)||n[3][0]===i)?Number(t):r.leadingZeros&&!a?(t=(n[1]||"")+n[3],Number(t)):e}else return e}function ed(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substring(0,e.length-1))),e}function td(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function rd(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(const r of e)if(typeof r=="string"&&t===r||r instanceof RegExp&&r.test(t))return!0}:()=>!1}class nd{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(r,n)=>String.fromCodePoint(Number.parseInt(n,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(r,n)=>String.fromCodePoint(Number.parseInt(n,16))}},this.addExternalEntities=sd,this.parseXml=ud,this.parseTextData=id,this.resolveNameSpace=od,this.buildAttributesMap=cd,this.isItStopNode=fd,this.replaceEntitiesValue=dd,this.readStopNodeData=gd,this.saveTextToParentTag=hd,this.addChild=ld,this.ignoreAttributesFn=rd(this.options.ignoreAttributes)}}function sd(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const n=t[r];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:e[n]}}}function id(e,t,r,n,s,i,o){if(e!==void 0&&(this.options.trimValues&&!n&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e));const a=this.options.tagValueProcessor(t,e,r,s,i);return a==null?e:typeof a!=typeof e||a!==e?a:this.options.trimValues?ln(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?ln(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function od(e){if(this.options.removeNSPrefix){const t=e.split(":"),r=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=r+t[1])}return e}const ad=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function cd(e,t,r){if(this.options.ignoreAttributes!==!0&&typeof e=="string"){const n=Ho(e,ad),s=n.length,i={};for(let o=0;o<s;o++){const a=this.resolveNameSpace(n[o][1]);if(this.ignoreAttributesFn(a,t))continue;let c=n[o][4],u=this.options.attributeNamePrefix+a;if(a.length)if(this.options.transformAttributeName&&(u=this.options.transformAttributeName(u)),u==="__proto__"&&(u="#__proto__"),c!==void 0){this.options.trimValues&&(c=c.trim()),c=this.replaceEntitiesValue(c);const f=this.options.attributeValueProcessor(a,c,t);f==null?i[u]=c:typeof f!=typeof c||f!==c?i[u]=f:i[u]=ln(c,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[u]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){const o={};return o[this.options.attributesGroupName]=i,o}return i}}const ud=function(e){e=e.replace(/\r\n?/g,`
`);const t=new Qe("!xml");let r=t,n="",s="";for(let i=0;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="/"){const o=tt(e,">",i,"Closing Tag is not closed.");let a=e.substring(i+2,o).trim();if(this.options.removeNSPrefix){const f=a.indexOf(":");f!==-1&&(a=a.substr(f+1))}this.options.transformTagName&&(a=this.options.transformTagName(a)),r&&(n=this.saveTextToParentTag(n,r,s));const c=s.substring(s.lastIndexOf(".")+1);if(a&&this.options.unpairedTags.indexOf(a)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${a}>`);let u=0;c&&this.options.unpairedTags.indexOf(c)!==-1?(u=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):u=s.lastIndexOf("."),s=s.substring(0,u),r=this.tagsNodeStack.pop(),n="",i=o}else if(e[i+1]==="?"){let o=un(e,i,!1,"?>");if(!o)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,r,s),!(this.options.ignoreDeclaration&&o.tagName==="?xml"||this.options.ignorePiTags)){const a=new Qe(o.tagName);a.add(this.options.textNodeName,""),o.tagName!==o.tagExp&&o.attrExpPresent&&(a[":@"]=this.buildAttributesMap(o.tagExp,s,o.tagName)),this.addChild(r,a,s,i)}i=o.closeIndex+1}else if(e.substr(i+1,3)==="!--"){const o=tt(e,"-->",i+4,"Comment is not closed.");if(this.options.commentPropName){const a=e.substring(i+4,o-2);n=this.saveTextToParentTag(n,r,s),r.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}i=o}else if(e.substr(i+1,2)==="!D"){const o=zl(e,i);this.docTypeEntities=o.entities,i=o.i}else if(e.substr(i+1,2)==="!["){const o=tt(e,"]]>",i,"CDATA is not closed.")-2,a=e.substring(i+9,o);n=this.saveTextToParentTag(n,r,s);let c=this.parseTextData(a,r.tagname,s,!0,!1,!0,!0);c==null&&(c=""),this.options.cdataPropName?r.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]):r.add(this.options.textNodeName,c),i=o+2}else{let o=un(e,i,this.options.removeNSPrefix),a=o.tagName;const c=o.rawTagName;let u=o.tagExp,f=o.attrExpPresent,h=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),r&&n&&r.tagname!=="!xml"&&(n=this.saveTextToParentTag(n,r,s,!1));const p=r;p&&this.options.unpairedTags.indexOf(p.tagname)!==-1&&(r=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),a!==t.tagname&&(s+=s?"."+a:a);const y=i;if(this.isItStopNode(this.options.stopNodes,s,a)){let E="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)a[a.length-1]==="/"?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),i=o.closeIndex;else if(this.options.unpairedTags.indexOf(a)!==-1)i=o.closeIndex;else{const A=this.readStopNodeData(e,c,h+1);if(!A)throw new Error(`Unexpected end of ${c}`);i=A.i,E=A.tagContent}const x=new Qe(a);a!==u&&f&&(x[":@"]=this.buildAttributesMap(u,s,a)),E&&(E=this.parseTextData(E,a,s,!0,f,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),x.add(this.options.textNodeName,E),this.addChild(r,x,s,y)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){a[a.length-1]==="/"?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const E=new Qe(a);a!==u&&f&&(E[":@"]=this.buildAttributesMap(u,s,a)),this.addChild(r,E,s,y),s=s.substr(0,s.lastIndexOf("."))}else{const E=new Qe(a);this.tagsNodeStack.push(r),a!==u&&f&&(E[":@"]=this.buildAttributesMap(u,s,a)),this.addChild(r,E,s,y),r=E}n="",i=h}}else n+=e[i];return t.child};function ld(e,t,r,n){this.options.captureMetaData||(n=void 0);const s=this.options.updateTag(t.tagname,r,t[":@"]);s===!1||(typeof s=="string"&&(t.tagname=s),e.addChild(t,n))}const dd=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const r=this.docTypeEntities[t];e=e.replace(r.regx,r.val)}for(let t in this.lastEntities){const r=this.lastEntities[t];e=e.replace(r.regex,r.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const r=this.htmlEntities[t];e=e.replace(r.regex,r.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function hd(e,t,r,n){return e&&(n===void 0&&(n=t.child.length===0),e=this.parseTextData(e,t.tagname,r,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,n),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function fd(e,t,r){const n="*."+r;for(const s in e){const i=e[s];if(n===i||t===i)return!0}return!1}function pd(e,t,r=">"){let n,s="";for(let i=t;i<e.length;i++){let o=e[i];if(n)o===n&&(n="");else if(o==='"'||o==="'")n=o;else if(o===r[0])if(r[1]){if(e[i+1]===r[1])return{data:s,index:i}}else return{data:s,index:i};else o===" "&&(o=" ");s+=o}}function tt(e,t,r,n){const s=e.indexOf(t,r);if(s===-1)throw new Error(n);return s+t.length-1}function un(e,t,r,n=">"){const s=pd(e,t+1,n);if(!s)return;let i=s.data;const o=s.index,a=i.search(/\s/);let c=i,u=!0;a!==-1&&(c=i.substring(0,a),i=i.substring(a+1).trimStart());const f=c;if(r){const h=c.indexOf(":");h!==-1&&(c=c.substr(h+1),u=c!==s.data.substr(h+1))}return{tagName:c,tagExp:i,closeIndex:o,attrExpPresent:u,rawTagName:f}}function gd(e,t,r){const n=r;let s=1;for(;r<e.length;r++)if(e[r]==="<")if(e[r+1]==="/"){const i=tt(e,">",r,`${t} is not closed`);if(e.substring(r+2,i).trim()===t&&(s--,s===0))return{tagContent:e.substring(n,r),i};r=i}else if(e[r+1]==="?")r=tt(e,"?>",r+1,"StopNode is not closed.");else if(e.substr(r+1,3)==="!--")r=tt(e,"-->",r+3,"StopNode is not closed.");else if(e.substr(r+1,2)==="![")r=tt(e,"]]>",r,"StopNode is not closed.")-2;else{const i=un(e,r,">");i&&((i&&i.tagName)===t&&i.tagExp[i.tagExp.length-1]!=="/"&&s++,r=i.closeIndex)}}function ln(e,t,r){if(t&&typeof e=="string"){const n=e.trim();return n==="true"?!0:n==="false"?!1:Xl(e,r)}else return Nl(e)?e:""}const xr=Qe.getMetaDataSymbol();function md(e,t){return qo(e,t)}function qo(e,t,r){let n;const s={};for(let i=0;i<e.length;i++){const o=e[i],a=yd(o);let c="";if(r===void 0?c=a:c=r+"."+a,a===t.textNodeName)n===void 0?n=o[a]:n+=""+o[a];else{if(a===void 0)continue;if(o[a]){let u=qo(o[a],t,c);const f=bd(u,t);o[xr]!==void 0&&(u[xr]=o[xr]),o[":@"]?wd(u,o[":@"],c,t):Object.keys(u).length===1&&u[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?u=u[t.textNodeName]:Object.keys(u).length===0&&(t.alwaysCreateTextNode?u[t.textNodeName]="":u=""),s[a]!==void 0&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(u)):t.isArray(a,c,f)?s[a]=[u]:s[a]=u}}}return typeof n=="string"?n.length>0&&(s[t.textNodeName]=n):n!==void 0&&(s[t.textNodeName]=n),s}function yd(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const n=t[r];if(n!==":@")return n}}function wd(e,t,r,n){if(t){const s=Object.keys(t),i=s.length;for(let o=0;o<i;o++){const a=s[o];n.isArray(a,r+"."+a,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function bd(e,t){const{textNodeName:r}=t,n=Object.keys(e).length;return!!(n===0||n===1&&(e[r]||typeof e[r]=="boolean"||e[r]===0))}class vd{constructor(t){this.externalEntities={},this.options=jl(t)}parse(t,r){if(typeof t!="string")if(t.toString)t=t.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(r){r===!0&&(r={});const i=Ml(t,r);if(i!==!0)throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`)}const n=new nd(this.options);n.addExternalEntities(this.externalEntities);const s=n.parseXml(t);return this.options.preserveOrder||s===void 0?s:md(s,this.options)}addEntity(t,r){if(r.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(r==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=r}static getMetaDataSymbol(){return Qe.getMetaDataSymbol()}}const jo=(e,t)=>Cl(e,t).then(r=>{if(r.length){const n=new vd({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(c,u)=>u.trim()===""&&u.includes(`
`)?"":void 0});n.addEntity("#xD","\r"),n.addEntity("#10",`
`);let s;try{s=n.parse(r,!0)}catch(c){throw c&&typeof c=="object"&&Object.defineProperty(c,"$responseBodyText",{value:r}),c}const i="#text",o=Object.keys(s)[0],a=s[o];return a[i]&&(a[o]=a[i],delete a[i]),Lo(a)}return{}}),Sd=async(e,t)=>{const r=await jo(e,t);return r.Error&&(r.Error.message=r.Error.message??r.Error.Message),r},Ed=(e,t)=>{var r;if(((r=t==null?void 0:t.Error)==null?void 0:r.Code)!==void 0)return t.Error.Code;if((t==null?void 0:t.Code)!==void 0)return t.Code;if(e.statusCode==404)return"NotFound"},dn=[z.CRC32,z.CRC32C,z.CRC64NVME,z.SHA1,z.SHA256],Ad=[z.SHA256,z.SHA1,z.CRC32,z.CRC32C,z.CRC64NVME],xd=(e,{requestChecksumRequired:t,requestAlgorithmMember:r,requestChecksumCalculation:n})=>{if(!r)return n===gt.WHEN_SUPPORTED||t?nn:void 0;if(!e[r])return;const s=e[r];if(!dn.includes(s))throw new Error(`The checksum algorithm "${s}" is not supported by the client. Select one of ${dn}.`);return s},kn=e=>e===z.MD5?"content-md5":`x-amz-checksum-${e.toLowerCase()}`,kd=(e,t)=>{const r=e.toLowerCase();for(const n of Object.keys(t))if(r===n.toLowerCase())return!0;return!1},Rd=(e,t)=>{const r=e.toLowerCase();for(const n of Object.keys(t))if(n.toLowerCase().startsWith(r))return!0;return!1},zo=e=>e!==void 0&&typeof e!="string"&&!ArrayBuffer.isView(e)&&!_o(e);function Rn(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function a(f){try{u(n.next(f))}catch(h){o(h)}}function c(f){try{u(n.throw(f))}catch(h){o(h)}}function u(f){f.done?i(f.value):s(f.value).then(a,c)}u((n=n.apply(e,[])).next())})}function Cn(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(f){return c([u,f])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,s&&(i=u[0]&2?s.return:u[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,u[1])).done)return i;switch(s=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,s=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(f){u=[6,f],s=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Vo(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}const Wo=e=>new TextEncoder().encode(e);var Cd=typeof Buffer<"u"&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:Wo;function Ge(e){return e instanceof Uint8Array?e:typeof e=="string"?Cd(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function Ut(e){return typeof e=="string"?e.length===0:e.byteLength===0}function Ko(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}function Go(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),r=0;r<e.length;)t[r]=e[r],r+=1;return t}return Uint32Array.from(e)}var Pd=function(){function e(){this.crc32c=new ks}return e.prototype.update=function(t){Ut(t)||this.crc32c.update(Ge(t))},e.prototype.digest=function(){return Rn(this,void 0,void 0,function(){return Cn(this,function(t){return[2,Ko(this.crc32c.digest())]})})},e.prototype.reset=function(){this.crc32c=new ks},e}(),ks=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(t){var r,n;try{for(var s=Vo(t),i=s.next();!i.done;i=s.next()){var o=i.value;this.checksum=this.checksum>>>8^Id[(this.checksum^o)&255]}}catch(a){r={error:a}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return this},e.prototype.digest=function(){return(this.checksum^4294967295)>>>0},e}(),Td=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697],Id=Go(Td),Nd=function(){function e(){this.crc32=new Xt}return e.prototype.update=function(t){Ut(t)||this.crc32.update(Ge(t))},e.prototype.digest=function(){return Rn(this,void 0,void 0,function(){return Cn(this,function(t){return[2,Ko(this.crc32.digest())]})})},e.prototype.reset=function(){this.crc32=new Xt},e}(),Xt=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(t){var r,n;try{for(var s=Vo(t),i=s.next();!i.done;i=s.next()){var o=i.value;this.checksum=this.checksum>>>8^Md[(this.checksum^o)&255]}}catch(a){r={error:a}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return this},e.prototype.digest=function(){return(this.checksum^4294967295)>>>0},e}(),Od=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],Md=Go(Od);const Ud=()=>Nd,Zo=(e,t)=>{switch(e){case z.MD5:return t.md5;case z.CRC32:return Ud();case z.CRC32C:return Pd;case z.CRC64NVME:throw new Error(`Please check whether you have installed the "@aws-sdk/crc64-nvme-crt" package explicitly.
You must also register the package by calling [require("@aws-sdk/crc64-nvme-crt");] or an ESM equivalent such as [import "@aws-sdk/crc64-nvme-crt";].
For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);case z.SHA1:return t.sha1;case z.SHA256:return t.sha256;default:throw new Error(`Unsupported checksum algorithm: ${e}`)}},Yo=(e,t)=>{const r=new e;return r.update(mt(t||"")),r.digest()},$d={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},Dd=(e,t)=>(r,n)=>async s=>{if(!se.isInstance(s.request)||Rd("x-amz-checksum-",s.request.headers))return r(s);const{request:i,input:o}=s,{body:a,headers:c}=i,{base64Encoder:u,streamHasher:f}=e,{requestChecksumRequired:h,requestAlgorithmMember:p}=t,y=await e.requestChecksumCalculation(),E=p==null?void 0:p.name,x=p==null?void 0:p.httpHeader;E&&!o[E]&&(y===gt.WHEN_SUPPORTED||h)&&(o[E]=nn,x&&(c[x]=nn));const A=xd(o,{requestChecksumRequired:h,requestAlgorithmMember:p==null?void 0:p.name,requestChecksumCalculation:y});let L=a,W=c;if(A){switch(A){case z.CRC32:re(n,"FLEXIBLE_CHECKSUMS_REQ_CRC32","U");break;case z.CRC32C:re(n,"FLEXIBLE_CHECKSUMS_REQ_CRC32C","V");break;case z.CRC64NVME:re(n,"FLEXIBLE_CHECKSUMS_REQ_CRC64","W");break;case z.SHA1:re(n,"FLEXIBLE_CHECKSUMS_REQ_SHA1","X");break;case z.SHA256:re(n,"FLEXIBLE_CHECKSUMS_REQ_SHA256","Y");break}const F=kn(A),G=Zo(A,e);if(zo(a)){const{getAwsChunkedEncodingStream:he,bodyLengthChecker:oe}=e;L=he(typeof e.requestStreamBufferSize=="number"&&e.requestStreamBufferSize>=8*1024?Wc(a,e.requestStreamBufferSize,n.logger):a,{base64Encoder:u,bodyLengthChecker:oe,checksumLocationName:F,checksumAlgorithmFn:G,streamHasher:f}),W={...c,"content-encoding":c["content-encoding"]?`${c["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":c["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":F},delete W["content-length"]}else if(!kd(F,c)){const he=await Yo(G,a);W={...c,[F]:u(he)}}}return await r({...s,request:{...i,headers:W,body:L}})},_d={name:"flexibleChecksumsInputMiddleware",toMiddleware:"serializerMiddleware",relation:"before",tags:["BODY_CHECKSUM"],override:!0},Bd=(e,t)=>(r,n)=>async s=>{const i=s.input,{requestValidationModeMember:o}=t,a=await e.requestChecksumCalculation(),c=await e.responseChecksumValidation();switch(a){case gt.WHEN_REQUIRED:re(n,"FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED","a");break;case gt.WHEN_SUPPORTED:re(n,"FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED","Z");break}switch(c){case mr.WHEN_REQUIRED:re(n,"FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED","c");break;case mr.WHEN_SUPPORTED:re(n,"FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED","b");break}return o&&!i[o]&&c===mr.WHEN_SUPPORTED&&(i[o]="ENABLED"),r(s)},Xo=(e=[])=>{const t=[];for(const r of Ad)!e.includes(r)||!dn.includes(r)||t.push(r);return t},Ld=e=>{const t=e.lastIndexOf("-");if(t!==-1){const r=e.slice(t+1);if(!r.startsWith("0")){const n=parseInt(r,10);if(!isNaN(n)&&n>=1&&n<=1e4)return!0}}return!1},Fd=async(e,{checksumAlgorithmFn:t,base64Encoder:r})=>r(await Yo(t,e)),Hd=async(e,{config:t,responseAlgorithms:r,logger:n})=>{const s=Xo(r),{body:i,headers:o}=e;for(const a of s){const c=kn(a),u=o[c];if(u){let f;try{f=Zo(a,t)}catch(y){if(a===z.CRC64NVME){n==null||n.warn(`Skipping ${z.CRC64NVME} checksum validation: ${y.message}`);continue}throw y}const{base64Encoder:h}=t;if(zo(i)){e.body=jc({expectedChecksum:u,checksumSourceLocation:c,checksum:new f,source:i,base64Encoder:h});return}const p=await Fd(i,{checksumAlgorithmFn:f,base64Encoder:h});if(p===u)break;throw new Error(`Checksum mismatch: expected "${p}" but received "${u}" in response header "${c}".`)}}},qd={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},jd=(e,t)=>(r,n)=>async s=>{if(!se.isInstance(s.request))return r(s);const i=s.input,o=await r(s),a=o.response,{requestValidationModeMember:c,responseAlgorithms:u}=t;if(c&&i[c]==="ENABLED"){const{clientName:f,commandName:h}=n;if(f==="S3Client"&&h==="GetObjectCommand"&&Xo(u).every(p=>{const y=kn(p),E=a.headers[y];return!E||Ld(E)}))return o;await Hd(a,{config:e,responseAlgorithms:u,logger:n.logger})}return o},zd=(e,t)=>({applyToStack:r=>{r.add(Dd(e,t),$d),r.addRelativeTo(Bd(e,t),_d),r.addRelativeTo(jd(e,t),qd)}}),Vd=e=>{const{requestChecksumCalculation:t,responseChecksumValidation:r,requestStreamBufferSize:n}=e;return Object.assign(e,{requestChecksumCalculation:Me(t??Sc),responseChecksumValidation:Me(r??Ec),requestStreamBufferSize:Number(n??0)})},Wd=e=>t=>async r=>{if(!se.isInstance(r.request))return t(r);const{request:n}=r,{handlerProtocol:s=""}=e.requestHandler.metadata||{};if(s.indexOf("h2")>=0&&!n.headers[":authority"])delete n.headers.host,n.headers[":authority"]=n.hostname+(n.port?":"+n.port:"");else if(!n.headers.host){let i=n.hostname;n.port!=null&&(i+=`:${n.port}`),n.headers.host=i}return t(r)},Kd={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},Gd=e=>({applyToStack:t=>{t.add(Wd(e),Kd)}}),Zd=()=>(e,t)=>async r=>{var n,s;try{const i=await e(r),{clientName:o,commandName:a,logger:c,dynamoDbDocumentClientOptions:u={}}=t,{overrideInputFilterSensitiveLog:f,overrideOutputFilterSensitiveLog:h}=u,p=f??t.inputFilterSensitiveLog,y=h??t.outputFilterSensitiveLog,{$metadata:E,...x}=i.output;return(n=c==null?void 0:c.info)==null||n.call(c,{clientName:o,commandName:a,input:p(r.input),output:y(x),metadata:E}),i}catch(i){const{clientName:o,commandName:a,logger:c,dynamoDbDocumentClientOptions:u={}}=t,{overrideInputFilterSensitiveLog:f}=u,h=f??t.inputFilterSensitiveLog;throw(s=c==null?void 0:c.error)==null||s.call(c,{clientName:o,commandName:a,input:h(r.input),error:i,metadata:i.$metadata}),i}},Yd={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},Xd=e=>({applyToStack:t=>{t.add(Zd(),Yd)}}),kr="X-Amzn-Trace-Id",Qd="AWS_LAMBDA_FUNCTION_NAME",Jd="_X_AMZN_TRACE_ID",eh=e=>t=>async r=>{const{request:n}=r;if(!se.isInstance(n)||e.runtime!=="node")return t(r);const s=Object.keys(n.headers??{}).find(c=>c.toLowerCase()===kr.toLowerCase())??kr;if(n.headers.hasOwnProperty(s))return t(r);const i=Jn[Qd],o=Jn[Jd],a=c=>typeof c=="string"&&c.length>0;return a(i)&&a(o)&&(n.headers[kr]=o),t({...r,request:n})},th={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},rh=e=>({applyToStack:t=>{t.add(eh(e),th)}}),nh="content-length",sh="x-amz-decoded-content-length";function ih(){return(e,t)=>async r=>{var n;const{request:s}=r;return se.isInstance(s)&&!(nh in s.headers)&&!(sh in s.headers)&&typeof((n=t==null?void 0:t.logger)==null?void 0:n.warn)=="function"&&!(t.logger instanceof En)&&t.logger.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage."),e({...r})}}const oh={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},ah=e=>({applyToStack:t=>{t.add(ih(),oh)}}),ch=e=>(t,r)=>async n=>{const s=await e.region(),i=e.region;let o=()=>{};r.__s3RegionRedirect&&(Object.defineProperty(e,"region",{writable:!1,value:async()=>r.__s3RegionRedirect}),o=()=>Object.defineProperty(e,"region",{writable:!0,value:i}));try{const a=await t(n);if(r.__s3RegionRedirect){o();const c=await e.region();if(s!==c)throw new Error("Region was not restored following S3 region redirect.")}return a}catch(a){throw o(),a}},uh={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function lh(e){return(t,r)=>async n=>{var s,i,o;try{return await t(n)}catch(a){if(e.followRegionRedirects&&(((s=a==null?void 0:a.$metadata)==null?void 0:s.httpStatusCode)===301||((i=a==null?void 0:a.$metadata)==null?void 0:i.httpStatusCode)===400&&(a==null?void 0:a.name)==="IllegalLocationConstraintException")){try{const c=a.$response.headers["x-amz-bucket-region"];(o=r.logger)==null||o.debug(`Redirecting from ${await e.region()} to ${c}`),r.__s3RegionRedirect=c}catch(c){throw new Error("Region redirect failed: "+c)}return t(n)}throw a}}}const dh={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},hh=e=>({applyToStack:t=>{t.add(lh(e),dh),t.addRelativeTo(ch(e),uh)}}),Qo=class Jo{constructor(t={}){O(this,"data"),O(this,"lastPurgeTime",Date.now()),this.data=t}get(t){const r=this.data[t];if(r)return r}set(t,r){return this.data[t]=r,r}delete(t){delete this.data[t]}async purgeExpired(){const t=Date.now();if(!(this.lastPurgeTime+Jo.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>t))for(const r in this.data){const n=this.data[r];if(!n.isRefreshing){const s=await n.identity;s.expiration&&s.expiration.getTime()<t&&delete this.data[r]}}}};O(Qo,"EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS",3e4);let fh=Qo;class Rr{constructor(t,r=!1,n=Date.now()){O(this,"_identity"),O(this,"isRefreshing"),O(this,"accessed"),this._identity=t,this.isRefreshing=r,this.accessed=n}get identity(){return this.accessed=Date.now(),this._identity}}const ea=class ta{constructor(t,r=new fh){O(this,"createSessionFn"),O(this,"cache"),this.createSessionFn=t,this.cache=r}async getS3ExpressIdentity(t,r){const n=r.Bucket,{cache:s}=this,i=s.get(n);return i?i.identity.then(o=>{var a,c;return(((a=o.expiration)==null?void 0:a.getTime())??0)<Date.now()?s.set(n,new Rr(this.getIdentity(n))).identity:((((c=o.expiration)==null?void 0:c.getTime())??0)<Date.now()+ta.REFRESH_WINDOW_MS&&!i.isRefreshing&&(i.isRefreshing=!0,this.getIdentity(n).then(u=>{s.set(n,new Rr(Promise.resolve(u)))})),o)}):s.set(n,new Rr(this.getIdentity(n))).identity}async getIdentity(t){var r,n;await this.cache.purgeExpired().catch(i=>{});const s=await this.createSessionFn(t);if(!((r=s.Credentials)!=null&&r.AccessKeyId)||!((n=s.Credentials)!=null&&n.SecretAccessKey))throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:s.Credentials.AccessKeyId,secretAccessKey:s.Credentials.SecretAccessKey,sessionToken:s.Credentials.SessionToken,expiration:s.Credentials.Expiration?new Date(s.Credentials.Expiration):void 0}}};O(ea,"REFRESH_WINDOW_MS",6e4);let ph=ea;var Rs;(function(e){e.ENV="env",e.CONFIG="shared config entry"})(Rs||(Rs={}));const gh="Directory",mh="S3Express",yh="sigv4-s3express",hn="X-Amz-S3session-Token",fn=hn.toLowerCase();class wh extends cn{async signWithCredentials(t,r,n){const s=Cs(r);t.headers[fn]=r.sessionToken;const i=this;return Ps(i,s),i.signRequest(t,n??{})}async presignWithCredentials(t,r,n){const s=Cs(r);return delete t.headers[fn],t.headers[hn]=r.sessionToken,t.query=t.query??{},t.query[hn]=r.sessionToken,Ps(this,s),this.presign(t,n)}}function Cs(e){return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,expiration:e.expiration}}function Ps(e,t){const r=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),n=e.credentialProvider,s=()=>(clearTimeout(r),e.credentialProvider=n,Promise.resolve(t));e.credentialProvider=s}const bh=e=>(t,r)=>async n=>{var s,i,o,a,c;if(r.endpointV2){const u=r.endpointV2,f=((o=(i=(s=u.properties)==null?void 0:s.authSchemes)==null?void 0:i[0])==null?void 0:o.name)===yh;if((((a=u.properties)==null?void 0:a.backend)===mh||((c=u.properties)==null?void 0:c.bucketType)===gh)&&(re(r,"S3_EXPRESS_BUCKET","J"),r.isS3ExpressBucket=!0),f){const h=n.input.Bucket;if(h){const p=await e.s3ExpressIdentityProvider.getS3ExpressIdentity(await e.credentials(),{Bucket:h});r.s3ExpressIdentity=p,se.isInstance(n.request)&&p.sessionToken&&(n.request.headers[fn]=p.sessionToken)}}}return t(n)},vh={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},Sh=e=>({applyToStack:t=>{t.add(bh(e),vh)}}),Eh=async(e,t,r,n)=>{const s=await n.signWithCredentials(r,e,{});if(s.headers["X-Amz-Security-Token"]||s.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return s},Ah=e=>t=>{throw t},xh=(e,t)=>{},kh=e=>(t,r)=>async n=>{if(!se.isInstance(n.request))return t(n);const s=St(r).selectedHttpAuthScheme;if(!s)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:i={}},identity:o,signer:a}=s;let c;r.s3ExpressIdentity?c=await Eh(r.s3ExpressIdentity,i,n.request,await e.signer()):c=await a.sign(n.request,o,i);const u=await t({...n,request:c}).catch((a.errorHandler||Ah)(i));return(a.successHandler||xh)(u.response,i),u},Rh=e=>({applyToStack:t=>{t.addRelativeTo(kh(e),mo)}}),Ch=(e,{session:t})=>{const[r,n]=t,{forcePathStyle:s,useAccelerateEndpoint:i,disableMultiregionAccessPoints:o,followRegionRedirects:a,s3ExpressIdentityProvider:c,bucketEndpoint:u}=e;return Object.assign(e,{forcePathStyle:s??!1,useAccelerateEndpoint:i??!1,disableMultiregionAccessPoints:o??!1,followRegionRedirects:a??!1,s3ExpressIdentityProvider:c??new ph(async f=>r().send(new n({Bucket:f}))),bucketEndpoint:u??!1})},Ph={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Th=3e3,Ih=e=>(t,r)=>async n=>{const s=await t(n),{response:i}=s;if(!pt.isInstance(i))return s;const{statusCode:o,body:a}=i;if(o<200||o>=300||!(typeof(a==null?void 0:a.stream)=="function"||typeof(a==null?void 0:a.pipe)=="function"||typeof(a==null?void 0:a.tee)=="function"))return s;let c=a,u=a;a&&typeof a=="object"&&!(a instanceof Uint8Array)&&([c,u]=await su(a)),i.body=u;const f=await Nh(c,{streamCollector:async p=>Yc(p,Th)});typeof(c==null?void 0:c.destroy)=="function"&&c.destroy();const h=e.utf8Encoder(f.subarray(f.length-16));if(f.length===0&&Ph[r.commandName]){const p=new Error("S3 aborted request");throw p.name="InternalError",p}return h&&h.endsWith("</Error>")&&(i.statusCode=400),s},Nh=(e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array),Oh={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},ra=e=>({applyToStack:t=>{t.addRelativeTo(Ih(e),Oh)}}),Mh=e=>typeof e=="string"&&e.indexOf("arn:")===0&&e.split(":").length>=6;function Uh(e){return(t,r)=>async n=>{var s,i,o,a;if(e.bucketEndpoint){const c=r.endpointV2;if(c){const u=n.input.Bucket;if(typeof u=="string")try{const f=new URL(u);r.endpointV2={...c,url:f}}catch(f){const h=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${u} could not be parsed as URL.`;throw((i=(s=r.logger)==null?void 0:s.constructor)==null?void 0:i.name)==="NoOpLogger"||(a=(o=r.logger)==null?void 0:o.warn)==null||a.call(o,h),f}}}return t(n)}}const $h={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Dh({bucketEndpoint:e}){return t=>async r=>{const{input:{Bucket:n}}=r;if(!e&&typeof n=="string"&&!Mh(n)&&n.indexOf("/")>=0){const s=new Error(`Bucket name shouldn't contain '/', received '${n}'`);throw s.name="InvalidBucketName",s}return t({...r})}}const _h={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},Bh=e=>({applyToStack:t=>{t.add(Dh(e),_h),t.addRelativeTo(Uh(e),$h)}}),Lh=void 0;function Fh(e){return e===void 0?!0:typeof e=="string"&&e.length<=50}function Hh(e){const t=ht(e.userAgentAppId??Lh),{customUserAgent:r}=e;return Object.assign(e,{customUserAgent:typeof r=="string"?[[r]]:r,userAgentAppId:async()=>{var n,s;const i=await t();if(!Fh(i)){const o=((s=(n=e.logger)==null?void 0:n.constructor)==null?void 0:s.name)==="NoOpLogger"||!e.logger?console:e.logger;typeof i!="string"?o==null||o.warn("userAgentAppId must be a string or undefined."):i.length>50&&(o==null||o.warn("The provided userAgentAppId exceeds the maximum length of 50 characters."))}return i}})}class qh{constructor({size:t,params:r}){this.data=new Map,this.parameters=[],this.capacity=t??50,r&&(this.parameters=r)}get(t,r){const n=this.hash(t);if(n===!1)return r();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const s=this.data.keys();let i=0;for(;;){const{value:o,done:a}=s.next();if(this.data.delete(o),a||++i>10)break}}this.data.set(n,r())}return this.data.get(n)}size(){return this.data.size}hash(t){let r="";const{parameters:n}=this;if(n.length===0)return!1;for(const s of n){const i=String(t[s]??"");if(i.includes("|;"))return!1;r+=i+"|;"}return r}}const jh=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),na=e=>jh.test(e)||e.startsWith("[")&&e.endsWith("]"),zh=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),Pn=(e,t=!1)=>{if(!t)return zh.test(e);const r=e.split(".");for(const n of r)if(!Pn(n))return!1;return!0},Qt={},$t="endpoints";function Ze(e){return typeof e!="object"||e==null?e:"ref"in e?`$${Ze(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(Ze).join(", ")})`:JSON.stringify(e,null,2)}class Te extends Error{constructor(t){super(t),this.name="EndpointError"}}const Vh=(e,t)=>e===t,Wh=e=>{const t=e.split("."),r=[];for(const n of t){const s=n.indexOf("[");if(s!==-1){if(n.indexOf("]")!==n.length-1)throw new Te(`Path: '${e}' does not end with ']'`);const i=n.slice(s+1,-1);if(Number.isNaN(parseInt(i)))throw new Te(`Invalid array index: '${i}' in path: '${e}'`);s!==0&&r.push(n.slice(0,s)),r.push(i)}else r.push(n)}return r},sa=(e,t)=>Wh(t).reduce((r,n)=>{if(typeof r!="object")throw new Te(`Index '${n}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(r)?r[parseInt(n)]:r[n]},e),Kh=e=>e!=null,Gh=e=>!e,Cr={[Mt.HTTP]:80,[Mt.HTTPS]:443},Zh=e=>{const t=(()=>{try{if(e instanceof URL)return e;if(typeof e=="object"&&"hostname"in e){const{hostname:p,port:y,protocol:E="",path:x="",query:A={}}=e,L=new URL(`${E}//${p}${y?`:${y}`:""}${x}`);return L.search=Object.entries(A).map(([W,F])=>`${W}=${F}`).join("&"),L}return new URL(e)}catch{return null}})();if(!t)return null;const r=t.href,{host:n,hostname:s,pathname:i,protocol:o,search:a}=t;if(a)return null;const c=o.slice(0,-1);if(!Object.values(Mt).includes(c))return null;const u=na(s),f=r.includes(`${n}:${Cr[c]}`)||typeof e=="string"&&e.includes(`${n}:${Cr[c]}`),h=`${n}${f?`:${Cr[c]}`:""}`;return{scheme:c,authority:h,path:i,normalizedPath:i.endsWith("/")?i:`${i}/`,isIp:u}},Yh=(e,t)=>e===t,Xh=(e,t,r,n)=>t>=r||e.length<r?null:n?e.substring(e.length-r,e.length-t):e.substring(t,r),Qh=e=>encodeURIComponent(e).replace(/[!*'()]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),Jh={booleanEquals:Vh,getAttr:sa,isSet:Kh,isValidHostLabel:Pn,not:Gh,parseURL:Zh,stringEquals:Yh,substring:Xh,uriEncode:Qh},ia=(e,t)=>{const r=[],n={...t.endpointParams,...t.referenceRecord};let s=0;for(;s<e.length;){const i=e.indexOf("{",s);if(i===-1){r.push(e.slice(s));break}r.push(e.slice(s,i));const o=e.indexOf("}",i);if(o===-1){r.push(e.slice(i));break}e[i+1]==="{"&&e[o+1]==="}"&&(r.push(e.slice(i+1,o)),s=o+2);const a=e.substring(i+1,o);if(a.includes("#")){const[c,u]=a.split("#");r.push(sa(n[c],u))}else r.push(n[a]);s=o+1}return r.join("")},ef=({ref:e},t)=>({...t.endpointParams,...t.referenceRecord})[e],or=(e,t,r)=>{if(typeof e=="string")return ia(e,r);if(e.fn)return oa(e,r);if(e.ref)return ef(e,r);throw new Te(`'${t}': ${String(e)} is not a string, function or reference.`)},oa=({fn:e,argv:t},r)=>{const n=t.map(i=>["boolean","number"].includes(typeof i)?i:or(i,"arg",r)),s=e.split(".");return s[0]in Qt&&s[1]!=null?Qt[s[0]][s[1]](...n):Jh[e](...n)},tf=({assign:e,...t},r)=>{var n,s;if(e&&e in r.referenceRecord)throw new Te(`'${e}' is already defined in Reference Record.`);const i=oa(t,r);return(s=(n=r.logger)==null?void 0:n.debug)==null||s.call(n,`${$t} evaluateCondition: ${Ze(t)} = ${Ze(i)}`),{result:i===""?!0:!!i,...e!=null&&{toAssign:{name:e,value:i}}}},Tn=(e=[],t)=>{var r,n;const s={};for(const i of e){const{result:o,toAssign:a}=tf(i,{...t,referenceRecord:{...t.referenceRecord,...s}});if(!o)return{result:o};a&&(s[a.name]=a.value,(n=(r=t.logger)==null?void 0:r.debug)==null||n.call(r,`${$t} assign: ${a.name} := ${Ze(a.value)}`))}return{result:!0,referenceRecord:s}},rf=(e,t)=>Object.entries(e).reduce((r,[n,s])=>({...r,[n]:s.map(i=>{const o=or(i,"Header value entry",t);if(typeof o!="string")throw new Te(`Header '${n}' value '${o}' is not a string`);return o})}),{}),aa=(e,t)=>{if(Array.isArray(e))return e.map(r=>aa(r,t));switch(typeof e){case"string":return ia(e,t);case"object":if(e===null)throw new Te(`Unexpected endpoint property: ${e}`);return ca(e,t);case"boolean":return e;default:throw new Te(`Unexpected endpoint property type: ${typeof e}`)}},ca=(e,t)=>Object.entries(e).reduce((r,[n,s])=>({...r,[n]:aa(s,t)}),{}),nf=(e,t)=>{const r=or(e,"Endpoint URL",t);if(typeof r=="string")try{return new URL(r)}catch(n){throw n}throw new Te(`Endpoint URL must be a string, got ${typeof r}`)},sf=(e,t)=>{var r,n;const{conditions:s,endpoint:i}=e,{result:o,referenceRecord:a}=Tn(s,t);if(!o)return;const c={...t,referenceRecord:{...t.referenceRecord,...a}},{url:u,properties:f,headers:h}=i;return(n=(r=t.logger)==null?void 0:r.debug)==null||n.call(r,`${$t} Resolving endpoint from template: ${Ze(i)}`),{...h!=null&&{headers:rf(h,c)},...f!=null&&{properties:ca(f,c)},url:nf(u,c)}},of=(e,t)=>{const{conditions:r,error:n}=e,{result:s,referenceRecord:i}=Tn(r,t);if(s)throw new Te(or(n,"Error",{...t,referenceRecord:{...t.referenceRecord,...i}}))},af=(e,t)=>{const{conditions:r,rules:n}=e,{result:s,referenceRecord:i}=Tn(r,t);if(s)return ua(n,{...t,referenceRecord:{...t.referenceRecord,...i}})},ua=(e,t)=>{for(const r of e)if(r.type==="endpoint"){const n=sf(r,t);if(n)return n}else if(r.type==="error")of(r,t);else if(r.type==="tree"){const n=af(r,t);if(n)return n}else throw new Te(`Unknown endpoint rule: ${r}`);throw new Te("Rules evaluation failed")},cf=(e,t)=>{var r,n,s,i;const{endpointParams:o,logger:a}=t,{parameters:c,rules:u}=e;(n=(r=t.logger)==null?void 0:r.debug)==null||n.call(r,`${$t} Initial EndpointParams: ${Ze(o)}`);const f=Object.entries(c).filter(([,y])=>y.default!=null).map(([y,E])=>[y,E.default]);if(f.length>0)for(const[y,E]of f)o[y]=o[y]??E;const h=Object.entries(c).filter(([,y])=>y.required).map(([y])=>y);for(const y of h)if(o[y]==null)throw new Te(`Missing required parameter: '${y}'`);const p=ua(u,{endpointParams:o,logger:a,referenceRecord:{}});return(i=(s=t.logger)==null?void 0:s.debug)==null||i.call(s,`${$t} Resolved endpoint: ${Ze(p)}`),p},la=(e,t=!1)=>{if(t){for(const r of e.split("."))if(!la(r))return!1;return!0}return!(!Pn(e)||e.length<3||e.length>63||e!==e.toLowerCase()||na(e))},Ts=":",uf="/",lf=e=>{const t=e.split(Ts);if(t.length<6)return null;const[r,n,s,i,o,...a]=t;if(r!=="arn"||n===""||s===""||a.join(Ts)==="")return null;const c=a.map(u=>u.split(uf)).flat();return{partition:n,service:s,region:i,accountId:o,resourceId:c}},df=[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"AWS Standard global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"AWS China global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"AWS GovCloud (US) global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"c2s.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"AWS ISO (US) global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"sc2s.sgov.gov",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"AWS ISOB (US) global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"cloud.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"AWS ISOE (Europe) global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"csp.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"AWS ISOF global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"amazonaws.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"EU (Germany)"}}}],hf={partitions:df};let ff=hf;const pf=e=>{const{partitions:t}=ff;for(const n of t){const{regions:s,outputs:i}=n;for(const[o,a]of Object.entries(s))if(o===e)return{...i,...a}}for(const n of t){const{regionRegex:s,outputs:i}=n;if(new RegExp(s).test(e))return{...i}}const r=t.find(n=>n.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}},da={isVirtualHostableS3Bucket:la,parseArn:lf,partition:pf};Qt.aws=da;function gf(e){const t={};if(e=e.replace(/^\?/,""),e)for(const r of e.split("&")){let[n,s=null]=r.split("=");n=decodeURIComponent(n),s&&(s=decodeURIComponent(s)),n in t?Array.isArray(t[n])?t[n].push(s):t[n]=[t[n],s]:t[n]=s}return t}const Jt=e=>{if(typeof e=="string")return Jt(new URL(e));const{hostname:t,pathname:r,port:n,protocol:s,search:i}=e;let o;return i&&(o=gf(i)),{hostname:t,port:n?parseInt(n):void 0,protocol:s,path:r,query:o}},mf=/\d{12}\.ddb/;async function yf(e,t,r){var n,s,i,o,a,c,u;const f=r.request;if(((n=f==null?void 0:f.headers)==null?void 0:n["smithy-protocol"])==="rpc-v2-cbor"&&re(e,"PROTOCOL_RPC_V2_CBOR","M"),typeof t.retryStrategy=="function"){const p=await t.retryStrategy();typeof p.acquireInitialRetryToken=="function"?(i=(s=p.constructor)==null?void 0:s.name)!=null&&i.includes("Adaptive")?re(e,"RETRY_MODE_ADAPTIVE","F"):re(e,"RETRY_MODE_STANDARD","E"):re(e,"RETRY_MODE_LEGACY","D")}if(typeof t.accountIdEndpointMode=="function"){const p=e.endpointV2;switch(String((o=p==null?void 0:p.url)==null?void 0:o.hostname).match(mf)&&re(e,"ACCOUNT_ID_ENDPOINT","O"),await((a=t.accountIdEndpointMode)==null?void 0:a.call(t))){case"disabled":re(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":re(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":re(e,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const h=(u=(c=e.__smithy_context)==null?void 0:c.selectedHttpAuthScheme)==null?void 0:u.identity;if(h!=null&&h.$source){const p=h;p.accountId&&re(e,"RESOLVED_ACCOUNT_ID","T");for(const[y,E]of Object.entries(p.$source??{}))re(e,y,E)}}const Is="user-agent",Pr="x-amz-user-agent",Ns=" ",Tr="/",wf=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,bf=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,Os="-",vf=1024;function Sf(e){let t="";for(const r in e){const n=e[r];if(t.length+n.length+1<=vf){t.length?t+=","+n:t+=n;continue}break}return t}const Ef=e=>(t,r)=>async n=>{var s,i,o,a;const{request:c}=n;if(!se.isInstance(c))return t(n);const{headers:u}=c,f=((s=r==null?void 0:r.userAgent)==null?void 0:s.map(Bt))||[],h=(await e.defaultUserAgentProvider()).map(Bt);await yf(r,e,n);const p=r;h.push(`m/${Sf(Object.assign({},(i=r.__smithy_context)==null?void 0:i.features,(o=p.__aws_sdk_context)==null?void 0:o.features))}`);const y=((a=e==null?void 0:e.customUserAgent)==null?void 0:a.map(Bt))||[],E=await e.userAgentAppId();E&&h.push(Bt([`app/${E}`]));const x=[].concat([...h,...f,...y]).join(Ns),A=[...h.filter(L=>L.startsWith("aws-sdk-")),...y].join(Ns);return e.runtime!=="browser"?(A&&(u[Pr]=u[Pr]?`${u[Is]} ${A}`:A),u[Is]=x):u[Pr]=x,t({...n,request:c})},Bt=e=>{var t;const r=e[0].split(Tr).map(a=>a.replace(wf,Os)).join(Tr),n=(t=e[1])==null?void 0:t.replace(bf,Os),s=r.indexOf(Tr),i=r.substring(0,s);let o=r.substring(s+1);return i==="api"&&(o=o.toLowerCase()),[i,o,n].filter(a=>a&&a.length>0).reduce((a,c,u)=>{switch(u){case 0:return c;case 1:return`${a}/${c}`;default:return`${a}#${c}`}},"")},Af={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},xf=e=>({applyToStack:t=>{t.add(Ef(e),Af)}}),kf=!1,Rf=!1,ha=e=>typeof e=="string"&&(e.startsWith("fips-")||e.endsWith("-fips")),Ms=e=>ha(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e,Cf=e=>{const{region:t,useFipsEndpoint:r}=e;if(!t)throw new Error("Region is missing");return Object.assign(e,{region:async()=>{if(typeof t=="string")return Ms(t);const n=await t();return Ms(n)},useFipsEndpoint:async()=>{const n=typeof t=="string"?t:await t();return ha(n)?!0:typeof r!="function"?Promise.resolve(!!r):r()}})},Pf=e=>Object.assign(e,{eventStreamMarshaller:e.eventStreamSerdeProvider(e)}),Us="content-length";function Tf(e){return t=>async r=>{const n=r.request;if(se.isInstance(n)){const{body:s,headers:i}=n;if(s&&Object.keys(i).map(o=>o.toLowerCase()).indexOf(Us)===-1)try{const o=e(s);n.headers={...n.headers,[Us]:String(o)}}catch{}}return t({...r,request:n})}}const If={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},Nf=e=>({applyToStack:t=>{t.add(Tf(e.bodyLengthChecker),If)}}),Of=async e=>{const t=(e==null?void 0:e.Bucket)||"";if(typeof e.Bucket=="string"&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),_f(t)){if(e.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!Df(t)||t.indexOf(".")!==-1&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e},Mf=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,Uf=/(\d+\.){3}\d+/,$f=/\.\./,Df=e=>Mf.test(e)&&!Uf.test(e)&&!$f.test(e),_f=e=>{const[t,r,n,,,s]=e.split(":"),i=t==="arn"&&e.split(":").length>=6,o=!!(i&&r&&n&&s);if(i&&!o)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return o},Bf=(e,t,r)=>{const n=async()=>{const s=r[e]??r[t];return typeof s=="function"?s():s};return e==="credentialScope"||t==="CredentialScope"?async()=>{const s=typeof r.credentials=="function"?await r.credentials():r.credentials;return(s==null?void 0:s.credentialScope)??(s==null?void 0:s.CredentialScope)}:e==="accountId"||t==="AccountId"?async()=>{const s=typeof r.credentials=="function"?await r.credentials():r.credentials;return(s==null?void 0:s.accountId)??(s==null?void 0:s.AccountId)}:e==="endpoint"||t==="endpoint"?async()=>{if(r.isCustomEndpoint===!1)return;const s=await n();if(s&&typeof s=="object"){if("url"in s)return s.url.href;if("hostname"in s){const{protocol:i,hostname:o,port:a,path:c}=s;return`${i}//${o}${a?":"+a:""}${c}`}}return s}:n},fa=async e=>{},pa=e=>typeof e=="object"?"url"in e?Jt(e.url):e:Jt(e),Lf=async(e,t,r,n)=>{if(!r.isCustomEndpoint){let i;r.serviceConfiguredEndpoint?i=await r.serviceConfiguredEndpoint():i=await fa(r.serviceId),i&&(r.endpoint=()=>Promise.resolve(pa(i)),r.isCustomEndpoint=!0)}const s=await ga(e,t,r);if(typeof r.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");return r.endpointProvider(s,n)},ga=async(e,t,r)=>{var n;const s={},i=((n=t==null?void 0:t.getEndpointParameterInstructions)==null?void 0:n.call(t))||{};for(const[o,a]of Object.entries(i))switch(a.type){case"staticContextParams":s[o]=a.value;break;case"contextParams":s[o]=e[a.name];break;case"clientContextParams":case"builtInParams":s[o]=await Bf(a.name,o,r)();break;case"operationContextParams":s[o]=a.get(e);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(a))}return Object.keys(i).length===0&&Object.assign(s,r),String(r.serviceId).toLowerCase()==="s3"&&await Of(s),s},Ff=({config:e,instructions:t})=>(r,n)=>async s=>{var i,o,a;e.isCustomEndpoint&&Tu(n,"ENDPOINT_OVERRIDE","N");const c=await Lf(s.input,{getEndpointParameterInstructions(){return t}},{...e},n);n.endpointV2=c,n.authSchemes=(i=c.properties)==null?void 0:i.authSchemes;const u=(o=n.authSchemes)==null?void 0:o[0];if(u){n.signing_region=u.signingRegion,n.signing_service=u.signingName;const f=St(n),h=(a=f==null?void 0:f.selectedHttpAuthScheme)==null?void 0:a.httpAuthOption;h&&(h.signingProperties=Object.assign(h.signingProperties||{},{signing_region:u.signingRegion,signingRegion:u.signingRegion,signing_service:u.signingName,signingName:u.signingName,signingRegionSet:u.signingRegionSet},u.properties))}return r({...s})},Hf={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:po.name},ma=(e,t)=>({applyToStack:r=>{r.addRelativeTo(Ff({config:e,instructions:t}),Hf)}}),qf=e=>{const t=e.tls??!0,{endpoint:r,useDualstackEndpoint:n,useFipsEndpoint:s}=e,i=r!=null?async()=>pa(await Me(r)()):void 0,o=Object.assign(e,{endpoint:i,tls:t,isCustomEndpoint:!!r,useDualstackEndpoint:Me(n??!1),useFipsEndpoint:Me(s??!1)});let a;return o.serviceConfiguredEndpoint=async()=>(e.serviceId&&!a&&(a=fa(e.serviceId)),a),o};var yt;(function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"})(yt||(yt={}));const In=3,jf=yt.STANDARD,zf=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],Vf=["TimeoutError","RequestTimeout","RequestTimeoutException"],Wf=[500,502,503,504],Kf=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],Gf=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],Zf=e=>{var t;return(t=e.$metadata)==null?void 0:t.clockSkewCorrected},Yf=e=>{const t=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return e&&e instanceof TypeError?t.has(e.message):!1},ya=e=>{var t,r;return((t=e.$metadata)==null?void 0:t.httpStatusCode)===429||zf.includes(e.name)||((r=e.$retryable)==null?void 0:r.throttling)==!0},Nn=(e,t=0)=>{var r;return Zf(e)||Vf.includes(e.name)||Kf.includes((e==null?void 0:e.code)||"")||Gf.includes((e==null?void 0:e.code)||"")||Wf.includes(((r=e.$metadata)==null?void 0:r.httpStatusCode)||0)||Yf(e)||e.cause!==void 0&&t<=10&&Nn(e.cause,t+1)},Xf=e=>{var t;if(((t=e.$metadata)==null?void 0:t.httpStatusCode)!==void 0){const r=e.$metadata.httpStatusCode;return 500<=r&&r<=599&&!Nn(e)}return!1};class ar{constructor(t){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=(t==null?void 0:t.beta)??.7,this.minCapacity=(t==null?void 0:t.minCapacity)??1,this.minFillRate=(t==null?void 0:t.minFillRate)??.5,this.scaleConstant=(t==null?void 0:t.scaleConstant)??.4,this.smooth=(t==null?void 0:t.smooth)??.8;const r=this.getCurrentTimeInSeconds();this.lastThrottleTime=r,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(t){if(this.enabled){if(this.refillTokenBucket(),t>this.currentCapacity){const r=(t-this.currentCapacity)/this.fillRate*1e3;await new Promise(n=>ar.setTimeoutFn(n,r))}this.currentCapacity=this.currentCapacity-t}}refillTokenBucket(){const t=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=t;return}const r=(t-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+r),this.lastTimestamp=t}updateClientSendingRate(t){let r;if(this.updateMeasuredRate(),ya(t)){const s=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=s,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(s),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());const n=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(n)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(t){return this.getPrecise(t*this.beta)}cubicSuccess(t){return this.getPrecise(this.scaleConstant*Math.pow(t-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(t){this.refillTokenBucket(),this.fillRate=Math.max(t,this.minFillRate),this.maxCapacity=Math.max(t,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const t=this.getCurrentTimeInSeconds(),r=Math.floor(t*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){const n=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(t){return parseFloat(t.toFixed(8))}}ar.setTimeoutFn=setTimeout;const pn=100,wa=20*1e3,Qf=500,$s=500,Jf=5,ep=10,tp=1,rp="amz-sdk-invocation-id",np="amz-sdk-request",sp=()=>{let e=pn;return{computeNextBackoffDelay:t=>Math.floor(Math.min(wa,Math.random()*2**t*e)),setDelayBase:t=>{e=t}}},Ds=({retryDelay:e,retryCount:t,retryCost:r})=>({getRetryCount:()=>t,getRetryDelay:()=>Math.min(wa,e),getRetryCost:()=>r});class ba{constructor(t){this.maxAttempts=t,this.mode=yt.STANDARD,this.capacity=$s,this.retryBackoffStrategy=sp(),this.maxAttemptsProvider=typeof t=="function"?t:async()=>t}async acquireInitialRetryToken(t){return Ds({retryDelay:pn,retryCount:0})}async refreshRetryTokenForRetry(t,r){const n=await this.getMaxAttempts();if(this.shouldRetry(t,r,n)){const s=r.errorType;this.retryBackoffStrategy.setDelayBase(s==="THROTTLING"?Qf:pn);const i=this.retryBackoffStrategy.computeNextBackoffDelay(t.getRetryCount()),o=r.retryAfterHint?Math.max(r.retryAfterHint.getTime()-Date.now()||0,i):i,a=this.getCapacityCost(s);return this.capacity-=a,Ds({retryDelay:o,retryCount:t.getRetryCount()+1,retryCost:a})}throw new Error("No retry token available")}recordSuccess(t){this.capacity=Math.max($s,this.capacity+(t.getRetryCost()??tp))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return In}}shouldRetry(t,r,n){return t.getRetryCount()+1<n&&this.capacity>=this.getCapacityCost(r.errorType)&&this.isRetryableError(r.errorType)}getCapacityCost(t){return t==="TRANSIENT"?ep:Jf}isRetryableError(t){return t==="THROTTLING"||t==="TRANSIENT"}}class ip{constructor(t,r){this.maxAttemptsProvider=t,this.mode=yt.ADAPTIVE;const{rateLimiter:n}=r??{};this.rateLimiter=n??new ar,this.standardRetryStrategy=new ba(t)}async acquireInitialRetryToken(t){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(t)}async refreshRetryTokenForRetry(t,r){return this.rateLimiter.updateClientSendingRate(r),this.standardRetryStrategy.refreshRetryTokenForRetry(t,r)}recordSuccess(t){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(t)}}let Lt;const op=new Uint8Array(16);function ap(){if(!Lt&&(Lt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Lt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Lt(op)}const fe=[];for(let e=0;e<256;++e)fe.push((e+256).toString(16).slice(1));function cp(e,t=0){return fe[e[t+0]]+fe[e[t+1]]+fe[e[t+2]]+fe[e[t+3]]+"-"+fe[e[t+4]]+fe[e[t+5]]+"-"+fe[e[t+6]]+fe[e[t+7]]+"-"+fe[e[t+8]]+fe[e[t+9]]+"-"+fe[e[t+10]]+fe[e[t+11]]+fe[e[t+12]]+fe[e[t+13]]+fe[e[t+14]]+fe[e[t+15]]}const up=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),_s={randomUUID:up};function lp(e,t,r){if(_s.randomUUID&&!t&&!e)return _s.randomUUID();e=e||{};const n=e.random||(e.rng||ap)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,cp(n)}const dp=e=>e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):typeof e=="string"?new Error(e):new Error(`AWS SDK error wrapper for ${e}`),hp=e=>{const{retryStrategy:t,retryMode:r,maxAttempts:n}=e,s=Me(n??In);return Object.assign(e,{maxAttempts:s,retryStrategy:async()=>t||(await Me(r)()===yt.ADAPTIVE?new ip(s):new ba(s))})},fp=e=>(e==null?void 0:e.body)instanceof ReadableStream,pp=e=>(t,r)=>async n=>{var s;let i=await e.retryStrategy();const o=await e.maxAttempts();if(gp(i)){i=i;let a=await i.acquireInitialRetryToken(r.partition_id),c=new Error,u=0,f=0;const{request:h}=n,p=se.isInstance(h);for(p&&(h.headers[rp]=lp());;)try{p&&(h.headers[np]=`attempt=${u+1}; max=${o}`);const{response:y,output:E}=await t(n);return i.recordSuccess(a),E.$metadata.attempts=u+1,E.$metadata.totalRetryDelay=f,{response:y,output:E}}catch(y){const E=mp(y);if(c=dp(y),p&&fp(h))throw(s=r.logger instanceof En?console:r.logger)==null||s.warn("An error was encountered in a non-retryable streaming request."),c;try{a=await i.refreshRetryTokenForRetry(a,E)}catch{throw c.$metadata||(c.$metadata={}),c.$metadata.attempts=u+1,c.$metadata.totalRetryDelay=f,c}u=a.getRetryCount();const x=a.getRetryDelay();f+=x,await new Promise(A=>setTimeout(A,x))}}else return i=i,i!=null&&i.mode&&(r.userAgent=[...r.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(t,n)},gp=e=>typeof e.acquireInitialRetryToken<"u"&&typeof e.refreshRetryTokenForRetry<"u"&&typeof e.recordSuccess<"u",mp=e=>{const t={error:e,errorType:yp(e)},r=vp(e.$response);return r&&(t.retryAfterHint=r),t},yp=e=>ya(e)?"THROTTLING":Nn(e)?"TRANSIENT":Xf(e)?"SERVER_ERROR":"CLIENT_ERROR",wp={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},bp=e=>({applyToStack:t=>{t.add(pp(e),wp)}}),vp=e=>{if(!pt.isInstance(e))return;const t=Object.keys(e.headers).find(s=>s.toLowerCase()==="retry-after");if(!t)return;const r=e.headers[t],n=Number(r);return Number.isNaN(n)?new Date(r):new Date(n*1e3)};class va{constructor(t){O(this,"sigv4aSigner"),O(this,"sigv4Signer"),O(this,"signerOptions"),this.sigv4Signer=new wh(t),this.signerOptions=t}static sigv4aDependency(){return"none"}async sign(t,r={}){return r.signingRegion==="*"?this.getSigv4aSigner().sign(t,r):this.sigv4Signer.sign(t,r)}async signWithCredentials(t,r,n={}){if(n.signingRegion==="*")throw this.getSigv4aSigner(),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,r,n)}async presign(t,r={}){if(r.signingRegion==="*")throw this.getSigv4aSigner(),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,r)}async presignWithCredentials(t,r,n={}){if(n.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(t,r,n)}getSigv4aSigner(){if(!this.sigv4aSigner)throw this.signerOptions.runtime==="node"?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"):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");return this.sigv4aSigner}}const On="required",l="type",w="rules",d="conditions",g="fn",m="argv",T="ref",M="assign",R="url",C="properties",rt="backend",be="authSchemes",le="disableDoubleEncoding",de="signingName",xe="signingRegion",P="headers",Mn="signingRegionSet",Sp=6,Ep=!1,$e=!0,Pe="isSet",J="booleanEquals",k="error",er="aws.partition",B="stringEquals",K="getAttr",Q="name",j="substring",Bs="bucketSuffix",Un="parseURL",S="endpoint",b="tree",tr="aws.isVirtualHostableS3Bucket",rr="{url#scheme}://{Bucket}.{url#authority}{url#path}",Be="not",Ls="accessPointSuffix",zt="{url#scheme}://{url#authority}{url#path}",Sa="hardwareType",Ea="regionPrefix",Fs="bucketAliasSuffix",gn="outpostId",ot="isValidHostLabel",$n="sigv4a",Dt="s3-outposts",wt="s3",Aa="{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",xa="https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",Hs="https://{Bucket}.s3.{partitionResult#dnsSuffix}",ka="aws.parseArn",Ra="bucketArn",Ca="arnType",nr="",Dn="s3-object-lambda",Pa="accesspoint",_n="accessPointName",qs="{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",js="mrapPartition",zs="outpostType",Vs="arnPrefix",Ta="{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",Ws="https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",Ks="https://s3.{partitionResult#dnsSuffix}",at={[On]:!1,[l]:"String"},ct={[On]:!0,default:!1,[l]:"Boolean"},xt={[On]:!1,[l]:"Boolean"},Ne={[g]:J,[m]:[{[T]:"Accelerate"},!0]},V={[g]:J,[m]:[{[T]:"UseFIPS"},!0]},q={[g]:J,[m]:[{[T]:"UseDualStack"},!0]},Y={[g]:Pe,[m]:[{[T]:"Endpoint"}]},Ia={[g]:er,[m]:[{[T]:"Region"}],[M]:"partitionResult"},Gs={[g]:B,[m]:[{[g]:K,[m]:[{[T]:"partitionResult"},Q]},"aws-cn"]},Nt={[g]:Pe,[m]:[{[T]:"Bucket"}]},_={[T]:"Bucket"},Zs={[d]:[q],[k]:"S3Express does not support Dual-stack.",[l]:k},Ys={[d]:[Ne],[k]:"S3Express does not support S3 Accelerate.",[l]:k},Xs={[d]:[Y,{[g]:Un,[m]:[{[T]:"Endpoint"}],[M]:"url"}],[w]:[{[d]:[{[g]:Pe,[m]:[{[T]:"DisableS3ExpressSessionAuth"}]},{[g]:J,[m]:[{[T]:"DisableS3ExpressSessionAuth"},!0]}],[w]:[{[d]:[{[g]:J,[m]:[{[g]:K,[m]:[{[T]:"url"},"isIp"]},!0]}],[w]:[{[d]:[{[g]:"uriEncode",[m]:[_],[M]:"uri_encoded_bucket"}],[w]:[{[S]:{[R]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",[C]:{[rt]:"S3Express",[be]:[{[le]:!0,[Q]:"sigv4",[de]:"s3express",[xe]:"{Region}"}]},[P]:{}},[l]:S}],[l]:b}],[l]:b},{[d]:[{[g]:tr,[m]:[_,!1]}],[w]:[{[S]:{[R]:rr,[C]:{[rt]:"S3Express",[be]:[{[le]:!0,[Q]:"sigv4",[de]:"s3express",[xe]:"{Region}"}]},[P]:{}},[l]:S}],[l]:b},{[k]:"S3Express bucket name is not a valid virtual hostable name.",[l]:k}],[l]:b},{[d]:[{[g]:J,[m]:[{[g]:K,[m]:[{[T]:"url"},"isIp"]},!0]}],[w]:[{[d]:[{[g]:"uriEncode",[m]:[_],[M]:"uri_encoded_bucket"}],[w]:[{[S]:{[R]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",[C]:{[rt]:"S3Express",[be]:[{[le]:!0,[Q]:"sigv4-s3express",[de]:"s3express",[xe]:"{Region}"}]},[P]:{}},[l]:S}],[l]:b}],[l]:b},{[d]:[{[g]:tr,[m]:[_,!1]}],[w]:[{[S]:{[R]:rr,[C]:{[rt]:"S3Express",[be]:[{[le]:!0,[Q]:"sigv4-s3express",[de]:"s3express",[xe]:"{Region}"}]},[P]:{}},[l]:S}],[l]:b},{[k]:"S3Express bucket name is not a valid virtual hostable name.",[l]:k}],[l]:b},Ee={[g]:Un,[m]:[{[T]:"Endpoint"}],[M]:"url"},Ir={[g]:J,[m]:[{[g]:K,[m]:[{[T]:"url"},"isIp"]},!0]},Na={[T]:"url"},Oa={[g]:"uriEncode",[m]:[_],[M]:"uri_encoded_bucket"},et={[rt]:"S3Express",[be]:[{[le]:!0,[Q]:"sigv4",[de]:"s3express",[xe]:"{Region}"}]},I={},Ma={[g]:tr,[m]:[_,!1]},Qs={[k]:"S3Express bucket name is not a valid virtual hostable name.",[l]:k},Js={[g]:Pe,[m]:[{[T]:"UseS3ExpressControlEndpoint"}]},ei={[g]:J,[m]:[{[T]:"UseS3ExpressControlEndpoint"},!0]},N={[g]:Be,[m]:[Y]},Ft={[k]:"Unrecognized S3Express bucket name format.",[l]:k},ti={[g]:Be,[m]:[Nt]},ri={[T]:Sa},ni={[d]:[N],[k]:"Expected a endpoint to be specified but no endpoint was found",[l]:k},Ht={[be]:[{[le]:!0,[Q]:$n,[de]:Dt,[Mn]:["*"]},{[le]:!0,[Q]:"sigv4",[de]:Dt,[xe]:"{Region}"}]},Nr={[g]:J,[m]:[{[T]:"ForcePathStyle"},!1]},Ap={[T]:"ForcePathStyle"},te={[g]:J,[m]:[{[T]:"Accelerate"},!1]},ie={[g]:B,[m]:[{[T]:"Region"},"aws-global"]},ae={[be]:[{[le]:!0,[Q]:"sigv4",[de]:wt,[xe]:"us-east-1"}]},D={[g]:Be,[m]:[ie]},ce={[g]:J,[m]:[{[T]:"UseGlobalEndpoint"},!0]},si={[R]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[C]:{[be]:[{[le]:!0,[Q]:"sigv4",[de]:wt,[xe]:"{Region}"}]},[P]:{}},ne={[be]:[{[le]:!0,[Q]:"sigv4",[de]:wt,[xe]:"{Region}"}]},ue={[g]:J,[m]:[{[T]:"UseGlobalEndpoint"},!1]},$={[g]:J,[m]:[{[T]:"UseDualStack"},!1]},ii={[R]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",[C]:ne,[P]:{}},U={[g]:J,[m]:[{[T]:"UseFIPS"},!1]},oi={[R]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",[C]:ne,[P]:{}},ai={[R]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",[C]:ne,[P]:{}},Or={[g]:J,[m]:[{[g]:K,[m]:[Na,"isIp"]},!1]},Mr={[R]:Aa,[C]:ne,[P]:{}},mn={[R]:rr,[C]:ne,[P]:{}},ci={[S]:mn,[l]:S},Ur={[R]:xa,[C]:ne,[P]:{}},ui={[R]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",[C]:ne,[P]:{}},qt={[k]:"Invalid region: region was not a valid DNS name.",[l]:k},Ce={[T]:Ra},Ua={[T]:Ca},$r={[g]:K,[m]:[Ce,"service"]},Bn={[T]:_n},li={[d]:[q],[k]:"S3 Object Lambda does not support Dual-stack",[l]:k},di={[d]:[Ne],[k]:"S3 Object Lambda does not support S3 Accelerate",[l]:k},hi={[d]:[{[g]:Pe,[m]:[{[T]:"DisableAccessPoints"}]},{[g]:J,[m]:[{[T]:"DisableAccessPoints"},!0]}],[k]:"Access points are not supported for this operation",[l]:k},Dr={[d]:[{[g]:Pe,[m]:[{[T]:"UseArnRegion"}]},{[g]:J,[m]:[{[T]:"UseArnRegion"},!1]},{[g]:Be,[m]:[{[g]:B,[m]:[{[g]:K,[m]:[Ce,"region"]},"{Region}"]}]}],[k]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",[l]:k},$a={[g]:K,[m]:[{[T]:"bucketPartition"},Q]},Da={[g]:K,[m]:[Ce,"accountId"]},_r={[be]:[{[le]:!0,[Q]:"sigv4",[de]:Dn,[xe]:"{bucketArn#region}"}]},fi={[k]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",[l]:k},Br={[k]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",[l]:k},Lr={[k]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",[l]:k},Fr={[k]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",[l]:k},pi={[k]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",[l]:k},gi={[k]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",[l]:k},kt={[be]:[{[le]:!0,[Q]:"sigv4",[de]:wt,[xe]:"{bucketArn#region}"}]},mi={[be]:[{[le]:!0,[Q]:$n,[de]:Dt,[Mn]:["*"]},{[le]:!0,[Q]:"sigv4",[de]:Dt,[xe]:"{bucketArn#region}"}]},yi={[g]:ka,[m]:[_]},wi={[R]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[C]:ne,[P]:{}},bi={[R]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[C]:ne,[P]:{}},vi={[R]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[C]:ne,[P]:{}},Hr={[R]:Ta,[C]:ne,[P]:{}},Si={[R]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[C]:ne,[P]:{}},Ei={[T]:"UseObjectLambdaEndpoint"},qr={[be]:[{[le]:!0,[Q]:"sigv4",[de]:Dn,[xe]:"{Region}"}]},Ai={[R]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",[C]:ne,[P]:{}},xi={[R]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",[C]:ne,[P]:{}},ki={[R]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",[C]:ne,[P]:{}},jr={[R]:zt,[C]:ne,[P]:{}},Ri={[R]:"https://s3.{Region}.{partitionResult#dnsSuffix}",[C]:ne,[P]:{}},zr=[{[T]:"Region"}],xp=[{[T]:"Endpoint"}],kp=[_],Ci=[q],Vr=[Ne],ut=[Y,Ee],Pi=[{[g]:Pe,[m]:[{[T]:"DisableS3ExpressSessionAuth"}]},{[g]:J,[m]:[{[T]:"DisableS3ExpressSessionAuth"},!0]}],Rp=[Oa],Ti=[Ma],Ie=[Ia],lt=[V],Ii=[{[g]:j,[m]:[_,6,14,!0],[M]:"s3expressAvailabilityZoneId"},{[g]:j,[m]:[_,14,16,!0],[M]:"s3expressAvailabilityZoneDelim"},{[g]:B,[m]:[{[T]:"s3expressAvailabilityZoneDelim"},"--"]}],De=[{[d]:[V],[S]:{[R]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[C]:et,[P]:{}},[l]:S},{[S]:{[R]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[C]:et,[P]:{}},[l]:S}],Ni=[{[g]:j,[m]:[_,6,15,!0],[M]:"s3expressAvailabilityZoneId"},{[g]:j,[m]:[_,15,17,!0],[M]:"s3expressAvailabilityZoneDelim"},{[g]:B,[m]:[{[T]:"s3expressAvailabilityZoneDelim"},"--"]}],Oi=[{[g]:j,[m]:[_,6,19,!0],[M]:"s3expressAvailabilityZoneId"},{[g]:j,[m]:[_,19,21,!0],[M]:"s3expressAvailabilityZoneDelim"},{[g]:B,[m]:[{[T]:"s3expressAvailabilityZoneDelim"},"--"]}],Mi=[{[g]:j,[m]:[_,6,20,!0],[M]:"s3expressAvailabilityZoneId"},{[g]:j,[m]:[_,20,22,!0],[M]:"s3expressAvailabilityZoneDelim"},{[g]:B,[m]:[{[T]:"s3expressAvailabilityZoneDelim"},"--"]}],Ui=[{[g]:j,[m]:[_,6,26,!0],[M]:"s3expressAvailabilityZoneId"},{[g]:j,[m]:[_,26,28,!0],[M]:"s3expressAvailabilityZoneDelim"},{[g]:B,[m]:[{[T]:"s3expressAvailabilityZoneDelim"},"--"]}],_e=[{[d]:[V],[S]:{[R]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[C]:{[rt]:"S3Express",[be]:[{[le]:!0,[Q]:"sigv4-s3express",[de]:"s3express",[xe]:"{Region}"}]},[P]:{}},[l]:S},{[S]:{[R]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",[C]:{[rt]:"S3Express",[be]:[{[le]:!0,[Q]:"sigv4-s3express",[de]:"s3express",[xe]:"{Region}"}]},[P]:{}},[l]:S}],$i=[_,0,7,!0],Di=[{[g]:j,[m]:[_,7,15,!0],[M]:"s3expressAvailabilityZoneId"},{[g]:j,[m]:[_,15,17,!0],[M]:"s3expressAvailabilityZoneDelim"},{[g]:B,[m]:[{[T]:"s3expressAvailabilityZoneDelim"},"--"]}],_i=[{[g]:j,[m]:[_,7,16,!0],[M]:"s3expressAvailabilityZoneId"},{[g]:j,[m]:[_,16,18,!0],[M]:"s3expressAvailabilityZoneDelim"},{[g]:B,[m]:[{[T]:"s3expressAvailabilityZoneDelim"},"--"]}],Bi=[{[g]:j,[m]:[_,7,20,!0],[M]:"s3expressAvailabilityZoneId"},{[g]:j,[m]:[_,20,22,!0],[M]:"s3expressAvailabilityZoneDelim"},{[g]:B,[m]:[{[T]:"s3expressAvailabilityZoneDelim"},"--"]}],Li=[{[g]:j,[m]:[_,7,21,!0],[M]:"s3expressAvailabilityZoneId"},{[g]:j,[m]:[_,21,23,!0],[M]:"s3expressAvailabilityZoneDelim"},{[g]:B,[m]:[{[T]:"s3expressAvailabilityZoneDelim"},"--"]}],Fi=[{[g]:j,[m]:[_,7,27,!0],[M]:"s3expressAvailabilityZoneId"},{[g]:j,[m]:[_,27,29,!0],[M]:"s3expressAvailabilityZoneDelim"},{[g]:B,[m]:[{[T]:"s3expressAvailabilityZoneDelim"},"--"]}],Cp=[Nt],Hi=[{[g]:ot,[m]:[{[T]:gn},!1]}],qi=[{[g]:B,[m]:[{[T]:Ea},"beta"]}],Pp=["*"],ji=[{[g]:ot,[m]:[{[T]:"Region"},!1]}],Fe=[{[g]:B,[m]:[{[T]:"Region"},"us-east-1"]}],Wr=[{[g]:B,[m]:[Ua,Pa]}],zi=[{[g]:K,[m]:[Ce,"resourceId[1]"],[M]:_n},{[g]:Be,[m]:[{[g]:B,[m]:[Bn,nr]}]}],Tp=[Ce,"resourceId[1]"],Kr=[{[g]:Be,[m]:[{[g]:B,[m]:[{[g]:K,[m]:[Ce,"region"]},nr]}]}],Vi=[{[g]:Be,[m]:[{[g]:Pe,[m]:[{[g]:K,[m]:[Ce,"resourceId[2]"]}]}]}],Ip=[Ce,"resourceId[2]"],Gr=[{[g]:er,[m]:[{[g]:K,[m]:[Ce,"region"]}],[M]:"bucketPartition"}],Wi=[{[g]:B,[m]:[$a,{[g]:K,[m]:[{[T]:"partitionResult"},Q]}]}],Zr=[{[g]:ot,[m]:[{[g]:K,[m]:[Ce,"region"]},!0]}],Yr=[{[g]:ot,[m]:[Da,!1]}],Ki=[{[g]:ot,[m]:[Bn,!1]}],Gi=[{[g]:ot,[m]:[{[T]:"Region"},!0]}],Np={parameters:{Bucket:at,Region:at,UseFIPS:ct,UseDualStack:ct,Endpoint:at,ForcePathStyle:ct,Accelerate:ct,UseGlobalEndpoint:ct,UseObjectLambdaEndpoint:xt,Key:at,Prefix:at,CopySource:at,DisableAccessPoints:xt,DisableMultiRegionAccessPoints:ct,UseArnRegion:xt,UseS3ExpressControlEndpoint:xt,DisableS3ExpressSessionAuth:xt},[w]:[{[d]:[{[g]:Pe,[m]:zr}],[w]:[{[d]:[Ne,V],error:"Accelerate cannot be used with FIPS",[l]:k},{[d]:[q,Y],error:"Cannot set dual-stack in combination with a custom endpoint.",[l]:k},{[d]:[Y,V],error:"A custom endpoint cannot be combined with FIPS",[l]:k},{[d]:[Y,Ne],error:"A custom endpoint cannot be combined with S3 Accelerate",[l]:k},{[d]:[V,Ia,Gs],error:"Partition does not support FIPS",[l]:k},{[d]:[Nt,{[g]:j,[m]:[_,0,Sp,$e],[M]:Bs},{[g]:B,[m]:[{[T]:Bs},"--x-s3"]}],[w]:[Zs,Ys,Xs,{[d]:[Js,ei],[w]:[{[d]:Ie,[w]:[{[d]:[Oa,N],[w]:[{[d]:lt,endpoint:{[R]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[C]:et,[P]:I},[l]:S},{endpoint:{[R]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[C]:et,[P]:I},[l]:S}],[l]:b}],[l]:b}],[l]:b},{[d]:Ti,[w]:[{[d]:Ie,[w]:[{[d]:Pi,[w]:[{[d]:Ii,[w]:De,[l]:b},{[d]:Ni,[w]:De,[l]:b},{[d]:Oi,[w]:De,[l]:b},{[d]:Mi,[w]:De,[l]:b},{[d]:Ui,[w]:De,[l]:b},Ft],[l]:b},{[d]:Ii,[w]:_e,[l]:b},{[d]:Ni,[w]:_e,[l]:b},{[d]:Oi,[w]:_e,[l]:b},{[d]:Mi,[w]:_e,[l]:b},{[d]:Ui,[w]:_e,[l]:b},Ft],[l]:b}],[l]:b},Qs],[l]:b},{[d]:[Nt,{[g]:j,[m]:$i,[M]:Ls},{[g]:B,[m]:[{[T]:Ls},"--xa-s3"]}],[w]:[Zs,Ys,Xs,{[d]:Ti,[w]:[{[d]:Ie,[w]:[{[d]:Pi,[w]:[{[d]:Di,[w]:De,[l]:b},{[d]:_i,[w]:De,[l]:b},{[d]:Bi,[w]:De,[l]:b},{[d]:Li,[w]:De,[l]:b},{[d]:Fi,[w]:De,[l]:b},Ft],[l]:b},{[d]:Di,[w]:_e,[l]:b},{[d]:_i,[w]:_e,[l]:b},{[d]:Bi,[w]:_e,[l]:b},{[d]:Li,[w]:_e,[l]:b},{[d]:Fi,[w]:_e,[l]:b},Ft],[l]:b}],[l]:b},Qs],[l]:b},{[d]:[ti,Js,ei],[w]:[{[d]:Ie,[w]:[{[d]:ut,endpoint:{[R]:zt,[C]:et,[P]:I},[l]:S},{[d]:lt,endpoint:{[R]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}",[C]:et,[P]:I},[l]:S},{endpoint:{[R]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}",[C]:et,[P]:I},[l]:S}],[l]:b}],[l]:b},{[d]:[Nt,{[g]:j,[m]:[_,49,50,$e],[M]:Sa},{[g]:j,[m]:[_,8,12,$e],[M]:Ea},{[g]:j,[m]:$i,[M]:Fs},{[g]:j,[m]:[_,32,49,$e],[M]:gn},{[g]:er,[m]:zr,[M]:"regionPartition"},{[g]:B,[m]:[{[T]:Fs},"--op-s3"]}],[w]:[{[d]:Hi,[w]:[{[d]:[{[g]:B,[m]:[ri,"e"]}],[w]:[{[d]:qi,[w]:[ni,{[d]:ut,endpoint:{[R]:"https://{Bucket}.ec2.{url#authority}",[C]:Ht,[P]:I},[l]:S}],[l]:b},{endpoint:{[R]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",[C]:Ht,[P]:I},[l]:S}],[l]:b},{[d]:[{[g]:B,[m]:[ri,"o"]}],[w]:[{[d]:qi,[w]:[ni,{[d]:ut,endpoint:{[R]:"https://{Bucket}.op-{outpostId}.{url#authority}",[C]:Ht,[P]:I},[l]:S}],[l]:b},{endpoint:{[R]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",[C]:Ht,[P]:I},[l]:S}],[l]:b},{error:'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"',[l]:k}],[l]:b},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",[l]:k}],[l]:b},{[d]:Cp,[w]:[{[d]:[Y,{[g]:Be,[m]:[{[g]:Pe,[m]:[{[g]:Un,[m]:xp}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",[l]:k},{[d]:[Nr,Ma],[w]:[{[d]:Ie,[w]:[{[d]:ji,[w]:[{[d]:[Ne,Gs],error:"S3 Accelerate cannot be used in this region",[l]:k},{[d]:[q,V,te,N,ie],endpoint:{[R]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",[C]:ae,[P]:I},[l]:S},{[d]:[q,V,te,N,D,ce],[w]:[{endpoint:si,[l]:S}],[l]:b},{[d]:[q,V,te,N,D,ue],endpoint:si,[l]:S},{[d]:[$,V,te,N,ie],endpoint:{[R]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",[C]:ae,[P]:I},[l]:S},{[d]:[$,V,te,N,D,ce],[w]:[{endpoint:ii,[l]:S}],[l]:b},{[d]:[$,V,te,N,D,ue],endpoint:ii,[l]:S},{[d]:[q,U,Ne,N,ie],endpoint:{[R]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",[C]:ae,[P]:I},[l]:S},{[d]:[q,U,Ne,N,D,ce],[w]:[{endpoint:oi,[l]:S}],[l]:b},{[d]:[q,U,Ne,N,D,ue],endpoint:oi,[l]:S},{[d]:[q,U,te,N,ie],endpoint:{[R]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",[C]:ae,[P]:I},[l]:S},{[d]:[q,U,te,N,D,ce],[w]:[{endpoint:ai,[l]:S}],[l]:b},{[d]:[q,U,te,N,D,ue],endpoint:ai,[l]:S},{[d]:[$,U,te,Y,Ee,Ir,ie],endpoint:{[R]:Aa,[C]:ae,[P]:I},[l]:S},{[d]:[$,U,te,Y,Ee,Or,ie],endpoint:{[R]:rr,[C]:ae,[P]:I},[l]:S},{[d]:[$,U,te,Y,Ee,Ir,D,ce],[w]:[{[d]:Fe,endpoint:Mr,[l]:S},{endpoint:Mr,[l]:S}],[l]:b},{[d]:[$,U,te,Y,Ee,Or,D,ce],[w]:[{[d]:Fe,endpoint:mn,[l]:S},ci],[l]:b},{[d]:[$,U,te,Y,Ee,Ir,D,ue],endpoint:Mr,[l]:S},{[d]:[$,U,te,Y,Ee,Or,D,ue],endpoint:mn,[l]:S},{[d]:[$,U,Ne,N,ie],endpoint:{[R]:xa,[C]:ae,[P]:I},[l]:S},{[d]:[$,U,Ne,N,D,ce],[w]:[{[d]:Fe,endpoint:Ur,[l]:S},{endpoint:Ur,[l]:S}],[l]:b},{[d]:[$,U,Ne,N,D,ue],endpoint:Ur,[l]:S},{[d]:[$,U,te,N,ie],endpoint:{[R]:Hs,[C]:ae,[P]:I},[l]:S},{[d]:[$,U,te,N,D,ce],[w]:[{[d]:Fe,endpoint:{[R]:Hs,[C]:ne,[P]:I},[l]:S},{endpoint:ui,[l]:S}],[l]:b},{[d]:[$,U,te,N,D,ue],endpoint:ui,[l]:S}],[l]:b},qt],[l]:b}],[l]:b},{[d]:[Y,Ee,{[g]:B,[m]:[{[g]:K,[m]:[Na,"scheme"]},"http"]},{[g]:tr,[m]:[_,$e]},Nr,U,$,te],[w]:[{[d]:Ie,[w]:[{[d]:ji,[w]:[ci],[l]:b},qt],[l]:b}],[l]:b},{[d]:[Nr,{[g]:ka,[m]:kp,[M]:Ra}],[w]:[{[d]:[{[g]:K,[m]:[Ce,"resourceId[0]"],[M]:Ca},{[g]:Be,[m]:[{[g]:B,[m]:[Ua,nr]}]}],[w]:[{[d]:[{[g]:B,[m]:[$r,Dn]}],[w]:[{[d]:Wr,[w]:[{[d]:zi,[w]:[li,di,{[d]:Kr,[w]:[hi,{[d]:Vi,[w]:[Dr,{[d]:Gr,[w]:[{[d]:Ie,[w]:[{[d]:Wi,[w]:[{[d]:Zr,[w]:[{[d]:[{[g]:B,[m]:[Da,nr]}],error:"Invalid ARN: Missing account id",[l]:k},{[d]:Yr,[w]:[{[d]:Ki,[w]:[{[d]:ut,endpoint:{[R]:qs,[C]:_r,[P]:I},[l]:S},{[d]:lt,endpoint:{[R]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",[C]:_r,[P]:I},[l]:S},{endpoint:{[R]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",[C]:_r,[P]:I},[l]:S}],[l]:b},fi],[l]:b},Br],[l]:b},Lr],[l]:b},Fr],[l]:b}],[l]:b}],[l]:b},pi],[l]:b},{error:"Invalid ARN: bucket ARN is missing a region",[l]:k}],[l]:b},gi],[l]:b},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",[l]:k}],[l]:b},{[d]:Wr,[w]:[{[d]:zi,[w]:[{[d]:Kr,[w]:[{[d]:Wr,[w]:[{[d]:Kr,[w]:[hi,{[d]:Vi,[w]:[Dr,{[d]:Gr,[w]:[{[d]:Ie,[w]:[{[d]:[{[g]:B,[m]:[$a,"{partitionResult#name}"]}],[w]:[{[d]:Zr,[w]:[{[d]:[{[g]:B,[m]:[$r,wt]}],[w]:[{[d]:Yr,[w]:[{[d]:Ki,[w]:[{[d]:Vr,error:"Access Points do not support S3 Accelerate",[l]:k},{[d]:[V,q],endpoint:{[R]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",[C]:kt,[P]:I},[l]:S},{[d]:[V,$],endpoint:{[R]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",[C]:kt,[P]:I},[l]:S},{[d]:[U,q],endpoint:{[R]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",[C]:kt,[P]:I},[l]:S},{[d]:[U,$,Y,Ee],endpoint:{[R]:qs,[C]:kt,[P]:I},[l]:S},{[d]:[U,$],endpoint:{[R]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",[C]:kt,[P]:I},[l]:S}],[l]:b},fi],[l]:b},Br],[l]:b},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",[l]:k}],[l]:b},Lr],[l]:b},Fr],[l]:b}],[l]:b}],[l]:b},pi],[l]:b}],[l]:b}],[l]:b},{[d]:[{[g]:ot,[m]:[Bn,$e]}],[w]:[{[d]:Ci,error:"S3 MRAP does not support dual-stack",[l]:k},{[d]:lt,error:"S3 MRAP does not support FIPS",[l]:k},{[d]:Vr,error:"S3 MRAP does not support S3 Accelerate",[l]:k},{[d]:[{[g]:J,[m]:[{[T]:"DisableMultiRegionAccessPoints"},$e]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",[l]:k},{[d]:[{[g]:er,[m]:zr,[M]:js}],[w]:[{[d]:[{[g]:B,[m]:[{[g]:K,[m]:[{[T]:js},Q]},{[g]:K,[m]:[Ce,"partition"]}]}],[w]:[{endpoint:{[R]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",[C]:{[be]:[{[le]:$e,name:$n,[de]:wt,[Mn]:Pp}]},[P]:I},[l]:S}],[l]:b},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",[l]:k}],[l]:b}],[l]:b},{error:"Invalid Access Point Name",[l]:k}],[l]:b},gi],[l]:b},{[d]:[{[g]:B,[m]:[$r,Dt]}],[w]:[{[d]:Ci,error:"S3 Outposts does not support Dual-stack",[l]:k},{[d]:lt,error:"S3 Outposts does not support FIPS",[l]:k},{[d]:Vr,error:"S3 Outposts does not support S3 Accelerate",[l]:k},{[d]:[{[g]:Pe,[m]:[{[g]:K,[m]:[Ce,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",[l]:k},{[d]:[{[g]:K,[m]:Tp,[M]:gn}],[w]:[{[d]:Hi,[w]:[Dr,{[d]:Gr,[w]:[{[d]:Ie,[w]:[{[d]:Wi,[w]:[{[d]:Zr,[w]:[{[d]:Yr,[w]:[{[d]:[{[g]:K,[m]:Ip,[M]:zs}],[w]:[{[d]:[{[g]:K,[m]:[Ce,"resourceId[3]"],[M]:_n}],[w]:[{[d]:[{[g]:B,[m]:[{[T]:zs},Pa]}],[w]:[{[d]:ut,endpoint:{[R]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",[C]:mi,[P]:I},[l]:S},{endpoint:{[R]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",[C]:mi,[P]:I},[l]:S}],[l]:b},{error:"Expected an outpost type `accesspoint`, found {outpostType}",[l]:k}],[l]:b},{error:"Invalid ARN: expected an access point name",[l]:k}],[l]:b},{error:"Invalid ARN: Expected a 4-component resource",[l]:k}],[l]:b},Br],[l]:b},Lr],[l]:b},Fr],[l]:b}],[l]:b}],[l]:b},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",[l]:k}],[l]:b},{error:"Invalid ARN: The Outpost Id was not set",[l]:k}],[l]:b},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",[l]:k}],[l]:b},{error:"Invalid ARN: No ARN type specified",[l]:k}],[l]:b},{[d]:[{[g]:j,[m]:[_,0,4,Ep],[M]:Vs},{[g]:B,[m]:[{[T]:Vs},"arn:"]},{[g]:Be,[m]:[{[g]:Pe,[m]:[yi]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",[l]:k},{[d]:[{[g]:J,[m]:[Ap,$e]},yi],error:"Path-style addressing cannot be used with ARN buckets",[l]:k},{[d]:Rp,[w]:[{[d]:Ie,[w]:[{[d]:[te],[w]:[{[d]:[q,N,V,ie],endpoint:{[R]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[C]:ae,[P]:I},[l]:S},{[d]:[q,N,V,D,ce],[w]:[{endpoint:wi,[l]:S}],[l]:b},{[d]:[q,N,V,D,ue],endpoint:wi,[l]:S},{[d]:[$,N,V,ie],endpoint:{[R]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[C]:ae,[P]:I},[l]:S},{[d]:[$,N,V,D,ce],[w]:[{endpoint:bi,[l]:S}],[l]:b},{[d]:[$,N,V,D,ue],endpoint:bi,[l]:S},{[d]:[q,N,U,ie],endpoint:{[R]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",[C]:ae,[P]:I},[l]:S},{[d]:[q,N,U,D,ce],[w]:[{endpoint:vi,[l]:S}],[l]:b},{[d]:[q,N,U,D,ue],endpoint:vi,[l]:S},{[d]:[$,Y,Ee,U,ie],endpoint:{[R]:Ta,[C]:ae,[P]:I},[l]:S},{[d]:[$,Y,Ee,U,D,ce],[w]:[{[d]:Fe,endpoint:Hr,[l]:S},{endpoint:Hr,[l]:S}],[l]:b},{[d]:[$,Y,Ee,U,D,ue],endpoint:Hr,[l]:S},{[d]:[$,N,U,ie],endpoint:{[R]:Ws,[C]:ae,[P]:I},[l]:S},{[d]:[$,N,U,D,ce],[w]:[{[d]:Fe,endpoint:{[R]:Ws,[C]:ne,[P]:I},[l]:S},{endpoint:Si,[l]:S}],[l]:b},{[d]:[$,N,U,D,ue],endpoint:Si,[l]:S}],[l]:b},{error:"Path-style addressing cannot be used with S3 Accelerate",[l]:k}],[l]:b}],[l]:b}],[l]:b},{[d]:[{[g]:Pe,[m]:[Ei]},{[g]:J,[m]:[Ei,$e]}],[w]:[{[d]:Ie,[w]:[{[d]:Gi,[w]:[li,di,{[d]:ut,endpoint:{[R]:zt,[C]:qr,[P]:I},[l]:S},{[d]:lt,endpoint:{[R]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",[C]:qr,[P]:I},[l]:S},{endpoint:{[R]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",[C]:qr,[P]:I},[l]:S}],[l]:b},qt],[l]:b}],[l]:b},{[d]:[ti],[w]:[{[d]:Ie,[w]:[{[d]:Gi,[w]:[{[d]:[V,q,N,ie],endpoint:{[R]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",[C]:ae,[P]:I},[l]:S},{[d]:[V,q,N,D,ce],[w]:[{endpoint:Ai,[l]:S}],[l]:b},{[d]:[V,q,N,D,ue],endpoint:Ai,[l]:S},{[d]:[V,$,N,ie],endpoint:{[R]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",[C]:ae,[P]:I},[l]:S},{[d]:[V,$,N,D,ce],[w]:[{endpoint:xi,[l]:S}],[l]:b},{[d]:[V,$,N,D,ue],endpoint:xi,[l]:S},{[d]:[U,q,N,ie],endpoint:{[R]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",[C]:ae,[P]:I},[l]:S},{[d]:[U,q,N,D,ce],[w]:[{endpoint:ki,[l]:S}],[l]:b},{[d]:[U,q,N,D,ue],endpoint:ki,[l]:S},{[d]:[U,$,Y,Ee,ie],endpoint:{[R]:zt,[C]:ae,[P]:I},[l]:S},{[d]:[U,$,Y,Ee,D,ce],[w]:[{[d]:Fe,endpoint:jr,[l]:S},{endpoint:jr,[l]:S}],[l]:b},{[d]:[U,$,Y,Ee,D,ue],endpoint:jr,[l]:S},{[d]:[U,$,N,ie],endpoint:{[R]:Ks,[C]:ae,[P]:I},[l]:S},{[d]:[U,$,N,D,ce],[w]:[{[d]:Fe,endpoint:{[R]:Ks,[C]:ne,[P]:I},[l]:S},{endpoint:Ri,[l]:S}],[l]:b},{[d]:[U,$,N,D,ue],endpoint:Ri,[l]:S}],[l]:b},qt],[l]:b}],[l]:b}],[l]:b},{error:"A region must be set when sending requests to S3.",[l]:k}]},Op=Np,Mp=new qh({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),_a=(e,t={})=>Mp.get(e,()=>cf(Op,{endpointParams:e,logger:t.logger}));Qt.aws=da;const Up=e=>async(t,r,n)=>{var s,i,o;if(!n)throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");const a=await e(t,r,n),c=(o=(i=(s=St(r))==null?void 0:s.commandInstance)==null?void 0:i.constructor)==null?void 0:o.getEndpointParameterInstructions;if(!c)throw new Error(`getEndpointParameterInstructions() is not defined on \`${r.commandName}\``);const u=await ga(n,{getEndpointParameterInstructions:c},t);return Object.assign(a,u)},$p=async(e,t,r)=>({operation:St(t).operation,region:await Me(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),Dp=Up($p);function Ba(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:e.region},propertiesExtractor:(t,r)=>({signingProperties:{config:t,context:r}})}}function La(e){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:e.region},propertiesExtractor:(t,r)=>({signingProperties:{config:t,context:r}})}}const _p=(e,t,r)=>n=>{var s;const i=(s=e(n).properties)==null?void 0:s.authSchemes;if(!i)return t(n);const o=[];for(const a of i){const{name:c,properties:u={},...f}=a,h=c.toLowerCase();let p;if(h==="sigv4a"){p="aws.auth#sigv4a";const x=i.find(A=>{const L=A.name.toLowerCase();return L!=="sigv4a"&&L.startsWith("sigv4")});if(va.sigv4aDependency()==="none"&&x)continue}else if(h.startsWith("sigv4"))p="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${h}\``);const y=r[p];if(!y)throw new Error(`Could not find HttpAuthOption create function for \`${p}\``);const E=y(n);E.schemeId=p,E.signingProperties={...E.signingProperties||{},...f,...u},o.push(E)}return o},Bp=e=>{const t=[];switch(e.operation){default:t.push(Ba(e)),t.push(La(e))}return t},Lp=_p(_a,Bp,{"aws.auth#sigv4":Ba,"aws.auth#sigv4a":La}),Fp=e=>{const t=cl(e),r=Du(t);return Object.assign(r,{authSchemePreference:Me(e.authSchemePreference??[])})},Hp=e=>Object.assign(e,{useFipsEndpoint:e.useFipsEndpoint??!1,useDualstackEndpoint:e.useDualstackEndpoint??!1,forcePathStyle:e.forcePathStyle??!1,useAccelerateEndpoint:e.useAccelerateEndpoint??!1,useGlobalEndpoint:e.useGlobalEndpoint??!1,disableMultiregionAccessPoints:e.disableMultiregionAccessPoints??!1,defaultSigningName:"s3"}),Fa={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},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"}};class pe extends dt{constructor(t){super(t),Object.setPrototypeOf(this,pe.prototype)}}class Ln extends pe{constructor(t){super({name:"NoSuchUpload",$fault:"client",...t}),O(this,"name","NoSuchUpload"),O(this,"$fault","client"),Object.setPrototypeOf(this,Ln.prototype)}}class Fn extends pe{constructor(t){super({name:"ObjectNotInActiveTierError",$fault:"client",...t}),O(this,"name","ObjectNotInActiveTierError"),O(this,"$fault","client"),Object.setPrototypeOf(this,Fn.prototype)}}class Hn extends pe{constructor(t){super({name:"BucketAlreadyExists",$fault:"client",...t}),O(this,"name","BucketAlreadyExists"),O(this,"$fault","client"),Object.setPrototypeOf(this,Hn.prototype)}}class qn extends pe{constructor(t){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...t}),O(this,"name","BucketAlreadyOwnedByYou"),O(this,"$fault","client"),Object.setPrototypeOf(this,qn.prototype)}}class jn extends pe{constructor(t){super({name:"NoSuchBucket",$fault:"client",...t}),O(this,"name","NoSuchBucket"),O(this,"$fault","client"),Object.setPrototypeOf(this,jn.prototype)}}var Zi;(function(e){e.visit=(t,r)=>t.Prefix!==void 0?r.Prefix(t.Prefix):t.Tag!==void 0?r.Tag(t.Tag):t.And!==void 0?r.And(t.And):r._(t.$unknown[0],t.$unknown[1])})(Zi||(Zi={}));var Yi;(function(e){e.visit=(t,r)=>t.Prefix!==void 0?r.Prefix(t.Prefix):t.Tag!==void 0?r.Tag(t.Tag):t.AccessPointArn!==void 0?r.AccessPointArn(t.AccessPointArn):t.And!==void 0?r.And(t.And):r._(t.$unknown[0],t.$unknown[1])})(Yi||(Yi={}));class zn extends pe{constructor(t){super({name:"InvalidObjectState",$fault:"client",...t}),O(this,"name","InvalidObjectState"),O(this,"$fault","client"),O(this,"StorageClass"),O(this,"AccessTier"),Object.setPrototypeOf(this,zn.prototype),this.StorageClass=t.StorageClass,this.AccessTier=t.AccessTier}}class Vn extends pe{constructor(t){super({name:"NoSuchKey",$fault:"client",...t}),O(this,"name","NoSuchKey"),O(this,"$fault","client"),Object.setPrototypeOf(this,Vn.prototype)}}class Wn extends pe{constructor(t){super({name:"NotFound",$fault:"client",...t}),O(this,"name","NotFound"),O(this,"$fault","client"),Object.setPrototypeOf(this,Wn.prototype)}}const qp=e=>({...e,...e.SecretAccessKey&&{SecretAccessKey:Ue},...e.SessionToken&&{SessionToken:Ue}}),jp=e=>({...e,...e.SSEKMSKeyId&&{SSEKMSKeyId:Ue},...e.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Ue},...e.Credentials&&{Credentials:qp(e.Credentials)}}),zp=e=>({...e,...e.SSEKMSKeyId&&{SSEKMSKeyId:Ue},...e.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Ue}});class Kn extends pe{constructor(t){super({name:"EncryptionTypeMismatch",$fault:"client",...t}),O(this,"name","EncryptionTypeMismatch"),O(this,"$fault","client"),Object.setPrototypeOf(this,Kn.prototype)}}class Gn extends pe{constructor(t){super({name:"InvalidRequest",$fault:"client",...t}),O(this,"name","InvalidRequest"),O(this,"$fault","client"),Object.setPrototypeOf(this,Gn.prototype)}}class Zn extends pe{constructor(t){super({name:"InvalidWriteOffset",$fault:"client",...t}),O(this,"name","InvalidWriteOffset"),O(this,"$fault","client"),Object.setPrototypeOf(this,Zn.prototype)}}class Yn extends pe{constructor(t){super({name:"TooManyParts",$fault:"client",...t}),O(this,"name","TooManyParts"),O(this,"$fault","client"),Object.setPrototypeOf(this,Yn.prototype)}}class Xn extends pe{constructor(t){super({name:"IdempotencyParameterMismatch",$fault:"client",...t}),O(this,"name","IdempotencyParameterMismatch"),O(this,"$fault","client"),Object.setPrototypeOf(this,Xn.prototype)}}class Qn extends pe{constructor(t){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...t}),O(this,"name","ObjectAlreadyInActiveTierError"),O(this,"$fault","client"),Object.setPrototypeOf(this,Qn.prototype)}}var Xi;(function(e){e.visit=(t,r)=>t.Records!==void 0?r.Records(t.Records):t.Stats!==void 0?r.Stats(t.Stats):t.Progress!==void 0?r.Progress(t.Progress):t.Cont!==void 0?r.Cont(t.Cont):t.End!==void 0?r.End(t.End):r._(t.$unknown[0],t.$unknown[1])})(Xi||(Xi={}));const Vp=e=>({...e,...e.SSEKMSKeyId&&{SSEKMSKeyId:Ue},...e.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Ue}}),Wp=e=>({...e,...e.SSECustomerKey&&{SSECustomerKey:Ue},...e.SSEKMSKeyId&&{SSEKMSKeyId:Ue},...e.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Ue}}),Kp=async(e,t)=>{const r=To(e,t),n=ee({},ze,{[Jg]:e[Ug],[dr]:e[cr],[hr]:e[lr],[fr]:e[ur],[vt]:[()=>ze(e[bt]),()=>e[bt].toString()]});r.bp("/"),r.p("Bucket",()=>e.Bucket,"{Bucket}",!1);const s=ee({[Xg]:[,""]});return r.m("GET").h(n).q(s).b(void 0),r.build()},Gp=async(e,t)=>{const r=To(e,t),n=ee({},ze,{...e.Metadata!==void 0&&Object.keys(e.Metadata).reduce((a,c)=>(a[`x-amz-meta-${c.toLowerCase()}`]=e.Metadata[c],a),{}),[Wg]:e[Sg]||"application/octet-stream",[Qg]:e[fg],[Fg]:e[gg],[Hg]:e[mg],[qg]:e[yg],[jg]:e[wg],[zg]:[()=>ze(e[Qi]),()=>e[Qi].toString()],[Vg]:e[bg],[fm]:e[pg],[Za]:e[qa],[Ya]:e[ja],[Xa]:e[za],[Qa]:e[Va],[Ja]:e[Wa],[Kg]:[()=>ze(e[Ji]),()=>wu(e[Ji]).toString()],[Zg]:e[Pg],[Yg]:e[Tg],[nm]:e[xg],[sm]:e[kg],[im]:e[Rg],[om]:e[Cg],[ym]:[()=>ze(e[to]),()=>e[to].toString()],[dr]:e[cr],[hm]:e[Wt],[wm]:e[Lg],[ec]:e[Ka],[pm]:e[$g],[tc]:e[Ga],[hr]:e[lr],[fr]:e[ur],[vt]:[()=>ze(e[bt]),()=>e[bt].toString()],[dm]:e[Mg],[gm]:e[_g],[cm]:e[Ng],[um]:[()=>ze(e[eo]),()=>Rl(e[eo]).toString()],[am]:e[Ig],[rm]:e[Eg]});r.bp("/{Key+}"),r.p("Bucket",()=>e.Bucket,"{Bucket}",!1),r.p("Key",()=>e.Key,"{Key+}",!0);const s=ee({[bm]:[,"PutObject"]});let i,o;return e.Body!==void 0&&(o=e.Body,i=o),r.m("PUT").h(n).q(s).b(i),r.build()},Zp=async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return Ha(e,t);const r=ee({$metadata:ve(e),[cr]:[,e.headers[dr]],[lr]:[,e.headers[hr]],[ur]:[,e.headers[fr]],[bt]:[()=>e.headers[vt]!==void 0,()=>So(e.headers[vt])]}),n=xo(du(await jo(e.body,t)),"body");return n[Jr]!=null&&(r[Jr]=hg(n[Jr])),r},Yp=async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return Ha(e,t);const r=ee({$metadata:ve(e),[Vt]:[,e.headers[tm]],[Ag]:[,e.headers[Gg]],[qa]:[,e.headers[Za]],[ja]:[,e.headers[Ya]],[za]:[,e.headers[Xa]],[Va]:[,e.headers[Qa]],[Wa]:[,e.headers[Ja]],[vg]:[,e.headers[em]],[cr]:[,e.headers[dr]],[Bg]:[,e.headers[mm]],[Ka]:[,e.headers[ec]],[Ga]:[,e.headers[tc]],[lr]:[,e.headers[hr]],[ur]:[,e.headers[fr]],[bt]:[()=>e.headers[vt]!==void 0,()=>So(e.headers[vt])],[Dg]:[()=>e.headers[ro]!==void 0,()=>pu(e.headers[ro])],[Og]:[,e.headers[lm]]});return await vo(e.body,t),r},Ha=async(e,t)=>{const r={...e,body:await Sd(e.body,t)},n=Ed(e,r.body);switch(n){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await ag(r);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await lg(r);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await Qp(r);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await Jp(r);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await ig(r);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await rg(r);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await og(r);case"NotFound":case"com.amazonaws.s3#NotFound":throw await cg(r);case"EncryptionTypeMismatch":case"com.amazonaws.s3#EncryptionTypeMismatch":throw await eg(r);case"InvalidRequest":case"com.amazonaws.s3#InvalidRequest":throw await ng(r);case"InvalidWriteOffset":case"com.amazonaws.s3#InvalidWriteOffset":throw await sg(r);case"TooManyParts":case"com.amazonaws.s3#TooManyParts":throw await dg(r);case"IdempotencyParameterMismatch":case"com.amazonaws.s3#IdempotencyParameterMismatch":throw await tg(r);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await ug(r);default:const s=r.body;return Xp({output:e,parsedBody:s,errorCode:n})}},Xp=gl(pe),Qp=async(e,t)=>{const r=ee({});e.body;const n=new Hn({$metadata:ve(e),...r});return ke(n,e.body)},Jp=async(e,t)=>{const r=ee({});e.body;const n=new qn({$metadata:ve(e),...r});return ke(n,e.body)},eg=async(e,t)=>{const r=ee({});e.body;const n=new Kn({$metadata:ve(e),...r});return ke(n,e.body)},tg=async(e,t)=>{const r=ee({});e.body;const n=new Xn({$metadata:ve(e),...r});return ke(n,e.body)},rg=async(e,t)=>{const r=ee({}),n=e.body;n[Qr]!=null&&(r[Qr]=Tt(n[Qr])),n[Wt]!=null&&(r[Wt]=Tt(n[Wt]));const s=new zn({$metadata:ve(e),...r});return ke(s,e.body)},ng=async(e,t)=>{const r=ee({});e.body;const n=new Gn({$metadata:ve(e),...r});return ke(n,e.body)},sg=async(e,t)=>{const r=ee({});e.body;const n=new Zn({$metadata:ve(e),...r});return ke(n,e.body)},ig=async(e,t)=>{const r=ee({});e.body;const n=new jn({$metadata:ve(e),...r});return ke(n,e.body)},og=async(e,t)=>{const r=ee({});e.body;const n=new Vn({$metadata:ve(e),...r});return ke(n,e.body)},ag=async(e,t)=>{const r=ee({});e.body;const n=new Ln({$metadata:ve(e),...r});return ke(n,e.body)},cg=async(e,t)=>{const r=ee({});e.body;const n=new Wn({$metadata:ve(e),...r});return ke(n,e.body)},ug=async(e,t)=>{const r=ee({});e.body;const n=new Qn({$metadata:ve(e),...r});return ke(n,e.body)},lg=async(e,t)=>{const r=ee({});e.body;const n=new Fn({$metadata:ve(e),...r});return ke(n,e.body)},dg=async(e,t)=>{const r=ee({});e.body;const n=new Yn({$metadata:ve(e),...r});return ke(n,e.body)},hg=(e,t)=>{const r={};return e[Xr]!=null&&(r[Xr]=Tt(e[Xr])),e[en]!=null&&(r[en]=Tt(e[en])),e[tn]!=null&&(r[tn]=Tt(e[tn])),e[Vt]!=null&&(r[Vt]=xo(vu(e[Vt]))),r},ve=e=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),fg="ACL",Xr="AccessKeyId",Qr="AccessTier",bt="BucketKeyEnabled",Jr="Credentials",pg="ChecksumAlgorithm",gg="CacheControl",qa="ChecksumCRC32",ja="ChecksumCRC32C",za="ChecksumCRC64NVME",mg="ContentDisposition",yg="ContentEncoding",wg="ContentLanguage",Qi="ContentLength",bg="ContentMD5",Va="ChecksumSHA1",Wa="ChecksumSHA256",vg="ChecksumType",Sg="ContentType",Ji="Expires",Eg="ExpectedBucketOwner",Ag="ETag",Vt="Expiration",xg="GrantFullControl",kg="GrantRead",Rg="GrantReadACP",Cg="GrantWriteACP",Pg="IfMatch",Tg="IfNoneMatch",Ig="ObjectLockLegalHoldStatus",Ng="ObjectLockMode",eo="ObjectLockRetainUntilDate",Og="RequestCharged",Mg="RequestPayer",en="SecretAccessKey",Wt="StorageClass",Ug="SessionMode",cr="ServerSideEncryption",Ka="SSECustomerAlgorithm",$g="SSECustomerKey",Ga="SSECustomerKeyMD5",ur="SSEKMSEncryptionContext",lr="SSEKMSKeyId",tn="SessionToken",Dg="Size",_g="Tagging",Bg="VersionId",to="WriteOffsetBytes",Lg="WebsiteRedirectLocation",Fg="cache-control",Hg="content-disposition",qg="content-encoding",jg="content-language",zg="content-length",Vg="content-md5",Wg="content-type",Kg="expires",Gg="etag",Zg="if-match",Yg="if-none-match",Xg="session",Qg="x-amz-acl",Za="x-amz-checksum-crc32",Ya="x-amz-checksum-crc32c",Xa="x-amz-checksum-crc64nvme",Qa="x-amz-checksum-sha1",Ja="x-amz-checksum-sha256",Jg="x-amz-create-session-mode",em="x-amz-checksum-type",tm="x-amz-expiration",rm="x-amz-expected-bucket-owner",nm="x-amz-grant-full-control",sm="x-amz-grant-read",im="x-amz-grant-read-acp",om="x-amz-grant-write-acp",am="x-amz-object-lock-legal-hold",cm="x-amz-object-lock-mode",um="x-amz-object-lock-retain-until-date",ro="x-amz-object-size",lm="x-amz-request-charged",dm="x-amz-request-payer",hm="x-amz-storage-class",fm="x-amz-sdk-checksum-algorithm",dr="x-amz-server-side-encryption",hr="x-amz-server-side-encryption-aws-kms-key-id",vt="x-amz-server-side-encryption-bucket-key-enabled",fr="x-amz-server-side-encryption-context",ec="x-amz-server-side-encryption-customer-algorithm",pm="x-amz-server-side-encryption-customer-key",tc="x-amz-server-side-encryption-customer-key-md5",gm="x-amz-tagging",mm="x-amz-version-id",ym="x-amz-write-offset-bytes",wm="x-amz-website-redirect-location",bm="x-id";class vm extends Sn.classBuilder().ep({...Fa,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(t,r,n,s){return[go(n,this.serialize,this.deserialize),ma(n,t.getEndpointParameterInstructions()),ra(n)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(zp,jp).ser(Kp).de(Zp).build(){}const Sm="3.850.0",Em={version:Sm};function no(e){return typeof e=="string"?e.length===0:e.byteLength===0}var rc={name:"SHA-1"},so={name:"HMAC",hash:rc},Am=new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]);const xm={};function We(){return typeof window<"u"?window:typeof self<"u"?self:xm}var km=function(){function e(t){this.toHash=new Uint8Array(0),t!==void 0&&(this.key=new Promise(function(r,n){We().crypto.subtle.importKey("raw",io(t),so,!1,["sign"]).then(r,n)}),this.key.catch(function(){}))}return e.prototype.update=function(t){if(!no(t)){var r=io(t),n=new Uint8Array(this.toHash.byteLength+r.byteLength);n.set(this.toHash,0),n.set(r,this.toHash.byteLength),this.toHash=n}},e.prototype.digest=function(){var t=this;return this.key?this.key.then(function(r){return We().crypto.subtle.sign(so,r,t.toHash).then(function(n){return new Uint8Array(n)})}):no(this.toHash)?Promise.resolve(Am):Promise.resolve().then(function(){return We().crypto.subtle.digest(rc,t.toHash)}).then(function(r){return Promise.resolve(new Uint8Array(r))})},e.prototype.reset=function(){this.toHash=new Uint8Array(0)},e}();function io(e){return typeof e=="string"?Wo(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}var Rm=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function nc(e){if(Cm(e)&&typeof e.crypto.subtle=="object"){var t=e.crypto.subtle;return Pm(t)}return!1}function Cm(e){if(typeof e=="object"&&typeof e.crypto=="object"){var t=e.crypto.getRandomValues;return typeof t=="function"}return!1}function Pm(e){return e&&Rm.every(function(t){return typeof e[t]=="function"})}var Tm=function(){function e(t){if(nc(We()))this.hash=new km(t);else throw new Error("SHA1 not supported")}return e.prototype.update=function(t,r){this.hash.update(Ge(t))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e}(),sc={name:"SHA-256"},oo={name:"HMAC",hash:sc},Im=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]),Nm=function(){function e(t){this.toHash=new Uint8Array(0),this.secret=t,this.reset()}return e.prototype.update=function(t){if(!Ut(t)){var r=Ge(t),n=new Uint8Array(this.toHash.byteLength+r.byteLength);n.set(this.toHash,0),n.set(r,this.toHash.byteLength),this.toHash=n}},e.prototype.digest=function(){var t=this;return this.key?this.key.then(function(r){return We().crypto.subtle.sign(oo,r,t.toHash).then(function(n){return new Uint8Array(n)})}):Ut(this.toHash)?Promise.resolve(Im):Promise.resolve().then(function(){return We().crypto.subtle.digest(sc,t.toHash)}).then(function(r){return Promise.resolve(new Uint8Array(r))})},e.prototype.reset=function(){var t=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(r,n){We().crypto.subtle.importKey("raw",Ge(t.secret),oo,!1,["sign"]).then(r,n)}),this.key.catch(function(){}))},e}(),Oe=64,Om=32,Mm=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Um=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],$m=Math.pow(2,53)-1,Kt=function(){function e(){this.state=Int32Array.from(Um),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(t){if(this.finished)throw new Error("Attempted to update an already finished hash.");var r=0,n=t.byteLength;if(this.bytesHashed+=n,this.bytesHashed*8>$m)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=t[r++],n--,this.bufferLength===Oe&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var t=this.bytesHashed*8,r=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(r.setUint8(this.bufferLength++,128),n%Oe>=Oe-8){for(var s=this.bufferLength;s<Oe;s++)r.setUint8(s,0);this.hashBuffer(),this.bufferLength=0}for(var s=this.bufferLength;s<Oe-8;s++)r.setUint8(s,0);r.setUint32(Oe-8,Math.floor(t/4294967296),!0),r.setUint32(Oe-4,t),this.hashBuffer(),this.finished=!0}for(var i=new Uint8Array(Om),s=0;s<8;s++)i[s*4]=this.state[s]>>>24&255,i[s*4+1]=this.state[s]>>>16&255,i[s*4+2]=this.state[s]>>>8&255,i[s*4+3]=this.state[s]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var t=this,r=t.buffer,n=t.state,s=n[0],i=n[1],o=n[2],a=n[3],c=n[4],u=n[5],f=n[6],h=n[7],p=0;p<Oe;p++){if(p<16)this.temp[p]=(r[p*4]&255)<<24|(r[p*4+1]&255)<<16|(r[p*4+2]&255)<<8|r[p*4+3]&255;else{var y=this.temp[p-2],E=(y>>>17|y<<15)^(y>>>19|y<<13)^y>>>10;y=this.temp[p-15];var x=(y>>>7|y<<25)^(y>>>18|y<<14)^y>>>3;this.temp[p]=(E+this.temp[p-7]|0)+(x+this.temp[p-16]|0)}var A=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&u^~c&f)|0)+(h+(Mm[p]+this.temp[p]|0)|0)|0,L=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&i^s&o^i&o)|0;h=f,f=u,u=c,c=a+A|0,a=o,o=i,i=s,s=A+L|0}n[0]+=s,n[1]+=i,n[2]+=o,n[3]+=a,n[4]+=c,n[5]+=u,n[6]+=f,n[7]+=h},e}(),Dm=function(){function e(t){this.secret=t,this.hash=new Kt,this.reset()}return e.prototype.update=function(t){if(!(Ut(t)||this.error))try{this.hash.update(Ge(t))}catch(r){this.error=r}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return Rn(this,void 0,void 0,function(){return Cn(this,function(t){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new Kt,this.secret){this.outer=new Kt;var t=_m(this.secret),r=new Uint8Array(Oe);r.set(t);for(var n=0;n<Oe;n++)t[n]^=54,r[n]^=92;this.hash.update(t),this.outer.update(r);for(var n=0;n<t.byteLength;n++)t[n]=0}},e}();function _m(e){var t=Ge(e);if(t.byteLength>Oe){var r=new Kt;r.update(t),t=r.digest()}var n=new Uint8Array(Oe);return n.set(t),n}var Bm=function(){function e(t){nc(We())?this.hash=new Nm(t):this.hash=new Dm(t)}return e.prototype.update=function(t,r){this.hash.update(Ge(t))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e}();const Lm={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},ic={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},Z={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},Ae={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},qe={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class v{static getFirstMatch(t,r){const n=r.match(t);return n&&n.length>0&&n[1]||""}static getSecondMatch(t,r){const n=r.match(t);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(t,r,n){if(t.test(r))return n}static getWindowsVersionName(t){switch(t){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(t){const r=t.split(".").splice(0,2).map(n=>parseInt(n,10)||0);if(r.push(0),r[0]===10)switch(r[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(t){const r=t.split(".").splice(0,2).map(n=>parseInt(n,10)||0);if(r.push(0),!(r[0]===1&&r[1]<5)){if(r[0]===1&&r[1]<6)return"Cupcake";if(r[0]===1&&r[1]>=6)return"Donut";if(r[0]===2&&r[1]<2)return"Eclair";if(r[0]===2&&r[1]===2)return"Froyo";if(r[0]===2&&r[1]>2)return"Gingerbread";if(r[0]===3)return"Honeycomb";if(r[0]===4&&r[1]<1)return"Ice Cream Sandwich";if(r[0]===4&&r[1]<4)return"Jelly Bean";if(r[0]===4&&r[1]>=4)return"KitKat";if(r[0]===5)return"Lollipop";if(r[0]===6)return"Marshmallow";if(r[0]===7)return"Nougat";if(r[0]===8)return"Oreo";if(r[0]===9)return"Pie"}}static getVersionPrecision(t){return t.split(".").length}static compareVersions(t,r,n=!1){const s=v.getVersionPrecision(t),i=v.getVersionPrecision(r);let o=Math.max(s,i),a=0;const c=v.map([t,r],u=>{const f=o-v.getVersionPrecision(u),h=u+new Array(f+1).join(".0");return v.map(h.split("."),p=>new Array(20-p.length).join("0")+p).reverse()});for(n&&(a=o-Math.min(s,i)),o-=1;o>=a;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===a)return 0;o-=1}else if(c[0][o]<c[1][o])return-1}}static map(t,r){const n=[];let s;if(Array.prototype.map)return Array.prototype.map.call(t,r);for(s=0;s<t.length;s+=1)n.push(r(t[s]));return n}static find(t,r){let n,s;if(Array.prototype.find)return Array.prototype.find.call(t,r);for(n=0,s=t.length;n<s;n+=1){const i=t[n];if(r(i,n))return i}}static assign(t,...r){const n=t;let s,i;if(Object.assign)return Object.assign(t,...r);for(s=0,i=r.length;s<i;s+=1){const o=r[s];typeof o=="object"&&o!==null&&Object.keys(o).forEach(a=>{n[a]=o[a]})}return t}static getBrowserAlias(t){return Lm[t]}static getBrowserTypeByAlias(t){return ic[t]||""}}const H=/version\/(\d+(\.?_?\d+)+)/i,Fm=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},r=v.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||v.getFirstMatch(H,e);return r&&(t.version=r),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},r=v.getFirstMatch(H,e)||v.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},r=v.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||v.getFirstMatch(H,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},r=v.getFirstMatch(H,e)||v.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},r=v.getFirstMatch(H,e)||v.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},r=v.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||v.getFirstMatch(H,e);return r&&(t.version=r),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},r=v.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||v.getFirstMatch(H,e);return r&&(t.version=r),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},r=v.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||v.getFirstMatch(H,e);return r&&(t.version=r),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},r=v.getFirstMatch(H,e)||v.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},r=v.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||v.getFirstMatch(H,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},r=v.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||v.getFirstMatch(H,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},r=v.getFirstMatch(H,e)||v.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},r=v.getFirstMatch(H,e)||v.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},r=v.getFirstMatch(H,e)||v.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},r=v.getFirstMatch(H,e)||v.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},r=v.getFirstMatch(H,e)||v.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},r=v.getFirstMatch(H,e)||v.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},r=v.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||v.getFirstMatch(H,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=v.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||v.getFirstMatch(H,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},r=v.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},r=v.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},r=v.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},r=v.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},r=v.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},r=v.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},r=v.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},r=v.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},r=v.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},r=v.getFirstMatch(H,e)||v.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},r=v.getFirstMatch(H,e)||v.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},r=v.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},r=v.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||v.getFirstMatch(H,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},r=v.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||v.getFirstMatch(H,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},r=v.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},r=v.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},r=v.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},r=v.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||v.getFirstMatch(H,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},r=v.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},r=v.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){const t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe(e){const t={name:"Android Browser"},r=v.getFirstMatch(H,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},r=v.getFirstMatch(H,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},r=v.getFirstMatch(H,e);return r&&(t.version=r),t}},{test:[/.*/i],describe(e){const t=/^(.*)\/(.*) /,r=/^(.*)\/(.*)[ \t]\((.*)/,n=e.search("\\(")!==-1?r:t;return{name:v.getFirstMatch(n,e),version:v.getSecondMatch(n,e)}}}],Hm=[{test:[/Roku\/DVP/],describe(e){const t=v.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:Ae.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=v.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:Ae.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=v.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=v.getWindowsVersionName(t);return{name:Ae.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:Ae.iOS},r=v.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe(e){const t=v.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=v.getMacOSVersionName(t),n={name:Ae.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=v.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:Ae.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe(e){const t=v.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=v.getAndroidVersionName(t),n={name:Ae.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=v.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:Ae.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=v.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||v.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||v.getFirstMatch(/\bbb(\d+)/i,e);return{name:Ae.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=v.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:Ae.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=v.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:Ae.Tizen,version:t}}},{test:[/linux/i],describe(){return{name:Ae.Linux}}},{test:[/CrOS/],describe(){return{name:Ae.ChromeOS}}},{test:[/PlayStation 4/],describe(e){const t=v.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:Ae.PlayStation4,version:t}}}],qm=[{test:[/googlebot/i],describe(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe(e){const t=v.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:Z.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:Z.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:Z.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:Z.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:Z.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:Z.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:Z.tablet}}},{test(e){const t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe(e){const t=v.getFirstMatch(/(ipod|iphone)/i,e);return{type:Z.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:Z.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe(){return{type:Z.mobile}}},{test(e){return e.getBrowserName(!0)==="blackberry"},describe(){return{type:Z.mobile,vendor:"BlackBerry"}}},{test(e){return e.getBrowserName(!0)==="bada"},describe(){return{type:Z.mobile}}},{test(e){return e.getBrowserName()==="windows phone"},describe(){return{type:Z.mobile,vendor:"Microsoft"}}},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return e.getOSName(!0)==="android"&&t>=3},describe(){return{type:Z.tablet}}},{test(e){return e.getOSName(!0)==="android"},describe(){return{type:Z.mobile}}},{test(e){return e.getOSName(!0)==="macos"},describe(){return{type:Z.desktop,vendor:"Apple"}}},{test(e){return e.getOSName(!0)==="windows"},describe(){return{type:Z.desktop}}},{test(e){return e.getOSName(!0)==="linux"},describe(){return{type:Z.desktop}}},{test(e){return e.getOSName(!0)==="playstation 4"},describe(){return{type:Z.tv}}},{test(e){return e.getOSName(!0)==="roku"},describe(){return{type:Z.tv}}}],jm=[{test(e){return e.getBrowserName(!0)==="microsoft edge"},describe(e){if(/\sedg\//i.test(e))return{name:qe.Blink};const t=v.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:qe.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:qe.Trident},r=v.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){return e.test(/presto/i)},describe(e){const t={name:qe.Presto},r=v.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test(e){const t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe(e){const t={name:qe.Gecko},r=v.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:qe.Blink}}},{test:[/(apple)?webkit/i],describe(e){const t={name:qe.WebKit},r=v.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];class ao{constructor(t,r=!1){if(t==null||t==="")throw new Error("UserAgent parameter can't be empty");this._ua=t,this.parsedResult={},r!==!0&&this.parse()}getUA(){return this._ua}test(t){return t.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const t=v.find(Fm,r=>{if(typeof r.test=="function")return r.test(this);if(r.test instanceof Array)return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(t){return t?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const t=v.find(Hm,r=>{if(typeof r.test=="function")return r.test(this);if(r.test instanceof Array)return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os}getOSName(t){const{name:r}=this.getOS();return t?String(r).toLowerCase()||"":r||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(t=!1){const{type:r}=this.getPlatform();return t?String(r).toLowerCase()||"":r||""}parsePlatform(){this.parsedResult.platform={};const t=v.find(qm,r=>{if(typeof r.test=="function")return r.test(this);if(r.test instanceof Array)return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(t){return t?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const t=v.find(jm,r=>{if(typeof r.test=="function")return r.test(this);if(r.test instanceof Array)return r.test.some(n=>this.test(n));throw new Error("Browser's test function is not valid")});return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return v.assign({},this.parsedResult)}satisfies(t){const r={};let n=0;const s={};let i=0;if(Object.keys(t).forEach(o=>{const a=t[o];typeof a=="string"?(s[o]=a,i+=1):typeof a=="object"&&(r[o]=a,n+=1)}),n>0){const o=Object.keys(r),a=v.find(o,u=>this.isOS(u));if(a){const u=this.satisfies(r[a]);if(u!==void 0)return u}const c=v.find(o,u=>this.isPlatform(u));if(c){const u=this.satisfies(r[c]);if(u!==void 0)return u}}if(i>0){const o=Object.keys(s),a=v.find(o,c=>this.isBrowser(c,!0));if(a!==void 0)return this.compareVersion(s[a])}}isBrowser(t,r=!1){const n=this.getBrowserName().toLowerCase();let s=t.toLowerCase();const i=v.getBrowserTypeByAlias(s);return r&&i&&(s=i.toLowerCase()),s===n}compareVersion(t){let r=[0],n=t,s=!1;const i=this.getBrowserVersion();if(typeof i=="string")return t[0]===">"||t[0]==="<"?(n=t.substr(1),t[1]==="="?(s=!0,n=t.substr(2)):r=[],t[0]===">"?r.push(1):r.push(-1)):t[0]==="="?n=t.substr(1):t[0]==="~"&&(s=!0,n=t.substr(1)),r.indexOf(v.compareVersions(i,n,s))>-1}isOS(t){return this.getOSName(!0)===String(t).toLowerCase()}isPlatform(t){return this.getPlatformType(!0)===String(t).toLowerCase()}isEngine(t){return this.getEngineName(!0)===String(t).toLowerCase()}is(t,r=!1){return this.isBrowser(t,r)||this.isOS(t)||this.isPlatform(t)}some(t=[]){return t.some(r=>this.is(r))}}/*!
* Bowser - a browser detector
* https://github.com/lancedikson/bowser
* MIT License | (c) Dustin Diaz 2012-2015
* MIT License | (c) Denis Demchenko 2015-2019
*/class oc{static getParser(t,r=!1){if(typeof t!="string")throw new Error("UserAgent should be a string");return new ao(t,r)}static parse(t){return new ao(t).getResult()}static get BROWSER_MAP(){return ic}static get ENGINE_MAP(){return qe}static get OS_MAP(){return Ae}static get PLATFORMS_MAP(){return Z}}const zm=({serviceId:e,clientVersion:t})=>async r=>{var n,s,i,o,a,c;const u=typeof window<"u"&&(n=window==null?void 0:window.navigator)!=null&&n.userAgent?oc.parse(window.navigator.userAgent):void 0,f=[["aws-sdk-js",t],["ua","2.1"],[`os/${((s=u==null?void 0:u.os)==null?void 0:s.name)||"other"}`,(i=u==null?void 0:u.os)==null?void 0:i.version],["lang/js"],["md/browser",`${((o=u==null?void 0:u.browser)==null?void 0:o.name)??"unknown"}_${((a=u==null?void 0:u.browser)==null?void 0:a.version)??"unknown"}`]];e&&f.push([`api/${e}`,t]);const h=await((c=r==null?void 0:r.userAgentAppId)==null?void 0:c.call(r));return h&&f.push([`app/${h}`]),f};class Ot{constructor(t){if(this.bytes=t,t.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let n=7,s=Math.abs(Math.round(t));n>-1&&s>0;n--,s/=256)r[n]=s;return t<0&&co(r),new Ot(r)}valueOf(){const t=this.bytes.slice(0),r=t[0]&128;return r&&co(t),parseInt(Re(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function co(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}class Vm{constructor(t,r){this.toUtf8=t,this.fromUtf8=r}format(t){const r=[];for(const i of Object.keys(t)){const o=this.fromUtf8(i);r.push(Uint8Array.from([o.byteLength]),o,this.formatHeaderValue(t[i]))}const n=new Uint8Array(r.reduce((i,o)=>i+o.byteLength,0));let s=0;for(const i of r)n.set(i,s),s+=i.byteLength;return n}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,t.value,!1),new Uint8Array(r.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,t.value,!1),new Uint8Array(n.buffer);case"long":const s=new Uint8Array(9);return s[0]=5,s.set(t.value.bytes,1),s;case"binary":const i=new DataView(new ArrayBuffer(3+t.value.byteLength));i.setUint8(0,6),i.setUint16(1,t.value.byteLength,!1);const o=new Uint8Array(i.buffer);return o.set(t.value,3),o;case"string":const a=this.fromUtf8(t.value),c=new DataView(new ArrayBuffer(3+a.byteLength));c.setUint8(0,7),c.setUint16(1,a.byteLength,!1);const u=new Uint8Array(c.buffer);return u.set(a,3),u;case"timestamp":const f=new Uint8Array(9);return f[0]=8,f.set(Ot.fromNumber(t.value.valueOf()).bytes,1),f;case"uuid":if(!ey.test(t.value))throw new Error(`Invalid UUID received: ${t.value}`);const h=new Uint8Array(17);return h[0]=9,h.set(bo(t.value.replace(/\-/g,"")),1),h}}parse(t){const r={};let n=0;for(;n<t.byteLength;){const s=t.getUint8(n++),i=this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+n,s));switch(n+=s,t.getUint8(n++)){case 0:r[i]={type:lo,value:!0};break;case 1:r[i]={type:lo,value:!1};break;case 2:r[i]={type:Wm,value:t.getInt8(n++)};break;case 3:r[i]={type:Km,value:t.getInt16(n,!1)},n+=2;break;case 4:r[i]={type:Gm,value:t.getInt32(n,!1)},n+=4;break;case 5:r[i]={type:Zm,value:new Ot(new Uint8Array(t.buffer,t.byteOffset+n,8))},n+=8;break;case 6:const o=t.getUint16(n,!1);n+=2,r[i]={type:Ym,value:new Uint8Array(t.buffer,t.byteOffset+n,o)},n+=o;break;case 7:const a=t.getUint16(n,!1);n+=2,r[i]={type:Xm,value:this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+n,a))},n+=a;break;case 8:r[i]={type:Qm,value:new Date(new Ot(new Uint8Array(t.buffer,t.byteOffset+n,8)).valueOf())},n+=8;break;case 9:const c=new Uint8Array(t.buffer,t.byteOffset+n,16);n+=16,r[i]={type:Jm,value:`${Re(c.subarray(0,4))}-${Re(c.subarray(4,6))}-${Re(c.subarray(6,8))}-${Re(c.subarray(8,10))}-${Re(c.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return r}}var uo;(function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"})(uo||(uo={}));const lo="boolean",Wm="byte",Km="short",Gm="integer",Zm="long",Ym="binary",Xm="string",Qm="timestamp",Jm="uuid",ey=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,ac=4,je=ac*2,Xe=4,ty=je+Xe*2;function ry({byteLength:e,byteOffset:t,buffer:r}){if(e<ty)throw new Error("Provided message too short to accommodate event stream message overhead");const n=new DataView(r,t,e),s=n.getUint32(0,!1);if(e!==s)throw new Error("Reported message length does not match received message length");const i=n.getUint32(ac,!1),o=n.getUint32(je,!1),a=n.getUint32(e-Xe,!1),c=new Xt().update(new Uint8Array(r,t,je));if(o!==c.digest())throw new Error(`The prelude checksum specified in the message (${o}) does not match the calculated CRC32 checksum (${c.digest()})`);if(c.update(new Uint8Array(r,t+je,e-(je+Xe))),a!==c.digest())throw new Error(`The message checksum (${c.digest()}) did not match the expected value of ${a}`);return{headers:new DataView(r,t+je+Xe,i),body:new Uint8Array(r,t+je+Xe+i,s-i-(je+Xe+Xe))}}class ny{constructor(t,r){this.headerMarshaller=new Vm(t,r),this.messageBuffer=[],this.isEndOfStream=!1}feed(t){this.messageBuffer.push(this.decode(t))}endOfStream(){this.isEndOfStream=!0}getMessage(){const t=this.messageBuffer.pop(),r=this.isEndOfStream;return{getMessage(){return t},isEndOfStream(){return r}}}getAvailableMessages(){const t=this.messageBuffer;this.messageBuffer=[];const r=this.isEndOfStream;return{getMessages(){return t},isEndOfStream(){return r}}}encode({headers:t,body:r}){const n=this.headerMarshaller.format(t),s=n.byteLength+r.byteLength+16,i=new Uint8Array(s),o=new DataView(i.buffer,i.byteOffset,i.byteLength),a=new Xt;return o.setUint32(0,s,!1),o.setUint32(4,n.byteLength,!1),o.setUint32(8,a.update(i.subarray(0,8)).digest(),!1),i.set(n,12),i.set(r,n.byteLength+12),o.setUint32(s-4,a.update(i.subarray(8,s-4)).digest(),!1),i}decode(t){const{headers:r,body:n}=ry(t);return{headers:this.headerMarshaller.parse(r),body:n}}formatHeaders(t){return this.headerMarshaller.format(t)}}class sy{constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const t of this.options.inputStream)yield this.options.decoder.decode(t)}}class iy{constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const t of this.options.messageStream)yield this.options.encoder.encode(t);this.options.includeEndFrame&&(yield new Uint8Array(0))}}class oy{constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const t of this.options.messageStream){const r=await this.options.deserializer(t);r!==void 0&&(yield r)}}}class ay{constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(const t of this.options.inputStream)yield this.options.serializer(t)}}function cy(e){let t=0,r=0,n=null,s=null;const i=a=>{if(typeof a!="number")throw new Error("Attempted to allocate an event message where size was not a number: "+a);t=a,r=4,n=new Uint8Array(a),new DataView(n.buffer).setUint32(0,a,!1)},o=async function*(){const a=e[Symbol.asyncIterator]();for(;;){const{value:c,done:u}=await a.next();if(u){if(t)if(t===r)yield n;else throw new Error("Truncated event message received.");else return;return}const f=c.length;let h=0;for(;h<f;){if(!n){const y=f-h;s||(s=new Uint8Array(4));const E=Math.min(4-r,y);if(s.set(c.slice(h,h+E),r),r+=E,h+=E,r<4)break;i(new DataView(s.buffer).getUint32(0,!1)),s=null}const p=Math.min(t-r,f-h);n.set(c.slice(h,h+p),r),r+=p,h+=p,t&&t===r&&(yield n,n=null,t=0,r=0)}}};return{[Symbol.asyncIterator]:o}}function uy(e,t){return async function(r){const{value:n}=r.headers[":message-type"];if(n==="error"){const s=new Error(r.headers[":error-message"].value||"UnknownError");throw s.name=r.headers[":error-code"].value,s}else if(n==="exception"){const s=r.headers[":exception-type"].value,i={[s]:r},o=await e(i);if(o.$unknown){const a=new Error(t(r.body));throw a.name=s,a}throw o[s]}else if(n==="event"){const s={[r.headers[":event-type"].value]:r},i=await e(s);return i.$unknown?void 0:i}else throw Error(`Unrecognizable event type: ${r.headers[":event-type"].value}`)}}let ly=class{constructor({utf8Encoder:e,utf8Decoder:t}){this.eventStreamCodec=new ny(e,t),this.utfEncoder=e}deserialize(e,t){const r=cy(e);return new oy({messageStream:new sy({inputStream:r,decoder:this.eventStreamCodec}),deserializer:uy(t,this.utfEncoder)})}serialize(e,t){return new iy({messageStream:new ay({inputStream:e,serializer:t}),encoder:this.eventStreamCodec,includeEndFrame:!0})}};const dy=e=>({[Symbol.asyncIterator]:async function*(){const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)return;yield n}}finally{t.releaseLock()}}}),hy=e=>{const t=e[Symbol.asyncIterator]();return new ReadableStream({async pull(r){const{done:n,value:s}=await t.next();if(n)return r.close();r.enqueue(s)}})};class fy{constructor({utf8Encoder:t,utf8Decoder:r}){this.universalMarshaller=new ly({utf8Decoder:r,utf8Encoder:t})}deserialize(t,r){const n=py(t)?dy(t):t;return this.universalMarshaller.deserialize(n,r)}serialize(t,r){const n=this.universalMarshaller.serialize(t,r);return typeof ReadableStream=="function"?hy(n):n}}const py=e=>typeof ReadableStream=="function"&&e instanceof ReadableStream,gy=e=>new fy(e);async function my(e,t,r=1024*1024){const n=e.size;let s=0;for(;s<n;){const i=e.slice(s,Math.min(n,s+r));t(new Uint8Array(await i.arrayBuffer())),s+=i.size}}const yy=async function(e,t){const r=new e;return await my(t,n=>{r.update(n)}),r.digest()},wy=e=>()=>Promise.reject(e),He=64,by=16,vy=[1732584193,4023233417,2562383102,271733878];class Sy{constructor(){this.reset()}update(t){if(Ey(t))return;if(this.finished)throw new Error("Attempted to update an already finished hash.");const r=Ay(t);let n=0,{byteLength:s}=r;for(this.bytesHashed+=s;s>0;)this.buffer.setUint8(this.bufferLength++,r[n++]),s--,this.bufferLength===He&&(this.hashBuffer(),this.bufferLength=0)}async digest(){if(!this.finished){const{buffer:r,bufferLength:n,bytesHashed:s}=this,i=s*8;if(r.setUint8(this.bufferLength++,128),n%He>=He-8){for(let o=this.bufferLength;o<He;o++)r.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(let o=this.bufferLength;o<He-8;o++)r.setUint8(o,0);r.setUint32(He-8,i>>>0,!0),r.setUint32(He-4,Math.floor(i/4294967296),!0),this.hashBuffer(),this.finished=!0}const t=new DataView(new ArrayBuffer(by));for(let r=0;r<4;r++)t.setUint32(r*4,this.state[r],!0);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}hashBuffer(){const{buffer:t,state:r}=this;let n=r[0],s=r[1],i=r[2],o=r[3];n=ge(n,s,i,o,t.getUint32(0,!0),7,3614090360),o=ge(o,n,s,i,t.getUint32(4,!0),12,3905402710),i=ge(i,o,n,s,t.getUint32(8,!0),17,606105819),s=ge(s,i,o,n,t.getUint32(12,!0),22,3250441966),n=ge(n,s,i,o,t.getUint32(16,!0),7,4118548399),o=ge(o,n,s,i,t.getUint32(20,!0),12,1200080426),i=ge(i,o,n,s,t.getUint32(24,!0),17,2821735955),s=ge(s,i,o,n,t.getUint32(28,!0),22,4249261313),n=ge(n,s,i,o,t.getUint32(32,!0),7,1770035416),o=ge(o,n,s,i,t.getUint32(36,!0),12,2336552879),i=ge(i,o,n,s,t.getUint32(40,!0),17,4294925233),s=ge(s,i,o,n,t.getUint32(44,!0),22,2304563134),n=ge(n,s,i,o,t.getUint32(48,!0),7,1804603682),o=ge(o,n,s,i,t.getUint32(52,!0),12,4254626195),i=ge(i,o,n,s,t.getUint32(56,!0),17,2792965006),s=ge(s,i,o,n,t.getUint32(60,!0),22,1236535329),n=me(n,s,i,o,t.getUint32(4,!0),5,4129170786),o=me(o,n,s,i,t.getUint32(24,!0),9,3225465664),i=me(i,o,n,s,t.getUint32(44,!0),14,643717713),s=me(s,i,o,n,t.getUint32(0,!0),20,3921069994),n=me(n,s,i,o,t.getUint32(20,!0),5,3593408605),o=me(o,n,s,i,t.getUint32(40,!0),9,38016083),i=me(i,o,n,s,t.getUint32(60,!0),14,3634488961),s=me(s,i,o,n,t.getUint32(16,!0),20,3889429448),n=me(n,s,i,o,t.getUint32(36,!0),5,568446438),o=me(o,n,s,i,t.getUint32(56,!0),9,3275163606),i=me(i,o,n,s,t.getUint32(12,!0),14,4107603335),s=me(s,i,o,n,t.getUint32(32,!0),20,1163531501),n=me(n,s,i,o,t.getUint32(52,!0),5,2850285829),o=me(o,n,s,i,t.getUint32(8,!0),9,4243563512),i=me(i,o,n,s,t.getUint32(28,!0),14,1735328473),s=me(s,i,o,n,t.getUint32(48,!0),20,2368359562),n=ye(n,s,i,o,t.getUint32(20,!0),4,4294588738),o=ye(o,n,s,i,t.getUint32(32,!0),11,2272392833),i=ye(i,o,n,s,t.getUint32(44,!0),16,1839030562),s=ye(s,i,o,n,t.getUint32(56,!0),23,4259657740),n=ye(n,s,i,o,t.getUint32(4,!0),4,2763975236),o=ye(o,n,s,i,t.getUint32(16,!0),11,1272893353),i=ye(i,o,n,s,t.getUint32(28,!0),16,4139469664),s=ye(s,i,o,n,t.getUint32(40,!0),23,3200236656),n=ye(n,s,i,o,t.getUint32(52,!0),4,681279174),o=ye(o,n,s,i,t.getUint32(0,!0),11,3936430074),i=ye(i,o,n,s,t.getUint32(12,!0),16,3572445317),s=ye(s,i,o,n,t.getUint32(24,!0),23,76029189),n=ye(n,s,i,o,t.getUint32(36,!0),4,3654602809),o=ye(o,n,s,i,t.getUint32(48,!0),11,3873151461),i=ye(i,o,n,s,t.getUint32(60,!0),16,530742520),s=ye(s,i,o,n,t.getUint32(8,!0),23,3299628645),n=we(n,s,i,o,t.getUint32(0,!0),6,4096336452),o=we(o,n,s,i,t.getUint32(28,!0),10,1126891415),i=we(i,o,n,s,t.getUint32(56,!0),15,2878612391),s=we(s,i,o,n,t.getUint32(20,!0),21,4237533241),n=we(n,s,i,o,t.getUint32(48,!0),6,1700485571),o=we(o,n,s,i,t.getUint32(12,!0),10,2399980690),i=we(i,o,n,s,t.getUint32(40,!0),15,4293915773),s=we(s,i,o,n,t.getUint32(4,!0),21,2240044497),n=we(n,s,i,o,t.getUint32(32,!0),6,1873313359),o=we(o,n,s,i,t.getUint32(60,!0),10,4264355552),i=we(i,o,n,s,t.getUint32(24,!0),15,2734768916),s=we(s,i,o,n,t.getUint32(52,!0),21,1309151649),n=we(n,s,i,o,t.getUint32(16,!0),6,4149444226),o=we(o,n,s,i,t.getUint32(44,!0),10,3174756917),i=we(i,o,n,s,t.getUint32(8,!0),15,718787259),s=we(s,i,o,n,t.getUint32(36,!0),21,3951481745),r[0]=n+r[0]&4294967295,r[1]=s+r[1]&4294967295,r[2]=i+r[2]&4294967295,r[3]=o+r[3]&4294967295}reset(){this.state=Uint32Array.from(vy),this.buffer=new DataView(new ArrayBuffer(He)),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}}function pr(e,t,r,n,s,i){return t=(t+e&4294967295)+(n+i&4294967295)&4294967295,(t<<s|t>>>32-s)+r&4294967295}function ge(e,t,r,n,s,i,o){return pr(t&r|~t&n,e,t,s,i,o)}function me(e,t,r,n,s,i,o){return pr(t&n|r&~n,e,t,s,i,o)}function ye(e,t,r,n,s,i,o){return pr(t^r^n,e,t,s,i,o)}function we(e,t,r,n,s,i,o){return pr(r^(t|~n),e,t,s,i,o)}function Ey(e){return typeof e=="string"?e.length===0:e.byteLength===0}function Ay(e){return typeof e=="string"?it(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}const xy=e=>({apiVersion:"2006-03-01",base64Decoder:(e==null?void 0:e.base64Decoder)??wn,base64Encoder:(e==null?void 0:e.base64Encoder)??sr,disableHostPrefix:(e==null?void 0:e.disableHostPrefix)??!1,endpointProvider:(e==null?void 0:e.endpointProvider)??_a,extensions:(e==null?void 0:e.extensions)??[],getAwsChunkedEncodingStream:(e==null?void 0:e.getAwsChunkedEncodingStream)??Zc,httpAuthSchemeProvider:(e==null?void 0:e.httpAuthSchemeProvider)??Lp,httpAuthSchemes:(e==null?void 0:e.httpAuthSchemes)??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new fo},{schemeId:"aws.auth#sigv4a",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4a"),signer:new kc}],logger:(e==null?void 0:e.logger)??new En,sdkStreamMixin:(e==null?void 0:e.sdkStreamMixin)??nu,serviceId:(e==null?void 0:e.serviceId)??"S3",signerConstructor:(e==null?void 0:e.signerConstructor)??va,signingEscapePath:(e==null?void 0:e.signingEscapePath)??!1,urlParser:(e==null?void 0:e.urlParser)??Jt,useArnRegion:(e==null?void 0:e.useArnRegion)??void 0,utf8Decoder:(e==null?void 0:e.utf8Decoder)??it,utf8Encoder:(e==null?void 0:e.utf8Encoder)??bn}),ky=["in-region","cross-region","mobile","standard","legacy"],Ry=({defaultsMode:e}={})=>$u(async()=>{const t=typeof e=="function"?await e():e;switch(t==null?void 0:t.toLowerCase()){case"auto":return Promise.resolve(Cy()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(t==null?void 0:t.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${ky.join(", ")}, got ${t}`)}}),Cy=()=>{var e,t;const r=typeof window<"u"&&(e=window==null?void 0:window.navigator)!=null&&e.userAgent?oc.parse(window.navigator.userAgent):void 0,n=(t=r==null?void 0:r.platform)==null?void 0:t.type;return n==="tablet"||n==="mobile"},Py=e=>{const t=Ry(e),r=()=>t().then(yl),n=xy(e);return{...n,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:(e==null?void 0:e.bodyLengthChecker)??dl,credentialDefaultProvider:(e==null?void 0:e.credentialDefaultProvider)??(s=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:(e==null?void 0:e.defaultUserAgentProvider)??zm({serviceId:n.serviceId,clientVersion:Em.version}),eventStreamSerdeProvider:(e==null?void 0:e.eventStreamSerdeProvider)??gy,maxAttempts:(e==null?void 0:e.maxAttempts)??In,md5:(e==null?void 0:e.md5)??Sy,region:(e==null?void 0:e.region)??wy("Region is missing"),requestHandler:vn.create((e==null?void 0:e.requestHandler)??r),retryMode:(e==null?void 0:e.retryMode)??(async()=>(await r()).retryMode||jf),sha1:(e==null?void 0:e.sha1)??Tm,sha256:(e==null?void 0:e.sha256)??Bm,streamCollector:(e==null?void 0:e.streamCollector)??yo,streamHasher:(e==null?void 0:e.streamHasher)??yy,useDualstackEndpoint:(e==null?void 0:e.useDualstackEndpoint)??(()=>Promise.resolve(kf)),useFipsEndpoint:(e==null?void 0:e.useFipsEndpoint)??(()=>Promise.resolve(Rf))}},Ty=e=>({setRegion(t){e.region=t},region(){return e.region}}),Iy=e=>({region:e.region()}),Ny=e=>{const t=e.httpAuthSchemes;let r=e.httpAuthSchemeProvider,n=e.credentials;return{setHttpAuthScheme(s){const i=t.findIndex(o=>o.schemeId===s.schemeId);i===-1?t.push(s):t.splice(i,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){r=s},httpAuthSchemeProvider(){return r},setCredentials(s){n=s},credentials(){return n}}},Oy=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),My=(e,t)=>{const r=Object.assign(Ty(e),El(e),gc(e),Ny(e));return t.forEach(n=>n.configure(r)),Object.assign(e,Iy(r),Al(r),mc(r),Oy(r))};class Uy extends hl{constructor(...[t]){const r=Py(t||{});super(r),O(this,"config"),this.initConfig=r;const n=Hp(r),s=Hh(n),i=Vd(s),o=hp(i),a=Cf(o),c=a,u=qf(c),f=Pf(u),h=Fp(f),p=Ch(h,{session:[()=>this,vm]}),y=My(p,(t==null?void 0:t.extensions)||[]);this.config=y,this.middlewareStack.use(xf(this.config)),this.middlewareStack.use(bp(this.config)),this.middlewareStack.use(Nf(this.config)),this.middlewareStack.use(Gd(this.config)),this.middlewareStack.use(Xd(this.config)),this.middlewareStack.use(rh(this.config)),this.middlewareStack.use(Ic(this.config,{httpAuthSchemeParametersProvider:Dp,identityProviderConfigProvider:async E=>new Iu({"aws.auth#sigv4":E.credentials,"aws.auth#sigv4a":E.credentials})})),this.middlewareStack.use(_c(this.config)),this.middlewareStack.use(Bh(this.config)),this.middlewareStack.use(vc(this.config)),this.middlewareStack.use(hh(this.config)),this.middlewareStack.use(Sh(this.config)),this.middlewareStack.use(Rh(this.config))}destroy(){super.destroy()}}function $y(e){return t=>async r=>{const n={...r.input},s=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(const i of s){const o=n[i.target];if(o){let a;typeof o=="string"?By(o,e)?a=e.base64Decoder(o):(a=e.utf8Decoder(o),n[i.target]=e.base64Encoder(a)):(a=ArrayBuffer.isView(o)?new Uint8Array(o.buffer,o.byteOffset,o.byteLength):new Uint8Array(o),n[i.target]=e.base64Encoder(a));const c=new e.md5;c.update(a),n[i.hash]=e.base64Encoder(await c.digest())}}return t({...r,input:n})}}const Dy={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},_y=e=>({applyToStack:t=>{t.add($y(e),Dy)}});function By(e,t){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e))return!1;try{return t.base64Decoder(e).length===32}catch{return!1}}class Ly extends Sn.classBuilder().ep({...Fa,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(t,r,n,s){return[go(n,this.serialize,this.deserialize),ma(n,t.getEndpointParameterInstructions()),zd(n,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),ah(),ra(n),_y(n)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(Wp,Vp).ser(Gp).de(Yp).build(){}const Fy=dc.create({});async function Hy(e,t,r){return e.getSignedUrl||console.error("请先配置uploader.getSignedUrl该方法应该从后端获取签名url"),await e.getSignedUrl(e.bucket,t,e,r)}async function qy(e,t){const{file:r,onProgress:n,options:s}=e,i=await Hy(s,t,"put"),o=decodeURIComponent(i);return await Fy.put(o,r,{onUploadProgress:a=>{const{loaded:c,total:u}=a;n({percent:Math.round(c*100/u)})}})}async function jy(e){const{file:t,fileName:r,onProgress:n,options:s}=e,i=s,o=new Uy({...(i==null?void 0:i.sdkOpts)||{}}),a=await hc(t,r,i);async function c(){const u={url:i.sdkOpts.endpoint+"/"+i.bucket+"/"+a,key:a};return i.successHandle?await i.successHandle(u):u}if(i.getSignedUrl)await qy(e,a);else{const u={Bucket:i.bucket,Key:a};await o.send(new Ly({Body:t,...u}))}return await c()}async function Wy(e){const{getConfig:t}=cc(),r=t("s3"),n=e.options,s=uc(lc(r),n);return e.options=s,await jy(e)}export{Hy as buildSignedUrl,Wy as upload,qy as uploadUsingSignedUrl};