gemi 0.4.55 → 0.4.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -271,47 +271,31 @@ function useMutation(url, ...args) {
271
271
  },
272
272
  ...body ? { body } : {}
273
273
  });
274
- if (response.ok) {
275
- try {
276
- const data = await response.json();
277
- if (!response.ok) {
278
- setState(() => ({
279
- data: null,
280
- error: data.error,
281
- loading: false
282
- }));
283
- return;
284
- }
285
- options.onSuccess(data);
274
+ try {
275
+ const data = await response.json();
276
+ if (!response.ok) {
286
277
  setState({
287
- data,
288
- error: null,
289
- loading: false
290
- });
291
- return data;
292
- } catch (error) {
293
- setState((state2) => ({
294
- data: state2.data,
295
- error,
296
- loading: false
297
- }));
298
- }
299
- } else {
300
- try {
301
- const data = await response.json();
302
- options.onError(data);
303
- setState(() => ({
304
278
  data: null,
305
279
  error: data.error,
306
280
  loading: false
307
- }));
308
- } catch (error) {
309
- setState((state2) => ({
310
- data: state2.data,
311
- error: { message: "Server error" },
312
- loading: false
313
- }));
281
+ });
282
+ options.onError(data);
283
+ return;
314
284
  }
285
+ options.onSuccess(data);
286
+ setState({
287
+ data,
288
+ error: null,
289
+ loading: false
290
+ });
291
+ return data;
292
+ } catch (error) {
293
+ options.onError(error);
294
+ setState({
295
+ data: null,
296
+ error,
297
+ loading: false
298
+ });
315
299
  }
316
300
  }
317
301
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useMutation.d.ts","sourceRoot":"","sources":["../../client/useMutation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAWnD,KAAK,OAAO,GAAG;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/B,CAAC;AASF,KAAK,cAAc,CAAC,CAAC,IACnB,CAAC,SAAS,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC,GAC9C;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,GAC/C,KAAK,CAAC;AAEZ,KAAK,KAAK,GACN;IACE,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/B,GACD;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEN,KAAK,QAAQ,CAAC,CAAC,IACb,CAAC,SAAS,gBAAgB,CAAC,MAAM,KAAK,EAAE,MAAM,MAAM,EAAE,GAAG,CAAC,GACtD;IACE,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,CACP,GAAG,IAAI,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,KAC/D,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;CACrC,GACD,KAAK,CAAC;AAEZ,KAAK,WAAW,CAAC,CAAC,IAChB,CAAC,SAAS,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC;AAEtE,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,EAC7C,GAAG,EAAE,CAAC,SAAS,OAAO,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,EAC1C,GAAG,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACtD;IACE,MAAM,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;CAC3B,GACD,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,GAC/D,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CA2FlB"}
1
+ {"version":3,"file":"useMutation.d.ts","sourceRoot":"","sources":["../../client/useMutation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAWnD,KAAK,OAAO,GAAG;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/B,CAAC;AASF,KAAK,cAAc,CAAC,CAAC,IACnB,CAAC,SAAS,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC,GAC9C;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,GAC/C,KAAK,CAAC;AAEZ,KAAK,KAAK,GACN;IACE,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/B,GACD;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEN,KAAK,QAAQ,CAAC,CAAC,IACb,CAAC,SAAS,gBAAgB,CAAC,MAAM,KAAK,EAAE,MAAM,MAAM,EAAE,GAAG,CAAC,GACtD;IACE,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,CACP,GAAG,IAAI,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,KAC/D,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;CACrC,GACD,KAAK,CAAC;AAEZ,KAAK,WAAW,CAAC,CAAC,IAChB,CAAC,SAAS,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC;AAEtE,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,EAC7C,GAAG,EAAE,CAAC,SAAS,OAAO,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,EAC1C,GAAG,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACtD;IACE,MAAM,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;CAC3B,GACD,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,GAC/D,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CA4ElB"}
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"../chunk-545989119755857f.js";import{y as J} from"../chunk-7ce930fe69575c87.js";import{A as Gg,B as Fg,C as X,D as yr,E as Hr,F as Qg,G as pg,J as rg,K as sg,L as es,M as fg,N as lg,O as hg,Q as ag,R as Sg,S as _m,T as mg,U as $l,V as Ml,W as xh,X as Ar,Y as v,_ as gs,ba as ar,ca as oh,da as Sr,ea as nh,fa as ms,ga as zr,ia as Uf,ja as $r,ka as Jh,la as O,ma as ph,na as Rg,oa as Ag,pa as Kg,qa as Wg,sa as C,ua as uh} from"../chunk-c85fc7168a708cb6.js";import{wa as O3} from"../chunk-f08ca4bd263b132b.js";import{$a as jg,Aa as yg,Ba as $w,Ca as n,Da as p,Ea as Zs,Fa as Ur,Ga as Gh,Ha as Yg,Ia as Th,Ja as zh,Ka as Ch,La as Bg,Ma as kg,Na as Ig,Oa as dg,Pa as Eg,Qa as vg,Ra as Og,Sa as Fh,Ta as kr,Ua as Ir,Va as qg,Wa as Pg,Xa as rl,Ya as eg,Za as _g,_a as Ng,ab as $3,bb as xr,cb as $g,db as Ms,eb as Mg,fb as Ug,gb as Vg,hb as Zg,xa as Xg,ya as Jg,za as Hg} from"../chunk-52e76204b898931e.js";import{ib as Mw} from"../chunk-09dd89e1046786a5.js";import{kb as c,lb as gg} from"../chunk-f67aa3e46d73674e.js";import{mb as Dg} from"../chunk-40942fb138dcd780.js";import"../chunk-ffe161a589b4c44b.js";import"../chunk-d16ef78d852a6856.js";function aw(r){return(s)=>async(f)=>{const{request:l}=f;if(X.isInstance(l)&&l.body&&r.runtime==="node"){if(r.requestHandler?.constructor?.name!=="FetchHttpHandler")l.headers={...l.headers,Expect:"100-continue"}}return s({...f,request:l})}}var Sw={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},sl=(r)=>({applyToStack:(s)=>{s.add(aw(r),Sw)}});function Aw(){return(r,s)=>async(f)=>{const{request:l}=f;if(X.isInstance(l)){if(!(Rw in l.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof Hr))s.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.");else console.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.")}return r({...f})}}var Rw="content-length",kw={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},fl=(r)=>({applyToStack:(s)=>{s.add(Aw(),kw)}});var ll=(r)=>{return(s,f)=>async(l)=>{const h=await r.region(),m=r.region;let g=()=>{};if(f.__s3RegionRedirect)Object.defineProperty(r,"region",{writable:!1,value:async()=>{return f.__s3RegionRedirect}}),g=()=>Object.defineProperty(r,"region",{writable:!0,value:m});try{const w=await s(l);if(f.__s3RegionRedirect){g();const a=await r.region();if(h!==a)throw new Error("Region was not restored following S3 region redirect.")}return w}catch(w){throw g(),w}}},hl={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function Iw(r){return(s,f)=>async(l)=>{try{return await s(l)}catch(h){if(r.followRegionRedirects&&h?.$metadata?.httpStatusCode===301){try{const m=h.$response.headers["x-amz-bucket-region"];f.logger?.debug(`Redirecting from ${await r.region()} to ${m}`),f.__s3RegionRedirect=m}catch(m){throw new Error("Region redirect failed: "+m)}return s(l)}else throw h}}}var dw={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},ml=(r)=>({applyToStack:(s)=>{s.add(Iw(r),dw),s.addRelativeTo(ll(r),hl)}});var Ew=(r)=>{return(s,f)=>async(l)=>{const h=await s(l),{response:m}=h;if(yr.isInstance(m)){if(m.headers.expires){m.headers.expiresstring=m.headers.expires;try{$r(m.headers.expires)}catch(g){f.logger?.warn(`AWS SDK Warning for ${f.clientName}::${f.commandName} response parsing (${m.headers.expires}): ${g}`),delete m.headers.expires}}}return h}},Pw={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},gl=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Ew(r),Pw)}});class sr{constructor(r={}){this.data=r,this.lastPurgeTime=Date.now()}get(r){const s=this.data[r];if(!s)return;return s}set(r,s){return this.data[r]=s,s}delete(r){delete this.data[r]}async purgeExpired(){const r=Date.now();if(this.lastPurgeTime+sr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>r)return;for(let s in this.data){const f=this.data[s];if(!f.isRefreshing){const l=await f.identity;if(l.expiration){if(l.expiration.getTime()<r)delete this.data[s]}}}}}sr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class fr{constructor(r,s=!1,f=Date.now()){this._identity=r,this.isRefreshing=s,this.accessed=f}get identity(){return this.accessed=Date.now(),this._identity}}class lr{constructor(r,s=new sr){this.createSessionFn=r,this.cache=s}async getS3ExpressIdentity(r,s){const f=s.Bucket,{cache:l}=this,h=l.get(f);if(h)return h.identity.then((m)=>{if((m.expiration?.getTime()??0)<Date.now())return l.set(f,new fr(this.getIdentity(f))).identity;if((m.expiration?.getTime()??0)<Date.now()+lr.REFRESH_WINDOW_MS&&!h.isRefreshing)h.isRefreshing=!0,this.getIdentity(f).then((a)=>{l.set(f,new fr(Promise.resolve(a)))});return m});return l.set(f,new fr(this.getIdentity(f))).identity}async getIdentity(r){await this.cache.purgeExpired().catch((l)=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+l)});const s=await this.createSessionFn(r);if(!s.Credentials?.AccessKeyId||!s.Credentials?.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}}}lr.REFRESH_WINDOW_MS=60000;var kl=J($w(),1);var wl="Directory",al="S3Express",Sl="sigv4-s3express",Qr="X-Amz-S3session-Token",Mr=Qr.toLowerCase(),ew="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",Nw="s3_disable_express_session_auth",Ws={environmentVariableSelector:(r)=>n(r,ew,p.ENV),configFileSelector:(r)=>n(r,Nw,p.CONFIG),default:!1};var Rl=function(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}},Al=function(r,s){const f=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),l=r.credentialProvider,h=()=>{return clearTimeout(f),r.credentialProvider=l,Promise.resolve(s)};r.credentialProvider=h};class Yr extends kl.SignatureV4{async signWithCredentials(r,s,f){const l=Rl(s);r.headers[Mr]=s.sessionToken;const h=this;return Al(h,l),h.signRequest(r,f??{})}async presignWithCredentials(r,s,f){const l=Rl(s);return delete r.headers[Mr],r.headers[Qr]=s.sessionToken,r.query=r.query??{},r.query[Qr]=s.sessionToken,Al(this,l),this.presign(r,f)}}var Il=(r)=>{return(s,f)=>async(l)=>{if(f.endpointV2){const h=f.endpointV2,m=h.properties?.authSchemes?.[0]?.name===Sl;if(h.properties?.backend===al||h.properties?.bucketType===wl)f.isS3ExpressBucket=!0;if(m){const w=l.input.Bucket;if(w){const a=await r.s3ExpressIdentityProvider.getS3ExpressIdentity(await r.credentials(),{Bucket:w});if(f.s3ExpressIdentity=a,X.isInstance(l.request)&&a.sessionToken)l.request.headers[Mr]=a.sessionToken}}}return s(l)}},dl={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},Vs=(r)=>({applyToStack:(s)=>{s.add(Il(r),dl)}});var Pl=J(Zs(),1);var Uw=J(Mw(),1);var El=async(r,s,f,l)=>{const h=await l.signWithCredentials(f,r,{});if(h.headers["X-Amz-Security-Token"]||h.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return h};var Dw=(r)=>(s)=>{throw s},Tw=(r,s)=>{};var el=(r)=>(s,f)=>async(l)=>{if(!X.isInstance(l.request))return s(l);const m=Ur(f).selectedHttpAuthScheme;if(!m)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:g={}},identity:w,signer:a}=m;let P;if(f.s3ExpressIdentity)P=await El(f.s3ExpressIdentity,g,l.request,await r.signer());else P=await a.sign(l.request,w,g);const e=await s({...l,request:P}).catch((a.errorHandler||Dw)(g));return(a.successHandler||Tw)(e.response,g),e},Ls=(r)=>({applyToStack:(s)=>{s.addRelativeTo(el(r),Pl.httpSigningMiddlewareOptions)}});var Nl=(r,{session:s})=>{const[f,l]=s;return{...r,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,followRegionRedirects:r.followRegionRedirects??!1,s3ExpressIdentityProvider:r.s3ExpressIdentityProvider??new lr(async(h)=>f().send(new l({Bucket:h,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var zw={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Cw=3000,Gw=(r)=>(s,f)=>async(l)=>{const h=await s(l),{response:m}=h;if(!yr.isInstance(m))return h;const{statusCode:g,body:w}=m;if(g<200||g>=300)return h;let a=w,P=w;if(w&&typeof w==="object"&&!(w instanceof Uint8Array))[a,P]=await $l(w);m.body=P;const e=await Fw(a,{streamCollector:async(N)=>{return Ml(N,Cw)}});if(typeof a?.destroy==="function")a.destroy();const $=r.utf8Encoder(e.subarray(e.length-16));if(e.length===0&&zw[f.commandName]){const N=new Error("S3 aborted request");throw N.name="InternalError",N}if($&&$.endsWith("</Error>"))m.statusCode=400;return h},Fw=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},Kw={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},Br=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Gw(r),Kw)}});var Xs=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function Ul(r){return(s,f)=>async(l)=>{if(r.bucketEndpoint){const h=f.endpointV2;if(h){const m=l.input.Bucket;if(typeof m==="string")try{const g=new URL(m);h.url=g}catch(g){const w=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${m} could not be parsed as URL.`;if(f.logger?.constructor?.name==="NoOpLogger")console.warn(w);else f.logger?.warn?.(w);throw g}}}return s(l)}}var Dl={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Ww({bucketEndpoint:r}){return(s)=>async(f)=>{const{input:{Bucket:l}}=f;if(!r&&typeof l==="string"&&!Xs(l)&&l.indexOf("/")>=0){const h=new Error(`Bucket name shouldn't contain '/', received '${l}'`);throw h.name="InvalidBucketName",h}return s({...f})}}var Vw={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},Tl=(r)=>({applyToStack:(s)=>{s.add(Ww(r),Vw),s.addRelativeTo(Ul(r),Dl)}});var Er=J(Zs(),1);var zl=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var or=J(xr(),1);var vr={CrtSignerV4:null};class Js{constructor(r){this.sigv4Signer=new Yr(r),this.signerOptions=r}async sign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().sign(r,s)}return this.sigv4Signer.sign(r,s)}async signWithCredentials(r,s,f={}){if(f.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().signWithCredentials(r,s,f)}return this.sigv4Signer.signWithCredentials(r,s,f)}async presign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().presign(r,s)}return this.sigv4Signer.presign(r,s)}async presignWithCredentials(r,s,f={}){if(f.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(r,s,f)}getSigv4aSigner(){if(!this.sigv4aSigner){let r=null;try{if(r=vr.CrtSignerV4,typeof r!=="function")throw new Error}catch(s){throw s.message=`${s.message}\n`+'Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. \nYou 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";]. \nFor more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt',s}this.sigv4aSigner=new r({...this.signerOptions,signingAlgorithm:1})}return this.sigv4aSigner}}var hr={["required"]:!1,["type"]:"String"},mr={["required"]:!0,default:!1,["type"]:"Boolean"},Dr={["required"]:!1,["type"]:"Boolean"},B={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},E={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},d={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},D={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},Eh={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},Cl={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},cr={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},V={["ref"]:"Bucket"},W={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},jr={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},Ph={["ref"]:"url"},eh={["fn"]:"uriEncode",["argv"]:[V],["assign"]:"uri_encoded_bucket"},_={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},S={},Nh={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[V,!1]},Hs={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},br={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},Gl={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},Fl={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},R={["fn"]:"not",["argv"]:[D]},Kl={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},Wl={["fn"]:"not",["argv"]:[cr]},Vl={["ref"]:"hardwareType"},Zl={["conditions"]:[R],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},Or={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},ys={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},Zw={["ref"]:"ForcePathStyle"},U={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},z={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},G={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},I={["fn"]:"not",["argv"]:[z]},F={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},Ll={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},T={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},K={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},k={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},Xl={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},A={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},Jl={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},Hl={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},Qs={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Ph,"isIp"]},!1]},Ys={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:T,["headers"]:{}},hf={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:T,["headers"]:{}},yl={["endpoint"]:hf,["type"]:"endpoint"},Bs={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},Ql={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},qr={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},L={["ref"]:"bucketArn"},$h={["ref"]:"arnType"},vs={["fn"]:"getAttr",["argv"]:[L,"service"]},mf={["ref"]:"accessPointName"},Yl={["conditions"]:[d],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},Bl={["conditions"]:[B],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},vl={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},Os={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},Mh={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},Uh={["fn"]:"getAttr",["argv"]:[L,"accountId"]},qs={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},Ol={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},_s={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},js={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},cs={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},ql={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},_l={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Tr={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},jl={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},cl={["fn"]:"aws.parseArn",["argv"]:[V]},bl={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},il={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},xl={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},bs={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},ol={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},nl={["ref"]:"UseObjectLambdaEndpoint"},is={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},pl={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},ul={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},tl={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},xs={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:T,["headers"]:{}},rh={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},os=[{["ref"]:"Region"}],Lw=[{["ref"]:"Endpoint"}],Xw=[V],ns=[d],_r=[B],u=[D,W],sh=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],fh=[jr],ps=[eh],us=[Nh],gr=[E],lh=[{["fn"]:"substring",["argv"]:[V,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[V,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],hh=[{["conditions"]:[E],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:_,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:_,["headers"]:{}},["type"]:"endpoint"}],mh=[{["fn"]:"substring",["argv"]:[V,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[V,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],gh=[{["conditions"]:[E],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:br,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:br,["headers"]:{}},["type"]:"endpoint"}],Jw=[cr],wh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],ah=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],Hw=["*"],b=[Eh],Sh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],i=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],ts=[{["fn"]:"stringEquals",["argv"]:[$h,"accesspoint"]}],Rh=[{["fn"]:"getAttr",["argv"]:[L,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[mf,""]}]}],yw=[L,"resourceId[1]"],rf=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"region"]},""]}]}],Ah=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"resourceId[2]"]}]}]}],Qw=[L,"resourceId[2]"],sf=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"region"]}],["assign"]:"bucketPartition"}],kh=[{["fn"]:"stringEquals",["argv"]:[Mh,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],ff=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"region"]},!0]}],lf=[{["fn"]:"isValidHostLabel",["argv"]:[Uh,!1]}],Ih=[{["fn"]:"isValidHostLabel",["argv"]:[mf,!1]}],dh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],Yw={version:"1.0",parameters:{Bucket:hr,Region:hr,UseFIPS:mr,UseDualStack:mr,Endpoint:hr,ForcePathStyle:mr,Accelerate:mr,UseGlobalEndpoint:mr,UseObjectLambdaEndpoint:Dr,Key:hr,Prefix:hr,CopySource:hr,DisableAccessPoints:Dr,DisableMultiRegionAccessPoints:mr,UseArnRegion:Dr,UseS3ExpressControlEndpoint:Dr,DisableS3ExpressSessionAuth:Dr},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:os}],rules:[{["conditions"]:[B,E],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[d,D],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[D,E],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[D,B],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[E,Eh,Cl],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[cr,{["fn"]:"substring",["argv"]:[V,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:ns,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:_r,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:u,rules:[{["conditions"]:sh,rules:[{["conditions"]:fh,rules:[{["conditions"]:ps,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:_,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:us,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:_,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},Hs],["type"]:"tree"},{["conditions"]:fh,rules:[{["conditions"]:ps,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:br,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:us,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:br,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},Hs],["type"]:"tree"},{["conditions"]:[Gl,Fl],rules:[{["conditions"]:[eh,R],rules:[{["conditions"]:gr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:_,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:_,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:us,rules:[{["conditions"]:sh,rules:[{["conditions"]:lh,rules:hh,["type"]:"tree"},{["conditions"]:mh,rules:hh,["type"]:"tree"},Kl],["type"]:"tree"},{["conditions"]:lh,rules:gh,["type"]:"tree"},{["conditions"]:mh,rules:gh,["type"]:"tree"},Kl],["type"]:"tree"},Hs],["type"]:"tree"},{["conditions"]:[Wl,Gl,Fl],rules:[{["conditions"]:u,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:_,["headers"]:S},["type"]:"endpoint"},{["conditions"]:gr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com",["properties"]:_,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com",["properties"]:_,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[cr,{["fn"]:"substring",["argv"]:[V,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[V,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:[V,0,7,!0],["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[V,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:os,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:wh,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Vl,"e"]}],rules:[{["conditions"]:ah,rules:[Zl,{["conditions"]:u,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:Or,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Or,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Vl,"o"]}],rules:[{["conditions"]:ah,rules:[Zl,{["conditions"]:u,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:Or,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Or,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{error:"Unrecognized hardware type: \"Expected hardware type o or e but got {hardwareType}\"",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",["type"]:"error"}],["type"]:"tree"},{["conditions"]:Jw,rules:[{["conditions"]:[D,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:Lw}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[ys,Nh],rules:[{["conditions"]:b,rules:[{["conditions"]:Sh,rules:[{["conditions"]:[B,Cl],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[d,E,U,R,z],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[d,E,U,R,I,F],rules:[{endpoint:Ll,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[d,E,U,R,I,K],endpoint:Ll,["type"]:"endpoint"},{["conditions"]:[k,E,U,R,z],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[k,E,U,R,I,F],rules:[{endpoint:Xl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,E,U,R,I,K],endpoint:Xl,["type"]:"endpoint"},{["conditions"]:[d,A,B,R,z],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[d,A,B,R,I,F],rules:[{endpoint:Jl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[d,A,B,R,I,K],endpoint:Jl,["type"]:"endpoint"},{["conditions"]:[d,A,U,R,z],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[d,A,U,R,I,F],rules:[{endpoint:Hl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[d,A,U,R,I,K],endpoint:Hl,["type"]:"endpoint"},{["conditions"]:[k,A,U,D,W,jr,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[k,A,U,D,W,Qs,z],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[k,A,U,D,W,jr,I,F],rules:[{["conditions"]:i,endpoint:Ys,["type"]:"endpoint"},{endpoint:Ys,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,A,U,D,W,Qs,I,F],rules:[{["conditions"]:i,endpoint:hf,["type"]:"endpoint"},yl],["type"]:"tree"},{["conditions"]:[k,A,U,D,W,jr,I,K],endpoint:Ys,["type"]:"endpoint"},{["conditions"]:[k,A,U,D,W,Qs,I,K],endpoint:hf,["type"]:"endpoint"},{["conditions"]:[k,A,B,R,z],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[k,A,B,R,I,F],rules:[{["conditions"]:i,endpoint:Bs,["type"]:"endpoint"},{endpoint:Bs,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,A,B,R,I,K],endpoint:Bs,["type"]:"endpoint"},{["conditions"]:[k,A,U,R,z],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[k,A,U,R,I,F],rules:[{["conditions"]:i,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:S},["type"]:"endpoint"},{endpoint:Ql,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,A,U,R,I,K],endpoint:Ql,["type"]:"endpoint"}],["type"]:"tree"},qr],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[D,W,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Ph,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[V,!0]},ys,A,k,U],rules:[{["conditions"]:b,rules:[{["conditions"]:Sh,rules:[yl],["type"]:"tree"},qr],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[ys,{["fn"]:"aws.parseArn",["argv"]:Xw,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[L,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[$h,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[vs,"s3-object-lambda"]}],rules:[{["conditions"]:ts,rules:[{["conditions"]:Rh,rules:[Yl,Bl,{["conditions"]:rf,rules:[vl,{["conditions"]:Ah,rules:[Os,{["conditions"]:sf,rules:[{["conditions"]:b,rules:[{["conditions"]:kh,rules:[{["conditions"]:ff,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Uh,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:lf,rules:[{["conditions"]:Ih,rules:[{["conditions"]:u,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:qs,["headers"]:S},["type"]:"endpoint"},{["conditions"]:gr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:qs,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:qs,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},Ol],["type"]:"tree"},_s],["type"]:"tree"},js],["type"]:"tree"},cs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},ql],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},_l],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:ts,rules:[{["conditions"]:Rh,rules:[{["conditions"]:rf,rules:[{["conditions"]:ts,rules:[{["conditions"]:rf,rules:[vl,{["conditions"]:Ah,rules:[Os,{["conditions"]:sf,rules:[{["conditions"]:b,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Mh,"{partitionResult#name}"]}],rules:[{["conditions"]:ff,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[vs,"s3"]}],rules:[{["conditions"]:lf,rules:[{["conditions"]:Ih,rules:[{["conditions"]:_r,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:[E,d],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Tr,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[E,k],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Tr,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,d],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Tr,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,k,D,W],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Tr,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,k],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Tr,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},Ol],["type"]:"tree"},_s],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},js],["type"]:"tree"},cs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},ql],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[mf,!0]}],rules:[{["conditions"]:ns,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:gr,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:_r,error:"S3 MRAP does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableMultiRegionAccessPoints"},!0]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",["type"]:"error"},{["conditions"]:[{["fn"]:"aws.partition",["argv"]:os,["assign"]:"mrapPartition"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[L,"partition"]}]}],rules:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:Hw}]},["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Access Point Name",["type"]:"error"}],["type"]:"tree"},_l],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[vs,"s3-outposts"]}],rules:[{["conditions"]:ns,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:gr,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:_r,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:yw,["assign"]:"outpostId"}],rules:[{["conditions"]:wh,rules:[Os,{["conditions"]:sf,rules:[{["conditions"]:b,rules:[{["conditions"]:kh,rules:[{["conditions"]:ff,rules:[{["conditions"]:lf,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:Qw,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[L,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:u,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:jl,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:jl,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{error:"Expected an outpost type `accesspoint`, found {outpostType}",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: expected an access point name",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Expected a 4-component resource",["type"]:"error"}],["type"]:"tree"},_s],["type"]:"tree"},js],["type"]:"tree"},cs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The Outpost Id was not set",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: No ARN type specified",["type"]:"error"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"substring",["argv"]:[V,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[cl]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[Zw,!0]},cl],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:ps,rules:[{["conditions"]:b,rules:[{["conditions"]:[U],rules:[{["conditions"]:[d,R,E,z],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[d,R,E,I,F],rules:[{endpoint:bl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[d,R,E,I,K],endpoint:bl,["type"]:"endpoint"},{["conditions"]:[k,R,E,z],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[k,R,E,I,F],rules:[{endpoint:il,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,R,E,I,K],endpoint:il,["type"]:"endpoint"},{["conditions"]:[d,R,A,z],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[d,R,A,I,F],rules:[{endpoint:xl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[d,R,A,I,K],endpoint:xl,["type"]:"endpoint"},{["conditions"]:[k,D,W,A,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[k,D,W,A,I,F],rules:[{["conditions"]:i,endpoint:bs,["type"]:"endpoint"},{endpoint:bs,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,D,W,A,I,K],endpoint:bs,["type"]:"endpoint"},{["conditions"]:[k,R,A,z],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[k,R,A,I,F],rules:[{["conditions"]:i,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:S},["type"]:"endpoint"},{endpoint:ol,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,R,A,I,K],endpoint:ol,["type"]:"endpoint"}],["type"]:"tree"},{error:"Path-style addressing cannot be used with S3 Accelerate",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[nl]},{["fn"]:"booleanEquals",["argv"]:[nl,!0]}],rules:[{["conditions"]:b,rules:[{["conditions"]:dh,rules:[Yl,Bl,{["conditions"]:u,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:is,["headers"]:S},["type"]:"endpoint"},{["conditions"]:gr,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:is,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:is,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},qr],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Wl],rules:[{["conditions"]:b,rules:[{["conditions"]:dh,rules:[{["conditions"]:[E,d,R,z],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[E,d,R,I,F],rules:[{endpoint:pl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[E,d,R,I,K],endpoint:pl,["type"]:"endpoint"},{["conditions"]:[E,k,R,z],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[E,k,R,I,F],rules:[{endpoint:ul,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[E,k,R,I,K],endpoint:ul,["type"]:"endpoint"},{["conditions"]:[A,d,R,z],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,d,R,I,F],rules:[{endpoint:tl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,d,R,I,K],endpoint:tl,["type"]:"endpoint"},{["conditions"]:[A,k,D,W,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,k,D,W,I,F],rules:[{["conditions"]:i,endpoint:xs,["type"]:"endpoint"},{endpoint:xs,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,k,D,W,I,K],endpoint:xs,["type"]:"endpoint"},{["conditions"]:[A,k,R,z],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,k,R,I,F],rules:[{["conditions"]:i,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:S},["type"]:"endpoint"},{endpoint:rh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,k,R,I,K],endpoint:rh,["type"]:"endpoint"}],["type"]:"tree"},qr],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},Dh=Yw;var ir=(r,s={})=>{return zh(Dh,{endpointParams:r,logger:s.logger})};Th.aws=Ch;var Wh=function(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,f)=>({signingProperties:{config:s,context:f}})}},Vh=function(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,f)=>({signingProperties:{config:s,context:f}})}},Bw=(r)=>async(s,f,l)=>{if(!l)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const h=await r(s,f,l),m=Ur(f)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!m)throw new Error(`getEndpointParameterInstructions() is not defined on \`${f.commandName}\``);const g=await Fh(l,{getEndpointParameterInstructions:m},s);return Object.assign(h,g)},vw=async(r,s,f)=>{return{operation:Ur(s).operation,region:await Gh(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Kh=Bw(vw),Ow=(r,s,f)=>{return(h)=>{const g=r(h).properties?.authSchemes;if(!g)return s(h);const w=[];for(let a of g){const{name:P,properties:e={},...$}=a,N=P.toLowerCase();if(P!==N)console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${P}\` to \`${N}\``);let H;if(N==="sigv4a"){H="aws.auth#sigv4a";const Jr=g.find((q)=>{const Nr=q.name.toLowerCase();return Nr!=="sigv4a"&&Nr.startsWith("sigv4")});if(!vr.CrtSignerV4&&Jr)continue}else if(N.startsWith("sigv4"))H="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${N}\``);const y=f[H];if(!y)throw new Error(`Could not find HttpAuthOption create function for \`${H}\``);const Y=y(h);Y.schemeId=H,Y.signingProperties={...Y.signingProperties||{},...$,...e},w.push(Y)}return w}},qw=(r)=>{const s=[];switch(r.operation){default:s.push(Wh(r)),s.push(Vh(r))}return s},Zh=Ow(ir,qw,{"aws.auth#sigv4":Wh,"aws.auth#sigv4a":Vh}),Lh=(r)=>{const s=or.resolveAwsSdkSigV4Config(r);return{...or.resolveAwsSdkSigV4AConfig(s)}};var Xh=(r)=>{return{...r,useFipsEndpoint:r.useFipsEndpoint??!1,useDualstackEndpoint:r.useDualstackEndpoint??!1,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,useGlobalEndpoint:r.useGlobalEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,defaultSigningName:"s3"}},wr={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 Z extends Jh{constructor(r){super(r);Object.setPrototypeOf(this,Z.prototype)}}class nr extends Z{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,nr.prototype)}}class pr extends Z{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,pr.prototype)}}class ur extends Z{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,ur.prototype)}}class tr extends Z{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,tr.prototype)}}class rs extends Z{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,rs.prototype)}}var gf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(gf||(gf={}));var wf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.ObjectSizeGreaterThan!==void 0)return f.ObjectSizeGreaterThan(s.ObjectSizeGreaterThan);if(s.ObjectSizeLessThan!==void 0)return f.ObjectSizeLessThan(s.ObjectSizeLessThan);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(wf||(wf={}));var af;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.AccessPointArn!==void 0)return f.AccessPointArn(s.AccessPointArn);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(af||(af={}));var Sf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Sf||(Sf={}));class ss extends Z{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,ss.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class fs extends Z{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,fs.prototype)}}class ls extends Z{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,ls.prototype)}}var _w=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:v},...r.SessionToken&&{SessionToken:v}}),Hh=(r)=>({...r,...r.Credentials&&{Credentials:_w(r.Credentials)}});var yh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:v}}),Qh=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:v}});var Rr=J(xr(),1);var as=J(Zs(),1);class hs extends Z{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,hs.prototype)}}var Yh;(function(r){r.visit=(s,f)=>{if(s.Records!==void 0)return f.Records(s.Records);if(s.Stats!==void 0)return f.Stats(s.Stats);if(s.Progress!==void 0)return f.Progress(s.Progress);if(s.Cont!==void 0)return f.Cont(s.Cont);if(s.End!==void 0)return f.End(s.End);return f._(s.$unknown[0],s.$unknown[1])}})(Yh||(Yh={}));var Bh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:v},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:v}}),vh=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:v},...r.SSEKMSKeyId&&{SSEKMSKeyId:v},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:v}});var th=async(r,s)=>{const f=as.requestBuilder(r,s),l=C({},j,{[ua]:r[Wa]});f.bp("/"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const h=C({[xa]:[,""]});let m;return f.m("GET").h(l).q(h).b(m),f.build()};var rm=async(r,s)=>{const f=as.requestBuilder(r,s),l=C({},j,{[ya]:r[da],[Qa]:[()=>j(r[Oh]),()=>zr(r[Oh]).toString()],[Ya]:r[Ea],[Ba]:[()=>j(r[qh]),()=>zr(r[qh]).toString()],[Oa]:r[Ma],[As]:r[Ss],[Xm]:r[Pm],[ks]:r[Rs],[Vm]:r[Em],[Gm]:r[Rm],[pa]:r[ma]});f.bp("/{Key+}"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1),f.p("Key",()=>r.Key,"{Key+}",!0);const h=C({[ym]:[,"GetObject"],[qa]:[,r[Ua]],[_a]:[,r[Da]],[ja]:[,r[Ta]],[ca]:[,r[za]],[ba]:[,r[Ca]],[ia]:[()=>r.ResponseExpires!==void 0,()=>zr(r[Ga]).toString()],[oa]:[,r[Wf]],[va]:[()=>r.PartNumber!==void 0,()=>r[$a].toString()]});let m;return f.m("GET").h(l).q(h).b(m),f.build()};var sm=async(r,s)=>{const f=as.requestBuilder(r,s),l=C({},j,{[Tm]:r[Sm]||"application/octet-stream",[na]:r[fa],[$m]:r[mm],[Mm]:r[gm],[Um]:r[wm],[Dm]:r[am],[Nf]:[()=>j(r[Ef]),()=>r[Ef].toString()],[Xa]:r[ga],[m3]:r[ha],[Vf]:r[Tf],[Zf]:r[zf],[Lf]:r[Cf],[Xf]:r[Gf],[$f]:[()=>j(r[Pf]),()=>zr(r[Pf]).toString()],[ta]:r[Ra],[r3]:r[Aa],[s3]:r[ka],[f3]:r[Ia],[Jf]:r[Ff],[Zm]:r[Gr],[Hm]:r[Nm],[As]:r[Ss],[Xm]:r[Pm],[ks]:r[Rs],[Hf]:r[Kf],[Lm]:r[em],[Fr]:[()=>j(r[ws]),()=>r[ws].toString()],[Vm]:r[Em],[g3]:r[Va],[Km]:r[Im],[Mf]:[()=>j(r[ef]),()=>uh(r[ef]).toString()],[Fm]:r[km],[Gm]:r[Rm],...r.Metadata!==void 0&&Object.keys(r.Metadata).reduce((w,a)=>{return w[`x-amz-meta-${a.toLowerCase()}`]=r.Metadata[a],w},{})});f.bp("/{Key+}"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1),f.p("Key",()=>r.Key,"{Key+}",!0);const h=C({[ym]:[,"PutObject"]});let m,g;if(r.Body!==void 0)g=r.Body,m=g;return f.m("PUT").h(l).q(h).b(m),f.build()};var fm=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return Df(r,s);const f=C({$metadata:Q(r)}),l=ar(oh(await Rr.parseXmlBody(r.body,s)),"body");if(l[kf]!=null)f[kf]=sa(l[kf],s);return f};var lm=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return Df(r,s);const f=C({$metadata:Q(r),[aa]:[()=>r.headers[jh]!==void 0,()=>gs(r.headers[jh])],[la]:[,r.headers[La]],[Cr]:[,r.headers[Cm]],[Ka]:[,r.headers[l3]],[Pa]:[()=>r.headers[_h]!==void 0,()=>ar($r(r.headers[_h]))],[Ef]:[()=>r.headers[Nf]!==void 0,()=>nh(r.headers[Nf])],[Am]:[,r.headers[zm]],[Tf]:[,r.headers[Vf]],[zf]:[,r.headers[Zf]],[Cf]:[,r.headers[Lf]],[Gf]:[,r.headers[Xf]],[ea]:[()=>r.headers[ch]!==void 0,()=>ms(r.headers[ch])],[Wf]:[,r.headers[Jm]],[mm]:[,r.headers[$m]],[gm]:[,r.headers[Mm]],[wm]:[,r.headers[Um]],[am]:[,r.headers[Dm]],[wa]:[,r.headers[Ja]],[Sm]:[,r.headers[Tm]],[Pf]:[()=>r.headers[$f]!==void 0,()=>ar($r(r.headers[$f]))],[Sa]:[,r.headers[Ha]],[Nm]:[,r.headers[Hm]],[Ff]:[,r.headers[Jf]],[Ss]:[,r.headers[As]],[Rs]:[,r.headers[ks]],[Kf]:[,r.headers[Hf]],[ws]:[()=>r.headers[Fr]!==void 0,()=>gs(r.headers[Fr])],[Gr]:[,r.headers[Zm]],[dm]:[,r.headers[Wm]],[Fa]:[,r.headers[h3]],[Na]:[()=>r.headers[bh]!==void 0,()=>ms(r.headers[bh])],[Za]:[()=>r.headers[ih]!==void 0,()=>ms(r.headers[ih])],[Im]:[,r.headers[Km]],[ef]:[()=>r.headers[Mf]!==void 0,()=>ar(Uf(r.headers[Mf]))],[km]:[,r.headers[Fm]],Metadata:[,Object.keys(r.headers).filter((h)=>h.startsWith("x-amz-meta-")).reduce((h,m)=>{return h[m.substring(11)]=r.headers[m],h},{})]}),l=r.body;return s.sdkStreamMixin(l),f.Body=l,f};var hm=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return Df(r,s);const f=C({$metadata:Q(r),[Cr]:[,r.headers[Cm]],[Am]:[,r.headers[zm]],[Tf]:[,r.headers[Vf]],[zf]:[,r.headers[Zf]],[Cf]:[,r.headers[Lf]],[Gf]:[,r.headers[Xf]],[Ff]:[,r.headers[Jf]],[Wf]:[,r.headers[Jm]],[Ss]:[,r.headers[As]],[Rs]:[,r.headers[ks]],[Kf]:[,r.headers[Hf]],[em]:[,r.headers[Lm]],[ws]:[()=>r.headers[Fr]!==void 0,()=>gs(r.headers[Fr])],[dm]:[,r.headers[Wm]]});return await xh(r.body,s),f};var Df=async(r,s)=>{const f={...r,body:await Rr.parseXmlErrorBody(r.body,s)},l=Rr.loadRestXmlErrorCode(r,f.body);switch(l){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await pw(f,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await ra(f,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await bw(f,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await iw(f,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await ow(f,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await xw(f,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await nw(f,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await uw(f,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await tw(f,s);default:const h=f.body;return cw({output:r,parsedBody:h,errorCode:l})}},cw=ph(Z),bw=async(r,s)=>{const f=C({}),l=r.body,h=new ur({$metadata:Q(r),...f});return O(h,r.body)},iw=async(r,s)=>{const f=C({}),l=r.body,h=new tr({$metadata:Q(r),...f});return O(h,r.body)},xw=async(r,s)=>{const f=C({}),l=r.body;if(l[Af]!=null)f[Af]=Sr(l[Af]);if(l[Gr]!=null)f[Gr]=Sr(l[Gr]);const h=new ss({$metadata:Q(r),...f});return O(h,r.body)},ow=async(r,s)=>{const f=C({}),l=r.body,h=new rs({$metadata:Q(r),...f});return O(h,r.body)},nw=async(r,s)=>{const f=C({}),l=r.body,h=new fs({$metadata:Q(r),...f});return O(h,r.body)},pw=async(r,s)=>{const f=C({}),l=r.body,h=new nr({$metadata:Q(r),...f});return O(h,r.body)},uw=async(r,s)=>{const f=C({}),l=r.body,h=new ls({$metadata:Q(r),...f});return O(h,r.body)},tw=async(r,s)=>{const f=C({}),l=r.body,h=new hs({$metadata:Q(r),...f});return O(h,r.body)},ra=async(r,s)=>{const f=C({}),l=r.body,h=new pr({$metadata:Q(r),...f});return O(h,r.body)};var sa=(r,s)=>{const f={};if(r[Rf]!=null)f[Rf]=Sr(r[Rf]);if(r[If]!=null)f[If]=Sr(r[If]);if(r[df]!=null)f[df]=Sr(r[df]);if(r[Cr]!=null)f[Cr]=ar(Uf(r[Cr]));return f};var Q=(r)=>({httpStatusCode:r.statusCode,requestId:r.headers["x-amzn-requestid"]??r.headers["x-amzn-request-id"]??r.headers["x-amz-request-id"],extendedRequestId:r.headers["x-amz-id-2"],cfId:r.headers["x-amz-cf-id"]});var j=(r)=>r!==void 0&&r!==null&&r!==""&&(!Object.getOwnPropertyNames(r).includes("length")||r.length!=0)&&(!Object.getOwnPropertyNames(r).includes("size")||r.size!=0);var fa="ACL";var Rf="AccessKeyId";var la="AcceptRanges";var Af="AccessTier";var ws="BucketKeyEnabled";var kf="Credentials",ha="ChecksumAlgorithm";var mm="CacheControl",Tf="ChecksumCRC32",zf="ChecksumCRC32C",gm="ContentDisposition";var wm="ContentEncoding";var am="ContentLanguage",Ef="ContentLength",ma="ChecksumMode",ga="ContentMD5";var wa="ContentRange";var Cf="ChecksumSHA1",Gf="ChecksumSHA256";var Sm="ContentType";var aa="DeleteMarker";var Pf="Expires";var Rm="ExpectedBucketOwner";var Sa="ExpiresString";var Am="ETag";var Cr="Expiration";var Ra="GrantFullControl";var Aa="GrantRead",ka="GrantReadACP";var Ia="GrantWriteACP";var da="IfMatch",Oh="IfModifiedSince",Ea="IfNoneMatch";var qh="IfUnmodifiedSince";var Pa="LastModified";var ea="MissingMeta";var km="ObjectLockLegalHoldStatus",Im="ObjectLockMode";var ef="ObjectLockRetainUntilDate";var Na="PartsCount";var $a="PartNumber";var Ma="Range";var dm="RequestCharged",Ua="ResponseCacheControl",Da="ResponseContentDisposition",Ta="ResponseContentEncoding",za="ResponseContentLanguage",Ca="ResponseContentType";var Ga="ResponseExpires";var Em="RequestPayer";var Fa="ReplicationStatus";var Ka="Restore";var If="SecretAccessKey";var Gr="StorageClass";var Wa="SessionMode";var Ff="ServerSideEncryption";var Ss="SSECustomerAlgorithm",Pm="SSECustomerKey",Rs="SSECustomerKeyMD5";var em="SSEKMSEncryptionContext",Kf="SSEKMSKeyId";var df="SessionToken";var Va="Tagging";var Za="TagCount";var Wf="VersionId";var Nm="WebsiteRedirectLocation";var La="accept-ranges";var $m="cache-control",Mm="content-disposition",Um="content-encoding",Dm="content-language",Nf="content-length",Xa="content-md5",Ja="content-range",Tm="content-type";var $f="expires";var zm="etag",Ha="expiresstring";var ya="if-match",Qa="if-modified-since";var Ya="if-none-match";var Ba="if-unmodified-since";var _h="last-modified";var va="partNumber";var Oa="range",qa="response-cache-control",_a="response-content-disposition",ja="response-content-encoding",ca="response-content-language",ba="response-content-type",ia="response-expires";var xa="session";var oa="versionId";var na="x-amz-acl";var Vf="x-amz-checksum-crc32",Zf="x-amz-checksum-crc32c",pa="x-amz-checksum-mode";var Lf="x-amz-checksum-sha1",Xf="x-amz-checksum-sha256";var ua="x-amz-create-session-mode";var jh="x-amz-delete-marker",Cm="x-amz-expiration",Gm="x-amz-expected-bucket-owner";var ta="x-amz-grant-full-control",r3="x-amz-grant-read",s3="x-amz-grant-read-acp";var f3="x-amz-grant-write-acp";var ch="x-amz-missing-meta";var bh="x-amz-mp-parts-count";var Fm="x-amz-object-lock-legal-hold",Km="x-amz-object-lock-mode",Mf="x-amz-object-lock-retain-until-date";var l3="x-amz-restore",Wm="x-amz-request-charged";var Vm="x-amz-request-payer";var h3="x-amz-replication-status";var Zm="x-amz-storage-class",m3="x-amz-sdk-checksum-algorithm";var Jf="x-amz-server-side-encryption",Hf="x-amz-server-side-encryption-aws-kms-key-id",Fr="x-amz-server-side-encryption-bucket-key-enabled",Lm="x-amz-server-side-encryption-context",As="x-amz-server-side-encryption-customer-algorithm",Xm="x-amz-server-side-encryption-customer-key",ks="x-amz-server-side-encryption-customer-key-md5",g3="x-amz-tagging",ih="x-amz-tagging-count";var Jm="x-amz-version-id",Hm="x-amz-website-redirect-location",ym="x-id";class yf extends Ar.classBuilder().ep({...wr,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,f,l){return[kr(f,this.serialize,this.deserialize),Ir(f,r.getEndpointParameterInstructions()),Br(f)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(void 0,Hh).ser(th).de(fm).build(){}var Qm={name:"@aws-sdk/client-s3",description:"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",version:"3.629.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3",test:"yarn test:unit","test:e2e":"yarn test:e2e:node && yarn test:e2e:browser","test:e2e:browser":"ts-mocha test/**/*.browser.ispec.ts && karma start karma.conf.js","test:e2e:node":"jest --c jest.config.e2e.js","test:unit":"ts-mocha test/unit/**/*.spec.ts"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha1-browser":"5.2.0","@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.629.0","@aws-sdk/client-sts":"3.629.0","@aws-sdk/core":"3.629.0","@aws-sdk/credential-provider-node":"3.629.0","@aws-sdk/middleware-bucket-endpoint":"3.620.0","@aws-sdk/middleware-expect-continue":"3.620.0","@aws-sdk/middleware-flexible-checksums":"3.620.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-location-constraint":"3.609.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-sdk-s3":"3.629.0","@aws-sdk/middleware-ssec":"3.609.0","@aws-sdk/middleware-user-agent":"3.620.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/signature-v4-multi-region":"3.629.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.614.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@aws-sdk/xml-builder":"3.609.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.3.2","@smithy/eventstream-serde-browser":"^3.0.6","@smithy/eventstream-serde-config-resolver":"^3.0.3","@smithy/eventstream-serde-node":"^3.0.5","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-blob-browser":"^3.1.2","@smithy/hash-node":"^3.0.3","@smithy/hash-stream-node":"^3.1.2","@smithy/invalid-dependency":"^3.0.3","@smithy/md5-js":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.14","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.1.12","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.14","@smithy/util-defaults-mode-node":"^3.0.14","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-stream":"^3.1.3","@smithy/util-utf8":"^3.0.0","@smithy/util-waiter":"^3.1.2",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/signature-v4-crt":"3.629.0","@tsconfig/node16":"16.1.3","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-s3"}};var Us=J(xr(),1);var a3="AWS_S3_USE_ARN_REGION",S3="s3_use_arn_region",Ym={environmentVariableSelector:(r)=>n(r,a3,p.ENV),configFileSelector:(r)=>n(r,S3,p.CONFIG),default:!1};var Bm=J($3(),1),{__extends:KA,__assign:WA,__rest:VA,__decorate:ZA,__param:LA,__esDecorate:XA,__runInitializers:JA,__propKey:HA,__setFunctionName:yA,__metadata:QA,__awaiter:Is,__generator:ds,__exportStar:YA,__createBinding:BA,__values:Es,__read:vA,__spread:OA,__spreadArrays:qA,__spreadArray:_A,__await:jA,__asyncGenerator:cA,__asyncDelegator:bA,__asyncValues:iA,__makeTemplateObject:xA,__importStar:oA,__importDefault:nA,__classPrivateFieldGet:pA,__classPrivateFieldSet:uA,__classPrivateFieldIn:tA,__addDisposableResource:rk,__disposeResources:sk}=Bm.default;import{Buffer as vm} from"buffer";var Om=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?vm.from(r,s):vm.from(r)};var Qf=(r)=>{const s=Om(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function Kr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return M3(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var M3=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:Qf;function Wr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function Vr(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}function Zr(r){if(!Uint32Array.from){var s=new Uint32Array(r.length),f=0;while(f<r.length)s[f]=r[f],f+=1;return s}return Uint32Array.from(r)}var Yf=function(){function r(){this.crc32=new t}return r.prototype.update=function(s){if(Wr(s))return;this.crc32.update(Kr(s))},r.prototype.digest=function(){return Is(this,void 0,void 0,function(){return ds(this,function(s){return[2,Vr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new t},r}();var t=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var f,l;try{for(var h=Es(s),m=h.next();!m.done;m=h.next()){var g=m.value;this.checksum=this.checksum>>>8^D3[(this.checksum^g)&255]}}catch(w){f={error:w}}finally{try{if(m&&!m.done&&(l=h.return))l.call(h)}finally{if(f)throw f.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var U3=[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,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],D3=Zr(U3);var x=J(_m(),1);var jm=J(_m(),1),qm=function(r){for(let s=0;s<8;s++)r[s]^=255;for(let s=7;s>-1;s--)if(r[s]++,r[s]!==0)break};class dr{constructor(r){if(this.bytes=r,r.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(r){if(r>9223372036854776000||r<-9223372036854776000)throw new Error(`${r} is too large (or, if negative, too small) to represent as an Int64`);const s=new Uint8Array(8);for(let f=7,l=Math.abs(Math.round(r));f>-1&&l>0;f--,l/=256)s[f]=l;if(r<0)qm(s);return new dr(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)qm(r);return parseInt(jm.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class Bf{constructor(r,s){this.toUtf8=r,this.fromUtf8=s}format(r){const s=[];for(let h of Object.keys(r)){const m=this.fromUtf8(h);s.push(Uint8Array.from([m.byteLength]),m,this.formatHeaderValue(r[h]))}const f=new Uint8Array(s.reduce((h,m)=>h+m.byteLength,0));let l=0;for(let h of s)f.set(h,l),l+=h.byteLength;return f}formatHeaderValue(r){switch(r.type){case"boolean":return Uint8Array.from([r.value?0:1]);case"byte":return Uint8Array.from([2,r.value]);case"short":const s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,r.value,!1),new Uint8Array(s.buffer);case"integer":const f=new DataView(new ArrayBuffer(5));return f.setUint8(0,4),f.setInt32(1,r.value,!1),new Uint8Array(f.buffer);case"long":const l=new Uint8Array(9);return l[0]=5,l.set(r.value.bytes,1),l;case"binary":const h=new DataView(new ArrayBuffer(3+r.value.byteLength));h.setUint8(0,6),h.setUint16(1,r.value.byteLength,!1);const m=new Uint8Array(h.buffer);return m.set(r.value,3),m;case"string":const g=this.fromUtf8(r.value),w=new DataView(new ArrayBuffer(3+g.byteLength));w.setUint8(0,7),w.setUint16(1,g.byteLength,!1);const a=new Uint8Array(w.buffer);return a.set(g,3),a;case"timestamp":const P=new Uint8Array(9);return P[0]=8,P.set(dr.fromNumber(r.value.valueOf()).bytes,1),P;case"uuid":if(!Z3.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const e=new Uint8Array(17);return e[0]=9,e.set(x.fromHex(r.value.replace(/\-/g,"")),1),e}}parse(r){const s={};let f=0;while(f<r.byteLength){const l=r.getUint8(f++),h=this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+f,l));switch(f+=l,r.getUint8(f++)){case 0:s[h]={type:bm,value:!0};break;case 1:s[h]={type:bm,value:!1};break;case 2:s[h]={type:T3,value:r.getInt8(f++)};break;case 3:s[h]={type:z3,value:r.getInt16(f,!1)},f+=2;break;case 4:s[h]={type:C3,value:r.getInt32(f,!1)},f+=4;break;case 5:s[h]={type:G3,value:new dr(new Uint8Array(r.buffer,r.byteOffset+f,8))},f+=8;break;case 6:const m=r.getUint16(f,!1);f+=2,s[h]={type:F3,value:new Uint8Array(r.buffer,r.byteOffset+f,m)},f+=m;break;case 7:const g=r.getUint16(f,!1);f+=2,s[h]={type:K3,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+f,g))},f+=g;break;case 8:s[h]={type:W3,value:new Date(new dr(new Uint8Array(r.buffer,r.byteOffset+f,8)).valueOf())},f+=8;break;case 9:const w=new Uint8Array(r.buffer,r.byteOffset+f,16);f+=16,s[h]={type:V3,value:`${x.toHex(w.subarray(0,4))}-${x.toHex(w.subarray(4,6))}-${x.toHex(w.subarray(6,8))}-${x.toHex(w.subarray(8,10))}-${x.toHex(w.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return s}}var cm;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(cm||(cm={}));var bm="boolean",T3="byte",z3="short",C3="integer",G3="long",F3="binary",K3="string",W3="timestamp",V3="uuid",Z3=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function xm({byteLength:r,byteOffset:s,buffer:f}){if(r<L3)throw new Error("Provided message too short to accommodate event stream message overhead");const l=new DataView(f,s,r),h=l.getUint32(0,!1);if(r!==h)throw new Error("Reported message length does not match received message length");const m=l.getUint32(im,!1),g=l.getUint32(o,!1),w=l.getUint32(r-rr,!1),a=new t().update(new Uint8Array(f,s,o));if(g!==a.digest())throw new Error(`The prelude checksum specified in the message (${g}) does not match the calculated CRC32 checksum (${a.digest()})`);if(a.update(new Uint8Array(f,s+o,r-(o+rr))),w!==a.digest())throw new Error(`The message checksum (${a.digest()}) did not match the expected value of ${w}`);return{headers:new DataView(f,s+o+rr,m),body:new Uint8Array(f,s+o+rr+m,h-m-(o+rr+rr))}}var im=4,o=im*2,rr=4,L3=o+rr*2;class vf{constructor(r,s){this.headerMarshaller=new Bf(r,s),this.messageBuffer=[],this.isEndOfStream=!1}feed(r){this.messageBuffer.push(this.decode(r))}endOfStream(){this.isEndOfStream=!0}getMessage(){const r=this.messageBuffer.pop(),s=this.isEndOfStream;return{getMessage(){return r},isEndOfStream(){return s}}}getAvailableMessages(){const r=this.messageBuffer;this.messageBuffer=[];const s=this.isEndOfStream;return{getMessages(){return r},isEndOfStream(){return s}}}encode({headers:r,body:s}){const f=this.headerMarshaller.format(r),l=f.byteLength+s.byteLength+16,h=new Uint8Array(l),m=new DataView(h.buffer,h.byteOffset,h.byteLength),g=new t;return m.setUint32(0,l,!1),m.setUint32(4,f.byteLength,!1),m.setUint32(8,g.update(h.subarray(0,8)).digest(),!1),h.set(f,12),h.set(s,f.byteLength+12),m.setUint32(l-4,g.update(h.subarray(8,l-4)).digest(),!1),h}decode(r){const{headers:s,body:f}=xm(r);return{headers:this.headerMarshaller.parse(s),body:f}}formatHeaders(r){return this.headerMarshaller.format(r)}}class Of{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.decoder.decode(r)}}class qf{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream)yield this.options.encoder.encode(r);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class _f{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream){const s=await this.options.deserializer(r);if(s===void 0)continue;yield s}}}class jf{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.serializer(r)}}function om(r){let s=0,f=0,l=null,h=null;const m=(w)=>{if(typeof w!=="number")throw new Error("Attempted to allocate an event message where size was not a number: "+w);s=w,f=4,l=new Uint8Array(w),new DataView(l.buffer).setUint32(0,w,!1)},g=async function*(){const w=r[Symbol.asyncIterator]();while(!0){const{value:a,done:P}=await w.next();if(P){if(!s)return;else if(s===f)yield l;else throw new Error("Truncated event message received.");return}const e=a.length;let $=0;while($<e){if(!l){const H=e-$;if(!h)h=new Uint8Array(4);const y=Math.min(4-f,H);if(h.set(a.slice($,$+y),f),f+=y,$+=y,f<4)break;m(new DataView(h.buffer).getUint32(0,!1)),h=null}const N=Math.min(s-f,e-$);if(l.set(a.slice($,$+N),f),f+=N,$+=N,s&&s===f)yield l,l=null,s=0,f=0}}};return{[Symbol.asyncIterator]:g}}function nm(r,s){return async function(f){const{value:l}=f.headers[":message-type"];if(l==="error"){const h=new Error(f.headers[":error-message"].value||"UnknownError");throw h.name=f.headers[":error-code"].value,h}else if(l==="exception"){const h=f.headers[":exception-type"].value,m={[h]:f},g=await r(m);if(g.$unknown){const w=new Error(s(f.body));throw w.name=h,w}throw g[h]}else if(l==="event"){const h={[f.headers[":event-type"].value]:f},m=await r(h);if(m.$unknown)return;return m}else throw Error(`Unrecognizable event type: ${f.headers[":event-type"].value}`)}}class Ps{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new vf(r,s),this.utfEncoder=r}deserialize(r,s){const f=om(r);return new _f({messageStream:new Of({inputStream:f,decoder:this.eventStreamCodec}),deserializer:nm(s,this.utfEncoder)})}serialize(r,s){return new qf({messageStream:new jf({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as X3} from"stream";async function*pm(r){let s=!1,f=!1;const l=new Array;r.on("error",(h)=>{if(!s)s=!0;if(h)throw h}),r.on("data",(h)=>{l.push(h)}),r.on("end",()=>{s=!0});while(!f){const h=await new Promise((m)=>setTimeout(()=>m(l.shift()),0));if(h)yield h;f=s&&l.length===0}}class cf{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new Ps({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const f=typeof r[Symbol.asyncIterator]==="function"?r:pm(r);return this.universalMarshaller.deserialize(f,s)}serialize(r,s){return X3.from(this.universalMarshaller.serialize(r,s))}}var um=(r)=>new cf(r);import{Writable as J3} from"stream";class Ns extends J3{constructor(r,s){super(s);this.hash=r}_write(r,s,f){try{this.hash.update(es(r))}catch(l){return f(l)}f()}}var tm=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const f=new r,l=new Ns(f);return s.pipe(l),new Promise((h,m)=>{s.on("error",(g)=>{l.end(),m(g)}),l.on("error",m),l.on("finish",()=>{f.digest().then(h).catch(m)})})};var $s=J(xr(),1);var wg=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??rg,base64Encoder:r?.base64Encoder??lg,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??ir,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??hg,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??Zh,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new $s.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new $s.AwsSdkSigV4ASigner}],logger:r?.logger??new Hr,sdkStreamMixin:r?.sdkStreamMixin??mg,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??Js,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??gg,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??sg,utf8Encoder:r?.utf8Encoder??fg}};var Tg=(r)=>{Ag(process.version);const s=Ug(r),f=()=>s().then(Rg),l=wg(r);return Us.emitWarningIfUnsupportedVersion(process.version),{...l,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??Mg,credentialDefaultProvider:r?.credentialDefaultProvider??Dg,defaultUserAgentProvider:r?.defaultUserAgentProvider??$g({serviceId:l.serviceId,clientVersion:Qm.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??c(Ws),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??um,maxAttempts:r?.maxAttempts??c(eg),md5:r?.md5??Ms.bind(null,"md5"),region:r?.region??c(dg,Eg),requestHandler:ag.create(r?.requestHandler??f),retryMode:r?.retryMode??c({...Ng,default:async()=>(await f()).retryMode||Pg}),sha1:r?.sha1??Ms.bind(null,"sha1"),sha256:r?.sha256??Ms.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??c(Us.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??Sg,streamHasher:r?.streamHasher??tm,useArnRegion:r?.useArnRegion??c(Ym),useDualstackEndpoint:r?.useDualstackEndpoint??c(kg),useFipsEndpoint:r?.useFipsEndpoint??c(Ig)}};var zg=(r)=>{const s=r.httpAuthSchemes;let{httpAuthSchemeProvider:f,credentials:l}=r;return{setHttpAuthScheme(h){const m=s.findIndex((g)=>g.schemeId===h.schemeId);if(m===-1)s.push(h);else s.splice(m,1,h)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(h){f=h},httpAuthSchemeProvider(){return f},setCredentials(h){l=h},credentials(){return l}}},Cg=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var Ds=(r)=>r,Lg=(r,s)=>{const f={...Ds(Vg(r)),...Ds(Kg(r)),...Ds(Gg(r)),...Ds(zg(r))};return s.forEach((l)=>l.configure(f)),{...r,...Zg(f),...Wg(f),...Fg(f),...Cg(f)}};class bf extends Qg{constructor(...[r]){const s=Tg(r||{}),f=Xh(s),l=Yg(f),h=_g(l),m=vg(h),g=Xg(m),w=qg(g),a=zl(w),P=Lh(a),e=Nl(P,{session:[()=>this,yf]}),$=Lg(e,r?.extensions||[]);super($);this.config=$,this.middlewareStack.use(Bg(this.config)),this.middlewareStack.use(jg(this.config)),this.middlewareStack.use(Og(this.config)),this.middlewareStack.use(Jg(this.config)),this.middlewareStack.use(Hg(this.config)),this.middlewareStack.use(yg(this.config)),this.middlewareStack.use(Er.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Kh,identityProviderConfigProvider:async(N)=>new Er.DefaultIdentityProviderConfig({"aws.auth#sigv4":N.credentials,"aws.auth#sigv4a":N.credentials})})),this.middlewareStack.use(Er.getHttpSigningPlugin(this.config)),this.middlewareStack.use(Tl(this.config)),this.middlewareStack.use(sl(this.config)),this.middlewareStack.use(ml(this.config)),this.middlewareStack.use(Vs(this.config)),this.middlewareStack.use(Ls(this.config))}destroy(){super.destroy()}}function H3(r){return(s)=>async(f)=>{const l={...f.input},h=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let m of h){const g=l[m.target];if(g){let w;if(typeof g==="string")if(Q3(g,r))w=r.base64Decoder(g);else w=r.utf8Decoder(g),l[m.target]=r.base64Encoder(w);else w=ArrayBuffer.isView(g)?new Uint8Array(g.buffer,g.byteOffset,g.byteLength):new Uint8Array(g),l[m.target]=r.base64Encoder(w);const a=new r.md5;a.update(w),l[m.hash]=r.base64Encoder(await a.digest())}}return s({...f,input:l})}}function Q3(r,s){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(r))return!1;try{return s.base64Decoder(r).length===32}catch{return!1}}var y3={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},Ts=(r)=>({applyToStack:(s)=>{s.add(H3(r),y3)}});var M;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(M||(M={}));var cg;(function(r){r.HEADER="header",r.TRAILER="trailer"})(cg||(cg={}));var{MD5:bg,CRC32:ig}=M;var Lr=[M.CRC32,M.CRC32C,M.SHA1,M.SHA256],xg=[M.CRC32,M.CRC32C,M.SHA1,M.SHA256];var og=(r,{requestChecksumRequired:s,requestAlgorithmMember:f},l)=>{const h=l?ig:bg;if(!f||!r[f])return s?h:void 0;const m=r[f];if(!Lr.includes(m))throw new Error(`The checksum algorithm "${m}" is not supported by the client.`+` Select one of ${Lr}.`);return m};var Pr=(r)=>r===M.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var ng=(r,s)=>{const f=r.toLowerCase();for(let l of Object.keys(s))if(f===l.toLowerCase())return!0;return!1};var er=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!pg(r);var of=function(){function r(){this.crc32c=new xf}return r.prototype.update=function(s){if(Wr(s))return;this.crc32c.update(Kr(s))},r.prototype.digest=function(){return Is(this,void 0,void 0,function(){return ds(this,function(s){return[2,Vr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new xf},r}();var xf=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var f,l;try{for(var h=Es(s),m=h.next();!m.done;m=h.next()){var g=m.value;this.checksum=this.checksum>>>8^B3[(this.checksum^g)&255]}}catch(w){f={error:w}}finally{try{if(m&&!m.done&&(l=h.return))l.call(h)}finally{if(f)throw f.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var Y3=[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],B3=Zr(Y3);var zs=(r,s)=>({[M.MD5]:s.md5,[M.CRC32]:Yf,[M.CRC32C]:of,[M.SHA1]:s.sha1,[M.SHA256]:s.sha256})[r];var Cs=(r,s)=>{const f=new r;return f.update(es(s||"")),f.digest()};var ug={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},tg=(r,s)=>(f,l)=>async(h)=>{if(!X.isInstance(h.request))return f(h);const{request:m}=h,{body:g,headers:w}=m,{base64Encoder:a,streamHasher:P}=r,{input:e,requestChecksumRequired:$,requestAlgorithmMember:N}=s,H=og(e,{requestChecksumRequired:$,requestAlgorithmMember:N},!!l.isS3ExpressBucket);let y=g,Y=w;if(H){const q=Pr(H),Nr=zs(H,r);if(er(g)){const{getAwsChunkedEncodingStream:Ks,bodyLengthChecker:ww}=r;y=Ks(g,{base64Encoder:a,bodyLengthChecker:ww,checksumLocationName:q,checksumAlgorithmFn:Nr,streamHasher:P}),Y={...w,"content-encoding":w["content-encoding"]?`${w["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":w["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":q},delete Y["content-length"]}else if(!ng(q,w)){const Ks=await Cs(Nr,g);Y={...w,[q]:a(Ks)}}}return await f({...h,request:{...m,headers:Y,body:y}})};var Gs=(r=[])=>{const s=[];for(let f of xg){if(!r.includes(f)||!Lr.includes(f))continue;s.push(f)}return s};var rw=(r)=>{const s=r.lastIndexOf("-");if(s!==-1){const f=r.slice(s+1);if(!f.startsWith("0")){const l=parseInt(f,10);if(!isNaN(l)&&l>=1&&l<=1e4)return!0}}return!1};import{Transform as v3} from"stream";function nf(r){const s=new v3;return s.push(r),s.push(null),s}var sw=async(r,{streamHasher:s,checksumAlgorithmFn:f,base64Encoder:l})=>{const h=er(r)?s(f,r):Cs(f,r);return l(await h)};var fw=async(r,{config:s,responseAlgorithms:f})=>{const l=Gs(f),{body:h,headers:m}=r;for(let g of l){const w=Pr(g),a=m[w];if(a){const P=zs(g,s),{streamHasher:e,base64Encoder:$}=s,N=await sw(h,{streamHasher:e,checksumAlgorithmFn:P,base64Encoder:$});if(N===a)break;throw new Error(`Checksum mismatch: expected "${N}" but received "${a}"`+` in response header "${w}".`)}}};var lw={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},hw=(r,s)=>(f,l)=>async(h)=>{if(!X.isInstance(h.request))return f(h);const m=h.input,g=await f(h),w=g.response;let a=void 0;const{requestValidationModeMember:P,responseAlgorithms:e}=s;if(P&&m[P]==="ENABLED"){const{clientName:$,commandName:N}=l;if($==="S3Client"&&N==="GetObjectCommand"&&Gs(e).every((Y)=>{const Jr=Pr(Y),q=w.headers[Jr];return!q||rw(q)}))return g;const y=er(w.body);if(y)a=await r.streamCollector(w.body),w.body=nf(a);if(await fw(g.response,{config:r,responseAlgorithms:e}),y&&a)w.body=nf(a)}return g};var Fs=(r,s)=>({applyToStack:(f)=>{f.add(tg(r,s),ug),f.addRelativeTo(hw(r,s),lw)}});class pf extends Ar.classBuilder().ep({...wr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,f,l){return[kr(f,this.serialize,this.deserialize),Ir(f,r.getEndpointParameterInstructions()),Fs(f,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),Ts(f),gl(f)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(Qh,yh).ser(rm).de(lm).build(){}class uf extends Ar.classBuilder().ep({...wr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,f,l){return[kr(f,this.serialize,this.deserialize),Ir(f,r.getEndpointParameterInstructions()),Fs(f,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),fl(f),Br(f),Ts(f)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(vh,Bh).ser(sm).de(hm).build(){}var gw=J(O3(),1);import{Buffer as tf} from"buffer";var mw=new bf;class Xr{static folder(r){if(!r||r.includes("null")||r.includes("undefined"))throw new Error("Folder path has to be specified.");return{put:async(s)=>{let f;if(s instanceof Blob)return f=`${rl()}.${s.type.split("/")[1]}`,Xr.put({body:s,name:`${r}/${f}`});return Xr.put({...s,name:`${r}/${f}`})},fetch:async(s)=>{let f=process.env.BUCKET_NAME,l;if(typeof s==="string")l=s;else f=s.bucket??f,l=s.name;if(!l)throw new Error("Object name has to be specified");return Xr.fetch({...s,name:`${r}/${l}`})}}}static async put(r){let s,f,l,h=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,l=`${rl()}.${r.type.split("/")[1]}`,f=r.type;else s=r.body,l=r.name,f=r.contentType;f=s instanceof Blob||s instanceof File?s.type:void 0;const m=s instanceof tf?s:tf.from(await s.arrayBuffer());return await mw.send(new uf({Bucket:h,Key:l,Body:m,ContentType:f})),l}static async metadata(r){const s=tf.from(await r.arrayBuffer());try{return await gw.default(s).metadata()}catch{return{}}}static async fetch(r){let s=process.env.BUCKET_NAME,f;if(typeof r==="string")f=r;else s=r.bucket??s,f=r.name;if(!f)throw new Error("Object name has to be specified");const l=await mw.send(new pf({Bucket:s,Key:f}));return new Response(l.Body.transformToWebStream(),{headers:{"Content-Type":l.ContentType,"Content-Length":l.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":l.LastModified?.toUTCString()||"",ETag:l.ETag||""}})}static delete(){}}export{Xr as Storage};
2
+ import"../chunk-68af0a6f6be163ce.js";import{y as J} from"../chunk-7ce930fe69575c87.js";import{A as Gg,B as Fg,C as X,D as yr,E as Hr,F as Qg,G as pg,J as rg,K as sg,L as es,M as fg,N as lg,O as hg,Q as ag,R as Sg,S as _m,T as mg,U as $l,V as Ml,W as xh,X as Ar,Y as v,_ as gs,ba as ar,ca as oh,da as Sr,ea as nh,fa as ms,ga as zr,ia as Uf,ja as $r,ka as Jh,la as O,ma as ph,na as Rg,oa as Ag,pa as Kg,qa as Wg,sa as C,ua as uh} from"../chunk-c85fc7168a708cb6.js";import{wa as O3} from"../chunk-f08ca4bd263b132b.js";import{$a as jg,Aa as yg,Ba as $w,Ca as n,Da as p,Ea as Zs,Fa as Ur,Ga as Gh,Ha as Yg,Ia as Th,Ja as zh,Ka as Ch,La as Bg,Ma as kg,Na as Ig,Oa as dg,Pa as Eg,Qa as vg,Ra as Og,Sa as Fh,Ta as kr,Ua as Ir,Va as qg,Wa as Pg,Xa as rl,Ya as eg,Za as _g,_a as Ng,ab as $3,bb as xr,cb as $g,db as Ms,eb as Mg,fb as Ug,gb as Vg,hb as Zg,xa as Xg,ya as Jg,za as Hg} from"../chunk-3567e8e424a60c99.js";import{ib as Mw} from"../chunk-09dd89e1046786a5.js";import{jb as c,kb as gg} from"../chunk-d33a0e61ccf1bab5.js";import"../chunk-c72bfaa252a03f6f.js";import{mb as Dg} from"../chunk-a3f85d0d3261ae44.js";import"../chunk-ffe161a589b4c44b.js";function aw(r){return(s)=>async(f)=>{const{request:l}=f;if(X.isInstance(l)&&l.body&&r.runtime==="node"){if(r.requestHandler?.constructor?.name!=="FetchHttpHandler")l.headers={...l.headers,Expect:"100-continue"}}return s({...f,request:l})}}var Sw={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},sl=(r)=>({applyToStack:(s)=>{s.add(aw(r),Sw)}});function Aw(){return(r,s)=>async(f)=>{const{request:l}=f;if(X.isInstance(l)){if(!(Rw in l.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof Hr))s.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.");else console.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.")}return r({...f})}}var Rw="content-length",kw={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},fl=(r)=>({applyToStack:(s)=>{s.add(Aw(),kw)}});var ll=(r)=>{return(s,f)=>async(l)=>{const h=await r.region(),m=r.region;let g=()=>{};if(f.__s3RegionRedirect)Object.defineProperty(r,"region",{writable:!1,value:async()=>{return f.__s3RegionRedirect}}),g=()=>Object.defineProperty(r,"region",{writable:!0,value:m});try{const w=await s(l);if(f.__s3RegionRedirect){g();const a=await r.region();if(h!==a)throw new Error("Region was not restored following S3 region redirect.")}return w}catch(w){throw g(),w}}},hl={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function Iw(r){return(s,f)=>async(l)=>{try{return await s(l)}catch(h){if(r.followRegionRedirects&&h?.$metadata?.httpStatusCode===301){try{const m=h.$response.headers["x-amz-bucket-region"];f.logger?.debug(`Redirecting from ${await r.region()} to ${m}`),f.__s3RegionRedirect=m}catch(m){throw new Error("Region redirect failed: "+m)}return s(l)}else throw h}}}var dw={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},ml=(r)=>({applyToStack:(s)=>{s.add(Iw(r),dw),s.addRelativeTo(ll(r),hl)}});var Ew=(r)=>{return(s,f)=>async(l)=>{const h=await s(l),{response:m}=h;if(yr.isInstance(m)){if(m.headers.expires){m.headers.expiresstring=m.headers.expires;try{$r(m.headers.expires)}catch(g){f.logger?.warn(`AWS SDK Warning for ${f.clientName}::${f.commandName} response parsing (${m.headers.expires}): ${g}`),delete m.headers.expires}}}return h}},Pw={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},gl=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Ew(r),Pw)}});class sr{constructor(r={}){this.data=r,this.lastPurgeTime=Date.now()}get(r){const s=this.data[r];if(!s)return;return s}set(r,s){return this.data[r]=s,s}delete(r){delete this.data[r]}async purgeExpired(){const r=Date.now();if(this.lastPurgeTime+sr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>r)return;for(let s in this.data){const f=this.data[s];if(!f.isRefreshing){const l=await f.identity;if(l.expiration){if(l.expiration.getTime()<r)delete this.data[s]}}}}}sr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class fr{constructor(r,s=!1,f=Date.now()){this._identity=r,this.isRefreshing=s,this.accessed=f}get identity(){return this.accessed=Date.now(),this._identity}}class lr{constructor(r,s=new sr){this.createSessionFn=r,this.cache=s}async getS3ExpressIdentity(r,s){const f=s.Bucket,{cache:l}=this,h=l.get(f);if(h)return h.identity.then((m)=>{if((m.expiration?.getTime()??0)<Date.now())return l.set(f,new fr(this.getIdentity(f))).identity;if((m.expiration?.getTime()??0)<Date.now()+lr.REFRESH_WINDOW_MS&&!h.isRefreshing)h.isRefreshing=!0,this.getIdentity(f).then((a)=>{l.set(f,new fr(Promise.resolve(a)))});return m});return l.set(f,new fr(this.getIdentity(f))).identity}async getIdentity(r){await this.cache.purgeExpired().catch((l)=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+l)});const s=await this.createSessionFn(r);if(!s.Credentials?.AccessKeyId||!s.Credentials?.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}}}lr.REFRESH_WINDOW_MS=60000;var kl=J($w(),1);var wl="Directory",al="S3Express",Sl="sigv4-s3express",Qr="X-Amz-S3session-Token",Mr=Qr.toLowerCase(),ew="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",Nw="s3_disable_express_session_auth",Ws={environmentVariableSelector:(r)=>n(r,ew,p.ENV),configFileSelector:(r)=>n(r,Nw,p.CONFIG),default:!1};var Rl=function(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}},Al=function(r,s){const f=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),l=r.credentialProvider,h=()=>{return clearTimeout(f),r.credentialProvider=l,Promise.resolve(s)};r.credentialProvider=h};class Yr extends kl.SignatureV4{async signWithCredentials(r,s,f){const l=Rl(s);r.headers[Mr]=s.sessionToken;const h=this;return Al(h,l),h.signRequest(r,f??{})}async presignWithCredentials(r,s,f){const l=Rl(s);return delete r.headers[Mr],r.headers[Qr]=s.sessionToken,r.query=r.query??{},r.query[Qr]=s.sessionToken,Al(this,l),this.presign(r,f)}}var Il=(r)=>{return(s,f)=>async(l)=>{if(f.endpointV2){const h=f.endpointV2,m=h.properties?.authSchemes?.[0]?.name===Sl;if(h.properties?.backend===al||h.properties?.bucketType===wl)f.isS3ExpressBucket=!0;if(m){const w=l.input.Bucket;if(w){const a=await r.s3ExpressIdentityProvider.getS3ExpressIdentity(await r.credentials(),{Bucket:w});if(f.s3ExpressIdentity=a,X.isInstance(l.request)&&a.sessionToken)l.request.headers[Mr]=a.sessionToken}}}return s(l)}},dl={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},Vs=(r)=>({applyToStack:(s)=>{s.add(Il(r),dl)}});var Pl=J(Zs(),1);var Uw=J(Mw(),1);var El=async(r,s,f,l)=>{const h=await l.signWithCredentials(f,r,{});if(h.headers["X-Amz-Security-Token"]||h.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return h};var Dw=(r)=>(s)=>{throw s},Tw=(r,s)=>{};var el=(r)=>(s,f)=>async(l)=>{if(!X.isInstance(l.request))return s(l);const m=Ur(f).selectedHttpAuthScheme;if(!m)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:g={}},identity:w,signer:a}=m;let P;if(f.s3ExpressIdentity)P=await El(f.s3ExpressIdentity,g,l.request,await r.signer());else P=await a.sign(l.request,w,g);const e=await s({...l,request:P}).catch((a.errorHandler||Dw)(g));return(a.successHandler||Tw)(e.response,g),e},Ls=(r)=>({applyToStack:(s)=>{s.addRelativeTo(el(r),Pl.httpSigningMiddlewareOptions)}});var Nl=(r,{session:s})=>{const[f,l]=s;return{...r,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,followRegionRedirects:r.followRegionRedirects??!1,s3ExpressIdentityProvider:r.s3ExpressIdentityProvider??new lr(async(h)=>f().send(new l({Bucket:h,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var zw={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Cw=3000,Gw=(r)=>(s,f)=>async(l)=>{const h=await s(l),{response:m}=h;if(!yr.isInstance(m))return h;const{statusCode:g,body:w}=m;if(g<200||g>=300)return h;let a=w,P=w;if(w&&typeof w==="object"&&!(w instanceof Uint8Array))[a,P]=await $l(w);m.body=P;const e=await Fw(a,{streamCollector:async(N)=>{return Ml(N,Cw)}});if(typeof a?.destroy==="function")a.destroy();const $=r.utf8Encoder(e.subarray(e.length-16));if(e.length===0&&zw[f.commandName]){const N=new Error("S3 aborted request");throw N.name="InternalError",N}if($&&$.endsWith("</Error>"))m.statusCode=400;return h},Fw=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},Kw={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},Br=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Gw(r),Kw)}});var Xs=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function Ul(r){return(s,f)=>async(l)=>{if(r.bucketEndpoint){const h=f.endpointV2;if(h){const m=l.input.Bucket;if(typeof m==="string")try{const g=new URL(m);h.url=g}catch(g){const w=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${m} could not be parsed as URL.`;if(f.logger?.constructor?.name==="NoOpLogger")console.warn(w);else f.logger?.warn?.(w);throw g}}}return s(l)}}var Dl={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Ww({bucketEndpoint:r}){return(s)=>async(f)=>{const{input:{Bucket:l}}=f;if(!r&&typeof l==="string"&&!Xs(l)&&l.indexOf("/")>=0){const h=new Error(`Bucket name shouldn't contain '/', received '${l}'`);throw h.name="InvalidBucketName",h}return s({...f})}}var Vw={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},Tl=(r)=>({applyToStack:(s)=>{s.add(Ww(r),Vw),s.addRelativeTo(Ul(r),Dl)}});var Er=J(Zs(),1);var zl=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var or=J(xr(),1);var vr={CrtSignerV4:null};class Js{constructor(r){this.sigv4Signer=new Yr(r),this.signerOptions=r}async sign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().sign(r,s)}return this.sigv4Signer.sign(r,s)}async signWithCredentials(r,s,f={}){if(f.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().signWithCredentials(r,s,f)}return this.sigv4Signer.signWithCredentials(r,s,f)}async presign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().presign(r,s)}return this.sigv4Signer.presign(r,s)}async presignWithCredentials(r,s,f={}){if(f.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(r,s,f)}getSigv4aSigner(){if(!this.sigv4aSigner){let r=null;try{if(r=vr.CrtSignerV4,typeof r!=="function")throw new Error}catch(s){throw s.message=`${s.message}\n`+'Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. \nYou 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";]. \nFor more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt',s}this.sigv4aSigner=new r({...this.signerOptions,signingAlgorithm:1})}return this.sigv4aSigner}}var hr={["required"]:!1,["type"]:"String"},mr={["required"]:!0,default:!1,["type"]:"Boolean"},Dr={["required"]:!1,["type"]:"Boolean"},B={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},E={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},d={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},D={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},Eh={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},Cl={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},cr={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},V={["ref"]:"Bucket"},W={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},jr={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},Ph={["ref"]:"url"},eh={["fn"]:"uriEncode",["argv"]:[V],["assign"]:"uri_encoded_bucket"},_={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},S={},Nh={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[V,!1]},Hs={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},br={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},Gl={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},Fl={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},R={["fn"]:"not",["argv"]:[D]},Kl={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},Wl={["fn"]:"not",["argv"]:[cr]},Vl={["ref"]:"hardwareType"},Zl={["conditions"]:[R],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},Or={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},ys={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},Zw={["ref"]:"ForcePathStyle"},U={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},z={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},G={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},I={["fn"]:"not",["argv"]:[z]},F={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},Ll={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},T={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},K={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},k={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},Xl={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},A={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},Jl={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},Hl={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},Qs={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Ph,"isIp"]},!1]},Ys={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:T,["headers"]:{}},hf={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:T,["headers"]:{}},yl={["endpoint"]:hf,["type"]:"endpoint"},Bs={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},Ql={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},qr={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},L={["ref"]:"bucketArn"},$h={["ref"]:"arnType"},vs={["fn"]:"getAttr",["argv"]:[L,"service"]},mf={["ref"]:"accessPointName"},Yl={["conditions"]:[d],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},Bl={["conditions"]:[B],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},vl={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},Os={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},Mh={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},Uh={["fn"]:"getAttr",["argv"]:[L,"accountId"]},qs={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},Ol={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},_s={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},js={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},cs={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},ql={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},_l={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Tr={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},jl={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},cl={["fn"]:"aws.parseArn",["argv"]:[V]},bl={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},il={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},xl={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},bs={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},ol={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:{}},nl={["ref"]:"UseObjectLambdaEndpoint"},is={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},pl={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},ul={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},tl={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},xs={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:T,["headers"]:{}},rh={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:{}},os=[{["ref"]:"Region"}],Lw=[{["ref"]:"Endpoint"}],Xw=[V],ns=[d],_r=[B],u=[D,W],sh=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],fh=[jr],ps=[eh],us=[Nh],gr=[E],lh=[{["fn"]:"substring",["argv"]:[V,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[V,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],hh=[{["conditions"]:[E],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:_,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:_,["headers"]:{}},["type"]:"endpoint"}],mh=[{["fn"]:"substring",["argv"]:[V,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[V,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],gh=[{["conditions"]:[E],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:br,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:br,["headers"]:{}},["type"]:"endpoint"}],Jw=[cr],wh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],ah=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],Hw=["*"],b=[Eh],Sh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],i=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],ts=[{["fn"]:"stringEquals",["argv"]:[$h,"accesspoint"]}],Rh=[{["fn"]:"getAttr",["argv"]:[L,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[mf,""]}]}],yw=[L,"resourceId[1]"],rf=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"region"]},""]}]}],Ah=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"resourceId[2]"]}]}]}],Qw=[L,"resourceId[2]"],sf=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"region"]}],["assign"]:"bucketPartition"}],kh=[{["fn"]:"stringEquals",["argv"]:[Mh,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],ff=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"region"]},!0]}],lf=[{["fn"]:"isValidHostLabel",["argv"]:[Uh,!1]}],Ih=[{["fn"]:"isValidHostLabel",["argv"]:[mf,!1]}],dh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],Yw={version:"1.0",parameters:{Bucket:hr,Region:hr,UseFIPS:mr,UseDualStack:mr,Endpoint:hr,ForcePathStyle:mr,Accelerate:mr,UseGlobalEndpoint:mr,UseObjectLambdaEndpoint:Dr,Key:hr,Prefix:hr,CopySource:hr,DisableAccessPoints:Dr,DisableMultiRegionAccessPoints:mr,UseArnRegion:Dr,UseS3ExpressControlEndpoint:Dr,DisableS3ExpressSessionAuth:Dr},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:os}],rules:[{["conditions"]:[B,E],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[d,D],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[D,E],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[D,B],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[E,Eh,Cl],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[cr,{["fn"]:"substring",["argv"]:[V,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:ns,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:_r,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:u,rules:[{["conditions"]:sh,rules:[{["conditions"]:fh,rules:[{["conditions"]:ps,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:_,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:us,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:_,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},Hs],["type"]:"tree"},{["conditions"]:fh,rules:[{["conditions"]:ps,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:br,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:us,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:br,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},Hs],["type"]:"tree"},{["conditions"]:[Gl,Fl],rules:[{["conditions"]:[eh,R],rules:[{["conditions"]:gr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:_,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:_,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:us,rules:[{["conditions"]:sh,rules:[{["conditions"]:lh,rules:hh,["type"]:"tree"},{["conditions"]:mh,rules:hh,["type"]:"tree"},Kl],["type"]:"tree"},{["conditions"]:lh,rules:gh,["type"]:"tree"},{["conditions"]:mh,rules:gh,["type"]:"tree"},Kl],["type"]:"tree"},Hs],["type"]:"tree"},{["conditions"]:[Wl,Gl,Fl],rules:[{["conditions"]:u,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:_,["headers"]:S},["type"]:"endpoint"},{["conditions"]:gr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com",["properties"]:_,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com",["properties"]:_,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[cr,{["fn"]:"substring",["argv"]:[V,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[V,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:[V,0,7,!0],["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[V,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:os,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:wh,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Vl,"e"]}],rules:[{["conditions"]:ah,rules:[Zl,{["conditions"]:u,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:Or,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Or,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Vl,"o"]}],rules:[{["conditions"]:ah,rules:[Zl,{["conditions"]:u,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:Or,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Or,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{error:"Unrecognized hardware type: \"Expected hardware type o or e but got {hardwareType}\"",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",["type"]:"error"}],["type"]:"tree"},{["conditions"]:Jw,rules:[{["conditions"]:[D,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:Lw}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[ys,Nh],rules:[{["conditions"]:b,rules:[{["conditions"]:Sh,rules:[{["conditions"]:[B,Cl],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[d,E,U,R,z],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[d,E,U,R,I,F],rules:[{endpoint:Ll,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[d,E,U,R,I,K],endpoint:Ll,["type"]:"endpoint"},{["conditions"]:[k,E,U,R,z],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[k,E,U,R,I,F],rules:[{endpoint:Xl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,E,U,R,I,K],endpoint:Xl,["type"]:"endpoint"},{["conditions"]:[d,A,B,R,z],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[d,A,B,R,I,F],rules:[{endpoint:Jl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[d,A,B,R,I,K],endpoint:Jl,["type"]:"endpoint"},{["conditions"]:[d,A,U,R,z],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[d,A,U,R,I,F],rules:[{endpoint:Hl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[d,A,U,R,I,K],endpoint:Hl,["type"]:"endpoint"},{["conditions"]:[k,A,U,D,W,jr,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[k,A,U,D,W,Qs,z],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[k,A,U,D,W,jr,I,F],rules:[{["conditions"]:i,endpoint:Ys,["type"]:"endpoint"},{endpoint:Ys,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,A,U,D,W,Qs,I,F],rules:[{["conditions"]:i,endpoint:hf,["type"]:"endpoint"},yl],["type"]:"tree"},{["conditions"]:[k,A,U,D,W,jr,I,K],endpoint:Ys,["type"]:"endpoint"},{["conditions"]:[k,A,U,D,W,Qs,I,K],endpoint:hf,["type"]:"endpoint"},{["conditions"]:[k,A,B,R,z],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[k,A,B,R,I,F],rules:[{["conditions"]:i,endpoint:Bs,["type"]:"endpoint"},{endpoint:Bs,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,A,B,R,I,K],endpoint:Bs,["type"]:"endpoint"},{["conditions"]:[k,A,U,R,z],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[k,A,U,R,I,F],rules:[{["conditions"]:i,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:S},["type"]:"endpoint"},{endpoint:Ql,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,A,U,R,I,K],endpoint:Ql,["type"]:"endpoint"}],["type"]:"tree"},qr],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[D,W,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Ph,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[V,!0]},ys,A,k,U],rules:[{["conditions"]:b,rules:[{["conditions"]:Sh,rules:[yl],["type"]:"tree"},qr],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[ys,{["fn"]:"aws.parseArn",["argv"]:Xw,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[L,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[$h,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[vs,"s3-object-lambda"]}],rules:[{["conditions"]:ts,rules:[{["conditions"]:Rh,rules:[Yl,Bl,{["conditions"]:rf,rules:[vl,{["conditions"]:Ah,rules:[Os,{["conditions"]:sf,rules:[{["conditions"]:b,rules:[{["conditions"]:kh,rules:[{["conditions"]:ff,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Uh,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:lf,rules:[{["conditions"]:Ih,rules:[{["conditions"]:u,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:qs,["headers"]:S},["type"]:"endpoint"},{["conditions"]:gr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:qs,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:qs,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},Ol],["type"]:"tree"},_s],["type"]:"tree"},js],["type"]:"tree"},cs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},ql],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},_l],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:ts,rules:[{["conditions"]:Rh,rules:[{["conditions"]:rf,rules:[{["conditions"]:ts,rules:[{["conditions"]:rf,rules:[vl,{["conditions"]:Ah,rules:[Os,{["conditions"]:sf,rules:[{["conditions"]:b,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Mh,"{partitionResult#name}"]}],rules:[{["conditions"]:ff,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[vs,"s3"]}],rules:[{["conditions"]:lf,rules:[{["conditions"]:Ih,rules:[{["conditions"]:_r,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:[E,d],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Tr,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[E,k],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Tr,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,d],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Tr,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,k,D,W],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Tr,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,k],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Tr,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},Ol],["type"]:"tree"},_s],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},js],["type"]:"tree"},cs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},ql],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[mf,!0]}],rules:[{["conditions"]:ns,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:gr,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:_r,error:"S3 MRAP does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableMultiRegionAccessPoints"},!0]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",["type"]:"error"},{["conditions"]:[{["fn"]:"aws.partition",["argv"]:os,["assign"]:"mrapPartition"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[L,"partition"]}]}],rules:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:Hw}]},["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Access Point Name",["type"]:"error"}],["type"]:"tree"},_l],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[vs,"s3-outposts"]}],rules:[{["conditions"]:ns,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:gr,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:_r,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[L,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:yw,["assign"]:"outpostId"}],rules:[{["conditions"]:wh,rules:[Os,{["conditions"]:sf,rules:[{["conditions"]:b,rules:[{["conditions"]:kh,rules:[{["conditions"]:ff,rules:[{["conditions"]:lf,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:Qw,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[L,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:u,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:jl,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:jl,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},{error:"Expected an outpost type `accesspoint`, found {outpostType}",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: expected an access point name",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Expected a 4-component resource",["type"]:"error"}],["type"]:"tree"},_s],["type"]:"tree"},js],["type"]:"tree"},cs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The Outpost Id was not set",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: No ARN type specified",["type"]:"error"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"substring",["argv"]:[V,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[cl]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[Zw,!0]},cl],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:ps,rules:[{["conditions"]:b,rules:[{["conditions"]:[U],rules:[{["conditions"]:[d,R,E,z],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[d,R,E,I,F],rules:[{endpoint:bl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[d,R,E,I,K],endpoint:bl,["type"]:"endpoint"},{["conditions"]:[k,R,E,z],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[k,R,E,I,F],rules:[{endpoint:il,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,R,E,I,K],endpoint:il,["type"]:"endpoint"},{["conditions"]:[d,R,A,z],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[d,R,A,I,F],rules:[{endpoint:xl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[d,R,A,I,K],endpoint:xl,["type"]:"endpoint"},{["conditions"]:[k,D,W,A,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[k,D,W,A,I,F],rules:[{["conditions"]:i,endpoint:bs,["type"]:"endpoint"},{endpoint:bs,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,D,W,A,I,K],endpoint:bs,["type"]:"endpoint"},{["conditions"]:[k,R,A,z],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[k,R,A,I,F],rules:[{["conditions"]:i,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:T,["headers"]:S},["type"]:"endpoint"},{endpoint:ol,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,R,A,I,K],endpoint:ol,["type"]:"endpoint"}],["type"]:"tree"},{error:"Path-style addressing cannot be used with S3 Accelerate",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[nl]},{["fn"]:"booleanEquals",["argv"]:[nl,!0]}],rules:[{["conditions"]:b,rules:[{["conditions"]:dh,rules:[Yl,Bl,{["conditions"]:u,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:is,["headers"]:S},["type"]:"endpoint"},{["conditions"]:gr,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:is,["headers"]:S},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:is,["headers"]:S},["type"]:"endpoint"}],["type"]:"tree"},qr],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Wl],rules:[{["conditions"]:b,rules:[{["conditions"]:dh,rules:[{["conditions"]:[E,d,R,z],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[E,d,R,I,F],rules:[{endpoint:pl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[E,d,R,I,K],endpoint:pl,["type"]:"endpoint"},{["conditions"]:[E,k,R,z],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[E,k,R,I,F],rules:[{endpoint:ul,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[E,k,R,I,K],endpoint:ul,["type"]:"endpoint"},{["conditions"]:[A,d,R,z],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,d,R,I,F],rules:[{endpoint:tl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,d,R,I,K],endpoint:tl,["type"]:"endpoint"},{["conditions"]:[A,k,D,W,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,k,D,W,I,F],rules:[{["conditions"]:i,endpoint:xs,["type"]:"endpoint"},{endpoint:xs,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,k,D,W,I,K],endpoint:xs,["type"]:"endpoint"},{["conditions"]:[A,k,R,z],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:S},["type"]:"endpoint"},{["conditions"]:[A,k,R,I,F],rules:[{["conditions"]:i,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:T,["headers"]:S},["type"]:"endpoint"},{endpoint:rh,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,k,R,I,K],endpoint:rh,["type"]:"endpoint"}],["type"]:"tree"},qr],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},Dh=Yw;var ir=(r,s={})=>{return zh(Dh,{endpointParams:r,logger:s.logger})};Th.aws=Ch;var Wh=function(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,f)=>({signingProperties:{config:s,context:f}})}},Vh=function(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,f)=>({signingProperties:{config:s,context:f}})}},Bw=(r)=>async(s,f,l)=>{if(!l)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const h=await r(s,f,l),m=Ur(f)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!m)throw new Error(`getEndpointParameterInstructions() is not defined on \`${f.commandName}\``);const g=await Fh(l,{getEndpointParameterInstructions:m},s);return Object.assign(h,g)},vw=async(r,s,f)=>{return{operation:Ur(s).operation,region:await Gh(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Kh=Bw(vw),Ow=(r,s,f)=>{return(h)=>{const g=r(h).properties?.authSchemes;if(!g)return s(h);const w=[];for(let a of g){const{name:P,properties:e={},...$}=a,N=P.toLowerCase();if(P!==N)console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${P}\` to \`${N}\``);let H;if(N==="sigv4a"){H="aws.auth#sigv4a";const Jr=g.find((q)=>{const Nr=q.name.toLowerCase();return Nr!=="sigv4a"&&Nr.startsWith("sigv4")});if(!vr.CrtSignerV4&&Jr)continue}else if(N.startsWith("sigv4"))H="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${N}\``);const y=f[H];if(!y)throw new Error(`Could not find HttpAuthOption create function for \`${H}\``);const Y=y(h);Y.schemeId=H,Y.signingProperties={...Y.signingProperties||{},...$,...e},w.push(Y)}return w}},qw=(r)=>{const s=[];switch(r.operation){default:s.push(Wh(r)),s.push(Vh(r))}return s},Zh=Ow(ir,qw,{"aws.auth#sigv4":Wh,"aws.auth#sigv4a":Vh}),Lh=(r)=>{const s=or.resolveAwsSdkSigV4Config(r);return{...or.resolveAwsSdkSigV4AConfig(s)}};var Xh=(r)=>{return{...r,useFipsEndpoint:r.useFipsEndpoint??!1,useDualstackEndpoint:r.useDualstackEndpoint??!1,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,useGlobalEndpoint:r.useGlobalEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,defaultSigningName:"s3"}},wr={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 Z extends Jh{constructor(r){super(r);Object.setPrototypeOf(this,Z.prototype)}}class nr extends Z{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,nr.prototype)}}class pr extends Z{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,pr.prototype)}}class ur extends Z{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,ur.prototype)}}class tr extends Z{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,tr.prototype)}}class rs extends Z{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,rs.prototype)}}var gf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(gf||(gf={}));var wf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.ObjectSizeGreaterThan!==void 0)return f.ObjectSizeGreaterThan(s.ObjectSizeGreaterThan);if(s.ObjectSizeLessThan!==void 0)return f.ObjectSizeLessThan(s.ObjectSizeLessThan);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(wf||(wf={}));var af;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.AccessPointArn!==void 0)return f.AccessPointArn(s.AccessPointArn);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(af||(af={}));var Sf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Sf||(Sf={}));class ss extends Z{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,ss.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class fs extends Z{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,fs.prototype)}}class ls extends Z{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,ls.prototype)}}var _w=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:v},...r.SessionToken&&{SessionToken:v}}),Hh=(r)=>({...r,...r.Credentials&&{Credentials:_w(r.Credentials)}});var yh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:v}}),Qh=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:v}});var Rr=J(xr(),1);var as=J(Zs(),1);class hs extends Z{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,hs.prototype)}}var Yh;(function(r){r.visit=(s,f)=>{if(s.Records!==void 0)return f.Records(s.Records);if(s.Stats!==void 0)return f.Stats(s.Stats);if(s.Progress!==void 0)return f.Progress(s.Progress);if(s.Cont!==void 0)return f.Cont(s.Cont);if(s.End!==void 0)return f.End(s.End);return f._(s.$unknown[0],s.$unknown[1])}})(Yh||(Yh={}));var Bh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:v},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:v}}),vh=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:v},...r.SSEKMSKeyId&&{SSEKMSKeyId:v},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:v}});var th=async(r,s)=>{const f=as.requestBuilder(r,s),l=C({},j,{[ua]:r[Wa]});f.bp("/"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const h=C({[xa]:[,""]});let m;return f.m("GET").h(l).q(h).b(m),f.build()};var rm=async(r,s)=>{const f=as.requestBuilder(r,s),l=C({},j,{[ya]:r[da],[Qa]:[()=>j(r[Oh]),()=>zr(r[Oh]).toString()],[Ya]:r[Ea],[Ba]:[()=>j(r[qh]),()=>zr(r[qh]).toString()],[Oa]:r[Ma],[As]:r[Ss],[Xm]:r[Pm],[ks]:r[Rs],[Vm]:r[Em],[Gm]:r[Rm],[pa]:r[ma]});f.bp("/{Key+}"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1),f.p("Key",()=>r.Key,"{Key+}",!0);const h=C({[ym]:[,"GetObject"],[qa]:[,r[Ua]],[_a]:[,r[Da]],[ja]:[,r[Ta]],[ca]:[,r[za]],[ba]:[,r[Ca]],[ia]:[()=>r.ResponseExpires!==void 0,()=>zr(r[Ga]).toString()],[oa]:[,r[Wf]],[va]:[()=>r.PartNumber!==void 0,()=>r[$a].toString()]});let m;return f.m("GET").h(l).q(h).b(m),f.build()};var sm=async(r,s)=>{const f=as.requestBuilder(r,s),l=C({},j,{[Tm]:r[Sm]||"application/octet-stream",[na]:r[fa],[$m]:r[mm],[Mm]:r[gm],[Um]:r[wm],[Dm]:r[am],[Nf]:[()=>j(r[Ef]),()=>r[Ef].toString()],[Xa]:r[ga],[m3]:r[ha],[Vf]:r[Tf],[Zf]:r[zf],[Lf]:r[Cf],[Xf]:r[Gf],[$f]:[()=>j(r[Pf]),()=>zr(r[Pf]).toString()],[ta]:r[Ra],[r3]:r[Aa],[s3]:r[ka],[f3]:r[Ia],[Jf]:r[Ff],[Zm]:r[Gr],[Hm]:r[Nm],[As]:r[Ss],[Xm]:r[Pm],[ks]:r[Rs],[Hf]:r[Kf],[Lm]:r[em],[Fr]:[()=>j(r[ws]),()=>r[ws].toString()],[Vm]:r[Em],[g3]:r[Va],[Km]:r[Im],[Mf]:[()=>j(r[ef]),()=>uh(r[ef]).toString()],[Fm]:r[km],[Gm]:r[Rm],...r.Metadata!==void 0&&Object.keys(r.Metadata).reduce((w,a)=>{return w[`x-amz-meta-${a.toLowerCase()}`]=r.Metadata[a],w},{})});f.bp("/{Key+}"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1),f.p("Key",()=>r.Key,"{Key+}",!0);const h=C({[ym]:[,"PutObject"]});let m,g;if(r.Body!==void 0)g=r.Body,m=g;return f.m("PUT").h(l).q(h).b(m),f.build()};var fm=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return Df(r,s);const f=C({$metadata:Q(r)}),l=ar(oh(await Rr.parseXmlBody(r.body,s)),"body");if(l[kf]!=null)f[kf]=sa(l[kf],s);return f};var lm=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return Df(r,s);const f=C({$metadata:Q(r),[aa]:[()=>r.headers[jh]!==void 0,()=>gs(r.headers[jh])],[la]:[,r.headers[La]],[Cr]:[,r.headers[Cm]],[Ka]:[,r.headers[l3]],[Pa]:[()=>r.headers[_h]!==void 0,()=>ar($r(r.headers[_h]))],[Ef]:[()=>r.headers[Nf]!==void 0,()=>nh(r.headers[Nf])],[Am]:[,r.headers[zm]],[Tf]:[,r.headers[Vf]],[zf]:[,r.headers[Zf]],[Cf]:[,r.headers[Lf]],[Gf]:[,r.headers[Xf]],[ea]:[()=>r.headers[ch]!==void 0,()=>ms(r.headers[ch])],[Wf]:[,r.headers[Jm]],[mm]:[,r.headers[$m]],[gm]:[,r.headers[Mm]],[wm]:[,r.headers[Um]],[am]:[,r.headers[Dm]],[wa]:[,r.headers[Ja]],[Sm]:[,r.headers[Tm]],[Pf]:[()=>r.headers[$f]!==void 0,()=>ar($r(r.headers[$f]))],[Sa]:[,r.headers[Ha]],[Nm]:[,r.headers[Hm]],[Ff]:[,r.headers[Jf]],[Ss]:[,r.headers[As]],[Rs]:[,r.headers[ks]],[Kf]:[,r.headers[Hf]],[ws]:[()=>r.headers[Fr]!==void 0,()=>gs(r.headers[Fr])],[Gr]:[,r.headers[Zm]],[dm]:[,r.headers[Wm]],[Fa]:[,r.headers[h3]],[Na]:[()=>r.headers[bh]!==void 0,()=>ms(r.headers[bh])],[Za]:[()=>r.headers[ih]!==void 0,()=>ms(r.headers[ih])],[Im]:[,r.headers[Km]],[ef]:[()=>r.headers[Mf]!==void 0,()=>ar(Uf(r.headers[Mf]))],[km]:[,r.headers[Fm]],Metadata:[,Object.keys(r.headers).filter((h)=>h.startsWith("x-amz-meta-")).reduce((h,m)=>{return h[m.substring(11)]=r.headers[m],h},{})]}),l=r.body;return s.sdkStreamMixin(l),f.Body=l,f};var hm=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return Df(r,s);const f=C({$metadata:Q(r),[Cr]:[,r.headers[Cm]],[Am]:[,r.headers[zm]],[Tf]:[,r.headers[Vf]],[zf]:[,r.headers[Zf]],[Cf]:[,r.headers[Lf]],[Gf]:[,r.headers[Xf]],[Ff]:[,r.headers[Jf]],[Wf]:[,r.headers[Jm]],[Ss]:[,r.headers[As]],[Rs]:[,r.headers[ks]],[Kf]:[,r.headers[Hf]],[em]:[,r.headers[Lm]],[ws]:[()=>r.headers[Fr]!==void 0,()=>gs(r.headers[Fr])],[dm]:[,r.headers[Wm]]});return await xh(r.body,s),f};var Df=async(r,s)=>{const f={...r,body:await Rr.parseXmlErrorBody(r.body,s)},l=Rr.loadRestXmlErrorCode(r,f.body);switch(l){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await pw(f,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await ra(f,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await bw(f,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await iw(f,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await ow(f,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await xw(f,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await nw(f,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await uw(f,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await tw(f,s);default:const h=f.body;return cw({output:r,parsedBody:h,errorCode:l})}},cw=ph(Z),bw=async(r,s)=>{const f=C({}),l=r.body,h=new ur({$metadata:Q(r),...f});return O(h,r.body)},iw=async(r,s)=>{const f=C({}),l=r.body,h=new tr({$metadata:Q(r),...f});return O(h,r.body)},xw=async(r,s)=>{const f=C({}),l=r.body;if(l[Af]!=null)f[Af]=Sr(l[Af]);if(l[Gr]!=null)f[Gr]=Sr(l[Gr]);const h=new ss({$metadata:Q(r),...f});return O(h,r.body)},ow=async(r,s)=>{const f=C({}),l=r.body,h=new rs({$metadata:Q(r),...f});return O(h,r.body)},nw=async(r,s)=>{const f=C({}),l=r.body,h=new fs({$metadata:Q(r),...f});return O(h,r.body)},pw=async(r,s)=>{const f=C({}),l=r.body,h=new nr({$metadata:Q(r),...f});return O(h,r.body)},uw=async(r,s)=>{const f=C({}),l=r.body,h=new ls({$metadata:Q(r),...f});return O(h,r.body)},tw=async(r,s)=>{const f=C({}),l=r.body,h=new hs({$metadata:Q(r),...f});return O(h,r.body)},ra=async(r,s)=>{const f=C({}),l=r.body,h=new pr({$metadata:Q(r),...f});return O(h,r.body)};var sa=(r,s)=>{const f={};if(r[Rf]!=null)f[Rf]=Sr(r[Rf]);if(r[If]!=null)f[If]=Sr(r[If]);if(r[df]!=null)f[df]=Sr(r[df]);if(r[Cr]!=null)f[Cr]=ar(Uf(r[Cr]));return f};var Q=(r)=>({httpStatusCode:r.statusCode,requestId:r.headers["x-amzn-requestid"]??r.headers["x-amzn-request-id"]??r.headers["x-amz-request-id"],extendedRequestId:r.headers["x-amz-id-2"],cfId:r.headers["x-amz-cf-id"]});var j=(r)=>r!==void 0&&r!==null&&r!==""&&(!Object.getOwnPropertyNames(r).includes("length")||r.length!=0)&&(!Object.getOwnPropertyNames(r).includes("size")||r.size!=0);var fa="ACL";var Rf="AccessKeyId";var la="AcceptRanges";var Af="AccessTier";var ws="BucketKeyEnabled";var kf="Credentials",ha="ChecksumAlgorithm";var mm="CacheControl",Tf="ChecksumCRC32",zf="ChecksumCRC32C",gm="ContentDisposition";var wm="ContentEncoding";var am="ContentLanguage",Ef="ContentLength",ma="ChecksumMode",ga="ContentMD5";var wa="ContentRange";var Cf="ChecksumSHA1",Gf="ChecksumSHA256";var Sm="ContentType";var aa="DeleteMarker";var Pf="Expires";var Rm="ExpectedBucketOwner";var Sa="ExpiresString";var Am="ETag";var Cr="Expiration";var Ra="GrantFullControl";var Aa="GrantRead",ka="GrantReadACP";var Ia="GrantWriteACP";var da="IfMatch",Oh="IfModifiedSince",Ea="IfNoneMatch";var qh="IfUnmodifiedSince";var Pa="LastModified";var ea="MissingMeta";var km="ObjectLockLegalHoldStatus",Im="ObjectLockMode";var ef="ObjectLockRetainUntilDate";var Na="PartsCount";var $a="PartNumber";var Ma="Range";var dm="RequestCharged",Ua="ResponseCacheControl",Da="ResponseContentDisposition",Ta="ResponseContentEncoding",za="ResponseContentLanguage",Ca="ResponseContentType";var Ga="ResponseExpires";var Em="RequestPayer";var Fa="ReplicationStatus";var Ka="Restore";var If="SecretAccessKey";var Gr="StorageClass";var Wa="SessionMode";var Ff="ServerSideEncryption";var Ss="SSECustomerAlgorithm",Pm="SSECustomerKey",Rs="SSECustomerKeyMD5";var em="SSEKMSEncryptionContext",Kf="SSEKMSKeyId";var df="SessionToken";var Va="Tagging";var Za="TagCount";var Wf="VersionId";var Nm="WebsiteRedirectLocation";var La="accept-ranges";var $m="cache-control",Mm="content-disposition",Um="content-encoding",Dm="content-language",Nf="content-length",Xa="content-md5",Ja="content-range",Tm="content-type";var $f="expires";var zm="etag",Ha="expiresstring";var ya="if-match",Qa="if-modified-since";var Ya="if-none-match";var Ba="if-unmodified-since";var _h="last-modified";var va="partNumber";var Oa="range",qa="response-cache-control",_a="response-content-disposition",ja="response-content-encoding",ca="response-content-language",ba="response-content-type",ia="response-expires";var xa="session";var oa="versionId";var na="x-amz-acl";var Vf="x-amz-checksum-crc32",Zf="x-amz-checksum-crc32c",pa="x-amz-checksum-mode";var Lf="x-amz-checksum-sha1",Xf="x-amz-checksum-sha256";var ua="x-amz-create-session-mode";var jh="x-amz-delete-marker",Cm="x-amz-expiration",Gm="x-amz-expected-bucket-owner";var ta="x-amz-grant-full-control",r3="x-amz-grant-read",s3="x-amz-grant-read-acp";var f3="x-amz-grant-write-acp";var ch="x-amz-missing-meta";var bh="x-amz-mp-parts-count";var Fm="x-amz-object-lock-legal-hold",Km="x-amz-object-lock-mode",Mf="x-amz-object-lock-retain-until-date";var l3="x-amz-restore",Wm="x-amz-request-charged";var Vm="x-amz-request-payer";var h3="x-amz-replication-status";var Zm="x-amz-storage-class",m3="x-amz-sdk-checksum-algorithm";var Jf="x-amz-server-side-encryption",Hf="x-amz-server-side-encryption-aws-kms-key-id",Fr="x-amz-server-side-encryption-bucket-key-enabled",Lm="x-amz-server-side-encryption-context",As="x-amz-server-side-encryption-customer-algorithm",Xm="x-amz-server-side-encryption-customer-key",ks="x-amz-server-side-encryption-customer-key-md5",g3="x-amz-tagging",ih="x-amz-tagging-count";var Jm="x-amz-version-id",Hm="x-amz-website-redirect-location",ym="x-id";class yf extends Ar.classBuilder().ep({...wr,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,f,l){return[kr(f,this.serialize,this.deserialize),Ir(f,r.getEndpointParameterInstructions()),Br(f)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(void 0,Hh).ser(th).de(fm).build(){}var Qm={name:"@aws-sdk/client-s3",description:"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",version:"3.629.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3",test:"yarn test:unit","test:e2e":"yarn test:e2e:node && yarn test:e2e:browser","test:e2e:browser":"ts-mocha test/**/*.browser.ispec.ts && karma start karma.conf.js","test:e2e:node":"jest --c jest.config.e2e.js","test:unit":"ts-mocha test/unit/**/*.spec.ts"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha1-browser":"5.2.0","@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.629.0","@aws-sdk/client-sts":"3.629.0","@aws-sdk/core":"3.629.0","@aws-sdk/credential-provider-node":"3.629.0","@aws-sdk/middleware-bucket-endpoint":"3.620.0","@aws-sdk/middleware-expect-continue":"3.620.0","@aws-sdk/middleware-flexible-checksums":"3.620.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-location-constraint":"3.609.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-sdk-s3":"3.629.0","@aws-sdk/middleware-ssec":"3.609.0","@aws-sdk/middleware-user-agent":"3.620.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/signature-v4-multi-region":"3.629.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.614.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@aws-sdk/xml-builder":"3.609.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.3.2","@smithy/eventstream-serde-browser":"^3.0.6","@smithy/eventstream-serde-config-resolver":"^3.0.3","@smithy/eventstream-serde-node":"^3.0.5","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-blob-browser":"^3.1.2","@smithy/hash-node":"^3.0.3","@smithy/hash-stream-node":"^3.1.2","@smithy/invalid-dependency":"^3.0.3","@smithy/md5-js":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.14","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.1.12","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.14","@smithy/util-defaults-mode-node":"^3.0.14","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-stream":"^3.1.3","@smithy/util-utf8":"^3.0.0","@smithy/util-waiter":"^3.1.2",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/signature-v4-crt":"3.629.0","@tsconfig/node16":"16.1.3","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-s3"}};var Us=J(xr(),1);var a3="AWS_S3_USE_ARN_REGION",S3="s3_use_arn_region",Ym={environmentVariableSelector:(r)=>n(r,a3,p.ENV),configFileSelector:(r)=>n(r,S3,p.CONFIG),default:!1};var Bm=J($3(),1),{__extends:KA,__assign:WA,__rest:VA,__decorate:ZA,__param:LA,__esDecorate:XA,__runInitializers:JA,__propKey:HA,__setFunctionName:yA,__metadata:QA,__awaiter:Is,__generator:ds,__exportStar:YA,__createBinding:BA,__values:Es,__read:vA,__spread:OA,__spreadArrays:qA,__spreadArray:_A,__await:jA,__asyncGenerator:cA,__asyncDelegator:bA,__asyncValues:iA,__makeTemplateObject:xA,__importStar:oA,__importDefault:nA,__classPrivateFieldGet:pA,__classPrivateFieldSet:uA,__classPrivateFieldIn:tA,__addDisposableResource:rk,__disposeResources:sk}=Bm.default;import{Buffer as vm} from"buffer";var Om=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?vm.from(r,s):vm.from(r)};var Qf=(r)=>{const s=Om(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function Kr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return M3(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var M3=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:Qf;function Wr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function Vr(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}function Zr(r){if(!Uint32Array.from){var s=new Uint32Array(r.length),f=0;while(f<r.length)s[f]=r[f],f+=1;return s}return Uint32Array.from(r)}var Yf=function(){function r(){this.crc32=new t}return r.prototype.update=function(s){if(Wr(s))return;this.crc32.update(Kr(s))},r.prototype.digest=function(){return Is(this,void 0,void 0,function(){return ds(this,function(s){return[2,Vr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new t},r}();var t=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var f,l;try{for(var h=Es(s),m=h.next();!m.done;m=h.next()){var g=m.value;this.checksum=this.checksum>>>8^D3[(this.checksum^g)&255]}}catch(w){f={error:w}}finally{try{if(m&&!m.done&&(l=h.return))l.call(h)}finally{if(f)throw f.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var U3=[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,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],D3=Zr(U3);var x=J(_m(),1);var jm=J(_m(),1),qm=function(r){for(let s=0;s<8;s++)r[s]^=255;for(let s=7;s>-1;s--)if(r[s]++,r[s]!==0)break};class dr{constructor(r){if(this.bytes=r,r.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(r){if(r>9223372036854776000||r<-9223372036854776000)throw new Error(`${r} is too large (or, if negative, too small) to represent as an Int64`);const s=new Uint8Array(8);for(let f=7,l=Math.abs(Math.round(r));f>-1&&l>0;f--,l/=256)s[f]=l;if(r<0)qm(s);return new dr(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)qm(r);return parseInt(jm.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class Bf{constructor(r,s){this.toUtf8=r,this.fromUtf8=s}format(r){const s=[];for(let h of Object.keys(r)){const m=this.fromUtf8(h);s.push(Uint8Array.from([m.byteLength]),m,this.formatHeaderValue(r[h]))}const f=new Uint8Array(s.reduce((h,m)=>h+m.byteLength,0));let l=0;for(let h of s)f.set(h,l),l+=h.byteLength;return f}formatHeaderValue(r){switch(r.type){case"boolean":return Uint8Array.from([r.value?0:1]);case"byte":return Uint8Array.from([2,r.value]);case"short":const s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,r.value,!1),new Uint8Array(s.buffer);case"integer":const f=new DataView(new ArrayBuffer(5));return f.setUint8(0,4),f.setInt32(1,r.value,!1),new Uint8Array(f.buffer);case"long":const l=new Uint8Array(9);return l[0]=5,l.set(r.value.bytes,1),l;case"binary":const h=new DataView(new ArrayBuffer(3+r.value.byteLength));h.setUint8(0,6),h.setUint16(1,r.value.byteLength,!1);const m=new Uint8Array(h.buffer);return m.set(r.value,3),m;case"string":const g=this.fromUtf8(r.value),w=new DataView(new ArrayBuffer(3+g.byteLength));w.setUint8(0,7),w.setUint16(1,g.byteLength,!1);const a=new Uint8Array(w.buffer);return a.set(g,3),a;case"timestamp":const P=new Uint8Array(9);return P[0]=8,P.set(dr.fromNumber(r.value.valueOf()).bytes,1),P;case"uuid":if(!Z3.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const e=new Uint8Array(17);return e[0]=9,e.set(x.fromHex(r.value.replace(/\-/g,"")),1),e}}parse(r){const s={};let f=0;while(f<r.byteLength){const l=r.getUint8(f++),h=this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+f,l));switch(f+=l,r.getUint8(f++)){case 0:s[h]={type:bm,value:!0};break;case 1:s[h]={type:bm,value:!1};break;case 2:s[h]={type:T3,value:r.getInt8(f++)};break;case 3:s[h]={type:z3,value:r.getInt16(f,!1)},f+=2;break;case 4:s[h]={type:C3,value:r.getInt32(f,!1)},f+=4;break;case 5:s[h]={type:G3,value:new dr(new Uint8Array(r.buffer,r.byteOffset+f,8))},f+=8;break;case 6:const m=r.getUint16(f,!1);f+=2,s[h]={type:F3,value:new Uint8Array(r.buffer,r.byteOffset+f,m)},f+=m;break;case 7:const g=r.getUint16(f,!1);f+=2,s[h]={type:K3,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+f,g))},f+=g;break;case 8:s[h]={type:W3,value:new Date(new dr(new Uint8Array(r.buffer,r.byteOffset+f,8)).valueOf())},f+=8;break;case 9:const w=new Uint8Array(r.buffer,r.byteOffset+f,16);f+=16,s[h]={type:V3,value:`${x.toHex(w.subarray(0,4))}-${x.toHex(w.subarray(4,6))}-${x.toHex(w.subarray(6,8))}-${x.toHex(w.subarray(8,10))}-${x.toHex(w.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return s}}var cm;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(cm||(cm={}));var bm="boolean",T3="byte",z3="short",C3="integer",G3="long",F3="binary",K3="string",W3="timestamp",V3="uuid",Z3=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function xm({byteLength:r,byteOffset:s,buffer:f}){if(r<L3)throw new Error("Provided message too short to accommodate event stream message overhead");const l=new DataView(f,s,r),h=l.getUint32(0,!1);if(r!==h)throw new Error("Reported message length does not match received message length");const m=l.getUint32(im,!1),g=l.getUint32(o,!1),w=l.getUint32(r-rr,!1),a=new t().update(new Uint8Array(f,s,o));if(g!==a.digest())throw new Error(`The prelude checksum specified in the message (${g}) does not match the calculated CRC32 checksum (${a.digest()})`);if(a.update(new Uint8Array(f,s+o,r-(o+rr))),w!==a.digest())throw new Error(`The message checksum (${a.digest()}) did not match the expected value of ${w}`);return{headers:new DataView(f,s+o+rr,m),body:new Uint8Array(f,s+o+rr+m,h-m-(o+rr+rr))}}var im=4,o=im*2,rr=4,L3=o+rr*2;class vf{constructor(r,s){this.headerMarshaller=new Bf(r,s),this.messageBuffer=[],this.isEndOfStream=!1}feed(r){this.messageBuffer.push(this.decode(r))}endOfStream(){this.isEndOfStream=!0}getMessage(){const r=this.messageBuffer.pop(),s=this.isEndOfStream;return{getMessage(){return r},isEndOfStream(){return s}}}getAvailableMessages(){const r=this.messageBuffer;this.messageBuffer=[];const s=this.isEndOfStream;return{getMessages(){return r},isEndOfStream(){return s}}}encode({headers:r,body:s}){const f=this.headerMarshaller.format(r),l=f.byteLength+s.byteLength+16,h=new Uint8Array(l),m=new DataView(h.buffer,h.byteOffset,h.byteLength),g=new t;return m.setUint32(0,l,!1),m.setUint32(4,f.byteLength,!1),m.setUint32(8,g.update(h.subarray(0,8)).digest(),!1),h.set(f,12),h.set(s,f.byteLength+12),m.setUint32(l-4,g.update(h.subarray(8,l-4)).digest(),!1),h}decode(r){const{headers:s,body:f}=xm(r);return{headers:this.headerMarshaller.parse(s),body:f}}formatHeaders(r){return this.headerMarshaller.format(r)}}class Of{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.decoder.decode(r)}}class qf{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream)yield this.options.encoder.encode(r);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class _f{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream){const s=await this.options.deserializer(r);if(s===void 0)continue;yield s}}}class jf{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.serializer(r)}}function om(r){let s=0,f=0,l=null,h=null;const m=(w)=>{if(typeof w!=="number")throw new Error("Attempted to allocate an event message where size was not a number: "+w);s=w,f=4,l=new Uint8Array(w),new DataView(l.buffer).setUint32(0,w,!1)},g=async function*(){const w=r[Symbol.asyncIterator]();while(!0){const{value:a,done:P}=await w.next();if(P){if(!s)return;else if(s===f)yield l;else throw new Error("Truncated event message received.");return}const e=a.length;let $=0;while($<e){if(!l){const H=e-$;if(!h)h=new Uint8Array(4);const y=Math.min(4-f,H);if(h.set(a.slice($,$+y),f),f+=y,$+=y,f<4)break;m(new DataView(h.buffer).getUint32(0,!1)),h=null}const N=Math.min(s-f,e-$);if(l.set(a.slice($,$+N),f),f+=N,$+=N,s&&s===f)yield l,l=null,s=0,f=0}}};return{[Symbol.asyncIterator]:g}}function nm(r,s){return async function(f){const{value:l}=f.headers[":message-type"];if(l==="error"){const h=new Error(f.headers[":error-message"].value||"UnknownError");throw h.name=f.headers[":error-code"].value,h}else if(l==="exception"){const h=f.headers[":exception-type"].value,m={[h]:f},g=await r(m);if(g.$unknown){const w=new Error(s(f.body));throw w.name=h,w}throw g[h]}else if(l==="event"){const h={[f.headers[":event-type"].value]:f},m=await r(h);if(m.$unknown)return;return m}else throw Error(`Unrecognizable event type: ${f.headers[":event-type"].value}`)}}class Ps{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new vf(r,s),this.utfEncoder=r}deserialize(r,s){const f=om(r);return new _f({messageStream:new Of({inputStream:f,decoder:this.eventStreamCodec}),deserializer:nm(s,this.utfEncoder)})}serialize(r,s){return new qf({messageStream:new jf({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as X3} from"stream";async function*pm(r){let s=!1,f=!1;const l=new Array;r.on("error",(h)=>{if(!s)s=!0;if(h)throw h}),r.on("data",(h)=>{l.push(h)}),r.on("end",()=>{s=!0});while(!f){const h=await new Promise((m)=>setTimeout(()=>m(l.shift()),0));if(h)yield h;f=s&&l.length===0}}class cf{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new Ps({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const f=typeof r[Symbol.asyncIterator]==="function"?r:pm(r);return this.universalMarshaller.deserialize(f,s)}serialize(r,s){return X3.from(this.universalMarshaller.serialize(r,s))}}var um=(r)=>new cf(r);import{Writable as J3} from"stream";class Ns extends J3{constructor(r,s){super(s);this.hash=r}_write(r,s,f){try{this.hash.update(es(r))}catch(l){return f(l)}f()}}var tm=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const f=new r,l=new Ns(f);return s.pipe(l),new Promise((h,m)=>{s.on("error",(g)=>{l.end(),m(g)}),l.on("error",m),l.on("finish",()=>{f.digest().then(h).catch(m)})})};var $s=J(xr(),1);var wg=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??rg,base64Encoder:r?.base64Encoder??lg,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??ir,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??hg,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??Zh,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new $s.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new $s.AwsSdkSigV4ASigner}],logger:r?.logger??new Hr,sdkStreamMixin:r?.sdkStreamMixin??mg,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??Js,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??gg,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??sg,utf8Encoder:r?.utf8Encoder??fg}};var Tg=(r)=>{Ag(process.version);const s=Ug(r),f=()=>s().then(Rg),l=wg(r);return Us.emitWarningIfUnsupportedVersion(process.version),{...l,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??Mg,credentialDefaultProvider:r?.credentialDefaultProvider??Dg,defaultUserAgentProvider:r?.defaultUserAgentProvider??$g({serviceId:l.serviceId,clientVersion:Qm.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??c(Ws),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??um,maxAttempts:r?.maxAttempts??c(eg),md5:r?.md5??Ms.bind(null,"md5"),region:r?.region??c(dg,Eg),requestHandler:ag.create(r?.requestHandler??f),retryMode:r?.retryMode??c({...Ng,default:async()=>(await f()).retryMode||Pg}),sha1:r?.sha1??Ms.bind(null,"sha1"),sha256:r?.sha256??Ms.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??c(Us.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??Sg,streamHasher:r?.streamHasher??tm,useArnRegion:r?.useArnRegion??c(Ym),useDualstackEndpoint:r?.useDualstackEndpoint??c(kg),useFipsEndpoint:r?.useFipsEndpoint??c(Ig)}};var zg=(r)=>{const s=r.httpAuthSchemes;let{httpAuthSchemeProvider:f,credentials:l}=r;return{setHttpAuthScheme(h){const m=s.findIndex((g)=>g.schemeId===h.schemeId);if(m===-1)s.push(h);else s.splice(m,1,h)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(h){f=h},httpAuthSchemeProvider(){return f},setCredentials(h){l=h},credentials(){return l}}},Cg=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var Ds=(r)=>r,Lg=(r,s)=>{const f={...Ds(Vg(r)),...Ds(Kg(r)),...Ds(Gg(r)),...Ds(zg(r))};return s.forEach((l)=>l.configure(f)),{...r,...Zg(f),...Wg(f),...Fg(f),...Cg(f)}};class bf extends Qg{constructor(...[r]){const s=Tg(r||{}),f=Xh(s),l=Yg(f),h=_g(l),m=vg(h),g=Xg(m),w=qg(g),a=zl(w),P=Lh(a),e=Nl(P,{session:[()=>this,yf]}),$=Lg(e,r?.extensions||[]);super($);this.config=$,this.middlewareStack.use(Bg(this.config)),this.middlewareStack.use(jg(this.config)),this.middlewareStack.use(Og(this.config)),this.middlewareStack.use(Jg(this.config)),this.middlewareStack.use(Hg(this.config)),this.middlewareStack.use(yg(this.config)),this.middlewareStack.use(Er.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Kh,identityProviderConfigProvider:async(N)=>new Er.DefaultIdentityProviderConfig({"aws.auth#sigv4":N.credentials,"aws.auth#sigv4a":N.credentials})})),this.middlewareStack.use(Er.getHttpSigningPlugin(this.config)),this.middlewareStack.use(Tl(this.config)),this.middlewareStack.use(sl(this.config)),this.middlewareStack.use(ml(this.config)),this.middlewareStack.use(Vs(this.config)),this.middlewareStack.use(Ls(this.config))}destroy(){super.destroy()}}function H3(r){return(s)=>async(f)=>{const l={...f.input},h=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let m of h){const g=l[m.target];if(g){let w;if(typeof g==="string")if(Q3(g,r))w=r.base64Decoder(g);else w=r.utf8Decoder(g),l[m.target]=r.base64Encoder(w);else w=ArrayBuffer.isView(g)?new Uint8Array(g.buffer,g.byteOffset,g.byteLength):new Uint8Array(g),l[m.target]=r.base64Encoder(w);const a=new r.md5;a.update(w),l[m.hash]=r.base64Encoder(await a.digest())}}return s({...f,input:l})}}function Q3(r,s){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(r))return!1;try{return s.base64Decoder(r).length===32}catch{return!1}}var y3={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},Ts=(r)=>({applyToStack:(s)=>{s.add(H3(r),y3)}});var M;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(M||(M={}));var cg;(function(r){r.HEADER="header",r.TRAILER="trailer"})(cg||(cg={}));var{MD5:bg,CRC32:ig}=M;var Lr=[M.CRC32,M.CRC32C,M.SHA1,M.SHA256],xg=[M.CRC32,M.CRC32C,M.SHA1,M.SHA256];var og=(r,{requestChecksumRequired:s,requestAlgorithmMember:f},l)=>{const h=l?ig:bg;if(!f||!r[f])return s?h:void 0;const m=r[f];if(!Lr.includes(m))throw new Error(`The checksum algorithm "${m}" is not supported by the client.`+` Select one of ${Lr}.`);return m};var Pr=(r)=>r===M.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var ng=(r,s)=>{const f=r.toLowerCase();for(let l of Object.keys(s))if(f===l.toLowerCase())return!0;return!1};var er=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!pg(r);var of=function(){function r(){this.crc32c=new xf}return r.prototype.update=function(s){if(Wr(s))return;this.crc32c.update(Kr(s))},r.prototype.digest=function(){return Is(this,void 0,void 0,function(){return ds(this,function(s){return[2,Vr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new xf},r}();var xf=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var f,l;try{for(var h=Es(s),m=h.next();!m.done;m=h.next()){var g=m.value;this.checksum=this.checksum>>>8^B3[(this.checksum^g)&255]}}catch(w){f={error:w}}finally{try{if(m&&!m.done&&(l=h.return))l.call(h)}finally{if(f)throw f.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var Y3=[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],B3=Zr(Y3);var zs=(r,s)=>({[M.MD5]:s.md5,[M.CRC32]:Yf,[M.CRC32C]:of,[M.SHA1]:s.sha1,[M.SHA256]:s.sha256})[r];var Cs=(r,s)=>{const f=new r;return f.update(es(s||"")),f.digest()};var ug={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},tg=(r,s)=>(f,l)=>async(h)=>{if(!X.isInstance(h.request))return f(h);const{request:m}=h,{body:g,headers:w}=m,{base64Encoder:a,streamHasher:P}=r,{input:e,requestChecksumRequired:$,requestAlgorithmMember:N}=s,H=og(e,{requestChecksumRequired:$,requestAlgorithmMember:N},!!l.isS3ExpressBucket);let y=g,Y=w;if(H){const q=Pr(H),Nr=zs(H,r);if(er(g)){const{getAwsChunkedEncodingStream:Ks,bodyLengthChecker:ww}=r;y=Ks(g,{base64Encoder:a,bodyLengthChecker:ww,checksumLocationName:q,checksumAlgorithmFn:Nr,streamHasher:P}),Y={...w,"content-encoding":w["content-encoding"]?`${w["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":w["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":q},delete Y["content-length"]}else if(!ng(q,w)){const Ks=await Cs(Nr,g);Y={...w,[q]:a(Ks)}}}return await f({...h,request:{...m,headers:Y,body:y}})};var Gs=(r=[])=>{const s=[];for(let f of xg){if(!r.includes(f)||!Lr.includes(f))continue;s.push(f)}return s};var rw=(r)=>{const s=r.lastIndexOf("-");if(s!==-1){const f=r.slice(s+1);if(!f.startsWith("0")){const l=parseInt(f,10);if(!isNaN(l)&&l>=1&&l<=1e4)return!0}}return!1};import{Transform as v3} from"stream";function nf(r){const s=new v3;return s.push(r),s.push(null),s}var sw=async(r,{streamHasher:s,checksumAlgorithmFn:f,base64Encoder:l})=>{const h=er(r)?s(f,r):Cs(f,r);return l(await h)};var fw=async(r,{config:s,responseAlgorithms:f})=>{const l=Gs(f),{body:h,headers:m}=r;for(let g of l){const w=Pr(g),a=m[w];if(a){const P=zs(g,s),{streamHasher:e,base64Encoder:$}=s,N=await sw(h,{streamHasher:e,checksumAlgorithmFn:P,base64Encoder:$});if(N===a)break;throw new Error(`Checksum mismatch: expected "${N}" but received "${a}"`+` in response header "${w}".`)}}};var lw={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},hw=(r,s)=>(f,l)=>async(h)=>{if(!X.isInstance(h.request))return f(h);const m=h.input,g=await f(h),w=g.response;let a=void 0;const{requestValidationModeMember:P,responseAlgorithms:e}=s;if(P&&m[P]==="ENABLED"){const{clientName:$,commandName:N}=l;if($==="S3Client"&&N==="GetObjectCommand"&&Gs(e).every((Y)=>{const Jr=Pr(Y),q=w.headers[Jr];return!q||rw(q)}))return g;const y=er(w.body);if(y)a=await r.streamCollector(w.body),w.body=nf(a);if(await fw(g.response,{config:r,responseAlgorithms:e}),y&&a)w.body=nf(a)}return g};var Fs=(r,s)=>({applyToStack:(f)=>{f.add(tg(r,s),ug),f.addRelativeTo(hw(r,s),lw)}});class pf extends Ar.classBuilder().ep({...wr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,f,l){return[kr(f,this.serialize,this.deserialize),Ir(f,r.getEndpointParameterInstructions()),Fs(f,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),Ts(f),gl(f)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(Qh,yh).ser(rm).de(lm).build(){}class uf extends Ar.classBuilder().ep({...wr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,f,l){return[kr(f,this.serialize,this.deserialize),Ir(f,r.getEndpointParameterInstructions()),Fs(f,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),fl(f),Br(f),Ts(f)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(vh,Bh).ser(sm).de(hm).build(){}var gw=J(O3(),1);import{Buffer as tf} from"buffer";var mw=new bf;class Xr{static folder(r){if(!r||r.includes("null")||r.includes("undefined"))throw new Error("Folder path has to be specified.");return{put:async(s)=>{let f;if(s instanceof Blob)return f=`${rl()}.${s.type.split("/")[1]}`,Xr.put({body:s,name:`${r}/${f}`});return Xr.put({...s,name:`${r}/${f}`})},fetch:async(s)=>{let f=process.env.BUCKET_NAME,l;if(typeof s==="string")l=s;else f=s.bucket??f,l=s.name;if(!l)throw new Error("Object name has to be specified");return Xr.fetch({...s,name:`${r}/${l}`})}}}static async put(r){let s,f,l,h=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,l=`${rl()}.${r.type.split("/")[1]}`,f=r.type;else s=r.body,l=r.name,f=r.contentType;f=s instanceof Blob||s instanceof File?s.type:void 0;const m=s instanceof tf?s:tf.from(await s.arrayBuffer());return await mw.send(new uf({Bucket:h,Key:l,Body:m,ContentType:f})),l}static async metadata(r){const s=tf.from(await r.arrayBuffer());try{return await gw.default(s).metadata()}catch{return{}}}static async fetch(r){let s=process.env.BUCKET_NAME,f;if(typeof r==="string")f=r;else s=r.bucket??s,f=r.name;if(!f)throw new Error("Object name has to be specified");const l=await mw.send(new pf({Bucket:s,Key:f}));return new Response(l.Body.transformToWebStream(),{headers:{"Content-Type":l.ContentType,"Content-Length":l.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":l.LastModified?.toUTCString()||"",ETag:l.ETag||""}})}static delete(){}}export{Xr as Storage};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemi",
3
- "version": "0.4.55",
3
+ "version": "0.4.56",
4
4
  "devDependencies": {
5
5
  "@happy-dom/global-registrator": "^14.12.3",
6
6
  "@repo/eslint-config": "*",