gemi 0.41.4 → 0.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/index.js +2 -2
- package/dist/app/index.js.map +1 -1
- package/dist/bin/gemi.js +129 -19
- package/dist/bin/gemi.js.map +5 -5
- package/dist/broadcasting/index.js +1 -1
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-4e4ax9bs.js → chunk-0pjn1a5d.js} +2 -2
- package/dist/{chunk-4e4ax9bs.js.map → chunk-0pjn1a5d.js.map} +1 -1
- package/dist/{chunk-awscq13h.js → chunk-1kmbs8cd.js} +3 -3
- package/dist/{chunk-awscq13h.js.map → chunk-1kmbs8cd.js.map} +1 -1
- package/dist/{chunk-4f45pw0v.js → chunk-22pr1w8v.js} +2 -2
- package/dist/{chunk-4f45pw0v.js.map → chunk-22pr1w8v.js.map} +1 -1
- package/dist/{chunk-xdk56snm.js → chunk-358x9aca.js} +3 -3
- package/dist/{chunk-xdk56snm.js.map → chunk-358x9aca.js.map} +1 -1
- package/dist/{chunk-9nfdjzen.js → chunk-522q81af.js} +4 -4
- package/dist/{chunk-9nfdjzen.js.map → chunk-522q81af.js.map} +1 -1
- package/dist/{chunk-8rm601h3.js → chunk-81yxskss.js} +2 -2
- package/dist/{chunk-8rm601h3.js.map → chunk-81yxskss.js.map} +1 -1
- package/dist/{chunk-jt0z45dn.js → chunk-8cqkdzyh.js} +4 -4
- package/dist/{chunk-jt0z45dn.js.map → chunk-8cqkdzyh.js.map} +1 -1
- package/dist/{chunk-r9p9g2x9.js → chunk-8mgsjrcc.js} +2 -2
- package/dist/{chunk-r9p9g2x9.js.map → chunk-8mgsjrcc.js.map} +1 -1
- package/dist/{chunk-c1bjq2ss.js → chunk-9byxbqnn.js} +2 -2
- package/dist/{chunk-c1bjq2ss.js.map → chunk-9byxbqnn.js.map} +1 -1
- package/dist/{chunk-q91708he.js → chunk-akbepc3f.js} +65 -65
- package/dist/{chunk-q91708he.js.map → chunk-akbepc3f.js.map} +3 -3
- package/dist/{chunk-1g3qpb60.js → chunk-ayjtdck4.js} +2 -2
- package/dist/{chunk-1g3qpb60.js.map → chunk-ayjtdck4.js.map} +1 -1
- package/dist/{chunk-6b1abejc.js → chunk-b3qebxqh.js} +3 -3
- package/dist/{chunk-6b1abejc.js.map → chunk-b3qebxqh.js.map} +1 -1
- package/dist/{chunk-c1hsc4aa.js → chunk-bfnh3gwv.js} +2 -2
- package/dist/{chunk-c1hsc4aa.js.map → chunk-bfnh3gwv.js.map} +1 -1
- package/dist/{chunk-agvzqxv7.js → chunk-cwq1vdcb.js} +2 -2
- package/dist/{chunk-21r4g9h0.js.map → chunk-cwq1vdcb.js.map} +1 -1
- package/dist/{chunk-b4xfh9pg.js → chunk-cx38xsyf.js} +2 -2
- package/dist/{chunk-b4xfh9pg.js.map → chunk-cx38xsyf.js.map} +1 -1
- package/dist/{chunk-wzxsj3cp.js → chunk-fb78bz10.js} +2 -2
- package/dist/{chunk-wzxsj3cp.js.map → chunk-fb78bz10.js.map} +2 -2
- package/dist/{chunk-q3wpyr9y.js → chunk-gsvzrj5r.js} +2 -2
- package/dist/{chunk-q3wpyr9y.js.map → chunk-gsvzrj5r.js.map} +1 -1
- package/dist/{chunk-s3zn2vas.js → chunk-hzw2y2rz.js} +3 -3
- package/dist/{chunk-s3zn2vas.js.map → chunk-hzw2y2rz.js.map} +1 -1
- package/dist/{chunk-xnhktttd.js → chunk-n1xpxhm0.js} +2 -2
- package/dist/{chunk-xnhktttd.js.map → chunk-n1xpxhm0.js.map} +1 -1
- package/dist/{chunk-3hjfype8.js → chunk-n78kxce1.js} +2 -2
- package/dist/{chunk-3hjfype8.js.map → chunk-n78kxce1.js.map} +1 -1
- package/dist/chunk-nccmdkf1.js +5 -0
- package/dist/chunk-nccmdkf1.js.map +12 -0
- package/dist/{chunk-c74f9zbq.js → chunk-pfaq2mer.js} +2 -2
- package/dist/{chunk-c74f9zbq.js.map → chunk-pfaq2mer.js.map} +1 -1
- package/dist/chunk-pjgfvdr6.js +79 -0
- package/dist/{chunk-88fb6hzq.js.map → chunk-pjgfvdr6.js.map} +5 -4
- package/dist/{chunk-sns685hn.js → chunk-pn30zsrt.js} +2 -2
- package/dist/{chunk-sns685hn.js.map → chunk-pn30zsrt.js.map} +1 -1
- package/dist/{chunk-4cqg9kg4.js → chunk-pr3pvtmh.js} +2 -2
- package/dist/{chunk-4cqg9kg4.js.map → chunk-pr3pvtmh.js.map} +1 -1
- package/dist/{chunk-wfbgtbae.js → chunk-pxcv9ccp.js} +3 -3
- package/dist/{chunk-wfbgtbae.js.map → chunk-pxcv9ccp.js.map} +1 -1
- package/dist/{chunk-yk9aw128.js → chunk-pygcsw1f.js} +2 -2
- package/dist/{chunk-yk9aw128.js.map → chunk-pygcsw1f.js.map} +1 -1
- package/dist/{chunk-1nm4bfjq.js → chunk-q0y425d3.js} +3 -3
- package/dist/{chunk-1nm4bfjq.js.map → chunk-q0y425d3.js.map} +1 -1
- package/dist/{chunk-y7qsts67.js → chunk-qeq8hv3t.js} +2 -2
- package/dist/{chunk-y7qsts67.js.map → chunk-qeq8hv3t.js.map} +1 -1
- package/dist/{chunk-kd4whs4z.js → chunk-qyn10pv7.js} +1 -1
- package/dist/{chunk-h465ja8n.js → chunk-qzemjynx.js} +3 -3
- package/dist/{chunk-h465ja8n.js.map → chunk-qzemjynx.js.map} +1 -1
- package/dist/{chunk-rm5y1v00.js → chunk-ratbccpg.js} +2 -2
- package/dist/{chunk-rm5y1v00.js.map → chunk-ratbccpg.js.map} +1 -1
- package/dist/{chunk-p9qt93zk.js → chunk-rrwtgt86.js} +2 -2
- package/dist/{chunk-agvzqxv7.js.map → chunk-rrwtgt86.js.map} +1 -1
- package/dist/{chunk-p6ezs2w7.js → chunk-sbmg0hfr.js} +3 -3
- package/dist/{chunk-p6ezs2w7.js.map → chunk-sbmg0hfr.js.map} +1 -1
- package/dist/{chunk-3hgk4fxz.js → chunk-shpca068.js} +3 -3
- package/dist/{chunk-3hgk4fxz.js.map → chunk-shpca068.js.map} +1 -1
- package/dist/{chunk-vfvetfjg.js → chunk-syaxsp9y.js} +3 -3
- package/dist/{chunk-vfvetfjg.js.map → chunk-syaxsp9y.js.map} +1 -1
- package/dist/chunk-tb8yy4rf.js +5 -0
- package/dist/{chunk-emt6gz1d.js.map → chunk-tb8yy4rf.js.map} +1 -1
- package/dist/{chunk-sgv88qqn.js → chunk-wa84ybnt.js} +5 -5
- package/dist/{chunk-sgv88qqn.js.map → chunk-wa84ybnt.js.map} +1 -1
- package/dist/{chunk-rkf1stc0.js → chunk-x3vy6dbw.js} +2 -2
- package/dist/{chunk-rkf1stc0.js.map → chunk-x3vy6dbw.js.map} +1 -1
- package/dist/chunk-xpk460d1.js +4 -0
- package/dist/{chunk-p9qt93zk.js.map → chunk-xpk460d1.js.map} +1 -1
- package/dist/chunk-yeqwzeq7.js +4 -0
- package/dist/{chunk-a8wmfnw6.js.map → chunk-yeqwzeq7.js.map} +3 -3
- package/dist/{chunk-85hzphk5.js → chunk-z9vdcpqr.js} +2 -2
- package/dist/{chunk-85hzphk5.js.map → chunk-z9vdcpqr.js.map} +1 -1
- package/dist/{chunk-kw1g4bjh.js → chunk-zaa3yt2w.js} +3 -3
- package/dist/{chunk-kw1g4bjh.js.map → chunk-zaa3yt2w.js.map} +1 -1
- package/dist/config/index.js +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/http/ViewRouter.d.ts +29 -5
- package/dist/http/ViewRouter.d.ts.map +1 -1
- package/dist/http/index.d.ts +2 -2
- package/dist/http/index.d.ts.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +2 -2
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +2 -2
- package/dist/server/httpProd.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +2 -2
- package/dist/services/index.js +2 -2
- package/dist/services/index.js.map +1 -1
- package/dist/services/router/ViewRouterServiceContainer.d.ts +9 -0
- package/dist/services/router/ViewRouterServiceContainer.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-21r4g9h0.js +0 -4
- package/dist/chunk-88fb6hzq.js +0 -79
- package/dist/chunk-a8wmfnw6.js +0 -4
- package/dist/chunk-c9wa4rtm.js +0 -5
- package/dist/chunk-c9wa4rtm.js.map +0 -10
- package/dist/chunk-emt6gz1d.js +0 -5
- package/dist/chunk-kyw5n83x.js +0 -5
- package/dist/chunk-kyw5n83x.js.map +0 -12
- /package/dist/{chunk-kd4whs4z.js.map → chunk-qyn10pv7.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Na as OB,Oa as CB,Ta as PB}from"./chunk-qeq8hv3t.js";import{$a as rh,Ua as q4,Va as C4,Wa as Y0,Xa as wx,Ya as Fx,Za as Nx,_a as U4,ab as ih,bb as tK,cb as Gx,db as tB,eb as $x,fb as U0,gb as oB,hb as eK,ib as ux,jb as Dx,kb as Bx,lb as aK,mb as Ax}from"./chunk-522q81af.js";import{nb as oK}from"./chunk-syaxsp9y.js";import{ob as pD,pb as nK,rb as sK,sb as IB,tb as iu,vb as ZB,zb as k2}from"./chunk-8cqkdzyh.js";import{Ab as m2}from"./chunk-hzw2y2rz.js";import{Bb as $h,Db as iD}from"./chunk-q0y425d3.js";import{Eb as pK}from"./chunk-1kmbs8cd.js";import{Fb as kK}from"./chunk-zaa3yt2w.js";import{Ib as cB}from"./chunk-qzemjynx.js";import{Jb as vh}from"./chunk-shpca068.js";import{Kb as hY}from"./chunk-b3qebxqh.js";import{Ob as pY,Pb as f}from"./chunk-n1xpxhm0.js";import{Rb as eY}from"./chunk-bfnh3gwv.js";import{Sb as X,Tb as $,Vb as l2}from"./chunk-cwq1vdcb.js";var i1=$((k6)=>{Object.defineProperty(k6,"__esModule",{value:!0});k6.ApplicationInSerializer=void 0;k6.ApplicationInSerializer={_fromJsonObject(u){return{metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid}},_toJsonObject(u){return{metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid}}}});var i3=$((V6)=>{Object.defineProperty(V6,"__esModule",{value:!0});V6.ApplicationOutSerializer=void 0;V6.ApplicationOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),id:u.id,metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{createdAt:u.createdAt,id:u.id,metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,updatedAt:u.updatedAt}}}});var m6=$((I6)=>{Object.defineProperty(I6,"__esModule",{value:!0});I6.ApplicationPatchSerializer=void 0;I6.ApplicationPatchSerializer={_fromJsonObject(u){return{metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,uid:u.uid}},_toJsonObject(u){return{metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,uid:u.uid}}}});var b6=$((_6)=>{Object.defineProperty(_6,"__esModule",{value:!0});_6.ListResponseApplicationOutSerializer=void 0;var g6=i3();_6.ListResponseApplicationOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>g6.ApplicationOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>g6.ApplicationOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var n3=$((l6)=>{Object.defineProperty(l6,"__esModule",{value:!0});l6.ApiException=void 0;class j6 extends Error{constructor(u,D,B){super(`HTTP-Code: ${u}
|
|
3
3
|
Headers: ${JSON.stringify(B)}`);this.code=u,this.body=D,this.headers={},B.forEach((A,w)=>{this.headers[w]=A})}}l6.ApiException=j6});var g=$((U2)=>{var Su=U2&&U2.__awaiter||function(u,D,B,A){function w(F){return F instanceof B?F:new B(function(N){N(F)})}return new(B||(B=Promise))(function(F,N){function G(Q){try{z(A.next(Q))}catch(Z){N(Z)}}function v(Q){try{z(A.throw(Q))}catch(Z){N(Z)}}function z(Q){Q.done?F(Q.value):w(Q.value).then(G,v)}z((A=A.apply(u,D||[])).next())})};Object.defineProperty(U2,"__esModule",{value:!0});U2.SvixRequest=U2.HttpMethod=U2.LIB_VERSION=void 0;var p3=n3();U2.LIB_VERSION="1.92.2";var Mx=`svix-libs/${U2.LIB_VERSION}/javascript`,Lx;(function(u){u.GET="GET",u.HEAD="HEAD",u.POST="POST",u.PUT="PUT",u.DELETE="DELETE",u.CONNECT="CONNECT",u.OPTIONS="OPTIONS",u.TRACE="TRACE",u.PATCH="PATCH"})(Lx=U2.HttpMethod||(U2.HttpMethod={}));class r6{constructor(u,D){this.method=u,this.path=D,this.queryParams={},this.headerParams={}}setPathParam(u,D){let B=this.path.replace(`{${u}}`,encodeURIComponent(D));if(this.path===B)throw Error(`path parameter ${u} not found`);this.path=B}setQueryParams(u){for(let[D,B]of Object.entries(u))this.setQueryParam(D,B)}setQueryParam(u,D){if(D===void 0||D===null)return;if(typeof D==="string")this.queryParams[u]=D;else if(typeof D==="boolean"||typeof D==="number")this.queryParams[u]=D.toString();else if(D instanceof Date)this.queryParams[u]=D.toISOString();else if(Array.isArray(D)){if(D.length>0)this.queryParams[u]=D.join(",")}else{let B=D;throw Error(`query parameter ${u} has unsupported type`)}}setHeaderParam(u,D){if(D===void 0)return;this.headerParams[u]=D}setBody(u){this.body=JSON.stringify(u)}send(u,D){return Su(this,void 0,void 0,function*(){let B=yield this.sendInner(u);if(B.status===204)return null;let A=yield B.text();return D(JSON.parse(A))})}sendNoResponseBody(u){return Su(this,void 0,void 0,function*(){yield this.sendInner(u)})}sendInner(u){var D,B;return Su(this,void 0,void 0,function*(){let A=new URL(u.baseUrl+this.path);for(let[G,v]of Object.entries(this.queryParams))A.searchParams.set(G,v);if(this.headerParams["idempotency-key"]===void 0&&this.method.toUpperCase()==="POST")this.headerParams["idempotency-key"]=`auto_${crypto.randomUUID()}`;let w=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER);if(this.body!=null)this.headerParams["content-type"]="application/json";let F="credentials"in Request.prototype,N=yield i6(A,{method:this.method.toString(),body:this.body,headers:Object.assign({accept:"application/json, */*;q=0.8",authorization:`Bearer ${u.token}`,"user-agent":Mx,"svix-req-id":w.toString()},this.headerParams),credentials:F?"same-origin":void 0,signal:u.timeout!==void 0?AbortSignal.timeout(u.timeout):void 0},u.retryScheduleInMs,(D=u.retryScheduleInMs)===null||D===void 0?void 0:D[0],((B=u.retryScheduleInMs)===null||B===void 0?void 0:B.length)||u.numRetries,u.fetch);return Ex(N)})}}U2.SvixRequest=r6;function Ex(u){return Su(this,void 0,void 0,function*(){if(u.status<300)return u;let D=yield u.text();if(u.status===422)throw new p3.ApiException(u.status,JSON.parse(D),u.headers);if(u.status>=400&&u.status<=499)throw new p3.ApiException(u.status,JSON.parse(D),u.headers);throw new p3.ApiException(u.status,D,u.headers)})}function i6(u,D,B,A=50,w=2,F=fetch,N=1){return Su(this,void 0,void 0,function*(){let G=(v)=>new Promise((z)=>setTimeout(z,v));try{let v=yield F(u,D);if(w<=0||v.status<500)return v}catch(v){if(w<=0)throw v}return yield G(A),D.headers["svix-retry-count"]=N.toString(),A=(B===null||B===void 0?void 0:B[N])||A*2,yield i6(u,D,B,A,--w,F,++N)})}});var s6=$((p6)=>{Object.defineProperty(p6,"__esModule",{value:!0});p6.Application=void 0;var a3=i1(),Ru=i3(),Ox=m6(),Cx=b6(),Z2=g();class n6{constructor(u){this.requestCtx=u}list(u){let D=new Z2.SvixRequest(Z2.HttpMethod.GET,"/api/v1/app");return D.setQueryParams({exclude_apps_with_no_endpoints:u===null||u===void 0?void 0:u.excludeAppsWithNoEndpoints,exclude_apps_with_disabled_endpoints:u===null||u===void 0?void 0:u.excludeAppsWithDisabledEndpoints,exclude_apps_with_svix_play_endpoints:u===null||u===void 0?void 0:u.excludeAppsWithSvixPlayEndpoints,limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,Cx.ListResponseApplicationOutSerializer._fromJsonObject)}create(u,D){let B=new Z2.SvixRequest(Z2.HttpMethod.POST,"/api/v1/app");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(a3.ApplicationInSerializer._toJsonObject(u)),B.send(this.requestCtx,Ru.ApplicationOutSerializer._fromJsonObject)}getOrCreate(u,D){let B=new Z2.SvixRequest(Z2.HttpMethod.POST,"/api/v1/app");return B.setQueryParam("get_if_exists",!0),B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(a3.ApplicationInSerializer._toJsonObject(u)),B.send(this.requestCtx,Ru.ApplicationOutSerializer._fromJsonObject)}get(u){let D=new Z2.SvixRequest(Z2.HttpMethod.GET,"/api/v1/app/{app_id}");return D.setPathParam("app_id",u),D.send(this.requestCtx,Ru.ApplicationOutSerializer._fromJsonObject)}update(u,D){let B=new Z2.SvixRequest(Z2.HttpMethod.PUT,"/api/v1/app/{app_id}");return B.setPathParam("app_id",u),B.setBody(a3.ApplicationInSerializer._toJsonObject(D)),B.send(this.requestCtx,Ru.ApplicationOutSerializer._fromJsonObject)}delete(u){let D=new Z2.SvixRequest(Z2.HttpMethod.DELETE,"/api/v1/app/{app_id}");return D.setPathParam("app_id",u),D.sendNoResponseBody(this.requestCtx)}patch(u,D){let B=new Z2.SvixRequest(Z2.HttpMethod.PATCH,"/api/v1/app/{app_id}");return B.setPathParam("app_id",u),B.setBody(Ox.ApplicationPatchSerializer._toJsonObject(D)),B.send(this.requestCtx,Ru.ApplicationOutSerializer._fromJsonObject)}}p6.Application=n6});var e6=$((t6)=>{Object.defineProperty(t6,"__esModule",{value:!0});t6.ApiTokenOutSerializer=void 0;t6.ApiTokenOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),expiresAt:u.expiresAt?new Date(u.expiresAt):null,id:u.id,name:u.name,scopes:u.scopes,token:u.token}},_toJsonObject(u){return{createdAt:u.createdAt,expiresAt:u.expiresAt,id:u.id,name:u.name,scopes:u.scopes,token:u.token}}}});var s3=$((DA)=>{Object.defineProperty(DA,"__esModule",{value:!0});DA.AppPortalCapabilitySerializer=DA.AppPortalCapability=void 0;var Px;(function(u){u.ViewBase="ViewBase",u.ViewEndpointSecret="ViewEndpointSecret",u.ManageEndpointSecret="ManageEndpointSecret",u.ManageTransformations="ManageTransformations",u.CreateAttempts="CreateAttempts",u.ManageEndpoint="ManageEndpoint"})(Px=DA.AppPortalCapability||(DA.AppPortalCapability={}));DA.AppPortalCapabilitySerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var GA=$((FA)=>{Object.defineProperty(FA,"__esModule",{value:!0});FA.AppPortalAccessInSerializer=void 0;var AA=s3(),wA=i1();FA.AppPortalAccessInSerializer={_fromJsonObject(u){var D;return{application:u.application!=null?wA.ApplicationInSerializer._fromJsonObject(u.application):void 0,capabilities:(D=u.capabilities)===null||D===void 0?void 0:D.map((B)=>AA.AppPortalCapabilitySerializer._fromJsonObject(B)),expiry:u.expiry,featureFlags:u.featureFlags,readOnly:u.readOnly,sessionId:u.sessionId}},_toJsonObject(u){var D;return{application:u.application!=null?wA.ApplicationInSerializer._toJsonObject(u.application):void 0,capabilities:(D=u.capabilities)===null||D===void 0?void 0:D.map((B)=>AA.AppPortalCapabilitySerializer._toJsonObject(B)),expiry:u.expiry,featureFlags:u.featureFlags,readOnly:u.readOnly,sessionId:u.sessionId}}}});var zA=$(($A)=>{Object.defineProperty($A,"__esModule",{value:!0});$A.AppPortalAccessOutSerializer=void 0;$A.AppPortalAccessOutSerializer={_fromJsonObject(u){return{token:u.token,url:u.url}},_toJsonObject(u){return{token:u.token,url:u.url}}}});var QA=$((ZA)=>{Object.defineProperty(ZA,"__esModule",{value:!0});ZA.ApplicationTokenExpireInSerializer=void 0;ZA.ApplicationTokenExpireInSerializer={_fromJsonObject(u){return{expiry:u.expiry,sessionIds:u.sessionIds}},_toJsonObject(u){return{expiry:u.expiry,sessionIds:u.sessionIds}}}});var YA=$((WA)=>{Object.defineProperty(WA,"__esModule",{value:!0});WA.RotatePollerTokenInSerializer=void 0;WA.RotatePollerTokenInSerializer={_fromJsonObject(u){return{expiry:u.expiry,oldTokenExpiry:u.oldTokenExpiry}},_toJsonObject(u){return{expiry:u.expiry,oldTokenExpiry:u.oldTokenExpiry}}}});var xA=$((hA)=>{Object.defineProperty(hA,"__esModule",{value:!0});hA.StreamPortalAccessInSerializer=void 0;hA.StreamPortalAccessInSerializer={_fromJsonObject(u){return{expiry:u.expiry,featureFlags:u.featureFlags,sessionId:u.sessionId}},_toJsonObject(u){return{expiry:u.expiry,featureFlags:u.featureFlags,sessionId:u.sessionId}}}});var HA=$((SA)=>{Object.defineProperty(SA,"__esModule",{value:!0});SA.StreamTokenExpireInSerializer=void 0;SA.StreamTokenExpireInSerializer={_fromJsonObject(u){return{expiry:u.expiry,sessionIds:u.sessionIds}},_toJsonObject(u){return{expiry:u.expiry,sessionIds:u.sessionIds}}}});var t3=$((UA)=>{Object.defineProperty(UA,"__esModule",{value:!0});UA.DashboardAccessOutSerializer=void 0;UA.DashboardAccessOutSerializer={_fromJsonObject(u){return{token:u.token,url:u.url}},_toJsonObject(u){return{token:u.token,url:u.url}}}});var PA=$((OA)=>{Object.defineProperty(OA,"__esModule",{value:!0});OA.Authentication=void 0;var MA=e6(),kx=GA(),LA=zA(),yx=QA(),Vx=YA(),Tx=xA(),Ix=HA(),qx=t3(),u2=g();class EA{constructor(u){this.requestCtx=u}appPortalAccess(u,D,B){let A=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/app-portal-access/{app_id}");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(kx.AppPortalAccessInSerializer._toJsonObject(D)),A.send(this.requestCtx,LA.AppPortalAccessOutSerializer._fromJsonObject)}expireAll(u,D,B){let A=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/app/{app_id}/expire-all");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(yx.ApplicationTokenExpireInSerializer._toJsonObject(D)),A.sendNoResponseBody(this.requestCtx)}dashboardAccess(u,D){let B=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/dashboard-access/{app_id}");return B.setPathParam("app_id",u),B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.send(this.requestCtx,qx.DashboardAccessOutSerializer._fromJsonObject)}logout(u){let D=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/logout");return D.setHeaderParam("idempotency-key",u===null||u===void 0?void 0:u.idempotencyKey),D.sendNoResponseBody(this.requestCtx)}streamLogout(u){let D=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/stream-logout");return D.setHeaderParam("idempotency-key",u===null||u===void 0?void 0:u.idempotencyKey),D.sendNoResponseBody(this.requestCtx)}streamPortalAccess(u,D,B){let A=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/stream-portal-access/{stream_id}");return A.setPathParam("stream_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(Tx.StreamPortalAccessInSerializer._toJsonObject(D)),A.send(this.requestCtx,LA.AppPortalAccessOutSerializer._fromJsonObject)}streamExpireAll(u,D,B){let A=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/expire-all");return A.setPathParam("stream_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(Ix.StreamTokenExpireInSerializer._toJsonObject(D)),A.sendNoResponseBody(this.requestCtx)}getStreamPollerToken(u,D){let B=new u2.SvixRequest(u2.HttpMethod.GET,"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.send(this.requestCtx,MA.ApiTokenOutSerializer._fromJsonObject)}rotateStreamPollerToken(u,D,B,A){let w=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token/rotate");return w.setPathParam("stream_id",u),w.setPathParam("sink_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(Vx.RotatePollerTokenInSerializer._toJsonObject(B)),w.send(this.requestCtx,MA.ApiTokenOutSerializer._fromJsonObject)}}OA.Authentication=EA});var a2=$((yA)=>{Object.defineProperty(yA,"__esModule",{value:!0});yA.BackgroundTaskStatusSerializer=yA.BackgroundTaskStatus=void 0;var mx;(function(u){u.Running="running",u.Finished="finished",u.Failed="failed"})(mx=yA.BackgroundTaskStatus||(yA.BackgroundTaskStatus={}));yA.BackgroundTaskStatusSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var s2=$((IA)=>{Object.defineProperty(IA,"__esModule",{value:!0});IA.BackgroundTaskTypeSerializer=IA.BackgroundTaskType=void 0;var gx;(function(u){u.EndpointReplay="endpoint.replay",u.EndpointRecover="endpoint.recover",u.ApplicationStats="application.stats",u.MessageBroadcast="message.broadcast",u.SdkGenerate="sdk.generate",u.EventTypeAggregate="event-type.aggregate",u.ApplicationPurgeContent="application.purge_content",u.EndpointBulkReplay="endpoint.bulk-replay"})(gx=IA.BackgroundTaskType||(IA.BackgroundTaskType={}));IA.BackgroundTaskTypeSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var o3=$((_A)=>{Object.defineProperty(_A,"__esModule",{value:!0});_A.BackgroundTaskOutSerializer=void 0;var mA=a2(),gA=s2();_A.BackgroundTaskOutSerializer={_fromJsonObject(u){return{data:u.data,id:u.id,status:mA.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:gA.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{data:u.data,id:u.id,status:mA.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:gA.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var dA=$((jA)=>{Object.defineProperty(jA,"__esModule",{value:!0});jA.ListResponseBackgroundTaskOutSerializer=void 0;var bA=o3();jA.ListResponseBackgroundTaskOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>bA.BackgroundTaskOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>bA.BackgroundTaskOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var pA=$((iA)=>{Object.defineProperty(iA,"__esModule",{value:!0});iA.BackgroundTask=void 0;var _x=o3(),fx=dA(),n1=g();class rA{constructor(u){this.requestCtx=u}list(u){let D=new n1.SvixRequest(n1.HttpMethod.GET,"/api/v1/background-task");return D.setQueryParams({status:u===null||u===void 0?void 0:u.status,task:u===null||u===void 0?void 0:u.task,limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,fx.ListResponseBackgroundTaskOutSerializer._fromJsonObject)}listByEndpoint(u){return this.list(u)}get(u){let D=new n1.SvixRequest(n1.HttpMethod.GET,"/api/v1/background-task/{task_id}");return D.setPathParam("task_id",u),D.send(this.requestCtx,_x.BackgroundTaskOutSerializer._fromJsonObject)}}iA.BackgroundTask=rA});var k0=$((sA)=>{Object.defineProperty(sA,"__esModule",{value:!0});sA.ConnectorKindSerializer=sA.ConnectorKind=void 0;var bx;(function(u){u.Custom="Custom",u.AgenticCommerceProtocol="AgenticCommerceProtocol",u.CloseCrm="CloseCRM",u.CustomerIo="CustomerIO",u.Discord="Discord",u.Hubspot="Hubspot",u.Inngest="Inngest",u.Loops="Loops",u.Otel="Otel",u.Resend="Resend",u.Salesforce="Salesforce",u.Segment="Segment",u.Sendgrid="Sendgrid",u.Slack="Slack",u.Teams="Teams",u.TriggerDev="TriggerDev",u.Windmill="Windmill",u.Zapier="Zapier"})(bx=sA.ConnectorKind||(sA.ConnectorKind={}));sA.ConnectorKindSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var p1=$((eA)=>{Object.defineProperty(eA,"__esModule",{value:!0});eA.ConnectorProductSerializer=eA.ConnectorProduct=void 0;var jx;(function(u){u.Dispatch="Dispatch",u.Stream="Stream"})(jx=eA.ConnectorProduct||(eA.ConnectorProduct={}));eA.ConnectorProductSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var e3=$((Aw)=>{Object.defineProperty(Aw,"__esModule",{value:!0});Aw.ConnectorInSerializer=void 0;var Dw=k0(),Bw=p1();Aw.ConnectorInSerializer={_fromJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?Dw.ConnectorKindSerializer._fromJsonObject(u.kind):void 0,logo:u.logo,name:u.name,productType:u.productType!=null?Bw.ConnectorProductSerializer._fromJsonObject(u.productType):void 0,transformation:u.transformation,uid:u.uid}},_toJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?Dw.ConnectorKindSerializer._toJsonObject(u.kind):void 0,logo:u.logo,name:u.name,productType:u.productType!=null?Bw.ConnectorProductSerializer._toJsonObject(u.productType):void 0,transformation:u.transformation,uid:u.uid}}}});var a1=$((Gw)=>{Object.defineProperty(Gw,"__esModule",{value:!0});Gw.ConnectorOutSerializer=void 0;var Fw=k0(),Nw=p1();Gw.ConnectorOutSerializer={_fromJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,createdAt:new Date(u.createdAt),description:u.description,featureFlags:u.featureFlags,id:u.id,instructions:u.instructions,kind:Fw.ConnectorKindSerializer._fromJsonObject(u.kind),logo:u.logo,name:u.name,orgId:u.orgId,productType:Nw.ConnectorProductSerializer._fromJsonObject(u.productType),transformation:u.transformation,transformationUpdatedAt:new Date(u.transformationUpdatedAt),uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,createdAt:u.createdAt,description:u.description,featureFlags:u.featureFlags,id:u.id,instructions:u.instructions,kind:Fw.ConnectorKindSerializer._toJsonObject(u.kind),logo:u.logo,name:u.name,orgId:u.orgId,productType:Nw.ConnectorProductSerializer._toJsonObject(u.productType),transformation:u.transformation,transformationUpdatedAt:u.transformationUpdatedAt,uid:u.uid,updatedAt:u.updatedAt}}}});var Jw=$((zw)=>{Object.defineProperty(zw,"__esModule",{value:!0});zw.ConnectorPatchSerializer=void 0;var vw=k0();zw.ConnectorPatchSerializer={_fromJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?vw.ConnectorKindSerializer._fromJsonObject(u.kind):void 0,logo:u.logo,name:u.name,transformation:u.transformation}},_toJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?vw.ConnectorKindSerializer._toJsonObject(u.kind):void 0,logo:u.logo,name:u.name,transformation:u.transformation}}}});var Yw=$((Ww)=>{Object.defineProperty(Ww,"__esModule",{value:!0});Ww.ConnectorUpdateSerializer=void 0;var Qw=k0();Ww.ConnectorUpdateSerializer={_fromJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?Qw.ConnectorKindSerializer._fromJsonObject(u.kind):void 0,logo:u.logo,name:u.name,transformation:u.transformation}},_toJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?Qw.ConnectorKindSerializer._toJsonObject(u.kind):void 0,logo:u.logo,name:u.name,transformation:u.transformation}}}});var Sw=$((Kw)=>{Object.defineProperty(Kw,"__esModule",{value:!0});Kw.ListResponseConnectorOutSerializer=void 0;var hw=a1();Kw.ListResponseConnectorOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>hw.ConnectorOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>hw.ConnectorOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var cw=$((Hw)=>{Object.defineProperty(Hw,"__esModule",{value:!0});Hw.Connector=void 0;var lx=e3(),s1=a1(),dx=Jw(),rx=Yw(),ix=Sw(),c2=g();class Rw{constructor(u){this.requestCtx=u}list(u){let D=new c2.SvixRequest(c2.HttpMethod.GET,"/api/v1/connector");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order,product_type:u===null||u===void 0?void 0:u.productType}),D.send(this.requestCtx,ix.ListResponseConnectorOutSerializer._fromJsonObject)}create(u,D){let B=new c2.SvixRequest(c2.HttpMethod.POST,"/api/v1/connector");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(lx.ConnectorInSerializer._toJsonObject(u)),B.send(this.requestCtx,s1.ConnectorOutSerializer._fromJsonObject)}get(u){let D=new c2.SvixRequest(c2.HttpMethod.GET,"/api/v1/connector/{connector_id}");return D.setPathParam("connector_id",u),D.send(this.requestCtx,s1.ConnectorOutSerializer._fromJsonObject)}update(u,D){let B=new c2.SvixRequest(c2.HttpMethod.PUT,"/api/v1/connector/{connector_id}");return B.setPathParam("connector_id",u),B.setBody(rx.ConnectorUpdateSerializer._toJsonObject(D)),B.send(this.requestCtx,s1.ConnectorOutSerializer._fromJsonObject)}delete(u){let D=new c2.SvixRequest(c2.HttpMethod.DELETE,"/api/v1/connector/{connector_id}");return D.setPathParam("connector_id",u),D.sendNoResponseBody(this.requestCtx)}patch(u,D){let B=new c2.SvixRequest(c2.HttpMethod.PATCH,"/api/v1/connector/{connector_id}");return B.setPathParam("connector_id",u),B.setBody(dx.ConnectorPatchSerializer._toJsonObject(D)),B.send(this.requestCtx,s1.ConnectorOutSerializer._fromJsonObject)}}Hw.Connector=Rw});var y0=$((Lw)=>{Object.defineProperty(Lw,"__esModule",{value:!0});Lw.MessageStatusSerializer=Lw.MessageStatus=void 0;var nx;(function(u){u[u.Success=0]="Success",u[u.Pending=1]="Pending",u[u.Fail=2]="Fail",u[u.Sending=3]="Sending"})(nx=Lw.MessageStatus||(Lw.MessageStatus={}));Lw.MessageStatusSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var u8=$((Cw)=>{Object.defineProperty(Cw,"__esModule",{value:!0});Cw.StatusCodeClassSerializer=Cw.StatusCodeClass=void 0;var px;(function(u){u[u.CodeNone=0]="CodeNone",u[u.Code1xx=100]="Code1xx",u[u.Code2xx=200]="Code2xx",u[u.Code3xx=300]="Code3xx",u[u.Code4xx=400]="Code4xx",u[u.Code5xx=500]="Code5xx"})(px=Cw.StatusCodeClass||(Cw.StatusCodeClass={}));Cw.StatusCodeClassSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var Iw=$((Vw)=>{Object.defineProperty(Vw,"__esModule",{value:!0});Vw.BulkReplayInSerializer=void 0;var kw=y0(),yw=u8();Vw.BulkReplayInSerializer={_fromJsonObject(u){return{channel:u.channel,eventTypes:u.eventTypes,since:new Date(u.since),status:u.status!=null?kw.MessageStatusSerializer._fromJsonObject(u.status):void 0,statusCodeClass:u.statusCodeClass!=null?yw.StatusCodeClassSerializer._fromJsonObject(u.statusCodeClass):void 0,tag:u.tag,until:u.until?new Date(u.until):null}},_toJsonObject(u){return{channel:u.channel,eventTypes:u.eventTypes,since:u.since,status:u.status!=null?kw.MessageStatusSerializer._toJsonObject(u.status):void 0,statusCodeClass:u.statusCodeClass!=null?yw.StatusCodeClassSerializer._toJsonObject(u.statusCodeClass):void 0,tag:u.tag,until:u.until}}}});var gw=$((qw)=>{Object.defineProperty(qw,"__esModule",{value:!0});qw.EndpointHeadersInSerializer=void 0;qw.EndpointHeadersInSerializer={_fromJsonObject(u){return{headers:u.headers}},_toJsonObject(u){return{headers:u.headers}}}});var D8=$((_w)=>{Object.defineProperty(_w,"__esModule",{value:!0});_w.EndpointHeadersOutSerializer=void 0;_w.EndpointHeadersOutSerializer={_fromJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}},_toJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}}}});var lw=$((bw)=>{Object.defineProperty(bw,"__esModule",{value:!0});bw.EndpointHeadersPatchInSerializer=void 0;bw.EndpointHeadersPatchInSerializer={_fromJsonObject(u){return{deleteHeaders:u.deleteHeaders,headers:u.headers}},_toJsonObject(u){return{deleteHeaders:u.deleteHeaders,headers:u.headers}}}});var iw=$((dw)=>{Object.defineProperty(dw,"__esModule",{value:!0});dw.EndpointInSerializer=void 0;dw.EndpointInSerializer={_fromJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,headers:u.headers,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,headers:u.headers,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}}}});var B8=$((nw)=>{Object.defineProperty(nw,"__esModule",{value:!0});nw.EndpointOutSerializer=void 0;nw.EndpointOutSerializer={_fromJsonObject(u){return{channels:u.channels,createdAt:new Date(u.createdAt),description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,updatedAt:new Date(u.updatedAt),url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,createdAt:u.createdAt,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,updatedAt:u.updatedAt,url:u.url,version:u.version}}}});var tw=$((aw)=>{Object.defineProperty(aw,"__esModule",{value:!0});aw.EndpointPatchSerializer=void 0;aw.EndpointPatchSerializer={_fromJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}}}});var uF=$((ow)=>{Object.defineProperty(ow,"__esModule",{value:!0});ow.EndpointSecretOutSerializer=void 0;ow.EndpointSecretOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var A8=$((DF)=>{Object.defineProperty(DF,"__esModule",{value:!0});DF.EndpointSecretRotateInSerializer=void 0;DF.EndpointSecretRotateInSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var FF=$((AF)=>{Object.defineProperty(AF,"__esModule",{value:!0});AF.EndpointStatsSerializer=void 0;AF.EndpointStatsSerializer={_fromJsonObject(u){return{fail:u.fail,pending:u.pending,sending:u.sending,success:u.success}},_toJsonObject(u){return{fail:u.fail,pending:u.pending,sending:u.sending,success:u.success}}}});var $F=$((NF)=>{Object.defineProperty(NF,"__esModule",{value:!0});NF.EndpointTransformationInSerializer=void 0;NF.EndpointTransformationInSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var ZF=$((vF)=>{Object.defineProperty(vF,"__esModule",{value:!0});vF.EndpointTransformationOutSerializer=void 0;vF.EndpointTransformationOutSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled,updatedAt:u.updatedAt?new Date(u.updatedAt):null}},_toJsonObject(u){return{code:u.code,enabled:u.enabled,updatedAt:u.updatedAt}}}});var WF=$((JF)=>{Object.defineProperty(JF,"__esModule",{value:!0});JF.EndpointTransformationPatchSerializer=void 0;JF.EndpointTransformationPatchSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var hF=$((XF)=>{Object.defineProperty(XF,"__esModule",{value:!0});XF.EndpointUpdateSerializer=void 0;XF.EndpointUpdateSerializer={_fromJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}}}});var SF=$((KF)=>{Object.defineProperty(KF,"__esModule",{value:!0});KF.EventExampleInSerializer=void 0;KF.EventExampleInSerializer={_fromJsonObject(u){return{eventType:u.eventType,exampleIndex:u.exampleIndex}},_toJsonObject(u){return{eventType:u.eventType,exampleIndex:u.exampleIndex}}}});var cF=$((HF)=>{Object.defineProperty(HF,"__esModule",{value:!0});HF.ListResponseEndpointOutSerializer=void 0;var RF=B8();HF.ListResponseEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>RF.EndpointOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>RF.EndpointOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var Hu=$((MF)=>{Object.defineProperty(MF,"__esModule",{value:!0});MF.MessageOutSerializer=void 0;MF.MessageOutSerializer={_fromJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt?new Date(u.deliverAt):null,eventId:u.eventId,eventType:u.eventType,id:u.id,payload:u.payload,tags:u.tags,timestamp:new Date(u.timestamp)}},_toJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt,eventId:u.eventId,eventType:u.eventType,id:u.id,payload:u.payload,tags:u.tags,timestamp:u.timestamp}}}});var CF=$((EF)=>{Object.defineProperty(EF,"__esModule",{value:!0});EF.RecoverInSerializer=void 0;EF.RecoverInSerializer={_fromJsonObject(u){return{since:new Date(u.since),until:u.until?new Date(u.until):null}},_toJsonObject(u){return{since:u.since,until:u.until}}}});var TF=$((yF)=>{Object.defineProperty(yF,"__esModule",{value:!0});yF.RecoverOutSerializer=void 0;var PF=a2(),kF=s2();yF.RecoverOutSerializer={_fromJsonObject(u){return{id:u.id,status:PF.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:kF.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:PF.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:kF.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var mF=$((IF)=>{Object.defineProperty(IF,"__esModule",{value:!0});IF.ReplayInSerializer=void 0;IF.ReplayInSerializer={_fromJsonObject(u){return{since:new Date(u.since),until:u.until?new Date(u.until):null}},_toJsonObject(u){return{since:u.since,until:u.until}}}});var jF=$((fF)=>{Object.defineProperty(fF,"__esModule",{value:!0});fF.ReplayOutSerializer=void 0;var gF=a2(),_F=s2();fF.ReplayOutSerializer={_fromJsonObject(u){return{id:u.id,status:gF.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:_F.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:gF.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:_F.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var nF=$((rF)=>{Object.defineProperty(rF,"__esModule",{value:!0});rF.Endpoint=void 0;var ax=Iw(),sx=gw(),tx=D8(),ox=lw(),ex=iw(),t1=B8(),uS=tw(),DS=uF(),BS=A8(),AS=FF(),wS=$F(),FS=ZF(),NS=WF(),GS=hF(),$S=SF(),vS=cF(),zS=Hu(),ZS=CF(),JS=TF(),QS=mF(),lF=jF(),H=g();class dF{constructor(u){this.requestCtx=u}list(u,D){let B=new H.SvixRequest(H.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint");return B.setPathParam("app_id",u),B.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,order:D===null||D===void 0?void 0:D.order}),B.send(this.requestCtx,vS.ListResponseEndpointOutSerializer._fromJsonObject)}create(u,D,B){let A=new H.SvixRequest(H.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(ex.EndpointInSerializer._toJsonObject(D)),A.send(this.requestCtx,t1.EndpointOutSerializer._fromJsonObject)}get(u,D){let B=new H.SvixRequest(H.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,t1.EndpointOutSerializer._fromJsonObject)}update(u,D,B){let A=new H.SvixRequest(H.HttpMethod.PUT,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(GS.EndpointUpdateSerializer._toJsonObject(B)),A.send(this.requestCtx,t1.EndpointOutSerializer._fromJsonObject)}delete(u,D){let B=new H.SvixRequest(H.HttpMethod.DELETE,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.sendNoResponseBody(this.requestCtx)}patch(u,D,B){let A=new H.SvixRequest(H.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(uS.EndpointPatchSerializer._toJsonObject(B)),A.send(this.requestCtx,t1.EndpointOutSerializer._fromJsonObject)}bulkReplay(u,D,B,A){let w=new H.SvixRequest(H.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/bulk-replay");return w.setPathParam("app_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(ax.BulkReplayInSerializer._toJsonObject(B)),w.send(this.requestCtx,lF.ReplayOutSerializer._fromJsonObject)}getHeaders(u,D){let B=new H.SvixRequest(H.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,tx.EndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(u,D,B){let A=new H.SvixRequest(H.HttpMethod.PUT,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(sx.EndpointHeadersInSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}headersUpdate(u,D,B){return this.updateHeaders(u,D,B)}patchHeaders(u,D,B){let A=new H.SvixRequest(H.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(ox.EndpointHeadersPatchInSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}headersPatch(u,D,B){return this.patchHeaders(u,D,B)}recover(u,D,B,A){let w=new H.SvixRequest(H.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover");return w.setPathParam("app_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(ZS.RecoverInSerializer._toJsonObject(B)),w.send(this.requestCtx,JS.RecoverOutSerializer._fromJsonObject)}replayMissing(u,D,B,A){let w=new H.SvixRequest(H.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing");return w.setPathParam("app_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(QS.ReplayInSerializer._toJsonObject(B)),w.send(this.requestCtx,lF.ReplayOutSerializer._fromJsonObject)}getSecret(u,D){let B=new H.SvixRequest(H.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,DS.EndpointSecretOutSerializer._fromJsonObject)}rotateSecret(u,D,B,A){let w=new H.SvixRequest(H.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate");return w.setPathParam("app_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(BS.EndpointSecretRotateInSerializer._toJsonObject(B)),w.sendNoResponseBody(this.requestCtx)}sendExample(u,D,B,A){let w=new H.SvixRequest(H.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example");return w.setPathParam("app_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody($S.EventExampleInSerializer._toJsonObject(B)),w.send(this.requestCtx,zS.MessageOutSerializer._fromJsonObject)}getStats(u,D,B){let A=new H.SvixRequest(H.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setQueryParams({since:B===null||B===void 0?void 0:B.since,until:B===null||B===void 0?void 0:B.until}),A.send(this.requestCtx,AS.EndpointStatsSerializer._fromJsonObject)}transformationGet(u,D){let B=new H.SvixRequest(H.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,FS.EndpointTransformationOutSerializer._fromJsonObject)}patchTransformation(u,D,B){let A=new H.SvixRequest(H.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(NS.EndpointTransformationPatchSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}transformationPartialUpdate(u,D,B){let A=new H.SvixRequest(H.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(wS.EndpointTransformationInSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}}rF.Endpoint=dF});var w8=$((pF)=>{Object.defineProperty(pF,"__esModule",{value:!0});pF.EventTypeInSerializer=void 0;pF.EventTypeInSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas}}}});var u7=$((oF)=>{Object.defineProperty(oF,"__esModule",{value:!0});oF.EnvironmentInSerializer=void 0;var sF=e3(),tF=w8();oF.EnvironmentInSerializer={_fromJsonObject(u){var D,B;return{connectors:(D=u.connectors)===null||D===void 0?void 0:D.map((A)=>sF.ConnectorInSerializer._fromJsonObject(A)),eventTypes:(B=u.eventTypes)===null||B===void 0?void 0:B.map((A)=>tF.EventTypeInSerializer._fromJsonObject(A)),settings:u.settings}},_toJsonObject(u){var D,B;return{connectors:(D=u.connectors)===null||D===void 0?void 0:D.map((A)=>sF.ConnectorInSerializer._toJsonObject(A)),eventTypes:(B=u.eventTypes)===null||B===void 0?void 0:B.map((A)=>tF.EventTypeInSerializer._toJsonObject(A)),settings:u.settings}}}});var o1=$((D7)=>{Object.defineProperty(D7,"__esModule",{value:!0});D7.EventTypeOutSerializer=void 0;D7.EventTypeOutSerializer={_fromJsonObject(u){return{archived:u.archived,createdAt:new Date(u.createdAt),deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{archived:u.archived,createdAt:u.createdAt,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas,updatedAt:u.updatedAt}}}});var G7=$((F7)=>{Object.defineProperty(F7,"__esModule",{value:!0});F7.EnvironmentOutSerializer=void 0;var A7=a1(),w7=o1();F7.EnvironmentOutSerializer={_fromJsonObject(u){return{connectors:u.connectors.map((D)=>A7.ConnectorOutSerializer._fromJsonObject(D)),createdAt:new Date(u.createdAt),eventTypes:u.eventTypes.map((D)=>w7.EventTypeOutSerializer._fromJsonObject(D)),settings:u.settings,version:u.version}},_toJsonObject(u){return{connectors:u.connectors.map((D)=>A7.ConnectorOutSerializer._toJsonObject(D)),createdAt:u.createdAt,eventTypes:u.eventTypes.map((D)=>w7.EventTypeOutSerializer._toJsonObject(D)),settings:u.settings,version:u.version}}}});var Z7=$((v7)=>{Object.defineProperty(v7,"__esModule",{value:!0});v7.Environment=void 0;var WS=u7(),XS=G7(),e1=g();class $7{constructor(u){this.requestCtx=u}export(u){let D=new e1.SvixRequest(e1.HttpMethod.POST,"/api/v1/environment/export");return D.setHeaderParam("idempotency-key",u===null||u===void 0?void 0:u.idempotencyKey),D.send(this.requestCtx,XS.EnvironmentOutSerializer._fromJsonObject)}import(u,D){let B=new e1.SvixRequest(e1.HttpMethod.POST,"/api/v1/environment/import");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(WS.EnvironmentInSerializer._toJsonObject(u)),B.sendNoResponseBody(this.requestCtx)}}v7.Environment=$7});var W7=$((J7)=>{Object.defineProperty(J7,"__esModule",{value:!0});J7.EventTypeImportOpenApiInSerializer=void 0;J7.EventTypeImportOpenApiInSerializer={_fromJsonObject(u){return{dryRun:u.dryRun,replaceAll:u.replaceAll,spec:u.spec,specRaw:u.specRaw}},_toJsonObject(u){return{dryRun:u.dryRun,replaceAll:u.replaceAll,spec:u.spec,specRaw:u.specRaw}}}});var h7=$((X7)=>{Object.defineProperty(X7,"__esModule",{value:!0});X7.EventTypeFromOpenApiSerializer=void 0;X7.EventTypeFromOpenApiSerializer={_fromJsonObject(u){return{deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas}},_toJsonObject(u){return{deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas}}}});var R7=$((x7)=>{Object.defineProperty(x7,"__esModule",{value:!0});x7.EventTypeImportOpenApiOutDataSerializer=void 0;var K7=h7();x7.EventTypeImportOpenApiOutDataSerializer={_fromJsonObject(u){var D;return{modified:u.modified,toModify:(D=u.to_modify)===null||D===void 0?void 0:D.map((B)=>K7.EventTypeFromOpenApiSerializer._fromJsonObject(B))}},_toJsonObject(u){var D;return{modified:u.modified,to_modify:(D=u.toModify)===null||D===void 0?void 0:D.map((B)=>K7.EventTypeFromOpenApiSerializer._toJsonObject(B))}}}});var M7=$((U7)=>{Object.defineProperty(U7,"__esModule",{value:!0});U7.EventTypeImportOpenApiOutSerializer=void 0;var H7=R7();U7.EventTypeImportOpenApiOutSerializer={_fromJsonObject(u){return{data:H7.EventTypeImportOpenApiOutDataSerializer._fromJsonObject(u.data)}},_toJsonObject(u){return{data:H7.EventTypeImportOpenApiOutDataSerializer._toJsonObject(u.data)}}}});var O7=$((L7)=>{Object.defineProperty(L7,"__esModule",{value:!0});L7.EventTypePatchSerializer=void 0;L7.EventTypePatchSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,schemas:u.schemas}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,schemas:u.schemas}}}});var k7=$((C7)=>{Object.defineProperty(C7,"__esModule",{value:!0});C7.EventTypeUpdateSerializer=void 0;C7.EventTypeUpdateSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,schemas:u.schemas}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,schemas:u.schemas}}}});var I7=$((V7)=>{Object.defineProperty(V7,"__esModule",{value:!0});V7.ListResponseEventTypeOutSerializer=void 0;var y7=o1();V7.ListResponseEventTypeOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>y7.EventTypeOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>y7.EventTypeOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var _7=$((m7)=>{Object.defineProperty(m7,"__esModule",{value:!0});m7.EventType=void 0;var YS=W7(),hS=M7(),KS=w8(),uD=o1(),xS=O7(),SS=k7(),RS=I7(),J2=g();class q7{constructor(u){this.requestCtx=u}list(u){let D=new J2.SvixRequest(J2.HttpMethod.GET,"/api/v1/event-type");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order,include_archived:u===null||u===void 0?void 0:u.includeArchived,with_content:u===null||u===void 0?void 0:u.withContent}),D.send(this.requestCtx,RS.ListResponseEventTypeOutSerializer._fromJsonObject)}create(u,D){let B=new J2.SvixRequest(J2.HttpMethod.POST,"/api/v1/event-type");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(KS.EventTypeInSerializer._toJsonObject(u)),B.send(this.requestCtx,uD.EventTypeOutSerializer._fromJsonObject)}importOpenapi(u,D){let B=new J2.SvixRequest(J2.HttpMethod.POST,"/api/v1/event-type/import/openapi");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(YS.EventTypeImportOpenApiInSerializer._toJsonObject(u)),B.send(this.requestCtx,hS.EventTypeImportOpenApiOutSerializer._fromJsonObject)}get(u){let D=new J2.SvixRequest(J2.HttpMethod.GET,"/api/v1/event-type/{event_type_name}");return D.setPathParam("event_type_name",u),D.send(this.requestCtx,uD.EventTypeOutSerializer._fromJsonObject)}update(u,D){let B=new J2.SvixRequest(J2.HttpMethod.PUT,"/api/v1/event-type/{event_type_name}");return B.setPathParam("event_type_name",u),B.setBody(SS.EventTypeUpdateSerializer._toJsonObject(D)),B.send(this.requestCtx,uD.EventTypeOutSerializer._fromJsonObject)}delete(u,D){let B=new J2.SvixRequest(J2.HttpMethod.DELETE,"/api/v1/event-type/{event_type_name}");return B.setPathParam("event_type_name",u),B.setQueryParams({expunge:D===null||D===void 0?void 0:D.expunge}),B.sendNoResponseBody(this.requestCtx)}patch(u,D){let B=new J2.SvixRequest(J2.HttpMethod.PATCH,"/api/v1/event-type/{event_type_name}");return B.setPathParam("event_type_name",u),B.setBody(xS.EventTypePatchSerializer._toJsonObject(D)),B.send(this.requestCtx,uD.EventTypeOutSerializer._fromJsonObject)}}m7.EventType=q7});var d7=$((j7)=>{Object.defineProperty(j7,"__esModule",{value:!0});j7.Health=void 0;var f7=g();class b7{constructor(u){this.requestCtx=u}get(){return new f7.SvixRequest(f7.HttpMethod.GET,"/api/v1/health").sendNoResponseBody(this.requestCtx)}}j7.Health=b7});var n7=$((r7)=>{Object.defineProperty(r7,"__esModule",{value:!0});r7.IngestSourceConsumerPortalAccessInSerializer=void 0;r7.IngestSourceConsumerPortalAccessInSerializer={_fromJsonObject(u){return{expiry:u.expiry,readOnly:u.readOnly}},_toJsonObject(u){return{expiry:u.expiry,readOnly:u.readOnly}}}});var s7=$((p7)=>{Object.defineProperty(p7,"__esModule",{value:!0});p7.IngestEndpointHeadersInSerializer=void 0;p7.IngestEndpointHeadersInSerializer={_fromJsonObject(u){return{headers:u.headers}},_toJsonObject(u){return{headers:u.headers}}}});var e7=$((t7)=>{Object.defineProperty(t7,"__esModule",{value:!0});t7.IngestEndpointHeadersOutSerializer=void 0;t7.IngestEndpointHeadersOutSerializer={_fromJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}},_toJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}}}});var BN=$((uN)=>{Object.defineProperty(uN,"__esModule",{value:!0});uN.IngestEndpointInSerializer=void 0;uN.IngestEndpointInSerializer={_fromJsonObject(u){return{description:u.description,disabled:u.disabled,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,uid:u.uid,url:u.url}},_toJsonObject(u){return{description:u.description,disabled:u.disabled,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,uid:u.uid,url:u.url}}}});var F8=$((AN)=>{Object.defineProperty(AN,"__esModule",{value:!0});AN.IngestEndpointOutSerializer=void 0;AN.IngestEndpointOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),description:u.description,disabled:u.disabled,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,updatedAt:new Date(u.updatedAt),url:u.url}},_toJsonObject(u){return{createdAt:u.createdAt,description:u.description,disabled:u.disabled,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,updatedAt:u.updatedAt,url:u.url}}}});var GN=$((FN)=>{Object.defineProperty(FN,"__esModule",{value:!0});FN.IngestEndpointSecretInSerializer=void 0;FN.IngestEndpointSecretInSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var zN=$(($N)=>{Object.defineProperty($N,"__esModule",{value:!0});$N.IngestEndpointSecretOutSerializer=void 0;$N.IngestEndpointSecretOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var QN=$((ZN)=>{Object.defineProperty(ZN,"__esModule",{value:!0});ZN.IngestEndpointTransformationOutSerializer=void 0;ZN.IngestEndpointTransformationOutSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var YN=$((WN)=>{Object.defineProperty(WN,"__esModule",{value:!0});WN.IngestEndpointTransformationPatchSerializer=void 0;WN.IngestEndpointTransformationPatchSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var xN=$((hN)=>{Object.defineProperty(hN,"__esModule",{value:!0});hN.IngestEndpointUpdateSerializer=void 0;hN.IngestEndpointUpdateSerializer={_fromJsonObject(u){return{description:u.description,disabled:u.disabled,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,url:u.url}},_toJsonObject(u){return{description:u.description,disabled:u.disabled,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,url:u.url}}}});var UN=$((RN)=>{Object.defineProperty(RN,"__esModule",{value:!0});RN.ListResponseIngestEndpointOutSerializer=void 0;var SN=F8();RN.ListResponseIngestEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>SN.IngestEndpointOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>SN.IngestEndpointOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var EN=$((MN)=>{Object.defineProperty(MN,"__esModule",{value:!0});MN.IngestEndpoint=void 0;var HS=s7(),US=e7(),cS=BN(),N8=F8(),MS=GN(),LS=zN(),ES=QN(),OS=YN(),CS=xN(),PS=UN(),b=g();class cN{constructor(u){this.requestCtx=u}list(u,D){let B=new b.SvixRequest(b.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint");return B.setPathParam("source_id",u),B.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,order:D===null||D===void 0?void 0:D.order}),B.send(this.requestCtx,PS.ListResponseIngestEndpointOutSerializer._fromJsonObject)}create(u,D,B){let A=new b.SvixRequest(b.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint");return A.setPathParam("source_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(cS.IngestEndpointInSerializer._toJsonObject(D)),A.send(this.requestCtx,N8.IngestEndpointOutSerializer._fromJsonObject)}get(u,D){let B=new b.SvixRequest(b.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,N8.IngestEndpointOutSerializer._fromJsonObject)}update(u,D,B){let A=new b.SvixRequest(b.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return A.setPathParam("source_id",u),A.setPathParam("endpoint_id",D),A.setBody(CS.IngestEndpointUpdateSerializer._toJsonObject(B)),A.send(this.requestCtx,N8.IngestEndpointOutSerializer._fromJsonObject)}delete(u,D){let B=new b.SvixRequest(b.HttpMethod.DELETE,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.sendNoResponseBody(this.requestCtx)}getHeaders(u,D){let B=new b.SvixRequest(b.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,US.IngestEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(u,D,B){let A=new b.SvixRequest(b.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers");return A.setPathParam("source_id",u),A.setPathParam("endpoint_id",D),A.setBody(HS.IngestEndpointHeadersInSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}getSecret(u,D){let B=new b.SvixRequest(b.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,LS.IngestEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(u,D,B,A){let w=new b.SvixRequest(b.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate");return w.setPathParam("source_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(MS.IngestEndpointSecretInSerializer._toJsonObject(B)),w.sendNoResponseBody(this.requestCtx)}getTransformation(u,D){let B=new b.SvixRequest(b.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,ES.IngestEndpointTransformationOutSerializer._fromJsonObject)}setTransformation(u,D,B){let A=new b.SvixRequest(b.HttpMethod.PATCH,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation");return A.setPathParam("source_id",u),A.setPathParam("endpoint_id",D),A.setBody(OS.IngestEndpointTransformationPatchSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}}MN.IngestEndpoint=cN});var PN=$((ON)=>{Object.defineProperty(ON,"__esModule",{value:!0});ON.AdobeSignConfigSerializer=void 0;ON.AdobeSignConfigSerializer={_fromJsonObject(u){return{clientId:u.clientId}},_toJsonObject(u){return{clientId:u.clientId}}}});var VN=$((kN)=>{Object.defineProperty(kN,"__esModule",{value:!0});kN.AirwallexConfigSerializer=void 0;kN.AirwallexConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var qN=$((TN)=>{Object.defineProperty(TN,"__esModule",{value:!0});TN.CheckbookConfigSerializer=void 0;TN.CheckbookConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var G8=$((mN)=>{Object.defineProperty(mN,"__esModule",{value:!0});mN.CronConfigSerializer=void 0;mN.CronConfigSerializer={_fromJsonObject(u){return{contentType:u.contentType,payload:u.payload,schedule:u.schedule}},_toJsonObject(u){return{contentType:u.contentType,payload:u.payload,schedule:u.schedule}}}});var bN=$((_N)=>{Object.defineProperty(_N,"__esModule",{value:!0});_N.DocusignConfigSerializer=void 0;_N.DocusignConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var dN=$((jN)=>{Object.defineProperty(jN,"__esModule",{value:!0});jN.EasypostConfigSerializer=void 0;jN.EasypostConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var nN=$((rN)=>{Object.defineProperty(rN,"__esModule",{value:!0});rN.GithubConfigSerializer=void 0;rN.GithubConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var sN=$((pN)=>{Object.defineProperty(pN,"__esModule",{value:!0});pN.HubspotConfigSerializer=void 0;pN.HubspotConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var eN=$((tN)=>{Object.defineProperty(tN,"__esModule",{value:!0});tN.MetaConfigSerializer=void 0;tN.MetaConfigSerializer={_fromJsonObject(u){return{secret:u.secret,verifyToken:u.verifyToken}},_toJsonObject(u){return{secret:u.secret,verifyToken:u.verifyToken}}}});var BG=$((uG)=>{Object.defineProperty(uG,"__esModule",{value:!0});uG.OrumIoConfigSerializer=void 0;uG.OrumIoConfigSerializer={_fromJsonObject(u){return{publicKey:u.publicKey}},_toJsonObject(u){return{publicKey:u.publicKey}}}});var FG=$((AG)=>{Object.defineProperty(AG,"__esModule",{value:!0});AG.PandaDocConfigSerializer=void 0;AG.PandaDocConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var $G=$((NG)=>{Object.defineProperty(NG,"__esModule",{value:!0});NG.PortIoConfigSerializer=void 0;NG.PortIoConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var ZG=$((vG)=>{Object.defineProperty(vG,"__esModule",{value:!0});vG.RutterConfigSerializer=void 0;vG.RutterConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var WG=$((JG)=>{Object.defineProperty(JG,"__esModule",{value:!0});JG.SegmentConfigSerializer=void 0;JG.SegmentConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var hG=$((XG)=>{Object.defineProperty(XG,"__esModule",{value:!0});XG.ShopifyConfigSerializer=void 0;XG.ShopifyConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var SG=$((KG)=>{Object.defineProperty(KG,"__esModule",{value:!0});KG.SlackConfigSerializer=void 0;KG.SlackConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var UG=$((RG)=>{Object.defineProperty(RG,"__esModule",{value:!0});RG.StripeConfigSerializer=void 0;RG.StripeConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var LG=$((cG)=>{Object.defineProperty(cG,"__esModule",{value:!0});cG.SvixConfigSerializer=void 0;cG.SvixConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var CG=$((EG)=>{Object.defineProperty(EG,"__esModule",{value:!0});EG.TelnyxConfigSerializer=void 0;EG.TelnyxConfigSerializer={_fromJsonObject(u){return{publicKey:u.publicKey}},_toJsonObject(u){return{publicKey:u.publicKey}}}});var yG=$((PG)=>{Object.defineProperty(PG,"__esModule",{value:!0});PG.VapiConfigSerializer=void 0;PG.VapiConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var IG=$((VG)=>{Object.defineProperty(VG,"__esModule",{value:!0});VG.VeriffConfigSerializer=void 0;VG.VeriffConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var gG=$((qG)=>{Object.defineProperty(qG,"__esModule",{value:!0});qG.ZoomConfigSerializer=void 0;qG.ZoomConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var $$=$((N$)=>{Object.defineProperty(N$,"__esModule",{value:!0});N$.IngestSourceInSerializer=void 0;var _G=PN(),fG=VN(),bG=qN(),jG=G8(),lG=bN(),dG=dN(),rG=nN(),iG=sN(),nG=eN(),pG=BG(),aG=FG(),sG=$G(),tG=ZG(),oG=WG(),eG=hG(),u$=SG(),D$=UG(),C=LG(),B$=CG(),A$=yG(),w$=IG(),F$=gG();N$.IngestSourceInSerializer={_fromJsonObject(u){let D=u.type;function B(A){switch(A){case"generic-webhook":return{};case"cron":return jG.CronConfigSerializer._fromJsonObject(u.config);case"adobe-sign":return _G.AdobeSignConfigSerializer._fromJsonObject(u.config);case"beehiiv":return C.SvixConfigSerializer._fromJsonObject(u.config);case"brex":return C.SvixConfigSerializer._fromJsonObject(u.config);case"checkbook":return bG.CheckbookConfigSerializer._fromJsonObject(u.config);case"clerk":return C.SvixConfigSerializer._fromJsonObject(u.config);case"docusign":return lG.DocusignConfigSerializer._fromJsonObject(u.config);case"easypost":return dG.EasypostConfigSerializer._fromJsonObject(u.config);case"github":return rG.GithubConfigSerializer._fromJsonObject(u.config);case"guesty":return C.SvixConfigSerializer._fromJsonObject(u.config);case"hubspot":return iG.HubspotConfigSerializer._fromJsonObject(u.config);case"incident-io":return C.SvixConfigSerializer._fromJsonObject(u.config);case"lithic":return C.SvixConfigSerializer._fromJsonObject(u.config);case"meta":return nG.MetaConfigSerializer._fromJsonObject(u.config);case"nash":return C.SvixConfigSerializer._fromJsonObject(u.config);case"orum-io":return pG.OrumIoConfigSerializer._fromJsonObject(u.config);case"panda-doc":return aG.PandaDocConfigSerializer._fromJsonObject(u.config);case"port-io":return sG.PortIoConfigSerializer._fromJsonObject(u.config);case"pleo":return C.SvixConfigSerializer._fromJsonObject(u.config);case"psi-fi":return C.SvixConfigSerializer._fromJsonObject(u.config);case"replicate":return C.SvixConfigSerializer._fromJsonObject(u.config);case"resend":return C.SvixConfigSerializer._fromJsonObject(u.config);case"rutter":return tG.RutterConfigSerializer._fromJsonObject(u.config);case"safebase":return C.SvixConfigSerializer._fromJsonObject(u.config);case"sardine":return C.SvixConfigSerializer._fromJsonObject(u.config);case"segment":return oG.SegmentConfigSerializer._fromJsonObject(u.config);case"shopify":return eG.ShopifyConfigSerializer._fromJsonObject(u.config);case"slack":return u$.SlackConfigSerializer._fromJsonObject(u.config);case"stripe":return D$.StripeConfigSerializer._fromJsonObject(u.config);case"stych":return C.SvixConfigSerializer._fromJsonObject(u.config);case"svix":return C.SvixConfigSerializer._fromJsonObject(u.config);case"zoom":return F$.ZoomConfigSerializer._fromJsonObject(u.config);case"telnyx":return B$.TelnyxConfigSerializer._fromJsonObject(u.config);case"vapi":return A$.VapiConfigSerializer._fromJsonObject(u.config);case"open-ai":return C.SvixConfigSerializer._fromJsonObject(u.config);case"render":return C.SvixConfigSerializer._fromJsonObject(u.config);case"veriff":return w$.VeriffConfigSerializer._fromJsonObject(u.config);case"airwallex":return fG.AirwallexConfigSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${A}`)}}return{type:D,config:B(D),metadata:u.metadata,name:u.name,uid:u.uid}},_toJsonObject(u){let D;switch(u.type){case"generic-webhook":D={};break;case"cron":D=jG.CronConfigSerializer._toJsonObject(u.config);break;case"adobe-sign":D=_G.AdobeSignConfigSerializer._toJsonObject(u.config);break;case"beehiiv":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"brex":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"checkbook":D=bG.CheckbookConfigSerializer._toJsonObject(u.config);break;case"clerk":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"docusign":D=lG.DocusignConfigSerializer._toJsonObject(u.config);break;case"easypost":D=dG.EasypostConfigSerializer._toJsonObject(u.config);break;case"github":D=rG.GithubConfigSerializer._toJsonObject(u.config);break;case"guesty":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"hubspot":D=iG.HubspotConfigSerializer._toJsonObject(u.config);break;case"incident-io":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"lithic":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"meta":D=nG.MetaConfigSerializer._toJsonObject(u.config);break;case"nash":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"orum-io":D=pG.OrumIoConfigSerializer._toJsonObject(u.config);break;case"panda-doc":D=aG.PandaDocConfigSerializer._toJsonObject(u.config);break;case"port-io":D=sG.PortIoConfigSerializer._toJsonObject(u.config);break;case"pleo":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"psi-fi":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"replicate":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"resend":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"rutter":D=tG.RutterConfigSerializer._toJsonObject(u.config);break;case"safebase":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"sardine":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"segment":D=oG.SegmentConfigSerializer._toJsonObject(u.config);break;case"shopify":D=eG.ShopifyConfigSerializer._toJsonObject(u.config);break;case"slack":D=u$.SlackConfigSerializer._toJsonObject(u.config);break;case"stripe":D=D$.StripeConfigSerializer._toJsonObject(u.config);break;case"stych":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"svix":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"zoom":D=F$.ZoomConfigSerializer._toJsonObject(u.config);break;case"telnyx":D=B$.TelnyxConfigSerializer._toJsonObject(u.config);break;case"vapi":D=A$.VapiConfigSerializer._toJsonObject(u.config);break;case"open-ai":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"render":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"veriff":D=w$.VeriffConfigSerializer._toJsonObject(u.config);break;case"airwallex":D=fG.AirwallexConfigSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,metadata:u.metadata,name:u.name,uid:u.uid}}}});var Z$=$((v$)=>{Object.defineProperty(v$,"__esModule",{value:!0});v$.AdobeSignConfigOutSerializer=void 0;v$.AdobeSignConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var W$=$((J$)=>{Object.defineProperty(J$,"__esModule",{value:!0});J$.AirwallexConfigOutSerializer=void 0;J$.AirwallexConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var h$=$((X$)=>{Object.defineProperty(X$,"__esModule",{value:!0});X$.CheckbookConfigOutSerializer=void 0;X$.CheckbookConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var S$=$((K$)=>{Object.defineProperty(K$,"__esModule",{value:!0});K$.DocusignConfigOutSerializer=void 0;K$.DocusignConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var U$=$((R$)=>{Object.defineProperty(R$,"__esModule",{value:!0});R$.EasypostConfigOutSerializer=void 0;R$.EasypostConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var L$=$((c$)=>{Object.defineProperty(c$,"__esModule",{value:!0});c$.GithubConfigOutSerializer=void 0;c$.GithubConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var C$=$((E$)=>{Object.defineProperty(E$,"__esModule",{value:!0});E$.HubspotConfigOutSerializer=void 0;E$.HubspotConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var y$=$((P$)=>{Object.defineProperty(P$,"__esModule",{value:!0});P$.MetaConfigOutSerializer=void 0;P$.MetaConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var I$=$((V$)=>{Object.defineProperty(V$,"__esModule",{value:!0});V$.OrumIoConfigOutSerializer=void 0;V$.OrumIoConfigOutSerializer={_fromJsonObject(u){return{publicKey:u.publicKey}},_toJsonObject(u){return{publicKey:u.publicKey}}}});var g$=$((q$)=>{Object.defineProperty(q$,"__esModule",{value:!0});q$.PandaDocConfigOutSerializer=void 0;q$.PandaDocConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var b$=$((_$)=>{Object.defineProperty(_$,"__esModule",{value:!0});_$.PortIoConfigOutSerializer=void 0;_$.PortIoConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var d$=$((j$)=>{Object.defineProperty(j$,"__esModule",{value:!0});j$.RutterConfigOutSerializer=void 0;j$.RutterConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var n$=$((r$)=>{Object.defineProperty(r$,"__esModule",{value:!0});r$.SegmentConfigOutSerializer=void 0;r$.SegmentConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var s$=$((p$)=>{Object.defineProperty(p$,"__esModule",{value:!0});p$.ShopifyConfigOutSerializer=void 0;p$.ShopifyConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var e$=$((t$)=>{Object.defineProperty(t$,"__esModule",{value:!0});t$.SlackConfigOutSerializer=void 0;t$.SlackConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Bv=$((uv)=>{Object.defineProperty(uv,"__esModule",{value:!0});uv.StripeConfigOutSerializer=void 0;uv.StripeConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Fv=$((Av)=>{Object.defineProperty(Av,"__esModule",{value:!0});Av.SvixConfigOutSerializer=void 0;Av.SvixConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var $v=$((Nv)=>{Object.defineProperty(Nv,"__esModule",{value:!0});Nv.TelnyxConfigOutSerializer=void 0;Nv.TelnyxConfigOutSerializer={_fromJsonObject(u){return{publicKey:u.publicKey}},_toJsonObject(u){return{publicKey:u.publicKey}}}});var Zv=$((vv)=>{Object.defineProperty(vv,"__esModule",{value:!0});vv.VapiConfigOutSerializer=void 0;vv.VapiConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Wv=$((Jv)=>{Object.defineProperty(Jv,"__esModule",{value:!0});Jv.VeriffConfigOutSerializer=void 0;Jv.VeriffConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var hv=$((Xv)=>{Object.defineProperty(Xv,"__esModule",{value:!0});Xv.ZoomConfigOutSerializer=void 0;Xv.ZoomConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var $8=$((_v)=>{Object.defineProperty(_v,"__esModule",{value:!0});_v.IngestSourceOutSerializer=void 0;var Kv=Z$(),xv=W$(),Sv=h$(),Rv=G8(),Hv=S$(),Uv=U$(),cv=L$(),Mv=C$(),Lv=y$(),Ev=I$(),Ov=g$(),Cv=b$(),Pv=d$(),kv=n$(),yv=s$(),Vv=e$(),Tv=Bv(),P=Fv(),Iv=$v(),qv=Zv(),mv=Wv(),gv=hv();_v.IngestSourceOutSerializer={_fromJsonObject(u){let D=u.type;function B(A){switch(A){case"generic-webhook":return{};case"cron":return Rv.CronConfigSerializer._fromJsonObject(u.config);case"adobe-sign":return Kv.AdobeSignConfigOutSerializer._fromJsonObject(u.config);case"beehiiv":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"brex":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"checkbook":return Sv.CheckbookConfigOutSerializer._fromJsonObject(u.config);case"clerk":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"docusign":return Hv.DocusignConfigOutSerializer._fromJsonObject(u.config);case"easypost":return Uv.EasypostConfigOutSerializer._fromJsonObject(u.config);case"github":return cv.GithubConfigOutSerializer._fromJsonObject(u.config);case"guesty":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"hubspot":return Mv.HubspotConfigOutSerializer._fromJsonObject(u.config);case"incident-io":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"lithic":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"meta":return Lv.MetaConfigOutSerializer._fromJsonObject(u.config);case"nash":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"orum-io":return Ev.OrumIoConfigOutSerializer._fromJsonObject(u.config);case"panda-doc":return Ov.PandaDocConfigOutSerializer._fromJsonObject(u.config);case"port-io":return Cv.PortIoConfigOutSerializer._fromJsonObject(u.config);case"psi-fi":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"pleo":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"replicate":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"resend":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"rutter":return Pv.RutterConfigOutSerializer._fromJsonObject(u.config);case"safebase":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"sardine":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"segment":return kv.SegmentConfigOutSerializer._fromJsonObject(u.config);case"shopify":return yv.ShopifyConfigOutSerializer._fromJsonObject(u.config);case"slack":return Vv.SlackConfigOutSerializer._fromJsonObject(u.config);case"stripe":return Tv.StripeConfigOutSerializer._fromJsonObject(u.config);case"stych":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"svix":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"zoom":return gv.ZoomConfigOutSerializer._fromJsonObject(u.config);case"telnyx":return Iv.TelnyxConfigOutSerializer._fromJsonObject(u.config);case"vapi":return qv.VapiConfigOutSerializer._fromJsonObject(u.config);case"open-ai":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"render":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"veriff":return mv.VeriffConfigOutSerializer._fromJsonObject(u.config);case"airwallex":return xv.AirwallexConfigOutSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${A}`)}}return{type:D,config:B(D),createdAt:new Date(u.createdAt),id:u.id,ingestUrl:u.ingestUrl,metadata:u.metadata,name:u.name,uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){let D;switch(u.type){case"generic-webhook":D={};break;case"cron":D=Rv.CronConfigSerializer._toJsonObject(u.config);break;case"adobe-sign":D=Kv.AdobeSignConfigOutSerializer._toJsonObject(u.config);break;case"beehiiv":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"brex":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"checkbook":D=Sv.CheckbookConfigOutSerializer._toJsonObject(u.config);break;case"clerk":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"docusign":D=Hv.DocusignConfigOutSerializer._toJsonObject(u.config);break;case"easypost":D=Uv.EasypostConfigOutSerializer._toJsonObject(u.config);break;case"github":D=cv.GithubConfigOutSerializer._toJsonObject(u.config);break;case"guesty":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"hubspot":D=Mv.HubspotConfigOutSerializer._toJsonObject(u.config);break;case"incident-io":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"lithic":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"meta":D=Lv.MetaConfigOutSerializer._toJsonObject(u.config);break;case"nash":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"orum-io":D=Ev.OrumIoConfigOutSerializer._toJsonObject(u.config);break;case"panda-doc":D=Ov.PandaDocConfigOutSerializer._toJsonObject(u.config);break;case"port-io":D=Cv.PortIoConfigOutSerializer._toJsonObject(u.config);break;case"psi-fi":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"pleo":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"replicate":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"resend":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"rutter":D=Pv.RutterConfigOutSerializer._toJsonObject(u.config);break;case"safebase":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"sardine":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"segment":D=kv.SegmentConfigOutSerializer._toJsonObject(u.config);break;case"shopify":D=yv.ShopifyConfigOutSerializer._toJsonObject(u.config);break;case"slack":D=Vv.SlackConfigOutSerializer._toJsonObject(u.config);break;case"stripe":D=Tv.StripeConfigOutSerializer._toJsonObject(u.config);break;case"stych":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"svix":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"zoom":D=gv.ZoomConfigOutSerializer._toJsonObject(u.config);break;case"telnyx":D=Iv.TelnyxConfigOutSerializer._toJsonObject(u.config);break;case"vapi":D=qv.VapiConfigOutSerializer._toJsonObject(u.config);break;case"open-ai":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"render":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"veriff":D=mv.VeriffConfigOutSerializer._toJsonObject(u.config);break;case"airwallex":D=xv.AirwallexConfigOutSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,createdAt:u.createdAt,id:u.id,ingestUrl:u.ingestUrl,metadata:u.metadata,name:u.name,uid:u.uid,updatedAt:u.updatedAt}}}});var dv=$((jv)=>{Object.defineProperty(jv,"__esModule",{value:!0});jv.ListResponseIngestSourceOutSerializer=void 0;var bv=$8();jv.ListResponseIngestSourceOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>bv.IngestSourceOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>bv.IngestSourceOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var nv=$((rv)=>{Object.defineProperty(rv,"__esModule",{value:!0});rv.RotateTokenOutSerializer=void 0;rv.RotateTokenOutSerializer={_fromJsonObject(u){return{ingestUrl:u.ingestUrl}},_toJsonObject(u){return{ingestUrl:u.ingestUrl}}}});var ov=$((sv)=>{Object.defineProperty(sv,"__esModule",{value:!0});sv.IngestSource=void 0;var pv=$$(),v8=$8(),kS=dv(),yS=nv(),M2=g();class av{constructor(u){this.requestCtx=u}list(u){let D=new M2.SvixRequest(M2.HttpMethod.GET,"/ingest/api/v1/source");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,kS.ListResponseIngestSourceOutSerializer._fromJsonObject)}create(u,D){let B=new M2.SvixRequest(M2.HttpMethod.POST,"/ingest/api/v1/source");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(pv.IngestSourceInSerializer._toJsonObject(u)),B.send(this.requestCtx,v8.IngestSourceOutSerializer._fromJsonObject)}get(u){let D=new M2.SvixRequest(M2.HttpMethod.GET,"/ingest/api/v1/source/{source_id}");return D.setPathParam("source_id",u),D.send(this.requestCtx,v8.IngestSourceOutSerializer._fromJsonObject)}update(u,D){let B=new M2.SvixRequest(M2.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}");return B.setPathParam("source_id",u),B.setBody(pv.IngestSourceInSerializer._toJsonObject(D)),B.send(this.requestCtx,v8.IngestSourceOutSerializer._fromJsonObject)}delete(u){let D=new M2.SvixRequest(M2.HttpMethod.DELETE,"/ingest/api/v1/source/{source_id}");return D.setPathParam("source_id",u),D.sendNoResponseBody(this.requestCtx)}rotateToken(u,D){let B=new M2.SvixRequest(M2.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/token/rotate");return B.setPathParam("source_id",u),B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.send(this.requestCtx,yS.RotateTokenOutSerializer._fromJsonObject)}}sv.IngestSource=av});var Az=$((Dz)=>{Object.defineProperty(Dz,"__esModule",{value:!0});Dz.Ingest=void 0;var VS=t3(),TS=n7(),IS=EN(),qS=ov(),ev=g();class uz{constructor(u){this.requestCtx=u}get endpoint(){return new IS.IngestEndpoint(this.requestCtx)}get source(){return new qS.IngestSource(this.requestCtx)}dashboard(u,D,B){let A=new ev.SvixRequest(ev.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/dashboard");return A.setPathParam("source_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(TS.IngestSourceConsumerPortalAccessInSerializer._toJsonObject(D)),A.send(this.requestCtx,VS.DashboardAccessOutSerializer._fromJsonObject)}}Dz.Ingest=uz});var Nz=$((wz)=>{Object.defineProperty(wz,"__esModule",{value:!0});wz.IntegrationInSerializer=void 0;wz.IntegrationInSerializer={_fromJsonObject(u){return{featureFlags:u.featureFlags,name:u.name}},_toJsonObject(u){return{featureFlags:u.featureFlags,name:u.name}}}});var vz=$((Gz)=>{Object.defineProperty(Gz,"__esModule",{value:!0});Gz.IntegrationKeyOutSerializer=void 0;Gz.IntegrationKeyOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var z8=$((zz)=>{Object.defineProperty(zz,"__esModule",{value:!0});zz.IntegrationOutSerializer=void 0;zz.IntegrationOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),featureFlags:u.featureFlags,id:u.id,name:u.name,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{createdAt:u.createdAt,featureFlags:u.featureFlags,id:u.id,name:u.name,updatedAt:u.updatedAt}}}});var Wz=$((Jz)=>{Object.defineProperty(Jz,"__esModule",{value:!0});Jz.IntegrationUpdateSerializer=void 0;Jz.IntegrationUpdateSerializer={_fromJsonObject(u){return{featureFlags:u.featureFlags,name:u.name}},_toJsonObject(u){return{featureFlags:u.featureFlags,name:u.name}}}});var Kz=$((Yz)=>{Object.defineProperty(Yz,"__esModule",{value:!0});Yz.ListResponseIntegrationOutSerializer=void 0;var Xz=z8();Yz.ListResponseIntegrationOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>Xz.IntegrationOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>Xz.IntegrationOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var Uz=$((Rz)=>{Object.defineProperty(Rz,"__esModule",{value:!0});Rz.Integration=void 0;var mS=Nz(),xz=vz(),Z8=z8(),gS=Wz(),_S=Kz(),Q2=g();class Sz{constructor(u){this.requestCtx=u}list(u,D){let B=new Q2.SvixRequest(Q2.HttpMethod.GET,"/api/v1/app/{app_id}/integration");return B.setPathParam("app_id",u),B.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,order:D===null||D===void 0?void 0:D.order}),B.send(this.requestCtx,_S.ListResponseIntegrationOutSerializer._fromJsonObject)}create(u,D,B){let A=new Q2.SvixRequest(Q2.HttpMethod.POST,"/api/v1/app/{app_id}/integration");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(mS.IntegrationInSerializer._toJsonObject(D)),A.send(this.requestCtx,Z8.IntegrationOutSerializer._fromJsonObject)}get(u,D){let B=new Q2.SvixRequest(Q2.HttpMethod.GET,"/api/v1/app/{app_id}/integration/{integ_id}");return B.setPathParam("app_id",u),B.setPathParam("integ_id",D),B.send(this.requestCtx,Z8.IntegrationOutSerializer._fromJsonObject)}update(u,D,B){let A=new Q2.SvixRequest(Q2.HttpMethod.PUT,"/api/v1/app/{app_id}/integration/{integ_id}");return A.setPathParam("app_id",u),A.setPathParam("integ_id",D),A.setBody(gS.IntegrationUpdateSerializer._toJsonObject(B)),A.send(this.requestCtx,Z8.IntegrationOutSerializer._fromJsonObject)}delete(u,D){let B=new Q2.SvixRequest(Q2.HttpMethod.DELETE,"/api/v1/app/{app_id}/integration/{integ_id}");return B.setPathParam("app_id",u),B.setPathParam("integ_id",D),B.sendNoResponseBody(this.requestCtx)}getKey(u,D){let B=new Q2.SvixRequest(Q2.HttpMethod.GET,"/api/v1/app/{app_id}/integration/{integ_id}/key");return B.setPathParam("app_id",u),B.setPathParam("integ_id",D),B.send(this.requestCtx,xz.IntegrationKeyOutSerializer._fromJsonObject)}rotateKey(u,D,B){let A=new Q2.SvixRequest(Q2.HttpMethod.POST,"/api/v1/app/{app_id}/integration/{integ_id}/key/rotate");return A.setPathParam("app_id",u),A.setPathParam("integ_id",D),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.send(this.requestCtx,xz.IntegrationKeyOutSerializer._fromJsonObject)}}Rz.Integration=Sz});var Oz=$((Lz)=>{Object.defineProperty(Lz,"__esModule",{value:!0});Lz.ExpungeAllContentsOutSerializer=void 0;var cz=a2(),Mz=s2();Lz.ExpungeAllContentsOutSerializer={_fromJsonObject(u){return{id:u.id,status:cz.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:Mz.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:cz.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:Mz.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var yz=$((Pz)=>{Object.defineProperty(Pz,"__esModule",{value:!0});Pz.ListResponseMessageOutSerializer=void 0;var Cz=Hu();Pz.ListResponseMessageOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>Cz.MessageOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>Cz.MessageOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var Iz=$((Vz)=>{Object.defineProperty(Vz,"__esModule",{value:!0});Vz.MessagePrecheckInSerializer=void 0;Vz.MessagePrecheckInSerializer={_fromJsonObject(u){return{channels:u.channels,eventType:u.eventType}},_toJsonObject(u){return{channels:u.channels,eventType:u.eventType}}}});var gz=$((qz)=>{Object.defineProperty(qz,"__esModule",{value:!0});qz.MessagePrecheckOutSerializer=void 0;qz.MessagePrecheckOutSerializer={_fromJsonObject(u){return{active:u.active}},_toJsonObject(u){return{active:u.active}}}});var bz=$((_z)=>{Object.defineProperty(_z,"__esModule",{value:!0});_z.PollingEndpointConsumerSeekInSerializer=void 0;_z.PollingEndpointConsumerSeekInSerializer={_fromJsonObject(u){return{after:new Date(u.after)}},_toJsonObject(u){return{after:u.after}}}});var dz=$((jz)=>{Object.defineProperty(jz,"__esModule",{value:!0});jz.PollingEndpointConsumerSeekOutSerializer=void 0;jz.PollingEndpointConsumerSeekOutSerializer={_fromJsonObject(u){return{iterator:u.iterator}},_toJsonObject(u){return{iterator:u.iterator}}}});var nz=$((rz)=>{Object.defineProperty(rz,"__esModule",{value:!0});rz.PollingEndpointMessageOutSerializer=void 0;rz.PollingEndpointMessageOutSerializer={_fromJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt?new Date(u.deliverAt):null,eventId:u.eventId,eventType:u.eventType,headers:u.headers,id:u.id,payload:u.payload,tags:u.tags,timestamp:new Date(u.timestamp)}},_toJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt,eventId:u.eventId,eventType:u.eventType,headers:u.headers,id:u.id,payload:u.payload,tags:u.tags,timestamp:u.timestamp}}}});var tz=$((az)=>{Object.defineProperty(az,"__esModule",{value:!0});az.PollingEndpointOutSerializer=void 0;var pz=nz();az.PollingEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>pz.PollingEndpointMessageOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator}},_toJsonObject(u){return{data:u.data.map((D)=>pz.PollingEndpointMessageOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator}}}});var BZ=$((uZ)=>{Object.defineProperty(uZ,"__esModule",{value:!0});uZ.MessagePoller=void 0;var fS=bz(),bS=dz(),oz=tz(),V0=g();class ez{constructor(u){this.requestCtx=u}poll(u,D,B){let A=new V0.SvixRequest(V0.HttpMethod.GET,"/api/v1/app/{app_id}/poller/{sink_id}");return A.setPathParam("app_id",u),A.setPathParam("sink_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator,event_type:B===null||B===void 0?void 0:B.eventType,channel:B===null||B===void 0?void 0:B.channel,after:B===null||B===void 0?void 0:B.after}),A.send(this.requestCtx,oz.PollingEndpointOutSerializer._fromJsonObject)}consumerPoll(u,D,B,A){let w=new V0.SvixRequest(V0.HttpMethod.GET,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}");return w.setPathParam("app_id",u),w.setPathParam("sink_id",D),w.setPathParam("consumer_id",B),w.setQueryParams({limit:A===null||A===void 0?void 0:A.limit,iterator:A===null||A===void 0?void 0:A.iterator}),w.send(this.requestCtx,oz.PollingEndpointOutSerializer._fromJsonObject)}consumerSeek(u,D,B,A,w){let F=new V0.SvixRequest(V0.HttpMethod.POST,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}/seek");return F.setPathParam("app_id",u),F.setPathParam("sink_id",D),F.setPathParam("consumer_id",B),F.setHeaderParam("idempotency-key",w===null||w===void 0?void 0:w.idempotencyKey),F.setBody(fS.PollingEndpointConsumerSeekInSerializer._toJsonObject(A)),F.send(this.requestCtx,bS.PollingEndpointConsumerSeekOutSerializer._fromJsonObject)}}uZ.MessagePoller=ez});var NZ=$((wZ)=>{Object.defineProperty(wZ,"__esModule",{value:!0});wZ.MessageInSerializer=void 0;var AZ=i1();wZ.MessageInSerializer={_fromJsonObject(u){return{application:u.application!=null?AZ.ApplicationInSerializer._fromJsonObject(u.application):void 0,channels:u.channels,deliverAt:u.deliverAt?new Date(u.deliverAt):null,eventId:u.eventId,eventType:u.eventType,payload:u.payload,payloadRetentionHours:u.payloadRetentionHours,payloadRetentionPeriod:u.payloadRetentionPeriod,tags:u.tags,transformationsParams:u.transformationsParams}},_toJsonObject(u){return{application:u.application!=null?AZ.ApplicationInSerializer._toJsonObject(u.application):void 0,channels:u.channels,deliverAt:u.deliverAt,eventId:u.eventId,eventType:u.eventType,payload:u.payload,payloadRetentionHours:u.payloadRetentionHours,payloadRetentionPeriod:u.payloadRetentionPeriod,tags:u.tags,transformationsParams:u.transformationsParams}}}});var J8=$((vZ)=>{Object.defineProperty(vZ,"__esModule",{value:!0});vZ.messageInRaw=vZ.Message=void 0;var jS=Oz(),lS=yz(),GZ=Hu(),dS=Iz(),rS=gz(),iS=BZ(),L2=g(),nS=NZ();class $Z{constructor(u){this.requestCtx=u}get poller(){return new iS.MessagePoller(this.requestCtx)}list(u,D){let B=new L2.SvixRequest(L2.HttpMethod.GET,"/api/v1/app/{app_id}/msg");return B.setPathParam("app_id",u),B.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,channel:D===null||D===void 0?void 0:D.channel,before:D===null||D===void 0?void 0:D.before,after:D===null||D===void 0?void 0:D.after,with_content:D===null||D===void 0?void 0:D.withContent,tag:D===null||D===void 0?void 0:D.tag,event_types:D===null||D===void 0?void 0:D.eventTypes}),B.send(this.requestCtx,lS.ListResponseMessageOutSerializer._fromJsonObject)}create(u,D,B){let A=new L2.SvixRequest(L2.HttpMethod.POST,"/api/v1/app/{app_id}/msg");return A.setPathParam("app_id",u),A.setQueryParams({with_content:B===null||B===void 0?void 0:B.withContent}),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(nS.MessageInSerializer._toJsonObject(D)),A.send(this.requestCtx,GZ.MessageOutSerializer._fromJsonObject)}expungeAllContents(u,D){let B=new L2.SvixRequest(L2.HttpMethod.POST,"/api/v1/app/{app_id}/msg/expunge-all-contents");return B.setPathParam("app_id",u),B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.send(this.requestCtx,jS.ExpungeAllContentsOutSerializer._fromJsonObject)}precheck(u,D,B){let A=new L2.SvixRequest(L2.HttpMethod.POST,"/api/v1/app/{app_id}/msg/precheck/active");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(dS.MessagePrecheckInSerializer._toJsonObject(D)),A.send(this.requestCtx,rS.MessagePrecheckOutSerializer._fromJsonObject)}get(u,D,B){let A=new L2.SvixRequest(L2.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}");return A.setPathParam("app_id",u),A.setPathParam("msg_id",D),A.setQueryParams({with_content:B===null||B===void 0?void 0:B.withContent}),A.send(this.requestCtx,GZ.MessageOutSerializer._fromJsonObject)}expungeContent(u,D){let B=new L2.SvixRequest(L2.HttpMethod.DELETE,"/api/v1/app/{app_id}/msg/{msg_id}/content");return B.setPathParam("app_id",u),B.setPathParam("msg_id",D),B.sendNoResponseBody(this.requestCtx)}}vZ.Message=$Z;function pS(u,D,B){return{eventType:u,payload:{},transformationsParams:{rawPayload:D,headers:B?{"content-type":B}:void 0}}}vZ.messageInRaw=pS});var Q8=$((ZZ)=>{Object.defineProperty(ZZ,"__esModule",{value:!0});ZZ.EmptyResponseSerializer=void 0;ZZ.EmptyResponseSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Uu=$((WZ)=>{Object.defineProperty(WZ,"__esModule",{value:!0});WZ.MessageStatusTextSerializer=WZ.MessageStatusText=void 0;var sS;(function(u){u.Success="success",u.Pending="pending",u.Fail="fail",u.Sending="sending"})(sS=WZ.MessageStatusText||(WZ.MessageStatusText={}));WZ.MessageStatusTextSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var SZ=$((KZ)=>{Object.defineProperty(KZ,"__esModule",{value:!0});KZ.EndpointMessageOutSerializer=void 0;var YZ=y0(),hZ=Uu();KZ.EndpointMessageOutSerializer={_fromJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt?new Date(u.deliverAt):null,eventId:u.eventId,eventType:u.eventType,id:u.id,nextAttempt:u.nextAttempt?new Date(u.nextAttempt):null,payload:u.payload,status:YZ.MessageStatusSerializer._fromJsonObject(u.status),statusText:hZ.MessageStatusTextSerializer._fromJsonObject(u.statusText),tags:u.tags,timestamp:new Date(u.timestamp)}},_toJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt,eventId:u.eventId,eventType:u.eventType,id:u.id,nextAttempt:u.nextAttempt,payload:u.payload,status:YZ.MessageStatusSerializer._toJsonObject(u.status),statusText:hZ.MessageStatusTextSerializer._toJsonObject(u.statusText),tags:u.tags,timestamp:u.timestamp}}}});var cZ=$((HZ)=>{Object.defineProperty(HZ,"__esModule",{value:!0});HZ.ListResponseEndpointMessageOutSerializer=void 0;var RZ=SZ();HZ.ListResponseEndpointMessageOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>RZ.EndpointMessageOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>RZ.EndpointMessageOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var W8=$((LZ)=>{Object.defineProperty(LZ,"__esModule",{value:!0});LZ.MessageAttemptTriggerTypeSerializer=LZ.MessageAttemptTriggerType=void 0;var tS;(function(u){u[u.Scheduled=0]="Scheduled",u[u.Manual=1]="Manual"})(tS=LZ.MessageAttemptTriggerType||(LZ.MessageAttemptTriggerType={}));LZ.MessageAttemptTriggerTypeSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var X8=$((yZ)=>{Object.defineProperty(yZ,"__esModule",{value:!0});yZ.MessageAttemptOutSerializer=void 0;var OZ=W8(),CZ=Hu(),PZ=y0(),kZ=Uu();yZ.MessageAttemptOutSerializer={_fromJsonObject(u){return{endpointId:u.endpointId,id:u.id,msg:u.msg!=null?CZ.MessageOutSerializer._fromJsonObject(u.msg):void 0,msgId:u.msgId,response:u.response,responseDurationMs:u.responseDurationMs,responseStatusCode:u.responseStatusCode,status:PZ.MessageStatusSerializer._fromJsonObject(u.status),statusText:kZ.MessageStatusTextSerializer._fromJsonObject(u.statusText),timestamp:new Date(u.timestamp),triggerType:OZ.MessageAttemptTriggerTypeSerializer._fromJsonObject(u.triggerType),url:u.url}},_toJsonObject(u){return{endpointId:u.endpointId,id:u.id,msg:u.msg!=null?CZ.MessageOutSerializer._toJsonObject(u.msg):void 0,msgId:u.msgId,response:u.response,responseDurationMs:u.responseDurationMs,responseStatusCode:u.responseStatusCode,status:PZ.MessageStatusSerializer._toJsonObject(u.status),statusText:kZ.MessageStatusTextSerializer._toJsonObject(u.statusText),timestamp:u.timestamp,triggerType:OZ.MessageAttemptTriggerTypeSerializer._toJsonObject(u.triggerType),url:u.url}}}});var mZ=$((IZ)=>{Object.defineProperty(IZ,"__esModule",{value:!0});IZ.ListResponseMessageAttemptOutSerializer=void 0;var TZ=X8();IZ.ListResponseMessageAttemptOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>TZ.MessageAttemptOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>TZ.MessageAttemptOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var jZ=$((fZ)=>{Object.defineProperty(fZ,"__esModule",{value:!0});fZ.MessageEndpointOutSerializer=void 0;var gZ=y0(),_Z=Uu();fZ.MessageEndpointOutSerializer={_fromJsonObject(u){return{channels:u.channels,createdAt:new Date(u.createdAt),description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,nextAttempt:u.nextAttempt?new Date(u.nextAttempt):null,rateLimit:u.rateLimit,status:gZ.MessageStatusSerializer._fromJsonObject(u.status),statusText:_Z.MessageStatusTextSerializer._fromJsonObject(u.statusText),throttleRate:u.throttleRate,uid:u.uid,updatedAt:new Date(u.updatedAt),url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,createdAt:u.createdAt,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,nextAttempt:u.nextAttempt,rateLimit:u.rateLimit,status:gZ.MessageStatusSerializer._toJsonObject(u.status),statusText:_Z.MessageStatusTextSerializer._toJsonObject(u.statusText),throttleRate:u.throttleRate,uid:u.uid,updatedAt:u.updatedAt,url:u.url,version:u.version}}}});var iZ=$((dZ)=>{Object.defineProperty(dZ,"__esModule",{value:!0});dZ.ListResponseMessageEndpointOutSerializer=void 0;var lZ=jZ();dZ.ListResponseMessageEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>lZ.MessageEndpointOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>lZ.MessageEndpointOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var tZ=$((aZ)=>{Object.defineProperty(aZ,"__esModule",{value:!0});aZ.MessageAttempt=void 0;var oS=Q8(),eS=cZ(),nZ=mZ(),uR=iZ(),DR=X8(),W2=g();class pZ{constructor(u){this.requestCtx=u}listByEndpoint(u,D,B){let A=new W2.SvixRequest(W2.HttpMethod.GET,"/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator,status:B===null||B===void 0?void 0:B.status,status_code_class:B===null||B===void 0?void 0:B.statusCodeClass,channel:B===null||B===void 0?void 0:B.channel,tag:B===null||B===void 0?void 0:B.tag,before:B===null||B===void 0?void 0:B.before,after:B===null||B===void 0?void 0:B.after,with_content:B===null||B===void 0?void 0:B.withContent,with_msg:B===null||B===void 0?void 0:B.withMsg,event_types:B===null||B===void 0?void 0:B.eventTypes}),A.send(this.requestCtx,nZ.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listByMsg(u,D,B){let A=new W2.SvixRequest(W2.HttpMethod.GET,"/api/v1/app/{app_id}/attempt/msg/{msg_id}");return A.setPathParam("app_id",u),A.setPathParam("msg_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator,status:B===null||B===void 0?void 0:B.status,status_code_class:B===null||B===void 0?void 0:B.statusCodeClass,channel:B===null||B===void 0?void 0:B.channel,tag:B===null||B===void 0?void 0:B.tag,endpoint_id:B===null||B===void 0?void 0:B.endpointId,before:B===null||B===void 0?void 0:B.before,after:B===null||B===void 0?void 0:B.after,with_content:B===null||B===void 0?void 0:B.withContent,event_types:B===null||B===void 0?void 0:B.eventTypes}),A.send(this.requestCtx,nZ.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listAttemptedMessages(u,D,B){let A=new W2.SvixRequest(W2.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator,channel:B===null||B===void 0?void 0:B.channel,tag:B===null||B===void 0?void 0:B.tag,status:B===null||B===void 0?void 0:B.status,before:B===null||B===void 0?void 0:B.before,after:B===null||B===void 0?void 0:B.after,with_content:B===null||B===void 0?void 0:B.withContent,event_types:B===null||B===void 0?void 0:B.eventTypes}),A.send(this.requestCtx,eS.ListResponseEndpointMessageOutSerializer._fromJsonObject)}get(u,D,B){let A=new W2.SvixRequest(W2.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}");return A.setPathParam("app_id",u),A.setPathParam("msg_id",D),A.setPathParam("attempt_id",B),A.send(this.requestCtx,DR.MessageAttemptOutSerializer._fromJsonObject)}expungeContent(u,D,B){let A=new W2.SvixRequest(W2.HttpMethod.DELETE,"/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content");return A.setPathParam("app_id",u),A.setPathParam("msg_id",D),A.setPathParam("attempt_id",B),A.sendNoResponseBody(this.requestCtx)}listAttemptedDestinations(u,D,B){let A=new W2.SvixRequest(W2.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}/endpoint");return A.setPathParam("app_id",u),A.setPathParam("msg_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator}),A.send(this.requestCtx,uR.ListResponseMessageEndpointOutSerializer._fromJsonObject)}resend(u,D,B,A){let w=new W2.SvixRequest(W2.HttpMethod.POST,"/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend");return w.setPathParam("app_id",u),w.setPathParam("msg_id",D),w.setPathParam("endpoint_id",B),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.send(this.requestCtx,oS.EmptyResponseSerializer._fromJsonObject)}}aZ.MessageAttempt=pZ});var Y8=$((oZ)=>{Object.defineProperty(oZ,"__esModule",{value:!0});oZ.OperationalWebhookEndpointOutSerializer=void 0;oZ.OperationalWebhookEndpointOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,updatedAt:new Date(u.updatedAt),url:u.url}},_toJsonObject(u){return{createdAt:u.createdAt,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,updatedAt:u.updatedAt,url:u.url}}}});var AJ=$((DJ)=>{Object.defineProperty(DJ,"__esModule",{value:!0});DJ.ListResponseOperationalWebhookEndpointOutSerializer=void 0;var uJ=Y8();DJ.ListResponseOperationalWebhookEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>uJ.OperationalWebhookEndpointOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>uJ.OperationalWebhookEndpointOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var NJ=$((wJ)=>{Object.defineProperty(wJ,"__esModule",{value:!0});wJ.OperationalWebhookEndpointHeadersInSerializer=void 0;wJ.OperationalWebhookEndpointHeadersInSerializer={_fromJsonObject(u){return{headers:u.headers}},_toJsonObject(u){return{headers:u.headers}}}});var vJ=$((GJ)=>{Object.defineProperty(GJ,"__esModule",{value:!0});GJ.OperationalWebhookEndpointHeadersOutSerializer=void 0;GJ.OperationalWebhookEndpointHeadersOutSerializer={_fromJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}},_toJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}}}});var JJ=$((zJ)=>{Object.defineProperty(zJ,"__esModule",{value:!0});zJ.OperationalWebhookEndpointInSerializer=void 0;zJ.OperationalWebhookEndpointInSerializer={_fromJsonObject(u){return{description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,uid:u.uid,url:u.url}},_toJsonObject(u){return{description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,uid:u.uid,url:u.url}}}});var XJ=$((QJ)=>{Object.defineProperty(QJ,"__esModule",{value:!0});QJ.OperationalWebhookEndpointSecretInSerializer=void 0;QJ.OperationalWebhookEndpointSecretInSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var KJ=$((YJ)=>{Object.defineProperty(YJ,"__esModule",{value:!0});YJ.OperationalWebhookEndpointSecretOutSerializer=void 0;YJ.OperationalWebhookEndpointSecretOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var RJ=$((xJ)=>{Object.defineProperty(xJ,"__esModule",{value:!0});xJ.OperationalWebhookEndpointUpdateSerializer=void 0;xJ.OperationalWebhookEndpointUpdateSerializer={_fromJsonObject(u){return{description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,url:u.url}},_toJsonObject(u){return{description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,url:u.url}}}});var K8=$((UJ)=>{Object.defineProperty(UJ,"__esModule",{value:!0});UJ.OperationalWebhookEndpoint=void 0;var BR=AJ(),AR=NJ(),wR=vJ(),FR=JJ(),h8=Y8(),NR=XJ(),GR=KJ(),$R=RJ(),D2=g();class HJ{constructor(u){this.requestCtx=u}list(u){let D=new D2.SvixRequest(D2.HttpMethod.GET,"/api/v1/operational-webhook/endpoint");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,BR.ListResponseOperationalWebhookEndpointOutSerializer._fromJsonObject)}create(u,D){let B=new D2.SvixRequest(D2.HttpMethod.POST,"/api/v1/operational-webhook/endpoint");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(FR.OperationalWebhookEndpointInSerializer._toJsonObject(u)),B.send(this.requestCtx,h8.OperationalWebhookEndpointOutSerializer._fromJsonObject)}get(u){let D=new D2.SvixRequest(D2.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return D.setPathParam("endpoint_id",u),D.send(this.requestCtx,h8.OperationalWebhookEndpointOutSerializer._fromJsonObject)}update(u,D){let B=new D2.SvixRequest(D2.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return B.setPathParam("endpoint_id",u),B.setBody($R.OperationalWebhookEndpointUpdateSerializer._toJsonObject(D)),B.send(this.requestCtx,h8.OperationalWebhookEndpointOutSerializer._fromJsonObject)}delete(u){let D=new D2.SvixRequest(D2.HttpMethod.DELETE,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return D.setPathParam("endpoint_id",u),D.sendNoResponseBody(this.requestCtx)}getHeaders(u){let D=new D2.SvixRequest(D2.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return D.setPathParam("endpoint_id",u),D.send(this.requestCtx,wR.OperationalWebhookEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(u,D){let B=new D2.SvixRequest(D2.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return B.setPathParam("endpoint_id",u),B.setBody(AR.OperationalWebhookEndpointHeadersInSerializer._toJsonObject(D)),B.sendNoResponseBody(this.requestCtx)}getSecret(u){let D=new D2.SvixRequest(D2.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret");return D.setPathParam("endpoint_id",u),D.send(this.requestCtx,GR.OperationalWebhookEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(u,D,B){let A=new D2.SvixRequest(D2.HttpMethod.POST,"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret/rotate");return A.setPathParam("endpoint_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(NR.OperationalWebhookEndpointSecretInSerializer._toJsonObject(D)),A.sendNoResponseBody(this.requestCtx)}}UJ.OperationalWebhookEndpoint=HJ});var OJ=$((LJ)=>{Object.defineProperty(LJ,"__esModule",{value:!0});LJ.OperationalWebhook=void 0;var vR=K8();class MJ{constructor(u){this.requestCtx=u}get endpoint(){return new vR.OperationalWebhookEndpoint(this.requestCtx)}}LJ.OperationalWebhook=MJ});var VJ=$((kJ)=>{Object.defineProperty(kJ,"__esModule",{value:!0});kJ.AggregateEventTypesOutSerializer=void 0;var CJ=a2(),PJ=s2();kJ.AggregateEventTypesOutSerializer={_fromJsonObject(u){return{id:u.id,status:CJ.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:PJ.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:CJ.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:PJ.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var qJ=$((TJ)=>{Object.defineProperty(TJ,"__esModule",{value:!0});TJ.AppUsageStatsInSerializer=void 0;TJ.AppUsageStatsInSerializer={_fromJsonObject(u){return{appIds:u.appIds,since:new Date(u.since),until:new Date(u.until)}},_toJsonObject(u){return{appIds:u.appIds,since:u.since,until:u.until}}}});var bJ=$((_J)=>{Object.defineProperty(_J,"__esModule",{value:!0});_J.AppUsageStatsOutSerializer=void 0;var mJ=a2(),gJ=s2();_J.AppUsageStatsOutSerializer={_fromJsonObject(u){return{id:u.id,status:mJ.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:gJ.BackgroundTaskTypeSerializer._fromJsonObject(u.task),unresolvedAppIds:u.unresolvedAppIds,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:mJ.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:gJ.BackgroundTaskTypeSerializer._toJsonObject(u.task),unresolvedAppIds:u.unresolvedAppIds,updatedAt:u.updatedAt}}}});var rJ=$((lJ)=>{Object.defineProperty(lJ,"__esModule",{value:!0});lJ.Statistics=void 0;var zR=VJ(),ZR=qJ(),JR=bJ(),DD=g();class jJ{constructor(u){this.requestCtx=u}aggregateAppStats(u,D){let B=new DD.SvixRequest(DD.HttpMethod.POST,"/api/v1/stats/usage/app");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(ZR.AppUsageStatsInSerializer._toJsonObject(u)),B.send(this.requestCtx,JR.AppUsageStatsOutSerializer._fromJsonObject)}aggregateEventTypes(){return new DD.SvixRequest(DD.HttpMethod.PUT,"/api/v1/stats/usage/event-types").send(this.requestCtx,zR.AggregateEventTypesOutSerializer._fromJsonObject)}}lJ.Statistics=jJ});var pJ=$((iJ)=>{Object.defineProperty(iJ,"__esModule",{value:!0});iJ.HttpSinkHeadersPatchInSerializer=void 0;iJ.HttpSinkHeadersPatchInSerializer={_fromJsonObject(u){return{headers:u.headers}},_toJsonObject(u){return{headers:u.headers}}}});var tJ=$((aJ)=>{Object.defineProperty(aJ,"__esModule",{value:!0});aJ.SinkTransformationOutSerializer=void 0;aJ.SinkTransformationOutSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var x8=$((oJ)=>{Object.defineProperty(oJ,"__esModule",{value:!0});oJ.StreamEventTypeOutSerializer=void 0;oJ.StreamEventTypeOutSerializer={_fromJsonObject(u){return{archived:u.archived,createdAt:new Date(u.createdAt),deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{archived:u.archived,createdAt:u.createdAt,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name,updatedAt:u.updatedAt}}}});var AQ=$((DQ)=>{Object.defineProperty(DQ,"__esModule",{value:!0});DQ.ListResponseStreamEventTypeOutSerializer=void 0;var uQ=x8();DQ.ListResponseStreamEventTypeOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>uQ.StreamEventTypeOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>uQ.StreamEventTypeOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var NQ=$((wQ)=>{Object.defineProperty(wQ,"__esModule",{value:!0});wQ.StreamEventTypeInSerializer=void 0;wQ.StreamEventTypeInSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name}}}});var vQ=$((GQ)=>{Object.defineProperty(GQ,"__esModule",{value:!0});GQ.StreamEventTypePatchSerializer=void 0;GQ.StreamEventTypePatchSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name}}}});var WQ=$((JQ)=>{Object.defineProperty(JQ,"__esModule",{value:!0});JQ.StreamingEventType=void 0;var QR=AQ(),zQ=NQ(),BD=x8(),WR=vQ(),E2=g();class ZQ{constructor(u){this.requestCtx=u}list(u){let D=new E2.SvixRequest(E2.HttpMethod.GET,"/api/v1/stream/event-type");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order,include_archived:u===null||u===void 0?void 0:u.includeArchived}),D.send(this.requestCtx,QR.ListResponseStreamEventTypeOutSerializer._fromJsonObject)}create(u,D){let B=new E2.SvixRequest(E2.HttpMethod.POST,"/api/v1/stream/event-type");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(zQ.StreamEventTypeInSerializer._toJsonObject(u)),B.send(this.requestCtx,BD.StreamEventTypeOutSerializer._fromJsonObject)}get(u){let D=new E2.SvixRequest(E2.HttpMethod.GET,"/api/v1/stream/event-type/{name}");return D.setPathParam("name",u),D.send(this.requestCtx,BD.StreamEventTypeOutSerializer._fromJsonObject)}update(u,D){let B=new E2.SvixRequest(E2.HttpMethod.PUT,"/api/v1/stream/event-type/{name}");return B.setPathParam("name",u),B.setBody(zQ.StreamEventTypeInSerializer._toJsonObject(D)),B.send(this.requestCtx,BD.StreamEventTypeOutSerializer._fromJsonObject)}delete(u,D){let B=new E2.SvixRequest(E2.HttpMethod.DELETE,"/api/v1/stream/event-type/{name}");return B.setPathParam("name",u),B.setQueryParams({expunge:D===null||D===void 0?void 0:D.expunge}),B.sendNoResponseBody(this.requestCtx)}patch(u,D){let B=new E2.SvixRequest(E2.HttpMethod.PATCH,"/api/v1/stream/event-type/{name}");return B.setPathParam("name",u),B.setBody(WR.StreamEventTypePatchSerializer._toJsonObject(D)),B.send(this.requestCtx,BD.StreamEventTypeOutSerializer._fromJsonObject)}}JQ.StreamingEventType=ZQ});var hQ=$((XQ)=>{Object.defineProperty(XQ,"__esModule",{value:!0});XQ.EventInSerializer=void 0;XQ.EventInSerializer={_fromJsonObject(u){return{eventType:u.eventType,payload:u.payload}},_toJsonObject(u){return{eventType:u.eventType,payload:u.payload}}}});var S8=$((KQ)=>{Object.defineProperty(KQ,"__esModule",{value:!0});KQ.StreamInSerializer=void 0;KQ.StreamInSerializer={_fromJsonObject(u){return{metadata:u.metadata,name:u.name,uid:u.uid}},_toJsonObject(u){return{metadata:u.metadata,name:u.name,uid:u.uid}}}});var cQ=$((HQ)=>{Object.defineProperty(HQ,"__esModule",{value:!0});HQ.CreateStreamEventsInSerializer=void 0;var SQ=hQ(),RQ=S8();HQ.CreateStreamEventsInSerializer={_fromJsonObject(u){return{events:u.events.map((D)=>SQ.EventInSerializer._fromJsonObject(D)),stream:u.stream!=null?RQ.StreamInSerializer._fromJsonObject(u.stream):void 0}},_toJsonObject(u){return{events:u.events.map((D)=>SQ.EventInSerializer._toJsonObject(D)),stream:u.stream!=null?RQ.StreamInSerializer._toJsonObject(u.stream):void 0}}}});var EQ=$((MQ)=>{Object.defineProperty(MQ,"__esModule",{value:!0});MQ.CreateStreamEventsOutSerializer=void 0;MQ.CreateStreamEventsOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var PQ=$((OQ)=>{Object.defineProperty(OQ,"__esModule",{value:!0});OQ.EventOutSerializer=void 0;OQ.EventOutSerializer={_fromJsonObject(u){return{eventType:u.eventType,payload:u.payload,timestamp:new Date(u.timestamp)}},_toJsonObject(u){return{eventType:u.eventType,payload:u.payload,timestamp:u.timestamp}}}});var TQ=$((yQ)=>{Object.defineProperty(yQ,"__esModule",{value:!0});yQ.EventStreamOutSerializer=void 0;var kQ=PQ();yQ.EventStreamOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>kQ.EventOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator}},_toJsonObject(u){return{data:u.data.map((D)=>kQ.EventOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator}}}});var gQ=$((qQ)=>{Object.defineProperty(qQ,"__esModule",{value:!0});qQ.StreamingEvents=void 0;var XR=cQ(),YR=EQ(),hR=TQ(),AD=g();class IQ{constructor(u){this.requestCtx=u}create(u,D,B){let A=new AD.SvixRequest(AD.HttpMethod.POST,"/api/v1/stream/{stream_id}/events");return A.setPathParam("stream_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(XR.CreateStreamEventsInSerializer._toJsonObject(D)),A.send(this.requestCtx,YR.CreateStreamEventsOutSerializer._fromJsonObject)}get(u,D,B){let A=new AD.SvixRequest(AD.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/events");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator,after:B===null||B===void 0?void 0:B.after}),A.send(this.requestCtx,hR.EventStreamOutSerializer._fromJsonObject)}}qQ.StreamingEvents=IQ});var R8=$((_Q)=>{Object.defineProperty(_Q,"__esModule",{value:!0});_Q.AzureBlobStorageConfigSerializer=void 0;_Q.AzureBlobStorageConfigSerializer={_fromJsonObject(u){return{accessKey:u.accessKey,account:u.account,container:u.container}},_toJsonObject(u){return{accessKey:u.accessKey,account:u.account,container:u.container}}}});var H8=$((bQ)=>{Object.defineProperty(bQ,"__esModule",{value:!0});bQ.GoogleCloudStorageConfigSerializer=void 0;bQ.GoogleCloudStorageConfigSerializer={_fromJsonObject(u){return{bucket:u.bucket,credentials:u.credentials}},_toJsonObject(u){return{bucket:u.bucket,credentials:u.credentials}}}});var U8=$((lQ)=>{Object.defineProperty(lQ,"__esModule",{value:!0});lQ.S3ConfigSerializer=void 0;lQ.S3ConfigSerializer={_fromJsonObject(u){return{accessKeyId:u.accessKeyId,bucket:u.bucket,endpointUrl:u.endpointUrl,region:u.region,secretAccessKey:u.secretAccessKey}},_toJsonObject(u){return{accessKeyId:u.accessKeyId,bucket:u.bucket,endpointUrl:u.endpointUrl,region:u.region,secretAccessKey:u.secretAccessKey}}}});var c8=$((rQ)=>{Object.defineProperty(rQ,"__esModule",{value:!0});rQ.SinkHttpConfigSerializer=void 0;rQ.SinkHttpConfigSerializer={_fromJsonObject(u){return{headers:u.headers,key:u.key,url:u.url}},_toJsonObject(u){return{headers:u.headers,key:u.key,url:u.url}}}});var M8=$((nQ)=>{Object.defineProperty(nQ,"__esModule",{value:!0});nQ.SinkOtelV1ConfigSerializer=void 0;nQ.SinkOtelV1ConfigSerializer={_fromJsonObject(u){return{headers:u.headers,url:u.url}},_toJsonObject(u){return{headers:u.headers,url:u.url}}}});var L8=$((sQ)=>{Object.defineProperty(sQ,"__esModule",{value:!0});sQ.SinkStatusSerializer=sQ.SinkStatus=void 0;var KR;(function(u){u.Enabled="enabled",u.Paused="paused",u.Disabled="disabled",u.Retrying="retrying"})(KR=sQ.SinkStatus||(sQ.SinkStatus={}));sQ.SinkStatusSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var E8=$((wW)=>{Object.defineProperty(wW,"__esModule",{value:!0});wW.StreamSinkOutSerializer=void 0;var oQ=R8(),eQ=H8(),uW=U8(),DW=c8(),BW=M8(),AW=L8();wW.StreamSinkOutSerializer={_fromJsonObject(u){let D=u.type;function B(A){switch(A){case"poller":return{};case"azureBlobStorage":return oQ.AzureBlobStorageConfigSerializer._fromJsonObject(u.config);case"otelTracing":return BW.SinkOtelV1ConfigSerializer._fromJsonObject(u.config);case"http":return DW.SinkHttpConfigSerializer._fromJsonObject(u.config);case"amazonS3":return uW.S3ConfigSerializer._fromJsonObject(u.config);case"googleCloudStorage":return eQ.GoogleCloudStorageConfigSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${A}`)}}return{type:D,config:B(D),batchSize:u.batchSize,createdAt:new Date(u.createdAt),currentIterator:u.currentIterator,eventTypes:u.eventTypes,failureReason:u.failureReason,id:u.id,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,nextRetryAt:u.nextRetryAt?new Date(u.nextRetryAt):null,status:AW.SinkStatusSerializer._fromJsonObject(u.status),uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){let D;switch(u.type){case"poller":D={};break;case"azureBlobStorage":D=oQ.AzureBlobStorageConfigSerializer._toJsonObject(u.config);break;case"otelTracing":D=BW.SinkOtelV1ConfigSerializer._toJsonObject(u.config);break;case"http":D=DW.SinkHttpConfigSerializer._toJsonObject(u.config);break;case"amazonS3":D=uW.S3ConfigSerializer._toJsonObject(u.config);break;case"googleCloudStorage":D=eQ.GoogleCloudStorageConfigSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,batchSize:u.batchSize,createdAt:u.createdAt,currentIterator:u.currentIterator,eventTypes:u.eventTypes,failureReason:u.failureReason,id:u.id,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,nextRetryAt:u.nextRetryAt,status:AW.SinkStatusSerializer._toJsonObject(u.status),uid:u.uid,updatedAt:u.updatedAt}}}});var vW=$((GW)=>{Object.defineProperty(GW,"__esModule",{value:!0});GW.ListResponseStreamSinkOutSerializer=void 0;var NW=E8();GW.ListResponseStreamSinkOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>NW.StreamSinkOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>NW.StreamSinkOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var JW=$((zW)=>{Object.defineProperty(zW,"__esModule",{value:!0});zW.SinkSecretOutSerializer=void 0;zW.SinkSecretOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var XW=$((QW)=>{Object.defineProperty(QW,"__esModule",{value:!0});QW.SinkTransformInSerializer=void 0;QW.SinkTransformInSerializer={_fromJsonObject(u){return{code:u.code}},_toJsonObject(u){return{code:u.code}}}});var wD=$((hW)=>{Object.defineProperty(hW,"__esModule",{value:!0});hW.SinkStatusInSerializer=hW.SinkStatusIn=void 0;var xR;(function(u){u.Enabled="enabled",u.Disabled="disabled"})(xR=hW.SinkStatusIn||(hW.SinkStatusIn={}));hW.SinkStatusInSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var EW=$((MW)=>{Object.defineProperty(MW,"__esModule",{value:!0});MW.StreamSinkInSerializer=void 0;var xW=R8(),SW=H8(),RW=U8(),HW=c8(),UW=M8(),cW=wD();MW.StreamSinkInSerializer={_fromJsonObject(u){let D=u.type;function B(A){switch(A){case"poller":return{};case"azureBlobStorage":return xW.AzureBlobStorageConfigSerializer._fromJsonObject(u.config);case"otelTracing":return UW.SinkOtelV1ConfigSerializer._fromJsonObject(u.config);case"http":return HW.SinkHttpConfigSerializer._fromJsonObject(u.config);case"amazonS3":return RW.S3ConfigSerializer._fromJsonObject(u.config);case"googleCloudStorage":return SW.GoogleCloudStorageConfigSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${A}`)}}return{type:D,config:B(D),batchSize:u.batchSize,eventTypes:u.eventTypes,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,status:u.status!=null?cW.SinkStatusInSerializer._fromJsonObject(u.status):void 0,uid:u.uid}},_toJsonObject(u){let D;switch(u.type){case"poller":D={};break;case"azureBlobStorage":D=xW.AzureBlobStorageConfigSerializer._toJsonObject(u.config);break;case"otelTracing":D=UW.SinkOtelV1ConfigSerializer._toJsonObject(u.config);break;case"http":D=HW.SinkHttpConfigSerializer._toJsonObject(u.config);break;case"amazonS3":D=RW.S3ConfigSerializer._toJsonObject(u.config);break;case"googleCloudStorage":D=SW.GoogleCloudStorageConfigSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,batchSize:u.batchSize,eventTypes:u.eventTypes,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,status:u.status!=null?cW.SinkStatusInSerializer._toJsonObject(u.status):void 0,uid:u.uid}}}});var PW=$((OW)=>{Object.defineProperty(OW,"__esModule",{value:!0});OW.AmazonS3PatchConfigSerializer=void 0;OW.AmazonS3PatchConfigSerializer={_fromJsonObject(u){return{accessKeyId:u.accessKeyId,bucket:u.bucket,endpointUrl:u.endpointUrl,region:u.region,secretAccessKey:u.secretAccessKey}},_toJsonObject(u){return{accessKeyId:u.accessKeyId,bucket:u.bucket,endpointUrl:u.endpointUrl,region:u.region,secretAccessKey:u.secretAccessKey}}}});var VW=$((kW)=>{Object.defineProperty(kW,"__esModule",{value:!0});kW.AzureBlobStoragePatchConfigSerializer=void 0;kW.AzureBlobStoragePatchConfigSerializer={_fromJsonObject(u){return{accessKey:u.accessKey,account:u.account,container:u.container}},_toJsonObject(u){return{accessKey:u.accessKey,account:u.account,container:u.container}}}});var qW=$((TW)=>{Object.defineProperty(TW,"__esModule",{value:!0});TW.GoogleCloudStoragePatchConfigSerializer=void 0;TW.GoogleCloudStoragePatchConfigSerializer={_fromJsonObject(u){return{bucket:u.bucket,credentials:u.credentials}},_toJsonObject(u){return{bucket:u.bucket,credentials:u.credentials}}}});var _W=$((mW)=>{Object.defineProperty(mW,"__esModule",{value:!0});mW.HttpPatchConfigSerializer=void 0;mW.HttpPatchConfigSerializer={_fromJsonObject(u){return{url:u.url}},_toJsonObject(u){return{url:u.url}}}});var jW=$((fW)=>{Object.defineProperty(fW,"__esModule",{value:!0});fW.OtelTracingPatchConfigSerializer=void 0;fW.OtelTracingPatchConfigSerializer={_fromJsonObject(u){return{url:u.url}},_toJsonObject(u){return{url:u.url}}}});var tW=$((aW)=>{Object.defineProperty(aW,"__esModule",{value:!0});aW.StreamSinkPatchSerializer=void 0;var lW=PW(),dW=VW(),rW=qW(),iW=_W(),nW=jW(),pW=wD();aW.StreamSinkPatchSerializer={_fromJsonObject(u){let D=u.type;function B(A){switch(A){case"poller":return{};case"azureBlobStorage":return dW.AzureBlobStoragePatchConfigSerializer._fromJsonObject(u.config);case"otelTracing":return nW.OtelTracingPatchConfigSerializer._fromJsonObject(u.config);case"http":return iW.HttpPatchConfigSerializer._fromJsonObject(u.config);case"amazonS3":return lW.AmazonS3PatchConfigSerializer._fromJsonObject(u.config);case"googleCloudStorage":return rW.GoogleCloudStoragePatchConfigSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${A}`)}}return{type:D,config:B(D),batchSize:u.batchSize,eventTypes:u.eventTypes,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,status:u.status!=null?pW.SinkStatusInSerializer._fromJsonObject(u.status):void 0,uid:u.uid}},_toJsonObject(u){let D;switch(u.type){case"poller":D={};break;case"azureBlobStorage":D=dW.AzureBlobStoragePatchConfigSerializer._toJsonObject(u.config);break;case"otelTracing":D=nW.OtelTracingPatchConfigSerializer._toJsonObject(u.config);break;case"http":D=iW.HttpPatchConfigSerializer._toJsonObject(u.config);break;case"amazonS3":D=lW.AmazonS3PatchConfigSerializer._toJsonObject(u.config);break;case"googleCloudStorage":D=rW.GoogleCloudStoragePatchConfigSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,batchSize:u.batchSize,eventTypes:u.eventTypes,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,status:u.status!=null?pW.SinkStatusInSerializer._toJsonObject(u.status):void 0,uid:u.uid}}}});var AX=$((DX)=>{Object.defineProperty(DX,"__esModule",{value:!0});DX.StreamingSink=void 0;var oW=Q8(),SR=A8(),RR=vW(),HR=JW(),UR=XW(),eW=EW(),FD=E8(),cR=tW(),B2=g();class uX{constructor(u){this.requestCtx=u}list(u,D){let B=new B2.SvixRequest(B2.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink");return B.setPathParam("stream_id",u),B.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,order:D===null||D===void 0?void 0:D.order}),B.send(this.requestCtx,RR.ListResponseStreamSinkOutSerializer._fromJsonObject)}create(u,D,B){let A=new B2.SvixRequest(B2.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink");return A.setPathParam("stream_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(eW.StreamSinkInSerializer._toJsonObject(D)),A.send(this.requestCtx,FD.StreamSinkOutSerializer._fromJsonObject)}get(u,D){let B=new B2.SvixRequest(B2.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.send(this.requestCtx,FD.StreamSinkOutSerializer._fromJsonObject)}update(u,D,B){let A=new B2.SvixRequest(B2.HttpMethod.PUT,"/api/v1/stream/{stream_id}/sink/{sink_id}");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.setBody(eW.StreamSinkInSerializer._toJsonObject(B)),A.send(this.requestCtx,FD.StreamSinkOutSerializer._fromJsonObject)}delete(u,D){let B=new B2.SvixRequest(B2.HttpMethod.DELETE,"/api/v1/stream/{stream_id}/sink/{sink_id}");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.sendNoResponseBody(this.requestCtx)}patch(u,D,B){let A=new B2.SvixRequest(B2.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.setBody(cR.StreamSinkPatchSerializer._toJsonObject(B)),A.send(this.requestCtx,FD.StreamSinkOutSerializer._fromJsonObject)}getSecret(u,D){let B=new B2.SvixRequest(B2.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/secret");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.send(this.requestCtx,HR.SinkSecretOutSerializer._fromJsonObject)}rotateSecret(u,D,B,A){let w=new B2.SvixRequest(B2.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink/{sink_id}/secret/rotate");return w.setPathParam("stream_id",u),w.setPathParam("sink_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(SR.EndpointSecretRotateInSerializer._toJsonObject(B)),w.send(this.requestCtx,oW.EmptyResponseSerializer._fromJsonObject)}transformationPartialUpdate(u,D,B){let A=new B2.SvixRequest(B2.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.setBody(UR.SinkTransformInSerializer._toJsonObject(B)),A.send(this.requestCtx,oW.EmptyResponseSerializer._fromJsonObject)}}DX.StreamingSink=uX});var O8=$((wX)=>{Object.defineProperty(wX,"__esModule",{value:!0});wX.StreamOutSerializer=void 0;wX.StreamOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),id:u.id,metadata:u.metadata,name:u.name,uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{createdAt:u.createdAt,id:u.id,metadata:u.metadata,name:u.name,uid:u.uid,updatedAt:u.updatedAt}}}});var vX=$((GX)=>{Object.defineProperty(GX,"__esModule",{value:!0});GX.ListResponseStreamOutSerializer=void 0;var NX=O8();GX.ListResponseStreamOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>NX.StreamOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>NX.StreamOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var JX=$((zX)=>{Object.defineProperty(zX,"__esModule",{value:!0});zX.StreamPatchSerializer=void 0;zX.StreamPatchSerializer={_fromJsonObject(u){return{description:u.description,metadata:u.metadata,uid:u.uid}},_toJsonObject(u){return{description:u.description,metadata:u.metadata,uid:u.uid}}}});var hX=$((XX)=>{Object.defineProperty(XX,"__esModule",{value:!0});XX.StreamingStream=void 0;var MR=vX(),QX=S8(),ND=O8(),LR=JX(),O2=g();class WX{constructor(u){this.requestCtx=u}list(u){let D=new O2.SvixRequest(O2.HttpMethod.GET,"/api/v1/stream");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,MR.ListResponseStreamOutSerializer._fromJsonObject)}create(u,D){let B=new O2.SvixRequest(O2.HttpMethod.POST,"/api/v1/stream");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(QX.StreamInSerializer._toJsonObject(u)),B.send(this.requestCtx,ND.StreamOutSerializer._fromJsonObject)}get(u){let D=new O2.SvixRequest(O2.HttpMethod.GET,"/api/v1/stream/{stream_id}");return D.setPathParam("stream_id",u),D.send(this.requestCtx,ND.StreamOutSerializer._fromJsonObject)}update(u,D){let B=new O2.SvixRequest(O2.HttpMethod.PUT,"/api/v1/stream/{stream_id}");return B.setPathParam("stream_id",u),B.setBody(QX.StreamInSerializer._toJsonObject(D)),B.send(this.requestCtx,ND.StreamOutSerializer._fromJsonObject)}delete(u){let D=new O2.SvixRequest(O2.HttpMethod.DELETE,"/api/v1/stream/{stream_id}");return D.setPathParam("stream_id",u),D.sendNoResponseBody(this.requestCtx)}patch(u,D){let B=new O2.SvixRequest(O2.HttpMethod.PATCH,"/api/v1/stream/{stream_id}");return B.setPathParam("stream_id",u),B.setBody(LR.StreamPatchSerializer._toJsonObject(D)),B.send(this.requestCtx,ND.StreamOutSerializer._fromJsonObject)}}XX.StreamingStream=WX});var HX=$((SX)=>{Object.defineProperty(SX,"__esModule",{value:!0});SX.Streaming=void 0;var KX=D8(),ER=pJ(),OR=tJ(),CR=WQ(),PR=gQ(),kR=AX(),yR=hX(),T0=g();class xX{constructor(u){this.requestCtx=u}get event_type(){return new CR.StreamingEventType(this.requestCtx)}get events(){return new PR.StreamingEvents(this.requestCtx)}get sink(){return new kR.StreamingSink(this.requestCtx)}get stream(){return new yR.StreamingStream(this.requestCtx)}sinkHeadersGet(u,D){let B=new T0.SvixRequest(T0.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.send(this.requestCtx,KX.EndpointHeadersOutSerializer._fromJsonObject)}sinkHeadersPatch(u,D,B){let A=new T0.SvixRequest(T0.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.setBody(ER.HttpSinkHeadersPatchInSerializer._toJsonObject(B)),A.send(this.requestCtx,KX.EndpointHeadersOutSerializer._fromJsonObject)}sinkTransformationGet(u,D){let B=new T0.SvixRequest(T0.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.send(this.requestCtx,OR.SinkTransformationOutSerializer._fromJsonObject)}}SX.Streaming=xX});var MX=$((UX)=>{Object.defineProperty(UX,"__esModule",{value:!0});UX.HTTPValidationError=UX.ValidationError=UX.HttpErrorOut=void 0;class I0{static getAttributeTypeMap(){return I0.attributeTypeMap}}UX.HttpErrorOut=I0;I0.discriminator=void 0;I0.mapping=void 0;I0.attributeTypeMap=[{name:"code",baseName:"code",type:"string",format:""},{name:"detail",baseName:"detail",type:"string",format:""}];class q0{static getAttributeTypeMap(){return q0.attributeTypeMap}}UX.ValidationError=q0;q0.discriminator=void 0;q0.mapping=void 0;q0.attributeTypeMap=[{name:"loc",baseName:"loc",type:"Array<string>",format:""},{name:"msg",baseName:"msg",type:"string",format:""},{name:"type",baseName:"type",type:"string",format:""}];class m0{static getAttributeTypeMap(){return m0.attributeTypeMap}}UX.HTTPValidationError=m0;m0.discriminator=void 0;m0.mapping=void 0;m0.attributeTypeMap=[{name:"detail",baseName:"detail",type:"Array<ValidationError>",format:""}]});var CX=$((EX)=>{Object.defineProperty(EX,"__esModule",{value:!0});EX.timingSafeEqual=void 0;function LX(u,D=""){if(!u)throw Error(D)}function IR(u,D){if(u.byteLength!==D.byteLength)return!1;if(!(u instanceof DataView))u=new DataView(ArrayBuffer.isView(u)?u.buffer:u);if(!(D instanceof DataView))D=new DataView(ArrayBuffer.isView(D)?D.buffer:D);LX(u instanceof DataView),LX(D instanceof DataView);let B=u.byteLength,A=0,w=-1;while(++w<B)A|=u.getUint8(w)^D.getUint8(w);return A===0}EX.timingSafeEqual=IR});var yX=$((h2)=>{var qR=h2&&h2.__extends||function(){var u=function(D,B){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,w){A.__proto__=w}||function(A,w){for(var F in w)if(w.hasOwnProperty(F))A[F]=w[F]},u(D,B)};return function(D,B){u(D,B);function A(){this.constructor=D}D.prototype=B===null?Object.create(B):(A.prototype=B.prototype,new A)}}();Object.defineProperty(h2,"__esModule",{value:!0});var i=256,C8=function(){function u(D){if(D===void 0)D="=";this._paddingCharacter=D}return u.prototype.encodedLength=function(D){if(!this._paddingCharacter)return(D*8+5)/6|0;return(D+2)/3*4|0},u.prototype.encode=function(D){var B="",A=0;for(;A<D.length-2;A+=3){var w=D[A]<<16|D[A+1]<<8|D[A+2];B+=this._encodeByte(w>>>18&63),B+=this._encodeByte(w>>>12&63),B+=this._encodeByte(w>>>6&63),B+=this._encodeByte(w>>>0&63)}var F=D.length-A;if(F>0){var w=D[A]<<16|(F===2?D[A+1]<<8:0);if(B+=this._encodeByte(w>>>18&63),B+=this._encodeByte(w>>>12&63),F===2)B+=this._encodeByte(w>>>6&63);else B+=this._paddingCharacter||"";B+=this._paddingCharacter||""}return B},u.prototype.maxDecodedLength=function(D){if(!this._paddingCharacter)return(D*6+7)/8|0;return D/4*3|0},u.prototype.decodedLength=function(D){return this.maxDecodedLength(D.length-this._getPaddingLength(D))},u.prototype.decode=function(D){if(D.length===0)return new Uint8Array(0);var B=this._getPaddingLength(D),A=D.length-B,w=new Uint8Array(this.maxDecodedLength(A)),F=0,N=0,G=0,v=0,z=0,Q=0,Z=0;for(;N<A-4;N+=4)v=this._decodeChar(D.charCodeAt(N+0)),z=this._decodeChar(D.charCodeAt(N+1)),Q=this._decodeChar(D.charCodeAt(N+2)),Z=this._decodeChar(D.charCodeAt(N+3)),w[F++]=v<<2|z>>>4,w[F++]=z<<4|Q>>>2,w[F++]=Q<<6|Z,G|=v&i,G|=z&i,G|=Q&i,G|=Z&i;if(N<A-1)v=this._decodeChar(D.charCodeAt(N)),z=this._decodeChar(D.charCodeAt(N+1)),w[F++]=v<<2|z>>>4,G|=v&i,G|=z&i;if(N<A-2)Q=this._decodeChar(D.charCodeAt(N+2)),w[F++]=z<<4|Q>>>2,G|=Q&i;if(N<A-3)Z=this._decodeChar(D.charCodeAt(N+3)),w[F++]=Q<<6|Z,G|=Z&i;if(G!==0)throw Error("Base64Coder: incorrect characters for decoding");return w},u.prototype._encodeByte=function(D){var B=D;return B+=65,B+=25-D>>>8&6,B+=51-D>>>8&-75,B+=61-D>>>8&-15,B+=62-D>>>8&3,String.fromCharCode(B)},u.prototype._decodeChar=function(D){var B=i;return B+=(42-D&D-44)>>>8&-i+D-43+62,B+=(46-D&D-48)>>>8&-i+D-47+63,B+=(47-D&D-58)>>>8&-i+D-48+52,B+=(64-D&D-91)>>>8&-i+D-65+0,B+=(96-D&D-123)>>>8&-i+D-97+26,B},u.prototype._getPaddingLength=function(D){var B=0;if(this._paddingCharacter){for(var A=D.length-1;A>=0;A--){if(D[A]!==this._paddingCharacter)break;B++}if(D.length<4||B>2)throw Error("Base64Coder: incorrect padding")}return B},u}();h2.Coder=C8;var cu=new C8;function mR(u){return cu.encode(u)}h2.encode=mR;function gR(u){return cu.decode(u)}h2.decode=gR;var PX=function(u){qR(D,u);function D(){return u!==null&&u.apply(this,arguments)||this}return D.prototype._encodeByte=function(B){var A=B;return A+=65,A+=25-B>>>8&6,A+=51-B>>>8&-75,A+=61-B>>>8&-13,A+=62-B>>>8&49,String.fromCharCode(A)},D.prototype._decodeChar=function(B){var A=i;return A+=(44-B&B-46)>>>8&-i+B-45+62,A+=(94-B&B-96)>>>8&-i+B-95+63,A+=(47-B&B-58)>>>8&-i+B-48+52,A+=(64-B&B-91)>>>8&-i+B-65+0,A+=(96-B&B-123)>>>8&-i+B-97+26,A},D}(C8);h2.URLSafeCoder=PX;var kX=new PX;function _R(u){return kX.encode(u)}h2.encodeURLSafe=_R;function fR(u){return kX.decode(u)}h2.decodeURLSafe=fR;h2.encodedLength=function(u){return cu.encodedLength(u)};h2.maxDecodedLength=function(u){return cu.maxDecodedLength(u)};h2.decodedLength=function(u){return cu.decodedLength(u)}});var TX=$((VX,GD)=>{(function(u,D){var B={};D(B);var A=B.default;for(var w in B)A[w]=B[w];if(typeof GD==="object"&&typeof GD.exports==="object")GD.exports=A;else if(typeof define==="function"&&define.amd)define(function(){return A});else u.sha256=A})(VX,function(u){u.__esModule=!0,u.digestLength=32,u.blockSize=64;var D=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function B(Z,J,W,Y,M){var x,L,S,y,_,V,x2,a,F2,s,o0,e0,qu;while(M>=64){x=J[0],L=J[1],S=J[2],y=J[3],_=J[4],V=J[5],x2=J[6],a=J[7];for(s=0;s<16;s++)o0=Y+s*4,Z[s]=(W[o0]&255)<<24|(W[o0+1]&255)<<16|(W[o0+2]&255)<<8|W[o0+3]&255;for(s=16;s<64;s++)F2=Z[s-2],e0=(F2>>>17|F2<<15)^(F2>>>19|F2<<13)^F2>>>10,F2=Z[s-15],qu=(F2>>>7|F2<<25)^(F2>>>18|F2<<14)^F2>>>3,Z[s]=(e0+Z[s-7]|0)+(qu+Z[s-16]|0);for(s=0;s<64;s++)e0=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&V^~_&x2)|0)+(a+(D[s]+Z[s]|0)|0)|0,qu=((x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10))+(x&L^x&S^L&S)|0,a=x2,x2=V,V=_,_=y+e0|0,y=S,S=L,L=x,x=e0+qu|0;J[0]+=x,J[1]+=L,J[2]+=S,J[3]+=y,J[4]+=_,J[5]+=V,J[6]+=x2,J[7]+=a,Y+=64,M-=64}return Y}var A=function(){function Z(){this.digestLength=u.digestLength,this.blockSize=u.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return Z.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},Z.prototype.clean=function(){for(var J=0;J<this.buffer.length;J++)this.buffer[J]=0;for(var J=0;J<this.temp.length;J++)this.temp[J]=0;this.reset()},Z.prototype.update=function(J,W){if(W===void 0)W=J.length;if(this.finished)throw Error("SHA256: can't update because hash was finished.");var Y=0;if(this.bytesHashed+=W,this.bufferLength>0){while(this.bufferLength<64&&W>0)this.buffer[this.bufferLength++]=J[Y++],W--;if(this.bufferLength===64)B(this.temp,this.state,this.buffer,0,64),this.bufferLength=0}if(W>=64)Y=B(this.temp,this.state,J,Y,W),W%=64;while(W>0)this.buffer[this.bufferLength++]=J[Y++],W--;return this},Z.prototype.finish=function(J){if(!this.finished){var W=this.bytesHashed,Y=this.bufferLength,M=W/536870912|0,x=W<<3,L=W%64<56?64:128;this.buffer[Y]=128;for(var S=Y+1;S<L-8;S++)this.buffer[S]=0;this.buffer[L-8]=M>>>24&255,this.buffer[L-7]=M>>>16&255,this.buffer[L-6]=M>>>8&255,this.buffer[L-5]=M>>>0&255,this.buffer[L-4]=x>>>24&255,this.buffer[L-3]=x>>>16&255,this.buffer[L-2]=x>>>8&255,this.buffer[L-1]=x>>>0&255,B(this.temp,this.state,this.buffer,0,L),this.finished=!0}for(var S=0;S<8;S++)J[S*4+0]=this.state[S]>>>24&255,J[S*4+1]=this.state[S]>>>16&255,J[S*4+2]=this.state[S]>>>8&255,J[S*4+3]=this.state[S]>>>0&255;return this},Z.prototype.digest=function(){var J=new Uint8Array(this.digestLength);return this.finish(J),J},Z.prototype._saveState=function(J){for(var W=0;W<this.state.length;W++)J[W]=this.state[W]},Z.prototype._restoreState=function(J,W){for(var Y=0;Y<this.state.length;Y++)this.state[Y]=J[Y];this.bytesHashed=W,this.finished=!1,this.bufferLength=0},Z}();u.Hash=A;var w=function(){function Z(J){this.inner=new A,this.outer=new A,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var W=new Uint8Array(this.blockSize);if(J.length>this.blockSize)new A().update(J).finish(W).clean();else for(var Y=0;Y<J.length;Y++)W[Y]=J[Y];for(var Y=0;Y<W.length;Y++)W[Y]^=54;this.inner.update(W);for(var Y=0;Y<W.length;Y++)W[Y]^=106;this.outer.update(W),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var Y=0;Y<W.length;Y++)W[Y]=0}return Z.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},Z.prototype.clean=function(){for(var J=0;J<this.istate.length;J++)this.ostate[J]=this.istate[J]=0;this.inner.clean(),this.outer.clean()},Z.prototype.update=function(J){return this.inner.update(J),this},Z.prototype.finish=function(J){if(this.outer.finished)this.outer.finish(J);else this.inner.finish(J),this.outer.update(J,this.digestLength).finish(J);return this},Z.prototype.digest=function(){var J=new Uint8Array(this.digestLength);return this.finish(J),J},Z}();u.HMAC=w;function F(Z){var J=new A().update(Z),W=J.digest();return J.clean(),W}u.hash=F,u.default=F;function N(Z,J){var W=new w(Z).update(J),Y=W.digest();return W.clean(),Y}u.hmac=N;function G(Z,J,W,Y){var M=Y[0];if(M===0)throw Error("hkdf: cannot expand more");if(J.reset(),M>1)J.update(Z);if(W)J.update(W);J.update(Y),J.finish(Z),Y[0]++}var v=new Uint8Array(u.digestLength);function z(Z,J,W,Y){if(J===void 0)J=v;if(Y===void 0)Y=32;var M=new Uint8Array([1]),x=N(J,Z),L=new w(x),S=new Uint8Array(L.digestLength),y=S.length,_=new Uint8Array(Y);for(var V=0;V<Y;V++){if(y===S.length)G(S,L,W,M),y=0;_[V]=S[y++]}return L.clean(),S.fill(0),M.fill(0),_}u.hkdf=z;function Q(Z,J,W,Y){var M=new w(Z),x=M.digestLength,L=new Uint8Array(4),S=new Uint8Array(x),y=new Uint8Array(x),_=new Uint8Array(Y);for(var V=0;V*x<Y;V++){var x2=V+1;L[0]=x2>>>24&255,L[1]=x2>>>16&255,L[2]=x2>>>8&255,L[3]=x2>>>0&255,M.reset(),M.update(J),M.update(L),M.finish(y);for(var a=0;a<x;a++)S[a]=y[a];for(var a=2;a<=W;a++){M.reset(),M.update(y).finish(y);for(var F2=0;F2<x;F2++)S[F2]^=y[F2]}for(var a=0;a<x&&V*x+a<Y;a++)_[V*x+a]=S[a]}for(var V=0;V<x;V++)S[V]=y[V]=0;for(var V=0;V<4;V++)L[V]=0;return M.clean(),_}u.pbkdf2=Q})});var k8=$((mX)=>{Object.defineProperty(mX,"__esModule",{value:!0});mX.Webhook=mX.WebhookVerificationError=void 0;var bR=CX(),IX=yX(),jR=TX(),qX=300;class P8 extends Error{constructor(u){super(u);Object.setPrototypeOf(this,P8.prototype),this.name="ExtendableError",this.stack=Error(u).stack}}class t2 extends P8{constructor(u){super(u);Object.setPrototypeOf(this,t2.prototype),this.name="WebhookVerificationError"}}mX.WebhookVerificationError=t2;class Mu{constructor(u,D){if(!u)throw Error("Secret can't be empty.");if((D===null||D===void 0?void 0:D.format)==="raw")if(u instanceof Uint8Array)this.key=u;else this.key=Uint8Array.from(u,(B)=>B.charCodeAt(0));else{if(typeof u!=="string")throw Error("Expected secret to be of type string");if(u.startsWith(Mu.prefix))u=u.substring(Mu.prefix.length);this.key=IX.decode(u)}}verify(u,D){let B={};for(let Z of Object.keys(D))B[Z.toLowerCase()]=D[Z];let A=B["webhook-id"],w=B["webhook-signature"],F=B["webhook-timestamp"];if(!w||!A||!F)throw new t2("Missing required headers");let N=this.verifyTimestamp(F),v=this.sign(A,N,u).split(",")[1],z=w.split(" "),Q=new globalThis.TextEncoder;for(let Z of z){let[J,W]=Z.split(",");if(J!=="v1")continue;if((0,bR.timingSafeEqual)(Q.encode(W),Q.encode(v)))return JSON.parse(u.toString())}throw new t2("No matching signature found")}sign(u,D,B){if(typeof B==="string");else if(B.constructor.name==="Buffer")B=B.toString();else throw Error("Expected payload to be of type string or Buffer.");let A=new TextEncoder,w=Math.floor(D.getTime()/1000),F=A.encode(`${u}.${w}.${B}`);return`v1,${IX.encode(jR.hmac(this.key,F))}`}verifyTimestamp(u){let D=Math.floor(Date.now()/1000),B=parseInt(u,10);if(isNaN(B))throw new t2("Invalid Signature Headers");if(D-B>qX)throw new t2("Message timestamp too old");if(B>D+qX)throw new t2("Message timestamp too new");return new Date(B*1000)}}mX.Webhook=Mu;Mu.prefix="whsec_"});var bX=$((y8)=>{Object.defineProperty(y8,"__esModule",{value:!0});y8.Webhook=y8.WebhookVerificationError=void 0;var dR=k8(),rR=k8();Object.defineProperty(y8,"WebhookVerificationError",{enumerable:!0,get:function(){return rR.WebhookVerificationError}});class _X{constructor(u,D){this.inner=new dR.Webhook(u,D)}verify(u,D){var B,A,w,F,N,G;let v={};for(let z of Object.keys(D))v[z.toLowerCase()]=D[z];return v["webhook-id"]=(A=(B=v["svix-id"])!==null&&B!==void 0?B:v["webhook-id"])!==null&&A!==void 0?A:"",v["webhook-signature"]=(F=(w=v["svix-signature"])!==null&&w!==void 0?w:v["webhook-signature"])!==null&&F!==void 0?F:"",v["webhook-timestamp"]=(G=(N=v["svix-timestamp"])!==null&&N!==void 0?N:v["webhook-timestamp"])!==null&&G!==void 0?G:"",this.inner.verify(u,v)}sign(u,D,B){return this.inner.sign(u,D,B)}}y8.Webhook=_X});var rX=$((lX)=>{Object.defineProperty(lX,"__esModule",{value:!0});lX.EndpointDisabledTriggerSerializer=lX.EndpointDisabledTrigger=void 0;var iR;(function(u){u.Manual="manual",u.Automatic="automatic"})(iR=lX.EndpointDisabledTrigger||(lX.EndpointDisabledTrigger={}));lX.EndpointDisabledTriggerSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var aX=$((nX)=>{Object.defineProperty(nX,"__esModule",{value:!0});nX.OrderingSerializer=nX.Ordering=void 0;var nR;(function(u){u.Ascending="ascending",u.Descending="descending"})(nR=nX.Ordering||(nX.Ordering={}));nX.OrderingSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var sX=$((v2)=>{Object.defineProperty(v2,"__esModule",{value:!0});v2.StatusCodeClass=v2.SinkStatusIn=v2.SinkStatus=v2.Ordering=v2.MessageStatusText=v2.MessageStatus=v2.MessageAttemptTriggerType=v2.EndpointDisabledTrigger=v2.ConnectorProduct=v2.ConnectorKind=v2.BackgroundTaskType=v2.BackgroundTaskStatus=v2.AppPortalCapability=void 0;var pR=s3();Object.defineProperty(v2,"AppPortalCapability",{enumerable:!0,get:function(){return pR.AppPortalCapability}});var aR=a2();Object.defineProperty(v2,"BackgroundTaskStatus",{enumerable:!0,get:function(){return aR.BackgroundTaskStatus}});var sR=s2();Object.defineProperty(v2,"BackgroundTaskType",{enumerable:!0,get:function(){return sR.BackgroundTaskType}});var tR=k0();Object.defineProperty(v2,"ConnectorKind",{enumerable:!0,get:function(){return tR.ConnectorKind}});var oR=p1();Object.defineProperty(v2,"ConnectorProduct",{enumerable:!0,get:function(){return oR.ConnectorProduct}});var eR=rX();Object.defineProperty(v2,"EndpointDisabledTrigger",{enumerable:!0,get:function(){return eR.EndpointDisabledTrigger}});var uH=W8();Object.defineProperty(v2,"MessageAttemptTriggerType",{enumerable:!0,get:function(){return uH.MessageAttemptTriggerType}});var DH=y0();Object.defineProperty(v2,"MessageStatus",{enumerable:!0,get:function(){return DH.MessageStatus}});var BH=Uu();Object.defineProperty(v2,"MessageStatusText",{enumerable:!0,get:function(){return BH.MessageStatusText}});var AH=aX();Object.defineProperty(v2,"Ordering",{enumerable:!0,get:function(){return AH.Ordering}});var wH=L8();Object.defineProperty(v2,"SinkStatus",{enumerable:!0,get:function(){return wH.SinkStatus}});var FH=wD();Object.defineProperty(v2,"SinkStatusIn",{enumerable:!0,get:function(){return FH.SinkStatusIn}});var NH=u8();Object.defineProperty(v2,"StatusCodeClass",{enumerable:!0,get:function(){return NH.StatusCodeClass}})});var eX=$((n)=>{var $H=n&&n.__createBinding||(Object.create?function(u,D,B,A){if(A===void 0)A=B;var w=Object.getOwnPropertyDescriptor(D,B);if(!w||("get"in w?!D.__esModule:w.writable||w.configurable))w={enumerable:!0,get:function(){return D[B]}};Object.defineProperty(u,A,w)}:function(u,D,B,A){if(A===void 0)A=B;u[A]=D[B]}),tX=n&&n.__exportStar||function(u,D){for(var B in u)if(B!=="default"&&!Object.prototype.hasOwnProperty.call(D,B))$H(D,u,B)};Object.defineProperty(n,"__esModule",{value:!0});n.Svix=n.messageInRaw=n.ValidationError=n.HttpErrorOut=n.HTTPValidationError=n.ApiException=void 0;var vH=s6(),zH=PA(),ZH=pA(),JH=cw(),QH=nF(),WH=Z7(),XH=_7(),YH=d7(),hH=Az(),KH=Uz(),xH=J8(),SH=tZ(),RH=OJ(),HH=rJ(),UH=HX(),cH=K8(),MH=n3();Object.defineProperty(n,"ApiException",{enumerable:!0,get:function(){return MH.ApiException}});var V8=MX();Object.defineProperty(n,"HTTPValidationError",{enumerable:!0,get:function(){return V8.HTTPValidationError}});Object.defineProperty(n,"HttpErrorOut",{enumerable:!0,get:function(){return V8.HttpErrorOut}});Object.defineProperty(n,"ValidationError",{enumerable:!0,get:function(){return V8.ValidationError}});tX(bX(),n);tX(sX(),n);var LH=J8();Object.defineProperty(n,"messageInRaw",{enumerable:!0,get:function(){return LH.messageInRaw}});var EH=[{region:"us",url:"https://api.us.svix.com"},{region:"eu",url:"https://api.eu.svix.com"},{region:"in",url:"https://api.in.svix.com"},{region:"ca",url:"https://api.ca.svix.com"},{region:"au",url:"https://api.au.svix.com"}];class oX{constructor(u,D={}){var B,A,w;let F=(B=EH.find((G)=>G.region===u.split(".")[1]))===null||B===void 0?void 0:B.url,N=(w=(A=D.serverUrl)!==null&&A!==void 0?A:F)!==null&&w!==void 0?w:"https://api.svix.com";if(D.retryScheduleInMs){this.requestCtx={baseUrl:N,token:u,timeout:D.requestTimeout,retryScheduleInMs:D.retryScheduleInMs,fetch:D.fetch};return}if(D.numRetries){this.requestCtx={baseUrl:N,token:u,timeout:D.requestTimeout,numRetries:D.numRetries,fetch:D.fetch};return}this.requestCtx={baseUrl:N,token:u,timeout:D.requestTimeout,fetch:D.fetch}}get application(){return new vH.Application(this.requestCtx)}get authentication(){return new zH.Authentication(this.requestCtx)}get backgroundTask(){return new ZH.BackgroundTask(this.requestCtx)}get connector(){return new JH.Connector(this.requestCtx)}get endpoint(){return new QH.Endpoint(this.requestCtx)}get environment(){return new WH.Environment(this.requestCtx)}get eventType(){return new XH.EventType(this.requestCtx)}get health(){return new YH.Health(this.requestCtx)}get ingest(){return new hH.Ingest(this.requestCtx)}get integration(){return new KH.Integration(this.requestCtx)}get message(){return new xH.Message(this.requestCtx)}get messageAttempt(){return new SH.MessageAttempt(this.requestCtx)}get operationalWebhook(){return new RH.OperationalWebhook(this.requestCtx)}get statistics(){return new HH.Statistics(this.requestCtx)}get streaming(){return new UH.Streaming(this.requestCtx)}get operationalWebhookEndpoint(){return new cH.OperationalWebhookEndpoint(this.requestCtx)}}n.Svix=oX});class Q0{}import{readdir as Dh}from"fs/promises";class mu extends Q0{folderPath;constructor(u=`${process.env.ROOT_DIR}/storage`){super();this.folderPath=u}async put(u){let D,B;if(u instanceof Blob)D=u,B=`${Bun.randomUUIDv7()}.${u.type.split("/")[1].split(";")[0]}`;else D=u.body,B=u.name;let A=D instanceof Buffer?D:D instanceof Blob||D instanceof File?Buffer.from(await D.arrayBuffer()):"",w=`${this.folderPath}/${B}`;return await Bun.write(w,A),B}async fetch(u){let D=process.env.BUCKET_NAME,B;if(typeof u==="string")B=u;else D=u.bucket??D,B=u.name;if(!B)throw Error("Object name has to be specified");let A=`${this.folderPath}/${B}`,w=Bun.file(A),F=Bun.file(A).stream(),N=new Date(w.lastModified).toUTCString();return new Response(F,{headers:{"Content-Type":w.type,"Content-Length":String(w.size),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":N}})}async list(){return await Dh(this.folderPath)}}class m5 extends f{driver=new mu;boot(){}}var g5=X(m2(),1);function Bh(u){return(D)=>async(B)=>{let{request:A}=B;if(u.expectContinueHeader!==!1&&g5.HttpRequest.isInstance(A)&&A.body&&u.runtime==="node"&&u.requestHandler?.constructor?.name!=="FetchHttpHandler"){let w=!0;if(typeof u.expectContinueHeader==="number")try{w=(Number(A.headers?.["content-length"])??u.bodyLengthChecker?.(A.body)??1/0)>=u.expectContinueHeader}catch(F){}else w=!!u.expectContinueHeader;if(w)A.headers.Expect="100-continue"}return D({...B,request:A})}}var Ah={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},_5=(u)=>({applyToStack:(D)=>{D.add(Bh(u),Ah)}});var S2={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},gu=S2.WHEN_SUPPORTED,A0={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},_u=S2.WHEN_SUPPORTED,k;(function(u){u.MD5="MD5",u.CRC32="CRC32",u.CRC32C="CRC32C",u.CRC64NVME="CRC64NVME",u.SHA1="SHA1",u.SHA256="SHA256"})(k||(k={}));var f5;(function(u){u.HEADER="header",u.TRAILER="trailer"})(f5||(f5={}));var uu=k.CRC32;var f2;(function(u){u.ENV="env",u.CONFIG="shared config entry"})(f2||(f2={}));var W0=(u,D,B,A)=>{if(!(D in u))return;let w=u[D].toUpperCase();if(!Object.values(B).includes(w))throw TypeError(`Cannot load ${A} '${D}'. Expected one of ${Object.values(B)}, got '${u[D]}'.`);return w};var wh="AWS_REQUEST_CHECKSUM_CALCULATION",Fh="request_checksum_calculation",b5={environmentVariableSelector:(u)=>W0(u,wh,S2,f2.ENV),configFileSelector:(u)=>W0(u,Fh,S2,f2.CONFIG),default:gu};var Nh="AWS_RESPONSE_CHECKSUM_VALIDATION",Gh="response_checksum_validation",j5={environmentVariableSelector:(u)=>W0(u,Nh,A0,f2.ENV),configFileSelector:(u)=>W0(u,Gh,A0,f2.CONFIG),default:_u};var X0=X(Y0(),1),u4=X(m2(),1),D4=X(iu(),1);var l5=(u,{requestChecksumRequired:D,requestAlgorithmMember:B,requestChecksumCalculation:A})=>{if(!B)return A===S2.WHEN_SUPPORTED||D?uu:void 0;if(!u[B])return;return u[B]};var w0=(u)=>u===k.MD5?"content-md5":`x-amz-checksum-${u.toLowerCase()}`;var d5=(u,D)=>{let B=u.toLowerCase();for(let A of Object.keys(D))if(B===A.toLowerCase())return!0;return!1};var r5=(u,D)=>{let B=u.toLowerCase();for(let A of Object.keys(D))if(A.toLowerCase().startsWith(B))return!0;return!1};var i5=X($h(),1),fu=(u)=>u!==void 0&&typeof u!=="string"&&!ArrayBuffer.isView(u)&&!i5.isArrayBuffer(u);var n5=X(vh(),1),{__extends:fU,__assign:bU,__rest:jU,__decorate:lU,__param:dU,__esDecorate:rU,__runInitializers:iU,__propKey:nU,__setFunctionName:pU,__metadata:aU,__awaiter:bu,__generator:ju,__exportStar:sU,__createBinding:tU,__values:lu,__read:oU,__spread:eU,__spreadArrays:uc,__spreadArray:Dc,__await:Bc,__asyncGenerator:Ac,__asyncDelegator:wc,__asyncValues:Fc,__makeTemplateObject:Nc,__importStar:Gc,__importDefault:$c,__classPrivateFieldGet:vc,__classPrivateFieldSet:zc,__classPrivateFieldIn:Zc,__addDisposableResource:Jc,__disposeResources:Qc,__rewriteRelativeImportExtension:Wc}=n5.default;import{Buffer as p5}from"buffer";var a5=(u,D)=>{if(typeof u!=="string")throw TypeError(`The "input" argument must be of type string. Received type ${typeof u} (${u})`);return D?p5.from(u,D):p5.from(u)};var PD=(u)=>{let D=a5(u,"utf8");return new Uint8Array(D.buffer,D.byteOffset,D.byteLength/Uint8Array.BYTES_PER_ELEMENT)};var zh=typeof Buffer<"u"&&Buffer.from?function(u){return Buffer.from(u,"utf8")}:PD;function Du(u){if(u instanceof Uint8Array)return u;if(typeof u==="string")return zh(u);if(ArrayBuffer.isView(u))return new Uint8Array(u.buffer,u.byteOffset,u.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(u)}function Bu(u){if(typeof u==="string")return u.length===0;return u.byteLength===0}function F0(u){return new Uint8Array([(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&255])}function Au(u){if(!Uint32Array.from){var D=new Uint32Array(u.length),B=0;while(B<u.length)D[B]=u[B],B+=1;return D}return Uint32Array.from(u)}var yD=function(){function u(){this.crc32c=new kD}return u.prototype.update=function(D){if(Bu(D))return;this.crc32c.update(Du(D))},u.prototype.digest=function(){return bu(this,void 0,void 0,function(){return ju(this,function(D){return[2,F0(this.crc32c.digest())]})})},u.prototype.reset=function(){this.crc32c=new kD},u}();var kD=function(){function u(){this.checksum=4294967295}return u.prototype.update=function(D){var B,A;try{for(var w=lu(D),F=w.next();!F.done;F=w.next()){var N=F.value;this.checksum=this.checksum>>>8^Jh[(this.checksum^N)&255]}}catch(G){B={error:G}}finally{try{if(F&&!F.done&&(A=w.return))A.call(w)}finally{if(B)throw B.error}}return this},u.prototype.digest=function(){return(this.checksum^4294967295)>>>0},u}();var Zh=[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],Jh=Au(Zh);var Qh=()=>{let D=[,,,,,,,,];for(let B=0;B<8;B++){let A=Array(512);for(let w=0;w<256;w++){let F=BigInt(w);for(let N=0;N<8*(B+1);N++)if(F&1n)F=F>>1n^0x9a6c9329ac4bc9b5n;else F=F>>1n;A[w*2]=Number(F>>32n&0xffffffffn),A[w*2+1]=Number(F&0xffffffffn)}D[B]=new Uint32Array(A)}return D},VD,wu,TD,ID,qD,mD,gD,_D,fD,Wh=()=>{if(!VD)VD=Qh(),[wu,TD,ID,qD,mD,gD,_D,fD]=VD};class bD{c1=0;c2=0;constructor(){Wh(),this.reset()}update(u){let D=u.length,B=0,A=this.c1,w=this.c2;while(B+8<=D){let F=((w^u[B++])&255)<<1,N=((w>>>8^u[B++])&255)<<1,G=((w>>>16^u[B++])&255)<<1,v=((w>>>24^u[B++])&255)<<1,z=((A^u[B++])&255)<<1,Q=((A>>>8^u[B++])&255)<<1,Z=((A>>>16^u[B++])&255)<<1,J=((A>>>24^u[B++])&255)<<1;A=fD[F]^_D[N]^gD[G]^mD[v]^qD[z]^ID[Q]^TD[Z]^wu[J],w=fD[F+1]^_D[N+1]^gD[G+1]^mD[v+1]^qD[z+1]^ID[Q+1]^TD[Z+1]^wu[J+1]}while(B<D){let F=((w^u[B])&255)<<1;w=(w>>>8|(A&255)<<24)>>>0,A=A>>>8^wu[F],w^=wu[F+1],B++}this.c1=A,this.c2=w}async digest(){let u=this.c1^4294967295,D=this.c2^4294967295;return new Uint8Array([u>>>24,u>>>16&255,u>>>8&255,u&255,D>>>24,D>>>16&255,D>>>8&255,D&255])}reset(){this.c1=4294967295,this.c2=4294967295}}var jD={CrtCrc64Nvme:null};var lD=function(){function u(){this.crc32=new N0}return u.prototype.update=function(D){if(Bu(D))return;this.crc32.update(Du(D))},u.prototype.digest=function(){return bu(this,void 0,void 0,function(){return ju(this,function(D){return[2,F0(this.crc32.digest())]})})},u.prototype.reset=function(){this.crc32=new N0},u}();var N0=function(){function u(){this.checksum=4294967295}return u.prototype.update=function(D){var B,A;try{for(var w=lu(D),F=w.next();!F.done;F=w.next()){var N=F.value;this.checksum=this.checksum>>>8^Yh[(this.checksum^N)&255]}}catch(G){B={error:G}}finally{try{if(F&&!F.done&&(A=w.return))A.call(w)}finally{if(B)throw B.error}}return this},u.prototype.digest=function(){return(this.checksum^4294967295)>>>0},u}();var Xh=[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],Yh=Au(Xh);import*as dD from"zlib";class s5{checksum=0;update(u){this.checksum=dD.crc32(u,this.checksum)}async digest(){return F0(this.checksum)}reset(){this.checksum=0}}var t5=()=>{if(typeof dD.crc32>"u")return lD;return s5};var o5=[k.CRC32,k.CRC32C,k.CRC64NVME,k.SHA1,k.SHA256],rD=[k.SHA256,k.SHA1,k.CRC32,k.CRC32C,k.CRC64NVME];var du=(u,D)=>{let{checksumAlgorithms:B={}}=D;switch(u){case k.MD5:return B?.MD5??D.md5;case k.CRC32:return B?.CRC32??t5();case k.CRC32C:return B?.CRC32C??yD;case k.CRC64NVME:if(typeof jD.CrtCrc64Nvme!=="function")return B?.CRC64NVME??bD;return B?.CRC64NVME??jD.CrtCrc64Nvme;case k.SHA1:return B?.SHA1??D.sha1;case k.SHA256:return B?.SHA256??D.sha256;default:if(B?.[u])return B[u];throw Error(`The checksum algorithm "${u}" is not supported by the client. Select one of ${o5}, or provide an implementation to the client constructor checksums field.`)}};var e5=X(iD(),1),ru=(u,D)=>{let B=new u;return B.update(e5.toUint8Array(D||"")),B.digest()};var B4={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},A4=(u,D)=>(B,A)=>async(w)=>{if(!u4.HttpRequest.isInstance(w.request))return B(w);if(r5("x-amz-checksum-",w.request.headers))return B(w);let{request:F,input:N}=w,{body:G,headers:v}=F,{base64Encoder:z,streamHasher:Q}=u,{requestChecksumRequired:Z,requestAlgorithmMember:J}=D,W=await u.requestChecksumCalculation(),Y=J?.name,M=J?.httpHeader;if(Y&&!N[Y]){if(W===S2.WHEN_SUPPORTED||Z){if(N[Y]=uu,M)v[M]=uu}}let x=l5(N,{requestChecksumRequired:Z,requestAlgorithmMember:J?.name,requestChecksumCalculation:W}),L=G,S=v;if(x){switch(x){case k.CRC32:X0.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_CRC32","U");break;case k.CRC32C:X0.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_CRC32C","V");break;case k.CRC64NVME:X0.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_CRC64","W");break;case k.SHA1:X0.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_SHA1","X");break;case k.SHA256:X0.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_SHA256","Y");break}let y=w0(x),_=du(x,u);if(fu(G)){let{getAwsChunkedEncodingStream:V,bodyLengthChecker:x2}=u;L=V(typeof u.requestStreamBufferSize==="number"&&u.requestStreamBufferSize>=8192?D4.createBufferedReadable(G,u.requestStreamBufferSize,A.logger):G,{base64Encoder:z,bodyLengthChecker:x2,checksumLocationName:y,checksumAlgorithmFn:_,streamHasher:Q}),S={...v,"content-encoding":v["content-encoding"]?`${v["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":v["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":y},delete S["content-length"]}else if(!d5(y,v)){let V=await ru(_,G);S={...v,[y]:z(V)}}}try{return await B({...w,request:{...F,headers:S,body:L}})}catch(y){if(y instanceof Error&&y.name==="InvalidChunkSizeError")try{if(!y.message.endsWith("."))y.message+=".";y.message+=" Set [requestStreamBufferSize=number e.g. 65_536] in client constructor to instruct AWS SDK to buffer your input stream."}catch(_){}throw y}};var Fu=X(Y0(),1);var w4={name:"flexibleChecksumsInputMiddleware",toMiddleware:"serializerMiddleware",relation:"before",tags:["BODY_CHECKSUM"],override:!0},F4=(u,D)=>(B,A)=>async(w)=>{let F=w.input,{requestValidationModeMember:N}=D,G=await u.requestChecksumCalculation(),v=await u.responseChecksumValidation();switch(G){case S2.WHEN_REQUIRED:Fu.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED","a");break;case S2.WHEN_SUPPORTED:Fu.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED","Z");break}switch(v){case A0.WHEN_REQUIRED:Fu.setFeature(A,"FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED","c");break;case A0.WHEN_SUPPORTED:Fu.setFeature(A,"FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED","b");break}if(N&&!F[N]){if(v===A0.WHEN_SUPPORTED)F[N]="ENABLED"}return B(w)};var z4=X(m2(),1);var nu=(u=[])=>{let D=[],B=rD.length;for(let A of u){let w=rD.indexOf(A);if(w!==-1)D[w]=A;else D[B++]=A}return D.filter(Boolean)};var N4=(u)=>{let D=u.lastIndexOf("-");if(D!==-1){let B=u.slice(D+1);if(!B.startsWith("0")){let A=parseInt(B,10);if(!isNaN(A)&&A>=1&&A<=1e4)return!0}}return!1};var $4=X(iu(),1);var G4=async(u,{checksumAlgorithmFn:D,base64Encoder:B})=>B(await ru(D,u));var v4=async(u,{config:D,responseAlgorithms:B,logger:A})=>{let w=nu(B),{body:F,headers:N}=u;for(let G of w){let v=w0(G),z=N[v];if(z){let Q;try{Q=du(G,D)}catch(W){if(G===k.CRC64NVME){A?.warn(`Skipping ${k.CRC64NVME} checksum validation: ${W.message}`);continue}throw W}let{base64Encoder:Z}=D;if(fu(F)){u.body=$4.createChecksumStream({expectedChecksum:z,checksumSourceLocation:v,checksum:new Q,source:F,base64Encoder:Z});return}let J=await G4(F,{checksumAlgorithmFn:Q,base64Encoder:Z});if(J===z)break;throw Error(`Checksum mismatch: expected "${J}" but received "${z}" in response header "${v}".`)}}};var Z4={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},J4=(u,D)=>(B,A)=>async(w)=>{if(!z4.HttpRequest.isInstance(w.request))return B(w);let F=w.input,N=await B(w),G=N.response,{requestValidationModeMember:v,responseAlgorithms:z}=D;if(v&&F[v]==="ENABLED"){let{clientName:Q,commandName:Z}=A,J=Object.keys(u.checksumAlgorithms??{}).filter((M)=>{let x=w0(M);return G.headers[x]!==void 0}),W=nu([...z??[],...J]);if(Q==="S3Client"&&Z==="GetObjectCommand"&&W.every((M)=>{let x=w0(M),L=G.headers[x];return!L||N4(L)}))return N;await v4(G,{config:u,responseAlgorithms:W,logger:A.logger})}return N};var pu=(u,D)=>({applyToStack:(B)=>{B.add(A4(u,D),B4),B.addRelativeTo(F4(u,D),w4),B.addRelativeTo(J4(u,D),Z4)}});var nD=X(pD(),1);var Q4=(u)=>{let{requestChecksumCalculation:D,responseChecksumValidation:B,requestStreamBufferSize:A}=u;return Object.assign(u,{requestChecksumCalculation:nD.normalizeProvider(D??gu),responseChecksumValidation:nD.normalizeProvider(B??_u),requestStreamBufferSize:Number(A??0),checksumAlgorithms:u.checksumAlgorithms??{}})};var I1=X(wx(),1),N6=X(Fx(),1),G6=X(Nx(),1);var W4=X(m2(),1),X4=X(k2(),1),hh="content-length",Kh="x-amz-decoded-content-length";function xh(){return(u,D)=>async(B)=>{let{request:A}=B;if(W4.HttpRequest.isInstance(A)){if(!(hh in A.headers)&&!(Kh in A.headers))if(typeof D?.logger?.warn==="function"&&!(D.logger instanceof X4.NoOpLogger))D.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 u({...B})}}var Sh={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},Y4=(u)=>({applyToStack:(D)=>{D.add(xh(),Sh)}});var h4=(u)=>{return(D,B)=>async(A)=>{let w=await u.region(),F=u.region,N=()=>{};if(B.__s3RegionRedirect)Object.defineProperty(u,"region",{writable:!1,value:async()=>{return B.__s3RegionRedirect}}),N=()=>Object.defineProperty(u,"region",{writable:!0,value:F});try{let G=await D(A);if(B.__s3RegionRedirect){N();let v=await u.region();if(w!==v)throw Error("Region was not restored following S3 region redirect.")}return G}catch(G){throw N(),G}}},K4={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function Rh(u){return(D,B)=>async(A)=>{try{return await D(A)}catch(w){if(u.followRegionRedirects){let F=w?.$metadata?.httpStatusCode,N=B.commandName==="HeadBucketCommand",G=w?.$response?.headers?.["x-amz-bucket-region"];if(G){if(F===301||F===400&&(w?.name==="IllegalLocationConstraintException"||N)){try{let v=G;B.logger?.debug(`Redirecting from ${await u.region()} to ${v}`),B.__s3RegionRedirect=v}catch(v){throw Error("Region redirect failed: "+v)}return D(A)}}}throw w}}}var Hh={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},x4=(u)=>({applyToStack:(D)=>{D.add(Rh(u),Hh),D.addRelativeTo(h4(u),K4)}});var S4=X(m2(),1),R4=X(k2(),1),Uh=(u)=>{return(D,B)=>async(A)=>{let w=await D(A),{response:F}=w;if(S4.HttpResponse.isInstance(F)){if(F.headers.expires){F.headers.expiresstring=F.headers.expires;try{R4.parseRfc7231DateTime(F.headers.expires)}catch(N){B.logger?.warn(`AWS SDK Warning for ${B.clientName}::${B.commandName} response parsing (${F.headers.expires}): ${N}`),delete F.headers.expires}}}return w}},ch={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},H4=(u)=>({applyToStack:(D)=>{D.addRelativeTo(Uh(u),ch)}});class au{data;lastPurgeTime=Date.now();static EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;constructor(u={}){this.data=u}get(u){let D=this.data[u];if(!D)return;return D}set(u,D){return this.data[u]=D,D}delete(u){delete this.data[u]}async purgeExpired(){let u=Date.now();if(this.lastPurgeTime+au.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>u)return;for(let D in this.data){let B=this.data[D];if(!B.isRefreshing){let A=await B.identity;if(A.expiration){if(A.expiration.getTime()<u)delete this.data[D]}}}}}class Nu{_identity;isRefreshing;accessed;constructor(u,D=!1,B=Date.now()){this._identity=u,this.isRefreshing=D,this.accessed=B}get identity(){return this.accessed=Date.now(),this._identity}}class Gu{createSessionFn;cache;static REFRESH_WINDOW_MS=60000;constructor(u,D=new au){this.createSessionFn=u,this.cache=D}async getS3ExpressIdentity(u,D){let B=D.Bucket,{cache:A}=this,w=A.get(B);if(w)return w.identity.then((F)=>{if((F.expiration?.getTime()??0)<Date.now())return A.set(B,new Nu(this.getIdentity(B))).identity;if((F.expiration?.getTime()??0)<Date.now()+Gu.REFRESH_WINDOW_MS&&!w.isRefreshing)w.isRefreshing=!0,this.getIdentity(B).then((v)=>{A.set(B,new Nu(Promise.resolve(v)))});return F});return A.set(B,new Nu(this.getIdentity(B))).identity}async getIdentity(u){await this.cache.purgeExpired().catch((A)=>{console.warn(`Error while clearing expired entries in S3ExpressIdentityCache:
|
|
4
|
-
`+A)});let D=await this.createSessionFn(u);if(!D.Credentials?.AccessKeyId||!D.Credentials?.SecretAccessKey)throw Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:D.Credentials.AccessKeyId,secretAccessKey:D.Credentials.SecretAccessKey,sessionToken:D.Credentials.SessionToken,expiration:D.Credentials.Expiration?new Date(D.Credentials.Expiration):void 0}}}var P4=X(C4(),1);var h0=X(U4(),1),c4="Directory",M4="S3Express",L4="sigv4-s3express",su="X-Amz-S3session-Token",$u=su.toLowerCase(),Mh="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",Lh="s3_disable_express_session_auth",aD={environmentVariableSelector:(u)=>h0.booleanSelector(u,Mh,h0.SelectorType.ENV),configFileSelector:(u)=>h0.booleanSelector(u,Lh,h0.SelectorType.CONFIG),default:!1};class tu extends P4.SignatureV4{async signWithCredentials(u,D,B){let A=E4(D);u.headers[$u]=D.sessionToken;let w=this;return O4(w,A),w.signRequest(u,B??{})}async presignWithCredentials(u,D,B){let A=E4(D);return delete u.headers[$u],u.headers[su]=D.sessionToken,u.query=u.query??{},u.query[su]=D.sessionToken,O4(this,A),this.presign(u,B)}}function E4(u){return{accessKeyId:u.accessKeyId,secretAccessKey:u.secretAccessKey,expiration:u.expiration}}function O4(u,D){let B=setTimeout(()=>{throw Error("SignatureV4S3Express credential override was created but not called.")},10),A=u.credentialProvider,w=()=>{return clearTimeout(B),u.credentialProvider=A,Promise.resolve(D)};u.credentialProvider=w}var k4=X(Y0(),1),y4=X(m2(),1);var V4=(u)=>{return(D,B)=>async(A)=>{if(B.endpointV2){let w=B.endpointV2,F=w.properties?.authSchemes?.[0]?.name===L4;if(w.properties?.backend===M4||w.properties?.bucketType===c4)k4.setFeature(B,"S3_EXPRESS_BUCKET","J"),B.isS3ExpressBucket=!0;if(F){let G=A.input.Bucket;if(G){let v=await u.s3ExpressIdentityProvider.getS3ExpressIdentity(await u.credentials(),{Bucket:G});if(B.s3ExpressIdentity=v,y4.HttpRequest.isInstance(A.request)&&v.sessionToken)A.request.headers[$u]=v.sessionToken}}}return D(A)}},T4={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},sD=(u)=>({applyToStack:(D)=>{D.add(V4(u),T4)}});var m4=X(q4(),1),g4=X(m2(),1),_4=X(pD(),1);var I4=async(u,D,B,A)=>{let w=await A.signWithCredentials(B,u,{});if(w.headers["X-Amz-Security-Token"]||w.headers["x-amz-security-token"])throw Error("X-Amz-Security-Token must not be set for s3-express requests.");return w};var Eh=(u)=>(D)=>{throw D},Oh=(u,D)=>{};var f4=(u)=>(D,B)=>async(A)=>{if(!g4.HttpRequest.isInstance(A.request))return D(A);let F=_4.getSmithyContext(B).selectedHttpAuthScheme;if(!F)throw Error("No HttpAuthScheme was selected: unable to sign request");let{httpAuthOption:{signingProperties:N={}},identity:G,signer:v}=F,z;if(B.s3ExpressIdentity)z=await I4(B.s3ExpressIdentity,N,A.request,await u.signer());else z=await v.sign(A.request,G,N);let Q=await D({...A,request:z}).catch((v.errorHandler||Eh)(N));return(v.successHandler||Oh)(Q.response,N),Q},tD=(u)=>({applyToStack:(D)=>{D.addRelativeTo(f4(u),m4.httpSigningMiddlewareOptions)}});var b4=(u,{session:D})=>{let[B,A]=D,{forcePathStyle:w,useAccelerateEndpoint:F,disableMultiregionAccessPoints:N,followRegionRedirects:G,s3ExpressIdentityProvider:v,bucketEndpoint:z,expectContinueHeader:Q}=u;return Object.assign(u,{forcePathStyle:w??!1,useAccelerateEndpoint:F??!1,disableMultiregionAccessPoints:N??!1,followRegionRedirects:G??!1,s3ExpressIdentityProvider:v??new Gu(async(Z)=>B().send(new A({Bucket:Z}))),bucketEndpoint:z??!1,expectContinueHeader:Q??2097152})};var j4=X(m2(),1),ou=X(iu(),1),Ch={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Ph=3000,kh=(u)=>(D,B)=>async(A)=>{let w=await D(A),{response:F}=w;if(!j4.HttpResponse.isInstance(F))return w;let{statusCode:N,body:G}=F;if(N<200||N>=300)return w;if(!(typeof G?.stream==="function"||typeof G?.pipe==="function"||typeof G?.tee==="function"))return w;let z=G,Q=G;if(G&&typeof G==="object"&&!(G instanceof Uint8Array))[z,Q]=await ou.splitStream(G);F.body=Q;let Z=await yh(z,{streamCollector:async(W)=>{return ou.headStream(W,Ph)}});if(typeof z?.destroy==="function")z.destroy();let J=u.utf8Encoder(Z.subarray(Z.length-16));if(Z.length===0&&Ch[B.commandName]){let W=Error("S3 aborted request");throw W.name="InternalError",W}if(J&&J.endsWith("</Error>"))F.statusCode=400;return w},yh=(u=new Uint8Array,D)=>{if(u instanceof Uint8Array)return Promise.resolve(u);return D.streamCollector(u)||Promise.resolve(new Uint8Array)},Vh={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},K0=(u)=>({applyToStack:(D)=>{D.addRelativeTo(kh(u),Vh)}});var l4=(u)=>typeof u==="string"&&u.indexOf("arn:")===0&&u.split(":").length>=6;function d4(u){return(D,B)=>async(A)=>{if(u.bucketEndpoint){let w=B.endpointV2;if(w){let F=A.input.Bucket;if(typeof F==="string")try{let N=new URL(F);B.endpointV2={...w,url:N}}catch(N){let G=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${F} could not be parsed as URL.`;if(B.logger?.constructor?.name==="NoOpLogger")console.warn(G);else B.logger?.warn?.(G);throw N}}}return D(A)}}var r4={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Th({bucketEndpoint:u}){return(D)=>async(B)=>{let{input:{Bucket:A}}=B;if(!u&&typeof A==="string"&&!l4(A)&&A.indexOf("/")>=0){let w=Error(`Bucket name shouldn't contain '/', received '${A}'`);throw w.name="InvalidBucketName",w}return D({...B})}}var Ih={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},i4=(u)=>({applyToStack:(D)=>{D.add(Th(u),Ih),D.addRelativeTo(d4(u),r4)}});var q1=X(Gx(),1),$6=X(tB(),1),O0=X(q4(),1),v6=X(ZB(),1);var n4=(u)=>Object.assign(u,{eventStreamMarshaller:u.eventStreamSerdeProvider(u)});var z6=X($x(),1),Z6=X(U0(),1),m1=X(oB(),1),J6=X(k2(),1);var w1=X(Y0(),1);var oD=X(C4(),1);var vu={CrtSignerV4:null};class zu{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){if(typeof vu.CrtSignerV4==="function")return"crt";else if(typeof oD.signatureV4aContainer.SignatureV4a==="function")return"js";return"none"}constructor(u){this.sigv4Signer=new tu(u),this.signerOptions=u}async sign(u,D={}){if(D.signingRegion==="*")return this.getSigv4aSigner().sign(u,D);return this.sigv4Signer.sign(u,D)}async signWithCredentials(u,D,B={}){if(B.signingRegion==="*"){let A=this.getSigv4aSigner(),w=vu.CrtSignerV4;if(w&&A instanceof w)return A.signWithCredentials(u,D,B);else throw Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.signWithCredentials(u,D,B)}async presign(u,D={}){if(D.signingRegion==="*"){let B=this.getSigv4aSigner(),A=vu.CrtSignerV4;if(A&&B instanceof A)return B.presign(u,D);else throw Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.presign(u,D)}async presignWithCredentials(u,D,B={}){if(B.signingRegion==="*")throw Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(u,D,B)}getSigv4aSigner(){if(!this.sigv4aSigner){let u=vu.CrtSignerV4,D=oD.signatureV4aContainer.SignatureV4a;if(this.signerOptions.runtime==="node"){if(!u&&!D)throw Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");if(u&&typeof u==="function")this.sigv4aSigner=new u({...this.signerOptions,signingAlgorithm:1});else if(D&&typeof D==="function")this.sigv4aSigner=new D({...this.signerOptions});else throw Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt")}else{if(!D||typeof D!=="function")throw Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");this.sigv4aSigner=new D({...this.signerOptions})}}return this.sigv4aSigner}}var BB=X(U0(),1),c0=X(pD(),1);var DB=X(ih(),1),H0=X(rh(),1);var x0={["required"]:!1,["type"]:"string"},S0={["required"]:!0,default:!1,["type"]:"boolean"},Zu={["required"]:!1,["type"]:"boolean"},H2={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},I={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},j={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},n9={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},p4={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},Qu={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},O={["ref"]:"Bucket"},a4={["conditions"]:[H2],["error"]:"S3Express does not support S3 Accelerate.",["type"]:"error"},s4={["conditions"]:[j,{["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"}],["rules"]:[{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],["rules"]:[{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]}],["rules"]:[{["conditions"]:[{["fn"]:"uriEncode",["argv"]:[O],["assign"]:"uri_encoded_bucket"}],["rules"]:[{["endpoint"]:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[O,!1]}],["rules"]:[{["endpoint"]:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],["type"]:"tree"},{["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]}],["rules"]:[{["conditions"]:[{["fn"]:"uriEncode",["argv"]:[O],["assign"]:"uri_encoded_bucket"}],["rules"]:[{["endpoint"]:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[O,!1]}],["rules"]:[{["endpoint"]:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],["type"]:"tree"},{["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"}],["type"]:"tree"},$2={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},eD={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},p9={["ref"]:"url"},a9={["fn"]:"uriEncode",["argv"]:[O],["assign"]:"uri_encoded_bucket"},X2={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},h={},s9={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[O,!1]},t4={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},o4={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},e4={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},K={["fn"]:"not",["argv"]:[j]},U={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},R={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},eu={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},u9={["fn"]:"not",["argv"]:[Qu]},D9={["ref"]:"hardwareType"},B9={["conditions"]:[K],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},u1={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},u3={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},qh={["ref"]:"ForcePathStyle"},l={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},p={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},t={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},E={["fn"]:"not",["argv"]:[p]},o={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},A9={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},d={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},e={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},w9={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},F9={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},N9={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},D3={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[p9,"isIp"]},!1]},B3={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:d,["headers"]:{}},H3={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:d,["headers"]:{}},G9={["endpoint"]:H3,["type"]:"endpoint"},A3={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},$9={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},D1={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},z2={["ref"]:"bucketArn"},t9={["ref"]:"arnType"},w3={["fn"]:"getAttr",["argv"]:[z2,"service"]},U3={["ref"]:"accessPointName"},v9={["conditions"]:[T],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},z9={["conditions"]:[H2],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},Z9={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},F3={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},o9={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},e9={["fn"]:"getAttr",["argv"]:[z2,"accountId"]},N3={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},J9={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},G3={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},$3={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},v3={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},Q9={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},W9={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Ju={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},X9={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},Y9={["fn"]:"aws.parseArn",["argv"]:[O]},h9={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},K9={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},x9={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},z3={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},S9={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},R9={["ref"]:"UseObjectLambdaEndpoint"},Z3={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},H9={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},U9={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},c9={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},J3={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:d,["headers"]:{}},M9={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},Q3=[{["ref"]:"Region"}],mh=[{["ref"]:"Endpoint"}],gh=[O],W3=[H2],R0=[j,$2],L9=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],_h=[a9],X3=[s9],R2=[n9],Y3=[I,T],Wu=[I,U],Xu=[R,T],Yu=[R,U],E9=[{["fn"]:"substring",["argv"]:[O,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],T2=[{["conditions"]:[I,T],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Wu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Xu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Yu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:{}},["type"]:"endpoint"}],O9=[{["fn"]:"substring",["argv"]:[O,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],C9=[{["fn"]:"substring",["argv"]:[O,6,19,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,19,21,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],P9=[{["fn"]:"substring",["argv"]:[O,6,20,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,20,22,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],k9=[{["fn"]:"substring",["argv"]:[O,6,26,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,26,28,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],I2=[{["conditions"]:[I,T],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Wu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Xu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Yu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],y9=[O,0,7,!0],V9=[{["fn"]:"substring",["argv"]:[O,7,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],T9=[{["fn"]:"substring",["argv"]:[O,7,16,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,16,18,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],I9=[{["fn"]:"substring",["argv"]:[O,7,20,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,20,22,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],q9=[{["fn"]:"substring",["argv"]:[O,7,21,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,21,23,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],m9=[{["fn"]:"substring",["argv"]:[O,7,27,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,27,29,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],fh=[Qu],g9=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],_9=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],bh=["*"],f9=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],b2=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],h3=[{["fn"]:"stringEquals",["argv"]:[t9,"accesspoint"]}],b9=[{["fn"]:"getAttr",["argv"]:[z2,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[U3,""]}]}],jh=[z2,"resourceId[1]"],j9=[T],K3=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"region"]},""]}]}],l9=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"resourceId[2]"]}]}]}],lh=[z2,"resourceId[2]"],x3=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"region"]}],["assign"]:"bucketPartition"}],d9=[{["fn"]:"stringEquals",["argv"]:[o9,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],S3=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"region"]},!0]}],R3=[{["fn"]:"isValidHostLabel",["argv"]:[e9,!1]}],r9=[{["fn"]:"isValidHostLabel",["argv"]:[U3,!1]}],B1=[I],i9=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],dh={version:"1.0",parameters:{Bucket:x0,Region:x0,UseFIPS:S0,UseDualStack:S0,Endpoint:x0,ForcePathStyle:S0,Accelerate:S0,UseGlobalEndpoint:S0,UseObjectLambdaEndpoint:Zu,Key:x0,Prefix:x0,CopySource:x0,DisableAccessPoints:Zu,DisableMultiRegionAccessPoints:S0,UseArnRegion:Zu,UseS3ExpressControlEndpoint:Zu,DisableS3ExpressSessionAuth:Zu},["rules"]:[{["conditions"]:[{["fn"]:"isSet",["argv"]:Q3}],["rules"]:[{["conditions"]:[H2,I],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[T,j],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[j,I],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[j,H2],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[I,n9,p4],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[Qu,{["fn"]:"substring",["argv"]:[O,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],["rules"]:[a4,s4,{["conditions"]:[o4,e4],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:[a9,K],["rules"]:[{["conditions"]:Y3,endpoint:{["url"]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Wu,endpoint:{["url"]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Xu,endpoint:{["url"]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Yu,endpoint:{["url"]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:X3,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:L9,["rules"]:[{["conditions"]:E9,["rules"]:T2,["type"]:"tree"},{["conditions"]:O9,["rules"]:T2,["type"]:"tree"},{["conditions"]:C9,["rules"]:T2,["type"]:"tree"},{["conditions"]:P9,["rules"]:T2,["type"]:"tree"},{["conditions"]:k9,["rules"]:T2,["type"]:"tree"},eu],["type"]:"tree"},{["conditions"]:E9,["rules"]:I2,["type"]:"tree"},{["conditions"]:O9,["rules"]:I2,["type"]:"tree"},{["conditions"]:C9,["rules"]:I2,["type"]:"tree"},{["conditions"]:P9,["rules"]:I2,["type"]:"tree"},{["conditions"]:k9,["rules"]:I2,["type"]:"tree"},eu],["type"]:"tree"}],["type"]:"tree"},t4],["type"]:"tree"},{["conditions"]:[Qu,{["fn"]:"substring",["argv"]:y9,["assign"]:"accessPointSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"accessPointSuffix"},"--xa-s3"]}],["rules"]:[a4,s4,{["conditions"]:X3,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:L9,["rules"]:[{["conditions"]:V9,["rules"]:T2,["type"]:"tree"},{["conditions"]:T9,["rules"]:T2,["type"]:"tree"},{["conditions"]:I9,["rules"]:T2,["type"]:"tree"},{["conditions"]:q9,["rules"]:T2,["type"]:"tree"},{["conditions"]:m9,["rules"]:T2,["type"]:"tree"},eu],["type"]:"tree"},{["conditions"]:V9,["rules"]:I2,["type"]:"tree"},{["conditions"]:T9,["rules"]:I2,["type"]:"tree"},{["conditions"]:I9,["rules"]:I2,["type"]:"tree"},{["conditions"]:q9,["rules"]:I2,["type"]:"tree"},{["conditions"]:m9,["rules"]:I2,["type"]:"tree"},eu],["type"]:"tree"}],["type"]:"tree"},t4],["type"]:"tree"},{["conditions"]:[u9,o4,e4],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:R0,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Y3,endpoint:{["url"]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Wu,endpoint:{["url"]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Xu,endpoint:{["url"]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Yu,endpoint:{["url"]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Qu,{["fn"]:"substring",["argv"]:[O,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[O,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:y9,["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[O,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:Q3,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],["rules"]:[{["conditions"]:g9,["rules"]:[{["conditions"]:X3,["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[D9,"e"]}],["rules"]:[{["conditions"]:_9,["rules"]:[B9,{["conditions"]:R0,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:u1,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:u1,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[D9,"o"]}],["rules"]:[{["conditions"]:_9,["rules"]:[B9,{["conditions"]:R0,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:u1,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:u1,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},{error:'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"',["type"]:"error"}],["type"]:"tree"},{error:"Invalid Outposts Bucket alias - it must be a valid bucket name.",["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"]:fh,["rules"]:[{["conditions"]:[j,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:mh}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[u3,s9],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:f9,["rules"]:[{["conditions"]:[H2,p4],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[T,I,l,K,p],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[T,I,l,K,E,o],["rules"]:[{endpoint:A9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,I,l,K,E,e],endpoint:A9,["type"]:"endpoint"},{["conditions"]:[U,I,l,K,p],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,I,l,K,E,o],["rules"]:[{endpoint:w9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,I,l,K,E,e],endpoint:w9,["type"]:"endpoint"},{["conditions"]:[T,R,H2,K,p],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[T,R,H2,K,E,o],["rules"]:[{endpoint:F9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,R,H2,K,E,e],endpoint:F9,["type"]:"endpoint"},{["conditions"]:[T,R,l,K,p],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[T,R,l,K,E,o],["rules"]:[{endpoint:N9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,R,l,K,E,e],endpoint:N9,["type"]:"endpoint"},{["conditions"]:[U,R,l,j,$2,eD,p],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,R,l,j,$2,D3,p],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,R,l,j,$2,eD,E,o],["rules"]:[{["conditions"]:b2,endpoint:B3,["type"]:"endpoint"},{endpoint:B3,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,R,l,j,$2,D3,E,o],["rules"]:[{["conditions"]:b2,endpoint:H3,["type"]:"endpoint"},G9],["type"]:"tree"},{["conditions"]:[U,R,l,j,$2,eD,E,e],endpoint:B3,["type"]:"endpoint"},{["conditions"]:[U,R,l,j,$2,D3,E,e],endpoint:H3,["type"]:"endpoint"},{["conditions"]:[U,R,H2,K,p],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,R,H2,K,E,o],["rules"]:[{["conditions"]:b2,endpoint:A3,["type"]:"endpoint"},{endpoint:A3,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,R,H2,K,E,e],endpoint:A3,["type"]:"endpoint"},{["conditions"]:[U,R,l,K,p],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,R,l,K,E,o],["rules"]:[{["conditions"]:b2,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:h},["type"]:"endpoint"},{endpoint:$9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,R,l,K,E,e],endpoint:$9,["type"]:"endpoint"}],["type"]:"tree"},D1],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[j,$2,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[p9,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[O,!0]},u3,R,U,l],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:f9,["rules"]:[G9],["type"]:"tree"},D1],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[u3,{["fn"]:"aws.parseArn",["argv"]:gh,["assign"]:"bucketArn"}],["rules"]:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[z2,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[t9,""]}]}],["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[w3,"s3-object-lambda"]}],["rules"]:[{["conditions"]:h3,["rules"]:[{["conditions"]:b9,["rules"]:[v9,z9,{["conditions"]:K3,["rules"]:[Z9,{["conditions"]:l9,["rules"]:[F3,{["conditions"]:x3,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:d9,["rules"]:[{["conditions"]:S3,["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[e9,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:R3,["rules"]:[{["conditions"]:r9,["rules"]:[{["conditions"]:R0,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:N3,["headers"]:h},["type"]:"endpoint"},{["conditions"]:B1,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:N3,["headers"]:h},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:N3,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},J9],["type"]:"tree"},G3],["type"]:"tree"},$3],["type"]:"tree"},v3],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Q9],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},W9],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:h3,["rules"]:[{["conditions"]:b9,["rules"]:[{["conditions"]:K3,["rules"]:[{["conditions"]:h3,["rules"]:[{["conditions"]:K3,["rules"]:[Z9,{["conditions"]:l9,["rules"]:[F3,{["conditions"]:x3,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[o9,"{partitionResult#name}"]}],["rules"]:[{["conditions"]:S3,["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[w3,"s3"]}],["rules"]:[{["conditions"]:R3,["rules"]:[{["conditions"]:r9,["rules"]:[{["conditions"]:W3,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:Y3,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ju,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Wu,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ju,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Xu,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ju,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[R,U,j,$2],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Ju,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Yu,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ju,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},J9],["type"]:"tree"},G3],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},$3],["type"]:"tree"},v3],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Q9],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[U3,!0]}],["rules"]:[{["conditions"]:j9,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:B1,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:W3,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"]:Q3,["assign"]:"mrapPartition"}],["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[z2,"partition"]}]}],["rules"]:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:bh}]},["headers"]:h},["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"},W9],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[w3,"s3-outposts"]}],["rules"]:[{["conditions"]:j9,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:B1,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:W3,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:jh,["assign"]:"outpostId"}],["rules"]:[{["conditions"]:g9,["rules"]:[F3,{["conditions"]:x3,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:d9,["rules"]:[{["conditions"]:S3,["rules"]:[{["conditions"]:R3,["rules"]:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:lh,["assign"]:"outpostType"}],["rules"]:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[z2,"resourceId[3]"],["assign"]:"accessPointName"}],["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],["rules"]:[{["conditions"]:R0,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:X9,["headers"]:h},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:X9,["headers"]:h},["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"},G3],["type"]:"tree"},$3],["type"]:"tree"},v3],["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"]:[O,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[Y9]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[qh,!0]},Y9],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:_h,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:[l],["rules"]:[{["conditions"]:[T,K,I,p],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[T,K,I,E,o],["rules"]:[{endpoint:h9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,K,I,E,e],endpoint:h9,["type"]:"endpoint"},{["conditions"]:[U,K,I,p],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,K,I,E,o],["rules"]:[{endpoint:K9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,K,I,E,e],endpoint:K9,["type"]:"endpoint"},{["conditions"]:[T,K,R,p],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[T,K,R,E,o],["rules"]:[{endpoint:x9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,K,R,E,e],endpoint:x9,["type"]:"endpoint"},{["conditions"]:[U,j,$2,R,p],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,j,$2,R,E,o],["rules"]:[{["conditions"]:b2,endpoint:z3,["type"]:"endpoint"},{endpoint:z3,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,j,$2,R,E,e],endpoint:z3,["type"]:"endpoint"},{["conditions"]:[U,K,R,p],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,K,R,E,o],["rules"]:[{["conditions"]:b2,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:h},["type"]:"endpoint"},{endpoint:S9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,K,R,E,e],endpoint:S9,["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"]:[R9]},{["fn"]:"booleanEquals",["argv"]:[R9,!0]}],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:i9,["rules"]:[v9,z9,{["conditions"]:R0,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:Z3,["headers"]:h},["type"]:"endpoint"},{["conditions"]:B1,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:Z3,["headers"]:h},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:Z3,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},D1],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[u9],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:i9,["rules"]:[{["conditions"]:[I,T,K,p],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[I,T,K,E,o],["rules"]:[{endpoint:H9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,T,K,E,e],endpoint:H9,["type"]:"endpoint"},{["conditions"]:[I,U,K,p],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[I,U,K,E,o],["rules"]:[{endpoint:U9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,U,K,E,e],endpoint:U9,["type"]:"endpoint"},{["conditions"]:[R,T,K,p],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[R,T,K,E,o],["rules"]:[{endpoint:c9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,T,K,E,e],endpoint:c9,["type"]:"endpoint"},{["conditions"]:[R,U,j,$2,p],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[R,U,j,$2,E,o],["rules"]:[{["conditions"]:b2,endpoint:J3,["type"]:"endpoint"},{endpoint:J3,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,U,j,$2,E,e],endpoint:J3,["type"]:"endpoint"},{["conditions"]:[R,U,K,p],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[R,U,K,E,o],["rules"]:[{["conditions"]:b2,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:h},["type"]:"endpoint"},{endpoint:M9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,U,K,E,e],endpoint:M9,["type"]:"endpoint"}],["type"]:"tree"},D1],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},uB=dh;var nh=new H0.EndpointCache({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),A1=(u,D={})=>{return nh.get(u,()=>H0.resolveEndpoint(uB,{endpointParams:u,logger:D.logger}))};H0.customEndpointFunctions.aws=DB.awsEndpointFunctions;var ph=(u)=>async(D,B,A)=>{if(!A)throw Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");let w=await u(D,B,A),F=c0.getSmithyContext(B)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!F)throw Error(`getEndpointParameterInstructions() is not defined on '${B.commandName}'`);let N=await BB.resolveParams(A,{getEndpointParameterInstructions:F},D);return Object.assign(w,N)},ah=async(u,D,B)=>{return{operation:c0.getSmithyContext(D).operation,region:await c0.normalizeProvider(u.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},AB=ph(ah);function wB(u){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:u.region},propertiesExtractor:(D,B)=>({signingProperties:{config:D,context:B}})}}function FB(u){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:u.region},propertiesExtractor:(D,B)=>({signingProperties:{config:D,context:B}})}}var sh=(u,D,B)=>{return(w)=>{let N=u(w).properties?.authSchemes;if(!N)return D(w);let G=[];for(let v of N){let{name:z,properties:Q={},...Z}=v,J=z.toLowerCase();if(z!==J)console.warn(`HttpAuthScheme has been normalized with lowercasing: '${z}' to '${J}'`);let W;if(J==="sigv4a"){W="aws.auth#sigv4a";let x=N.find((L)=>{let S=L.name.toLowerCase();return S!=="sigv4a"&&S.startsWith("sigv4")});if(zu.sigv4aDependency()==="none"&&x)continue}else if(J.startsWith("sigv4"))W="aws.auth#sigv4";else throw Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${J}'`);let Y=B[W];if(!Y)throw Error(`Could not find HttpAuthOption create function for '${W}'`);let M=Y(w);M.schemeId=W,M.signingProperties={...M.signingProperties||{},...Z,...Q},G.push(M)}return G}},th=(u)=>{let D=[];switch(u.operation){default:D.push(wB(u)),D.push(FB(u))}return D},NB=sh(A1,th,{"aws.auth#sigv4":wB,"aws.auth#sigv4a":FB}),GB=(u)=>{let D=w1.resolveAwsSdkSigV4Config(u),B=w1.resolveAwsSdkSigV4AConfig(D);return Object.assign(B,{authSchemePreference:c0.normalizeProvider(u.authSchemePreference??[])})};var SB=X(U0(),1),RB=X(k2(),1);var $B=(u)=>{return Object.assign(u,{useFipsEndpoint:u.useFipsEndpoint??!1,useDualstackEndpoint:u.useDualstackEndpoint??!1,forcePathStyle:u.forcePathStyle??!1,useAccelerateEndpoint:u.useAccelerateEndpoint??!1,useGlobalEndpoint:u.useGlobalEndpoint??!1,disableMultiregionAccessPoints:u.disableMultiregionAccessPoints??!1,defaultSigningName:"s3",clientContextParams:u.clientContextParams??{}})},j2={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"}};var c3=X(ZB(),1);var vB=X(k2(),1);class r extends vB.ServiceException{constructor(u){super(u);Object.setPrototypeOf(this,r.prototype)}}class F1 extends r{name="NoSuchUpload";$fault="client";constructor(u){super({name:"NoSuchUpload",$fault:"client",...u});Object.setPrototypeOf(this,F1.prototype)}}class N1 extends r{name="AccessDenied";$fault="client";constructor(u){super({name:"AccessDenied",$fault:"client",...u});Object.setPrototypeOf(this,N1.prototype)}}class G1 extends r{name="ObjectNotInActiveTierError";$fault="client";constructor(u){super({name:"ObjectNotInActiveTierError",$fault:"client",...u});Object.setPrototypeOf(this,G1.prototype)}}class $1 extends r{name="BucketAlreadyExists";$fault="client";constructor(u){super({name:"BucketAlreadyExists",$fault:"client",...u});Object.setPrototypeOf(this,$1.prototype)}}class v1 extends r{name="BucketAlreadyOwnedByYou";$fault="client";constructor(u){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...u});Object.setPrototypeOf(this,v1.prototype)}}class z1 extends r{name="NoSuchBucket";$fault="client";constructor(u){super({name:"NoSuchBucket",$fault:"client",...u});Object.setPrototypeOf(this,z1.prototype)}}class Z1 extends r{name="InvalidObjectState";$fault="client";StorageClass;AccessTier;constructor(u){super({name:"InvalidObjectState",$fault:"client",...u});Object.setPrototypeOf(this,Z1.prototype),this.StorageClass=u.StorageClass,this.AccessTier=u.AccessTier}}class J1 extends r{name="NoSuchKey";$fault="client";constructor(u){super({name:"NoSuchKey",$fault:"client",...u});Object.setPrototypeOf(this,J1.prototype)}}class Q1 extends r{name="NotFound";$fault="client";constructor(u){super({name:"NotFound",$fault:"client",...u});Object.setPrototypeOf(this,Q1.prototype)}}class W1 extends r{name="EncryptionTypeMismatch";$fault="client";constructor(u){super({name:"EncryptionTypeMismatch",$fault:"client",...u});Object.setPrototypeOf(this,W1.prototype)}}class X1 extends r{name="InvalidRequest";$fault="client";constructor(u){super({name:"InvalidRequest",$fault:"client",...u});Object.setPrototypeOf(this,X1.prototype)}}class Y1 extends r{name="InvalidWriteOffset";$fault="client";constructor(u){super({name:"InvalidWriteOffset",$fault:"client",...u});Object.setPrototypeOf(this,Y1.prototype)}}class h1 extends r{name="TooManyParts";$fault="client";constructor(u){super({name:"TooManyParts",$fault:"client",...u});Object.setPrototypeOf(this,h1.prototype)}}class K1 extends r{name="IdempotencyParameterMismatch";$fault="client";constructor(u){super({name:"IdempotencyParameterMismatch",$fault:"client",...u});Object.setPrototypeOf(this,K1.prototype)}}class x1 extends r{name="ObjectAlreadyInActiveTierError";$fault="client";constructor(u){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...u});Object.setPrototypeOf(this,x1.prototype)}}var JB=c3.TypeRegistry.for("smithy.ts.sdk.synthetic.com.amazonaws.s3"),oh=[-3,"smithy.ts.sdk.synthetic.com.amazonaws.s3","S3ServiceException",0,[],[]];JB.registerError(oh,r);var G2=c3.TypeRegistry.for("com.amazonaws.s3"),eh=[-3,"com.amazonaws.s3","AccessDenied",{["error"]:"client",["httpError"]:403},[],[]];G2.registerError(eh,N1);var uK=[-3,"com.amazonaws.s3","BucketAlreadyExists",{["error"]:"client",["httpError"]:409},[],[]];G2.registerError(uK,$1);var DK=[-3,"com.amazonaws.s3","BucketAlreadyOwnedByYou",{["error"]:"client",["httpError"]:409},[],[]];G2.registerError(DK,v1);var BK=[-3,"com.amazonaws.s3","EncryptionTypeMismatch",{["error"]:"client",["httpError"]:400},[],[]];G2.registerError(BK,W1);var AK=[-3,"com.amazonaws.s3","IdempotencyParameterMismatch",{["error"]:"client",["httpError"]:400},[],[]];G2.registerError(AK,K1);var wK=[-3,"com.amazonaws.s3","InvalidObjectState",{["error"]:"client",["httpError"]:403},["StorageClass","AccessTier"],[0,0]];G2.registerError(wK,Z1);var FK=[-3,"com.amazonaws.s3","InvalidRequest",{["error"]:"client",["httpError"]:400},[],[]];G2.registerError(FK,X1);var NK=[-3,"com.amazonaws.s3","InvalidWriteOffset",{["error"]:"client",["httpError"]:400},[],[]];G2.registerError(NK,Y1);var GK=[-3,"com.amazonaws.s3","NoSuchBucket",{["error"]:"client",["httpError"]:404},[],[]];G2.registerError(GK,z1);var $K=[-3,"com.amazonaws.s3","NoSuchKey",{["error"]:"client",["httpError"]:404},[],[]];G2.registerError($K,J1);var vK=[-3,"com.amazonaws.s3","NoSuchUpload",{["error"]:"client",["httpError"]:404},[],[]];G2.registerError(vK,F1);var zK=[-3,"com.amazonaws.s3","NotFound",{["error"]:"client"},[],[]];G2.registerError(zK,Q1);var ZK=[-3,"com.amazonaws.s3","ObjectAlreadyInActiveTierError",{["error"]:"client",["httpError"]:403},[],[]];G2.registerError(ZK,x1);var JK=[-3,"com.amazonaws.s3","ObjectNotInActiveTierError",{["error"]:"client",["httpError"]:403},[],[]];G2.registerError(JK,G1);var QK=[-3,"com.amazonaws.s3","TooManyParts",{["error"]:"client",["httpError"]:400},[],[]];G2.registerError(QK,h1);var QB=[JB,G2];var zB=[0,"com.amazonaws.s3","SessionCredentialValue",8,0],WB=[0,"com.amazonaws.s3","SSECustomerKey",8,0],S1=[0,"com.amazonaws.s3","SSEKMSEncryptionContext",8,0],hu=[0,"com.amazonaws.s3","SSEKMSKeyId",8,0],XB=[0,"com.amazonaws.s3","StreamingBlob",{["streaming"]:1},42];var WK=[3,"com.amazonaws.s3","CommonPrefix",0,["Prefix"],[0]];var XK=[3,"com.amazonaws.s3","CreateSessionOutput",{["xmlName"]:"CreateSessionResult"},["Credentials","ServerSideEncryption","SSEKMSKeyId","SSEKMSEncryptionContext","BucketKeyEnabled"],[[()=>LK,{["xmlName"]:"Credentials"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[()=>hu,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[()=>S1,{["httpHeader"]:"x-amz-server-side-encryption-context"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}]],1],YK=[3,"com.amazonaws.s3","CreateSessionRequest",0,["Bucket","SessionMode","ServerSideEncryption","SSEKMSKeyId","SSEKMSEncryptionContext","BucketKeyEnabled"],[[0,1],[0,{["httpHeader"]:"x-amz-create-session-mode"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[()=>hu,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[()=>S1,{["httpHeader"]:"x-amz-server-side-encryption-context"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}]],1];var hK=[3,"com.amazonaws.s3","GetObjectOutput",0,["Body","DeleteMarker","AcceptRanges","Expiration","Restore","LastModified","ContentLength","ETag","ChecksumCRC32","ChecksumCRC32C","ChecksumCRC64NVME","ChecksumSHA1","ChecksumSHA256","ChecksumType","MissingMeta","VersionId","CacheControl","ContentDisposition","ContentEncoding","ContentLanguage","ContentRange","ContentType","Expires","ExpiresString","WebsiteRedirectLocation","ServerSideEncryption","Metadata","SSECustomerAlgorithm","SSECustomerKeyMD5","SSEKMSKeyId","BucketKeyEnabled","StorageClass","RequestCharged","ReplicationStatus","PartsCount","TagCount","ObjectLockMode","ObjectLockRetainUntilDate","ObjectLockLegalHoldStatus"],[[()=>XB,16],[2,{["httpHeader"]:"x-amz-delete-marker"}],[0,{["httpHeader"]:"accept-ranges"}],[0,{["httpHeader"]:"x-amz-expiration"}],[0,{["httpHeader"]:"x-amz-restore"}],[4,{["httpHeader"]:"Last-Modified"}],[1,{["httpHeader"]:"Content-Length"}],[0,{["httpHeader"]:"ETag"}],[0,{["httpHeader"]:"x-amz-checksum-crc32"}],[0,{["httpHeader"]:"x-amz-checksum-crc32c"}],[0,{["httpHeader"]:"x-amz-checksum-crc64nvme"}],[0,{["httpHeader"]:"x-amz-checksum-sha1"}],[0,{["httpHeader"]:"x-amz-checksum-sha256"}],[0,{["httpHeader"]:"x-amz-checksum-type"}],[1,{["httpHeader"]:"x-amz-missing-meta"}],[0,{["httpHeader"]:"x-amz-version-id"}],[0,{["httpHeader"]:"Cache-Control"}],[0,{["httpHeader"]:"Content-Disposition"}],[0,{["httpHeader"]:"Content-Encoding"}],[0,{["httpHeader"]:"Content-Language"}],[0,{["httpHeader"]:"Content-Range"}],[0,{["httpHeader"]:"Content-Type"}],[4,{["httpHeader"]:"Expires"}],[0,{["httpHeader"]:"ExpiresString"}],[0,{["httpHeader"]:"x-amz-website-redirect-location"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[128,{["httpPrefixHeaders"]:"x-amz-meta-"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[()=>hu,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}],[0,{["httpHeader"]:"x-amz-storage-class"}],[0,{["httpHeader"]:"x-amz-request-charged"}],[0,{["httpHeader"]:"x-amz-replication-status"}],[1,{["httpHeader"]:"x-amz-mp-parts-count"}],[1,{["httpHeader"]:"x-amz-tagging-count"}],[0,{["httpHeader"]:"x-amz-object-lock-mode"}],[5,{["httpHeader"]:"x-amz-object-lock-retain-until-date"}],[0,{["httpHeader"]:"x-amz-object-lock-legal-hold"}]]],KK=[3,"com.amazonaws.s3","GetObjectRequest",0,["Bucket","Key","IfMatch","IfModifiedSince","IfNoneMatch","IfUnmodifiedSince","Range","ResponseCacheControl","ResponseContentDisposition","ResponseContentEncoding","ResponseContentLanguage","ResponseContentType","ResponseExpires","VersionId","SSECustomerAlgorithm","SSECustomerKey","SSECustomerKeyMD5","RequestPayer","PartNumber","ExpectedBucketOwner","ChecksumMode"],[[0,1],[0,1],[0,{["httpHeader"]:"If-Match"}],[4,{["httpHeader"]:"If-Modified-Since"}],[0,{["httpHeader"]:"If-None-Match"}],[4,{["httpHeader"]:"If-Unmodified-Since"}],[0,{["httpHeader"]:"Range"}],[0,{["httpQuery"]:"response-cache-control"}],[0,{["httpQuery"]:"response-content-disposition"}],[0,{["httpQuery"]:"response-content-encoding"}],[0,{["httpQuery"]:"response-content-language"}],[0,{["httpQuery"]:"response-content-type"}],[6,{["httpQuery"]:"response-expires"}],[0,{["httpQuery"]:"versionId"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[()=>WB,{["httpHeader"]:"x-amz-server-side-encryption-customer-key"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[0,{["httpHeader"]:"x-amz-request-payer"}],[1,{["httpQuery"]:"partNumber"}],[0,{["httpHeader"]:"x-amz-expected-bucket-owner"}],[0,{["httpHeader"]:"x-amz-checksum-mode"}]],2];var xK=[3,"com.amazonaws.s3","ListObjectsV2Output",{["xmlName"]:"ListBucketResult"},["IsTruncated","Contents","Name","Prefix","Delimiter","MaxKeys","CommonPrefixes","EncodingType","KeyCount","ContinuationToken","NextContinuationToken","StartAfter","RequestCharged"],[2,[()=>OK,{["xmlFlattened"]:1}],0,0,0,1,[()=>EK,{["xmlFlattened"]:1}],0,1,0,0,0,[0,{["httpHeader"]:"x-amz-request-charged"}]]],SK=[3,"com.amazonaws.s3","ListObjectsV2Request",0,["Bucket","Delimiter","EncodingType","MaxKeys","Prefix","ContinuationToken","FetchOwner","StartAfter","RequestPayer","ExpectedBucketOwner","OptionalObjectAttributes"],[[0,1],[0,{["httpQuery"]:"delimiter"}],[0,{["httpQuery"]:"encoding-type"}],[1,{["httpQuery"]:"max-keys"}],[0,{["httpQuery"]:"prefix"}],[0,{["httpQuery"]:"continuation-token"}],[2,{["httpQuery"]:"fetch-owner"}],[0,{["httpQuery"]:"start-after"}],[0,{["httpHeader"]:"x-amz-request-payer"}],[0,{["httpHeader"]:"x-amz-expected-bucket-owner"}],[64,{["httpHeader"]:"x-amz-optional-object-attributes"}]],1];var RK=[3,"com.amazonaws.s3","Object",0,["Key","LastModified","ETag","ChecksumAlgorithm","ChecksumType","Size","StorageClass","Owner","RestoreStatus"],[0,4,0,[64,{["xmlFlattened"]:1}],0,1,0,()=>HK,()=>MK]];var HK=[3,"com.amazonaws.s3","Owner",0,["DisplayName","ID"],[0,0]];var UK=[3,"com.amazonaws.s3","PutObjectOutput",0,["Expiration","ETag","ChecksumCRC32","ChecksumCRC32C","ChecksumCRC64NVME","ChecksumSHA1","ChecksumSHA256","ChecksumType","ServerSideEncryption","VersionId","SSECustomerAlgorithm","SSECustomerKeyMD5","SSEKMSKeyId","SSEKMSEncryptionContext","BucketKeyEnabled","Size","RequestCharged"],[[0,{["httpHeader"]:"x-amz-expiration"}],[0,{["httpHeader"]:"ETag"}],[0,{["httpHeader"]:"x-amz-checksum-crc32"}],[0,{["httpHeader"]:"x-amz-checksum-crc32c"}],[0,{["httpHeader"]:"x-amz-checksum-crc64nvme"}],[0,{["httpHeader"]:"x-amz-checksum-sha1"}],[0,{["httpHeader"]:"x-amz-checksum-sha256"}],[0,{["httpHeader"]:"x-amz-checksum-type"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[0,{["httpHeader"]:"x-amz-version-id"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[()=>hu,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[()=>S1,{["httpHeader"]:"x-amz-server-side-encryption-context"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}],[1,{["httpHeader"]:"x-amz-object-size"}],[0,{["httpHeader"]:"x-amz-request-charged"}]]],cK=[3,"com.amazonaws.s3","PutObjectRequest",0,["Bucket","Key","ACL","Body","CacheControl","ContentDisposition","ContentEncoding","ContentLanguage","ContentLength","ContentMD5","ContentType","ChecksumAlgorithm","ChecksumCRC32","ChecksumCRC32C","ChecksumCRC64NVME","ChecksumSHA1","ChecksumSHA256","Expires","IfMatch","IfNoneMatch","GrantFullControl","GrantRead","GrantReadACP","GrantWriteACP","WriteOffsetBytes","Metadata","ServerSideEncryption","StorageClass","WebsiteRedirectLocation","SSECustomerAlgorithm","SSECustomerKey","SSECustomerKeyMD5","SSEKMSKeyId","SSEKMSEncryptionContext","BucketKeyEnabled","RequestPayer","Tagging","ObjectLockMode","ObjectLockRetainUntilDate","ObjectLockLegalHoldStatus","ExpectedBucketOwner"],[[0,1],[0,1],[0,{["httpHeader"]:"x-amz-acl"}],[()=>XB,16],[0,{["httpHeader"]:"Cache-Control"}],[0,{["httpHeader"]:"Content-Disposition"}],[0,{["httpHeader"]:"Content-Encoding"}],[0,{["httpHeader"]:"Content-Language"}],[1,{["httpHeader"]:"Content-Length"}],[0,{["httpHeader"]:"Content-MD5"}],[0,{["httpHeader"]:"Content-Type"}],[0,{["httpHeader"]:"x-amz-sdk-checksum-algorithm"}],[0,{["httpHeader"]:"x-amz-checksum-crc32"}],[0,{["httpHeader"]:"x-amz-checksum-crc32c"}],[0,{["httpHeader"]:"x-amz-checksum-crc64nvme"}],[0,{["httpHeader"]:"x-amz-checksum-sha1"}],[0,{["httpHeader"]:"x-amz-checksum-sha256"}],[4,{["httpHeader"]:"Expires"}],[0,{["httpHeader"]:"If-Match"}],[0,{["httpHeader"]:"If-None-Match"}],[0,{["httpHeader"]:"x-amz-grant-full-control"}],[0,{["httpHeader"]:"x-amz-grant-read"}],[0,{["httpHeader"]:"x-amz-grant-read-acp"}],[0,{["httpHeader"]:"x-amz-grant-write-acp"}],[1,{["httpHeader"]:"x-amz-write-offset-bytes"}],[128,{["httpPrefixHeaders"]:"x-amz-meta-"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[0,{["httpHeader"]:"x-amz-storage-class"}],[0,{["httpHeader"]:"x-amz-website-redirect-location"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[()=>WB,{["httpHeader"]:"x-amz-server-side-encryption-customer-key"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[()=>hu,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[()=>S1,{["httpHeader"]:"x-amz-server-side-encryption-context"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}],[0,{["httpHeader"]:"x-amz-request-payer"}],[0,{["httpHeader"]:"x-amz-tagging"}],[0,{["httpHeader"]:"x-amz-object-lock-mode"}],[5,{["httpHeader"]:"x-amz-object-lock-retain-until-date"}],[0,{["httpHeader"]:"x-amz-object-lock-legal-hold"}],[0,{["httpHeader"]:"x-amz-expected-bucket-owner"}]],2];var MK=[3,"com.amazonaws.s3","RestoreStatus",0,["IsRestoreInProgress","RestoreExpiryDate"],[2,4]];var LK=[3,"com.amazonaws.s3","SessionCredentials",0,["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],[[0,{["xmlName"]:"AccessKeyId"}],[()=>zB,{["xmlName"]:"SecretAccessKey"}],[()=>zB,{["xmlName"]:"SessionToken"}],[4,{["xmlName"]:"Expiration"}]],4];var EK=[1,"com.amazonaws.s3","CommonPrefixList",0,()=>WK];var OK=[1,"com.amazonaws.s3","ObjectList",0,[()=>RK,0]];var YB=[9,"com.amazonaws.s3","CreateSession",{["http"]:["GET","/?session",200]},()=>YK,()=>XK];var hB=[9,"com.amazonaws.s3","GetObject",{["httpChecksum"]:"-",["http"]:["GET","/{Key+}?x-id=GetObject",200]},()=>KK,()=>hK];var KB=[9,"com.amazonaws.s3","ListObjectsV2",{["http"]:["GET","/?list-type=2",200]},()=>SK,()=>xK];var xB=[9,"com.amazonaws.s3","PutObject",{["httpChecksum"]:"-",["http"]:["PUT","/{Key+}?x-id=PutObject",200]},()=>cK,()=>UK];class M3 extends RB.Command.classBuilder().ep({...j2,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(u,D,B,A){return[SB.getEndpointPlugin(B,u.getEndpointParameterInstructions()),K0(B)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").sc(YB).build(){}var HB={name:"@aws-sdk/client-s3",description:"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",version:"3.1015.0",scripts:{build:"concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_package_name"',"build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3",test:"yarn g:vitest run","test:browser":"node ./test/browser-build/esbuild && yarn g:vitest run -c vitest.config.browser.mts","test:browser:watch":"node ./test/browser-build/esbuild && yarn g:vitest watch -c vitest.config.browser.mts","test:e2e":"yarn g:vitest run -c vitest.config.e2e.mts && yarn test:browser","test:e2e:watch":"yarn g:vitest watch -c vitest.config.e2e.mts","test:index":"tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs","test:integration":"yarn g:vitest run -c vitest.config.integ.mts","test:integration:watch":"yarn g:vitest watch -c vitest.config.integ.mts","test:watch":"yarn g:vitest watch"},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/core":"^3.973.24","@aws-sdk/credential-provider-node":"^3.972.25","@aws-sdk/middleware-bucket-endpoint":"^3.972.8","@aws-sdk/middleware-expect-continue":"^3.972.8","@aws-sdk/middleware-flexible-checksums":"^3.974.4","@aws-sdk/middleware-host-header":"^3.972.8","@aws-sdk/middleware-location-constraint":"^3.972.8","@aws-sdk/middleware-logger":"^3.972.8","@aws-sdk/middleware-recursion-detection":"^3.972.8","@aws-sdk/middleware-sdk-s3":"^3.972.24","@aws-sdk/middleware-ssec":"^3.972.8","@aws-sdk/middleware-user-agent":"^3.972.25","@aws-sdk/region-config-resolver":"^3.972.9","@aws-sdk/signature-v4-multi-region":"^3.996.12","@aws-sdk/types":"^3.973.6","@aws-sdk/util-endpoints":"^3.996.5","@aws-sdk/util-user-agent-browser":"^3.972.8","@aws-sdk/util-user-agent-node":"^3.973.11","@smithy/config-resolver":"^4.4.13","@smithy/core":"^3.23.12","@smithy/eventstream-serde-browser":"^4.2.12","@smithy/eventstream-serde-config-resolver":"^4.3.12","@smithy/eventstream-serde-node":"^4.2.12","@smithy/fetch-http-handler":"^5.3.15","@smithy/hash-blob-browser":"^4.2.13","@smithy/hash-node":"^4.2.12","@smithy/hash-stream-node":"^4.2.12","@smithy/invalid-dependency":"^4.2.12","@smithy/md5-js":"^4.2.12","@smithy/middleware-content-length":"^4.2.12","@smithy/middleware-endpoint":"^4.4.27","@smithy/middleware-retry":"^4.4.44","@smithy/middleware-serde":"^4.2.15","@smithy/middleware-stack":"^4.2.12","@smithy/node-config-provider":"^4.3.12","@smithy/node-http-handler":"^4.5.0","@smithy/protocol-http":"^5.3.12","@smithy/smithy-client":"^4.12.7","@smithy/types":"^4.13.1","@smithy/url-parser":"^4.2.12","@smithy/util-base64":"^4.3.2","@smithy/util-body-length-browser":"^4.2.2","@smithy/util-body-length-node":"^4.2.3","@smithy/util-defaults-mode-browser":"^4.3.43","@smithy/util-defaults-mode-node":"^4.2.47","@smithy/util-endpoints":"^3.3.3","@smithy/util-middleware":"^4.2.12","@smithy/util-retry":"^4.2.12","@smithy/util-stream":"^4.5.20","@smithy/util-utf8":"^4.2.2","@smithy/util-waiter":"^4.2.13",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/signature-v4-crt":"3.1015.0","@smithy/snapshot-testing":"^2.0.3","@tsconfig/node20":"20.1.8","@types/node":"^20.14.8",concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~5.8.3",vitest:"^4.0.17"},engines:{node:">=20.0.0"},typesVersions:{"<4.5":{"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 E0=X(Y0(),1);var H1=X(cB(),1),kB=X(kK(),1);var R1=X(cB(),1),UB="AWS_EC2_METADATA_DISABLED",MB=async(u)=>{let{ENV_CMDS_FULL_URI:D,ENV_CMDS_RELATIVE_URI:B,fromContainerMetadata:A,fromInstanceMetadata:w}=await import("./chunk-rm5y1v00.js");if(process.env[B]||process.env[D]){u.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");let{fromHttp:F}=await import("./chunk-c74f9zbq.js");return R1.chain(F(u),A(u))}if(process.env[UB]&&process.env[UB]!=="false")return async()=>{throw new R1.CredentialsProviderError("EC2 Instance Metadata Service access disabled",{logger:u.logger})};return u.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),w(u)};function LB(u,D){let B=PK(u),A,w,F,N=async(G)=>{if(G?.forceRefresh)return await B(G);if(F?.expiration){if(F?.expiration?.getTime()<Date.now())F=void 0}if(A)await A;else if(!F||D?.(F))if(F){if(!w)w=B(G).then((v)=>{F=v}).finally(()=>{w=void 0})}else return A=B(G).then((v)=>{F=v}).finally(()=>{A=void 0}),N(G);return F};return N}var PK=(u)=>async(D)=>{let B;for(let A of u)try{return await A(D)}catch(w){if(B=w,w?.tryNextLink)continue;throw w}throw B};var EB=!1,yB=(u={})=>LB([async()=>{if(u.profile??process.env[kB.ENV_PROFILE]){if(process.env[OB]&&process.env[CB]){if(!EB)(u.logger?.warn&&u.logger?.constructor?.name!=="NoOpLogger"?u.logger.warn.bind(u.logger):console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
|
|
4
|
+
`+A)});let D=await this.createSessionFn(u);if(!D.Credentials?.AccessKeyId||!D.Credentials?.SecretAccessKey)throw Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:D.Credentials.AccessKeyId,secretAccessKey:D.Credentials.SecretAccessKey,sessionToken:D.Credentials.SessionToken,expiration:D.Credentials.Expiration?new Date(D.Credentials.Expiration):void 0}}}var P4=X(C4(),1);var h0=X(U4(),1),c4="Directory",M4="S3Express",L4="sigv4-s3express",su="X-Amz-S3session-Token",$u=su.toLowerCase(),Mh="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",Lh="s3_disable_express_session_auth",aD={environmentVariableSelector:(u)=>h0.booleanSelector(u,Mh,h0.SelectorType.ENV),configFileSelector:(u)=>h0.booleanSelector(u,Lh,h0.SelectorType.CONFIG),default:!1};class tu extends P4.SignatureV4{async signWithCredentials(u,D,B){let A=E4(D);u.headers[$u]=D.sessionToken;let w=this;return O4(w,A),w.signRequest(u,B??{})}async presignWithCredentials(u,D,B){let A=E4(D);return delete u.headers[$u],u.headers[su]=D.sessionToken,u.query=u.query??{},u.query[su]=D.sessionToken,O4(this,A),this.presign(u,B)}}function E4(u){return{accessKeyId:u.accessKeyId,secretAccessKey:u.secretAccessKey,expiration:u.expiration}}function O4(u,D){let B=setTimeout(()=>{throw Error("SignatureV4S3Express credential override was created but not called.")},10),A=u.credentialProvider,w=()=>{return clearTimeout(B),u.credentialProvider=A,Promise.resolve(D)};u.credentialProvider=w}var k4=X(Y0(),1),y4=X(m2(),1);var V4=(u)=>{return(D,B)=>async(A)=>{if(B.endpointV2){let w=B.endpointV2,F=w.properties?.authSchemes?.[0]?.name===L4;if(w.properties?.backend===M4||w.properties?.bucketType===c4)k4.setFeature(B,"S3_EXPRESS_BUCKET","J"),B.isS3ExpressBucket=!0;if(F){let G=A.input.Bucket;if(G){let v=await u.s3ExpressIdentityProvider.getS3ExpressIdentity(await u.credentials(),{Bucket:G});if(B.s3ExpressIdentity=v,y4.HttpRequest.isInstance(A.request)&&v.sessionToken)A.request.headers[$u]=v.sessionToken}}}return D(A)}},T4={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},sD=(u)=>({applyToStack:(D)=>{D.add(V4(u),T4)}});var m4=X(q4(),1),g4=X(m2(),1),_4=X(pD(),1);var I4=async(u,D,B,A)=>{let w=await A.signWithCredentials(B,u,{});if(w.headers["X-Amz-Security-Token"]||w.headers["x-amz-security-token"])throw Error("X-Amz-Security-Token must not be set for s3-express requests.");return w};var Eh=(u)=>(D)=>{throw D},Oh=(u,D)=>{};var f4=(u)=>(D,B)=>async(A)=>{if(!g4.HttpRequest.isInstance(A.request))return D(A);let F=_4.getSmithyContext(B).selectedHttpAuthScheme;if(!F)throw Error("No HttpAuthScheme was selected: unable to sign request");let{httpAuthOption:{signingProperties:N={}},identity:G,signer:v}=F,z;if(B.s3ExpressIdentity)z=await I4(B.s3ExpressIdentity,N,A.request,await u.signer());else z=await v.sign(A.request,G,N);let Q=await D({...A,request:z}).catch((v.errorHandler||Eh)(N));return(v.successHandler||Oh)(Q.response,N),Q},tD=(u)=>({applyToStack:(D)=>{D.addRelativeTo(f4(u),m4.httpSigningMiddlewareOptions)}});var b4=(u,{session:D})=>{let[B,A]=D,{forcePathStyle:w,useAccelerateEndpoint:F,disableMultiregionAccessPoints:N,followRegionRedirects:G,s3ExpressIdentityProvider:v,bucketEndpoint:z,expectContinueHeader:Q}=u;return Object.assign(u,{forcePathStyle:w??!1,useAccelerateEndpoint:F??!1,disableMultiregionAccessPoints:N??!1,followRegionRedirects:G??!1,s3ExpressIdentityProvider:v??new Gu(async(Z)=>B().send(new A({Bucket:Z}))),bucketEndpoint:z??!1,expectContinueHeader:Q??2097152})};var j4=X(m2(),1),ou=X(iu(),1),Ch={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Ph=3000,kh=(u)=>(D,B)=>async(A)=>{let w=await D(A),{response:F}=w;if(!j4.HttpResponse.isInstance(F))return w;let{statusCode:N,body:G}=F;if(N<200||N>=300)return w;if(!(typeof G?.stream==="function"||typeof G?.pipe==="function"||typeof G?.tee==="function"))return w;let z=G,Q=G;if(G&&typeof G==="object"&&!(G instanceof Uint8Array))[z,Q]=await ou.splitStream(G);F.body=Q;let Z=await yh(z,{streamCollector:async(W)=>{return ou.headStream(W,Ph)}});if(typeof z?.destroy==="function")z.destroy();let J=u.utf8Encoder(Z.subarray(Z.length-16));if(Z.length===0&&Ch[B.commandName]){let W=Error("S3 aborted request");throw W.name="InternalError",W}if(J&&J.endsWith("</Error>"))F.statusCode=400;return w},yh=(u=new Uint8Array,D)=>{if(u instanceof Uint8Array)return Promise.resolve(u);return D.streamCollector(u)||Promise.resolve(new Uint8Array)},Vh={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},K0=(u)=>({applyToStack:(D)=>{D.addRelativeTo(kh(u),Vh)}});var l4=(u)=>typeof u==="string"&&u.indexOf("arn:")===0&&u.split(":").length>=6;function d4(u){return(D,B)=>async(A)=>{if(u.bucketEndpoint){let w=B.endpointV2;if(w){let F=A.input.Bucket;if(typeof F==="string")try{let N=new URL(F);B.endpointV2={...w,url:N}}catch(N){let G=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${F} could not be parsed as URL.`;if(B.logger?.constructor?.name==="NoOpLogger")console.warn(G);else B.logger?.warn?.(G);throw N}}}return D(A)}}var r4={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Th({bucketEndpoint:u}){return(D)=>async(B)=>{let{input:{Bucket:A}}=B;if(!u&&typeof A==="string"&&!l4(A)&&A.indexOf("/")>=0){let w=Error(`Bucket name shouldn't contain '/', received '${A}'`);throw w.name="InvalidBucketName",w}return D({...B})}}var Ih={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},i4=(u)=>({applyToStack:(D)=>{D.add(Th(u),Ih),D.addRelativeTo(d4(u),r4)}});var q1=X(Gx(),1),$6=X(tB(),1),O0=X(q4(),1),v6=X(ZB(),1);var n4=(u)=>Object.assign(u,{eventStreamMarshaller:u.eventStreamSerdeProvider(u)});var z6=X($x(),1),Z6=X(U0(),1),m1=X(oB(),1),J6=X(k2(),1);var w1=X(Y0(),1);var oD=X(C4(),1);var vu={CrtSignerV4:null};class zu{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){if(typeof vu.CrtSignerV4==="function")return"crt";else if(typeof oD.signatureV4aContainer.SignatureV4a==="function")return"js";return"none"}constructor(u){this.sigv4Signer=new tu(u),this.signerOptions=u}async sign(u,D={}){if(D.signingRegion==="*")return this.getSigv4aSigner().sign(u,D);return this.sigv4Signer.sign(u,D)}async signWithCredentials(u,D,B={}){if(B.signingRegion==="*"){let A=this.getSigv4aSigner(),w=vu.CrtSignerV4;if(w&&A instanceof w)return A.signWithCredentials(u,D,B);else throw Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.signWithCredentials(u,D,B)}async presign(u,D={}){if(D.signingRegion==="*"){let B=this.getSigv4aSigner(),A=vu.CrtSignerV4;if(A&&B instanceof A)return B.presign(u,D);else throw Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.presign(u,D)}async presignWithCredentials(u,D,B={}){if(B.signingRegion==="*")throw Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(u,D,B)}getSigv4aSigner(){if(!this.sigv4aSigner){let u=vu.CrtSignerV4,D=oD.signatureV4aContainer.SignatureV4a;if(this.signerOptions.runtime==="node"){if(!u&&!D)throw Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");if(u&&typeof u==="function")this.sigv4aSigner=new u({...this.signerOptions,signingAlgorithm:1});else if(D&&typeof D==="function")this.sigv4aSigner=new D({...this.signerOptions});else throw Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt")}else{if(!D||typeof D!=="function")throw Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");this.sigv4aSigner=new D({...this.signerOptions})}}return this.sigv4aSigner}}var BB=X(U0(),1),c0=X(pD(),1);var DB=X(ih(),1),H0=X(rh(),1);var x0={["required"]:!1,["type"]:"string"},S0={["required"]:!0,default:!1,["type"]:"boolean"},Zu={["required"]:!1,["type"]:"boolean"},H2={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},I={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},j={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},n9={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},p4={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},Qu={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},O={["ref"]:"Bucket"},a4={["conditions"]:[H2],["error"]:"S3Express does not support S3 Accelerate.",["type"]:"error"},s4={["conditions"]:[j,{["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"}],["rules"]:[{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],["rules"]:[{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]}],["rules"]:[{["conditions"]:[{["fn"]:"uriEncode",["argv"]:[O],["assign"]:"uri_encoded_bucket"}],["rules"]:[{["endpoint"]:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[O,!1]}],["rules"]:[{["endpoint"]:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],["type"]:"tree"},{["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]}],["rules"]:[{["conditions"]:[{["fn"]:"uriEncode",["argv"]:[O],["assign"]:"uri_encoded_bucket"}],["rules"]:[{["endpoint"]:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[O,!1]}],["rules"]:[{["endpoint"]:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],["type"]:"tree"},{["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"}],["type"]:"tree"},$2={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},eD={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},p9={["ref"]:"url"},a9={["fn"]:"uriEncode",["argv"]:[O],["assign"]:"uri_encoded_bucket"},X2={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},h={},s9={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[O,!1]},t4={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},o4={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},e4={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},K={["fn"]:"not",["argv"]:[j]},U={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},R={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},eu={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},u9={["fn"]:"not",["argv"]:[Qu]},D9={["ref"]:"hardwareType"},B9={["conditions"]:[K],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},u1={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},u3={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},qh={["ref"]:"ForcePathStyle"},l={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},p={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},t={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},E={["fn"]:"not",["argv"]:[p]},o={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},A9={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},d={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},e={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},w9={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},F9={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},N9={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},D3={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[p9,"isIp"]},!1]},B3={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:d,["headers"]:{}},H3={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:d,["headers"]:{}},G9={["endpoint"]:H3,["type"]:"endpoint"},A3={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},$9={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},D1={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},z2={["ref"]:"bucketArn"},t9={["ref"]:"arnType"},w3={["fn"]:"getAttr",["argv"]:[z2,"service"]},U3={["ref"]:"accessPointName"},v9={["conditions"]:[T],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},z9={["conditions"]:[H2],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},Z9={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},F3={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},o9={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},e9={["fn"]:"getAttr",["argv"]:[z2,"accountId"]},N3={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},J9={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},G3={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},$3={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},v3={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},Q9={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},W9={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Ju={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},X9={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},Y9={["fn"]:"aws.parseArn",["argv"]:[O]},h9={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},K9={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},x9={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},z3={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},S9={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},R9={["ref"]:"UseObjectLambdaEndpoint"},Z3={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},H9={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},U9={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},c9={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},J3={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:d,["headers"]:{}},M9={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},Q3=[{["ref"]:"Region"}],mh=[{["ref"]:"Endpoint"}],gh=[O],W3=[H2],R0=[j,$2],L9=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],_h=[a9],X3=[s9],R2=[n9],Y3=[I,T],Wu=[I,U],Xu=[R,T],Yu=[R,U],E9=[{["fn"]:"substring",["argv"]:[O,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],T2=[{["conditions"]:[I,T],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Wu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Xu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Yu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:{}},["type"]:"endpoint"}],O9=[{["fn"]:"substring",["argv"]:[O,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],C9=[{["fn"]:"substring",["argv"]:[O,6,19,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,19,21,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],P9=[{["fn"]:"substring",["argv"]:[O,6,20,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,20,22,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],k9=[{["fn"]:"substring",["argv"]:[O,6,26,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,26,28,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],I2=[{["conditions"]:[I,T],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Wu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Xu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Yu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],y9=[O,0,7,!0],V9=[{["fn"]:"substring",["argv"]:[O,7,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],T9=[{["fn"]:"substring",["argv"]:[O,7,16,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,16,18,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],I9=[{["fn"]:"substring",["argv"]:[O,7,20,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,20,22,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],q9=[{["fn"]:"substring",["argv"]:[O,7,21,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,21,23,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],m9=[{["fn"]:"substring",["argv"]:[O,7,27,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,27,29,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],fh=[Qu],g9=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],_9=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],bh=["*"],f9=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],b2=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],h3=[{["fn"]:"stringEquals",["argv"]:[t9,"accesspoint"]}],b9=[{["fn"]:"getAttr",["argv"]:[z2,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[U3,""]}]}],jh=[z2,"resourceId[1]"],j9=[T],K3=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"region"]},""]}]}],l9=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"resourceId[2]"]}]}]}],lh=[z2,"resourceId[2]"],x3=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"region"]}],["assign"]:"bucketPartition"}],d9=[{["fn"]:"stringEquals",["argv"]:[o9,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],S3=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"region"]},!0]}],R3=[{["fn"]:"isValidHostLabel",["argv"]:[e9,!1]}],r9=[{["fn"]:"isValidHostLabel",["argv"]:[U3,!1]}],B1=[I],i9=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],dh={version:"1.0",parameters:{Bucket:x0,Region:x0,UseFIPS:S0,UseDualStack:S0,Endpoint:x0,ForcePathStyle:S0,Accelerate:S0,UseGlobalEndpoint:S0,UseObjectLambdaEndpoint:Zu,Key:x0,Prefix:x0,CopySource:x0,DisableAccessPoints:Zu,DisableMultiRegionAccessPoints:S0,UseArnRegion:Zu,UseS3ExpressControlEndpoint:Zu,DisableS3ExpressSessionAuth:Zu},["rules"]:[{["conditions"]:[{["fn"]:"isSet",["argv"]:Q3}],["rules"]:[{["conditions"]:[H2,I],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[T,j],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[j,I],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[j,H2],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[I,n9,p4],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[Qu,{["fn"]:"substring",["argv"]:[O,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],["rules"]:[a4,s4,{["conditions"]:[o4,e4],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:[a9,K],["rules"]:[{["conditions"]:Y3,endpoint:{["url"]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Wu,endpoint:{["url"]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Xu,endpoint:{["url"]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Yu,endpoint:{["url"]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:X3,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:L9,["rules"]:[{["conditions"]:E9,["rules"]:T2,["type"]:"tree"},{["conditions"]:O9,["rules"]:T2,["type"]:"tree"},{["conditions"]:C9,["rules"]:T2,["type"]:"tree"},{["conditions"]:P9,["rules"]:T2,["type"]:"tree"},{["conditions"]:k9,["rules"]:T2,["type"]:"tree"},eu],["type"]:"tree"},{["conditions"]:E9,["rules"]:I2,["type"]:"tree"},{["conditions"]:O9,["rules"]:I2,["type"]:"tree"},{["conditions"]:C9,["rules"]:I2,["type"]:"tree"},{["conditions"]:P9,["rules"]:I2,["type"]:"tree"},{["conditions"]:k9,["rules"]:I2,["type"]:"tree"},eu],["type"]:"tree"}],["type"]:"tree"},t4],["type"]:"tree"},{["conditions"]:[Qu,{["fn"]:"substring",["argv"]:y9,["assign"]:"accessPointSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"accessPointSuffix"},"--xa-s3"]}],["rules"]:[a4,s4,{["conditions"]:X3,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:L9,["rules"]:[{["conditions"]:V9,["rules"]:T2,["type"]:"tree"},{["conditions"]:T9,["rules"]:T2,["type"]:"tree"},{["conditions"]:I9,["rules"]:T2,["type"]:"tree"},{["conditions"]:q9,["rules"]:T2,["type"]:"tree"},{["conditions"]:m9,["rules"]:T2,["type"]:"tree"},eu],["type"]:"tree"},{["conditions"]:V9,["rules"]:I2,["type"]:"tree"},{["conditions"]:T9,["rules"]:I2,["type"]:"tree"},{["conditions"]:I9,["rules"]:I2,["type"]:"tree"},{["conditions"]:q9,["rules"]:I2,["type"]:"tree"},{["conditions"]:m9,["rules"]:I2,["type"]:"tree"},eu],["type"]:"tree"}],["type"]:"tree"},t4],["type"]:"tree"},{["conditions"]:[u9,o4,e4],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:R0,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Y3,endpoint:{["url"]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Wu,endpoint:{["url"]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Xu,endpoint:{["url"]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Yu,endpoint:{["url"]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Qu,{["fn"]:"substring",["argv"]:[O,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[O,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:y9,["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[O,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:Q3,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],["rules"]:[{["conditions"]:g9,["rules"]:[{["conditions"]:X3,["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[D9,"e"]}],["rules"]:[{["conditions"]:_9,["rules"]:[B9,{["conditions"]:R0,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:u1,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:u1,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[D9,"o"]}],["rules"]:[{["conditions"]:_9,["rules"]:[B9,{["conditions"]:R0,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:u1,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:u1,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},{error:'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"',["type"]:"error"}],["type"]:"tree"},{error:"Invalid Outposts Bucket alias - it must be a valid bucket name.",["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"]:fh,["rules"]:[{["conditions"]:[j,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:mh}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[u3,s9],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:f9,["rules"]:[{["conditions"]:[H2,p4],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[T,I,l,K,p],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[T,I,l,K,E,o],["rules"]:[{endpoint:A9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,I,l,K,E,e],endpoint:A9,["type"]:"endpoint"},{["conditions"]:[U,I,l,K,p],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,I,l,K,E,o],["rules"]:[{endpoint:w9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,I,l,K,E,e],endpoint:w9,["type"]:"endpoint"},{["conditions"]:[T,R,H2,K,p],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[T,R,H2,K,E,o],["rules"]:[{endpoint:F9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,R,H2,K,E,e],endpoint:F9,["type"]:"endpoint"},{["conditions"]:[T,R,l,K,p],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[T,R,l,K,E,o],["rules"]:[{endpoint:N9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,R,l,K,E,e],endpoint:N9,["type"]:"endpoint"},{["conditions"]:[U,R,l,j,$2,eD,p],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,R,l,j,$2,D3,p],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,R,l,j,$2,eD,E,o],["rules"]:[{["conditions"]:b2,endpoint:B3,["type"]:"endpoint"},{endpoint:B3,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,R,l,j,$2,D3,E,o],["rules"]:[{["conditions"]:b2,endpoint:H3,["type"]:"endpoint"},G9],["type"]:"tree"},{["conditions"]:[U,R,l,j,$2,eD,E,e],endpoint:B3,["type"]:"endpoint"},{["conditions"]:[U,R,l,j,$2,D3,E,e],endpoint:H3,["type"]:"endpoint"},{["conditions"]:[U,R,H2,K,p],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,R,H2,K,E,o],["rules"]:[{["conditions"]:b2,endpoint:A3,["type"]:"endpoint"},{endpoint:A3,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,R,H2,K,E,e],endpoint:A3,["type"]:"endpoint"},{["conditions"]:[U,R,l,K,p],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,R,l,K,E,o],["rules"]:[{["conditions"]:b2,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:h},["type"]:"endpoint"},{endpoint:$9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,R,l,K,E,e],endpoint:$9,["type"]:"endpoint"}],["type"]:"tree"},D1],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[j,$2,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[p9,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[O,!0]},u3,R,U,l],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:f9,["rules"]:[G9],["type"]:"tree"},D1],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[u3,{["fn"]:"aws.parseArn",["argv"]:gh,["assign"]:"bucketArn"}],["rules"]:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[z2,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[t9,""]}]}],["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[w3,"s3-object-lambda"]}],["rules"]:[{["conditions"]:h3,["rules"]:[{["conditions"]:b9,["rules"]:[v9,z9,{["conditions"]:K3,["rules"]:[Z9,{["conditions"]:l9,["rules"]:[F3,{["conditions"]:x3,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:d9,["rules"]:[{["conditions"]:S3,["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[e9,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:R3,["rules"]:[{["conditions"]:r9,["rules"]:[{["conditions"]:R0,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:N3,["headers"]:h},["type"]:"endpoint"},{["conditions"]:B1,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:N3,["headers"]:h},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:N3,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},J9],["type"]:"tree"},G3],["type"]:"tree"},$3],["type"]:"tree"},v3],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Q9],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},W9],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:h3,["rules"]:[{["conditions"]:b9,["rules"]:[{["conditions"]:K3,["rules"]:[{["conditions"]:h3,["rules"]:[{["conditions"]:K3,["rules"]:[Z9,{["conditions"]:l9,["rules"]:[F3,{["conditions"]:x3,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[o9,"{partitionResult#name}"]}],["rules"]:[{["conditions"]:S3,["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[w3,"s3"]}],["rules"]:[{["conditions"]:R3,["rules"]:[{["conditions"]:r9,["rules"]:[{["conditions"]:W3,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:Y3,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ju,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Wu,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ju,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Xu,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ju,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[R,U,j,$2],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Ju,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Yu,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ju,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},J9],["type"]:"tree"},G3],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},$3],["type"]:"tree"},v3],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Q9],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[U3,!0]}],["rules"]:[{["conditions"]:j9,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:B1,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:W3,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"]:Q3,["assign"]:"mrapPartition"}],["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[z2,"partition"]}]}],["rules"]:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:bh}]},["headers"]:h},["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"},W9],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[w3,"s3-outposts"]}],["rules"]:[{["conditions"]:j9,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:B1,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:W3,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:jh,["assign"]:"outpostId"}],["rules"]:[{["conditions"]:g9,["rules"]:[F3,{["conditions"]:x3,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:d9,["rules"]:[{["conditions"]:S3,["rules"]:[{["conditions"]:R3,["rules"]:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:lh,["assign"]:"outpostType"}],["rules"]:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[z2,"resourceId[3]"],["assign"]:"accessPointName"}],["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],["rules"]:[{["conditions"]:R0,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:X9,["headers"]:h},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:X9,["headers"]:h},["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"},G3],["type"]:"tree"},$3],["type"]:"tree"},v3],["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"]:[O,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[Y9]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[qh,!0]},Y9],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:_h,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:[l],["rules"]:[{["conditions"]:[T,K,I,p],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[T,K,I,E,o],["rules"]:[{endpoint:h9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,K,I,E,e],endpoint:h9,["type"]:"endpoint"},{["conditions"]:[U,K,I,p],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,K,I,E,o],["rules"]:[{endpoint:K9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,K,I,E,e],endpoint:K9,["type"]:"endpoint"},{["conditions"]:[T,K,R,p],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[T,K,R,E,o],["rules"]:[{endpoint:x9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,K,R,E,e],endpoint:x9,["type"]:"endpoint"},{["conditions"]:[U,j,$2,R,p],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,j,$2,R,E,o],["rules"]:[{["conditions"]:b2,endpoint:z3,["type"]:"endpoint"},{endpoint:z3,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,j,$2,R,E,e],endpoint:z3,["type"]:"endpoint"},{["conditions"]:[U,K,R,p],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,K,R,E,o],["rules"]:[{["conditions"]:b2,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:h},["type"]:"endpoint"},{endpoint:S9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,K,R,E,e],endpoint:S9,["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"]:[R9]},{["fn"]:"booleanEquals",["argv"]:[R9,!0]}],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:i9,["rules"]:[v9,z9,{["conditions"]:R0,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:Z3,["headers"]:h},["type"]:"endpoint"},{["conditions"]:B1,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:Z3,["headers"]:h},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:Z3,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},D1],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[u9],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:i9,["rules"]:[{["conditions"]:[I,T,K,p],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[I,T,K,E,o],["rules"]:[{endpoint:H9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,T,K,E,e],endpoint:H9,["type"]:"endpoint"},{["conditions"]:[I,U,K,p],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[I,U,K,E,o],["rules"]:[{endpoint:U9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,U,K,E,e],endpoint:U9,["type"]:"endpoint"},{["conditions"]:[R,T,K,p],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[R,T,K,E,o],["rules"]:[{endpoint:c9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,T,K,E,e],endpoint:c9,["type"]:"endpoint"},{["conditions"]:[R,U,j,$2,p],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[R,U,j,$2,E,o],["rules"]:[{["conditions"]:b2,endpoint:J3,["type"]:"endpoint"},{endpoint:J3,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,U,j,$2,E,e],endpoint:J3,["type"]:"endpoint"},{["conditions"]:[R,U,K,p],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[R,U,K,E,o],["rules"]:[{["conditions"]:b2,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:h},["type"]:"endpoint"},{endpoint:M9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,U,K,E,e],endpoint:M9,["type"]:"endpoint"}],["type"]:"tree"},D1],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},uB=dh;var nh=new H0.EndpointCache({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),A1=(u,D={})=>{return nh.get(u,()=>H0.resolveEndpoint(uB,{endpointParams:u,logger:D.logger}))};H0.customEndpointFunctions.aws=DB.awsEndpointFunctions;var ph=(u)=>async(D,B,A)=>{if(!A)throw Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");let w=await u(D,B,A),F=c0.getSmithyContext(B)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!F)throw Error(`getEndpointParameterInstructions() is not defined on '${B.commandName}'`);let N=await BB.resolveParams(A,{getEndpointParameterInstructions:F},D);return Object.assign(w,N)},ah=async(u,D,B)=>{return{operation:c0.getSmithyContext(D).operation,region:await c0.normalizeProvider(u.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},AB=ph(ah);function wB(u){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:u.region},propertiesExtractor:(D,B)=>({signingProperties:{config:D,context:B}})}}function FB(u){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:u.region},propertiesExtractor:(D,B)=>({signingProperties:{config:D,context:B}})}}var sh=(u,D,B)=>{return(w)=>{let N=u(w).properties?.authSchemes;if(!N)return D(w);let G=[];for(let v of N){let{name:z,properties:Q={},...Z}=v,J=z.toLowerCase();if(z!==J)console.warn(`HttpAuthScheme has been normalized with lowercasing: '${z}' to '${J}'`);let W;if(J==="sigv4a"){W="aws.auth#sigv4a";let x=N.find((L)=>{let S=L.name.toLowerCase();return S!=="sigv4a"&&S.startsWith("sigv4")});if(zu.sigv4aDependency()==="none"&&x)continue}else if(J.startsWith("sigv4"))W="aws.auth#sigv4";else throw Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${J}'`);let Y=B[W];if(!Y)throw Error(`Could not find HttpAuthOption create function for '${W}'`);let M=Y(w);M.schemeId=W,M.signingProperties={...M.signingProperties||{},...Z,...Q},G.push(M)}return G}},th=(u)=>{let D=[];switch(u.operation){default:D.push(wB(u)),D.push(FB(u))}return D},NB=sh(A1,th,{"aws.auth#sigv4":wB,"aws.auth#sigv4a":FB}),GB=(u)=>{let D=w1.resolveAwsSdkSigV4Config(u),B=w1.resolveAwsSdkSigV4AConfig(D);return Object.assign(B,{authSchemePreference:c0.normalizeProvider(u.authSchemePreference??[])})};var SB=X(U0(),1),RB=X(k2(),1);var $B=(u)=>{return Object.assign(u,{useFipsEndpoint:u.useFipsEndpoint??!1,useDualstackEndpoint:u.useDualstackEndpoint??!1,forcePathStyle:u.forcePathStyle??!1,useAccelerateEndpoint:u.useAccelerateEndpoint??!1,useGlobalEndpoint:u.useGlobalEndpoint??!1,disableMultiregionAccessPoints:u.disableMultiregionAccessPoints??!1,defaultSigningName:"s3",clientContextParams:u.clientContextParams??{}})},j2={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"}};var c3=X(ZB(),1);var vB=X(k2(),1);class r extends vB.ServiceException{constructor(u){super(u);Object.setPrototypeOf(this,r.prototype)}}class F1 extends r{name="NoSuchUpload";$fault="client";constructor(u){super({name:"NoSuchUpload",$fault:"client",...u});Object.setPrototypeOf(this,F1.prototype)}}class N1 extends r{name="AccessDenied";$fault="client";constructor(u){super({name:"AccessDenied",$fault:"client",...u});Object.setPrototypeOf(this,N1.prototype)}}class G1 extends r{name="ObjectNotInActiveTierError";$fault="client";constructor(u){super({name:"ObjectNotInActiveTierError",$fault:"client",...u});Object.setPrototypeOf(this,G1.prototype)}}class $1 extends r{name="BucketAlreadyExists";$fault="client";constructor(u){super({name:"BucketAlreadyExists",$fault:"client",...u});Object.setPrototypeOf(this,$1.prototype)}}class v1 extends r{name="BucketAlreadyOwnedByYou";$fault="client";constructor(u){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...u});Object.setPrototypeOf(this,v1.prototype)}}class z1 extends r{name="NoSuchBucket";$fault="client";constructor(u){super({name:"NoSuchBucket",$fault:"client",...u});Object.setPrototypeOf(this,z1.prototype)}}class Z1 extends r{name="InvalidObjectState";$fault="client";StorageClass;AccessTier;constructor(u){super({name:"InvalidObjectState",$fault:"client",...u});Object.setPrototypeOf(this,Z1.prototype),this.StorageClass=u.StorageClass,this.AccessTier=u.AccessTier}}class J1 extends r{name="NoSuchKey";$fault="client";constructor(u){super({name:"NoSuchKey",$fault:"client",...u});Object.setPrototypeOf(this,J1.prototype)}}class Q1 extends r{name="NotFound";$fault="client";constructor(u){super({name:"NotFound",$fault:"client",...u});Object.setPrototypeOf(this,Q1.prototype)}}class W1 extends r{name="EncryptionTypeMismatch";$fault="client";constructor(u){super({name:"EncryptionTypeMismatch",$fault:"client",...u});Object.setPrototypeOf(this,W1.prototype)}}class X1 extends r{name="InvalidRequest";$fault="client";constructor(u){super({name:"InvalidRequest",$fault:"client",...u});Object.setPrototypeOf(this,X1.prototype)}}class Y1 extends r{name="InvalidWriteOffset";$fault="client";constructor(u){super({name:"InvalidWriteOffset",$fault:"client",...u});Object.setPrototypeOf(this,Y1.prototype)}}class h1 extends r{name="TooManyParts";$fault="client";constructor(u){super({name:"TooManyParts",$fault:"client",...u});Object.setPrototypeOf(this,h1.prototype)}}class K1 extends r{name="IdempotencyParameterMismatch";$fault="client";constructor(u){super({name:"IdempotencyParameterMismatch",$fault:"client",...u});Object.setPrototypeOf(this,K1.prototype)}}class x1 extends r{name="ObjectAlreadyInActiveTierError";$fault="client";constructor(u){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...u});Object.setPrototypeOf(this,x1.prototype)}}var JB=c3.TypeRegistry.for("smithy.ts.sdk.synthetic.com.amazonaws.s3"),oh=[-3,"smithy.ts.sdk.synthetic.com.amazonaws.s3","S3ServiceException",0,[],[]];JB.registerError(oh,r);var G2=c3.TypeRegistry.for("com.amazonaws.s3"),eh=[-3,"com.amazonaws.s3","AccessDenied",{["error"]:"client",["httpError"]:403},[],[]];G2.registerError(eh,N1);var uK=[-3,"com.amazonaws.s3","BucketAlreadyExists",{["error"]:"client",["httpError"]:409},[],[]];G2.registerError(uK,$1);var DK=[-3,"com.amazonaws.s3","BucketAlreadyOwnedByYou",{["error"]:"client",["httpError"]:409},[],[]];G2.registerError(DK,v1);var BK=[-3,"com.amazonaws.s3","EncryptionTypeMismatch",{["error"]:"client",["httpError"]:400},[],[]];G2.registerError(BK,W1);var AK=[-3,"com.amazonaws.s3","IdempotencyParameterMismatch",{["error"]:"client",["httpError"]:400},[],[]];G2.registerError(AK,K1);var wK=[-3,"com.amazonaws.s3","InvalidObjectState",{["error"]:"client",["httpError"]:403},["StorageClass","AccessTier"],[0,0]];G2.registerError(wK,Z1);var FK=[-3,"com.amazonaws.s3","InvalidRequest",{["error"]:"client",["httpError"]:400},[],[]];G2.registerError(FK,X1);var NK=[-3,"com.amazonaws.s3","InvalidWriteOffset",{["error"]:"client",["httpError"]:400},[],[]];G2.registerError(NK,Y1);var GK=[-3,"com.amazonaws.s3","NoSuchBucket",{["error"]:"client",["httpError"]:404},[],[]];G2.registerError(GK,z1);var $K=[-3,"com.amazonaws.s3","NoSuchKey",{["error"]:"client",["httpError"]:404},[],[]];G2.registerError($K,J1);var vK=[-3,"com.amazonaws.s3","NoSuchUpload",{["error"]:"client",["httpError"]:404},[],[]];G2.registerError(vK,F1);var zK=[-3,"com.amazonaws.s3","NotFound",{["error"]:"client"},[],[]];G2.registerError(zK,Q1);var ZK=[-3,"com.amazonaws.s3","ObjectAlreadyInActiveTierError",{["error"]:"client",["httpError"]:403},[],[]];G2.registerError(ZK,x1);var JK=[-3,"com.amazonaws.s3","ObjectNotInActiveTierError",{["error"]:"client",["httpError"]:403},[],[]];G2.registerError(JK,G1);var QK=[-3,"com.amazonaws.s3","TooManyParts",{["error"]:"client",["httpError"]:400},[],[]];G2.registerError(QK,h1);var QB=[JB,G2];var zB=[0,"com.amazonaws.s3","SessionCredentialValue",8,0],WB=[0,"com.amazonaws.s3","SSECustomerKey",8,0],S1=[0,"com.amazonaws.s3","SSEKMSEncryptionContext",8,0],hu=[0,"com.amazonaws.s3","SSEKMSKeyId",8,0],XB=[0,"com.amazonaws.s3","StreamingBlob",{["streaming"]:1},42];var WK=[3,"com.amazonaws.s3","CommonPrefix",0,["Prefix"],[0]];var XK=[3,"com.amazonaws.s3","CreateSessionOutput",{["xmlName"]:"CreateSessionResult"},["Credentials","ServerSideEncryption","SSEKMSKeyId","SSEKMSEncryptionContext","BucketKeyEnabled"],[[()=>LK,{["xmlName"]:"Credentials"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[()=>hu,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[()=>S1,{["httpHeader"]:"x-amz-server-side-encryption-context"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}]],1],YK=[3,"com.amazonaws.s3","CreateSessionRequest",0,["Bucket","SessionMode","ServerSideEncryption","SSEKMSKeyId","SSEKMSEncryptionContext","BucketKeyEnabled"],[[0,1],[0,{["httpHeader"]:"x-amz-create-session-mode"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[()=>hu,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[()=>S1,{["httpHeader"]:"x-amz-server-side-encryption-context"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}]],1];var hK=[3,"com.amazonaws.s3","GetObjectOutput",0,["Body","DeleteMarker","AcceptRanges","Expiration","Restore","LastModified","ContentLength","ETag","ChecksumCRC32","ChecksumCRC32C","ChecksumCRC64NVME","ChecksumSHA1","ChecksumSHA256","ChecksumType","MissingMeta","VersionId","CacheControl","ContentDisposition","ContentEncoding","ContentLanguage","ContentRange","ContentType","Expires","ExpiresString","WebsiteRedirectLocation","ServerSideEncryption","Metadata","SSECustomerAlgorithm","SSECustomerKeyMD5","SSEKMSKeyId","BucketKeyEnabled","StorageClass","RequestCharged","ReplicationStatus","PartsCount","TagCount","ObjectLockMode","ObjectLockRetainUntilDate","ObjectLockLegalHoldStatus"],[[()=>XB,16],[2,{["httpHeader"]:"x-amz-delete-marker"}],[0,{["httpHeader"]:"accept-ranges"}],[0,{["httpHeader"]:"x-amz-expiration"}],[0,{["httpHeader"]:"x-amz-restore"}],[4,{["httpHeader"]:"Last-Modified"}],[1,{["httpHeader"]:"Content-Length"}],[0,{["httpHeader"]:"ETag"}],[0,{["httpHeader"]:"x-amz-checksum-crc32"}],[0,{["httpHeader"]:"x-amz-checksum-crc32c"}],[0,{["httpHeader"]:"x-amz-checksum-crc64nvme"}],[0,{["httpHeader"]:"x-amz-checksum-sha1"}],[0,{["httpHeader"]:"x-amz-checksum-sha256"}],[0,{["httpHeader"]:"x-amz-checksum-type"}],[1,{["httpHeader"]:"x-amz-missing-meta"}],[0,{["httpHeader"]:"x-amz-version-id"}],[0,{["httpHeader"]:"Cache-Control"}],[0,{["httpHeader"]:"Content-Disposition"}],[0,{["httpHeader"]:"Content-Encoding"}],[0,{["httpHeader"]:"Content-Language"}],[0,{["httpHeader"]:"Content-Range"}],[0,{["httpHeader"]:"Content-Type"}],[4,{["httpHeader"]:"Expires"}],[0,{["httpHeader"]:"ExpiresString"}],[0,{["httpHeader"]:"x-amz-website-redirect-location"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[128,{["httpPrefixHeaders"]:"x-amz-meta-"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[()=>hu,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}],[0,{["httpHeader"]:"x-amz-storage-class"}],[0,{["httpHeader"]:"x-amz-request-charged"}],[0,{["httpHeader"]:"x-amz-replication-status"}],[1,{["httpHeader"]:"x-amz-mp-parts-count"}],[1,{["httpHeader"]:"x-amz-tagging-count"}],[0,{["httpHeader"]:"x-amz-object-lock-mode"}],[5,{["httpHeader"]:"x-amz-object-lock-retain-until-date"}],[0,{["httpHeader"]:"x-amz-object-lock-legal-hold"}]]],KK=[3,"com.amazonaws.s3","GetObjectRequest",0,["Bucket","Key","IfMatch","IfModifiedSince","IfNoneMatch","IfUnmodifiedSince","Range","ResponseCacheControl","ResponseContentDisposition","ResponseContentEncoding","ResponseContentLanguage","ResponseContentType","ResponseExpires","VersionId","SSECustomerAlgorithm","SSECustomerKey","SSECustomerKeyMD5","RequestPayer","PartNumber","ExpectedBucketOwner","ChecksumMode"],[[0,1],[0,1],[0,{["httpHeader"]:"If-Match"}],[4,{["httpHeader"]:"If-Modified-Since"}],[0,{["httpHeader"]:"If-None-Match"}],[4,{["httpHeader"]:"If-Unmodified-Since"}],[0,{["httpHeader"]:"Range"}],[0,{["httpQuery"]:"response-cache-control"}],[0,{["httpQuery"]:"response-content-disposition"}],[0,{["httpQuery"]:"response-content-encoding"}],[0,{["httpQuery"]:"response-content-language"}],[0,{["httpQuery"]:"response-content-type"}],[6,{["httpQuery"]:"response-expires"}],[0,{["httpQuery"]:"versionId"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[()=>WB,{["httpHeader"]:"x-amz-server-side-encryption-customer-key"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[0,{["httpHeader"]:"x-amz-request-payer"}],[1,{["httpQuery"]:"partNumber"}],[0,{["httpHeader"]:"x-amz-expected-bucket-owner"}],[0,{["httpHeader"]:"x-amz-checksum-mode"}]],2];var xK=[3,"com.amazonaws.s3","ListObjectsV2Output",{["xmlName"]:"ListBucketResult"},["IsTruncated","Contents","Name","Prefix","Delimiter","MaxKeys","CommonPrefixes","EncodingType","KeyCount","ContinuationToken","NextContinuationToken","StartAfter","RequestCharged"],[2,[()=>OK,{["xmlFlattened"]:1}],0,0,0,1,[()=>EK,{["xmlFlattened"]:1}],0,1,0,0,0,[0,{["httpHeader"]:"x-amz-request-charged"}]]],SK=[3,"com.amazonaws.s3","ListObjectsV2Request",0,["Bucket","Delimiter","EncodingType","MaxKeys","Prefix","ContinuationToken","FetchOwner","StartAfter","RequestPayer","ExpectedBucketOwner","OptionalObjectAttributes"],[[0,1],[0,{["httpQuery"]:"delimiter"}],[0,{["httpQuery"]:"encoding-type"}],[1,{["httpQuery"]:"max-keys"}],[0,{["httpQuery"]:"prefix"}],[0,{["httpQuery"]:"continuation-token"}],[2,{["httpQuery"]:"fetch-owner"}],[0,{["httpQuery"]:"start-after"}],[0,{["httpHeader"]:"x-amz-request-payer"}],[0,{["httpHeader"]:"x-amz-expected-bucket-owner"}],[64,{["httpHeader"]:"x-amz-optional-object-attributes"}]],1];var RK=[3,"com.amazonaws.s3","Object",0,["Key","LastModified","ETag","ChecksumAlgorithm","ChecksumType","Size","StorageClass","Owner","RestoreStatus"],[0,4,0,[64,{["xmlFlattened"]:1}],0,1,0,()=>HK,()=>MK]];var HK=[3,"com.amazonaws.s3","Owner",0,["DisplayName","ID"],[0,0]];var UK=[3,"com.amazonaws.s3","PutObjectOutput",0,["Expiration","ETag","ChecksumCRC32","ChecksumCRC32C","ChecksumCRC64NVME","ChecksumSHA1","ChecksumSHA256","ChecksumType","ServerSideEncryption","VersionId","SSECustomerAlgorithm","SSECustomerKeyMD5","SSEKMSKeyId","SSEKMSEncryptionContext","BucketKeyEnabled","Size","RequestCharged"],[[0,{["httpHeader"]:"x-amz-expiration"}],[0,{["httpHeader"]:"ETag"}],[0,{["httpHeader"]:"x-amz-checksum-crc32"}],[0,{["httpHeader"]:"x-amz-checksum-crc32c"}],[0,{["httpHeader"]:"x-amz-checksum-crc64nvme"}],[0,{["httpHeader"]:"x-amz-checksum-sha1"}],[0,{["httpHeader"]:"x-amz-checksum-sha256"}],[0,{["httpHeader"]:"x-amz-checksum-type"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[0,{["httpHeader"]:"x-amz-version-id"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[()=>hu,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[()=>S1,{["httpHeader"]:"x-amz-server-side-encryption-context"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}],[1,{["httpHeader"]:"x-amz-object-size"}],[0,{["httpHeader"]:"x-amz-request-charged"}]]],cK=[3,"com.amazonaws.s3","PutObjectRequest",0,["Bucket","Key","ACL","Body","CacheControl","ContentDisposition","ContentEncoding","ContentLanguage","ContentLength","ContentMD5","ContentType","ChecksumAlgorithm","ChecksumCRC32","ChecksumCRC32C","ChecksumCRC64NVME","ChecksumSHA1","ChecksumSHA256","Expires","IfMatch","IfNoneMatch","GrantFullControl","GrantRead","GrantReadACP","GrantWriteACP","WriteOffsetBytes","Metadata","ServerSideEncryption","StorageClass","WebsiteRedirectLocation","SSECustomerAlgorithm","SSECustomerKey","SSECustomerKeyMD5","SSEKMSKeyId","SSEKMSEncryptionContext","BucketKeyEnabled","RequestPayer","Tagging","ObjectLockMode","ObjectLockRetainUntilDate","ObjectLockLegalHoldStatus","ExpectedBucketOwner"],[[0,1],[0,1],[0,{["httpHeader"]:"x-amz-acl"}],[()=>XB,16],[0,{["httpHeader"]:"Cache-Control"}],[0,{["httpHeader"]:"Content-Disposition"}],[0,{["httpHeader"]:"Content-Encoding"}],[0,{["httpHeader"]:"Content-Language"}],[1,{["httpHeader"]:"Content-Length"}],[0,{["httpHeader"]:"Content-MD5"}],[0,{["httpHeader"]:"Content-Type"}],[0,{["httpHeader"]:"x-amz-sdk-checksum-algorithm"}],[0,{["httpHeader"]:"x-amz-checksum-crc32"}],[0,{["httpHeader"]:"x-amz-checksum-crc32c"}],[0,{["httpHeader"]:"x-amz-checksum-crc64nvme"}],[0,{["httpHeader"]:"x-amz-checksum-sha1"}],[0,{["httpHeader"]:"x-amz-checksum-sha256"}],[4,{["httpHeader"]:"Expires"}],[0,{["httpHeader"]:"If-Match"}],[0,{["httpHeader"]:"If-None-Match"}],[0,{["httpHeader"]:"x-amz-grant-full-control"}],[0,{["httpHeader"]:"x-amz-grant-read"}],[0,{["httpHeader"]:"x-amz-grant-read-acp"}],[0,{["httpHeader"]:"x-amz-grant-write-acp"}],[1,{["httpHeader"]:"x-amz-write-offset-bytes"}],[128,{["httpPrefixHeaders"]:"x-amz-meta-"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[0,{["httpHeader"]:"x-amz-storage-class"}],[0,{["httpHeader"]:"x-amz-website-redirect-location"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[()=>WB,{["httpHeader"]:"x-amz-server-side-encryption-customer-key"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[()=>hu,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[()=>S1,{["httpHeader"]:"x-amz-server-side-encryption-context"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}],[0,{["httpHeader"]:"x-amz-request-payer"}],[0,{["httpHeader"]:"x-amz-tagging"}],[0,{["httpHeader"]:"x-amz-object-lock-mode"}],[5,{["httpHeader"]:"x-amz-object-lock-retain-until-date"}],[0,{["httpHeader"]:"x-amz-object-lock-legal-hold"}],[0,{["httpHeader"]:"x-amz-expected-bucket-owner"}]],2];var MK=[3,"com.amazonaws.s3","RestoreStatus",0,["IsRestoreInProgress","RestoreExpiryDate"],[2,4]];var LK=[3,"com.amazonaws.s3","SessionCredentials",0,["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],[[0,{["xmlName"]:"AccessKeyId"}],[()=>zB,{["xmlName"]:"SecretAccessKey"}],[()=>zB,{["xmlName"]:"SessionToken"}],[4,{["xmlName"]:"Expiration"}]],4];var EK=[1,"com.amazonaws.s3","CommonPrefixList",0,()=>WK];var OK=[1,"com.amazonaws.s3","ObjectList",0,[()=>RK,0]];var YB=[9,"com.amazonaws.s3","CreateSession",{["http"]:["GET","/?session",200]},()=>YK,()=>XK];var hB=[9,"com.amazonaws.s3","GetObject",{["httpChecksum"]:"-",["http"]:["GET","/{Key+}?x-id=GetObject",200]},()=>KK,()=>hK];var KB=[9,"com.amazonaws.s3","ListObjectsV2",{["http"]:["GET","/?list-type=2",200]},()=>SK,()=>xK];var xB=[9,"com.amazonaws.s3","PutObject",{["httpChecksum"]:"-",["http"]:["PUT","/{Key+}?x-id=PutObject",200]},()=>cK,()=>UK];class M3 extends RB.Command.classBuilder().ep({...j2,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(u,D,B,A){return[SB.getEndpointPlugin(B,u.getEndpointParameterInstructions()),K0(B)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").sc(YB).build(){}var HB={name:"@aws-sdk/client-s3",description:"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",version:"3.1015.0",scripts:{build:"concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_package_name"',"build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3",test:"yarn g:vitest run","test:browser":"node ./test/browser-build/esbuild && yarn g:vitest run -c vitest.config.browser.mts","test:browser:watch":"node ./test/browser-build/esbuild && yarn g:vitest watch -c vitest.config.browser.mts","test:e2e":"yarn g:vitest run -c vitest.config.e2e.mts && yarn test:browser","test:e2e:watch":"yarn g:vitest watch -c vitest.config.e2e.mts","test:index":"tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs","test:integration":"yarn g:vitest run -c vitest.config.integ.mts","test:integration:watch":"yarn g:vitest watch -c vitest.config.integ.mts","test:watch":"yarn g:vitest watch"},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/core":"^3.973.24","@aws-sdk/credential-provider-node":"^3.972.25","@aws-sdk/middleware-bucket-endpoint":"^3.972.8","@aws-sdk/middleware-expect-continue":"^3.972.8","@aws-sdk/middleware-flexible-checksums":"^3.974.4","@aws-sdk/middleware-host-header":"^3.972.8","@aws-sdk/middleware-location-constraint":"^3.972.8","@aws-sdk/middleware-logger":"^3.972.8","@aws-sdk/middleware-recursion-detection":"^3.972.8","@aws-sdk/middleware-sdk-s3":"^3.972.24","@aws-sdk/middleware-ssec":"^3.972.8","@aws-sdk/middleware-user-agent":"^3.972.25","@aws-sdk/region-config-resolver":"^3.972.9","@aws-sdk/signature-v4-multi-region":"^3.996.12","@aws-sdk/types":"^3.973.6","@aws-sdk/util-endpoints":"^3.996.5","@aws-sdk/util-user-agent-browser":"^3.972.8","@aws-sdk/util-user-agent-node":"^3.973.11","@smithy/config-resolver":"^4.4.13","@smithy/core":"^3.23.12","@smithy/eventstream-serde-browser":"^4.2.12","@smithy/eventstream-serde-config-resolver":"^4.3.12","@smithy/eventstream-serde-node":"^4.2.12","@smithy/fetch-http-handler":"^5.3.15","@smithy/hash-blob-browser":"^4.2.13","@smithy/hash-node":"^4.2.12","@smithy/hash-stream-node":"^4.2.12","@smithy/invalid-dependency":"^4.2.12","@smithy/md5-js":"^4.2.12","@smithy/middleware-content-length":"^4.2.12","@smithy/middleware-endpoint":"^4.4.27","@smithy/middleware-retry":"^4.4.44","@smithy/middleware-serde":"^4.2.15","@smithy/middleware-stack":"^4.2.12","@smithy/node-config-provider":"^4.3.12","@smithy/node-http-handler":"^4.5.0","@smithy/protocol-http":"^5.3.12","@smithy/smithy-client":"^4.12.7","@smithy/types":"^4.13.1","@smithy/url-parser":"^4.2.12","@smithy/util-base64":"^4.3.2","@smithy/util-body-length-browser":"^4.2.2","@smithy/util-body-length-node":"^4.2.3","@smithy/util-defaults-mode-browser":"^4.3.43","@smithy/util-defaults-mode-node":"^4.2.47","@smithy/util-endpoints":"^3.3.3","@smithy/util-middleware":"^4.2.12","@smithy/util-retry":"^4.2.12","@smithy/util-stream":"^4.5.20","@smithy/util-utf8":"^4.2.2","@smithy/util-waiter":"^4.2.13",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/signature-v4-crt":"3.1015.0","@smithy/snapshot-testing":"^2.0.3","@tsconfig/node20":"20.1.8","@types/node":"^20.14.8",concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~5.8.3",vitest:"^4.0.17"},engines:{node:">=20.0.0"},typesVersions:{"<4.5":{"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 E0=X(Y0(),1);var H1=X(cB(),1),kB=X(kK(),1);var R1=X(cB(),1),UB="AWS_EC2_METADATA_DISABLED",MB=async(u)=>{let{ENV_CMDS_FULL_URI:D,ENV_CMDS_RELATIVE_URI:B,fromContainerMetadata:A,fromInstanceMetadata:w}=await import("./chunk-ratbccpg.js");if(process.env[B]||process.env[D]){u.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");let{fromHttp:F}=await import("./chunk-pfaq2mer.js");return R1.chain(F(u),A(u))}if(process.env[UB]&&process.env[UB]!=="false")return async()=>{throw new R1.CredentialsProviderError("EC2 Instance Metadata Service access disabled",{logger:u.logger})};return u.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),w(u)};function LB(u,D){let B=PK(u),A,w,F,N=async(G)=>{if(G?.forceRefresh)return await B(G);if(F?.expiration){if(F?.expiration?.getTime()<Date.now())F=void 0}if(A)await A;else if(!F||D?.(F))if(F){if(!w)w=B(G).then((v)=>{F=v}).finally(()=>{w=void 0})}else return A=B(G).then((v)=>{F=v}).finally(()=>{A=void 0}),N(G);return F};return N}var PK=(u)=>async(D)=>{let B;for(let A of u)try{return await A(D)}catch(w){if(B=w,w?.tryNextLink)continue;throw w}throw B};var EB=!1,yB=(u={})=>LB([async()=>{if(u.profile??process.env[kB.ENV_PROFILE]){if(process.env[OB]&&process.env[CB]){if(!EB)(u.logger?.warn&&u.logger?.constructor?.name!=="NoOpLogger"?u.logger.warn.bind(u.logger):console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
|
|
5
5
|
Multiple credential sources detected:
|
|
6
6
|
Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
|
|
7
7
|
This SDK will proceed with the AWS_PROFILE value.
|
|
@@ -9,7 +9,7 @@ Headers: ${JSON.stringify(B)}`);this.code=u,this.body=D,this.headers={},B.forEac
|
|
|
9
9
|
However, a future version may change this behavior to prefer the ENV static credentials.
|
|
10
10
|
Please ensure that your environment only sets either the AWS_PROFILE or the
|
|
11
11
|
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
|
|
12
|
-
`),EB=!0}throw new H1.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.",{logger:u.logger,tryNextLink:!0})}return u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),PB(u)()},async(D)=>{u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");let{ssoStartUrl:B,ssoAccountId:A,ssoRegion:w,ssoRoleName:F,ssoSession:N}=u;if(!B&&!A&&!w&&!F&&!N)throw new H1.CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:u.logger});let{fromSSO:G}=await import("./chunk-r9p9g2x9.js");return G(u)(D)},async(D)=>{u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:B}=await import("./chunk-8rm601h3.js");return B(u)(D)},async(D)=>{u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:B}=await import("./chunk-4e4ax9bs.js");return B(u)(D)},async(D)=>{u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:B}=await import("./chunk-rkf1stc0.js");return B(u)(D)},async()=>{return u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await MB(u))()},async()=>{throw new H1.CredentialsProviderError("Could not load credentials from any providers",{tryNextLink:!1,logger:u.logger})}],yK);var yK=(u)=>u?.expiration!==void 0&&u.expiration.getTime()-Date.now()<300000;var M0=X(U4(),1),VK="AWS_S3_USE_ARN_REGION",TK="s3_use_arn_region",VB={environmentVariableSelector:(u)=>M0.booleanSelector(u,VK,M0.SelectorType.ENV),configFileSelector:(u)=>M0.booleanSelector(u,TK,M0.SelectorType.CONFIG),default:void 0};var O1=X(eK(),1),i2=X(tB(),1);var d2=X(IB(),1);var qB=X(IB(),1);class L0{bytes;constructor(u){if(this.bytes=u,u.byteLength!==8)throw Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(u){if(u>9223372036854776000||u<-9223372036854776000)throw Error(`${u} is too large (or, if negative, too small) to represent as an Int64`);let D=new Uint8Array(8);for(let B=7,A=Math.abs(Math.round(u));B>-1&&A>0;B--,A/=256)D[B]=A;if(u<0)TB(D);return new L0(D)}valueOf(){let u=this.bytes.slice(0),D=u[0]&128;if(D)TB(u);return parseInt(qB.toHex(u),16)*(D?-1:1)}toString(){return String(this.valueOf())}}function TB(u){for(let D=0;D<8;D++)u[D]^=255;for(let D=7;D>-1;D--)if(u[D]++,u[D]!==0)break}class L3{toUtf8;fromUtf8;constructor(u,D){this.toUtf8=u,this.fromUtf8=D}format(u){let D=[];for(let w of Object.keys(u)){let F=this.fromUtf8(w);D.push(Uint8Array.from([F.byteLength]),F,this.formatHeaderValue(u[w]))}let B=new Uint8Array(D.reduce((w,F)=>w+F.byteLength,0)),A=0;for(let w of D)B.set(w,A),A+=w.byteLength;return B}formatHeaderValue(u){switch(u.type){case"boolean":return Uint8Array.from([u.value?0:1]);case"byte":return Uint8Array.from([2,u.value]);case"short":let D=new DataView(new ArrayBuffer(3));return D.setUint8(0,3),D.setInt16(1,u.value,!1),new Uint8Array(D.buffer);case"integer":let B=new DataView(new ArrayBuffer(5));return B.setUint8(0,4),B.setInt32(1,u.value,!1),new Uint8Array(B.buffer);case"long":let A=new Uint8Array(9);return A[0]=5,A.set(u.value.bytes,1),A;case"binary":let w=new DataView(new ArrayBuffer(3+u.value.byteLength));w.setUint8(0,6),w.setUint16(1,u.value.byteLength,!1);let F=new Uint8Array(w.buffer);return F.set(u.value,3),F;case"string":let N=this.fromUtf8(u.value),G=new DataView(new ArrayBuffer(3+N.byteLength));G.setUint8(0,7),G.setUint16(1,N.byteLength,!1);let v=new Uint8Array(G.buffer);return v.set(N,3),v;case"timestamp":let z=new Uint8Array(9);return z[0]=8,z.set(L0.fromNumber(u.value.valueOf()).bytes,1),z;case"uuid":if(!lK.test(u.value))throw Error(`Invalid UUID received: ${u.value}`);let Q=new Uint8Array(17);return Q[0]=9,Q.set(d2.fromHex(u.value.replace(/\-/g,"")),1),Q}}parse(u){let D={},B=0;while(B<u.byteLength){let A=u.getUint8(B++),w=this.toUtf8(new Uint8Array(u.buffer,u.byteOffset+B,A));switch(B+=A,u.getUint8(B++)){case 0:D[w]={type:gB,value:!0};break;case 1:D[w]={type:gB,value:!1};break;case 2:D[w]={type:IK,value:u.getInt8(B++)};break;case 3:D[w]={type:qK,value:u.getInt16(B,!1)},B+=2;break;case 4:D[w]={type:mK,value:u.getInt32(B,!1)},B+=4;break;case 5:D[w]={type:gK,value:new L0(new Uint8Array(u.buffer,u.byteOffset+B,8))},B+=8;break;case 6:let F=u.getUint16(B,!1);B+=2,D[w]={type:_K,value:new Uint8Array(u.buffer,u.byteOffset+B,F)},B+=F;break;case 7:let N=u.getUint16(B,!1);B+=2,D[w]={type:fK,value:this.toUtf8(new Uint8Array(u.buffer,u.byteOffset+B,N))},B+=N;break;case 8:D[w]={type:bK,value:new Date(new L0(new Uint8Array(u.buffer,u.byteOffset+B,8)).valueOf())},B+=8;break;case 9:let G=new Uint8Array(u.buffer,u.byteOffset+B,16);B+=16,D[w]={type:jK,value:`${d2.toHex(G.subarray(0,4))}-${d2.toHex(G.subarray(4,6))}-${d2.toHex(G.subarray(6,8))}-${d2.toHex(G.subarray(8,10))}-${d2.toHex(G.subarray(10))}`};break;default:throw Error("Unrecognized header type tag")}}return D}}var mB;(function(u){u[u.boolTrue=0]="boolTrue",u[u.boolFalse=1]="boolFalse",u[u.byte=2]="byte",u[u.short=3]="short",u[u.integer=4]="integer",u[u.long=5]="long",u[u.byteArray=6]="byteArray",u[u.string=7]="string",u[u.timestamp=8]="timestamp",u[u.uuid=9]="uuid"})(mB||(mB={}));var gB="boolean",IK="byte",qK="short",mK="integer",gK="long",_K="binary",fK="string",bK="timestamp",jK="uuid",lK=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;var _B=4,r2=_B*2,G0=4,dK=r2+G0*2;function fB({byteLength:u,byteOffset:D,buffer:B}){if(u<dK)throw Error("Provided message too short to accommodate event stream message overhead");let A=new DataView(B,D,u),w=A.getUint32(0,!1);if(u!==w)throw Error("Reported message length does not match received message length");let F=A.getUint32(_B,!1),N=A.getUint32(r2,!1),G=A.getUint32(u-G0,!1),v=new N0().update(new Uint8Array(B,D,r2));if(N!==v.digest())throw Error(`The prelude checksum specified in the message (${N}) does not match the calculated CRC32 checksum (${v.digest()})`);if(v.update(new Uint8Array(B,D+r2,u-(r2+G0))),G!==v.digest())throw Error(`The message checksum (${v.digest()}) did not match the expected value of ${G}`);return{headers:new DataView(B,D+r2+G0,F),body:new Uint8Array(B,D+r2+G0+F,w-F-(r2+G0+G0))}}class E3{headerMarshaller;messageBuffer;isEndOfStream;constructor(u,D){this.headerMarshaller=new L3(u,D),this.messageBuffer=[],this.isEndOfStream=!1}feed(u){this.messageBuffer.push(this.decode(u))}endOfStream(){this.isEndOfStream=!0}getMessage(){let u=this.messageBuffer.pop(),D=this.isEndOfStream;return{getMessage(){return u},isEndOfStream(){return D}}}getAvailableMessages(){let u=this.messageBuffer;this.messageBuffer=[];let D=this.isEndOfStream;return{getMessages(){return u},isEndOfStream(){return D}}}encode({headers:u,body:D}){let B=this.headerMarshaller.format(u),A=B.byteLength+D.byteLength+16,w=new Uint8Array(A),F=new DataView(w.buffer,w.byteOffset,w.byteLength),N=new N0;return F.setUint32(0,A,!1),F.setUint32(4,B.byteLength,!1),F.setUint32(8,N.update(w.subarray(0,8)).digest(),!1),w.set(B,12),w.set(D,B.byteLength+12),F.setUint32(A-4,N.update(w.subarray(8,A-4)).digest(),!1),w}decode(u){let{headers:D,body:B}=fB(u);return{headers:this.headerMarshaller.parse(D),body:B}}formatHeaders(u){return this.headerMarshaller.format(u)}}class O3{options;constructor(u){this.options=u}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let u of this.options.inputStream)yield this.options.decoder.decode(u)}}class C3{options;constructor(u){this.options=u}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let u of this.options.messageStream)yield this.options.encoder.encode(u);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class P3{options;constructor(u){this.options=u}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let u of this.options.messageStream){let D=await this.options.deserializer(u);if(D===void 0)continue;yield D}}}class k3{options;constructor(u){this.options=u}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let u of this.options.inputStream)yield this.options.serializer(u)}}function bB(u){let D=0,B=0,A=null,w=null,F=(G)=>{if(typeof G!=="number")throw Error("Attempted to allocate an event message where size was not a number: "+G);D=G,B=4,A=new Uint8Array(G),new DataView(A.buffer).setUint32(0,G,!1)},N=async function*(){let G=u[Symbol.asyncIterator]();while(!0){let{value:v,done:z}=await G.next();if(z){if(!D)return;else if(D===B)yield A;else throw Error("Truncated event message received.");return}let Q=v.length,Z=0;while(Z<Q){if(!A){let W=Q-Z;if(!w)w=new Uint8Array(4);let Y=Math.min(4-B,W);if(w.set(v.slice(Z,Z+Y),B),B+=Y,Z+=Y,B<4)break;F(new DataView(w.buffer).getUint32(0,!1)),w=null}let J=Math.min(D-B,Q-Z);if(A.set(v.slice(Z,Z+J),B),B+=J,Z+=J,D&&D===B)yield A,A=null,D=0,B=0}}};return{[Symbol.asyncIterator]:N}}function jB(u,D){return async function(B){let{value:A}=B.headers[":message-type"];if(A==="error"){let w=Error(B.headers[":error-message"].value||"UnknownError");throw w.name=B.headers[":error-code"].value,w}else if(A==="exception"){let w=B.headers[":exception-type"].value,F={[w]:B},N=await u(F);if(N.$unknown){let G=Error(D(B.body));throw G.name=w,G}throw N[w]}else if(A==="event"){let w={[B.headers[":event-type"].value]:B},F=await u(w);if(F.$unknown)return;return F}else throw Error(`Unrecognizable event type: ${B.headers[":event-type"].value}`)}}class y3{eventStreamCodec;utfEncoder;constructor({utf8Encoder:u,utf8Decoder:D}){this.eventStreamCodec=new E3(u,D),this.utfEncoder=u}deserialize(u,D){let B=bB(u);return new P3({messageStream:new O3({inputStream:B,decoder:this.eventStreamCodec}),deserializer:jB(D,this.utfEncoder)})}serialize(u,D){return new C3({messageStream:new k3({inputStream:u,serializer:D}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as rK}from"stream";async function*lB(u){let D=!1,B=!1,A=[];u.on("error",(w)=>{if(!D)D=!0;if(w)throw w}),u.on("data",(w)=>{A.push(w)}),u.on("end",()=>{D=!0});while(!B){let w=await new Promise((F)=>setTimeout(()=>F(A.shift()),0));if(w)yield w;B=D&&A.length===0}}class V3{universalMarshaller;constructor({utf8Encoder:u,utf8Decoder:D}){this.universalMarshaller=new y3({utf8Decoder:D,utf8Encoder:u})}deserialize(u,D){let B=typeof u[Symbol.asyncIterator]==="function"?u:lB(u);return this.universalMarshaller.deserialize(B,D)}serialize(u,D){return rK.from(this.universalMarshaller.serialize(u,D))}}var dB=(u)=>new V3(u);var E1=X(ux(),1);var rB=X(iD(),1);import{Writable as iK}from"stream";class T3 extends iK{hash;constructor(u,D){super(D);this.hash=u}_write(u,D,B){try{this.hash.update(rB.toUint8Array(u))}catch(A){return B(A)}B()}}var iB=(u,D)=>{if(D.readableFlowing!==null)throw Error("Unable to calculate hash for flowing readable stream");let B=new u,A=new T3(B);return D.pipe(A),new Promise((w,F)=>{D.on("error",(N)=>{A.end(),F(N)}),A.on("error",F),A.on("finish",()=>{B.digest().then(w).catch(F)})})};var C1=X(oB(),1),Y2=X(oK(),1),P1=X(sK(),1),k1=X(k2(),1),eB=X(Dx(),1),u6=X(Bx(),1),D6=X(tK(),1);var U1=X(Y0(),1),nB=X(aK(),1);var pB=X(k2(),1),aB=X(pK(),1),c1=X(nK(),1),M1=X(iu(),1),L1=X(iD(),1);var sB=(u)=>{return{apiVersion:"2006-03-01",base64Decoder:u?.base64Decoder??c1.fromBase64,base64Encoder:u?.base64Encoder??c1.toBase64,disableHostPrefix:u?.disableHostPrefix??!1,endpointProvider:u?.endpointProvider??A1,extensions:u?.extensions??[],getAwsChunkedEncodingStream:u?.getAwsChunkedEncodingStream??M1.getAwsChunkedEncodingStream,httpAuthSchemeProvider:u?.httpAuthSchemeProvider??NB,httpAuthSchemes:u?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(D)=>D.getIdentityProvider("aws.auth#sigv4"),signer:new U1.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(D)=>D.getIdentityProvider("aws.auth#sigv4a"),signer:new U1.AwsSdkSigV4ASigner}],logger:u?.logger??new pB.NoOpLogger,protocol:u?.protocol??nB.AwsRestXmlProtocol,protocolSettings:u?.protocolSettings??{defaultNamespace:"com.amazonaws.s3",errorTypeRegistries:QB,xmlNamespace:"http://s3.amazonaws.com/doc/2006-03-01/",version:"2006-03-01",serviceTarget:"AmazonS3"},sdkStreamMixin:u?.sdkStreamMixin??M1.sdkStreamMixin,serviceId:u?.serviceId??"S3",signerConstructor:u?.signerConstructor??zu,signingEscapePath:u?.signingEscapePath??!1,urlParser:u?.urlParser??aB.parseUrl,useArnRegion:u?.useArnRegion??void 0,utf8Decoder:u?.utf8Decoder??L1.fromUtf8,utf8Encoder:u?.utf8Encoder??L1.toUtf8}};var B6=(u)=>{k1.emitWarningIfUnsupportedVersion(process.version);let D=u6.resolveDefaultsModeConfig(u),B=()=>D().then(k1.loadConfigsForDefaultMode),A=sB(u);E0.emitWarningIfUnsupportedVersion(process.version);let w={profile:u?.profile,logger:A.logger};return{...A,...u,runtime:"node",defaultsMode:D,authSchemePreference:u?.authSchemePreference??Y2.loadConfig(E0.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,w),bodyLengthChecker:u?.bodyLengthChecker??eB.calculateBodyLength,credentialDefaultProvider:u?.credentialDefaultProvider??yB,defaultUserAgentProvider:u?.defaultUserAgentProvider??O1.createDefaultUserAgentProvider({serviceId:A.serviceId,clientVersion:HB.version}),disableS3ExpressSessionAuth:u?.disableS3ExpressSessionAuth??Y2.loadConfig(aD,w),eventStreamSerdeProvider:u?.eventStreamSerdeProvider??dB,maxAttempts:u?.maxAttempts??Y2.loadConfig(C1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,u),md5:u?.md5??E1.Hash.bind(null,"md5"),region:u?.region??Y2.loadConfig(i2.NODE_REGION_CONFIG_OPTIONS,{...i2.NODE_REGION_CONFIG_FILE_OPTIONS,...w}),requestChecksumCalculation:u?.requestChecksumCalculation??Y2.loadConfig(b5,w),requestHandler:P1.NodeHttpHandler.create(u?.requestHandler??B),responseChecksumValidation:u?.responseChecksumValidation??Y2.loadConfig(j5,w),retryMode:u?.retryMode??Y2.loadConfig({...C1.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await B()).retryMode||D6.DEFAULT_RETRY_MODE},u),sha1:u?.sha1??E1.Hash.bind(null,"sha1"),sha256:u?.sha256??E1.Hash.bind(null,"sha256"),sigv4aSigningRegionSet:u?.sigv4aSigningRegionSet??Y2.loadConfig(E0.NODE_SIGV4A_CONFIG_OPTIONS,w),streamCollector:u?.streamCollector??P1.streamCollector,streamHasher:u?.streamHasher??iB,useArnRegion:u?.useArnRegion??Y2.loadConfig(VB,w),useDualstackEndpoint:u?.useDualstackEndpoint??Y2.loadConfig(i2.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,w),useFipsEndpoint:u?.useFipsEndpoint??Y2.loadConfig(i2.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,w),userAgentAppId:u?.userAgentAppId??Y2.loadConfig(O1.NODE_APP_ID_CONFIG_OPTIONS,w)}};var y1=X(Ax(),1),V1=X(m2(),1),T1=X(k2(),1);var A6=(u)=>{let{httpAuthSchemes:D,httpAuthSchemeProvider:B,credentials:A}=u;return{setHttpAuthScheme(w){let F=D.findIndex((N)=>N.schemeId===w.schemeId);if(F===-1)D.push(w);else D.splice(F,1,w)},httpAuthSchemes(){return D},setHttpAuthSchemeProvider(w){B=w},httpAuthSchemeProvider(){return B},setCredentials(w){A=w},credentials(){return A}}},w6=(u)=>{return{httpAuthSchemes:u.httpAuthSchemes(),httpAuthSchemeProvider:u.httpAuthSchemeProvider(),credentials:u.credentials()}};var F6=(u,D)=>{let B=Object.assign(y1.getAwsRegionExtensionConfiguration(u),T1.getDefaultExtensionConfiguration(u),V1.getHttpHandlerExtensionConfiguration(u),A6(u));return D.forEach((A)=>A.configure(B)),Object.assign(u,y1.resolveAwsRegionExtensionConfiguration(B),T1.resolveDefaultRuntimeConfig(B),V1.resolveHttpHandlerRuntimeConfig(B),w6(B))};class I3 extends J6.Client{config;constructor(...[u]){let D=B6(u||{});super(D);this.initConfig=D;let B=$B(D),A=q1.resolveUserAgentConfig(B),w=Q4(A),F=m1.resolveRetryConfig(w),N=$6.resolveRegionConfig(F),G=I1.resolveHostHeaderConfig(N),v=Z6.resolveEndpointConfig(G),z=n4(v),Q=GB(z),Z=b4(Q,{session:[()=>this,M3]}),J=F6(Z,u?.extensions||[]);this.config=J,this.middlewareStack.use(v6.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(q1.getUserAgentPlugin(this.config)),this.middlewareStack.use(m1.getRetryPlugin(this.config)),this.middlewareStack.use(z6.getContentLengthPlugin(this.config)),this.middlewareStack.use(I1.getHostHeaderPlugin(this.config)),this.middlewareStack.use(N6.getLoggerPlugin(this.config)),this.middlewareStack.use(G6.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(O0.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:AB,identityProviderConfigProvider:async(W)=>new O0.DefaultIdentityProviderConfig({"aws.auth#sigv4":W.credentials,"aws.auth#sigv4a":W.credentials})})),this.middlewareStack.use(O0.getHttpSigningPlugin(this.config)),this.middlewareStack.use(i4(this.config)),this.middlewareStack.use(_5(this.config)),this.middlewareStack.use(x4(this.config)),this.middlewareStack.use(sD(this.config)),this.middlewareStack.use(tD(this.config))}destroy(){super.destroy()}}function vx(u){return(D)=>async(B)=>{let A={...B.input},w=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let F of w){let N=A[F.target];if(N){let G;if(typeof N==="string")if(Zx(N,u))G=u.base64Decoder(N);else G=u.utf8Decoder(N),A[F.target]=u.base64Encoder(G);else G=ArrayBuffer.isView(N)?new Uint8Array(N.buffer,N.byteOffset,N.byteLength):new Uint8Array(N),A[F.target]=u.base64Encoder(G);let v=new u.md5;v.update(G),A[F.hash]=u.base64Encoder(await v.digest())}}return D({...B,input:A})}}var zx={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},g1=(u)=>({applyToStack:(D)=>{D.add(vx(u),zx)}});function Zx(u,D){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u))return!1;try{return D.base64Decoder(u).length===32}catch{return!1}}var Q6=X(U0(),1),W6=X(k2(),1);class q3 extends W6.Command.classBuilder().ep({...j2,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(u,D,B,A){return[Q6.getEndpointPlugin(B,u.getEndpointParameterInstructions()),pu(B,{requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC64NVME","CRC32","CRC32C","SHA256","SHA1"]}),g1(B),H4(B)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").sc(hB).build(){}var X6=X(U0(),1),Y6=X(k2(),1);class m3 extends Y6.Command.classBuilder().ep({...j2,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(u,D,B,A){return[X6.getEndpointPlugin(B,u.getEndpointParameterInstructions()),K0(B)]}).s("AmazonS3","ListObjectsV2",{}).n("S3Client","ListObjectsV2Command").sc(KB).build(){}var h6=X(U0(),1),K6=X(k2(),1);class g3 extends K6.Command.classBuilder().ep({...j2,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(u,D,B,A){return[h6.getEndpointPlugin(B,u.getEndpointParameterInstructions()),pu(B,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),Y4(B),K0(B),g1(B)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").sc(xB).build(){}import{Buffer as x6}from"buffer";class S6 extends Q0{client;constructor(...u){super();this.client=new I3(...u)}async put(u){let D,B,A,w=process.env.BUCKET_NAME;if(u instanceof Blob)D=u,A=`${Bun.randomUUIDv7()}.${u.type.split("/")[1].split(";")[0]}`,B=u.type;else D=u.body,A=u.name,w=u.bucket??w,B=u.contentType;B=D instanceof Blob||D instanceof File?D.type:void 0;let F=D instanceof x6?D:D instanceof Blob||D instanceof File?x6.from(await D.arrayBuffer()):"";return await this.client.send(new g3({Bucket:w,Key:A,Body:F,ContentType:B})),A}async list(u){return await this.client.send(new m3({Bucket:process.env.BUCKET_NAME,Prefix:u}))}async fetch(u){let D=process.env.BUCKET_NAME,B;if(typeof u==="string")B=u;else D=u.bucket??D,B=u.name;if(!B)throw Error("Object name has to be specified");let A=await this.client.send(new q3({Bucket:D,Key:B}));return new Response(A.Body.transformToWebStream(),{headers:{"Content-Type":A.ContentType,"Content-Length":A.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":A.LastModified?.toUTCString()||"",ETag:A.ETag||""}})}}class _1{}class f1 extends _1{requests=new Map;consume(u,D){if(!this.requests.has(u))this.requests.set(u,{date:Date.now(),count:1});else{let B=this.requests.get(u),A=Date.now();if(A-B.date>=60000)this.requests.set(u,{date:A,count:1});else this.requests.set(u,{date:B.date,count:B.count+1})}return this.requests.get(u).count}}class R6 extends f{driver=new f1;boot(){}}var n2=new TextEncoder;var Ku=new Uint8Array(256);for(let u=0;u<64;u++)Ku["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(u)]=u;function b1(u){let D=Math.ceil(u.length/4)*3,B=u.length,A=0;if(u.length%4===3)D--;else if(u.length%4===2)D-=2;else if(u[u.length-1]==="="){if(D--,u[u.length-2]==="=")D--}let w=new ArrayBuffer(D),F=new Uint8Array(w);for(let N=0;N<B;N+=4){let G=Ku[u.charCodeAt(N)],v=Ku[u.charCodeAt(N+1)],z=Ku[u.charCodeAt(N+2)],Q=Ku[u.charCodeAt(N+3)];F[A++]=G<<2|v>>4,F[A++]=(v&15)<<4|z>>2,F[A++]=(z&3)<<6|Q&63}return w}function C0(u){u=u||"utf8";let D;try{D=new TextDecoder(u)}catch(B){D=new TextDecoder("windows-1252")}return D}async function p2(u){if("arrayBuffer"in u)return await u.arrayBuffer();let D=new FileReader;return new Promise((B,A)=>{D.onload=function(w){B(w.target.result)},D.onerror=function(w){A(D.error)},D.readAsArrayBuffer(u)})}function H6(u){if(u>=48&&u<=57||u>=97&&u<=102||u>=65&&u<=70)return String.fromCharCode(u);return!1}function Jx(u,D,B){let A=u.indexOf("*");if(A>=0)u=u.substr(0,A);D=D.toUpperCase();let w;if(D==="Q"){B=B.replace(/=\s+([0-9a-fA-F])/g,"=$1").replace(/[_\s]/g," ");let F=n2.encode(B),N=[];for(let v=0,z=F.length;v<z;v++){let Q=F[v];if(v<=z-2&&Q===61){let Z=H6(F[v+1]),J=H6(F[v+2]);if(Z&&J){let W=parseInt(Z+J,16);N.push(W),v+=2;continue}}N.push(Q)}w=new ArrayBuffer(N.length);let G=new DataView(w);for(let v=0,z=N.length;v<z;v++)G.setUint8(v,N[v])}else if(D==="B")w=b1(B.replace(/[^a-zA-Z0-9\+\/=]+/g,""));else w=n2.encode(B);return C0(u).decode(w)}function $0(u){let D=!0,B=!1;while(!B){let A=(u||"").toString().replace(/(=\?([^?]+)\?[Bb]\?([^?]*)\?=)\s*(?==\?([^?]+)\?[Bb]\?[^?]*\?=)/g,(w,F,N,G,v)=>{if(!D)return w;if(N===v&&G.length%4===0&&!/=$/.test(G))return F+"__\x00JOIN\x00__";return w}).replace(/(=\?([^?]+)\?[Qq]\?[^?]*\?=)\s*(?==\?([^?]+)\?[Qq]\?[^?]*\?=)/g,(w,F,N,G)=>{if(!D)return w;if(N===G)return F+"__\x00JOIN\x00__";return w}).replace(/(\?=)?__\x00JOIN\x00__(=\?([^?]+)\?[QqBb]\?)?/g,"").replace(/(=\?[^?]+\?[QqBb]\?[^?]*\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g,"$1").replace(/=\?([\w_\-*]+)\?([QqBb])\?([^?]*)\?=/g,(w,F,N,G)=>Jx(F,N,G));if(D&&A.indexOf("\uFFFD")>=0)D=!1;else return A}}function Qx(u,D){D=D||"utf-8";let B=[];for(let F=0;F<u.length;F++){let N=u.charAt(F);if(N==="%"&&/^[a-f0-9]{2}/i.test(u.substr(F+1,2))){let G=u.substr(F+1,2);F+=2,B.push(parseInt(G,16))}else if(N.charCodeAt(0)>126){N=n2.encode(N);for(let G=0;G<N.length;G++)B.push(N[G])}else B.push(N.charCodeAt(0))}let A=new ArrayBuffer(B.length),w=new DataView(A);for(let F=0,N=B.length;F<N;F++)w.setUint8(F,B[F]);return C0(D).decode(A)}function U6(u){let D=new Map;Object.keys(u.params).forEach((B)=>{let A=B.match(/\*((\d+)\*?)?$/);if(!A)return;let w=B.substr(0,A.index).toLowerCase(),F=Number(A[2])||0,N;if(!D.has(w))N={charset:!1,values:[]},D.set(w,N);else N=D.get(w);let G=u.params[B];if(F===0&&A[0].charAt(A[0].length-1)==="*"&&(A=G.match(/^([^']*)'[^']*'(.*)$/)))N.charset=A[1]||"utf-8",G=A[2];N.values.push({nr:F,value:G}),delete u.params[B]}),D.forEach((B,A)=>{u.params[A]=Qx(B.values.sort((w,F)=>w.nr-F.nr).map((w)=>w.value).join(""),B.charset)})}class j1{constructor(){this.chunks=[]}update(u){this.chunks.push(u),this.chunks.push(`
|
|
12
|
+
`),EB=!0}throw new H1.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.",{logger:u.logger,tryNextLink:!0})}return u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),PB(u)()},async(D)=>{u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");let{ssoStartUrl:B,ssoAccountId:A,ssoRegion:w,ssoRoleName:F,ssoSession:N}=u;if(!B&&!A&&!w&&!F&&!N)throw new H1.CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:u.logger});let{fromSSO:G}=await import("./chunk-8mgsjrcc.js");return G(u)(D)},async(D)=>{u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:B}=await import("./chunk-81yxskss.js");return B(u)(D)},async(D)=>{u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:B}=await import("./chunk-0pjn1a5d.js");return B(u)(D)},async(D)=>{u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:B}=await import("./chunk-x3vy6dbw.js");return B(u)(D)},async()=>{return u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await MB(u))()},async()=>{throw new H1.CredentialsProviderError("Could not load credentials from any providers",{tryNextLink:!1,logger:u.logger})}],yK);var yK=(u)=>u?.expiration!==void 0&&u.expiration.getTime()-Date.now()<300000;var M0=X(U4(),1),VK="AWS_S3_USE_ARN_REGION",TK="s3_use_arn_region",VB={environmentVariableSelector:(u)=>M0.booleanSelector(u,VK,M0.SelectorType.ENV),configFileSelector:(u)=>M0.booleanSelector(u,TK,M0.SelectorType.CONFIG),default:void 0};var O1=X(eK(),1),i2=X(tB(),1);var d2=X(IB(),1);var qB=X(IB(),1);class L0{bytes;constructor(u){if(this.bytes=u,u.byteLength!==8)throw Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(u){if(u>9223372036854776000||u<-9223372036854776000)throw Error(`${u} is too large (or, if negative, too small) to represent as an Int64`);let D=new Uint8Array(8);for(let B=7,A=Math.abs(Math.round(u));B>-1&&A>0;B--,A/=256)D[B]=A;if(u<0)TB(D);return new L0(D)}valueOf(){let u=this.bytes.slice(0),D=u[0]&128;if(D)TB(u);return parseInt(qB.toHex(u),16)*(D?-1:1)}toString(){return String(this.valueOf())}}function TB(u){for(let D=0;D<8;D++)u[D]^=255;for(let D=7;D>-1;D--)if(u[D]++,u[D]!==0)break}class L3{toUtf8;fromUtf8;constructor(u,D){this.toUtf8=u,this.fromUtf8=D}format(u){let D=[];for(let w of Object.keys(u)){let F=this.fromUtf8(w);D.push(Uint8Array.from([F.byteLength]),F,this.formatHeaderValue(u[w]))}let B=new Uint8Array(D.reduce((w,F)=>w+F.byteLength,0)),A=0;for(let w of D)B.set(w,A),A+=w.byteLength;return B}formatHeaderValue(u){switch(u.type){case"boolean":return Uint8Array.from([u.value?0:1]);case"byte":return Uint8Array.from([2,u.value]);case"short":let D=new DataView(new ArrayBuffer(3));return D.setUint8(0,3),D.setInt16(1,u.value,!1),new Uint8Array(D.buffer);case"integer":let B=new DataView(new ArrayBuffer(5));return B.setUint8(0,4),B.setInt32(1,u.value,!1),new Uint8Array(B.buffer);case"long":let A=new Uint8Array(9);return A[0]=5,A.set(u.value.bytes,1),A;case"binary":let w=new DataView(new ArrayBuffer(3+u.value.byteLength));w.setUint8(0,6),w.setUint16(1,u.value.byteLength,!1);let F=new Uint8Array(w.buffer);return F.set(u.value,3),F;case"string":let N=this.fromUtf8(u.value),G=new DataView(new ArrayBuffer(3+N.byteLength));G.setUint8(0,7),G.setUint16(1,N.byteLength,!1);let v=new Uint8Array(G.buffer);return v.set(N,3),v;case"timestamp":let z=new Uint8Array(9);return z[0]=8,z.set(L0.fromNumber(u.value.valueOf()).bytes,1),z;case"uuid":if(!lK.test(u.value))throw Error(`Invalid UUID received: ${u.value}`);let Q=new Uint8Array(17);return Q[0]=9,Q.set(d2.fromHex(u.value.replace(/\-/g,"")),1),Q}}parse(u){let D={},B=0;while(B<u.byteLength){let A=u.getUint8(B++),w=this.toUtf8(new Uint8Array(u.buffer,u.byteOffset+B,A));switch(B+=A,u.getUint8(B++)){case 0:D[w]={type:gB,value:!0};break;case 1:D[w]={type:gB,value:!1};break;case 2:D[w]={type:IK,value:u.getInt8(B++)};break;case 3:D[w]={type:qK,value:u.getInt16(B,!1)},B+=2;break;case 4:D[w]={type:mK,value:u.getInt32(B,!1)},B+=4;break;case 5:D[w]={type:gK,value:new L0(new Uint8Array(u.buffer,u.byteOffset+B,8))},B+=8;break;case 6:let F=u.getUint16(B,!1);B+=2,D[w]={type:_K,value:new Uint8Array(u.buffer,u.byteOffset+B,F)},B+=F;break;case 7:let N=u.getUint16(B,!1);B+=2,D[w]={type:fK,value:this.toUtf8(new Uint8Array(u.buffer,u.byteOffset+B,N))},B+=N;break;case 8:D[w]={type:bK,value:new Date(new L0(new Uint8Array(u.buffer,u.byteOffset+B,8)).valueOf())},B+=8;break;case 9:let G=new Uint8Array(u.buffer,u.byteOffset+B,16);B+=16,D[w]={type:jK,value:`${d2.toHex(G.subarray(0,4))}-${d2.toHex(G.subarray(4,6))}-${d2.toHex(G.subarray(6,8))}-${d2.toHex(G.subarray(8,10))}-${d2.toHex(G.subarray(10))}`};break;default:throw Error("Unrecognized header type tag")}}return D}}var mB;(function(u){u[u.boolTrue=0]="boolTrue",u[u.boolFalse=1]="boolFalse",u[u.byte=2]="byte",u[u.short=3]="short",u[u.integer=4]="integer",u[u.long=5]="long",u[u.byteArray=6]="byteArray",u[u.string=7]="string",u[u.timestamp=8]="timestamp",u[u.uuid=9]="uuid"})(mB||(mB={}));var gB="boolean",IK="byte",qK="short",mK="integer",gK="long",_K="binary",fK="string",bK="timestamp",jK="uuid",lK=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;var _B=4,r2=_B*2,G0=4,dK=r2+G0*2;function fB({byteLength:u,byteOffset:D,buffer:B}){if(u<dK)throw Error("Provided message too short to accommodate event stream message overhead");let A=new DataView(B,D,u),w=A.getUint32(0,!1);if(u!==w)throw Error("Reported message length does not match received message length");let F=A.getUint32(_B,!1),N=A.getUint32(r2,!1),G=A.getUint32(u-G0,!1),v=new N0().update(new Uint8Array(B,D,r2));if(N!==v.digest())throw Error(`The prelude checksum specified in the message (${N}) does not match the calculated CRC32 checksum (${v.digest()})`);if(v.update(new Uint8Array(B,D+r2,u-(r2+G0))),G!==v.digest())throw Error(`The message checksum (${v.digest()}) did not match the expected value of ${G}`);return{headers:new DataView(B,D+r2+G0,F),body:new Uint8Array(B,D+r2+G0+F,w-F-(r2+G0+G0))}}class E3{headerMarshaller;messageBuffer;isEndOfStream;constructor(u,D){this.headerMarshaller=new L3(u,D),this.messageBuffer=[],this.isEndOfStream=!1}feed(u){this.messageBuffer.push(this.decode(u))}endOfStream(){this.isEndOfStream=!0}getMessage(){let u=this.messageBuffer.pop(),D=this.isEndOfStream;return{getMessage(){return u},isEndOfStream(){return D}}}getAvailableMessages(){let u=this.messageBuffer;this.messageBuffer=[];let D=this.isEndOfStream;return{getMessages(){return u},isEndOfStream(){return D}}}encode({headers:u,body:D}){let B=this.headerMarshaller.format(u),A=B.byteLength+D.byteLength+16,w=new Uint8Array(A),F=new DataView(w.buffer,w.byteOffset,w.byteLength),N=new N0;return F.setUint32(0,A,!1),F.setUint32(4,B.byteLength,!1),F.setUint32(8,N.update(w.subarray(0,8)).digest(),!1),w.set(B,12),w.set(D,B.byteLength+12),F.setUint32(A-4,N.update(w.subarray(8,A-4)).digest(),!1),w}decode(u){let{headers:D,body:B}=fB(u);return{headers:this.headerMarshaller.parse(D),body:B}}formatHeaders(u){return this.headerMarshaller.format(u)}}class O3{options;constructor(u){this.options=u}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let u of this.options.inputStream)yield this.options.decoder.decode(u)}}class C3{options;constructor(u){this.options=u}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let u of this.options.messageStream)yield this.options.encoder.encode(u);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class P3{options;constructor(u){this.options=u}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let u of this.options.messageStream){let D=await this.options.deserializer(u);if(D===void 0)continue;yield D}}}class k3{options;constructor(u){this.options=u}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let u of this.options.inputStream)yield this.options.serializer(u)}}function bB(u){let D=0,B=0,A=null,w=null,F=(G)=>{if(typeof G!=="number")throw Error("Attempted to allocate an event message where size was not a number: "+G);D=G,B=4,A=new Uint8Array(G),new DataView(A.buffer).setUint32(0,G,!1)},N=async function*(){let G=u[Symbol.asyncIterator]();while(!0){let{value:v,done:z}=await G.next();if(z){if(!D)return;else if(D===B)yield A;else throw Error("Truncated event message received.");return}let Q=v.length,Z=0;while(Z<Q){if(!A){let W=Q-Z;if(!w)w=new Uint8Array(4);let Y=Math.min(4-B,W);if(w.set(v.slice(Z,Z+Y),B),B+=Y,Z+=Y,B<4)break;F(new DataView(w.buffer).getUint32(0,!1)),w=null}let J=Math.min(D-B,Q-Z);if(A.set(v.slice(Z,Z+J),B),B+=J,Z+=J,D&&D===B)yield A,A=null,D=0,B=0}}};return{[Symbol.asyncIterator]:N}}function jB(u,D){return async function(B){let{value:A}=B.headers[":message-type"];if(A==="error"){let w=Error(B.headers[":error-message"].value||"UnknownError");throw w.name=B.headers[":error-code"].value,w}else if(A==="exception"){let w=B.headers[":exception-type"].value,F={[w]:B},N=await u(F);if(N.$unknown){let G=Error(D(B.body));throw G.name=w,G}throw N[w]}else if(A==="event"){let w={[B.headers[":event-type"].value]:B},F=await u(w);if(F.$unknown)return;return F}else throw Error(`Unrecognizable event type: ${B.headers[":event-type"].value}`)}}class y3{eventStreamCodec;utfEncoder;constructor({utf8Encoder:u,utf8Decoder:D}){this.eventStreamCodec=new E3(u,D),this.utfEncoder=u}deserialize(u,D){let B=bB(u);return new P3({messageStream:new O3({inputStream:B,decoder:this.eventStreamCodec}),deserializer:jB(D,this.utfEncoder)})}serialize(u,D){return new C3({messageStream:new k3({inputStream:u,serializer:D}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as rK}from"stream";async function*lB(u){let D=!1,B=!1,A=[];u.on("error",(w)=>{if(!D)D=!0;if(w)throw w}),u.on("data",(w)=>{A.push(w)}),u.on("end",()=>{D=!0});while(!B){let w=await new Promise((F)=>setTimeout(()=>F(A.shift()),0));if(w)yield w;B=D&&A.length===0}}class V3{universalMarshaller;constructor({utf8Encoder:u,utf8Decoder:D}){this.universalMarshaller=new y3({utf8Decoder:D,utf8Encoder:u})}deserialize(u,D){let B=typeof u[Symbol.asyncIterator]==="function"?u:lB(u);return this.universalMarshaller.deserialize(B,D)}serialize(u,D){return rK.from(this.universalMarshaller.serialize(u,D))}}var dB=(u)=>new V3(u);var E1=X(ux(),1);var rB=X(iD(),1);import{Writable as iK}from"stream";class T3 extends iK{hash;constructor(u,D){super(D);this.hash=u}_write(u,D,B){try{this.hash.update(rB.toUint8Array(u))}catch(A){return B(A)}B()}}var iB=(u,D)=>{if(D.readableFlowing!==null)throw Error("Unable to calculate hash for flowing readable stream");let B=new u,A=new T3(B);return D.pipe(A),new Promise((w,F)=>{D.on("error",(N)=>{A.end(),F(N)}),A.on("error",F),A.on("finish",()=>{B.digest().then(w).catch(F)})})};var C1=X(oB(),1),Y2=X(oK(),1),P1=X(sK(),1),k1=X(k2(),1),eB=X(Dx(),1),u6=X(Bx(),1),D6=X(tK(),1);var U1=X(Y0(),1),nB=X(aK(),1);var pB=X(k2(),1),aB=X(pK(),1),c1=X(nK(),1),M1=X(iu(),1),L1=X(iD(),1);var sB=(u)=>{return{apiVersion:"2006-03-01",base64Decoder:u?.base64Decoder??c1.fromBase64,base64Encoder:u?.base64Encoder??c1.toBase64,disableHostPrefix:u?.disableHostPrefix??!1,endpointProvider:u?.endpointProvider??A1,extensions:u?.extensions??[],getAwsChunkedEncodingStream:u?.getAwsChunkedEncodingStream??M1.getAwsChunkedEncodingStream,httpAuthSchemeProvider:u?.httpAuthSchemeProvider??NB,httpAuthSchemes:u?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(D)=>D.getIdentityProvider("aws.auth#sigv4"),signer:new U1.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(D)=>D.getIdentityProvider("aws.auth#sigv4a"),signer:new U1.AwsSdkSigV4ASigner}],logger:u?.logger??new pB.NoOpLogger,protocol:u?.protocol??nB.AwsRestXmlProtocol,protocolSettings:u?.protocolSettings??{defaultNamespace:"com.amazonaws.s3",errorTypeRegistries:QB,xmlNamespace:"http://s3.amazonaws.com/doc/2006-03-01/",version:"2006-03-01",serviceTarget:"AmazonS3"},sdkStreamMixin:u?.sdkStreamMixin??M1.sdkStreamMixin,serviceId:u?.serviceId??"S3",signerConstructor:u?.signerConstructor??zu,signingEscapePath:u?.signingEscapePath??!1,urlParser:u?.urlParser??aB.parseUrl,useArnRegion:u?.useArnRegion??void 0,utf8Decoder:u?.utf8Decoder??L1.fromUtf8,utf8Encoder:u?.utf8Encoder??L1.toUtf8}};var B6=(u)=>{k1.emitWarningIfUnsupportedVersion(process.version);let D=u6.resolveDefaultsModeConfig(u),B=()=>D().then(k1.loadConfigsForDefaultMode),A=sB(u);E0.emitWarningIfUnsupportedVersion(process.version);let w={profile:u?.profile,logger:A.logger};return{...A,...u,runtime:"node",defaultsMode:D,authSchemePreference:u?.authSchemePreference??Y2.loadConfig(E0.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,w),bodyLengthChecker:u?.bodyLengthChecker??eB.calculateBodyLength,credentialDefaultProvider:u?.credentialDefaultProvider??yB,defaultUserAgentProvider:u?.defaultUserAgentProvider??O1.createDefaultUserAgentProvider({serviceId:A.serviceId,clientVersion:HB.version}),disableS3ExpressSessionAuth:u?.disableS3ExpressSessionAuth??Y2.loadConfig(aD,w),eventStreamSerdeProvider:u?.eventStreamSerdeProvider??dB,maxAttempts:u?.maxAttempts??Y2.loadConfig(C1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,u),md5:u?.md5??E1.Hash.bind(null,"md5"),region:u?.region??Y2.loadConfig(i2.NODE_REGION_CONFIG_OPTIONS,{...i2.NODE_REGION_CONFIG_FILE_OPTIONS,...w}),requestChecksumCalculation:u?.requestChecksumCalculation??Y2.loadConfig(b5,w),requestHandler:P1.NodeHttpHandler.create(u?.requestHandler??B),responseChecksumValidation:u?.responseChecksumValidation??Y2.loadConfig(j5,w),retryMode:u?.retryMode??Y2.loadConfig({...C1.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await B()).retryMode||D6.DEFAULT_RETRY_MODE},u),sha1:u?.sha1??E1.Hash.bind(null,"sha1"),sha256:u?.sha256??E1.Hash.bind(null,"sha256"),sigv4aSigningRegionSet:u?.sigv4aSigningRegionSet??Y2.loadConfig(E0.NODE_SIGV4A_CONFIG_OPTIONS,w),streamCollector:u?.streamCollector??P1.streamCollector,streamHasher:u?.streamHasher??iB,useArnRegion:u?.useArnRegion??Y2.loadConfig(VB,w),useDualstackEndpoint:u?.useDualstackEndpoint??Y2.loadConfig(i2.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,w),useFipsEndpoint:u?.useFipsEndpoint??Y2.loadConfig(i2.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,w),userAgentAppId:u?.userAgentAppId??Y2.loadConfig(O1.NODE_APP_ID_CONFIG_OPTIONS,w)}};var y1=X(Ax(),1),V1=X(m2(),1),T1=X(k2(),1);var A6=(u)=>{let{httpAuthSchemes:D,httpAuthSchemeProvider:B,credentials:A}=u;return{setHttpAuthScheme(w){let F=D.findIndex((N)=>N.schemeId===w.schemeId);if(F===-1)D.push(w);else D.splice(F,1,w)},httpAuthSchemes(){return D},setHttpAuthSchemeProvider(w){B=w},httpAuthSchemeProvider(){return B},setCredentials(w){A=w},credentials(){return A}}},w6=(u)=>{return{httpAuthSchemes:u.httpAuthSchemes(),httpAuthSchemeProvider:u.httpAuthSchemeProvider(),credentials:u.credentials()}};var F6=(u,D)=>{let B=Object.assign(y1.getAwsRegionExtensionConfiguration(u),T1.getDefaultExtensionConfiguration(u),V1.getHttpHandlerExtensionConfiguration(u),A6(u));return D.forEach((A)=>A.configure(B)),Object.assign(u,y1.resolveAwsRegionExtensionConfiguration(B),T1.resolveDefaultRuntimeConfig(B),V1.resolveHttpHandlerRuntimeConfig(B),w6(B))};class I3 extends J6.Client{config;constructor(...[u]){let D=B6(u||{});super(D);this.initConfig=D;let B=$B(D),A=q1.resolveUserAgentConfig(B),w=Q4(A),F=m1.resolveRetryConfig(w),N=$6.resolveRegionConfig(F),G=I1.resolveHostHeaderConfig(N),v=Z6.resolveEndpointConfig(G),z=n4(v),Q=GB(z),Z=b4(Q,{session:[()=>this,M3]}),J=F6(Z,u?.extensions||[]);this.config=J,this.middlewareStack.use(v6.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(q1.getUserAgentPlugin(this.config)),this.middlewareStack.use(m1.getRetryPlugin(this.config)),this.middlewareStack.use(z6.getContentLengthPlugin(this.config)),this.middlewareStack.use(I1.getHostHeaderPlugin(this.config)),this.middlewareStack.use(N6.getLoggerPlugin(this.config)),this.middlewareStack.use(G6.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(O0.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:AB,identityProviderConfigProvider:async(W)=>new O0.DefaultIdentityProviderConfig({"aws.auth#sigv4":W.credentials,"aws.auth#sigv4a":W.credentials})})),this.middlewareStack.use(O0.getHttpSigningPlugin(this.config)),this.middlewareStack.use(i4(this.config)),this.middlewareStack.use(_5(this.config)),this.middlewareStack.use(x4(this.config)),this.middlewareStack.use(sD(this.config)),this.middlewareStack.use(tD(this.config))}destroy(){super.destroy()}}function vx(u){return(D)=>async(B)=>{let A={...B.input},w=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let F of w){let N=A[F.target];if(N){let G;if(typeof N==="string")if(Zx(N,u))G=u.base64Decoder(N);else G=u.utf8Decoder(N),A[F.target]=u.base64Encoder(G);else G=ArrayBuffer.isView(N)?new Uint8Array(N.buffer,N.byteOffset,N.byteLength):new Uint8Array(N),A[F.target]=u.base64Encoder(G);let v=new u.md5;v.update(G),A[F.hash]=u.base64Encoder(await v.digest())}}return D({...B,input:A})}}var zx={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},g1=(u)=>({applyToStack:(D)=>{D.add(vx(u),zx)}});function Zx(u,D){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u))return!1;try{return D.base64Decoder(u).length===32}catch{return!1}}var Q6=X(U0(),1),W6=X(k2(),1);class q3 extends W6.Command.classBuilder().ep({...j2,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(u,D,B,A){return[Q6.getEndpointPlugin(B,u.getEndpointParameterInstructions()),pu(B,{requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC64NVME","CRC32","CRC32C","SHA256","SHA1"]}),g1(B),H4(B)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").sc(hB).build(){}var X6=X(U0(),1),Y6=X(k2(),1);class m3 extends Y6.Command.classBuilder().ep({...j2,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(u,D,B,A){return[X6.getEndpointPlugin(B,u.getEndpointParameterInstructions()),K0(B)]}).s("AmazonS3","ListObjectsV2",{}).n("S3Client","ListObjectsV2Command").sc(KB).build(){}var h6=X(U0(),1),K6=X(k2(),1);class g3 extends K6.Command.classBuilder().ep({...j2,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(u,D,B,A){return[h6.getEndpointPlugin(B,u.getEndpointParameterInstructions()),pu(B,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),Y4(B),K0(B),g1(B)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").sc(xB).build(){}import{Buffer as x6}from"buffer";class S6 extends Q0{client;constructor(...u){super();this.client=new I3(...u)}async put(u){let D,B,A,w=process.env.BUCKET_NAME;if(u instanceof Blob)D=u,A=`${Bun.randomUUIDv7()}.${u.type.split("/")[1].split(";")[0]}`,B=u.type;else D=u.body,A=u.name,w=u.bucket??w,B=u.contentType;B=D instanceof Blob||D instanceof File?D.type:void 0;let F=D instanceof x6?D:D instanceof Blob||D instanceof File?x6.from(await D.arrayBuffer()):"";return await this.client.send(new g3({Bucket:w,Key:A,Body:F,ContentType:B})),A}async list(u){return await this.client.send(new m3({Bucket:process.env.BUCKET_NAME,Prefix:u}))}async fetch(u){let D=process.env.BUCKET_NAME,B;if(typeof u==="string")B=u;else D=u.bucket??D,B=u.name;if(!B)throw Error("Object name has to be specified");let A=await this.client.send(new q3({Bucket:D,Key:B}));return new Response(A.Body.transformToWebStream(),{headers:{"Content-Type":A.ContentType,"Content-Length":A.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":A.LastModified?.toUTCString()||"",ETag:A.ETag||""}})}}class _1{}class f1 extends _1{requests=new Map;consume(u,D){if(!this.requests.has(u))this.requests.set(u,{date:Date.now(),count:1});else{let B=this.requests.get(u),A=Date.now();if(A-B.date>=60000)this.requests.set(u,{date:A,count:1});else this.requests.set(u,{date:B.date,count:B.count+1})}return this.requests.get(u).count}}class R6 extends f{driver=new f1;boot(){}}var n2=new TextEncoder;var Ku=new Uint8Array(256);for(let u=0;u<64;u++)Ku["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(u)]=u;function b1(u){let D=Math.ceil(u.length/4)*3,B=u.length,A=0;if(u.length%4===3)D--;else if(u.length%4===2)D-=2;else if(u[u.length-1]==="="){if(D--,u[u.length-2]==="=")D--}let w=new ArrayBuffer(D),F=new Uint8Array(w);for(let N=0;N<B;N+=4){let G=Ku[u.charCodeAt(N)],v=Ku[u.charCodeAt(N+1)],z=Ku[u.charCodeAt(N+2)],Q=Ku[u.charCodeAt(N+3)];F[A++]=G<<2|v>>4,F[A++]=(v&15)<<4|z>>2,F[A++]=(z&3)<<6|Q&63}return w}function C0(u){u=u||"utf8";let D;try{D=new TextDecoder(u)}catch(B){D=new TextDecoder("windows-1252")}return D}async function p2(u){if("arrayBuffer"in u)return await u.arrayBuffer();let D=new FileReader;return new Promise((B,A)=>{D.onload=function(w){B(w.target.result)},D.onerror=function(w){A(D.error)},D.readAsArrayBuffer(u)})}function H6(u){if(u>=48&&u<=57||u>=97&&u<=102||u>=65&&u<=70)return String.fromCharCode(u);return!1}function Jx(u,D,B){let A=u.indexOf("*");if(A>=0)u=u.substr(0,A);D=D.toUpperCase();let w;if(D==="Q"){B=B.replace(/=\s+([0-9a-fA-F])/g,"=$1").replace(/[_\s]/g," ");let F=n2.encode(B),N=[];for(let v=0,z=F.length;v<z;v++){let Q=F[v];if(v<=z-2&&Q===61){let Z=H6(F[v+1]),J=H6(F[v+2]);if(Z&&J){let W=parseInt(Z+J,16);N.push(W),v+=2;continue}}N.push(Q)}w=new ArrayBuffer(N.length);let G=new DataView(w);for(let v=0,z=N.length;v<z;v++)G.setUint8(v,N[v])}else if(D==="B")w=b1(B.replace(/[^a-zA-Z0-9\+\/=]+/g,""));else w=n2.encode(B);return C0(u).decode(w)}function $0(u){let D=!0,B=!1;while(!B){let A=(u||"").toString().replace(/(=\?([^?]+)\?[Bb]\?([^?]*)\?=)\s*(?==\?([^?]+)\?[Bb]\?[^?]*\?=)/g,(w,F,N,G,v)=>{if(!D)return w;if(N===v&&G.length%4===0&&!/=$/.test(G))return F+"__\x00JOIN\x00__";return w}).replace(/(=\?([^?]+)\?[Qq]\?[^?]*\?=)\s*(?==\?([^?]+)\?[Qq]\?[^?]*\?=)/g,(w,F,N,G)=>{if(!D)return w;if(N===G)return F+"__\x00JOIN\x00__";return w}).replace(/(\?=)?__\x00JOIN\x00__(=\?([^?]+)\?[QqBb]\?)?/g,"").replace(/(=\?[^?]+\?[QqBb]\?[^?]*\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g,"$1").replace(/=\?([\w_\-*]+)\?([QqBb])\?([^?]*)\?=/g,(w,F,N,G)=>Jx(F,N,G));if(D&&A.indexOf("\uFFFD")>=0)D=!1;else return A}}function Qx(u,D){D=D||"utf-8";let B=[];for(let F=0;F<u.length;F++){let N=u.charAt(F);if(N==="%"&&/^[a-f0-9]{2}/i.test(u.substr(F+1,2))){let G=u.substr(F+1,2);F+=2,B.push(parseInt(G,16))}else if(N.charCodeAt(0)>126){N=n2.encode(N);for(let G=0;G<N.length;G++)B.push(N[G])}else B.push(N.charCodeAt(0))}let A=new ArrayBuffer(B.length),w=new DataView(A);for(let F=0,N=B.length;F<N;F++)w.setUint8(F,B[F]);return C0(D).decode(A)}function U6(u){let D=new Map;Object.keys(u.params).forEach((B)=>{let A=B.match(/\*((\d+)\*?)?$/);if(!A)return;let w=B.substr(0,A.index).toLowerCase(),F=Number(A[2])||0,N;if(!D.has(w))N={charset:!1,values:[]},D.set(w,N);else N=D.get(w);let G=u.params[B];if(F===0&&A[0].charAt(A[0].length-1)==="*"&&(A=G.match(/^([^']*)'[^']*'(.*)$/)))N.charset=A[1]||"utf-8",G=A[2];N.values.push({nr:F,value:G}),delete u.params[B]}),D.forEach((B,A)=>{u.params[A]=Qx(B.values.sort((w,F)=>w.nr-F.nr).map((w)=>w.value).join(""),B.charset)})}class j1{constructor(){this.chunks=[]}update(u){this.chunks.push(u),this.chunks.push(`
|
|
13
13
|
`)}finalize(){return p2(new Blob(this.chunks,{type:"application/octet-stream"}))}}class l1{constructor(u){u=u||{},this.decoder=u.decoder||new TextDecoder,this.maxChunkSize=102400,this.chunks=[],this.remainder=""}update(u){let D=this.decoder.decode(u);if(D=D.replace(/[^a-zA-Z0-9+\/]+/g,""),this.remainder+=D,this.remainder.length>=this.maxChunkSize){let B=Math.floor(this.remainder.length/4)*4,A;if(B===this.remainder.length)A=this.remainder,this.remainder="";else A=this.remainder.substr(0,B),this.remainder=this.remainder.substr(B);if(A.length)this.chunks.push(b1(A))}}finalize(){if(this.remainder&&!/^=+$/.test(this.remainder))this.chunks.push(b1(this.remainder));return p2(new Blob(this.chunks,{type:"application/octet-stream"}))}}var c6=/^=[a-f0-9]{2}$/i,Wx=/(?==[a-f0-9]{2})/i,Xx=/=\r?\n/g,Yx=/=[a-fA-F0-9]?$/;class d1{constructor(u){u=u||{},this.decoder=u.decoder||new TextDecoder,this.maxChunkSize=102400,this.remainder="",this.chunks=[]}decodeQPBytes(u){let D=new ArrayBuffer(u.length),B=new DataView(D);for(let A=0,w=u.length;A<w;A++)B.setUint8(A,parseInt(u[A],16));return D}decodeChunks(u){u=u.replace(Xx,"");let D=u.split(Wx),B=[];for(let A of D){if(A.charAt(0)!=="="){if(B.length)this.chunks.push(this.decodeQPBytes(B)),B=[];this.chunks.push(A);continue}if(A.length===3){if(c6.test(A))B.push(A.substr(1));else{if(B.length)this.chunks.push(this.decodeQPBytes(B)),B=[];this.chunks.push(A)}continue}if(A.length>3){let w=A.substr(0,3);if(c6.test(w))B.push(A.substr(1,2)),this.chunks.push(this.decodeQPBytes(B)),B=[],A=A.substr(3),this.chunks.push(A);else{if(B.length)this.chunks.push(this.decodeQPBytes(B)),B=[];this.chunks.push(A)}}}if(B.length)this.chunks.push(this.decodeQPBytes(B))}update(u){let D=this.decoder.decode(u)+`
|
|
14
14
|
`;if(D=this.remainder+D,D.length<this.maxChunkSize){this.remainder=D;return}this.remainder="";let B=D.match(Yx);if(B){if(B.index===0){this.remainder=D;return}this.remainder=D.substr(B.index),D=D.substr(0,B.index)}this.decodeChunks(D)}finalize(){if(this.remainder.length)this.decodeChunks(this.remainder),this.remainder="";return p2(new Blob(this.chunks,{type:"application/octet-stream"}))}}var hx=C0();class xu{constructor(u){if(this.options=u||{},this.postalMime=this.options.postalMime,this.root=!!this.options.parentNode,this.childNodes=[],this.options.parentNode){if(this.parentNode=this.options.parentNode,this.depth=this.parentNode.depth+1,this.depth>this.options.maxNestingDepth)throw Error(`Maximum MIME nesting depth of ${this.options.maxNestingDepth} levels exceeded`);this.options.parentNode.childNodes.push(this)}else this.depth=0;this.state="header",this.headerLines=[],this.headerSize=0;let B=(this.options.parentMultipartType||null)==="digest"?"message/rfc822":"text/plain";this.contentType={value:B,default:!0},this.contentTransferEncoding={value:"8bit"},this.contentDisposition={value:""},this.headers=[],this.contentDecoder=!1}setupContentDecoder(u){if(/base64/i.test(u))this.contentDecoder=new l1;else if(/quoted-printable/i.test(u))this.contentDecoder=new d1({decoder:C0(this.contentType.parsed.params.charset)});else this.contentDecoder=new j1}async finalize(){if(this.state==="finished")return;if(this.state==="header")this.processHeaders();let u=this.postalMime.boundaries;for(let D=u.length-1;D>=0;D--)if(u[D].node===this){u.splice(D,1);break}await this.finalizeChildNodes(),this.content=this.contentDecoder?await this.contentDecoder.finalize():null,this.state="finished"}async finalizeChildNodes(){for(let u of this.childNodes)await u.finalize()}stripComments(u){let D="",B=0,A=!1,w=!1;for(let F=0;F<u.length;F++){let N=u.charAt(F);if(A){if(B===0)D+=N;A=!1;continue}if(N==="\\"){if(A=!0,B===0)D+=N;continue}if(N==='"'&&B===0){w=!w,D+=N;continue}if(!w){if(N==="("){B++;continue}if(N===")"&&B>0){B--;continue}}if(B===0)D+=N}return D}parseStructuredHeader(u){u=this.stripComments(u);let D={value:!1,params:{}},B=!1,A="",w="value",F=!1,N=!1,G;for(let v=0,z=u.length;v<z;v++)switch(G=u.charAt(v),w){case"key":if(G==="="){B=A.trim().toLowerCase(),w="value",A="";break}A+=G;break;case"value":if(N)A+=G;else if(G==="\\"){N=!0;continue}else if(F&&G===F)F=!1;else if(!F&&G==='"')F=G;else if(!F&&G===";"){if(B===!1)D.value=A.trim();else D.params[B]=A.trim();w="key",A=""}else A+=G;N=!1;break}if(A=A.trim(),w==="value")if(B===!1)D.value=A;else D.params[B]=A;else if(A)D.params[A.toLowerCase()]="";if(D.value)D.value=D.value.toLowerCase();return U6(D),D}decodeFlowedText(u,D){return u.split(/\r?\n/).reduce((B,A)=>{if(B.endsWith(" ")&&B!=="-- "&&!B.endsWith(`
|
|
15
15
|
-- `))if(D)return B.slice(0,-1)+A;else return B+A;else return B+`
|
|
@@ -43,6 +43,6 @@ ${u.resolution}.`;console.warn(B),console.warn("To disable this message, import
|
|
|
43
43
|
`)return this.emit(c.DataKeepAlive);this.parser.push(D.toString())}),this.resetKeepAliveTimeout()}initEventsFromParser(){let u=this.requestData.payloadIsError;this.parser.on(Z0.ParsedData,(D)=>{if(u&&u(D))this.emit(c.DataError,D),this.emit(c.Error,{type:c.DataError,error:D,message:"Twitter sent a payload that is detected as an error payload."});else this.emit(c.Data,D)}),this.parser.on(Z0.ParseError,(D)=>{this.emit(c.TweetParseError,D),this.emit(c.Error,{type:c.TweetParseError,error:D,message:"Failed to parse stream data."})})}resetKeepAliveTimeout(){if(this.unbindKeepAliveTimeout(),this.keepAliveTimeoutMs!==1/0)this.keepAliveTimeout=setTimeout(this.onKeepAliveTimeout,this.keepAliveTimeoutMs)}onKeepAliveTimeout(){this.emit(c.ConnectionLost),this.onConnectionError()}unbindTimeouts(){this.unbindRetryTimeout(),this.unbindKeepAliveTimeout()}unbindKeepAliveTimeout(){if(this.keepAliveTimeout)clearTimeout(this.keepAliveTimeout),this.keepAliveTimeout=void 0}unbindRetryTimeout(){if(this.retryTimeout)clearTimeout(this.retryTimeout),this.retryTimeout=void 0}closeWithoutEmit(){if(this.unbindTimeouts(),this.res)this.res.removeAllListeners(),this.res.destroy();if(this.req)this.req.removeAllListeners(),this.req.destroy()}close(){this.emit(c.ConnectionClosed),this.closeWithoutEmit()}destroy(){this.removeAllListeners(),this.close()}async clone(){let D=await new yu(this.requestData).makeRequestAsStream(),B=this.eventNames();for(let A of B){let w=this.listeners(A);for(let F of w)D.on(A,F)}return D}async connect(u={}){if(typeof u.autoReconnect<"u")this.autoReconnect=u.autoReconnect;if(typeof u.autoReconnectRetries<"u")this.autoReconnectRetries=u.autoReconnectRetries==="unlimited"?1/0:u.autoReconnectRetries;if(typeof u.keepAliveTimeout<"u")this.keepAliveTimeoutMs=u.keepAliveTimeout==="disable"?1/0:u.keepAliveTimeout;if(typeof u.nextRetryTimeout<"u")this.nextRetryTimeout=u.nextRetryTimeout;this.unbindTimeouts();try{await this.reconnect()}catch(D){if(this.emit(c.ConnectError,0),this.emit(c.Error,{type:c.ConnectError,error:D,message:"Connect error - Initial connection just failed."}),this.autoReconnect)this.makeAutoReconnectRetry(0,D);else throw D}return this}async reconnect(){if(this.connectionProcessRunning)throw Error("Connection process is already running.");this.connectionProcessRunning=!0;try{let u=!0;if(this.req)u=!1,this.closeWithoutEmit();let{req:D,res:B,originalResponse:A}=await new yu(this.requestData).makeRequestAndResolveWhenReady();this.req=D,this.res=B,this.originalResponse=A,this.emit(u?c.Connected:c.Reconnected),this.parser.reset(),this.initEventsFromRequest()}finally{this.connectionProcessRunning=!1}}async onConnectionError(u=0){if(this.unbindTimeouts(),this.closeWithoutEmit(),!this.autoReconnect){this.emit(c.ConnectionClosed);return}if(u>=this.autoReconnectRetries){this.emit(c.ReconnectLimitExceeded),this.emit(c.ConnectionClosed);return}try{this.emit(c.ReconnectAttempt,u),await this.reconnect()}catch(D){this.emit(c.ReconnectError,u),this.emit(c.Error,{type:c.ReconnectError,error:D,message:`Reconnect error - ${u+1} attempts made yet.`}),this.makeAutoReconnectRetry(u,D)}}makeAutoReconnectRetry(u,D){let B=this.nextRetryTimeout(u+1,D);this.retryTimeout=setTimeout(()=>{this.onConnectionError(u+1)},B)}async*[Symbol.asyncIterator](){let u=new EY(this);try{while(!0){if(!this.req||this.req.aborted)throw Error("Connection closed");if(u.hasStack())yield*u.popStack();let{type:D,payload:B}=await u.nextEvent();if(D==="error")throw B}}finally{u.destroy()}}}var YD=CY;function PY(u){var D;if(!((D=u.clientSettings.plugins)===null||D===void 0?void 0:D.length))return!1;for(let B of u.clientSettings.plugins)if(B.onRequestError||B.onResponseError)return!0;return!1}async function kY(u,D,B,A){let w;if(A instanceof Eu||A instanceof Ou)w=await this.applyPluginMethod("onRequestError",{client:this,url:this.getUrlObjectFromUrlString(u.url),params:u,computedParams:D,requestOptions:B,error:A});else if(A instanceof Cu)w=await this.applyPluginMethod("onResponseError",{client:this,url:this.getUrlObjectFromUrlString(u.url),params:u,computedParams:D,requestOptions:B,error:A});if(w&&w instanceof Pu)return w.value;return Promise.reject(A)}import*as TY from"crypto";class y2{constructor(u){this.nonceLength=32,this.consumerKeys=u.consumerKeys}static percentEncode(u){return encodeURIComponent(u).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")}hash(u,D){return TY.createHmac("sha1",D).update(u).digest("base64")}authorize(u,D={}){let B={oauth_consumer_key:this.consumerKeys.key,oauth_nonce:this.getNonce(),oauth_signature_method:"HMAC-SHA1",oauth_timestamp:this.getTimestamp(),oauth_version:"1.0"};if(D.key!==void 0)B.oauth_token=D.key;if(!u.data)u.data={};return B.oauth_signature=this.getSignature(u,D.secret,B),B}toHeader(u){let D=VY(u),B="OAuth ";for(let A of D){if(A.key.indexOf("oauth_")!==0)continue;B+=y2.percentEncode(A.key)+'="'+y2.percentEncode(A.value)+'",'}return{Authorization:B.slice(0,B.length-1)}}getNonce(){let D="";for(let B=0;B<this.nonceLength;B++)D+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.trunc(Math.random()*62)];return D}getTimestamp(){return Math.trunc(new Date().getTime()/1000)}getSignature(u,D,B){return this.hash(this.getBaseString(u,B),this.getSigningKey(D))}getSigningKey(u){return y2.percentEncode(this.consumerKeys.secret)+"&"+y2.percentEncode(u||"")}getBaseString(u,D){return u.method.toUpperCase()+"&"+y2.percentEncode(this.getBaseUrl(u.url))+"&"+y2.percentEncode(this.getParameterString(u,D))}getParameterString(u,D){let B=VY(QU(yY(D,yY(u.data,JU(u.url))))),A="";for(let{key:w,value:F}of B)if(F&&Array.isArray(F)){F.sort();let N="";F.forEach((G,v)=>{if(N+=w+"="+G,v<F.length)N+="&"}),A+=N}else A+=w+"="+F+"&";return A.slice(0,A.length-1)}getBaseUrl(u){return u.split("?")[0]}}var Vu=y2;function yY(u,D){return{...u||{},...D||{}}}function VY(u){return Object.keys(u).sort().map((D)=>({key:D,value:u[D]}))}function ZU(u){let D=u.split("&"),B={};for(let A of D){let[w,F=""]=A.split("=");if(B[w]){if(!Array.isArray(B[w]))B[w]=[B[w]];B[w].push(decodeURIComponent(F))}else B[w]=decodeURIComponent(F)}return B}function JU(u){let D=u.split("?");if(D.length===1)return{};return ZU(D[1])}function QU(u){let D={};for(let B in u){let A=u[B];if(A&&Array.isArray(A))A=A.map((w)=>y2.percentEncode(w));else A=y2.percentEncode(A);D[y2.percentEncode(B)]=A}return D}class V2{constructor(){this._boundary="",this._chunks=[]}bodyAppend(...u){let D=u.map((B)=>B instanceof Buffer?B:Buffer.from(B));this._chunks.push(...D)}append(u,D,B){let A=D instanceof Buffer?D:D.toString(),w=this.getMultipartHeader(u,A,B);this.bodyAppend(w,A,V2.LINE_BREAK)}getHeaders(){return{"content-type":"multipart/form-data; boundary="+this.getBoundary()}}getLength(){return this._chunks.reduce((u,D)=>u+D.length,this.getMultipartFooter().length)}getBuffer(){let u=[...this._chunks,this.getMultipartFooter()],D=Buffer.alloc(this.getLength()),B=0;for(let A of u)for(let w=0;w<A.length;B++,w++)D[B]=A[w];return D}getBoundary(){if(!this._boundary)this.generateBoundary();return this._boundary}generateBoundary(){let u="--------------------------";for(let D=0;D<24;D++)u+=Math.floor(Math.random()*10).toString(16);this._boundary=u}getMultipartHeader(u,D,B){if(!B)B=D instanceof Buffer?V2.DEFAULT_CONTENT_TYPE:"";let A={"Content-Disposition":["form-data",`name="${u}"`],"Content-Type":B},w="";for(let[F,N]of Object.entries(A)){if(!N.length)continue;w+=F+": "+WD(N).join("; ")+V2.LINE_BREAK}return"--"+this.getBoundary()+V2.LINE_BREAK+w+V2.LINE_BREAK}getMultipartFooter(){if(this._footerChunk)return this._footerChunk;return this._footerChunk=Buffer.from("--"+this.getBoundary()+"--"+V2.LINE_BREAK)}}V2.LINE_BREAK=`\r
|
|
44
44
|
`;V2.DEFAULT_CONTENT_TYPE="application/octet-stream";class f8{static formatQueryToString(u){let D={};for(let B in u)if(typeof u[B]==="string")D[B]=u[B];else if(typeof u[B]<"u")D[B]=String(u[B]);return D}static autoDetectBodyType(u){if(u.pathname.startsWith("/2/")||u.pathname.startsWith("/labs/2/")){if(u.password.startsWith("/2/oauth2"))return"url";return"json"}if(u.hostname==="upload.x.com"){if(u.pathname==="/1.1/media/upload.json")return"form-data";return"json"}let D=u.pathname.split("/1.1/",2)[1];if(this.JSON_1_1_ENDPOINTS.has(D))return"json";return"url"}static addQueryParamsToUrl(u,D){let B=Object.entries(D);if(B.length){let A="";for(let[w,F]of B)A+=(A.length?"&":"?")+`${Vu.percentEncode(w)}=${Vu.percentEncode(F)}`;u.search=A}}static constructBodyParams(u,D,B){if(u instanceof Buffer)return u;if(B==="json"){if(!D["content-type"])D["content-type"]="application/json;charset=UTF-8";return JSON.stringify(u)}else if(B==="url"){if(!D["content-type"])D["content-type"]="application/x-www-form-urlencoded;charset=UTF-8";if(Object.keys(u).length)return new URLSearchParams(u).toString().replace(/\*/g,"%2A");return""}else if(B==="raw")throw Error("You can only use raw body mode with Buffers. To give a string, use Buffer.from(str).");else{let A=new V2;for(let w in u)A.append(w,u[w]);if(!D["content-type"]){let w=A.getHeaders();D["content-type"]=w["content-type"]}return A.getBuffer()}}static setBodyLengthHeader(u,D){var B;if(u.headers=(B=u.headers)!==null&&B!==void 0?B:{},typeof D==="string")u.headers["content-length"]=Buffer.byteLength(D);else u.headers["content-length"]=D.length}static isOAuthSerializable(u){return!(u instanceof Buffer)}static mergeQueryAndBodyForOAuth(u,D){let B={};for(let A in u)B[A]=u[A];if(this.isOAuthSerializable(D))for(let A in D){let w=D[A];if(this.isOAuthSerializable(w))B[A]=typeof w==="object"&&w!==null&&"toString"in w?w.toString():w}return B}static moveUrlQueryParamsIntoObject(u,D){for(let[B,A]of u.searchParams)D[B]=A;return u.search="",u}static applyRequestParametersToUrl(u,D){return u.pathname=u.pathname.replace(/:([A-Z_-]+)/ig,(B,A)=>{if(D[A]!==void 0)return String(D[A]);return B}),u}}f8.JSON_1_1_ENDPOINTS=new Set(["direct_messages/events/new.json","direct_messages/welcome_messages/new.json","direct_messages/welcome_messages/rules/new.json","media/metadata/create.json","collections/entries/curate.json"]);var C2=f8;import*as IY from"crypto";class J0{static getCodeVerifier(){return this.generateRandomString(128)}static getCodeChallengeFromVerifier(u){return this.escapeBase64Url(IY.createHash("sha256").update(u).digest("base64"))}static getAuthHeader(u,D){let B=encodeURIComponent(u)+":"+encodeURIComponent(D);return Buffer.from(B).toString("base64")}static generateRandomString(u){let D="",B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~";for(let A=0;A<u;A++)D+=B[Math.floor(Math.random()*B.length)];return D}static escapeBase64Url(u){return u.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}}class l0{constructor(u){if(this.rateLimits={},this.clientSettings={},u)this.clientSettings=u}getRateLimits(){return this.rateLimits}saveRateLimit(u,D){this.rateLimits[u]=D}async send(u){var D,B,A,w,F;if((D=this.clientSettings.plugins)===null||D===void 0?void 0:D.length){let Z=await this.applyPreRequestConfigHooks(u);if(Z)return Z}let N=this.getHttpRequestArgs(u),G={method:N.method,headers:N.headers,timeout:u.timeout,agent:this.clientSettings.httpAgent},v=u.enableRateLimitSave!==!1;if(N.body)C2.setBodyLengthHeader(G,N.body);if((B=this.clientSettings.plugins)===null||B===void 0?void 0:B.length)await this.applyPreRequestHooks(u,N,G);let z=new yu({url:N.url,options:G,body:N.body,rateLimitSaver:v?this.saveRateLimit.bind(this,N.rawUrl):void 0,requestEventDebugHandler:u.requestEventDebugHandler,compression:(w=(A=u.compression)!==null&&A!==void 0?A:this.clientSettings.compression)!==null&&w!==void 0?w:!0,forceParseMode:u.forceParseMode}).makeRequest();if(PY(this))z=this.applyResponseErrorHooks(u,N,G,z);let Q=await z;if((F=this.clientSettings.plugins)===null||F===void 0?void 0:F.length){let Z=await this.applyPostRequestHooks(u,N,G,Q);if(Z)return Z.value}return Q}sendStream(u){var D,B;if(this.clientSettings.plugins)this.applyPreStreamRequestConfigHooks(u);let A=this.getHttpRequestArgs(u),w={method:A.method,headers:A.headers,agent:this.clientSettings.httpAgent},F=u.enableRateLimitSave!==!1,N=u.autoConnect!==!1;if(A.body)C2.setBodyLengthHeader(w,A.body);let G={url:A.url,options:w,body:A.body,rateLimitSaver:F?this.saveRateLimit.bind(this,A.rawUrl):void 0,payloadIsError:u.payloadIsError,compression:(B=(D=u.compression)!==null&&D!==void 0?D:this.clientSettings.compression)!==null&&B!==void 0?B:!0},v=new YD(G);if(!N)return v;return v.connect()}initializeToken(u){if(typeof u==="string")this.bearerToken=u;else if(typeof u==="object"&&"appKey"in u){if(this.consumerToken=u.appKey,this.consumerSecret=u.appSecret,u.accessToken&&u.accessSecret)this.accessToken=u.accessToken,this.accessSecret=u.accessSecret;this._oauth=this.buildOAuth()}else if(typeof u==="object"&&"username"in u){let D=encodeURIComponent(u.username)+":"+encodeURIComponent(u.password);this.basicToken=Buffer.from(D).toString("base64")}else if(typeof u==="object"&&"clientId"in u)this.clientId=u.clientId,this.clientSecret=u.clientSecret}getActiveTokens(){if(this.bearerToken)return{type:"oauth2",bearerToken:this.bearerToken};else if(this.basicToken)return{type:"basic",token:this.basicToken};else if(this.consumerSecret&&this._oauth)return{type:"oauth-1.0a",appKey:this.consumerToken,appSecret:this.consumerSecret,accessToken:this.accessToken,accessSecret:this.accessSecret};else if(this.clientId)return{type:"oauth2-user",clientId:this.clientId};return{type:"none"}}buildOAuth(){if(!this.consumerSecret||!this.consumerToken)throw Error("Invalid consumer tokens");return new Vu({consumerKeys:{key:this.consumerToken,secret:this.consumerSecret}})}getOAuthAccessTokens(){if(!this.accessSecret||!this.accessToken)return;return{key:this.accessToken,secret:this.accessSecret}}getPlugins(){var u;return(u=this.clientSettings.plugins)!==null&&u!==void 0?u:[]}hasPlugins(){var u;return!!((u=this.clientSettings.plugins)===null||u===void 0?void 0:u.length)}async applyPluginMethod(u,D){var B;let A;for(let w of this.getPlugins()){let F=await((B=w[u])===null||B===void 0?void 0:B.call(w,D));if(F&&F instanceof Pu)A=F}return A}writeAuthHeaders({headers:u,bodyInSignature:D,url:B,method:A,query:w,body:F}){if(u={...u},this.bearerToken)u.Authorization="Bearer "+this.bearerToken;else if(this.basicToken)u.Authorization="Basic "+this.basicToken;else if(this.clientId&&this.clientSecret)u.Authorization="Basic "+J0.getAuthHeader(this.clientId,this.clientSecret);else if(this.consumerSecret&&this._oauth){let N=D?C2.mergeQueryAndBodyForOAuth(w,F):w,G=this._oauth.authorize({url:B.toString(),method:A,data:N},this.getOAuthAccessTokens());u={...u,...this._oauth.toHeader(G)}}return u}getUrlObjectFromUrlString(u){if(!u.startsWith("http"))u="https://"+u;return new URL(u)}getHttpRequestArgs({url:u,method:D,query:B={},body:A={},headers:w,forceBodyMode:F,enableAuth:N,params:G}){let v=void 0;if(D=D.toUpperCase(),w=w!==null&&w!==void 0?w:{},!w["x-user-agent"])w["x-user-agent"]="Node.twitter-api-v2";let z=this.getUrlObjectFromUrlString(u),Q=z.origin+z.pathname;if(G)C2.applyRequestParametersToUrl(z,G);let Z=C2.formatQueryToString(B);if(C2.moveUrlQueryParamsIntoObject(z,Z),!(A instanceof Buffer))cY(A);let J=F!==null&&F!==void 0?F:C2.autoDetectBodyType(z);if(N!==!1){let W=l0.BODY_METHODS.has(D)&&J==="url";w=this.writeAuthHeaders({headers:w,bodyInSignature:W,method:D,query:Z,url:z,body:A})}if(l0.BODY_METHODS.has(D))v=C2.constructBodyParams(A,w,J)||void 0;return C2.addQueryParamsToUrl(z,Z),{rawUrl:Q,url:z,method:D,headers:w,body:v}}async applyPreRequestConfigHooks(u){var D;let B=this.getUrlObjectFromUrlString(u.url);for(let A of this.getPlugins()){let w=await((D=A.onBeforeRequestConfig)===null||D===void 0?void 0:D.call(A,{client:this,url:B,params:u}));if(w)return w}}applyPreStreamRequestConfigHooks(u){var D;let B=this.getUrlObjectFromUrlString(u.url);for(let A of this.getPlugins())(D=A.onBeforeStreamRequestConfig)===null||D===void 0||D.call(A,{client:this,url:B,params:u})}async applyPreRequestHooks(u,D,B){await this.applyPluginMethod("onBeforeRequest",{client:this,url:this.getUrlObjectFromUrlString(u.url),params:u,computedParams:D,requestOptions:B})}async applyPostRequestHooks(u,D,B,A){return await this.applyPluginMethod("onAfterRequest",{client:this,url:this.getUrlObjectFromUrlString(u.url),params:u,computedParams:D,requestOptions:B,response:A})}applyResponseErrorHooks(u,D,B,A){return A.catch(kY.bind(this,u,D,B))}}l0.BODY_METHODS=new Set(["POST","PUT","PATCH"]);class D0{constructor(u,D={}){if(this._currentUser=null,this._currentUserV2=null,u instanceof D0)this._requestMaker=u._requestMaker;else this._requestMaker=new l0(D),this._requestMaker.initializeToken(u)}setPrefix(u){this._prefix=u}cloneWithPrefix(u){let D=this.constructor(this);return D.setPrefix(u),D}getActiveTokens(){return this._requestMaker.getActiveTokens()}getPlugins(){return this._requestMaker.getPlugins()}getPluginOfType(u){return this.getPlugins().find((D)=>D instanceof u)}hasHitRateLimit(u){var D;if(this.isRateLimitStatusObsolete(u))return!1;return((D=this.getLastRateLimitStatus(u))===null||D===void 0?void 0:D.remaining)===0}isRateLimitStatusObsolete(u){let D=this.getLastRateLimitStatus(u);if(D===void 0)return!0;return D.reset*1000<Date.now()}getLastRateLimitStatus(u){let D=u.match(/^https?:\/\//)?u:this._prefix+u;return this._requestMaker.getRateLimits()[D]}getCurrentUserObject(u=!1){if(!u&&this._currentUser){if(this._currentUser.value)return Promise.resolve(this._currentUser.value);return this._currentUser.promise}return this._currentUser=g8(()=>this.get("account/verify_credentials.json",{tweet_mode:"extended"},{prefix:e2})),this._currentUser.promise}getCurrentUserV2Object(u=!1){if(!u&&this._currentUserV2){if(this._currentUserV2.value)return Promise.resolve(this._currentUserV2.value);return this._currentUserV2.promise}return this._currentUserV2=g8(()=>this.get("users/me",void 0,{prefix:o2})),this._currentUserV2.promise}async get(u,D={},{fullResponse:B,prefix:A=this._prefix,...w}={}){if(A)u=A+u;let F=await this._requestMaker.send({url:u,method:"GET",query:D,...w});return B?F:F.data}async delete(u,D={},{fullResponse:B,prefix:A=this._prefix,...w}={}){if(A)u=A+u;let F=await this._requestMaker.send({url:u,method:"DELETE",query:D,...w});return B?F:F.data}async post(u,D,{fullResponse:B,prefix:A=this._prefix,...w}={}){if(A)u=A+u;let F=await this._requestMaker.send({url:u,method:"POST",body:D,...w});return B?F:F.data}async put(u,D,{fullResponse:B,prefix:A=this._prefix,...w}={}){if(A)u=A+u;let F=await this._requestMaker.send({url:u,method:"PUT",body:D,...w});return B?F:F.data}async patch(u,D,{fullResponse:B,prefix:A=this._prefix,...w}={}){if(A)u=A+u;let F=await this._requestMaker.send({url:u,method:"PATCH",body:D,...w});return B?F:F.data}getStream(u,D,{prefix:B=this._prefix,...A}={}){return this._requestMaker.sendStream({url:B?B+u:u,method:"GET",query:D,...A})}postStream(u,D,{prefix:B=this._prefix,...A}={}){return this._requestMaker.sendStream({url:B?B+u:u,method:"POST",body:D,...A})}}class P2 extends D0{constructor(u){if(!(u instanceof D0))throw Error("You must instance SubTwitterApi instance from existing TwitterApi instance.");super(u)}}class d0 extends j0{constructor(){super(...arguments);this.hasFinishedFetch=!1}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.push(...B),this.hasFinishedFetch=B.length===0}getNextQueryParams(u){let D=BigInt(this._realData[this._realData.length-1].id_str);return{...this.injectQueryParams(u),max_id:(D-BigInt(1)).toString()}}getPageLengthFromRequest(u){return u.data.length}isFetchLastOver(u){return!u.data.length}canFetchNextPage(u){return u.length>0}getItemArray(){return this.tweets}get tweets(){return this._realData}get done(){return super.done||this.hasFinishedFetch}}class b8 extends d0{constructor(){super(...arguments);this._endpoint="statuses/home_timeline.json"}}class j8 extends d0{constructor(){super(...arguments);this._endpoint="statuses/mentions_timeline.json"}}class KD extends d0{constructor(){super(...arguments);this._endpoint="statuses/user_timeline.json"}}class l8 extends d0{constructor(){super(...arguments);this._endpoint="lists/statuses.json"}}class xD extends d0{constructor(){super(...arguments);this._endpoint="favorites/list.json"}}class d8 extends w2{constructor(){super(...arguments);this._endpoint="mutes/users/list.json"}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.users.push(...B.users),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.users.length}getItemArray(){return this.users}get users(){return this._realData.users}}class r8 extends w2{constructor(){super(...arguments);this._endpoint="mutes/users/ids.json",this._maxResultsWhenFetchLast=5000}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.ids.push(...B.ids),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.ids.length}getItemArray(){return this.ids}get ids(){return this._realData.ids}}class i8 extends w2{constructor(){super(...arguments);this._endpoint="followers/list.json"}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.users.push(...B.users),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.users.length}getItemArray(){return this.users}get users(){return this._realData.users}}class n8 extends w2{constructor(){super(...arguments);this._endpoint="followers/ids.json",this._maxResultsWhenFetchLast=5000}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.ids.push(...B.ids),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.ids.length}getItemArray(){return this.ids}get ids(){return this._realData.ids}}class p8 extends w2{constructor(){super(...arguments);this._endpoint="friends/list.json"}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.users.push(...B.users),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.users.length}getItemArray(){return this.users}get users(){return this._realData.users}}class a8 extends w2{constructor(){super(...arguments);this._endpoint="friends/ids.json",this._maxResultsWhenFetchLast=5000}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.ids.push(...B.ids),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.ids.length}getItemArray(){return this.ids}get ids(){return this._realData.ids}}class s8 extends j0{constructor(){super(...arguments);this._endpoint="users/search.json"}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.push(...B)}getNextQueryParams(u){var D;let B=Number((D=this._queryParams.page)!==null&&D!==void 0?D:"1");return{...this._queryParams,page:B+1,...u?{count:u}:{}}}getPageLengthFromRequest(u){return u.data.length}isFetchLastOver(u){return!u.data.length}canFetchNextPage(u){return u.length>0}getItemArray(){return this.users}get users(){return this._realData}}class SD extends w2{constructor(){super(...arguments);this._endpoint="friendships/incoming.json",this._maxResultsWhenFetchLast=5000}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.ids.push(...B.ids),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.ids.length}getItemArray(){return this.ids}get ids(){return this._realData.ids}}class t8 extends SD{constructor(){super(...arguments);this._endpoint="friendships/outgoing.json"}}class RD extends w2{refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.lists.push(...B.lists),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.lists.length}getItemArray(){return this.lists}get lists(){return this._realData.lists}}class o8 extends RD{constructor(){super(...arguments);this._endpoint="lists/memberships.json"}}class e8 extends RD{constructor(){super(...arguments);this._endpoint="lists/ownerships.json"}}class u5 extends RD{constructor(){super(...arguments);this._endpoint="lists/subscriptions.json"}}class D5 extends w2{refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.users.push(...B.users),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.users.length}getItemArray(){return this.users}get users(){return this._realData.users}}class B5 extends D5{constructor(){super(...arguments);this._endpoint="lists/members.json"}}class A5 extends D5{constructor(){super(...arguments);this._endpoint="lists/subscribers.json"}}class r0 extends P2{constructor(){super(...arguments);this._prefix=e2}singleTweet(u,D={}){return this.get("statuses/show.json",{tweet_mode:"extended",id:u,...D})}tweets(u,D={}){return this.post("statuses/lookup.json",{tweet_mode:"extended",id:u,...D})}oembedTweet(u,D={}){return this.get("oembed",{url:`https://x.com/i/statuses/${u}`,...D},{prefix:"https://publish.x.com/"})}async homeTimeline(u={}){let D={tweet_mode:"extended",...u},B=await this.get("statuses/home_timeline.json",D,{fullResponse:!0});return new b8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async mentionTimeline(u={}){let D={tweet_mode:"extended",...u},B=await this.get("statuses/mentions_timeline.json",D,{fullResponse:!0});return new j8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async userTimeline(u,D={}){let B={tweet_mode:"extended",user_id:u,...D},A=await this.get("statuses/user_timeline.json",B,{fullResponse:!0});return new KD({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}async userTimelineByUsername(u,D={}){let B={tweet_mode:"extended",screen_name:u,...D},A=await this.get("statuses/user_timeline.json",B,{fullResponse:!0});return new KD({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}async favoriteTimeline(u,D={}){let B={tweet_mode:"extended",user_id:u,...D},A=await this.get("favorites/list.json",B,{fullResponse:!0});return new xD({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}async favoriteTimelineByUsername(u,D={}){let B={tweet_mode:"extended",screen_name:u,...D},A=await this.get("favorites/list.json",B,{fullResponse:!0});return new xD({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}user(u){return this.get("users/show.json",{tweet_mode:"extended",...u})}users(u){return this.get("users/lookup.json",{tweet_mode:"extended",...u})}verifyCredentials(u={}){return this.get("account/verify_credentials.json",u)}async listMutedUsers(u={}){let D={tweet_mode:"extended",...u},B=await this.get("mutes/users/list.json",D,{fullResponse:!0});return new d8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async listMutedUserIds(u={}){let D={stringify_ids:!0,...u},B=await this.get("mutes/users/ids.json",D,{fullResponse:!0});return new r8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async userFriendList(u={}){let D={...u},B=await this.get("friends/list.json",D,{fullResponse:!0});return new p8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async userFollowerList(u={}){let D={...u},B=await this.get("followers/list.json",D,{fullResponse:!0});return new i8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async userFollowerIds(u={}){let D={stringify_ids:!0,...u},B=await this.get("followers/ids.json",D,{fullResponse:!0});return new n8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async userFollowingIds(u={}){let D={stringify_ids:!0,...u},B=await this.get("friends/ids.json",D,{fullResponse:!0});return new a8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async searchUsers(u,D={}){let B={q:u,tweet_mode:"extended",page:1,...D},A=await this.get("users/search.json",B,{fullResponse:!0});return new s8({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}friendship(u){return this.get("friendships/show.json",u)}friendships(u){return this.get("friendships/lookup.json",u)}friendshipsNoRetweets(){return this.get("friendships/no_retweets/ids.json",{stringify_ids:!0})}async friendshipsIncoming(u={}){let D={stringify_ids:!0,...u},B=await this.get("friendships/incoming.json",D,{fullResponse:!0});return new SD({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async friendshipsOutgoing(u={}){let D={stringify_ids:!0,...u},B=await this.get("friendships/outgoing.json",D,{fullResponse:!0});return new t8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}accountSettings(){return this.get("account/settings.json")}userProfileBannerSizes(u){return this.get("users/profile_banner.json",u)}list(u){return this.get("lists/show.json",{tweet_mode:"extended",...u})}lists(u={}){return this.get("lists/list.json",{tweet_mode:"extended",...u})}async listMembers(u={}){let D={tweet_mode:"extended",...u},B=await this.get("lists/members.json",D,{fullResponse:!0});return new B5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}listGetMember(u){return this.get("lists/members/show.json",{tweet_mode:"extended",...u})}async listMemberships(u={}){let D={tweet_mode:"extended",...u},B=await this.get("lists/memberships.json",D,{fullResponse:!0});return new o8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async listOwnerships(u={}){let D={tweet_mode:"extended",...u},B=await this.get("lists/ownerships.json",D,{fullResponse:!0});return new e8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async listStatuses(u){let D={tweet_mode:"extended",...u},B=await this.get("lists/statuses.json",D,{fullResponse:!0});return new l8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async listSubscribers(u={}){let D={tweet_mode:"extended",...u},B=await this.get("lists/subscribers.json",D,{fullResponse:!0});return new A5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}listGetSubscriber(u){return this.get("lists/subscribers/show.json",{tweet_mode:"extended",...u})}async listSubscriptions(u={}){let D={tweet_mode:"extended",...u},B=await this.get("lists/subscriptions.json",D,{fullResponse:!0});return new u5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}mediaInfo(u){return this.get("media/upload.json",{command:"STATUS",media_id:u},{prefix:g2})}filterStream({autoConnect:u,...D}={}){let B={};for(let[w,F]of Object.entries(D))if(w==="follow"||w==="track")B[w]=F.toString();else if(w==="locations"){let N=F;B.locations=WD(N).map((G)=>`${G.lng},${G.lat}`).join(",")}else B[w]=F;return this.stream.postStream("statuses/filter.json",B,{autoConnect:u})}sampleStream({autoConnect:u,...D}={}){return this.stream.getStream("statuses/sample.json",D,{autoConnect:u})}get stream(){let u=new HD(this);return u.setPrefix(RY),u}trendsByPlace(u,D={}){return this.get("trends/place.json",{id:u,...D})}trendsAvailable(){return this.get("trends/available.json")}trendsClosest(u,D){return this.get("trends/closest.json",{lat:u,long:D})}geoPlace(u){return this.get("geo/id/:place_id.json",void 0,{params:{place_id:u}})}geoSearch(u){return this.get("geo/search.json",u)}geoReverseGeoCode(u){return this.get("geo/reverse_geocode.json",u)}rateLimitStatuses(...u){return this.get("application/rate_limit_status.json",{resources:u})}supportedLanguages(){return this.get("help/languages.json")}}import*as B0 from"fs";async function w5(u){let D=await F5(u);if(typeof D==="number")return new Promise((B,A)=>{B0.readFile(D,(w,F)=>{if(w)return A(w);B(F)})});else if(D instanceof Buffer)return D;else return D.readFile()}function F5(u){if(typeof u==="string")return B0.promises.open(u,"r");else if(typeof u==="number")return u;else if(typeof u==="object"&&!(u instanceof Buffer))return u;else if(!(u instanceof Buffer))throw Error("Given file is not valid, please check its type.");else return u}async function qY(u){if(typeof u==="number")return(await new Promise((B,A)=>{B0.fstat(u,(w,F)=>{if(w)A(w);B(F)})})).size;else if(u instanceof Buffer)return u.length;else return(await u.stat()).size}function mY(u,D,B){if(typeof B==="string")return B;else if(typeof u==="string"&&!D)return WU(u);else if(typeof D==="string")return XU(D);throw Error("You must specify type if file is a file handle or Buffer.")}function WU(u){if(u.endsWith(".jpeg")||u.endsWith(".jpg"))return m.Jpeg;if(u.endsWith(".png"))return m.Png;if(u.endsWith(".webp"))return m.Webp;if(u.endsWith(".gif"))return m.Gif;if(u.endsWith(".mpeg4")||u.endsWith(".mp4"))return m.Mp4;if(u.endsWith(".mov")||u.endsWith(".mov"))return m.Mov;if(u.endsWith(".srt"))return m.Srt;return _8({instance:"TwitterApiv1ReadWrite",method:"uploadMedia",problem:"options.mimeType is missing and filename couldn't help to resolve MIME type, so it will fallback to image/jpeg",resolution:"If you except to give filenames without extensions, please specify explicitlty the MIME type using options.mimeType"}),m.Jpeg}function XU(u){if(_8({instance:"TwitterApiv1ReadWrite",method:"uploadMedia",problem:"you're using options.type",resolution:"Remove options.type argument and migrate to options.mimeType which takes the real MIME type. If you're using type=longmp4, add options.longVideo alongside of mimeType=EUploadMimeType.Mp4"}),u==="gif")return m.Gif;if(u==="jpg")return m.Jpeg;if(u==="png")return m.Png;if(u==="webp")return m.Webp;if(u==="srt")return m.Srt;if(u==="mp4"||u==="longmp4")return m.Mp4;if(u==="mov")return m.Mov;return u}function gY(u,D){if(u===m.Mp4||u===m.Mov)return D==="tweet"?"TweetVideo":"DmVideo";if(u===m.Gif)return D==="tweet"?"TweetGif":"DmGif";if(u===m.Srt)return"Subtitles";else return D==="tweet"?"TweetImage":"DmImage"}function N5(u){return new Promise((D)=>setTimeout(D,u*1000))}async function G5(u,D,B=0,A){if(u instanceof Buffer){let F=u.slice(B,B+D);return[F,F.length]}if(!A)throw Error("Well, we will need a buffer to store file content.");let w;if(typeof u==="number")w=await new Promise((F,N)=>{B0.read(u,A,0,D,B,(G,v)=>{if(G)N(G);F(v)})});else w=(await u.read(A,0,D,B)).bytesRead;return[A,w]}var $5="media/upload.json";class i0 extends r0{constructor(){super(...arguments);this._prefix=e2}get readOnly(){return this}tweet(u,D={}){let B={status:u,tweet_mode:"extended",...D};return this.post("statuses/update.json",B)}async quote(u,D,B={}){let A="https://x.com/i/statuses/"+D;return this.tweet(u,{...B,attachment_url:A})}async tweetThread(u){let D=[];for(let B of u){let A=D.length?D[D.length-1]:null,w={...typeof B==="string"?{status:B}:B},F=A?A.id_str:w.in_reply_to_status_id,N=w.status;if(F)D.push(await this.reply(N,F,w));else D.push(await this.tweet(N,w))}return D}reply(u,D,B={}){return this.tweet(u,{auto_populate_reply_metadata:!0,in_reply_to_status_id:D,...B})}deleteTweet(u){return this.post("statuses/destroy/:id.json",{tweet_mode:"extended"},{params:{id:u}})}reportUserAsSpam(u){return this.post("users/report_spam.json",{tweet_mode:"extended",...u})}updateFriendship(u){return this.post("friendships/update.json",u)}createFriendship(u){return this.post("friendships/create.json",u)}destroyFriendship(u){return this.post("friendships/destroy.json",u)}updateAccountSettings(u){return this.post("account/settings.json",u)}updateAccountProfile(u){return this.post("account/update_profile.json",u)}async updateAccountProfileBanner(u,D={}){let B={banner:await w5(u),...D};return this.post("account/update_profile_banner.json",B,{forceBodyMode:"form-data"})}async updateAccountProfileImage(u,D={}){let B={tweet_mode:"extended",image:await w5(u),...D};return this.post("account/update_profile_image.json",B,{forceBodyMode:"form-data"})}removeAccountProfileBanner(){return this.post("account/remove_profile_banner.json")}createList(u){return this.post("lists/create.json",{tweet_mode:"extended",...u})}updateList(u){return this.post("lists/update.json",{tweet_mode:"extended",...u})}removeList(u){return this.post("lists/destroy.json",{tweet_mode:"extended",...u})}addListMembers(u){let B=u.user_id&&ku(u.user_id)||u.screen_name&&ku(u.screen_name)?"lists/members/create_all.json":"lists/members/create.json";return this.post(B,u)}removeListMembers(u){let B=u.user_id&&ku(u.user_id)||u.screen_name&&ku(u.screen_name)?"lists/members/destroy_all.json":"lists/members/destroy.json";return this.post(B,u)}subscribeToList(u){return this.post("lists/subscribers/create.json",{tweet_mode:"extended",...u})}unsubscribeOfList(u){return this.post("lists/subscribers/destroy.json",{tweet_mode:"extended",...u})}createMediaMetadata(u,D){return this.post("media/metadata/create.json",{media_id:u,...D},{prefix:g2,forceBodyMode:"json"})}createMediaSubtitles(u,D){return this.post("media/subtitles/create.json",{media_id:u,media_category:"TweetVideo",subtitle_info:{subtitles:D}},{prefix:g2,forceBodyMode:"json"})}deleteMediaSubtitles(u,...D){return this.post("media/subtitles/delete.json",{media_id:u,media_category:"TweetVideo",subtitle_info:{subtitles:D.map((B)=>({language_code:B}))}},{prefix:g2,forceBodyMode:"json"})}async uploadMedia(u,D={},B=!1){var A;let w=(A=D.chunkLength)!==null&&A!==void 0?A:1048576,{fileHandle:F,mediaCategory:N,fileSize:G,mimeType:v}=await this.getUploadMediaRequirements(u,D);try{let z=await this.post($5,{command:"INIT",total_bytes:G,media_type:v,media_category:N,additional_owners:D.additionalOwners,shared:D.shared?!0:void 0},{prefix:g2});await this.mediaChunkedUpload(F,w,z.media_id_string,D.maxConcurrentUploads);let Q=await this.post($5,{command:"FINALIZE",media_id:z.media_id_string},{prefix:g2});if(Q.processing_info&&Q.processing_info.state!=="succeeded")await this.awaitForMediaProcessingCompletion(Q);if(B)return Q;else return Q.media_id_string}finally{if(typeof u==="number")v5.close(u,()=>{});else if(typeof F==="object"&&!(F instanceof Buffer))F.close()}}async awaitForMediaProcessingCompletion(u){var D;while(!0){u=await this.mediaInfo(u.media_id_string);let{processing_info:B}=u;if(!B||B.state==="succeeded")return;if((D=B.error)===null||D===void 0?void 0:D.code){let{name:A,message:w}=B.error;throw Error(`Failed to process media: ${A} - ${w}.`)}if(B.state==="failed")throw Error("Failed to process the media.");if(B.check_after_secs)await N5(B.check_after_secs);else await N5(5)}}async getUploadMediaRequirements(u,{mimeType:D,type:B,target:A,longVideo:w}={}){let F;try{F=await F5(u);let N=mY(u,B,D),G;if(N===m.Mp4&&(!D&&!B&&A!=="dm"||w))G="amplify_video";else G=gY(N,A!==null&&A!==void 0?A:"tweet");return{fileHandle:F,mediaCategory:G,fileSize:await qY(F),mimeType:N}}catch(N){if(typeof u==="number")v5.close(u,()=>{});else if(typeof F==="object"&&!(F instanceof Buffer))F.close();throw N}}async mediaChunkedUpload(u,D,B,A=3){let w=0;if(A<1)throw RangeError("Bad maxConcurrentUploads parameter.");let F=u instanceof Buffer?void 0:Buffer.alloc(D),N,G,v=0;[N,G]=await G5(u,D,v,F),v+=G;let z=new Set;while(G){let Q=N.slice(0,G);if(Q.length){let Z=this.post($5,{command:"APPEND",media_id:B,segment_index:w,media:Q},{prefix:g2});z.add(Z),Z.then(()=>{z.delete(Z)}),w++}if(z.size>=A)await Promise.race(z);[N,G]=await G5(u,D,v,F),v+=G}await Promise.all([...z])}}class _Y extends i0{constructor(){super(...arguments);this._prefix=e2}get readWrite(){return this}sendDm({recipient_id:u,custom_profile_id:D,...B}){let A={event:{type:u0.Create,[u0.Create]:{target:{recipient_id:u},message_data:B}}};if(D)A.event[u0.Create].custom_profile_id=D;return this.post("direct_messages/events/new.json",A,{forceBodyMode:"json"})}getDmEvent(u){return this.get("direct_messages/events/show.json",{id:u})}deleteDm(u){return this.delete("direct_messages/events/destroy.json",{id:u})}async listDmEvents(u={}){let D={...u},B=await this.get("direct_messages/events/list.json",D,{fullResponse:!0});return new q8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}newWelcomeDm(u,D){let B={[u0.WelcomeCreate]:{name:u,message_data:D}};return this.post("direct_messages/welcome_messages/new.json",B,{forceBodyMode:"json"})}getWelcomeDm(u){return this.get("direct_messages/welcome_messages/show.json",{id:u})}deleteWelcomeDm(u){return this.delete("direct_messages/welcome_messages/destroy.json",{id:u})}updateWelcomeDm(u,D){let B={message_data:D};return this.put("direct_messages/welcome_messages/update.json",B,{forceBodyMode:"json",query:{id:u}})}async listWelcomeDms(u={}){let D={...u},B=await this.get("direct_messages/welcome_messages/list.json",D,{fullResponse:!0});return new m8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}newWelcomeDmRule(u){return this.post("direct_messages/welcome_messages/rules/new.json",{welcome_message_rule:{welcome_message_id:u}},{forceBodyMode:"json"})}getWelcomeDmRule(u){return this.get("direct_messages/welcome_messages/rules/show.json",{id:u})}deleteWelcomeDmRule(u){return this.delete("direct_messages/welcome_messages/rules/destroy.json",{id:u})}async listWelcomeDmRules(u={}){let D={...u};return this.get("direct_messages/welcome_messages/rules/list.json",D)}async setWelcomeDm(u,D=!0){var B;let A=await this.listWelcomeDmRules();if((B=A.welcome_message_rules)===null||B===void 0?void 0:B.length){for(let w of A.welcome_message_rules)if(await this.deleteWelcomeDmRule(w.id),D)await this.deleteWelcomeDm(w.welcome_message_id)}return this.newWelcomeDmRule(u)}markDmAsRead(u,D){return this.post("direct_messages/mark_read.json",{last_read_event_id:u,recipient_id:D},{forceBodyMode:"url"})}indicateDmTyping(u){return this.post("direct_messages/indicate_typing.json",{recipient_id:u},{forceBodyMode:"url"})}async downloadDmImage(u){if(typeof u!=="string"){let B=u[u0.Create].message_data.attachment;if(!B)throw Error("The given direct message doesn't contain any attachment");u=B.media.media_url_https}let D=await this.get(u,void 0,{forceParseMode:"buffer",prefix:""});if(!D.length)throw Error("Image not found. Make sure you are logged with credentials able to access direct messages, and check the URL.");return D}}var HD=_Y;class q{constructor(u){this.result=u}get tweets(){return q.tweets(this.result)}static tweets(u){var D,B;return(B=(D=u.includes)===null||D===void 0?void 0:D.tweets)!==null&&B!==void 0?B:[]}tweetById(u){return q.tweetById(this.result,u)}static tweetById(u,D){return this.tweets(u).find((B)=>B.id===D)}retweet(u){return q.retweet(this.result,u)}static retweet(u,D){var B;let A=((B=D.referenced_tweets)!==null&&B!==void 0?B:[]).filter((w)=>w.type==="retweeted").map((w)=>w.id);return this.tweets(u).find((w)=>A.includes(w.id))}quote(u){return q.quote(this.result,u)}static quote(u,D){var B;let A=((B=D.referenced_tweets)!==null&&B!==void 0?B:[]).filter((w)=>w.type==="quoted").map((w)=>w.id);return this.tweets(u).find((w)=>A.includes(w.id))}repliedTo(u){return q.repliedTo(this.result,u)}static repliedTo(u,D){var B;let A=((B=D.referenced_tweets)!==null&&B!==void 0?B:[]).filter((w)=>w.type==="replied_to").map((w)=>w.id);return this.tweets(u).find((w)=>A.includes(w.id))}author(u){return q.author(this.result,u)}static author(u,D){let B=D.author_id;return B?this.users(u).find((A)=>A.id===B):void 0}repliedToAuthor(u){return q.repliedToAuthor(this.result,u)}static repliedToAuthor(u,D){let B=D.in_reply_to_user_id;return B?this.users(u).find((A)=>A.id===B):void 0}get users(){return q.users(this.result)}static users(u){var D,B;return(B=(D=u.includes)===null||D===void 0?void 0:D.users)!==null&&B!==void 0?B:[]}userById(u){return q.userById(this.result,u)}static userById(u,D){return this.users(u).find((B)=>B.id===D)}pinnedTweet(u){return q.pinnedTweet(this.result,u)}static pinnedTweet(u,D){return D.pinned_tweet_id?this.tweets(u).find((B)=>B.id===D.pinned_tweet_id):void 0}get media(){return q.media(this.result)}static media(u){var D,B;return(B=(D=u.includes)===null||D===void 0?void 0:D.media)!==null&&B!==void 0?B:[]}medias(u){return q.medias(this.result,u)}static medias(u,D){var B,A;let w=(A=(B=D.attachments)===null||B===void 0?void 0:B.media_keys)!==null&&A!==void 0?A:[];return this.media(u).filter((F)=>w.includes(F.media_key))}get polls(){return q.polls(this.result)}static polls(u){var D,B;return(B=(D=u.includes)===null||D===void 0?void 0:D.polls)!==null&&B!==void 0?B:[]}poll(u){return q.poll(this.result,u)}static poll(u,D){var B,A;let w=(A=(B=D.attachments)===null||B===void 0?void 0:B.poll_ids)!==null&&A!==void 0?A:[];if(w.length){let F=w[0];return this.polls(u).find((N)=>N.id===F)}return}get places(){return q.places(this.result)}static places(u){var D,B;return(B=(D=u.includes)===null||D===void 0?void 0:D.places)!==null&&B!==void 0?B:[]}place(u){return q.place(this.result,u)}static place(u,D){var B;let A=(B=D.geo)===null||B===void 0?void 0:B.place_id;return A?this.places(u).find((w)=>w.id===A):void 0}listOwner(u){return q.listOwner(this.result,u)}static listOwner(u,D){let B=D.owner_id;return B?this.users(u).find((A)=>A.id===B):void 0}spaceCreator(u){return q.spaceCreator(this.result,u)}static spaceCreator(u,D){let B=D.creator_id;return B?this.users(u).find((A)=>A.id===B):void 0}spaceHosts(u){return q.spaceHosts(this.result,u)}static spaceHosts(u,D){var B;let A=(B=D.host_ids)!==null&&B!==void 0?B:[];return this.users(u).filter((w)=>A.includes(w.id))}spaceSpeakers(u){return q.spaceSpeakers(this.result,u)}static spaceSpeakers(u,D){var B;let A=(B=D.speaker_ids)!==null&&B!==void 0?B:[];return this.users(u).filter((w)=>A.includes(w.id))}spaceInvitedUsers(u){return q.spaceInvitedUsers(this.result,u)}static spaceInvitedUsers(u,D){var B;let A=(B=D.invited_user_ids)!==null&&B!==void 0?B:[];return this.users(u).filter((w)=>A.includes(w.id))}}class UD extends I8{updateIncludes(u){if(u.errors){if(!this._realData.errors)this._realData.errors=[];this._realData.errors=[...this._realData.errors,...u.errors]}if(!u.includes)return;if(!this._realData.includes)this._realData.includes={};let D=this._realData.includes;for(let[B,A]of Object.entries(u.includes)){if(!D[B])D[B]=[];D[B]=[...D[B],...A]}}assertUsable(){if(this.unusable)throw Error("Unable to use this paginator to fetch more data, as it does not contain any metadata. Check .errors property for more details.")}get meta(){return this._realData.meta}get includes(){var u;if(!((u=this._realData)===null||u===void 0?void 0:u.includes))return new q(this._realData);if(this._includesInstance)return this._includesInstance;return this._includesInstance=new q(this._realData)}get errors(){var u;return(u=this._realData.errors)!==null&&u!==void 0?u:[]}get unusable(){return this.errors.length>0&&!this._realData.meta&&!this._realData.data}}class q2 extends UD{refreshInstanceFromResult(u,D){var B;let A=u.data,w=(B=A.data)!==null&&B!==void 0?B:[];if(this._rateLimit=u.rateLimit,!this._realData.data)this._realData.data=[];if(D)this._realData.meta.result_count+=A.meta.result_count,this._realData.meta.next_token=A.meta.next_token,this._realData.data.push(...w);else this._realData.meta.result_count+=A.meta.result_count,this._realData.meta.previous_token=A.meta.previous_token,this._realData.data.unshift(...w);this.updateIncludes(A)}getNextQueryParams(u){return this.assertUsable(),{...this.injectQueryParams(u),pagination_token:this._realData.meta.next_token}}getPreviousQueryParams(u){return this.assertUsable(),{...this.injectQueryParams(u),pagination_token:this._realData.meta.previous_token}}getPageLengthFromRequest(u){var D,B;return(B=(D=u.data.data)===null||D===void 0?void 0:D.length)!==null&&B!==void 0?B:0}isFetchLastOver(u){var D;return!((D=u.data.data)===null||D===void 0?void 0:D.length)||!this.canFetchNextPage(u.data)}canFetchNextPage(u){var D;return!!((D=u.meta)===null||D===void 0?void 0:D.next_token)}}class z5 extends UD{refreshInstanceFromResult(u,D){var B;let A=u.data,w=(B=A.data)!==null&&B!==void 0?B:[];if(this._rateLimit=u.rateLimit,!this._realData.data)this._realData.data=[];if(D)this._realData.meta.oldest_id=A.meta.oldest_id,this._realData.meta.result_count+=A.meta.result_count,this._realData.meta.next_token=A.meta.next_token,this._realData.data.push(...w);else this._realData.meta.newest_id=A.meta.newest_id,this._realData.meta.result_count+=A.meta.result_count,this._realData.data.unshift(...w);this.updateIncludes(A)}getNextQueryParams(u){this.assertUsable();let D={...this.injectQueryParams(u)};if(this._realData.meta.next_token)D.next_token=this._realData.meta.next_token;else{if(D.start_time)D.since_id=this.dateStringToSnowflakeId(D.start_time),delete D.start_time;if(D.end_time)delete D.end_time;D.until_id=this._realData.meta.oldest_id}return D}getPreviousQueryParams(u){return this.assertUsable(),{...this.injectQueryParams(u),since_id:this._realData.meta.newest_id}}getPageLengthFromRequest(u){var D,B;return(B=(D=u.data.data)===null||D===void 0?void 0:D.length)!==null&&B!==void 0?B:0}isFetchLastOver(u){var D;return!((D=u.data.data)===null||D===void 0?void 0:D.length)||!this.canFetchNextPage(u.data)}canFetchNextPage(u){return!!u.meta.next_token}getItemArray(){return this.tweets}dateStringToSnowflakeId(u){let D=BigInt("1288834974657"),B=new Date(u);if(isNaN(B.valueOf()))throw Error("Unable to convert start_time/end_time to a valid date. A ISO 8601 DateTime is excepted, please check your input.");return(BigInt(B.valueOf())-D<<BigInt("22")).toString()}get tweets(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}}class n0 extends q2{refreshInstanceFromResult(u,D){super.refreshInstanceFromResult(u,D);let B=u.data;if(D)this._realData.meta.oldest_id=B.meta.oldest_id;else this._realData.meta.newest_id=B.meta.newest_id}getItemArray(){return this.tweets}get tweets(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}}class Z5 extends z5{constructor(){super(...arguments);this._endpoint="tweets/search/recent"}}class J5 extends z5{constructor(){super(...arguments);this._endpoint="tweets/search/all"}}class Q5 extends n0{constructor(){super(...arguments);this._endpoint="tweets/:id/quote_tweets"}}class W5 extends n0{constructor(){super(...arguments);this._endpoint="users/:id/timelines/reverse_chronological"}}class X5 extends n0{constructor(){super(...arguments);this._endpoint="users/:id/tweets"}}class Y5 extends n0{constructor(){super(...arguments);this._endpoint="users/:id/mentions"}}class h5 extends n0{constructor(){super(...arguments);this._endpoint="users/:id/bookmarks"}}class K5 extends q2{get tweets(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}getItemArray(){return this.tweets}}class x5 extends K5{constructor(){super(...arguments);this._endpoint="users/:id/liked_tweets"}}class S5 extends K5{constructor(){super(...arguments);this._endpoint="lists/:id/tweets"}}class _2 extends q2{getItemArray(){return this.users}get users(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}}class R5 extends _2{constructor(){super(...arguments);this._endpoint="users/:id/blocking"}}class H5 extends _2{constructor(){super(...arguments);this._endpoint="users/:id/muting"}}class U5 extends _2{constructor(){super(...arguments);this._endpoint="users/:id/followers"}}class c5 extends _2{constructor(){super(...arguments);this._endpoint="users/:id/following"}}class M5 extends _2{constructor(){super(...arguments);this._endpoint="lists/:id/members"}}class L5 extends _2{constructor(){super(...arguments);this._endpoint="lists/:id/followers"}}class E5 extends _2{constructor(){super(...arguments);this._endpoint="tweets/:id/liking_users"}}class O5 extends _2{constructor(){super(...arguments);this._endpoint="tweets/:id/retweeted_by"}}class cD extends q2{getItemArray(){return this.lists}get lists(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}}class C5 extends cD{constructor(){super(...arguments);this._endpoint="users/:id/owned_lists"}}class P5 extends cD{constructor(){super(...arguments);this._endpoint="users/:id/list_memberships"}}class k5 extends cD{constructor(){super(...arguments);this._endpoint="users/:id/followed_lists"}}class p0 extends P2{constructor(){super(...arguments);this._prefix=_0}}class MD extends q2{getItemArray(){return this.events}get events(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}}class y5 extends MD{constructor(){super(...arguments);this._endpoint="dm_events"}}class V5 extends MD{constructor(){super(...arguments);this._endpoint="dm_conversations/with/:participant_id/dm_events"}}class T5 extends MD{constructor(){super(...arguments);this._endpoint="dm_conversations/:dm_conversation_id/dm_events"}}class a0 extends P2{constructor(){super(...arguments);this._prefix=o2}get labs(){if(this._labs)return this._labs;return this._labs=new p0(this)}async search(u,D={}){let B=typeof u==="string"?{...D,query:u}:{...u},A=await this.get("tweets/search/recent",B,{fullResponse:!0});return new Z5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}async searchAll(u,D={}){let B={...D,query:u},A=await this.get("tweets/search/all",B,{fullResponse:!0});return new J5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}singleTweet(u,D={}){return this.get("tweets/:id",D,{params:{id:u}})}tweets(u,D={}){return this.get("tweets",{ids:u,...D})}tweetCountRecent(u,D={}){return this.get("tweets/counts/recent",{query:u,...D})}tweetCountAll(u,D={}){return this.get("tweets/counts/all",{query:u,...D})}async tweetRetweetedBy(u,D={}){let{asPaginator:B,...A}=D,w=await this.get("tweets/:id/retweeted_by",A,{fullResponse:!0,params:{id:u}});if(!B)return w.data;return new O5({realData:w.data,rateLimit:w.rateLimit,instance:this,queryParams:A,sharedParams:{id:u}})}async tweetLikedBy(u,D={}){let{asPaginator:B,...A}=D,w=await this.get("tweets/:id/liking_users",A,{fullResponse:!0,params:{id:u}});if(!B)return w.data;return new E5({realData:w.data,rateLimit:w.rateLimit,instance:this,queryParams:A,sharedParams:{id:u}})}async homeTimeline(u={}){let D=await this.getCurrentUserV2Object(),B=await this.get("users/:id/timelines/reverse_chronological",u,{fullResponse:!0,params:{id:D.data.id}});return new W5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:u,sharedParams:{id:D.data.id}})}async userTimeline(u,D={}){let B=await this.get("users/:id/tweets",D,{fullResponse:!0,params:{id:u}});return new X5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D,sharedParams:{id:u}})}async userMentionTimeline(u,D={}){let B=await this.get("users/:id/mentions",D,{fullResponse:!0,params:{id:u}});return new Y5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D,sharedParams:{id:u}})}async quotes(u,D={}){let B=await this.get("tweets/:id/quote_tweets",D,{fullResponse:!0,params:{id:u}});return new Q5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D,sharedParams:{id:u}})}async bookmarks(u={}){let D=await this.getCurrentUserV2Object(),B=await this.get("users/:id/bookmarks",u,{fullResponse:!0,params:{id:D.data.id}});return new h5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:u,sharedParams:{id:D.data.id}})}me(u={}){return this.get("users/me",u)}user(u,D={}){return this.get("users/:id",D,{params:{id:u}})}users(u,D={}){let B=Array.isArray(u)?u.join(","):u;return this.get("users",{...D,ids:B})}userByUsername(u,D={}){return this.get("users/by/username/:username",D,{params:{username:u}})}usersByUsernames(u,D={}){return u=Array.isArray(u)?u.join(","):u,this.get("users/by",{...D,usernames:u})}async followers(u,D={}){let{asPaginator:B,...A}=D,w={id:u};if(!B)return this.get("users/:id/followers",A,{params:w});let F=await this.get("users/:id/followers",A,{fullResponse:!0,params:w});return new U5({realData:F.data,rateLimit:F.rateLimit,instance:this,queryParams:A,sharedParams:w})}async following(u,D={}){let{asPaginator:B,...A}=D,w={id:u};if(!B)return this.get("users/:id/following",A,{params:w});let F=await this.get("users/:id/following",A,{fullResponse:!0,params:w});return new c5({realData:F.data,rateLimit:F.rateLimit,instance:this,queryParams:A,sharedParams:w})}async userLikedTweets(u,D={}){let B={id:u},A=await this.get("users/:id/liked_tweets",D,{fullResponse:!0,params:B});return new x5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async userBlockingUsers(u,D={}){let B={id:u},A=await this.get("users/:id/blocking",D,{fullResponse:!0,params:B});return new R5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async userMutingUsers(u,D={}){let B={id:u},A=await this.get("users/:id/muting",D,{fullResponse:!0,params:B});return new H5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}list(u,D={}){return this.get("lists/:id",D,{params:{id:u}})}async listsOwned(u,D={}){let B={id:u},A=await this.get("users/:id/owned_lists",D,{fullResponse:!0,params:B});return new C5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listMemberships(u,D={}){let B={id:u},A=await this.get("users/:id/list_memberships",D,{fullResponse:!0,params:B});return new P5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listFollowed(u,D={}){let B={id:u},A=await this.get("users/:id/followed_lists",D,{fullResponse:!0,params:B});return new k5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listTweets(u,D={}){let B={id:u},A=await this.get("lists/:id/tweets",D,{fullResponse:!0,params:B});return new S5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listMembers(u,D={}){let B={id:u},A=await this.get("lists/:id/members",D,{fullResponse:!0,params:B});return new M5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listFollowers(u,D={}){let B={id:u},A=await this.get("lists/:id/followers",D,{fullResponse:!0,params:B});return new L5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listDmEvents(u={}){let D=await this.get("dm_events",u,{fullResponse:!0});return new y5({realData:D.data,rateLimit:D.rateLimit,instance:this,queryParams:{...u}})}async listDmEventsWithParticipant(u,D={}){let B={participant_id:u},A=await this.get("dm_conversations/with/:participant_id/dm_events",D,{fullResponse:!0,params:B});return new V5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listDmEventsOfConversation(u,D={}){let B={dm_conversation_id:u},A=await this.get("dm_conversations/:dm_conversation_id/dm_events",D,{fullResponse:!0,params:B});return new T5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}space(u,D={}){return this.get("spaces/:id",D,{params:{id:u}})}spaces(u,D={}){return this.get("spaces",{ids:u,...D})}spacesByCreators(u,D={}){return this.get("spaces/by/creator_ids",{user_ids:u,...D})}searchSpaces(u){return this.get("spaces/search",u)}spaceBuyers(u,D={}){return this.get("spaces/:id/buyers",D,{params:{id:u}})}spaceTweets(u,D={}){return this.get("spaces/:id/tweets",D,{params:{id:u}})}searchStream({autoConnect:u,...D}={}){return this.getStream("tweets/search/stream",D,{payloadIsError:XD,autoConnect:u})}streamRules(u={}){return this.get("tweets/search/stream/rules",u)}updateStreamRules(u,D={}){return this.post("tweets/search/stream/rules",u,{query:D})}sampleStream({autoConnect:u,...D}={}){return this.getStream("tweets/sample/stream",D,{payloadIsError:XD,autoConnect:u})}sample10Stream({autoConnect:u,...D}={}){return this.getStream("tweets/sample10/stream",D,{payloadIsError:XD,autoConnect:u})}complianceJobs(u){return this.get("compliance/jobs",u)}complianceJob(u){return this.get("compliance/jobs/:id",void 0,{params:{id:u}})}async sendComplianceJob(u){let D=await this.post("compliance/jobs",{type:u.type,name:u.name}),B=u.ids instanceof Buffer?u.ids:Buffer.from(u.ids.join(`
|
|
45
45
|
`));return await this.put(D.data.upload_url,B,{forceBodyMode:"raw",enableAuth:!1,headers:{"Content-Type":"text/plain"},prefix:""}),D}async complianceJobResult(u){let D=u;while(D.status!=="complete"){if(D.status==="expired"||D.status==="failed")throw Error("Job failed to be completed.");await new Promise((A)=>setTimeout(A,3500)),D=(await this.complianceJob(u.id)).data}return(await this.get(u.download_url,void 0,{enableAuth:!1,prefix:""})).trim().split(`
|
|
46
|
-
`).filter((A)=>A).map((A)=>JSON.parse(A))}async usage(u={}){return this.get("usage/tweets",u)}community(u,D={}){return this.get("communities/:id",D,{params:{id:u}})}searchCommunities(u,D={}){return this.get("communities/search",{query:u,...D})}}class s0 extends p0{constructor(){super(...arguments);this._prefix=_0}get readOnly(){return this}}class t0 extends a0{constructor(){super(...arguments);this._prefix=o2}get readOnly(){return this}get labs(){if(this._labs)return this._labs;return this._labs=new s0(this)}hideReply(u,D){return this.put("tweets/:id/hidden",{hidden:D},{params:{id:u}})}like(u,D){return this.post("users/:id/likes",{tweet_id:D},{params:{id:u}})}unlike(u,D){return this.delete("users/:id/likes/:tweet_id",void 0,{params:{id:u,tweet_id:D}})}retweet(u,D){return this.post("users/:id/retweets",{tweet_id:D},{params:{id:u}})}unretweet(u,D){return this.delete("users/:id/retweets/:tweet_id",void 0,{params:{id:u,tweet_id:D}})}tweet(u,D={}){if(typeof u==="object")D=u;else D={text:u,...D};return this.post("tweets",D)}async uploadMedia(u,D,B=1048576){let A=D.media_category;if(!D.media_category){if(D.media_type.includes("gif"))A="tweet_gif";else if(D.media_type.includes("image"))A="tweet_image";else if(D.media_type.includes("video"))A="tweet_video"}let w={additional_owners:D.additional_owners,media_type:D.media_type,total_bytes:u.length,media_category:A},N=(await this.post("media/upload/initialize",w)).data.id,G=Math.ceil(u.length/B),v=new Uint8Array(u);for(let Q=0;Q<G;Q++){let Z=Q*B,J=Math.min(Z+B,u.length),W=v.slice(Z,J),Y=Buffer.from(W),M={segment_index:Q,media:Y};await this.post(`media/upload/${N}/append`,M,{forceBodyMode:"form-data"})}if((await this.post(`media/upload/${N}/finalize`)).data.processing_info)await this.waitForMediaProcessing(N);return N}async waitForMediaProcessing(u){var D;let A=(await this.get("media/upload",{command:"STATUS",media_id:u})).data.processing_info;if(!A)return;switch(A.state){case"succeeded":return;case"failed":throw Error(`Media processing failed: ${(D=A.error)===null||D===void 0?void 0:D.message}`);case"pending":case"in_progress":{let w=A===null||A===void 0?void 0:A.check_after_secs;if(w&&w>0)await new Promise((F)=>setTimeout(F,w*1000)),await this.waitForMediaProcessing(u)}}}createMediaMetadata(u,D){return this.post("media/metadata",{id:u,metadata:D})}reply(u,D,B={}){var A;let w={in_reply_to_tweet_id:D,...(A=B.reply)!==null&&A!==void 0?A:{}};return this.post("tweets",{text:u,...B,reply:w})}quote(u,D,B={}){return this.tweet(u,{...B,quote_tweet_id:D})}async tweetThread(u){var D,B;let A=[];for(let w of u){let F=A.length?A[A.length-1]:null,N={...typeof w==="string"?{text:w}:w},G=F?F.data.id:(D=N.reply)===null||D===void 0?void 0:D.in_reply_to_tweet_id,v=(B=N.text)!==null&&B!==void 0?B:"";if(G)A.push(await this.reply(v,G,N));else A.push(await this.tweet(v,N))}return A}deleteTweet(u){return this.delete("tweets/:id",void 0,{params:{id:u}})}async bookmark(u){let D=await this.getCurrentUserV2Object();return this.post("users/:id/bookmarks",{tweet_id:u},{params:{id:D.data.id}})}async deleteBookmark(u){let D=await this.getCurrentUserV2Object();return this.delete("users/:id/bookmarks/:tweet_id",void 0,{params:{id:D.data.id,tweet_id:u}})}follow(u,D){return this.post("users/:id/following",{target_user_id:D},{params:{id:u}})}unfollow(u,D){return this.delete("users/:source_user_id/following/:target_user_id",void 0,{params:{source_user_id:u,target_user_id:D}})}block(u,D){return this.post("users/:id/blocking",{target_user_id:D},{params:{id:u}})}unblock(u,D){return this.delete("users/:source_user_id/blocking/:target_user_id",void 0,{params:{source_user_id:u,target_user_id:D}})}mute(u,D){return this.post("users/:id/muting",{target_user_id:D},{params:{id:u}})}unmute(u,D){return this.delete("users/:source_user_id/muting/:target_user_id",void 0,{params:{source_user_id:u,target_user_id:D}})}createList(u){return this.post("lists",u)}updateList(u,D={}){return this.put("lists/:id",D,{params:{id:u}})}removeList(u){return this.delete("lists/:id",void 0,{params:{id:u}})}addListMember(u,D){return this.post("lists/:id/members",{user_id:D},{params:{id:u}})}removeListMember(u,D){return this.delete("lists/:id/members/:user_id",void 0,{params:{id:u,user_id:D}})}subscribeToList(u,D){return this.post("users/:id/followed_lists",{list_id:D},{params:{id:u}})}unsubscribeOfList(u,D){return this.delete("users/:id/followed_lists/:list_id",void 0,{params:{id:u,list_id:D}})}pinList(u,D){return this.post("users/:id/pinned_lists",{list_id:D},{params:{id:u}})}unpinList(u,D){return this.delete("users/:id/pinned_lists/:list_id",void 0,{params:{id:u,list_id:D}})}sendDmInConversation(u,D){return this.post("dm_conversations/:dm_conversation_id/messages",D,{params:{dm_conversation_id:u}})}sendDmToParticipant(u,D){return this.post("dm_conversations/with/:participant_id/messages",D,{params:{participant_id:u}})}createDmConversation(u){return this.post("dm_conversations",u)}}class fY extends s0{constructor(){super(...arguments);this._prefix=_0}get readWrite(){return this}}var bY=fY;class jY extends t0{constructor(){super(...arguments);this._prefix=o2}get readWrite(){return this}get labs(){if(this._labs)return this._labs;return this._labs=new bY(this)}}var lY=jY;class Tu extends D0{get v1(){if(this._v1)return this._v1;return this._v1=new r0(this)}get v2(){if(this._v2)return this._v2;return this._v2=new a0(this)}async currentUser(u=!1){return await this.getCurrentUserObject(u)}async currentUserV2(u=!1){return await this.getCurrentUserV2Object(u)}search(u,D){return this.v2.search(u,D)}async generateAuthLink(u="oob",{authAccessType:D,linkMode:B="authenticate",forceLogin:A,screenName:w}={}){let F=await this.post("https://api.x.com/oauth/request_token",{oauth_callback:u,x_auth_access_type:D}),N=`https://api.x.com/oauth/${B}?oauth_token=${encodeURIComponent(F.oauth_token)}`;if(A!==void 0)N+=`&force_login=${encodeURIComponent(A)}`;if(w!==void 0)N+=`&screen_name=${encodeURIComponent(w)}`;if(this._requestMaker.hasPlugins())this._requestMaker.applyPluginMethod("onOAuth1RequestToken",{client:this._requestMaker,url:N,oauthResult:F});return{url:N,...F}}async login(u){let D=this.getActiveTokens();if(D.type!=="oauth-1.0a")throw Error("You must setup TwitterApi instance with consumer keys to accept OAuth 1.0 login");let B=await this.post("https://api.x.com/oauth/access_token",{oauth_token:D.accessToken,oauth_verifier:u}),A=new this.constructor({appKey:D.appKey,appSecret:D.appSecret,accessToken:B.oauth_token,accessSecret:B.oauth_token_secret},this._requestMaker.clientSettings);return{accessToken:B.oauth_token,accessSecret:B.oauth_token_secret,userId:B.user_id,screenName:B.screen_name,client:A}}async appLogin(){let u=this.getActiveTokens();if(u.type!=="oauth-1.0a")throw Error("You must setup TwitterApi instance with consumer keys to accept app-only login");let B=await new this.constructor({username:u.appKey,password:u.appSecret},this._requestMaker.clientSettings).post("https://api.x.com/oauth2/token",{grant_type:"client_credentials"});return new this.constructor(B.access_token,this._requestMaker.clientSettings)}generateOAuth2AuthLink(u,D={}){var B,A;if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. You can find your client ID in Twitter Developer Portal. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let w=(B=D.state)!==null&&B!==void 0?B:J0.generateRandomString(32),F=J0.getCodeVerifier(),N=J0.getCodeChallengeFromVerifier(F),G=(A=D.scope)!==null&&A!==void 0?A:"",v=Array.isArray(G)?G.join(" "):G,z=new URL("https://x.com/i/oauth2/authorize"),Q={response_type:"code",client_id:this._requestMaker.clientId,redirect_uri:u,state:w,code_challenge:N,code_challenge_method:"s256",scope:v};C2.addQueryParamsToUrl(z,Q);let Z={url:z.toString(),state:w,codeVerifier:F,codeChallenge:N};if(this._requestMaker.hasPlugins())this._requestMaker.applyPluginMethod("onOAuth2RequestToken",{client:this._requestMaker,result:Z,redirectUri:u});return Z}async loginWithOAuth2({code:u,codeVerifier:D,redirectUri:B}){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let A=await this.post("https://api.x.com/2/oauth2/token",{code:u,code_verifier:D,redirect_uri:B,grant_type:"authorization_code",client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret});return this.parseOAuth2AccessTokenResult(A)}async refreshOAuth2Token(u){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let D=await this.post("https://api.x.com/2/oauth2/token",{refresh_token:u,grant_type:"refresh_token",client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret});return this.parseOAuth2AccessTokenResult(D)}async revokeOAuth2Token(u,D="access_token"){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");return await this.post("https://api.x.com/2/oauth2/revoke",{client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret,token:u,token_type_hint:D})}parseOAuth2AccessTokenResult(u){let D=new this.constructor(u.access_token,this._requestMaker.clientSettings),B=u.scope.split(" ").filter((A)=>A);return{client:D,expiresIn:u.expires_in,accessToken:u.access_token,scope:B,refreshToken:u.refresh_token}}}class Iu extends Tu{get v1(){if(this._v1)return this._v1;return this._v1=new i0(this)}get v2(){if(this._v2)return this._v2;return this._v2=new t0(this)}get readOnly(){return this}}class LD extends P2{constructor(){super(...arguments);this._prefix=f0}}class ED extends LD{constructor(){super(...arguments);this._prefix=f0}get readOnly(){return this}}class OD extends P2{constructor(){super(...arguments);this._prefix=b0}}class CD extends OD{constructor(){super(...arguments);this._prefix=b0}get readOnly(){return this}}class dY extends CD{constructor(){super(...arguments);this._prefix=b0}get readWrite(){return this}}var rY=dY;class iY extends ED{constructor(){super(...arguments);this._prefix=f0}get readWrite(){return this}get sandbox(){if(this._sandbox)return this._sandbox;return this._sandbox=new rY(this)}}var nY=iY;class I5 extends Iu{get v1(){if(this._v1)return this._v1;return this._v1=new HD(this)}get v2(){if(this._v2)return this._v2;return this._v2=new lY(this)}get readWrite(){return this}get ads(){if(this._ads)return this._ads;return this._ads=new nY(this)}static getErrors(u){var D;if(typeof u!=="object")return[];if(!("data"in u))return[];return(D=u.data.errors)!==null&&D!==void 0?D:[]}static getProfileImageInSize(u,D){let B=u.split("/").pop(),A=["normal","bigger","mini"],w=u;for(let N of A)if(B.includes(`_${N}`)){w=u.replace(`_${N}`,"");break}if(D==="original")return w;let F=w.lastIndexOf(".");if(F!==-1){let N=w.slice(F+1);return w.slice(0,F)+"_"+D+"."+N}else return w+"_"+D}}var YU={clientId:process.env.X_CLIENT_ID,clientSecret:process.env.X_SECRET,redirectPath:"/auth/oauth/x/callback",scope:["tweet.read","users.read","offline.access"]};class aY extends g0{config;client;oauthStates=new Map;constructor(u={}){super();this.config={...YU,...u},this.client=new I5({clientId:this.config.clientId,clientSecret:this.config.clientSecret})}getRedirectUrl(){let{url:u,codeVerifier:D,state:B}=this.client.generateOAuth2AuthLink(`${process.env.HOST_NAME}${this.config.redirectPath}`,{scope:this.config.scope});return this.oauthStates.set(B,{state:B,codeVerifier:D}),pY.to(u),u}async onCallback(u){let D=u.search.get("code"),B=u.search.get("state"),A=this.oauthStates.get(B);if(!A)throw Error("Invalid or expired OAuth state");let w=await this.client.loginWithOAuth2({code:D,codeVerifier:A.codeVerifier,redirectUri:`${process.env.HOST_NAME}${this.config.redirectPath}`});this.oauthStates.delete(B);let{data:F}=await w.client.v2.me({"user.fields":["name","username","entities"]}),{name:N,email:G,id:v="",username:z}=F??{};return{name:N,email:G,username:z,providerId:v}}}class sY extends f{kernel;jobs=[];constructor(u){super();this.kernel=u}boot(){}}class tY{name;cron;callback(){}onTick(){}onComplete(){}static exp(u){return u}}class oY extends f{url=process.env.REDIS_URL;options;boot(){}}class q5 extends eY{service;static _name="SingletonServiceContainer";constructor(u){super();this.service=u}}class uh{static use(){let u=q5.use().service;if(u.services.has(this.name))return u.services.get(this.name);let D=new this;return u.services.set(this.name,D),D}}export{Q0 as ka,mu as la,m5 as ma,WY as na,S6 as oa,_1 as pa,f1 as qa,R6 as ra,vD as sa,zD as ta,ZY as ua,JY as va,QY as wa,XY as xa,YY as ya,KY as za,ZD as Aa,JD as Ba,xY as Ca,g0 as Da,SY as Ea,aY as Fa,sY as Ga,tY as Ha,oY as Ia,q5 as Ja,uh as Ka};
|
|
46
|
+
`).filter((A)=>A).map((A)=>JSON.parse(A))}async usage(u={}){return this.get("usage/tweets",u)}community(u,D={}){return this.get("communities/:id",D,{params:{id:u}})}searchCommunities(u,D={}){return this.get("communities/search",{query:u,...D})}}class s0 extends p0{constructor(){super(...arguments);this._prefix=_0}get readOnly(){return this}}class t0 extends a0{constructor(){super(...arguments);this._prefix=o2}get readOnly(){return this}get labs(){if(this._labs)return this._labs;return this._labs=new s0(this)}hideReply(u,D){return this.put("tweets/:id/hidden",{hidden:D},{params:{id:u}})}like(u,D){return this.post("users/:id/likes",{tweet_id:D},{params:{id:u}})}unlike(u,D){return this.delete("users/:id/likes/:tweet_id",void 0,{params:{id:u,tweet_id:D}})}retweet(u,D){return this.post("users/:id/retweets",{tweet_id:D},{params:{id:u}})}unretweet(u,D){return this.delete("users/:id/retweets/:tweet_id",void 0,{params:{id:u,tweet_id:D}})}tweet(u,D={}){if(typeof u==="object")D=u;else D={text:u,...D};return this.post("tweets",D)}async uploadMedia(u,D,B=1048576){let A=D.media_category;if(!D.media_category){if(D.media_type.includes("gif"))A="tweet_gif";else if(D.media_type.includes("image"))A="tweet_image";else if(D.media_type.includes("video"))A="tweet_video"}let w={additional_owners:D.additional_owners,media_type:D.media_type,total_bytes:u.length,media_category:A},N=(await this.post("media/upload/initialize",w)).data.id,G=Math.ceil(u.length/B),v=new Uint8Array(u);for(let Q=0;Q<G;Q++){let Z=Q*B,J=Math.min(Z+B,u.length),W=v.slice(Z,J),Y=Buffer.from(W),M={segment_index:Q,media:Y};await this.post(`media/upload/${N}/append`,M,{forceBodyMode:"form-data"})}if((await this.post(`media/upload/${N}/finalize`)).data.processing_info)await this.waitForMediaProcessing(N);return N}async waitForMediaProcessing(u){var D;let A=(await this.get("media/upload",{command:"STATUS",media_id:u})).data.processing_info;if(!A)return;switch(A.state){case"succeeded":return;case"failed":throw Error(`Media processing failed: ${(D=A.error)===null||D===void 0?void 0:D.message}`);case"pending":case"in_progress":{let w=A===null||A===void 0?void 0:A.check_after_secs;if(w&&w>0)await new Promise((F)=>setTimeout(F,w*1000)),await this.waitForMediaProcessing(u)}}}createMediaMetadata(u,D){return this.post("media/metadata",{id:u,metadata:D})}reply(u,D,B={}){var A;let w={in_reply_to_tweet_id:D,...(A=B.reply)!==null&&A!==void 0?A:{}};return this.post("tweets",{text:u,...B,reply:w})}quote(u,D,B={}){return this.tweet(u,{...B,quote_tweet_id:D})}async tweetThread(u){var D,B;let A=[];for(let w of u){let F=A.length?A[A.length-1]:null,N={...typeof w==="string"?{text:w}:w},G=F?F.data.id:(D=N.reply)===null||D===void 0?void 0:D.in_reply_to_tweet_id,v=(B=N.text)!==null&&B!==void 0?B:"";if(G)A.push(await this.reply(v,G,N));else A.push(await this.tweet(v,N))}return A}deleteTweet(u){return this.delete("tweets/:id",void 0,{params:{id:u}})}async bookmark(u){let D=await this.getCurrentUserV2Object();return this.post("users/:id/bookmarks",{tweet_id:u},{params:{id:D.data.id}})}async deleteBookmark(u){let D=await this.getCurrentUserV2Object();return this.delete("users/:id/bookmarks/:tweet_id",void 0,{params:{id:D.data.id,tweet_id:u}})}follow(u,D){return this.post("users/:id/following",{target_user_id:D},{params:{id:u}})}unfollow(u,D){return this.delete("users/:source_user_id/following/:target_user_id",void 0,{params:{source_user_id:u,target_user_id:D}})}block(u,D){return this.post("users/:id/blocking",{target_user_id:D},{params:{id:u}})}unblock(u,D){return this.delete("users/:source_user_id/blocking/:target_user_id",void 0,{params:{source_user_id:u,target_user_id:D}})}mute(u,D){return this.post("users/:id/muting",{target_user_id:D},{params:{id:u}})}unmute(u,D){return this.delete("users/:source_user_id/muting/:target_user_id",void 0,{params:{source_user_id:u,target_user_id:D}})}createList(u){return this.post("lists",u)}updateList(u,D={}){return this.put("lists/:id",D,{params:{id:u}})}removeList(u){return this.delete("lists/:id",void 0,{params:{id:u}})}addListMember(u,D){return this.post("lists/:id/members",{user_id:D},{params:{id:u}})}removeListMember(u,D){return this.delete("lists/:id/members/:user_id",void 0,{params:{id:u,user_id:D}})}subscribeToList(u,D){return this.post("users/:id/followed_lists",{list_id:D},{params:{id:u}})}unsubscribeOfList(u,D){return this.delete("users/:id/followed_lists/:list_id",void 0,{params:{id:u,list_id:D}})}pinList(u,D){return this.post("users/:id/pinned_lists",{list_id:D},{params:{id:u}})}unpinList(u,D){return this.delete("users/:id/pinned_lists/:list_id",void 0,{params:{id:u,list_id:D}})}sendDmInConversation(u,D){return this.post("dm_conversations/:dm_conversation_id/messages",D,{params:{dm_conversation_id:u}})}sendDmToParticipant(u,D){return this.post("dm_conversations/with/:participant_id/messages",D,{params:{participant_id:u}})}createDmConversation(u){return this.post("dm_conversations",u)}}class fY extends s0{constructor(){super(...arguments);this._prefix=_0}get readWrite(){return this}}var bY=fY;class jY extends t0{constructor(){super(...arguments);this._prefix=o2}get readWrite(){return this}get labs(){if(this._labs)return this._labs;return this._labs=new bY(this)}}var lY=jY;class Tu extends D0{get v1(){if(this._v1)return this._v1;return this._v1=new r0(this)}get v2(){if(this._v2)return this._v2;return this._v2=new a0(this)}async currentUser(u=!1){return await this.getCurrentUserObject(u)}async currentUserV2(u=!1){return await this.getCurrentUserV2Object(u)}search(u,D){return this.v2.search(u,D)}async generateAuthLink(u="oob",{authAccessType:D,linkMode:B="authenticate",forceLogin:A,screenName:w}={}){let F=await this.post("https://api.x.com/oauth/request_token",{oauth_callback:u,x_auth_access_type:D}),N=`https://api.x.com/oauth/${B}?oauth_token=${encodeURIComponent(F.oauth_token)}`;if(A!==void 0)N+=`&force_login=${encodeURIComponent(A)}`;if(w!==void 0)N+=`&screen_name=${encodeURIComponent(w)}`;if(this._requestMaker.hasPlugins())this._requestMaker.applyPluginMethod("onOAuth1RequestToken",{client:this._requestMaker,url:N,oauthResult:F});return{url:N,...F}}async login(u){let D=this.getActiveTokens();if(D.type!=="oauth-1.0a")throw Error("You must setup TwitterApi instance with consumer keys to accept OAuth 1.0 login");let B=await this.post("https://api.x.com/oauth/access_token",{oauth_token:D.accessToken,oauth_verifier:u}),A=new this.constructor({appKey:D.appKey,appSecret:D.appSecret,accessToken:B.oauth_token,accessSecret:B.oauth_token_secret},this._requestMaker.clientSettings);return{accessToken:B.oauth_token,accessSecret:B.oauth_token_secret,userId:B.user_id,screenName:B.screen_name,client:A}}async appLogin(){let u=this.getActiveTokens();if(u.type!=="oauth-1.0a")throw Error("You must setup TwitterApi instance with consumer keys to accept app-only login");let B=await new this.constructor({username:u.appKey,password:u.appSecret},this._requestMaker.clientSettings).post("https://api.x.com/oauth2/token",{grant_type:"client_credentials"});return new this.constructor(B.access_token,this._requestMaker.clientSettings)}generateOAuth2AuthLink(u,D={}){var B,A;if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. You can find your client ID in Twitter Developer Portal. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let w=(B=D.state)!==null&&B!==void 0?B:J0.generateRandomString(32),F=J0.getCodeVerifier(),N=J0.getCodeChallengeFromVerifier(F),G=(A=D.scope)!==null&&A!==void 0?A:"",v=Array.isArray(G)?G.join(" "):G,z=new URL("https://x.com/i/oauth2/authorize"),Q={response_type:"code",client_id:this._requestMaker.clientId,redirect_uri:u,state:w,code_challenge:N,code_challenge_method:"s256",scope:v};C2.addQueryParamsToUrl(z,Q);let Z={url:z.toString(),state:w,codeVerifier:F,codeChallenge:N};if(this._requestMaker.hasPlugins())this._requestMaker.applyPluginMethod("onOAuth2RequestToken",{client:this._requestMaker,result:Z,redirectUri:u});return Z}async loginWithOAuth2({code:u,codeVerifier:D,redirectUri:B}){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let A=await this.post("https://api.x.com/2/oauth2/token",{code:u,code_verifier:D,redirect_uri:B,grant_type:"authorization_code",client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret});return this.parseOAuth2AccessTokenResult(A)}async refreshOAuth2Token(u){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let D=await this.post("https://api.x.com/2/oauth2/token",{refresh_token:u,grant_type:"refresh_token",client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret});return this.parseOAuth2AccessTokenResult(D)}async revokeOAuth2Token(u,D="access_token"){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");return await this.post("https://api.x.com/2/oauth2/revoke",{client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret,token:u,token_type_hint:D})}parseOAuth2AccessTokenResult(u){let D=new this.constructor(u.access_token,this._requestMaker.clientSettings),B=u.scope.split(" ").filter((A)=>A);return{client:D,expiresIn:u.expires_in,accessToken:u.access_token,scope:B,refreshToken:u.refresh_token}}}class Iu extends Tu{get v1(){if(this._v1)return this._v1;return this._v1=new i0(this)}get v2(){if(this._v2)return this._v2;return this._v2=new t0(this)}get readOnly(){return this}}class LD extends P2{constructor(){super(...arguments);this._prefix=f0}}class ED extends LD{constructor(){super(...arguments);this._prefix=f0}get readOnly(){return this}}class OD extends P2{constructor(){super(...arguments);this._prefix=b0}}class CD extends OD{constructor(){super(...arguments);this._prefix=b0}get readOnly(){return this}}class dY extends CD{constructor(){super(...arguments);this._prefix=b0}get readWrite(){return this}}var rY=dY;class iY extends ED{constructor(){super(...arguments);this._prefix=f0}get readWrite(){return this}get sandbox(){if(this._sandbox)return this._sandbox;return this._sandbox=new rY(this)}}var nY=iY;class I5 extends Iu{get v1(){if(this._v1)return this._v1;return this._v1=new HD(this)}get v2(){if(this._v2)return this._v2;return this._v2=new lY(this)}get readWrite(){return this}get ads(){if(this._ads)return this._ads;return this._ads=new nY(this)}static getErrors(u){var D;if(typeof u!=="object")return[];if(!("data"in u))return[];return(D=u.data.errors)!==null&&D!==void 0?D:[]}static getProfileImageInSize(u,D){let B=u.split("/").pop(),A=["normal","bigger","mini"],w=u;for(let N of A)if(B.includes(`_${N}`)){w=u.replace(`_${N}`,"");break}if(D==="original")return w;let F=w.lastIndexOf(".");if(F!==-1){let N=w.slice(F+1);return w.slice(0,F)+"_"+D+"."+N}else return w+"_"+D}}var YU={clientId:process.env.X_CLIENT_ID,clientSecret:process.env.X_SECRET,redirectPath:"/auth/oauth/x/callback",scope:["tweet.read","users.read","offline.access"]};class aY extends g0{config;client;oauthStates=new Map;constructor(u={}){super();this.config={...YU,...u},this.client=new I5({clientId:this.config.clientId,clientSecret:this.config.clientSecret})}getRedirectUrl(){let{url:u,codeVerifier:D,state:B}=this.client.generateOAuth2AuthLink(`${process.env.HOST_NAME}${this.config.redirectPath}`,{scope:this.config.scope});return this.oauthStates.set(B,{state:B,codeVerifier:D}),pY.to(u),u}async onCallback(u){let D=u.search.get("code"),B=u.search.get("state"),A=this.oauthStates.get(B);if(!A)throw Error("Invalid or expired OAuth state");let w=await this.client.loginWithOAuth2({code:D,codeVerifier:A.codeVerifier,redirectUri:`${process.env.HOST_NAME}${this.config.redirectPath}`});this.oauthStates.delete(B);let{data:F}=await w.client.v2.me({"user.fields":["name","username","entities"]}),{name:N,email:G,id:v="",username:z}=F??{};return{name:N,email:G,username:z,providerId:v}}}class sY extends f{kernel;jobs=[];constructor(u){super();this.kernel=u}boot(){}}class tY{name;cron;callback(){}onTick(){}onComplete(){}static exp(u){return u}}class oY extends f{url=process.env.REDIS_URL;options;boot(){}}class q5 extends eY{service;static _name="SingletonServiceContainer";constructor(u){super();this.service=u}}class uh{static use(){let u=q5.use().service;if(u.services.has(this.name))return u.services.get(this.name);let D=new this;return u.services.set(this.name,D),D}}export{Q0 as ma,mu as na,m5 as oa,WY as pa,S6 as qa,_1 as ra,f1 as sa,R6 as ta,vD as ua,zD as va,ZY as wa,JY as xa,QY as ya,XY as za,YY as Aa,KY as Ba,ZD as Ca,JD as Da,xY as Ea,g0 as Fa,SY as Ga,aY as Ha,sY as Ia,tY as Ja,oY as Ka,q5 as La,uh as Ma};
|
|
47
47
|
|
|
48
|
-
//# debugId=
|
|
48
|
+
//# debugId=38F533AAF16C3F3C64756E2164756E21
|