gemi 0.4.102 → 0.4.103
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/{chunk-83f822c222295a62.js → chunk-087e1dd06f85d588.js} +2 -2
- package/dist/{chunk-83f822c222295a62.js.map → chunk-087e1dd06f85d588.js.map} +1 -1
- package/dist/{chunk-225a2ac22f559ca4.js → chunk-0a78bb530df845c9.js} +2 -2
- package/dist/{chunk-225a2ac22f559ca4.js.map → chunk-0a78bb530df845c9.js.map} +1 -1
- package/dist/{chunk-b2c75658070c9da8.js → chunk-0bc8cb0a7994c85d.js} +2 -2
- package/dist/{chunk-b2c75658070c9da8.js.map → chunk-0bc8cb0a7994c85d.js.map} +1 -1
- package/dist/chunk-17c3f49735b660d5.js +3 -0
- package/dist/chunk-17c3f49735b660d5.js.map +17 -0
- package/dist/{chunk-3840523c97bd28e4.js → chunk-28edd25587946042.js} +2 -2
- package/dist/{chunk-3840523c97bd28e4.js.map → chunk-28edd25587946042.js.map} +1 -1
- package/dist/chunk-4b2790e55056a146.js +4 -0
- package/dist/{chunk-76ab9cb416bb617d.js.map → chunk-4b2790e55056a146.js.map} +2 -2
- package/dist/chunk-4bda8e5e6ea82011.js +4 -0
- package/dist/{chunk-c69698325e61e6cf.js.map → chunk-4bda8e5e6ea82011.js.map} +2 -2
- package/dist/{chunk-f5707f3bdba77464.js → chunk-643d1c40e2a0f67f.js} +2 -2
- package/dist/{chunk-f5707f3bdba77464.js.map → chunk-643d1c40e2a0f67f.js.map} +1 -1
- package/dist/chunk-79168b7162a45077.js +3 -0
- package/dist/{chunk-4e3d8823a08776e9.js.map → chunk-79168b7162a45077.js.map} +4 -4
- package/dist/{chunk-9fefc0c4a022180f.js → chunk-7bf700c2348ef918.js} +2 -2
- package/dist/{chunk-9fefc0c4a022180f.js.map → chunk-7bf700c2348ef918.js.map} +1 -1
- package/dist/{chunk-89e42f2de63525a8.js → chunk-9037f8f927d4caff.js} +2 -2
- package/dist/{chunk-89e42f2de63525a8.js.map → chunk-9037f8f927d4caff.js.map} +1 -1
- package/dist/chunk-c4a5b4177603f458.js +8 -0
- package/dist/{chunk-056c4bd9d2ac239c.js.map → chunk-c4a5b4177603f458.js.map} +2 -2
- package/dist/chunk-ce40ec049b04e1d1.js +4 -0
- package/dist/{chunk-fea6a8b61878c7b7.js.map → chunk-ce40ec049b04e1d1.js.map} +2 -2
- package/dist/chunk-d8d25380b8f0c36e.js +18 -0
- package/dist/{chunk-de8906c4ce089607.js.map → chunk-d8d25380b8f0c36e.js.map} +15 -31
- package/dist/{chunk-7c5cdd2ff0c5a588.js → chunk-e3363367fe4893a2.js} +3 -3
- package/dist/{chunk-7c5cdd2ff0c5a588.js.map → chunk-e3363367fe4893a2.js.map} +1 -1
- package/dist/chunk-ebc6b30a0275d2f7.js +7 -0
- package/dist/chunk-ebc6b30a0275d2f7.js.map +65 -0
- package/dist/{chunk-8d48861243d49671.js → chunk-f53ed6a7a3dad8ec.js} +2 -2
- package/dist/{chunk-8d48861243d49671.js.map → chunk-f53ed6a7a3dad8ec.js.map} +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +3 -3
- package/dist/kernel/index.js +1 -1
- package/dist/services/index.js +2 -11
- package/dist/services/index.js.map +4 -15
- package/package.json +1 -1
- package/dist/chunk-056c4bd9d2ac239c.js +0 -8
- package/dist/chunk-1c2835b8ab6601e6.js +0 -5
- package/dist/chunk-1c2835b8ab6601e6.js.map +0 -64
- package/dist/chunk-4e3d8823a08776e9.js +0 -3
- package/dist/chunk-76ab9cb416bb617d.js +0 -4
- package/dist/chunk-7f095ebadaafbe12.js +0 -4
- package/dist/chunk-7f095ebadaafbe12.js.map +0 -10
- package/dist/chunk-c69698325e61e6cf.js +0 -4
- package/dist/chunk-de8906c4ce089607.js +0 -20
- package/dist/chunk-fea6a8b61878c7b7.js +0 -4
package/dist/services/index.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"../chunk-f5707f3bdba77464.js";import{H as B} from"../chunk-2c5231fcdfa1d6f2.js";import{I as U} from"../chunk-c83dcc500d5fefe3.js";import{O as _f,P as vA} from"../chunk-58fb175982676253.js";import{U as ng} from"../chunk-9e77cade8671df8d.js";import{$ as er,Aa as sg,Ba as eg,Ca as Ag,Da as Rg,V as tr,W as As,X as Eg,Y as cg,Z as Ig,_ as Pg,aa as fr,ba as Ge,ca as Ng,da as gh,ea as wh,fa as dh,ga as Ah,ha as Dg,ia as bm,ja as xm,ka as om,la as nm,ma as $g,na as yg,oa as Rh,pa as Ur,qa as Tr,ra as Ug,sa as pm,ta as um,ua as Tg,va as tm,wa as Mg,xa as Ls,ya as rg,za as se} from"../chunk-de8906c4ce089607.js";import{$a as yr,Ea as mg,Fa as gg,Ga as L,Ha as Ss,Ia as fs,La as Zr,Ma as Y,Na as Xm,Oa as Rs,Pa as kg,Qa as Zm,Ra as Vm,Sa as Jm,Ta as Vl,Ua as _m,Va as qm,Wa as Er,Xa as Bm,Ya as la,Za as aa,_a as Wh,ab as Z,cb as ir,fb as Nr,gb as Qh,hb as Dr,ib as Xh,jb as qs,kb as _r,mb as Nf,nb as Wr,ob as Nh,pb as i,qb as Zh,rb as jm,sb as im,tb as wg,ub as dg,wb as G,yb as Vh} from"../chunk-1c2835b8ab6601e6.js";import{Ab as TA,Bb as q} from"../chunk-225a2ac22f559ca4.js";import{Cb as Ew} from"../chunk-7f095ebadaafbe12.js";import{Db as fg} from"../chunk-7c5cdd2ff0c5a588.js";import"../chunk-4e3d8823a08776e9.js";import"../chunk-89e42f2de63525a8.js";class mr{}class rs extends mr{r;constructor(r=`${process.env.ROOT_DIR}/storage`){super();this.folderPath=r}async put(r){let s,e;if(r instanceof Blob)s=r,e=`${tr()}.${r.type.split("/")[1].split(";")[0]}`;else s=r.body,e=r.name;const f=s instanceof Buffer?s:Buffer.from(await s.arrayBuffer()),l=`${this.folderPath}/${e}`;return await Bun.write(l,f),e}async fetch(r){let s=process.env.BUCKET_NAME,e;if(typeof r==="string")e=r;else s=r.bucket??s,e=r.name;if(!e)throw new Error("Object name has to be specified");const f=`${this.folderPath}/${e}`,l=Bun.file(f),a=Bun.file(f).stream(),h=new Date(l.lastModified).toUTCString();return new Response(a,{headers:{"Content-Type":l.type,"Content-Length":String(l.size),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":h}})}}class qf extends B{constructor(){super(...arguments)}driver=new rs;boot(){}}function qg(r){return(s)=>async(e)=>{const{request:f}=e;if(L.isInstance(f)&&f.body&&r.runtime==="node"){if(r.requestHandler?.constructor?.name!=="FetchHttpHandler")f.headers={...f.headers,Expect:"100-continue"}}return s({...e,request:f})}}var jg={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},jf=(r)=>({applyToStack:(s)=>{s.add(qg(r),jg)}});var vr={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},ss=vr.WHEN_SUPPORTED,Ae={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},es=vr.WHEN_SUPPORTED,T;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(T||(T={}));var bf;(function(r){r.HEADER="header",r.TRAILER="trailer"})(bf||(bf={}));var{MD5:xf,CRC32:of}=T;var o;(function(r){r.ENV="env",r.CONFIG="shared config entry"})(o||(o={}));var gr=(r,s,e,f)=>{if(!(s in r))return;const l=r[s].toUpperCase();if(!Object.values(e).includes(l))throw new TypeError(`Cannot load ${f} '${s}'. Expected one of ${Object.values(e)}, got '${r[s]}'.`);return l};var ig="AWS_REQUEST_CHECKSUM_CALCULATION",bg="request_checksum_calculation",nf={environmentVariableSelector:(r)=>gr(r,ig,vr,o.ENV),configFileSelector:(r)=>gr(r,bg,vr,o.CONFIG),default:ss};var xg="AWS_RESPONSE_CHECKSUM_VALIDATION",og="response_checksum_validation",pf={environmentVariableSelector:(r)=>gr(r,xg,Ae,o.ENV),configFileSelector:(r)=>gr(r,og,Ae,o.CONFIG),default:es};var Gr=[T.CRC32,T.CRC32C,T.SHA1,T.SHA256],uf=[T.CRC32,T.CRC32C,T.SHA1,T.SHA256];var tf=(r,{requestChecksumRequired:s,requestAlgorithmMember:e},f)=>{const l=f?of:xf;if(!e||!r[e])return s?l:void 0;const a=r[e];if(!Gr.includes(a))throw new Error(`The checksum algorithm "${a}" is not supported by the client.`+` Select one of ${Gr}.`);return a};var wr=(r)=>r===T.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var rl=(r,s)=>{const e=r.toLowerCase();for(let f of Object.keys(s))if(e===f.toLowerCase())return!0;return!1};var dr=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!fs(r);var sl=U(ng(),1),{__extends:MR,__assign:CR,__rest:HR,__decorate:vR,__param:GR,__esDecorate:zR,__runInitializers:FR,__propKey:KR,__setFunctionName:LR,__metadata:WR,__awaiter:ls,__generator:as,__exportStar:QR,__createBinding:XR,__values:hs,__read:ZR,__spread:VR,__spreadArrays:JR,__spreadArray:BR,__await:YR,__asyncGenerator:OR,__asyncDelegator:_R,__asyncValues:qR,__makeTemplateObject:jR,__importStar:iR,__importDefault:bR,__classPrivateFieldGet:xR,__classPrivateFieldSet:oR,__classPrivateFieldIn:nR,__addDisposableResource:pR,__disposeResources:uR}=sl.default;import{Buffer as el} from"buffer";var fl=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?el.from(r,s):el.from(r)};var Re=(r)=>{const s=fl(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function zr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return pg(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var pg=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:Re;function Fr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function Kr(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}function Lr(r){if(!Uint32Array.from){var s=new Uint32Array(r.length),e=0;while(e<r.length)s[e]=r[e],e+=1;return s}return Uint32Array.from(r)}var Se=function(){function r(){this.crc32=new sr}return r.prototype.update=function(s){if(Fr(s))return;this.crc32.update(zr(s))},r.prototype.digest=function(){return ls(this,void 0,void 0,function(){return as(this,function(s){return[2,Kr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new sr},r}();var sr=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var e,f;try{for(var l=hs(s),a=l.next();!a.done;a=l.next()){var h=a.value;this.checksum=this.checksum>>>8^tg[(this.checksum^h)&255]}}catch(m){e={error:m}}finally{try{if(a&&!a.done&&(f=l.return))f.call(l)}finally{if(e)throw e.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var ug=[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],tg=Lr(ug);var ce=function(){function r(){this.crc32c=new Ee}return r.prototype.update=function(s){if(Fr(s))return;this.crc32c.update(zr(s))},r.prototype.digest=function(){return ls(this,void 0,void 0,function(){return as(this,function(s){return[2,Kr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new Ee},r}();var Ee=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var e,f;try{for(var l=hs(s),a=l.next();!a.done;a=l.next()){var h=a.value;this.checksum=this.checksum>>>8^sw[(this.checksum^h)&255]}}catch(m){e={error:m}}finally{try{if(a&&!a.done&&(f=l.return))f.call(l)}finally{if(e)throw e.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var rw=[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],sw=Lr(rw);var ms=(r,s)=>({[T.MD5]:s.md5,[T.CRC32]:Se,[T.CRC32C]:ce,[T.SHA1]:s.sha1,[T.SHA256]:s.sha256})[r];var gs=(r,s)=>{const e=new r;return e.update(Y(s||"")),e.digest()};var ll={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},al=(r,s)=>(e,f)=>async(l)=>{if(!L.isInstance(l.request))return e(l);const{request:a}=l,{body:h,headers:m}=a,{base64Encoder:g,streamHasher:w}=r,{input:E,requestChecksumRequired:I,requestAlgorithmMember:P}=s,N=tf(E,{requestChecksumRequired:I,requestAlgorithmMember:P},!!f.isS3ExpressBucket);let y=h,V=m;if(N){const b=wr(N),Hr=ms(N,r);if(dr(h)){const{getAwsChunkedEncodingStream:de,bodyLengthChecker:_g}=r;y=de(h,{base64Encoder:g,bodyLengthChecker:_g,checksumLocationName:b,checksumAlgorithmFn:Hr,streamHasher:w}),V={...m,"content-encoding":m["content-encoding"]?`${m["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":m["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":b},delete V["content-length"]}else if(!rl(b,m)){const de=await gs(Hr,h);V={...m,[b]:g(de)}}}return await e({...l,request:{...a,headers:V,body:y}})};var ws=(r=[])=>{const s=[];for(let e of uf){if(!r.includes(e)||!Gr.includes(e))continue;s.push(e)}return s};var hl=(r)=>{const s=r.lastIndexOf("-");if(s!==-1){const e=r.slice(s+1);if(!e.startsWith("0")){const f=parseInt(e,10);if(!isNaN(f)&&f>=1&&f<=1e4)return!0}}return!1};import{Transform as ew} from"stream";function Ie(r){const s=new ew;return s.push(r),s.push(null),s}var ml=async(r,{streamHasher:s,checksumAlgorithmFn:e,base64Encoder:f})=>{const l=dr(r)?s(e,r):gs(e,r);return f(await l)};var gl=async(r,{config:s,responseAlgorithms:e})=>{const f=ws(e),{body:l,headers:a}=r;for(let h of f){const m=wr(h),g=a[m];if(g){const w=ms(h,s),{streamHasher:E,base64Encoder:I}=s,P=await ml(l,{streamHasher:E,checksumAlgorithmFn:w,base64Encoder:I});if(P===g)break;throw new Error(`Checksum mismatch: expected "${P}" but received "${g}"`+` in response header "${m}".`)}}};var wl={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},dl=(r,s)=>(e,f)=>async(l)=>{if(!L.isInstance(l.request))return e(l);const a=l.input,h=await e(l),m=h.response;let g=void 0;const{requestValidationModeMember:w,responseAlgorithms:E}=s;if(w&&a[w]==="ENABLED"){const{clientName:I,commandName:P}=f;if(I==="S3Client"&&P==="GetObjectCommand"&&ws(E).every((V)=>{const ur=wr(V),b=m.headers[ur];return!b||hl(b)}))return h;const y=dr(m.body);if(y)g=await r.streamCollector(m.body),m.body=Ie(g);if(await gl(h.response,{config:r,responseAlgorithms:E}),y&&g)m.body=Ie(g)}return h};var ds=(r,s)=>({applyToStack:(e)=>{e.add(al(r,s),ll),e.addRelativeTo(dl(r,s),wl)}});var Pe=U(As(),1);var Al=(r)=>({...r,requestChecksumCalculation:Pe.normalizeProvider(r.requestChecksumCalculation??ss),responseChecksumValidation:Pe.normalizeProvider(r.responseChecksumValidation??es)});function lw(){return(r,s)=>async(e)=>{const{request:f}=e;if(L.isInstance(f)){if(!(fw in f.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof Rs))s.logger.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.");else console.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.")}return r({...e})}}var fw="content-length",aw={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},Rl=(r)=>({applyToStack:(s)=>{s.add(lw(),aw)}});var Sl=(r)=>{return(s,e)=>async(f)=>{const l=await r.region(),a=r.region;let h=()=>{};if(e.__s3RegionRedirect)Object.defineProperty(r,"region",{writable:!1,value:async()=>{return e.__s3RegionRedirect}}),h=()=>Object.defineProperty(r,"region",{writable:!0,value:a});try{const m=await s(f);if(e.__s3RegionRedirect){h();const g=await r.region();if(l!==g)throw new Error("Region was not restored following S3 region redirect.")}return m}catch(m){throw h(),m}}},El={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function hw(r){return(s,e)=>async(f)=>{try{return await s(f)}catch(l){if(r.followRegionRedirects&&l?.$metadata?.httpStatusCode===301){try{const a=l.$response.headers["x-amz-bucket-region"];e.logger?.debug(`Redirecting from ${await r.region()} to ${a}`),e.__s3RegionRedirect=a}catch(a){throw new Error("Region redirect failed: "+a)}return s(f)}else throw l}}}var mw={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},cl=(r)=>({applyToStack:(s)=>{s.add(hw(r),mw),s.addRelativeTo(Sl(r),El)}});var gw=(r)=>{return(s,e)=>async(f)=>{const l=await s(f),{response:a}=l;if(Ss.isInstance(a)){if(a.headers.expires){a.headers.expiresstring=a.headers.expires;try{Wr(a.headers.expires)}catch(h){e.logger?.warn(`AWS SDK Warning for ${e.clientName}::${e.commandName} response parsing (${a.headers.expires}): ${h}`),delete a.headers.expires}}}return l}},ww={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},Il=(r)=>({applyToStack:(s)=>{s.addRelativeTo(gw(r),ww)}});class Ar{constructor(r={}){this.data=r,this.lastPurgeTime=Date.now()}get(r){const s=this.data[r];if(!s)return;return s}set(r,s){return this.data[r]=s,s}delete(r){delete this.data[r]}async purgeExpired(){const r=Date.now();if(this.lastPurgeTime+Ar.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>r)return;for(let s in this.data){const e=this.data[s];if(!e.isRefreshing){const f=await e.identity;if(f.expiration){if(f.expiration.getTime()<r)delete this.data[s]}}}}}Ar.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class Rr{constructor(r,s=!1,e=Date.now()){this._identity=r,this.isRefreshing=s,this.accessed=e}get identity(){return this.accessed=Date.now(),this._identity}}class Sr{constructor(r,s=new Ar){this.createSessionFn=r,this.cache=s}async getS3ExpressIdentity(r,s){const e=s.Bucket,{cache:f}=this,l=f.get(e);if(l)return l.identity.then((a)=>{if((a.expiration?.getTime()??0)<Date.now())return f.set(e,new Rr(this.getIdentity(e))).identity;if((a.expiration?.getTime()??0)<Date.now()+Sr.REFRESH_WINDOW_MS&&!l.isRefreshing)l.isRefreshing=!0,this.getIdentity(e).then((g)=>{f.set(e,new Rr(Promise.resolve(g)))});return a});return f.set(e,new Rr(this.getIdentity(e))).identity}async getIdentity(r){await this.cache.purgeExpired().catch((f)=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+f)});const s=await this.createSessionFn(r);if(!s.Credentials?.AccessKeyId||!s.Credentials?.SecretAccessKey)throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:s.Credentials.AccessKeyId,secretAccessKey:s.Credentials.SecretAccessKey,sessionToken:s.Credentials.SessionToken,expiration:s.Credentials.Expiration?new Date(s.Credentials.Expiration):void 0}}}Sr.REFRESH_WINDOW_MS=60000;var Vr=U(Er(),1),Me=U(As(),1),jl=U(Vl(),1);var Pl="X-Amz-Algorithm",kl="X-Amz-Credential",Nl="X-Amz-Date",Dl="X-Amz-SignedHeaders",$l="X-Amz-Expires",yl="X-Amz-Signature",Ul="X-Amz-Security-Token";var Tl="authorization",ke="X-Amz-Date".toLowerCase();var Ml=["authorization",ke,"date"],Cl="X-Amz-Signature".toLowerCase(),Qr="x-amz-content-sha256",Hl="X-Amz-Security-Token".toLowerCase();var vl={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Gl=/^proxy-/,zl=/^sec-/;var Es="AWS4-HMAC-SHA256";var Fl="AWS4-HMAC-SHA256-PAYLOAD",Kl="UNSIGNED-PAYLOAD",Ll=50,Ne="aws4_request",Wl=604800;var Xl=U(Er(),1);var cs={},De=[],Is=(r,s,e)=>`${r}/${s}/${e}/${Ne}`,Zl=async(r,s,e,f,l)=>{const a=await Ql(r,s.secretAccessKey,s.accessKeyId),h=`${e}:${f}:${l}:${Xl.toHex(a)}:${s.sessionToken}`;if(h in cs)return cs[h];De.push(h);while(De.length>Ll)delete cs[De.shift()];let m=`AWS4${s.secretAccessKey}`;for(let g of[e,f,l,Ne])m=await Ql(r,m,g);return cs[h]=m};var Ql=(r,s,e)=>{const f=new r(s);return f.update(Y(e)),f.digest()};var Ps=({headers:r},s,e)=>{const f={};for(let l of Object.keys(r).sort()){if(r[l]==null)continue;const a=l.toLowerCase();if(a in vl||s?.has(a)||Gl.test(a)||zl.test(a)){if(!e||e&&!e.has(a))continue}f[a]=r[l].trim().replace(/\s+/g," ")}return f};var ks=U(Vl(),1);var $e=({query:r={}})=>{const s=[],e={};for(let f of Object.keys(r)){if(f.toLowerCase()===Cl)continue;const l=ks.escapeUri(f);s.push(l);const a=r[f];if(typeof a==="string")e[l]=`${l}=${ks.escapeUri(a)}`;else if(Array.isArray(a))e[l]=a.slice(0).reduce((h,m)=>h.concat([`${l}=${ks.escapeUri(m)}`]),[]).sort().join("&")}return s.sort().map((f)=>e[f]).filter((f)=>f).join("&")};var Jl=U(Er(),1);var Xr=async({headers:r,body:s},e)=>{for(let f of Object.keys(r))if(f.toLowerCase()===Qr)return r[f];if(s==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof s==="string"||ArrayBuffer.isView(s)||fs(s)){const f=new e;return f.update(Y(s)),Jl.toHex(await f.digest())}return Kl};var Ns=U(Er(),1);var Yl=function(r){for(let s=0;s<8;s++)r[s]^=255;for(let s=7;s>-1;s--)if(r[s]++,r[s]!==0)break};class ye{format(r){const s=[];for(let l of Object.keys(r)){const a=Zr(l);s.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(r[l]))}const e=new Uint8Array(s.reduce((l,a)=>l+a.byteLength,0));let f=0;for(let l of s)e.set(l,f),f+=l.byteLength;return e}formatHeaderValue(r){switch(r.type){case"boolean":return Uint8Array.from([r.value?0:1]);case"byte":return Uint8Array.from([2,r.value]);case"short":const s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,r.value,!1),new Uint8Array(s.buffer);case"integer":const e=new DataView(new ArrayBuffer(5));return e.setUint8(0,4),e.setInt32(1,r.value,!1),new Uint8Array(e.buffer);case"long":const f=new Uint8Array(9);return f[0]=5,f.set(r.value.bytes,1),f;case"binary":const l=new DataView(new ArrayBuffer(3+r.value.byteLength));l.setUint8(0,6),l.setUint16(1,r.value.byteLength,!1);const a=new Uint8Array(l.buffer);return a.set(r.value,3),a;case"string":const h=Zr(r.value),m=new DataView(new ArrayBuffer(3+h.byteLength));m.setUint8(0,7),m.setUint16(1,h.byteLength,!1);const g=new Uint8Array(m.buffer);return g.set(h,3),g;case"timestamp":const w=new Uint8Array(9);return w[0]=8,w.set(Ue.fromNumber(r.value.valueOf()).bytes,1),w;case"uuid":if(!dw.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const E=new Uint8Array(17);return E[0]=9,E.set(Ns.fromHex(r.value.replace(/\-/g,"")),1),E}}}var Bl;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(Bl||(Bl={}));var dw=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class Ue{constructor(r){if(this.bytes=r,r.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(r){if(r>9223372036854776000||r<-9223372036854776000)throw new Error(`${r} is too large (or, if negative, too small) to represent as an Int64`);const s=new Uint8Array(8);for(let e=7,f=Math.abs(Math.round(r));e>-1&&f>0;e--,f/=256)s[e]=f;if(r<0)Yl(s);return new Ue(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)Yl(r);return parseInt(Ns.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}var Ol=(r,s)=>{r=r.toLowerCase();for(let e of Object.keys(s))if(r===e.toLowerCase())return!0;return!1};var Te=(r,s={})=>{const{headers:e,query:f={}}=L.clone(r);for(let l of Object.keys(e)){const a=l.toLowerCase();if(a.slice(0,6)==="x-amz-"&&!s.unhoistableHeaders?.has(a))f[l]=e[l],delete e[l]}return{...r,headers:e,query:f}};var Ds=(r)=>{r=L.clone(r);for(let s of Object.keys(r.headers))if(Ml.indexOf(s.toLowerCase())>-1)delete r.headers[s];return r};var _l=(r)=>Aw(r).toISOString().replace(/\.\d{3}Z$/,"Z"),Aw=(r)=>{if(typeof r==="number")return new Date(r*1000);if(typeof r==="string"){if(Number(r))return new Date(Number(r)*1000);return new Date(r)}return r};class Ce{constructor({applyChecksum:r,credentials:s,region:e,service:f,sha256:l,uriEscapePath:a=!0}){this.headerFormatter=new ye,this.service=f,this.sha256=l,this.uriEscapePath=a,this.applyChecksum=typeof r==="boolean"?r:!0,this.regionProvider=Me.normalizeProvider(e),this.credentialProvider=Me.normalizeProvider(s)}async presign(r,s={}){const{signingDate:e=new Date,expiresIn:f=3600,unsignableHeaders:l,unhoistableHeaders:a,signableHeaders:h,signingRegion:m,signingService:g}=s,w=await this.credentialProvider();this.validateResolvedCredentials(w);const E=m??await this.regionProvider(),{longDate:I,shortDate:P}=$s(e);if(f>Wl)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const N=Is(P,E,g??this.service),y=Te(Ds(r),{unhoistableHeaders:a});if(w.sessionToken)y.query[Ul]=w.sessionToken;y.query[Pl]=Es,y.query[kl]=`${w.accessKeyId}/${N}`,y.query[Nl]=I,y.query[$l]=f.toString(10);const V=Ps(y,l,h);return y.query[Dl]=ql(V),y.query[yl]=await this.getSignature(I,N,this.getSigningKey(w,E,P,g),this.createCanonicalRequest(y,V,await Xr(r,this.sha256))),y}async sign(r,s){if(typeof r==="string")return this.signString(r,s);else if(r.headers&&r.payload)return this.signEvent(r,s);else if(r.message)return this.signMessage(r,s);else return this.signRequest(r,s)}async signEvent({headers:r,payload:s},{signingDate:e=new Date,priorSignature:f,signingRegion:l,signingService:a}){const h=l??await this.regionProvider(),{shortDate:m,longDate:g}=$s(e),w=Is(m,h,a??this.service),E=await Xr({headers:{},body:s},this.sha256),I=new this.sha256;I.update(r);const P=Vr.toHex(await I.digest()),N=[Fl,g,w,f,P,E].join("\n");return this.signString(N,{signingDate:e,signingRegion:h,signingService:a})}async signMessage(r,{signingDate:s=new Date,signingRegion:e,signingService:f}){return this.signEvent({headers:this.headerFormatter.format(r.message.headers),payload:r.message.body},{signingDate:s,signingRegion:e,signingService:f,priorSignature:r.priorSignature}).then((a)=>{return{message:r.message,signature:a}})}async signString(r,{signingDate:s=new Date,signingRegion:e,signingService:f}={}){const l=await this.credentialProvider();this.validateResolvedCredentials(l);const a=e??await this.regionProvider(),{shortDate:h}=$s(s),m=new this.sha256(await this.getSigningKey(l,a,h,f));return m.update(Y(r)),Vr.toHex(await m.digest())}async signRequest(r,{signingDate:s=new Date,signableHeaders:e,unsignableHeaders:f,signingRegion:l,signingService:a}={}){const h=await this.credentialProvider();this.validateResolvedCredentials(h);const m=l??await this.regionProvider(),g=Ds(r),{longDate:w,shortDate:E}=$s(s),I=Is(E,m,a??this.service);if(g.headers[ke]=w,h.sessionToken)g.headers[Hl]=h.sessionToken;const P=await Xr(g,this.sha256);if(!Ol(Qr,g.headers)&&this.applyChecksum)g.headers[Qr]=P;const N=Ps(g,f,e),y=await this.getSignature(w,I,this.getSigningKey(h,m,E,a),this.createCanonicalRequest(g,N,P));return g.headers[Tl]=`${Es} `+`Credential=${h.accessKeyId}/${I}, `+`SignedHeaders=${ql(N)}, `+`Signature=${y}`,g}createCanonicalRequest(r,s,e){const f=Object.keys(s).sort();return`${r.method}
|
|
3
|
-
${this.getCanonicalPath(r)}
|
|
4
|
-
${$e(r)}
|
|
5
|
-
${f.map((l)=>`${l}:${s[l]}`).join("\n")}
|
|
2
|
+
import"../chunk-643d1c40e2a0f67f.js";import{H as c} from"../chunk-2c5231fcdfa1d6f2.js";import{I as z} from"../chunk-c83dcc500d5fefe3.js";import{O as Mf,P as Vd} from"../chunk-58fb175982676253.js";import{U as sg} from"../chunk-9e77cade8671df8d.js";import{$ as $m,Aa as sm,Ba as Km,Ca as $s,Da as em,Ea as Os,Fa as hm,Ga as _a,Ha as ja,Ia as am,Ja as km,Ka as Pm,V as br,W as Zf,X as Oa,Y as ss,Z as qa,_ as hl,aa as Dm,ba as Um,ca as Mm,da as Pg,ea as sr,fa as lr,ga as Gd,ha as gl,ia as Cm,ja as Ah,ka as Eh,la as Ih,ma as kh,na as Fm,oa as na,pa,qa as ua,ra as ta,sa as zm,ta as Gm,ua as Ph,va as Ur,wa as Mr,xa as ym,ya as rm,za as Wm} from"../chunk-d8d25380b8f0c36e.js";import{$a as H,Ab as fm,La as Rm,Ma as Am,Na as X,Oa as as,Qa as hs,Sa as Tm,Xa as Va,Ya as de,Za as ch,_a as Dr,bb as Yr,eb as Pr,fb as Yh,gb as Nr,hb as Bh,ib as Ks,jb as Xr,lb as ul,mb as Lr,nb as Ch,ob as j,pb as Oh,qb as xa,rb as oa,sb as Em,tb as Im,vb as y,xb as qh,zb as lm} from"../chunk-ebc6b30a0275d2f7.js";import{Bb as zd,Cb as q} from"../chunk-0a78bb530df845c9.js";import"../chunk-17c3f49735b660d5.js";import{Hb as mm} from"../chunk-e3363367fe4893a2.js";import"../chunk-79168b7162a45077.js";import"../chunk-9037f8f927d4caff.js";class ar{}class xr extends ar{r;constructor(r=`${process.env.ROOT_DIR}/storage`){super();this.folderPath=r}async put(r){let s,l;if(r instanceof Blob)s=r,l=`${br()}.${r.type.split("/")[1].split(";")[0]}`;else s=r.body,l=r.name;const f=s instanceof Buffer?s:Buffer.from(await s.arrayBuffer()),e=`${this.folderPath}/${l}`;return await Bun.write(e,f),l}async fetch(r){let s=process.env.BUCKET_NAME,l;if(typeof r==="string")l=r;else s=r.bucket??s,l=r.name;if(!l)throw new Error("Object name has to be specified");const f=`${this.folderPath}/${l}`,e=Bun.file(f),h=Bun.file(f).stream(),m=new Date(e.lastModified).toUTCString();return new Response(h,{headers:{"Content-Type":e.type,"Content-Length":String(e.size),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":m}})}}class Tf extends c{constructor(){super(...arguments)}driver=new xr;boot(){}}function om(r){return(s)=>async(l)=>{const{request:f}=l;if(X.isInstance(f)&&f.body&&r.runtime==="node"){if(r.requestHandler?.constructor?.name!=="FetchHttpHandler")f.headers={...f.headers,Expect:"100-continue"}}return s({...l,request:f})}}var nm={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},Cf=(r)=>({applyToStack:(s)=>{s.add(om(r),nm)}});var zr={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},or=zr.WHEN_SUPPORTED,us={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},nr=zr.WHEN_SUPPORTED,U;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(U||(U={}));var Ff;(function(r){r.HEADER="header",r.TRAILER="trailer"})(Ff||(Ff={}));var{MD5:zf,CRC32:Gf}=U;var x;(function(r){r.ENV="env",r.CONFIG="shared config entry"})(x||(x={}));var mr=(r,s,l,f)=>{if(!(s in r))return;const e=r[s].toUpperCase();if(!Object.values(l).includes(e))throw new TypeError(`Cannot load ${f} '${s}'. Expected one of ${Object.values(l)}, got '${r[s]}'.`);return e};var pm="AWS_REQUEST_CHECKSUM_CALCULATION",um="request_checksum_calculation",yf={environmentVariableSelector:(r)=>mr(r,pm,zr,x.ENV),configFileSelector:(r)=>mr(r,um,zr,x.CONFIG),default:or};var tm="AWS_RESPONSE_CHECKSUM_VALIDATION",rg="response_checksum_validation",Wf={environmentVariableSelector:(r)=>mr(r,tm,us,x.ENV),configFileSelector:(r)=>mr(r,rg,us,x.CONFIG),default:nr};var Gr=[U.CRC32,U.CRC32C,U.SHA1,U.SHA256],Kf=[U.CRC32,U.CRC32C,U.SHA1,U.SHA256];var Vf=(r,{requestChecksumRequired:s,requestAlgorithmMember:l},f)=>{const e=f?Gf:zf;if(!l||!r[l])return s?e:void 0;const h=r[l];if(!Gr.includes(h))throw new Error(`The checksum algorithm "${h}" is not supported by the client.`+` Select one of ${Gr}.`);return h};var gr=(r)=>r===U.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var Lf=(r,s)=>{const l=r.toLowerCase();for(let f of Object.keys(s))if(l===f.toLowerCase())return!0;return!1};var wr=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!Zf(r);var vf=z(sg(),1),{__extends:y3,__assign:W3,__rest:K3,__decorate:V3,__param:L3,__esDecorate:Z3,__runInitializers:v3,__propKey:H3,__setFunctionName:J3,__metadata:X3,__awaiter:pr,__generator:ur,__exportStar:Q3,__createBinding:c3,__values:tr,__read:Y3,__spread:B3,__spreadArrays:O3,__spreadArray:q3,__await:_3,__asyncGenerator:j3,__asyncDelegator:i3,__asyncValues:b3,__makeTemplateObject:x3,__importStar:o3,__importDefault:n3,__classPrivateFieldGet:p3,__classPrivateFieldSet:u3,__classPrivateFieldIn:t3,__addDisposableResource:rS,__disposeResources:sS}=vf.default;import{Buffer as Hf} from"buffer";var Jf=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?Hf.from(r,s):Hf.from(r)};var ts=(r)=>{const s=Jf(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function yr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return lg(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var lg=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:ts;function Wr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function Kr(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}function Vr(r){if(!Uint32Array.from){var s=new Uint32Array(r.length),l=0;while(l<r.length)s[l]=r[l],l+=1;return s}return Uint32Array.from(r)}var rl=function(){function r(){this.crc32=new rr}return r.prototype.update=function(s){if(Wr(s))return;this.crc32.update(yr(s))},r.prototype.digest=function(){return pr(this,void 0,void 0,function(){return ur(this,function(s){return[2,Kr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new rr},r}();var rr=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var l,f;try{for(var e=tr(s),h=e.next();!h.done;h=e.next()){var m=h.value;this.checksum=this.checksum>>>8^eg[(this.checksum^m)&255]}}catch(a){l={error:a}}finally{try{if(h&&!h.done&&(f=e.return))f.call(e)}finally{if(l)throw l.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var fg=[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],eg=Vr(fg);var ll=function(){function r(){this.crc32c=new sl}return r.prototype.update=function(s){if(Wr(s))return;this.crc32c.update(yr(s))},r.prototype.digest=function(){return pr(this,void 0,void 0,function(){return ur(this,function(s){return[2,Kr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new sl},r}();var sl=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var l,f;try{for(var e=tr(s),h=e.next();!h.done;h=e.next()){var m=h.value;this.checksum=this.checksum>>>8^ag[(this.checksum^m)&255]}}catch(a){l={error:a}}finally{try{if(h&&!h.done&&(f=e.return))f.call(e)}finally{if(l)throw l.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var hg=[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],ag=Vr(hg);var rs=(r,s)=>({[U.MD5]:s.md5,[U.CRC32]:rl,[U.CRC32C]:ll,[U.SHA1]:s.sha1,[U.SHA256]:s.sha256})[r];var ls=(r,s)=>{const l=new r;return l.update(ss(s||"")),l.digest()};var Xf={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},Qf=(r,s)=>(l,f)=>async(e)=>{if(!X.isInstance(e.request))return l(e);const{request:h}=e,{body:m,headers:a}=h,{base64Encoder:g,streamHasher:R}=r,{input:N,requestChecksumRequired:$,requestAlgorithmMember:D}=s,M=Vf(N,{requestChecksumRequired:$,requestAlgorithmMember:D},!!f.isS3ExpressBucket);let Q=m,B=a;if(M){const i=gr(M),Fr=rs(M,r);if(wr(m)){const{getAwsChunkedEncodingStream:ps,bodyLengthChecker:xm}=r;Q=ps(m,{base64Encoder:g,bodyLengthChecker:xm,checksumLocationName:i,checksumAlgorithmFn:Fr,streamHasher:R}),B={...a,"content-encoding":a["content-encoding"]?`${a["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":a["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":i},delete B["content-length"]}else if(!Lf(i,a)){const ps=await ls(Fr,m);B={...a,[i]:g(ps)}}}return await l({...e,request:{...h,headers:B,body:Q}})};var fs=(r=[])=>{const s=[];for(let l of Kf){if(!r.includes(l)||!Gr.includes(l))continue;s.push(l)}return s};var cf=(r)=>{const s=r.lastIndexOf("-");if(s!==-1){const l=r.slice(s+1);if(!l.startsWith("0")){const f=parseInt(l,10);if(!isNaN(f)&&f>=1&&f<=1e4)return!0}}return!1};import{Transform as mg} from"stream";function fl(r){const s=new mg;return s.push(r),s.push(null),s}var Yf=async(r,{streamHasher:s,checksumAlgorithmFn:l,base64Encoder:f})=>{const e=wr(r)?s(l,r):ls(l,r);return f(await e)};var Bf=async(r,{config:s,responseAlgorithms:l})=>{const f=fs(l),{body:e,headers:h}=r;for(let m of f){const a=gr(m),g=h[a];if(g){const R=rs(m,s),{streamHasher:N,base64Encoder:$}=s,D=await Yf(e,{streamHasher:N,checksumAlgorithmFn:R,base64Encoder:$});if(D===g)break;throw new Error(`Checksum mismatch: expected "${D}" but received "${g}"`+` in response header "${a}".`)}}};var Of={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},qf=(r,s)=>(l,f)=>async(e)=>{if(!X.isInstance(e.request))return l(e);const h=e.input,m=await l(e),a=m.response;let g=void 0;const{requestValidationModeMember:R,responseAlgorithms:N}=s;if(R&&h[R]==="ENABLED"){const{clientName:$,commandName:D}=f;if($==="S3Client"&&D==="GetObjectCommand"&&fs(N).every((B)=>{const ir=gr(B),i=a.headers[ir];return!i||cf(i)}))return m;const Q=wr(a.body);if(Q)g=await r.streamCollector(a.body),a.body=fl(g);if(await Bf(m.response,{config:r,responseAlgorithms:N}),Q&&g)a.body=fl(g)}return m};var es=(r,s)=>({applyToStack:(l)=>{l.add(Qf(r,s),Xf),l.addRelativeTo(qf(r,s),Of)}});var el=z(hl(),1);var _f=(r)=>({...r,requestChecksumCalculation:el.normalizeProvider(r.requestChecksumCalculation??or),responseChecksumValidation:el.normalizeProvider(r.responseChecksumValidation??nr)});function wg(){return(r,s)=>async(l)=>{const{request:f}=l;if(X.isInstance(f)){if(!(gg in f.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof hs))s.logger.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.");else console.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.")}return r({...l})}}var gg="content-length",dg={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},jf=(r)=>({applyToStack:(s)=>{s.add(wg(),dg)}});var bf=(r)=>{return(s,l)=>async(f)=>{const e=await r.region(),h=r.region;let m=()=>{};if(l.__s3RegionRedirect)Object.defineProperty(r,"region",{writable:!1,value:async()=>{return l.__s3RegionRedirect}}),m=()=>Object.defineProperty(r,"region",{writable:!0,value:h});try{const a=await s(f);if(l.__s3RegionRedirect){m();const g=await r.region();if(e!==g)throw new Error("Region was not restored following S3 region redirect.")}return a}catch(a){throw m(),a}}},xf={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function Sg(r){return(s,l)=>async(f)=>{try{return await s(f)}catch(e){if(r.followRegionRedirects&&e?.$metadata?.httpStatusCode===301){try{const h=e.$response.headers["x-amz-bucket-region"];l.logger?.debug(`Redirecting from ${await r.region()} to ${h}`),l.__s3RegionRedirect=h}catch(h){throw new Error("Region redirect failed: "+h)}return s(f)}else throw e}}}var Rg={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},of=(r)=>({applyToStack:(s)=>{s.add(Sg(r),Rg),s.addRelativeTo(bf(r),xf)}});var Ag=(r)=>{return(s,l)=>async(f)=>{const e=await s(f),{response:h}=e;if(as.isInstance(h)){if(h.headers.expires){h.headers.expiresstring=h.headers.expires;try{Lr(h.headers.expires)}catch(m){l.logger?.warn(`AWS SDK Warning for ${l.clientName}::${l.commandName} response parsing (${h.headers.expires}): ${m}`),delete h.headers.expires}}}return e}},Eg={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},nf=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Ag(r),Eg)}});class dr{constructor(r={}){this.data=r,this.lastPurgeTime=Date.now()}get(r){const s=this.data[r];if(!s)return;return s}set(r,s){return this.data[r]=s,s}delete(r){delete this.data[r]}async purgeExpired(){const r=Date.now();if(this.lastPurgeTime+dr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>r)return;for(let s in this.data){const l=this.data[s];if(!l.isRefreshing){const f=await l.identity;if(f.expiration){if(f.expiration.getTime()<r)delete this.data[s]}}}}}dr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class Sr{constructor(r,s=!1,l=Date.now()){this._identity=r,this.isRefreshing=s,this.accessed=l}get identity(){return this.accessed=Date.now(),this._identity}}class Rr{constructor(r,s=new dr){this.createSessionFn=r,this.cache=s}async getS3ExpressIdentity(r,s){const l=s.Bucket,{cache:f}=this,e=f.get(l);if(e)return e.identity.then((h)=>{if((h.expiration?.getTime()??0)<Date.now())return f.set(l,new Sr(this.getIdentity(l))).identity;if((h.expiration?.getTime()??0)<Date.now()+Rr.REFRESH_WINDOW_MS&&!e.isRefreshing)e.isRefreshing=!0,this.getIdentity(l).then((g)=>{f.set(l,new Sr(Promise.resolve(g)))});return h});return f.set(l,new Sr(this.getIdentity(l))).identity}async getIdentity(r){await this.cache.purgeExpired().catch((f)=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+f)});const s=await this.createSessionFn(r);if(!s.Credentials?.AccessKeyId||!s.Credentials?.SecretAccessKey)throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:s.Credentials.AccessKeyId,secretAccessKey:s.Credentials.SecretAccessKey,sessionToken:s.Credentials.SessionToken,expiration:s.Credentials.Expiration?new Date(s.Credentials.Expiration):void 0}}}Rr.REFRESH_WINDOW_MS=60000;var le=z(Pg(),1);var pf="Directory",uf="S3Express",tf="sigv4-s3express",ms="X-Amz-S3session-Token",Zr=ms.toLowerCase(),Ig="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",kg="s3_disable_express_session_auth",al={environmentVariableSelector:(r)=>sr(r,Ig,lr.ENV),configFileSelector:(r)=>sr(r,kg,lr.CONFIG),default:!1};var re=function(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}},se=function(r,s){const l=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),f=r.credentialProvider,e=()=>{return clearTimeout(l),r.credentialProvider=f,Promise.resolve(s)};r.credentialProvider=e};class gs extends le.SignatureV4{async signWithCredentials(r,s,l){const f=re(s);r.headers[Zr]=s.sessionToken;const e=this;return se(e,f),e.signRequest(r,l??{})}async presignWithCredentials(r,s,l){const f=re(s);return delete r.headers[Zr],r.headers[ms]=s.sessionToken,r.query=r.query??{},r.query[ms]=s.sessionToken,se(this,f),this.presign(r,l)}}var fe=(r)=>{return(s,l)=>async(f)=>{if(l.endpointV2){const e=l.endpointV2,h=e.properties?.authSchemes?.[0]?.name===tf;if(e.properties?.backend===uf||e.properties?.bucketType===pf)l.isS3ExpressBucket=!0;if(h){const a=f.input.Bucket;if(a){const g=await r.s3ExpressIdentityProvider.getS3ExpressIdentity(await r.credentials(),{Bucket:a});if(l.s3ExpressIdentity=g,X.isInstance(f.request)&&g.sessionToken)f.request.headers[Zr]=g.sessionToken}}}return s(f)}},ee={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},ml=(r)=>({applyToStack:(s)=>{s.add(fe(r),ee)}});var ae=z(gl(),1);var me=z(hl(),1);var he=async(r,s,l,f)=>{const e=await f.signWithCredentials(l,r,{});if(e.headers["X-Amz-Security-Token"]||e.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return e};var Ng=(r)=>(s)=>{throw s},$g=(r,s)=>{};var ge=(r)=>(s,l)=>async(f)=>{if(!X.isInstance(f.request))return s(f);const h=me.getSmithyContext(l).selectedHttpAuthScheme;if(!h)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:m={}},identity:a,signer:g}=h;let R;if(l.s3ExpressIdentity)R=await he(l.s3ExpressIdentity,m,f.request,await r.signer());else R=await g.sign(f.request,a,m);const N=await s({...f,request:R}).catch((g.errorHandler||Ng)(m));return(g.successHandler||$g)(N.response,m),N},wl=(r)=>({applyToStack:(s)=>{s.addRelativeTo(ge(r),ae.httpSigningMiddlewareOptions)}});var we=(r,{session:s})=>{const[l,f]=s;return{...r,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,followRegionRedirects:r.followRegionRedirects??!1,s3ExpressIdentityProvider:r.s3ExpressIdentityProvider??new Rr(async(e)=>l().send(new f({Bucket:e,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var ws=z(de(),1),Dg={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Ug=3000,Mg=(r)=>(s,l)=>async(f)=>{const e=await s(f),{response:h}=e;if(!as.isInstance(h))return e;const{statusCode:m,body:a}=h;if(m<200||m>=300)return e;if(!(typeof a?.stream==="function"||typeof a?.pipe==="function"||typeof a?.tee==="function"))return e;let R=a,N=a;if(a&&typeof a==="object"&&!(a instanceof Uint8Array))[R,N]=await ws.splitStream(a);h.body=N;const $=await Tg(R,{streamCollector:async(M)=>{return ws.headStream(M,Ug)}});if(typeof R?.destroy==="function")R.destroy();const D=r.utf8Encoder($.subarray($.length-16));if($.length===0&&Dg[l.commandName]){const M=new Error("S3 aborted request");throw M.name="InternalError",M}if(D&&D.endsWith("</Error>"))h.statusCode=400;return e},Tg=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},Cg={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},ds=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Mg(r),Cg)}});var dl=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function Se(r){return(s,l)=>async(f)=>{if(r.bucketEndpoint){const e=l.endpointV2;if(e){const h=f.input.Bucket;if(typeof h==="string")try{const m=new URL(h);l.endpointV2={...e,url:m}}catch(m){const a=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${h} could not be parsed as URL.`;if(l.logger?.constructor?.name==="NoOpLogger")console.warn(a);else l.logger?.warn?.(a);throw m}}}return s(f)}}var Re={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Fg({bucketEndpoint:r}){return(s)=>async(l)=>{const{input:{Bucket:f}}=l;if(!r&&typeof f==="string"&&!dl(f)&&f.indexOf("/")>=0){const e=new Error(`Bucket name shouldn't contain '/', received '${f}'`);throw e.name="InvalidBucketName",e}return s({...l})}}var zg={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},Ae=(r)=>({applyToStack:(s)=>{s.add(Fg(r),zg),s.addRelativeTo(Se(r),Re)}});var Cr=z(gl(),1);var Ee=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var Ds=z($s(),1);var Ss={CrtSignerV4:null};class Sl{constructor(r){this.sigv4Signer=new gs(r),this.signerOptions=r}async sign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().sign(r,s)}return this.sigv4Signer.sign(r,s)}async signWithCredentials(r,s,l={}){if(l.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().signWithCredentials(r,s,l)}return this.sigv4Signer.signWithCredentials(r,s,l)}async presign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().presign(r,s)}return this.sigv4Signer.presign(r,s)}async presignWithCredentials(r,s,l={}){if(l.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(r,s,l)}getSigv4aSigner(){if(!this.sigv4aSigner){let r=null;try{if(r=Ss.CrtSignerV4,typeof r!=="function")throw new Error}catch(s){throw s.message=`${s.message}\n`+'Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. \nYou must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. \nFor more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt',s}this.sigv4aSigner=new r({...this.signerOptions,signingAlgorithm:1})}return this.sigv4aSigner}}var Jr=z(hl(),1);var Ar={["required"]:!1,["type"]:"String"},Er={["required"]:!0,default:!1,["type"]:"Boolean"},vr={["required"]:!1,["type"]:"Boolean"},O={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},P={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},k={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},C={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},hh={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},Ie={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},ks={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},Z={["ref"]:"Bucket"},L={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},Is={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},ah={["ref"]:"url"},mh={["fn"]:"uriEncode",["argv"]:[Z],["assign"]:"uri_encoded_bucket"},b={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},w={},gh={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Z,!1]},Rl={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},Ps={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},ke={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},Pe={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},d={["fn"]:"not",["argv"]:[C]},Ne={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},$e={["fn"]:"not",["argv"]:[ks]},De={["ref"]:"hardwareType"},Ue={["conditions"]:[d],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},Rs={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},Al={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},Gg={["ref"]:"ForcePathStyle"},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},G={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},W={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},E={["fn"]:"not",["argv"]:[G]},K={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},Me={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},F={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},V={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},A={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},Te={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},S={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},Ce={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Fe={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},El={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[ah,"isIp"]},!1]},Il={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:F,["headers"]:{}},Hl={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:F,["headers"]:{}},ze={["endpoint"]:Hl,["type"]:"endpoint"},kl={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Ge={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},As={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},J={["ref"]:"bucketArn"},wh={["ref"]:"arnType"},Pl={["fn"]:"getAttr",["argv"]:[J,"service"]},Jl={["ref"]:"accessPointName"},ye={["conditions"]:[k],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},We={["conditions"]:[O],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},Ke={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},Nl={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},dh={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},Sh={["fn"]:"getAttr",["argv"]:[J,"accountId"]},$l={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},Ve={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},Dl={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},Ul={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},Ml={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},Le={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},Ze={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Hr={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},ve={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},He={["fn"]:"aws.parseArn",["argv"]:[Z]},Je={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Xe={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Qe={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Tl={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},ce={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Ye={["ref"]:"UseObjectLambdaEndpoint"},Cl={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},Be={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Oe={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},qe={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Fl={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:F,["headers"]:{}},_e={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},zl=[{["ref"]:"Region"}],yg=[{["ref"]:"Endpoint"}],Wg=[Z],Gl=[k],Es=[O],fr=[C,L],je=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],ie=[Is],yl=[mh],Wl=[gh],Ir=[P],be=[{["fn"]:"substring",["argv"]:[Z,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Z,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],xe=[{["conditions"]:[P],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:b,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:b,["headers"]:{}},["type"]:"endpoint"}],oe=[{["fn"]:"substring",["argv"]:[Z,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Z,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],ne=[{["conditions"]:[P],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:Ps,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:Ps,["headers"]:{}},["type"]:"endpoint"}],Kg=[ks],pe=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],ue=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],Vg=["*"],o=[hh],te=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],n=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],Kl=[{["fn"]:"stringEquals",["argv"]:[wh,"accesspoint"]}],rh=[{["fn"]:"getAttr",["argv"]:[J,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[Jl,""]}]}],Lg=[J,"resourceId[1]"],Vl=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},""]}]}],sh=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[2]"]}]}]}],Zg=[J,"resourceId[2]"],Ll=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]}],["assign"]:"bucketPartition"}],lh=[{["fn"]:"stringEquals",["argv"]:[dh,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],Zl=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},!0]}],vl=[{["fn"]:"isValidHostLabel",["argv"]:[Sh,!1]}],fh=[{["fn"]:"isValidHostLabel",["argv"]:[Jl,!1]}],eh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],vg={version:"1.0",parameters:{Bucket:Ar,Region:Ar,UseFIPS:Er,UseDualStack:Er,Endpoint:Ar,ForcePathStyle:Er,Accelerate:Er,UseGlobalEndpoint:Er,UseObjectLambdaEndpoint:vr,Key:Ar,Prefix:Ar,CopySource:Ar,DisableAccessPoints:vr,DisableMultiRegionAccessPoints:Er,UseArnRegion:vr,UseS3ExpressControlEndpoint:vr,DisableS3ExpressSessionAuth:vr},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:zl}],rules:[{["conditions"]:[O,P],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[k,C],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[C,P],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[C,O],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[P,hh,Ie],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[ks,{["fn"]:"substring",["argv"]:[Z,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:Gl,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:Es,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:fr,rules:[{["conditions"]:je,rules:[{["conditions"]:ie,rules:[{["conditions"]:yl,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:b,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Wl,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:b,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Rl],["type"]:"tree"},{["conditions"]:ie,rules:[{["conditions"]:yl,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:Ps,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Wl,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:Ps,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Rl],["type"]:"tree"},{["conditions"]:[ke,Pe],rules:[{["conditions"]:[mh,d],rules:[{["conditions"]:Ir,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:b,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:b,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Wl,rules:[{["conditions"]:je,rules:[{["conditions"]:be,rules:xe,["type"]:"tree"},{["conditions"]:oe,rules:xe,["type"]:"tree"},Ne],["type"]:"tree"},{["conditions"]:be,rules:ne,["type"]:"tree"},{["conditions"]:oe,rules:ne,["type"]:"tree"},Ne],["type"]:"tree"},Rl],["type"]:"tree"},{["conditions"]:[$e,ke,Pe],rules:[{["conditions"]:fr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:b,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Ir,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com",["properties"]:b,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com",["properties"]:b,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[ks,{["fn"]:"substring",["argv"]:[Z,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[Z,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:[Z,0,7,!0],["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[Z,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:zl,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:pe,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[De,"e"]}],rules:[{["conditions"]:ue,rules:[Ue,{["conditions"]:fr,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:Rs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Rs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[De,"o"]}],rules:[{["conditions"]:ue,rules:[Ue,{["conditions"]:fr,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:Rs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Rs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Unrecognized hardware type: \"Expected hardware type o or e but got {hardwareType}\"",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",["type"]:"error"}],["type"]:"tree"},{["conditions"]:Kg,rules:[{["conditions"]:[C,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:yg}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[Al,gh],rules:[{["conditions"]:o,rules:[{["conditions"]:te,rules:[{["conditions"]:[O,Ie],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[k,P,T,d,G],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,P,T,d,E,K],rules:[{endpoint:Me,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,P,T,d,E,V],endpoint:Me,["type"]:"endpoint"},{["conditions"]:[A,P,T,d,G],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,P,T,d,E,K],rules:[{endpoint:Te,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,P,T,d,E,V],endpoint:Te,["type"]:"endpoint"},{["conditions"]:[k,S,O,d,G],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,S,O,d,E,K],rules:[{endpoint:Ce,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,S,O,d,E,V],endpoint:Ce,["type"]:"endpoint"},{["conditions"]:[k,S,T,d,G],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,S,T,d,E,K],rules:[{endpoint:Fe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,S,T,d,E,V],endpoint:Fe,["type"]:"endpoint"},{["conditions"]:[A,S,T,C,L,Is,G],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,T,C,L,El,G],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,T,C,L,Is,E,K],rules:[{["conditions"]:n,endpoint:Il,["type"]:"endpoint"},{endpoint:Il,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,S,T,C,L,El,E,K],rules:[{["conditions"]:n,endpoint:Hl,["type"]:"endpoint"},ze],["type"]:"tree"},{["conditions"]:[A,S,T,C,L,Is,E,V],endpoint:Il,["type"]:"endpoint"},{["conditions"]:[A,S,T,C,L,El,E,V],endpoint:Hl,["type"]:"endpoint"},{["conditions"]:[A,S,O,d,G],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,O,d,E,K],rules:[{["conditions"]:n,endpoint:kl,["type"]:"endpoint"},{endpoint:kl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,S,O,d,E,V],endpoint:kl,["type"]:"endpoint"},{["conditions"]:[A,S,T,d,G],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,T,d,E,K],rules:[{["conditions"]:n,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:w},["type"]:"endpoint"},{endpoint:Ge,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,S,T,d,E,V],endpoint:Ge,["type"]:"endpoint"}],["type"]:"tree"},As],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[C,L,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[ah,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Z,!0]},Al,S,A,T],rules:[{["conditions"]:o,rules:[{["conditions"]:te,rules:[ze],["type"]:"tree"},As],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Al,{["fn"]:"aws.parseArn",["argv"]:Wg,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[wh,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Pl,"s3-object-lambda"]}],rules:[{["conditions"]:Kl,rules:[{["conditions"]:rh,rules:[ye,We,{["conditions"]:Vl,rules:[Ke,{["conditions"]:sh,rules:[Nl,{["conditions"]:Ll,rules:[{["conditions"]:o,rules:[{["conditions"]:lh,rules:[{["conditions"]:Zl,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Sh,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:vl,rules:[{["conditions"]:fh,rules:[{["conditions"]:fr,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:$l,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Ir,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:$l,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:$l,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Ve],["type"]:"tree"},Dl],["type"]:"tree"},Ul],["type"]:"tree"},Ml],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Le],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},Ze],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:Kl,rules:[{["conditions"]:rh,rules:[{["conditions"]:Vl,rules:[{["conditions"]:Kl,rules:[{["conditions"]:Vl,rules:[Ke,{["conditions"]:sh,rules:[Nl,{["conditions"]:Ll,rules:[{["conditions"]:o,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[dh,"{partitionResult#name}"]}],rules:[{["conditions"]:Zl,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Pl,"s3"]}],rules:[{["conditions"]:vl,rules:[{["conditions"]:fh,rules:[{["conditions"]:Es,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:[P,k],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[P,A],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,k],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A,C,L],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Ve],["type"]:"tree"},Dl],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},Ul],["type"]:"tree"},Ml],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Le],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[Jl,!0]}],rules:[{["conditions"]:Gl,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:Ir,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:Es,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"]:zl,["assign"]:"mrapPartition"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[J,"partition"]}]}],rules:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:Vg}]},["headers"]:w},["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"},Ze],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Pl,"s3-outposts"]}],rules:[{["conditions"]:Gl,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:Ir,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:Es,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:Lg,["assign"]:"outpostId"}],rules:[{["conditions"]:pe,rules:[Nl,{["conditions"]:Ll,rules:[{["conditions"]:o,rules:[{["conditions"]:lh,rules:[{["conditions"]:Zl,rules:[{["conditions"]:vl,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:Zg,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:fr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:ve,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:ve,["headers"]:w},["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"},Dl],["type"]:"tree"},Ul],["type"]:"tree"},Ml],["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"]:[Z,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[He]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[Gg,!0]},He],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:yl,rules:[{["conditions"]:o,rules:[{["conditions"]:[T],rules:[{["conditions"]:[k,d,P,G],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,d,P,E,K],rules:[{endpoint:Je,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,d,P,E,V],endpoint:Je,["type"]:"endpoint"},{["conditions"]:[A,d,P,G],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,d,P,E,K],rules:[{endpoint:Xe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,d,P,E,V],endpoint:Xe,["type"]:"endpoint"},{["conditions"]:[k,d,S,G],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,d,S,E,K],rules:[{endpoint:Qe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,d,S,E,V],endpoint:Qe,["type"]:"endpoint"},{["conditions"]:[A,C,L,S,G],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,C,L,S,E,K],rules:[{["conditions"]:n,endpoint:Tl,["type"]:"endpoint"},{endpoint:Tl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,C,L,S,E,V],endpoint:Tl,["type"]:"endpoint"},{["conditions"]:[A,d,S,G],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,d,S,E,K],rules:[{["conditions"]:n,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:w},["type"]:"endpoint"},{endpoint:ce,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,d,S,E,V],endpoint:ce,["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"]:[Ye]},{["fn"]:"booleanEquals",["argv"]:[Ye,!0]}],rules:[{["conditions"]:o,rules:[{["conditions"]:eh,rules:[ye,We,{["conditions"]:fr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:Cl,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Ir,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:Cl,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:Cl,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},As],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[$e],rules:[{["conditions"]:o,rules:[{["conditions"]:eh,rules:[{["conditions"]:[P,k,d,G],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[P,k,d,E,K],rules:[{endpoint:Be,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[P,k,d,E,V],endpoint:Be,["type"]:"endpoint"},{["conditions"]:[P,A,d,G],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[P,A,d,E,K],rules:[{endpoint:Oe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[P,A,d,E,V],endpoint:Oe,["type"]:"endpoint"},{["conditions"]:[S,k,d,G],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,k,d,E,K],rules:[{endpoint:qe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,k,d,E,V],endpoint:qe,["type"]:"endpoint"},{["conditions"]:[S,A,C,L,G],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A,C,L,E,K],rules:[{["conditions"]:n,endpoint:Fl,["type"]:"endpoint"},{endpoint:Fl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,A,C,L,E,V],endpoint:Fl,["type"]:"endpoint"},{["conditions"]:[S,A,d,G],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A,d,E,K],rules:[{["conditions"]:n,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:w},["type"]:"endpoint"},{endpoint:_e,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,A,d,E,V],endpoint:_e,["type"]:"endpoint"}],["type"]:"tree"},As],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},Rh=vg;var Hg=new Ah({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),Ns=(r,s={})=>{return Hg.get(r,()=>Ih(Rh,{endpointParams:r,logger:s.logger}))};Eh.aws=kh;var $h=function(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,l)=>({signingProperties:{config:s,context:l}})}},Dh=function(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,l)=>({signingProperties:{config:s,context:l}})}},Jg=(r)=>async(s,l,f)=>{if(!f)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const e=await r(s,l,f),h=Jr.getSmithyContext(l)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!h)throw new Error(`getEndpointParameterInstructions() is not defined on \`${l.commandName}\``);const m=await Ph(f,{getEndpointParameterInstructions:h},s);return Object.assign(e,m)},Xg=async(r,s,l)=>{return{operation:Jr.getSmithyContext(s).operation,region:await Jr.normalizeProvider(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Nh=Jg(Xg),Qg=(r,s,l)=>{return(e)=>{const m=r(e).properties?.authSchemes;if(!m)return s(e);const a=[];for(let g of m){const{name:R,properties:N={},...$}=g,D=R.toLowerCase();if(R!==D)console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${R}\` to \`${D}\``);let M;if(D==="sigv4a"){M="aws.auth#sigv4a";const ir=m.find((i)=>{const Fr=i.name.toLowerCase();return Fr!=="sigv4a"&&Fr.startsWith("sigv4")});if(!Ss.CrtSignerV4&&ir)continue}else if(D.startsWith("sigv4"))M="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${D}\``);const Q=l[M];if(!Q)throw new Error(`Could not find HttpAuthOption create function for \`${M}\``);const B=Q(e);B.schemeId=M,B.signingProperties={...B.signingProperties||{},...$,...N},a.push(B)}return a}},cg=(r)=>{const s=[];switch(r.operation){default:s.push($h(r)),s.push(Dh(r))}return s},Uh=Qg(Ns,cg,{"aws.auth#sigv4":$h,"aws.auth#sigv4a":Dh}),Mh=(r)=>{const s=Ds.resolveAwsSdkSigV4Config(r);return{...Ds.resolveAwsSdkSigV4AConfig(s)}};var Th=(r)=>{return{...r,useFipsEndpoint:r.useFipsEndpoint??!1,useDualstackEndpoint:r.useDualstackEndpoint??!1,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,useGlobalEndpoint:r.useGlobalEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,defaultSigningName:"s3"}},kr={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class v extends Ch{constructor(r){super(r);Object.setPrototypeOf(this,v.prototype)}}class Us extends v{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,Us.prototype)}}class Ms extends v{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Ms.prototype)}}class Ts extends v{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,Ts.prototype)}}class Cs extends v{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,Cs.prototype)}}class Fs extends v{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,Fs.prototype)}}var Xl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Xl||(Xl={}));var Ql;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.ObjectSizeGreaterThan!==void 0)return l.ObjectSizeGreaterThan(s.ObjectSizeGreaterThan);if(s.ObjectSizeLessThan!==void 0)return l.ObjectSizeLessThan(s.ObjectSizeLessThan);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Ql||(Ql={}));var cl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.AccessPointArn!==void 0)return l.AccessPointArn(s.AccessPointArn);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(cl||(cl={}));var Yl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Yl||(Yl={}));class zs extends v{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,zs.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class Gs extends v{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,Gs.prototype)}}class ys extends v{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,ys.prototype)}}var Yg=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:H},...r.SessionToken&&{SessionToken:H}}),Fh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:H},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:H},...r.Credentials&&{Credentials:Yg(r.Credentials)}}),zh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:H},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:H}});var Gh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:H}}),yh=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:H}});var $r=z($s(),1);var Vs=z(gl(),1);class Ws extends v{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Ws.prototype)}}var Wh;(function(r){r.visit=(s,l)=>{if(s.Records!==void 0)return l.Records(s.Records);if(s.Stats!==void 0)return l.Stats(s.Stats);if(s.Progress!==void 0)return l.Progress(s.Progress);if(s.Cont!==void 0)return l.Cont(s.Cont);if(s.End!==void 0)return l.End(s.End);return l._(s.$unknown[0],s.$unknown[1])}})(Wh||(Wh={}));var Kh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:H},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:H}}),Vh=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:H},...r.SSEKMSKeyId&&{SSEKMSKeyId:H},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:H}});var _h=async(r,s)=>{const l=Vs.requestBuilder(r,s),f=y({},_,{[bw]:r[Fw],[qr]:r[Br],[_r]:r[Or],[Hs]:r[vs],[p]:[()=>_(r[er]),()=>r[er].toString()]});l.bp("/"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const e=y({[qw]:[,""]});let h;return l.m("GET").h(f).q(e).b(h),l.build()};var jh=async(r,s)=>{const l=Vs.requestBuilder(r,s),f=y({},_,{[Lw]:r[Sw],[Zw]:[()=>_(r[Lh]),()=>Xr(r[Lh]).toString()],[ka]:r[fa],[vw]:[()=>_(r[Zh]),()=>Xr(r[Zh]).toString()],[Jw]:r[kw],[Js]:r[Ls],[Ca]:r[ga],[Xs]:r[Zs],[Ma]:r[ma],[Na]:r[sa],[iw]:r[lw]});l.bp("/{Key+}"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1),l.p("Key",()=>r.Key,"{Key+}",!0);const e=y({[Ga]:[,"GetObject"],[Xw]:[,r[Pw]],[Qw]:[,r[Nw]],[cw]:[,r[$w]],[Yw]:[,r[Dw]],[Bw]:[,r[Uw]],[Ow]:[()=>r.ResponseExpires!==void 0,()=>Xr(r[Mw]).toString()],[_w]:[,r[ef]],[Hw]:[()=>r.PartNumber!==void 0,()=>r[Iw].toString()]});let h;return l.m("GET").h(f).q(e).b(h),l.build()};var ih=async(r,s)=>{const l=Vs.requestBuilder(r,s),f=y({},_,{[Ea]:r[ra]||"application/octet-stream",[jw]:r[tg],[da]:r[nh],[Sa]:r[ph],[Ra]:r[uh],[Aa]:r[th],[ol]:[()=>_(r[il]),()=>r[il].toString()],[Ww]:r[fw],[rd]:r[sw],[hf]:r[rf],[af]:r[sf],[mf]:r[lf],[gf]:r[ff],[nl]:[()=>_(r[bl]),()=>Xr(r[bl]).toString()],[ka]:r[fa],[xw]:r[mw],[ow]:r[gw],[nw]:r[ww],[pw]:r[dw],[qr]:r[Br],[Ta]:r[cr],[za]:r[wa],[Js]:r[Ls],[Ca]:r[ga],[Xs]:r[Zs],[_r]:r[Or],[Hs]:r[vs],[p]:[()=>_(r[er]),()=>r[er].toString()],[Ma]:r[ma],[sd]:r[zw],[Da]:r[ha],[pl]:[()=>_(r[xl]),()=>qh(r[xl]).toString()],[$a]:r[ea],[Na]:r[sa],...r.Metadata!==void 0&&Object.keys(r.Metadata).reduce((a,g)=>{return a[`x-amz-meta-${g.toLowerCase()}`]=r.Metadata[g],a},{})});l.bp("/{Key+}"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1),l.p("Key",()=>r.Key,"{Key+}",!0);const e=y({[Ga]:[,"PutObject"]});let h,m;if(r.Body!==void 0)m=r.Body,h=m;return l.m("PUT").h(f).q(e).b(h),l.build()};var bh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return tl(r,s);const l=y({$metadata:Y(r),[Br]:[,r.headers[qr]],[Or]:[,r.headers[_r]],[vs]:[,r.headers[Hs]],[er]:[()=>r.headers[p]!==void 0,()=>Yr(r.headers[p])]}),f=Pr(Yh(await $r.parseXmlBody(r.body,s)),"body");if(f[ql]!=null)l[ql]=ug(f[ql],s);return l};var xh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return tl(r,s);const l=y({$metadata:Y(r),[hw]:[()=>r.headers[Hh]!==void 0,()=>Yr(r.headers[Hh])],[rw]:[,r.headers[yw]],[Qr]:[,r.headers[Pa]],[Cw]:[,r.headers[uw]],[Rw]:[()=>r.headers[vh]!==void 0,()=>Pr(Lr(r.headers[vh]))],[il]:[()=>r.headers[ol]!==void 0,()=>Bh(r.headers[ol])],[la]:[,r.headers[Ia]],[rf]:[,r.headers[hf]],[sf]:[,r.headers[af]],[lf]:[,r.headers[mf]],[ff]:[,r.headers[gf]],[Aw]:[()=>r.headers[Jh]!==void 0,()=>Ks(r.headers[Jh])],[ef]:[,r.headers[Fa]],[nh]:[,r.headers[da]],[ph]:[,r.headers[Sa]],[uh]:[,r.headers[Ra]],[th]:[,r.headers[Aa]],[ew]:[,r.headers[Kw]],[ra]:[,r.headers[Ea]],[bl]:[()=>r.headers[nl]!==void 0,()=>Pr(Lr(r.headers[nl]))],[aw]:[,r.headers[Vw]],[wa]:[,r.headers[za]],[Br]:[,r.headers[qr]],[Ls]:[,r.headers[Js]],[Zs]:[,r.headers[Xs]],[Or]:[,r.headers[_r]],[er]:[()=>r.headers[p]!==void 0,()=>Yr(r.headers[p])],[cr]:[,r.headers[Ta]],[aa]:[,r.headers[Ua]],[Tw]:[,r.headers[tw]],[Ew]:[()=>r.headers[Xh]!==void 0,()=>Ks(r.headers[Xh])],[Gw]:[()=>r.headers[Qh]!==void 0,()=>Ks(r.headers[Qh])],[ha]:[,r.headers[Da]],[xl]:[()=>r.headers[pl]!==void 0,()=>Pr(ul(r.headers[pl]))],[ea]:[,r.headers[$a]],Metadata:[,Object.keys(r.headers).filter((e)=>e.startsWith("x-amz-meta-")).reduce((e,h)=>{return e[h.substring(11)]=r.headers[h],e},{})]}),f=r.body;return s.sdkStreamMixin(f),l.Body=f,l};var oh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return tl(r,s);const l=y({$metadata:Y(r),[Qr]:[,r.headers[Pa]],[la]:[,r.headers[Ia]],[rf]:[,r.headers[hf]],[sf]:[,r.headers[af]],[lf]:[,r.headers[mf]],[ff]:[,r.headers[gf]],[Br]:[,r.headers[qr]],[ef]:[,r.headers[Fa]],[Ls]:[,r.headers[Js]],[Zs]:[,r.headers[Xs]],[Or]:[,r.headers[_r]],[vs]:[,r.headers[Hs]],[er]:[()=>r.headers[p]!==void 0,()=>Yr(r.headers[p])],[aa]:[,r.headers[Ua]]});return await ch(r.body,s),l};var tl=async(r,s)=>{const l={...r,body:await $r.parseXmlErrorBody(r.body,s)},f=$r.loadRestXmlErrorCode(r,l.body);switch(f){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await xg(l,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await pg(l,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await qg(l,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await _g(l,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await ig(l,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await jg(l,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await bg(l,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await og(l,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await ng(l,s);default:const e=l.body;return Og({output:r,parsedBody:e,errorCode:f})}},Og=Oh(v),qg=async(r,s)=>{const l=y({}),f=r.body,e=new Ts({$metadata:Y(r),...l});return j(e,r.body)},_g=async(r,s)=>{const l=y({}),f=r.body,e=new Cs({$metadata:Y(r),...l});return j(e,r.body)},jg=async(r,s)=>{const l=y({}),f=r.body;if(f[Ol]!=null)l[Ol]=Nr(f[Ol]);if(f[cr]!=null)l[cr]=Nr(f[cr]);const e=new zs({$metadata:Y(r),...l});return j(e,r.body)},ig=async(r,s)=>{const l=y({}),f=r.body,e=new Fs({$metadata:Y(r),...l});return j(e,r.body)},bg=async(r,s)=>{const l=y({}),f=r.body,e=new Gs({$metadata:Y(r),...l});return j(e,r.body)},xg=async(r,s)=>{const l=y({}),f=r.body,e=new Us({$metadata:Y(r),...l});return j(e,r.body)},og=async(r,s)=>{const l=y({}),f=r.body,e=new ys({$metadata:Y(r),...l});return j(e,r.body)},ng=async(r,s)=>{const l=y({}),f=r.body,e=new Ws({$metadata:Y(r),...l});return j(e,r.body)},pg=async(r,s)=>{const l=y({}),f=r.body,e=new Ms({$metadata:Y(r),...l});return j(e,r.body)};var ug=(r,s)=>{const l={};if(r[Bl]!=null)l[Bl]=Nr(r[Bl]);if(r[_l]!=null)l[_l]=Nr(r[_l]);if(r[jl]!=null)l[jl]=Nr(r[jl]);if(r[Qr]!=null)l[Qr]=Pr(ul(r[Qr]));return l};var Y=(r)=>({httpStatusCode:r.statusCode,requestId:r.headers["x-amzn-requestid"]??r.headers["x-amzn-request-id"]??r.headers["x-amz-request-id"],extendedRequestId:r.headers["x-amz-id-2"],cfId:r.headers["x-amz-cf-id"]});var _=(r)=>r!==void 0&&r!==null&&r!==""&&(!Object.getOwnPropertyNames(r).includes("length")||r.length!=0)&&(!Object.getOwnPropertyNames(r).includes("size")||r.size!=0);var tg="ACL";var Bl="AccessKeyId";var rw="AcceptRanges";var Ol="AccessTier";var er="BucketKeyEnabled";var ql="Credentials",sw="ChecksumAlgorithm";var nh="CacheControl",rf="ChecksumCRC32",sf="ChecksumCRC32C",ph="ContentDisposition";var uh="ContentEncoding";var th="ContentLanguage",il="ContentLength",lw="ChecksumMode",fw="ContentMD5";var ew="ContentRange";var lf="ChecksumSHA1",ff="ChecksumSHA256";var ra="ContentType";var hw="DeleteMarker";var bl="Expires";var sa="ExpectedBucketOwner";var aw="ExpiresString";var la="ETag";var Qr="Expiration";var mw="GrantFullControl";var gw="GrantRead",ww="GrantReadACP";var dw="GrantWriteACP";var Sw="IfMatch",Lh="IfModifiedSince",fa="IfNoneMatch";var Zh="IfUnmodifiedSince";var Rw="LastModified";var Aw="MissingMeta";var ea="ObjectLockLegalHoldStatus",ha="ObjectLockMode";var xl="ObjectLockRetainUntilDate";var Ew="PartsCount";var Iw="PartNumber";var kw="Range";var aa="RequestCharged",Pw="ResponseCacheControl",Nw="ResponseContentDisposition",$w="ResponseContentEncoding",Dw="ResponseContentLanguage",Uw="ResponseContentType";var Mw="ResponseExpires";var ma="RequestPayer";var Tw="ReplicationStatus";var Cw="Restore";var _l="SecretAccessKey";var cr="StorageClass";var Fw="SessionMode";var Br="ServerSideEncryption";var Ls="SSECustomerAlgorithm",ga="SSECustomerKey",Zs="SSECustomerKeyMD5";var vs="SSEKMSEncryptionContext",Or="SSEKMSKeyId";var jl="SessionToken";var zw="Tagging";var Gw="TagCount";var ef="VersionId";var wa="WebsiteRedirectLocation";var yw="accept-ranges";var da="cache-control",Sa="content-disposition",Ra="content-encoding",Aa="content-language",ol="content-length",Ww="content-md5",Kw="content-range",Ea="content-type";var nl="expires";var Ia="etag",Vw="expiresstring";var Lw="if-match",Zw="if-modified-since";var ka="if-none-match";var vw="if-unmodified-since";var vh="last-modified";var Hw="partNumber";var Jw="range",Xw="response-cache-control",Qw="response-content-disposition",cw="response-content-encoding",Yw="response-content-language",Bw="response-content-type",Ow="response-expires";var qw="session";var _w="versionId";var jw="x-amz-acl";var hf="x-amz-checksum-crc32",af="x-amz-checksum-crc32c",iw="x-amz-checksum-mode";var mf="x-amz-checksum-sha1",gf="x-amz-checksum-sha256";var bw="x-amz-create-session-mode";var Hh="x-amz-delete-marker",Pa="x-amz-expiration",Na="x-amz-expected-bucket-owner";var xw="x-amz-grant-full-control",ow="x-amz-grant-read",nw="x-amz-grant-read-acp";var pw="x-amz-grant-write-acp";var Jh="x-amz-missing-meta";var Xh="x-amz-mp-parts-count";var $a="x-amz-object-lock-legal-hold",Da="x-amz-object-lock-mode",pl="x-amz-object-lock-retain-until-date";var uw="x-amz-restore",Ua="x-amz-request-charged";var Ma="x-amz-request-payer";var tw="x-amz-replication-status";var Ta="x-amz-storage-class",rd="x-amz-sdk-checksum-algorithm";var qr="x-amz-server-side-encryption",_r="x-amz-server-side-encryption-aws-kms-key-id",p="x-amz-server-side-encryption-bucket-key-enabled",Hs="x-amz-server-side-encryption-context",Js="x-amz-server-side-encryption-customer-algorithm",Ca="x-amz-server-side-encryption-customer-key",Xs="x-amz-server-side-encryption-customer-key-md5",sd="x-amz-tagging",Qh="x-amz-tagging-count";var Fa="x-amz-version-id",za="x-amz-website-redirect-location",Ga="x-id";class wf extends Dr.classBuilder().ep({...kr,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,l,f){return[Ur(l,this.serialize,this.deserialize),Mr(l,r.getEndpointParameterInstructions()),ds(l)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(zh,Fh).ser(_h).de(bh).build(){}var ya={name:"@aws-sdk/client-s3",description:"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",version:"3.654.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3",test:"yarn test:unit","test:e2e":"yarn test:e2e:node && yarn test:e2e:browser","test:e2e:browser":"ts-mocha test/**/*.browser.ispec.ts && karma start karma.conf.js","test:e2e:node":"jest --c jest.config.e2e.js","test:unit":"ts-mocha test/unit/**/*.spec.ts"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha1-browser":"5.2.0","@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.654.0","@aws-sdk/client-sts":"3.654.0","@aws-sdk/core":"3.654.0","@aws-sdk/credential-provider-node":"3.654.0","@aws-sdk/middleware-bucket-endpoint":"3.654.0","@aws-sdk/middleware-expect-continue":"3.654.0","@aws-sdk/middleware-flexible-checksums":"3.654.0","@aws-sdk/middleware-host-header":"3.654.0","@aws-sdk/middleware-location-constraint":"3.654.0","@aws-sdk/middleware-logger":"3.654.0","@aws-sdk/middleware-recursion-detection":"3.654.0","@aws-sdk/middleware-sdk-s3":"3.654.0","@aws-sdk/middleware-ssec":"3.654.0","@aws-sdk/middleware-user-agent":"3.654.0","@aws-sdk/region-config-resolver":"3.654.0","@aws-sdk/signature-v4-multi-region":"3.654.0","@aws-sdk/types":"3.654.0","@aws-sdk/util-endpoints":"3.654.0","@aws-sdk/util-user-agent-browser":"3.654.0","@aws-sdk/util-user-agent-node":"3.654.0","@aws-sdk/xml-builder":"3.654.0","@smithy/config-resolver":"^3.0.8","@smithy/core":"^2.4.3","@smithy/eventstream-serde-browser":"^3.0.9","@smithy/eventstream-serde-config-resolver":"^3.0.6","@smithy/eventstream-serde-node":"^3.0.8","@smithy/fetch-http-handler":"^3.2.7","@smithy/hash-blob-browser":"^3.1.5","@smithy/hash-node":"^3.0.6","@smithy/hash-stream-node":"^3.1.5","@smithy/invalid-dependency":"^3.0.6","@smithy/md5-js":"^3.0.6","@smithy/middleware-content-length":"^3.0.8","@smithy/middleware-endpoint":"^3.1.3","@smithy/middleware-retry":"^3.0.18","@smithy/middleware-serde":"^3.0.6","@smithy/middleware-stack":"^3.0.6","@smithy/node-config-provider":"^3.1.7","@smithy/node-http-handler":"^3.2.2","@smithy/protocol-http":"^4.1.3","@smithy/smithy-client":"^3.3.2","@smithy/types":"^3.4.2","@smithy/url-parser":"^3.0.6","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.18","@smithy/util-defaults-mode-node":"^3.0.18","@smithy/util-endpoints":"^2.1.2","@smithy/util-middleware":"^3.0.6","@smithy/util-retry":"^3.0.6","@smithy/util-stream":"^3.1.6","@smithy/util-utf8":"^3.0.0","@smithy/util-waiter":"^3.1.5",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/signature-v4-crt":"3.654.0","@tsconfig/node16":"16.1.3","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-s3"}};var qs=z($s(),1);var fd="AWS_S3_USE_ARN_REGION",ed="s3_use_arn_region",Wa={environmentVariableSelector:(r)=>sr(r,fd,lr.ENV),configFileSelector:(r)=>sr(r,ed,lr.CONFIG),default:!1};var u=z(Va(),1);var La=z(Va(),1),Ka=function(r){for(let s=0;s<8;s++)r[s]^=255;for(let s=7;s>-1;s--)if(r[s]++,r[s]!==0)break};class Tr{constructor(r){if(this.bytes=r,r.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(r){if(r>9223372036854776000||r<-9223372036854776000)throw new Error(`${r} is too large (or, if negative, too small) to represent as an Int64`);const s=new Uint8Array(8);for(let l=7,f=Math.abs(Math.round(r));l>-1&&f>0;l--,f/=256)s[l]=f;if(r<0)Ka(s);return new Tr(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)Ka(r);return parseInt(La.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class df{constructor(r,s){this.toUtf8=r,this.fromUtf8=s}format(r){const s=[];for(let e of Object.keys(r)){const h=this.fromUtf8(e);s.push(Uint8Array.from([h.byteLength]),h,this.formatHeaderValue(r[e]))}const l=new Uint8Array(s.reduce((e,h)=>e+h.byteLength,0));let f=0;for(let e of s)l.set(e,f),f+=e.byteLength;return l}formatHeaderValue(r){switch(r.type){case"boolean":return Uint8Array.from([r.value?0:1]);case"byte":return Uint8Array.from([2,r.value]);case"short":const s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,r.value,!1),new Uint8Array(s.buffer);case"integer":const l=new DataView(new ArrayBuffer(5));return l.setUint8(0,4),l.setInt32(1,r.value,!1),new Uint8Array(l.buffer);case"long":const f=new Uint8Array(9);return f[0]=5,f.set(r.value.bytes,1),f;case"binary":const e=new DataView(new ArrayBuffer(3+r.value.byteLength));e.setUint8(0,6),e.setUint16(1,r.value.byteLength,!1);const h=new Uint8Array(e.buffer);return h.set(r.value,3),h;case"string":const m=this.fromUtf8(r.value),a=new DataView(new ArrayBuffer(3+m.byteLength));a.setUint8(0,7),a.setUint16(1,m.byteLength,!1);const g=new Uint8Array(a.buffer);return g.set(m,3),g;case"timestamp":const R=new Uint8Array(9);return R[0]=8,R.set(Tr.fromNumber(r.value.valueOf()).bytes,1),R;case"uuid":if(!Md.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const N=new Uint8Array(17);return N[0]=9,N.set(u.fromHex(r.value.replace(/\-/g,"")),1),N}}parse(r){const s={};let l=0;while(l<r.byteLength){const f=r.getUint8(l++),e=this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+l,f));switch(l+=f,r.getUint8(l++)){case 0:s[e]={type:va,value:!0};break;case 1:s[e]={type:va,value:!1};break;case 2:s[e]={type:Ed,value:r.getInt8(l++)};break;case 3:s[e]={type:Id,value:r.getInt16(l,!1)},l+=2;break;case 4:s[e]={type:kd,value:r.getInt32(l,!1)},l+=4;break;case 5:s[e]={type:Pd,value:new Tr(new Uint8Array(r.buffer,r.byteOffset+l,8))},l+=8;break;case 6:const h=r.getUint16(l,!1);l+=2,s[e]={type:Nd,value:new Uint8Array(r.buffer,r.byteOffset+l,h)},l+=h;break;case 7:const m=r.getUint16(l,!1);l+=2,s[e]={type:$d,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+l,m))},l+=m;break;case 8:s[e]={type:Dd,value:new Date(new Tr(new Uint8Array(r.buffer,r.byteOffset+l,8)).valueOf())},l+=8;break;case 9:const a=new Uint8Array(r.buffer,r.byteOffset+l,16);l+=16,s[e]={type:Ud,value:`${u.toHex(a.subarray(0,4))}-${u.toHex(a.subarray(4,6))}-${u.toHex(a.subarray(6,8))}-${u.toHex(a.subarray(8,10))}-${u.toHex(a.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return s}}var Za;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(Za||(Za={}));var va="boolean",Ed="byte",Id="short",kd="integer",Pd="long",Nd="binary",$d="string",Dd="timestamp",Ud="uuid",Md=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function Ja({byteLength:r,byteOffset:s,buffer:l}){if(r<Td)throw new Error("Provided message too short to accommodate event stream message overhead");const f=new DataView(l,s,r),e=f.getUint32(0,!1);if(r!==e)throw new Error("Reported message length does not match received message length");const h=f.getUint32(Ha,!1),m=f.getUint32(t,!1),a=f.getUint32(r-hr,!1),g=new rr().update(new Uint8Array(l,s,t));if(m!==g.digest())throw new Error(`The prelude checksum specified in the message (${m}) does not match the calculated CRC32 checksum (${g.digest()})`);if(g.update(new Uint8Array(l,s+t,r-(t+hr))),a!==g.digest())throw new Error(`The message checksum (${g.digest()}) did not match the expected value of ${a}`);return{headers:new DataView(l,s+t+hr,h),body:new Uint8Array(l,s+t+hr+h,e-h-(t+hr+hr))}}var Ha=4,t=Ha*2,hr=4,Td=t+hr*2;class Sf{constructor(r,s){this.headerMarshaller=new df(r,s),this.messageBuffer=[],this.isEndOfStream=!1}feed(r){this.messageBuffer.push(this.decode(r))}endOfStream(){this.isEndOfStream=!0}getMessage(){const r=this.messageBuffer.pop(),s=this.isEndOfStream;return{getMessage(){return r},isEndOfStream(){return s}}}getAvailableMessages(){const r=this.messageBuffer;this.messageBuffer=[];const s=this.isEndOfStream;return{getMessages(){return r},isEndOfStream(){return s}}}encode({headers:r,body:s}){const l=this.headerMarshaller.format(r),f=l.byteLength+s.byteLength+16,e=new Uint8Array(f),h=new DataView(e.buffer,e.byteOffset,e.byteLength),m=new rr;return h.setUint32(0,f,!1),h.setUint32(4,l.byteLength,!1),h.setUint32(8,m.update(e.subarray(0,8)).digest(),!1),e.set(l,12),e.set(s,l.byteLength+12),h.setUint32(f-4,m.update(e.subarray(8,f-4)).digest(),!1),e}decode(r){const{headers:s,body:l}=Ja(r);return{headers:this.headerMarshaller.parse(s),body:l}}formatHeaders(r){return this.headerMarshaller.format(r)}}class Rf{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.decoder.decode(r)}}class Af{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream)yield this.options.encoder.encode(r);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class Ef{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream){const s=await this.options.deserializer(r);if(s===void 0)continue;yield s}}}class If{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.serializer(r)}}function Xa(r){let s=0,l=0,f=null,e=null;const h=(a)=>{if(typeof a!=="number")throw new Error("Attempted to allocate an event message where size was not a number: "+a);s=a,l=4,f=new Uint8Array(a),new DataView(f.buffer).setUint32(0,a,!1)},m=async function*(){const a=r[Symbol.asyncIterator]();while(!0){const{value:g,done:R}=await a.next();if(R){if(!s)return;else if(s===l)yield f;else throw new Error("Truncated event message received.");return}const N=g.length;let $=0;while($<N){if(!f){const M=N-$;if(!e)e=new Uint8Array(4);const Q=Math.min(4-l,M);if(e.set(g.slice($,$+Q),l),l+=Q,$+=Q,l<4)break;h(new DataView(e.buffer).getUint32(0,!1)),e=null}const D=Math.min(s-l,N-$);if(f.set(g.slice($,$+D),l),l+=D,$+=D,s&&s===l)yield f,f=null,s=0,l=0}}};return{[Symbol.asyncIterator]:m}}function Qa(r,s){return async function(l){const{value:f}=l.headers[":message-type"];if(f==="error"){const e=new Error(l.headers[":error-message"].value||"UnknownError");throw e.name=l.headers[":error-code"].value,e}else if(f==="exception"){const e=l.headers[":exception-type"].value,h={[e]:l},m=await r(h);if(m.$unknown){const a=new Error(s(l.body));throw a.name=e,a}throw m[e]}else if(f==="event"){const e={[l.headers[":event-type"].value]:l},h=await r(e);if(h.$unknown)return;return h}else throw Error(`Unrecognizable event type: ${l.headers[":event-type"].value}`)}}class Qs{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new Sf(r,s),this.utfEncoder=r}deserialize(r,s){const l=Xa(r);return new Ef({messageStream:new Rf({inputStream:l,decoder:this.eventStreamCodec}),deserializer:Qa(s,this.utfEncoder)})}serialize(r,s){return new Af({messageStream:new If({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as Cd} from"stream";async function*ca(r){let s=!1,l=!1;const f=new Array;r.on("error",(e)=>{if(!s)s=!0;if(e)throw e}),r.on("data",(e)=>{f.push(e)}),r.on("end",()=>{s=!0});while(!l){const e=await new Promise((h)=>setTimeout(()=>h(f.shift()),0));if(e)yield e;l=s&&f.length===0}}class kf{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new Qs({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const l=typeof r[Symbol.asyncIterator]==="function"?r:ca(r);return this.universalMarshaller.deserialize(l,s)}serialize(r,s){return Cd.from(this.universalMarshaller.serialize(r,s))}}var Ya=(r)=>new kf(r);import{Writable as Fd} from"stream";class cs extends Fd{constructor(r,s){super(s);this.hash=r}_write(r,s,l){try{this.hash.update(ss(r))}catch(f){return l(f)}l()}}var Ba=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const l=new r,f=new cs(l);return s.pipe(f),new Promise((e,h)=>{s.on("error",(m)=>{f.end(),h(m)}),f.on("error",h),f.on("finish",()=>{l.digest().then(e).catch(h)})})};var gm=z(Gd(),1);var Ys=z($s(),1);var ia=z(zd(),1);var Bs=z(de(),1);var ba=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??_a,base64Encoder:r?.base64Encoder??ja,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??Ns,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??Bs.getAwsChunkedEncodingStream,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??Uh,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Ys.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new Ys.AwsSdkSigV4ASigner}],logger:r?.logger??new hs,sdkStreamMixin:r?.sdkStreamMixin??Bs.sdkStreamMixin,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??Sl,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??ia.parseUrl,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??Oa,utf8Encoder:r?.utf8Encoder??qa}};var wm=(r)=>{oa(process.version);const s=am(r),l=()=>s().then(xa),f=ba(r);return qs.emitWarningIfUnsupportedVersion(process.version),{...f,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??hm,credentialDefaultProvider:r?.credentialDefaultProvider??mm,defaultUserAgentProvider:r?.defaultUserAgentProvider??em({serviceId:f.serviceId,clientVersion:ya.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??q(al),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??Ya,maxAttempts:r?.maxAttempts??q(rm),md5:r?.md5??Os.bind(null,"md5"),region:r?.region??q(ua,ta),requestChecksumCalculation:r?.requestChecksumCalculation??q(yf),requestHandler:lm.create(r?.requestHandler??l),responseChecksumValidation:r?.responseChecksumValidation??q(Wf),retryMode:r?.retryMode??q({...sm,default:async()=>(await l()).retryMode||gm.DEFAULT_RETRY_MODE}),sha1:r?.sha1??Os.bind(null,"sha1"),sha256:r?.sha256??Os.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??q(qs.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??fm,streamHasher:r?.streamHasher??Ba,useArnRegion:r?.useArnRegion??q(Wa),useDualstackEndpoint:r?.useDualstackEndpoint??q(na),useFipsEndpoint:r?.useFipsEndpoint??q(pa)}};var dm=(r)=>{const s=r.httpAuthSchemes;let{httpAuthSchemeProvider:l,credentials:f}=r;return{setHttpAuthScheme(e){const h=s.findIndex((m)=>m.schemeId===e.schemeId);if(h===-1)s.push(e);else s.splice(h,1,e)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(e){l=e},httpAuthSchemeProvider(){return l},setCredentials(e){f=e},credentials(){return f}}},Sm=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var _s=(r)=>r,Nm=(r,s)=>{const l={..._s(km(r)),..._s(Em(r)),..._s(Rm(r)),..._s(dm(r))};return s.forEach((f)=>f.configure(l)),{...r,...Pm(l),...Im(l),...Am(l),...Sm(l)}};class Pf extends Tm{constructor(...[r]){const s=wm(r||{}),l=Th(s),f=Cm(l),e=_f(f),h=Wm(e),m=zm(h),a=$m(m),g=ym(a),R=Ee(g),N=Mh(R),$=we(N,{session:[()=>this,wf]}),D=Nm($,r?.extensions||[]);super(D);this.config=D,this.middlewareStack.use(Fm(this.config)),this.middlewareStack.use(Km(this.config)),this.middlewareStack.use(Gm(this.config)),this.middlewareStack.use(Dm(this.config)),this.middlewareStack.use(Um(this.config)),this.middlewareStack.use(Mm(this.config)),this.middlewareStack.use(Cr.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Nh,identityProviderConfigProvider:async(M)=>new Cr.DefaultIdentityProviderConfig({"aws.auth#sigv4":M.credentials,"aws.auth#sigv4a":M.credentials})})),this.middlewareStack.use(Cr.getHttpSigningPlugin(this.config)),this.middlewareStack.use(Ae(this.config)),this.middlewareStack.use(Cf(this.config)),this.middlewareStack.use(of(this.config)),this.middlewareStack.use(ml(this.config)),this.middlewareStack.use(wl(this.config))}destroy(){super.destroy()}}function yd(r){return(s)=>async(l)=>{const f={...l.input},e=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let h of e){const m=f[h.target];if(m){let a;if(typeof m==="string")if(Kd(m,r))a=r.base64Decoder(m);else a=r.utf8Decoder(m),f[h.target]=r.base64Encoder(a);else a=ArrayBuffer.isView(m)?new Uint8Array(m.buffer,m.byteOffset,m.byteLength):new Uint8Array(m),f[h.target]=r.base64Encoder(a);const g=new r.md5;g.update(a),f[h.hash]=r.base64Encoder(await g.digest())}}return s({...l,input:f})}}function Kd(r,s){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(r))return!1;try{return s.base64Decoder(r).length===32}catch{return!1}}var Wd={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},js=(r)=>({applyToStack:(s)=>{s.add(yd(r),Wd)}});class Nf extends Dr.classBuilder().ep({...kr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,l,f){return[Ur(l,this.serialize,this.deserialize),Mr(l,r.getEndpointParameterInstructions()),es(l,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),js(l),nf(l)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(yh,Gh).ser(jh).de(xh).build(){}class $f extends Dr.classBuilder().ep({...kr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,l,f){return[Ur(l,this.serialize,this.deserialize),Mr(l,r.getEndpointParameterInstructions()),es(l,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),jf(l),ds(l),js(l)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(Vh,Kh).ser(ih).de(oh).build(){}import{Buffer as Vm} from"buffer";class Lm extends ar{client;constructor(...r){super();this.client=new Pf(...r)}async put(r){let s,l,f,e=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,f=`${br()}.${r.type.split("/")[1].split(";")[0]}`,l=r.type;else s=r.body,f=r.name,l=r.contentType;l=s instanceof Blob||s instanceof File?s.type:void 0;const h=s instanceof Vm?s:Vm.from(await s.arrayBuffer());return await this.client.send(new $f({Bucket:e,Key:f,Body:h,ContentType:l})),f}async fetch(r){let s=process.env.BUCKET_NAME,l;if(typeof r==="string")l=r;else s=r.bucket??s,l=r.name;if(!l)throw new Error("Object name has to be specified");const f=await this.client.send(new Nf({Bucket:s,Key:l}));return new Response(f.Body.transformToWebStream(),{headers:{"Content-Type":f.ContentType,"Content-Length":f.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":f.LastModified?.toUTCString()||"",ETag:f.ETag||""}})}}class is{}class bs extends is{constructor(){super(...arguments)}requests=new Map;consume(r,s){if(!this.requests.has(r))this.requests.set(r,{date:Date.now(),count:1});else{const l=this.requests.get(r),f=Date.now();if(f-l.date>=60000)this.requests.set(r,{date:f,count:1});else this.requests.set(r,{date:l.date,count:l.count+1})}return this.requests.get(r).count}}class Zm extends c{constructor(){super(...arguments)}driver=new bs;boot(){}}import*as Hd from"react-dom/server";var Qm=z(Vd(),1);import{Writable as cd} from"stream";var{defineProperty:Ld,getOwnPropertySymbols:vm}=Object,Zd=Object.prototype.hasOwnProperty,vd=Object.prototype.propertyIsEnumerable,Hm=(r,s,l)=>(s in r)?Ld(r,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[s]=l,Df=(r,s)=>{for(var l in s||(s={}))if(Zd.call(s,l))Hm(r,l,s[l]);if(vm){for(var l of vm(s))if(vd.call(s,l))Hm(r,l,s[l])}return r},Uf=(r,s,l)=>{return new Promise((f,e)=>{var h=(g)=>{try{a(l.next(g))}catch(R){e(R)}},m=(g)=>{try{a(l.throw(g))}catch(R){e(R)}},a=(g)=>g.done?f(g.value):Promise.resolve(g.value).then(h,m);a((l=l.apply(r,s)).next())})},Jd={unformatted:["code","pre","em","strong","span"],indent_inner_html:!0,indent_char:" ",indent_size:2,sep:"\n"},Xd=(r,s={})=>{return Qm.default.html(r,Df(Df({},Jd),s))},Qd=[{selector:"img",format:"skip"},{selector:"#__react-email-preview",format:"skip"},{selector:"a",options:{linkBrackets:!1}}];var Jm=new TextDecoder("utf-8"),Xm=(r)=>Uf(void 0,null,function*(){let s="";if("pipeTo"in r){const l=new WritableStream({write(f){s+=Jm.decode(f)}});yield r.pipeTo(l)}else{const l=new cd({write(f,e,h){s+=Jm.decode(f),h()}});return r.pipe(l),new Promise((f,e)=>{l.on("error",e),l.on("close",()=>{f(s)})})}return s}),xs=(r,s)=>Uf(void 0,null,function*(){const{default:l}=yield import("react-dom/server");let f;if(Object.hasOwn(l,"renderToReadableStream"))f=yield Xm(yield l.renderToReadableStream(r));else yield new Promise((m,a)=>{const g=l.renderToPipeableStream(r,{onAllReady(){return Uf(this,null,function*(){f=yield Xm(g),m()})},onError(R){a(R)}})});if(s==null?void 0:s.plainText)return Mf(f,Df({selectors:Qd},s.htmlToTextOptions));const h=`${'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'}${f.replace(/<!DOCTYPE.*?>/,"")}`;if(s==null?void 0:s.pretty)return Xd(h);return h});var{defineProperty:Yd,defineProperties:Bd,getOwnPropertyDescriptors:Od,getOwnPropertySymbols:cm}=Object,qd=Object.prototype.hasOwnProperty,_d=Object.prototype.propertyIsEnumerable,Ym=(r,s,l)=>(s in r)?Yd(r,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[s]=l,jr=(r,s)=>{for(var l in s||(s={}))if(qd.call(s,l))Ym(r,l,s[l]);if(cm){for(var l of cm(s))if(_d.call(s,l))Ym(r,l,s[l])}return r},jd=(r,s)=>Bd(r,Od(s)),I=(r,s,l)=>{return new Promise((f,e)=>{var h=(g)=>{try{a(l.next(g))}catch(R){e(R)}},m=(g)=>{try{a(l.throw(g))}catch(R){e(R)}},a=(g)=>g.done?f(g.value):Promise.resolve(g.value).then(h,m);a((l=l.apply(r,s)).next())})},id="3.5.0",bd=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post("/api-keys",s,l)})}list(){return I(this,null,function*(){return yield this.resend.get("/api-keys")})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/api-keys/${r}`)})}},xd=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post("/audiences",s,l)})}list(){return I(this,null,function*(){return yield this.resend.get("/audiences")})}get(r){return I(this,null,function*(){return yield this.resend.get(`/audiences/${r}`)})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/audiences/${r}`)})}},od=class{constructor(r){this.resend=r}send(r){return I(this,arguments,function*(s,l={}){return this.create(s,l)})}create(r){return I(this,arguments,function*(s,l={}){for(let e of s)if(e.react)e.html=yield xs(e.react),delete e.react;return yield this.resend.post("/emails/batch",s,l)})}},nd=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post(`/audiences/${s.audienceId}/contacts`,{unsubscribed:s.unsubscribed,email:s.email,first_name:s.firstName,last_name:s.lastName},l)})}list(r){return I(this,null,function*(){return yield this.resend.get(`/audiences/${r.audienceId}/contacts`)})}get(r){return I(this,null,function*(){return yield this.resend.get(`/audiences/${r.audienceId}/contacts/${r.id}`)})}update(r){return I(this,null,function*(){return yield this.resend.patch(`/audiences/${r.audienceId}/contacts/${r.id}`,{unsubscribed:r.unsubscribed,first_name:r.firstName,last_name:r.lastName})})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/audiences/${r.audienceId}/contacts/${(r==null?void 0:r.email)?r==null?void 0:r.email:r==null?void 0:r.id}`)})}},pd=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post("/domains",s,l)})}list(){return I(this,null,function*(){return yield this.resend.get("/domains")})}get(r){return I(this,null,function*(){return yield this.resend.get(`/domains/${r}`)})}update(r){return I(this,null,function*(){return yield this.resend.patch(`/domains/${r.id}`,{click_tracking:r.clickTracking,open_tracking:r.openTracking,tls:r.tls})})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/domains/${r}`)})}verify(r){return I(this,null,function*(){return yield this.resend.post(`/domains/${r}/verify`)})}},ud=class{constructor(r){this.resend=r}send(r){return I(this,arguments,function*(s,l={}){return this.create(s,l)})}create(r){return I(this,arguments,function*(s,l={}){if(s.react)s.html=yield xs(s.react),delete s.react;return yield this.resend.post("/emails",s,l)})}get(r){return I(this,null,function*(){return yield this.resend.get(`/emails/${r}`)})}},Bm="https://api.resend.com",Om=`resend-node:${id}`,td=typeof process!=="undefined"&&process.env?process.env.RESEND_BASE_URL||Bm:Bm,r3=typeof process!=="undefined"&&process.env?process.env.RESEND_USER_AGENT||Om:Om,qm=class{constructor(r){if(this.key=r,this.apiKeys=new bd(this),this.audiences=new xd(this),this.batch=new od(this),this.contacts=new nd(this),this.domains=new pd(this),this.emails=new ud(this),!r){if(typeof process!=="undefined"&&process.env)this.key=process.env.RESEND_API_KEY;if(!this.key)throw new Error('Missing API key. Pass it to the constructor `new Resend("re_123")`')}this.headers=new Headers({Authorization:`Bearer ${this.key}`,"User-Agent":r3,"Content-Type":"application/json"})}fetchRequest(r){return I(this,arguments,function*(s,l={}){try{const f=yield fetch(`${td}${s}`,l);if(!f.ok)try{const h=yield f.text();return{data:null,error:JSON.parse(h)}}catch(h){if(h instanceof SyntaxError)return{data:null,error:{name:"application_error",message:"Internal server error. We are unable to process your request right now, please try again later."}};const m={message:f.statusText,name:"application_error"};if(h instanceof Error)return{data:null,error:jd(jr({},m),{message:h.message})};return{data:null,error:m}}return{data:yield f.json(),error:null}}catch(f){return{data:null,error:{name:"application_error",message:"Unable to fetch data. The request could not be resolved."}}}})}post(r,s){return I(this,arguments,function*(l,f,e={}){const h=jr({method:"POST",headers:this.headers,body:JSON.stringify(f)},e);return this.fetchRequest(l,h)})}get(r){return I(this,arguments,function*(s,l={}){const f=jr({method:"GET",headers:this.headers},l);return this.fetchRequest(s,f)})}put(r,s){return I(this,arguments,function*(l,f,e={}){const h=jr({method:"PUT",headers:this.headers,body:JSON.stringify(f)},e);return this.fetchRequest(l,h)})}patch(r,s){return I(this,arguments,function*(l,f,e={}){const h=jr({method:"PATCH",headers:this.headers,body:JSON.stringify(f)},e);return this.fetchRequest(l,h)})}delete(r,s){return I(this,null,function*(){const l={method:"DELETE",headers:this.headers,body:JSON.stringify(s)};return this.fetchRequest(r,l)})}};class os{}class ns extends os{r;constructor(r=process.env.RESEND_API_KEY){super();this.apiKey=r}async send(r){const s=new qm(this.apiKey);console.log(r);const{data:l,error:f}=await s.emails.send({...r});if(f)return console.error(f),!1;if(l)return!0}}class _m extends c{constructor(){super(...arguments)}driver=new ns;boot(){}}class jm extends c{constructor(){super(...arguments)}channels={};boot(){}}class im extends c{constructor(){super(...arguments)}root;rootRouter;boot(){}}class bm extends c{constructor(){super(...arguments)}rootRouter;boot(){return"Origin"}}export{im as ViewRouterServiceProvider,Lm as S3Driver,ns as ResendDriver,Zm as RateLimiterServiceProvider,is as RateLimiterDriver,bs as InMemoryRateLimiter,xr as FileSystemDriver,Tf as FileStorageServiceProvider,ar as FileStorageDriver,_m as EmailServiceProvider,os as EmailDriver,jm as BroadcastingServiceProvider,bm as ApiRouterServiceProvider};export{Tf as w,bm as x,Zm as y,_m as z,jm as A,im as B};
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
${e}`}async createStringToSign(r,s,e){const f=new this.sha256;f.update(Y(e));const l=await f.digest();return`${Es}
|
|
9
|
-
${r}
|
|
10
|
-
${s}
|
|
11
|
-
${Vr.toHex(l)}`}getCanonicalPath({path:r}){if(this.uriEscapePath){const s=[];for(let l of r.split("/")){if(l?.length===0)continue;if(l===".")continue;if(l==="..")s.pop();else s.push(l)}const e=`${r?.startsWith("/")?"/":""}${s.join("/")}${s.length>0&&r?.endsWith("/")?"/":""}`;return jl.escapeUri(e).replace(/%2F/g,"/")}return r}async getSignature(r,s,e,f){const l=await this.createStringToSign(r,s,f),a=new this.sha256(await e);return a.update(Y(l)),Vr.toHex(await a.digest())}getSigningKey(r,s,e,f){return Zl(this.sha256,r,e,s,f||this.service)}validateResolvedCredentials(r){if(typeof r!=="object"||typeof r.accessKeyId!=="string"||typeof r.secretAccessKey!=="string")throw new Error("Resolved credential object is not valid")}}var $s=(r)=>{const s=_l(r).replace(/[\-:]/g,"");return{longDate:s,shortDate:s.slice(0,8)}},ql=(r)=>Object.keys(r).sort().join(";");var il="Directory",bl="S3Express",xl="sigv4-s3express",ys="X-Amz-S3session-Token",Jr=ys.toLowerCase(),Rw="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",Sw="s3_disable_express_session_auth",He={environmentVariableSelector:(r)=>er(r,Rw,fr.ENV),configFileSelector:(r)=>er(r,Sw,fr.CONFIG),default:!1};var ol=function(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}},nl=function(r,s){const e=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),f=r.credentialProvider,l=()=>{return clearTimeout(e),r.credentialProvider=f,Promise.resolve(s)};r.credentialProvider=l};class Us extends Ce{async signWithCredentials(r,s,e){const f=ol(s);r.headers[Jr]=s.sessionToken;const l=this;return nl(l,f),l.signRequest(r,e??{})}async presignWithCredentials(r,s,e){const f=ol(s);return delete r.headers[Jr],r.headers[ys]=s.sessionToken,r.query=r.query??{},r.query[ys]=s.sessionToken,nl(this,f),this.presign(r,e)}}var pl=(r)=>{return(s,e)=>async(f)=>{if(e.endpointV2){const l=e.endpointV2,a=l.properties?.authSchemes?.[0]?.name===xl;if(l.properties?.backend===bl||l.properties?.bucketType===il)e.isS3ExpressBucket=!0;if(a){const m=f.input.Bucket;if(m){const g=await r.s3ExpressIdentityProvider.getS3ExpressIdentity(await r.credentials(),{Bucket:m});if(e.s3ExpressIdentity=g,L.isInstance(f.request)&&g.sessionToken)f.request.headers[Jr]=g.sessionToken}}}return s(f)}},ul={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},ve=(r)=>({applyToStack:(s)=>{s.add(pl(r),ul)}});var ra=U(Ge(),1);var cw=U(Ew(),1),sa=U(As(),1);var tl=async(r,s,e,f)=>{const l=await f.signWithCredentials(e,r,{});if(l.headers["X-Amz-Security-Token"]||l.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return l};var Iw=(r)=>(s)=>{throw s},Pw=(r,s)=>{};var ea=(r)=>(s,e)=>async(f)=>{if(!L.isInstance(f.request))return s(f);const a=sa.getSmithyContext(e).selectedHttpAuthScheme;if(!a)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:h={}},identity:m,signer:g}=a;let w;if(e.s3ExpressIdentity)w=await tl(e.s3ExpressIdentity,h,f.request,await r.signer());else w=await g.sign(f.request,m,h);const E=await s({...f,request:w}).catch((g.errorHandler||Iw)(h));return(g.successHandler||Pw)(E.response,h),E},ze=(r)=>({applyToStack:(s)=>{s.addRelativeTo(ea(r),ra.httpSigningMiddlewareOptions)}});var fa=(r,{session:s})=>{const[e,f]=s;return{...r,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,followRegionRedirects:r.followRegionRedirects??!1,s3ExpressIdentityProvider:r.s3ExpressIdentityProvider??new Sr(async(l)=>e().send(new f({Bucket:l,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var kw={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Nw=3000,Dw=(r)=>(s,e)=>async(f)=>{const l=await s(f),{response:a}=l;if(!Ss.isInstance(a))return l;const{statusCode:h,body:m}=a;if(h<200||h>=300)return l;if(!(typeof m?.stream==="function"||typeof m?.pipe==="function"||typeof m?.tee==="function"))return l;let w=m,E=m;if(m&&typeof m==="object"&&!(m instanceof Uint8Array))[w,E]=await la(m);a.body=E;const I=await $w(w,{streamCollector:async(N)=>{return aa(N,Nw)}});if(typeof w?.destroy==="function")w.destroy();const P=r.utf8Encoder(I.subarray(I.length-16));if(I.length===0&&kw[e.commandName]){const N=new Error("S3 aborted request");throw N.name="InternalError",N}if(P&&P.endsWith("</Error>"))a.statusCode=400;return l},$w=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},yw={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},Ts=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Dw(r),yw)}});var Fe=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function ha(r){return(s,e)=>async(f)=>{if(r.bucketEndpoint){const l=e.endpointV2;if(l){const a=f.input.Bucket;if(typeof a==="string")try{const h=new URL(a);e.endpointV2={...l,url:h}}catch(h){const m=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${a} could not be parsed as URL.`;if(e.logger?.constructor?.name==="NoOpLogger")console.warn(m);else e.logger?.warn?.(m);throw h}}}return s(f)}}var ma={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Uw({bucketEndpoint:r}){return(s)=>async(e)=>{const{input:{Bucket:f}}=e;if(!r&&typeof f==="string"&&!Fe(f)&&f.indexOf("/")>=0){const l=new Error(`Bucket name shouldn't contain '/', received '${f}'`);throw l.name="InvalidBucketName",l}return s({...e})}}var Tw={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},ga=(r)=>({applyToStack:(s)=>{s.add(Uw(r),Tw),s.addRelativeTo(ha(r),ma)}});var Cr=U(Ge(),1);var wa=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var Ws=U(Ls(),1);var Ms={CrtSignerV4:null};class Ke{constructor(r){this.sigv4Signer=new Us(r),this.signerOptions=r}async sign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().sign(r,s)}return this.sigv4Signer.sign(r,s)}async signWithCredentials(r,s,e={}){if(e.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().signWithCredentials(r,s,e)}return this.sigv4Signer.signWithCredentials(r,s,e)}async presign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().presign(r,s)}return this.sigv4Signer.presign(r,s)}async presignWithCredentials(r,s,e={}){if(e.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(r,s,e)}getSigv4aSigner(){if(!this.sigv4aSigner){let r=null;try{if(r=Ms.CrtSignerV4,typeof r!=="function")throw new Error}catch(s){throw s.message=`${s.message}\n`+'Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. \nYou must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. \nFor more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt',s}this.sigv4aSigner=new r({...this.signerOptions,signingAlgorithm:1})}return this.sigv4aSigner}}var Or=U(As(),1);var cr={["required"]:!1,["type"]:"String"},Ir={["required"]:!0,default:!1,["type"]:"Boolean"},Br={["required"]:!1,["type"]:"Boolean"},_={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},$={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},D={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},C={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},rh={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},da={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},zs={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},Q={["ref"]:"Bucket"},W={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},Gs={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},sh={["ref"]:"url"},eh={["fn"]:"uriEncode",["argv"]:[Q],["assign"]:"uri_encoded_bucket"},x={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},d={},fh={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Q,!1]},Le={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},Fs={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},Aa={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},Ra={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},A={["fn"]:"not",["argv"]:[C]},Sa={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},Ea={["fn"]:"not",["argv"]:[zs]},ca={["ref"]:"hardwareType"},Ia={["conditions"]:[A],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},Cs={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},We={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},Mw={["ref"]:"ForcePathStyle"},M={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},v={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},z={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},c={["fn"]:"not",["argv"]:[v]},F={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},Pa={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},H={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},K={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},S={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},ka={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:{}},R={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},Na={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:{}},Da={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:{}},Qe={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[sh,"isIp"]},!1]},Xe={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:H,["headers"]:{}},ef={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:H,["headers"]:{}},$a={["endpoint"]:ef,["type"]:"endpoint"},Ze={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:{}},ya={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:{}},Hs={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},J={["ref"]:"bucketArn"},lh={["ref"]:"arnType"},Ve={["fn"]:"getAttr",["argv"]:[J,"service"]},ff={["ref"]:"accessPointName"},Ua={["conditions"]:[D],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},Ta={["conditions"]:[_],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},Ma={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},Je={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},ah={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},hh={["fn"]:"getAttr",["argv"]:[J,"accountId"]},Be={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},Ca={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},Ye={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},Oe={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},_e={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},Ha={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},va={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Yr={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},Ga={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},za={["fn"]:"aws.parseArn",["argv"]:[Q]},Fa={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:{}},Ka={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:{}},La={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:{}},qe={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:H,["headers"]:{}},Wa={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:{}},Qa={["ref"]:"UseObjectLambdaEndpoint"},je={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},Xa={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:{}},Za={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:{}},Va={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:{}},ie={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:H,["headers"]:{}},Ja={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:{}},be=[{["ref"]:"Region"}],Cw=[{["ref"]:"Endpoint"}],Hw=[Q],xe=[D],vs=[_],lr=[C,W],Ba=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],Ya=[Gs],oe=[eh],ne=[fh],Pr=[$],Oa=[{["fn"]:"substring",["argv"]:[Q,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Q,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],_a=[{["conditions"]:[$],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:x,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:x,["headers"]:{}},["type"]:"endpoint"}],qa=[{["fn"]:"substring",["argv"]:[Q,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Q,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],ja=[{["conditions"]:[$],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:Fs,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:Fs,["headers"]:{}},["type"]:"endpoint"}],vw=[zs],ia=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],ba=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],Gw=["*"],n=[rh],xa=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],p=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],pe=[{["fn"]:"stringEquals",["argv"]:[lh,"accesspoint"]}],oa=[{["fn"]:"getAttr",["argv"]:[J,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[ff,""]}]}],zw=[J,"resourceId[1]"],ue=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},""]}]}],na=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[2]"]}]}]}],Fw=[J,"resourceId[2]"],te=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]}],["assign"]:"bucketPartition"}],pa=[{["fn"]:"stringEquals",["argv"]:[ah,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],rf=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},!0]}],sf=[{["fn"]:"isValidHostLabel",["argv"]:[hh,!1]}],ua=[{["fn"]:"isValidHostLabel",["argv"]:[ff,!1]}],ta=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],Kw={version:"1.0",parameters:{Bucket:cr,Region:cr,UseFIPS:Ir,UseDualStack:Ir,Endpoint:cr,ForcePathStyle:Ir,Accelerate:Ir,UseGlobalEndpoint:Ir,UseObjectLambdaEndpoint:Br,Key:cr,Prefix:cr,CopySource:cr,DisableAccessPoints:Br,DisableMultiRegionAccessPoints:Ir,UseArnRegion:Br,UseS3ExpressControlEndpoint:Br,DisableS3ExpressSessionAuth:Br},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:be}],rules:[{["conditions"]:[_,$],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[D,C],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[C,$],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[C,_],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[$,rh,da],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[zs,{["fn"]:"substring",["argv"]:[Q,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:xe,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:vs,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:lr,rules:[{["conditions"]:Ba,rules:[{["conditions"]:Ya,rules:[{["conditions"]:oe,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:x,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:ne,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:x,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},Le],["type"]:"tree"},{["conditions"]:Ya,rules:[{["conditions"]:oe,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:Fs,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:ne,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:Fs,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},Le],["type"]:"tree"},{["conditions"]:[Aa,Ra],rules:[{["conditions"]:[eh,A],rules:[{["conditions"]:Pr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:x,["headers"]:d},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:x,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:ne,rules:[{["conditions"]:Ba,rules:[{["conditions"]:Oa,rules:_a,["type"]:"tree"},{["conditions"]:qa,rules:_a,["type"]:"tree"},Sa],["type"]:"tree"},{["conditions"]:Oa,rules:ja,["type"]:"tree"},{["conditions"]:qa,rules:ja,["type"]:"tree"},Sa],["type"]:"tree"},Le],["type"]:"tree"},{["conditions"]:[Ea,Aa,Ra],rules:[{["conditions"]:lr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:x,["headers"]:d},["type"]:"endpoint"},{["conditions"]:Pr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com",["properties"]:x,["headers"]:d},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com",["properties"]:x,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[zs,{["fn"]:"substring",["argv"]:[Q,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[Q,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:[Q,0,7,!0],["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[Q,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:be,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:ia,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[ca,"e"]}],rules:[{["conditions"]:ba,rules:[Ia,{["conditions"]:lr,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:Cs,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Cs,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[ca,"o"]}],rules:[{["conditions"]:ba,rules:[Ia,{["conditions"]:lr,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:Cs,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Cs,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},{error:"Unrecognized hardware type: \"Expected hardware type o or e but got {hardwareType}\"",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",["type"]:"error"}],["type"]:"tree"},{["conditions"]:vw,rules:[{["conditions"]:[C,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:Cw}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[We,fh],rules:[{["conditions"]:n,rules:[{["conditions"]:xa,rules:[{["conditions"]:[_,da],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[D,$,M,A,v],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[D,$,M,A,c,F],rules:[{endpoint:Pa,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,$,M,A,c,K],endpoint:Pa,["type"]:"endpoint"},{["conditions"]:[S,$,M,A,v],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,$,M,A,c,F],rules:[{endpoint:ka,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,$,M,A,c,K],endpoint:ka,["type"]:"endpoint"},{["conditions"]:[D,R,_,A,v],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[D,R,_,A,c,F],rules:[{endpoint:Na,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,R,_,A,c,K],endpoint:Na,["type"]:"endpoint"},{["conditions"]:[D,R,M,A,v],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[D,R,M,A,c,F],rules:[{endpoint:Da,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,R,M,A,c,K],endpoint:Da,["type"]:"endpoint"},{["conditions"]:[S,R,M,C,W,Gs,v],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,R,M,C,W,Qe,v],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,R,M,C,W,Gs,c,F],rules:[{["conditions"]:p,endpoint:Xe,["type"]:"endpoint"},{endpoint:Xe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,R,M,C,W,Qe,c,F],rules:[{["conditions"]:p,endpoint:ef,["type"]:"endpoint"},$a],["type"]:"tree"},{["conditions"]:[S,R,M,C,W,Gs,c,K],endpoint:Xe,["type"]:"endpoint"},{["conditions"]:[S,R,M,C,W,Qe,c,K],endpoint:ef,["type"]:"endpoint"},{["conditions"]:[S,R,_,A,v],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,R,_,A,c,F],rules:[{["conditions"]:p,endpoint:Ze,["type"]:"endpoint"},{endpoint:Ze,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,R,_,A,c,K],endpoint:Ze,["type"]:"endpoint"},{["conditions"]:[S,R,M,A,v],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,R,M,A,c,F],rules:[{["conditions"]:p,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:d},["type"]:"endpoint"},{endpoint:ya,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,R,M,A,c,K],endpoint:ya,["type"]:"endpoint"}],["type"]:"tree"},Hs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[C,W,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[sh,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Q,!0]},We,R,S,M],rules:[{["conditions"]:n,rules:[{["conditions"]:xa,rules:[$a],["type"]:"tree"},Hs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[We,{["fn"]:"aws.parseArn",["argv"]:Hw,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[lh,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Ve,"s3-object-lambda"]}],rules:[{["conditions"]:pe,rules:[{["conditions"]:oa,rules:[Ua,Ta,{["conditions"]:ue,rules:[Ma,{["conditions"]:na,rules:[Je,{["conditions"]:te,rules:[{["conditions"]:n,rules:[{["conditions"]:pa,rules:[{["conditions"]:rf,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[hh,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:sf,rules:[{["conditions"]:ua,rules:[{["conditions"]:lr,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Be,["headers"]:d},["type"]:"endpoint"},{["conditions"]:Pr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Be,["headers"]:d},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Be,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},Ca],["type"]:"tree"},Ye],["type"]:"tree"},Oe],["type"]:"tree"},_e],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Ha],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},va],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:pe,rules:[{["conditions"]:oa,rules:[{["conditions"]:ue,rules:[{["conditions"]:pe,rules:[{["conditions"]:ue,rules:[Ma,{["conditions"]:na,rules:[Je,{["conditions"]:te,rules:[{["conditions"]:n,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[ah,"{partitionResult#name}"]}],rules:[{["conditions"]:rf,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Ve,"s3"]}],rules:[{["conditions"]:sf,rules:[{["conditions"]:ua,rules:[{["conditions"]:vs,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:[$,D],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Yr,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[$,S],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Yr,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[R,D],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Yr,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[R,S,C,W],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Yr,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[R,S],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Yr,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},Ca],["type"]:"tree"},Ye],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},Oe],["type"]:"tree"},_e],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Ha],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[ff,!0]}],rules:[{["conditions"]:xe,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:Pr,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:vs,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"]:be,["assign"]:"mrapPartition"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[J,"partition"]}]}],rules:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:Gw}]},["headers"]:d},["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"},va],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Ve,"s3-outposts"]}],rules:[{["conditions"]:xe,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:Pr,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:vs,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:zw,["assign"]:"outpostId"}],rules:[{["conditions"]:ia,rules:[Je,{["conditions"]:te,rules:[{["conditions"]:n,rules:[{["conditions"]:pa,rules:[{["conditions"]:rf,rules:[{["conditions"]:sf,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:Fw,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:lr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:Ga,["headers"]:d},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ga,["headers"]:d},["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"},Ye],["type"]:"tree"},Oe],["type"]:"tree"},_e],["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"]:[Q,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[za]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[Mw,!0]},za],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:oe,rules:[{["conditions"]:n,rules:[{["conditions"]:[M],rules:[{["conditions"]:[D,A,$,v],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[D,A,$,c,F],rules:[{endpoint:Fa,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,A,$,c,K],endpoint:Fa,["type"]:"endpoint"},{["conditions"]:[S,A,$,v],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,A,$,c,F],rules:[{endpoint:Ka,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,A,$,c,K],endpoint:Ka,["type"]:"endpoint"},{["conditions"]:[D,A,R,v],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[D,A,R,c,F],rules:[{endpoint:La,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,A,R,c,K],endpoint:La,["type"]:"endpoint"},{["conditions"]:[S,C,W,R,v],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,C,W,R,c,F],rules:[{["conditions"]:p,endpoint:qe,["type"]:"endpoint"},{endpoint:qe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,C,W,R,c,K],endpoint:qe,["type"]:"endpoint"},{["conditions"]:[S,A,R,v],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,A,R,c,F],rules:[{["conditions"]:p,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:d},["type"]:"endpoint"},{endpoint:Wa,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,A,R,c,K],endpoint:Wa,["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"]:[Qa]},{["fn"]:"booleanEquals",["argv"]:[Qa,!0]}],rules:[{["conditions"]:n,rules:[{["conditions"]:ta,rules:[Ua,Ta,{["conditions"]:lr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:je,["headers"]:d},["type"]:"endpoint"},{["conditions"]:Pr,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:je,["headers"]:d},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:je,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},Hs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Ea],rules:[{["conditions"]:n,rules:[{["conditions"]:ta,rules:[{["conditions"]:[$,D,A,v],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[$,D,A,c,F],rules:[{endpoint:Xa,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[$,D,A,c,K],endpoint:Xa,["type"]:"endpoint"},{["conditions"]:[$,S,A,v],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[$,S,A,c,F],rules:[{endpoint:Za,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[$,S,A,c,K],endpoint:Za,["type"]:"endpoint"},{["conditions"]:[R,D,A,v],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[R,D,A,c,F],rules:[{endpoint:Va,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,D,A,c,K],endpoint:Va,["type"]:"endpoint"},{["conditions"]:[R,S,C,W,v],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[R,S,C,W,c,F],rules:[{["conditions"]:p,endpoint:ie,["type"]:"endpoint"},{endpoint:ie,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,S,C,W,c,K],endpoint:ie,["type"]:"endpoint"},{["conditions"]:[R,S,A,v],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[R,S,A,c,F],rules:[{["conditions"]:p,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:d},["type"]:"endpoint"},{endpoint:Ja,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,S,A,c,K],endpoint:Ja,["type"]:"endpoint"}],["type"]:"tree"},Hs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},mh=Kw;var Lw=new gh({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),Ks=(r,s={})=>{return Lw.get(r,()=>dh(mh,{endpointParams:r,logger:s.logger}))};wh.aws=Ah;var Eh=function(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,e)=>({signingProperties:{config:s,context:e}})}},ch=function(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,e)=>({signingProperties:{config:s,context:e}})}},Ww=(r)=>async(s,e,f)=>{if(!f)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const l=await r(s,e,f),a=Or.getSmithyContext(e)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!a)throw new Error(`getEndpointParameterInstructions() is not defined on \`${e.commandName}\``);const h=await Rh(f,{getEndpointParameterInstructions:a},s);return Object.assign(l,h)},Qw=async(r,s,e)=>{return{operation:Or.getSmithyContext(s).operation,region:await Or.normalizeProvider(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Sh=Ww(Qw),Xw=(r,s,e)=>{return(l)=>{const h=r(l).properties?.authSchemes;if(!h)return s(l);const m=[];for(let g of h){const{name:w,properties:E={},...I}=g,P=w.toLowerCase();if(w!==P)console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${w}\` to \`${P}\``);let N;if(P==="sigv4a"){N="aws.auth#sigv4a";const ur=h.find((b)=>{const Hr=b.name.toLowerCase();return Hr!=="sigv4a"&&Hr.startsWith("sigv4")});if(!Ms.CrtSignerV4&&ur)continue}else if(P.startsWith("sigv4"))N="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${P}\``);const y=e[N];if(!y)throw new Error(`Could not find HttpAuthOption create function for \`${N}\``);const V=y(l);V.schemeId=N,V.signingProperties={...V.signingProperties||{},...I,...E},m.push(V)}return m}},Zw=(r)=>{const s=[];switch(r.operation){default:s.push(Eh(r)),s.push(ch(r))}return s},Ih=Xw(Ks,Zw,{"aws.auth#sigv4":Eh,"aws.auth#sigv4a":ch}),Ph=(r)=>{const s=Ws.resolveAwsSdkSigV4Config(r);return{...Ws.resolveAwsSdkSigV4AConfig(s)}};var kh=(r)=>{return{...r,useFipsEndpoint:r.useFipsEndpoint??!1,useDualstackEndpoint:r.useDualstackEndpoint??!1,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,useGlobalEndpoint:r.useGlobalEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,defaultSigningName:"s3"}},kr={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class X extends Nh{constructor(r){super(r);Object.setPrototypeOf(this,X.prototype)}}class Qs extends X{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,Qs.prototype)}}class Xs extends X{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Xs.prototype)}}class Zs extends X{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,Zs.prototype)}}class Vs extends X{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,Vs.prototype)}}class Js extends X{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,Js.prototype)}}var lf;(function(r){r.visit=(s,e)=>{if(s.Prefix!==void 0)return e.Prefix(s.Prefix);if(s.Tag!==void 0)return e.Tag(s.Tag);if(s.And!==void 0)return e.And(s.And);return e._(s.$unknown[0],s.$unknown[1])}})(lf||(lf={}));var af;(function(r){r.visit=(s,e)=>{if(s.Prefix!==void 0)return e.Prefix(s.Prefix);if(s.Tag!==void 0)return e.Tag(s.Tag);if(s.ObjectSizeGreaterThan!==void 0)return e.ObjectSizeGreaterThan(s.ObjectSizeGreaterThan);if(s.ObjectSizeLessThan!==void 0)return e.ObjectSizeLessThan(s.ObjectSizeLessThan);if(s.And!==void 0)return e.And(s.And);return e._(s.$unknown[0],s.$unknown[1])}})(af||(af={}));var hf;(function(r){r.visit=(s,e)=>{if(s.Prefix!==void 0)return e.Prefix(s.Prefix);if(s.Tag!==void 0)return e.Tag(s.Tag);if(s.AccessPointArn!==void 0)return e.AccessPointArn(s.AccessPointArn);if(s.And!==void 0)return e.And(s.And);return e._(s.$unknown[0],s.$unknown[1])}})(hf||(hf={}));var mf;(function(r){r.visit=(s,e)=>{if(s.Prefix!==void 0)return e.Prefix(s.Prefix);if(s.Tag!==void 0)return e.Tag(s.Tag);if(s.And!==void 0)return e.And(s.And);return e._(s.$unknown[0],s.$unknown[1])}})(mf||(mf={}));class Bs extends X{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,Bs.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class Ys extends X{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,Ys.prototype)}}class Os extends X{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,Os.prototype)}}var Vw=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:Z},...r.SessionToken&&{SessionToken:Z}}),Dh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:Z},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Z},...r.Credentials&&{Credentials:Vw(r.Credentials)}}),$h=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:Z},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Z}});var yh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:Z}}),Uh=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:Z}});var $r=U(Ls(),1);var js=U(Ge(),1);class _s extends X{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,_s.prototype)}}var Th;(function(r){r.visit=(s,e)=>{if(s.Records!==void 0)return e.Records(s.Records);if(s.Stats!==void 0)return e.Stats(s.Stats);if(s.Progress!==void 0)return e.Progress(s.Progress);if(s.Cont!==void 0)return e.Cont(s.Cont);if(s.End!==void 0)return e.End(s.End);return e._(s.$unknown[0],s.$unknown[1])}})(Th||(Th={}));var Mh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:Z},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Z}}),Ch=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:Z},...r.SSEKMSKeyId&&{SSEKMSKeyId:Z},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Z}});var Jh=async(r,s)=>{const e=js.requestBuilder(r,s),f=G({},j,{[jd]:r[Ud],[or]:r[br],[nr]:r[xr],[os]:r[xs],[u]:[()=>j(r[ar]),()=>r[ar].toString()]});e.bp("/"),e.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const l=G({[Yd]:[,""]});let a;return e.m("GET").h(f).q(l).b(a),e.build()};var Bh=async(r,s)=>{const e=js.requestBuilder(r,s),f=G({},j,{[zd]:r[wd],[Fd]:[()=>j(r[Hh]),()=>_r(r[Hh]).toString()],[Am]:r[uh],[Kd]:[()=>j(r[vh]),()=>_r(r[vh]).toString()],[Wd]:r[Ed],[ns]:r[is],[Nm]:r[fm],[ps]:r[bs],[Pm]:r[em],[Sm]:r[nh],[qd]:r[rd]});e.bp("/{Key+}"),e.p("Bucket",()=>r.Bucket,"{Bucket}",!1),e.p("Key",()=>r.Key,"{Key+}",!0);const l=G({[ym]:[,"GetObject"],[Qd]:[,r[cd]],[Xd]:[,r[Id]],[Zd]:[,r[Pd]],[Vd]:[,r[kd]],[Jd]:[,r[Nd]],[Bd]:[()=>r.ResponseExpires!==void 0,()=>_r(r[Dd]).toString()],[Od]:[,r[Mf]],[Ld]:[()=>r.PartNumber!==void 0,()=>r[Sd].toString()]});let a;return e.m("GET").h(f).q(l).b(a),e.build()};var Yh=async(r,s)=>{const e=js.requestBuilder(r,s),f=G({},j,{[wm]:r[oh]||"application/octet-stream",[_d]:r[pw],[am]:r[jh],[hm]:r[ih],[mm]:r[bh],[gm]:r[xh],[If]:[()=>j(r[Sf]),()=>r[Sf].toString()],[Hd]:r[sd],[ud]:r[tw],[Cf]:r[$f],[Hf]:r[yf],[vf]:r[Uf],[Gf]:r[Tf],[Pf]:[()=>j(r[Ef]),()=>_r(r[Ef]).toString()],[Am]:r[uh],[id]:r[ad],[bd]:r[hd],[xd]:r[md],[od]:r[gd],[or]:r[br],[km]:r[jr],[$m]:r[lm],[ns]:r[is],[Nm]:r[fm],[ps]:r[bs],[nr]:r[xr],[os]:r[xs],[u]:[()=>j(r[ar]),()=>r[ar].toString()],[Pm]:r[em],[td]:r[Td],[cm]:r[rm],[kf]:[()=>j(r[cf]),()=>Vh(r[cf]).toString()],[Em]:r[th],[Sm]:r[nh],...r.Metadata!==void 0&&Object.keys(r.Metadata).reduce((m,g)=>{return m[`x-amz-meta-${g.toLowerCase()}`]=r.Metadata[g],m},{})});e.bp("/{Key+}"),e.p("Bucket",()=>r.Bucket,"{Bucket}",!1),e.p("Key",()=>r.Key,"{Key+}",!0);const l=G({[ym]:[,"PutObject"]});let a,h;if(r.Body!==void 0)h=r.Body,a=h;return e.m("PUT").h(f).q(l).b(a),e.build()};var Oh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return Df(r,s);const e=G({$metadata:O(r),[br]:[,r.headers[or]],[xr]:[,r.headers[nr]],[xs]:[,r.headers[os]],[ar]:[()=>r.headers[u]!==void 0,()=>ir(r.headers[u])]}),f=Nr(Qh(await $r.parseXmlBody(r.body,s)),"body");if(f[df]!=null)e[df]=nw(f[df],s);return e};var _h=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return Df(r,s);const e=G({$metadata:O(r),[fd]:[()=>r.headers[zh]!==void 0,()=>ir(r.headers[zh])],[uw]:[,r.headers[Cd]],[qr]:[,r.headers[Rm]],[yd]:[,r.headers[nd]],[dd]:[()=>r.headers[Gh]!==void 0,()=>Nr(Wr(r.headers[Gh]))],[Sf]:[()=>r.headers[If]!==void 0,()=>Xh(r.headers[If])],[ph]:[,r.headers[dm]],[$f]:[,r.headers[Cf]],[yf]:[,r.headers[Hf]],[Uf]:[,r.headers[vf]],[Tf]:[,r.headers[Gf]],[Ad]:[()=>r.headers[Fh]!==void 0,()=>qs(r.headers[Fh])],[Mf]:[,r.headers[Dm]],[jh]:[,r.headers[am]],[ih]:[,r.headers[hm]],[bh]:[,r.headers[mm]],[xh]:[,r.headers[gm]],[ed]:[,r.headers[vd]],[oh]:[,r.headers[wm]],[Ef]:[()=>r.headers[Pf]!==void 0,()=>Nr(Wr(r.headers[Pf]))],[ld]:[,r.headers[Gd]],[lm]:[,r.headers[$m]],[br]:[,r.headers[or]],[is]:[,r.headers[ns]],[bs]:[,r.headers[ps]],[xr]:[,r.headers[nr]],[ar]:[()=>r.headers[u]!==void 0,()=>ir(r.headers[u])],[jr]:[,r.headers[km]],[sm]:[,r.headers[Im]],[$d]:[,r.headers[pd]],[Rd]:[()=>r.headers[Kh]!==void 0,()=>qs(r.headers[Kh])],[Md]:[()=>r.headers[Lh]!==void 0,()=>qs(r.headers[Lh])],[rm]:[,r.headers[cm]],[cf]:[()=>r.headers[kf]!==void 0,()=>Nr(Nf(r.headers[kf]))],[th]:[,r.headers[Em]],Metadata:[,Object.keys(r.headers).filter((l)=>l.startsWith("x-amz-meta-")).reduce((l,a)=>{return l[a.substring(11)]=r.headers[a],l},{})]}),f=r.body;return s.sdkStreamMixin(f),e.Body=f,e};var qh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return Df(r,s);const e=G({$metadata:O(r),[qr]:[,r.headers[Rm]],[ph]:[,r.headers[dm]],[$f]:[,r.headers[Cf]],[yf]:[,r.headers[Hf]],[Uf]:[,r.headers[vf]],[Tf]:[,r.headers[Gf]],[br]:[,r.headers[or]],[Mf]:[,r.headers[Dm]],[is]:[,r.headers[ns]],[bs]:[,r.headers[ps]],[xr]:[,r.headers[nr]],[xs]:[,r.headers[os]],[ar]:[()=>r.headers[u]!==void 0,()=>ir(r.headers[u])],[sm]:[,r.headers[Im]]});return await Wh(r.body,s),e};var Df=async(r,s)=>{const e={...r,body:await $r.parseXmlErrorBody(r.body,s)},f=$r.loadRestXmlErrorCode(r,e.body);switch(f){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await iw(e,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await ow(e,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await Yw(e,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await Ow(e,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await qw(e,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await _w(e,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await jw(e,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await bw(e,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await xw(e,s);default:const l=e.body;return Bw({output:r,parsedBody:l,errorCode:f})}},Bw=Zh(X),Yw=async(r,s)=>{const e=G({}),f=r.body,l=new Zs({$metadata:O(r),...e});return i(l,r.body)},Ow=async(r,s)=>{const e=G({}),f=r.body,l=new Vs({$metadata:O(r),...e});return i(l,r.body)},_w=async(r,s)=>{const e=G({}),f=r.body;if(f[wf]!=null)e[wf]=Dr(f[wf]);if(f[jr]!=null)e[jr]=Dr(f[jr]);const l=new Bs({$metadata:O(r),...e});return i(l,r.body)},qw=async(r,s)=>{const e=G({}),f=r.body,l=new Js({$metadata:O(r),...e});return i(l,r.body)},jw=async(r,s)=>{const e=G({}),f=r.body,l=new Ys({$metadata:O(r),...e});return i(l,r.body)},iw=async(r,s)=>{const e=G({}),f=r.body,l=new Qs({$metadata:O(r),...e});return i(l,r.body)},bw=async(r,s)=>{const e=G({}),f=r.body,l=new Os({$metadata:O(r),...e});return i(l,r.body)},xw=async(r,s)=>{const e=G({}),f=r.body,l=new _s({$metadata:O(r),...e});return i(l,r.body)},ow=async(r,s)=>{const e=G({}),f=r.body,l=new Xs({$metadata:O(r),...e});return i(l,r.body)};var nw=(r,s)=>{const e={};if(r[gf]!=null)e[gf]=Dr(r[gf]);if(r[Af]!=null)e[Af]=Dr(r[Af]);if(r[Rf]!=null)e[Rf]=Dr(r[Rf]);if(r[qr]!=null)e[qr]=Nr(Nf(r[qr]));return e};var O=(r)=>({httpStatusCode:r.statusCode,requestId:r.headers["x-amzn-requestid"]??r.headers["x-amzn-request-id"]??r.headers["x-amz-request-id"],extendedRequestId:r.headers["x-amz-id-2"],cfId:r.headers["x-amz-cf-id"]});var j=(r)=>r!==void 0&&r!==null&&r!==""&&(!Object.getOwnPropertyNames(r).includes("length")||r.length!=0)&&(!Object.getOwnPropertyNames(r).includes("size")||r.size!=0);var pw="ACL";var gf="AccessKeyId";var uw="AcceptRanges";var wf="AccessTier";var ar="BucketKeyEnabled";var df="Credentials",tw="ChecksumAlgorithm";var jh="CacheControl",$f="ChecksumCRC32",yf="ChecksumCRC32C",ih="ContentDisposition";var bh="ContentEncoding";var xh="ContentLanguage",Sf="ContentLength",rd="ChecksumMode",sd="ContentMD5";var ed="ContentRange";var Uf="ChecksumSHA1",Tf="ChecksumSHA256";var oh="ContentType";var fd="DeleteMarker";var Ef="Expires";var nh="ExpectedBucketOwner";var ld="ExpiresString";var ph="ETag";var qr="Expiration";var ad="GrantFullControl";var hd="GrantRead",md="GrantReadACP";var gd="GrantWriteACP";var wd="IfMatch",Hh="IfModifiedSince",uh="IfNoneMatch";var vh="IfUnmodifiedSince";var dd="LastModified";var Ad="MissingMeta";var th="ObjectLockLegalHoldStatus",rm="ObjectLockMode";var cf="ObjectLockRetainUntilDate";var Rd="PartsCount";var Sd="PartNumber";var Ed="Range";var sm="RequestCharged",cd="ResponseCacheControl",Id="ResponseContentDisposition",Pd="ResponseContentEncoding",kd="ResponseContentLanguage",Nd="ResponseContentType";var Dd="ResponseExpires";var em="RequestPayer";var $d="ReplicationStatus";var yd="Restore";var Af="SecretAccessKey";var jr="StorageClass";var Ud="SessionMode";var br="ServerSideEncryption";var is="SSECustomerAlgorithm",fm="SSECustomerKey",bs="SSECustomerKeyMD5";var xs="SSEKMSEncryptionContext",xr="SSEKMSKeyId";var Rf="SessionToken";var Td="Tagging";var Md="TagCount";var Mf="VersionId";var lm="WebsiteRedirectLocation";var Cd="accept-ranges";var am="cache-control",hm="content-disposition",mm="content-encoding",gm="content-language",If="content-length",Hd="content-md5",vd="content-range",wm="content-type";var Pf="expires";var dm="etag",Gd="expiresstring";var zd="if-match",Fd="if-modified-since";var Am="if-none-match";var Kd="if-unmodified-since";var Gh="last-modified";var Ld="partNumber";var Wd="range",Qd="response-cache-control",Xd="response-content-disposition",Zd="response-content-encoding",Vd="response-content-language",Jd="response-content-type",Bd="response-expires";var Yd="session";var Od="versionId";var _d="x-amz-acl";var Cf="x-amz-checksum-crc32",Hf="x-amz-checksum-crc32c",qd="x-amz-checksum-mode";var vf="x-amz-checksum-sha1",Gf="x-amz-checksum-sha256";var jd="x-amz-create-session-mode";var zh="x-amz-delete-marker",Rm="x-amz-expiration",Sm="x-amz-expected-bucket-owner";var id="x-amz-grant-full-control",bd="x-amz-grant-read",xd="x-amz-grant-read-acp";var od="x-amz-grant-write-acp";var Fh="x-amz-missing-meta";var Kh="x-amz-mp-parts-count";var Em="x-amz-object-lock-legal-hold",cm="x-amz-object-lock-mode",kf="x-amz-object-lock-retain-until-date";var nd="x-amz-restore",Im="x-amz-request-charged";var Pm="x-amz-request-payer";var pd="x-amz-replication-status";var km="x-amz-storage-class",ud="x-amz-sdk-checksum-algorithm";var or="x-amz-server-side-encryption",nr="x-amz-server-side-encryption-aws-kms-key-id",u="x-amz-server-side-encryption-bucket-key-enabled",os="x-amz-server-side-encryption-context",ns="x-amz-server-side-encryption-customer-algorithm",Nm="x-amz-server-side-encryption-customer-key",ps="x-amz-server-side-encryption-customer-key-md5",td="x-amz-tagging",Lh="x-amz-tagging-count";var Dm="x-amz-version-id",$m="x-amz-website-redirect-location",ym="x-id";class zf extends yr.classBuilder().ep({...kr,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,e,f){return[Ur(e,this.serialize,this.deserialize),Tr(e,r.getEndpointParameterInstructions()),Ts(e)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f($h,Dh).ser(Jh).de(Oh).build(){}var Um={name:"@aws-sdk/client-s3",description:"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",version:"3.654.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3",test:"yarn test:unit","test:e2e":"yarn test:e2e:node && yarn test:e2e:browser","test:e2e:browser":"ts-mocha test/**/*.browser.ispec.ts && karma start karma.conf.js","test:e2e:node":"jest --c jest.config.e2e.js","test:unit":"ts-mocha test/unit/**/*.spec.ts"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha1-browser":"5.2.0","@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.654.0","@aws-sdk/client-sts":"3.654.0","@aws-sdk/core":"3.654.0","@aws-sdk/credential-provider-node":"3.654.0","@aws-sdk/middleware-bucket-endpoint":"3.654.0","@aws-sdk/middleware-expect-continue":"3.654.0","@aws-sdk/middleware-flexible-checksums":"3.654.0","@aws-sdk/middleware-host-header":"3.654.0","@aws-sdk/middleware-location-constraint":"3.654.0","@aws-sdk/middleware-logger":"3.654.0","@aws-sdk/middleware-recursion-detection":"3.654.0","@aws-sdk/middleware-sdk-s3":"3.654.0","@aws-sdk/middleware-ssec":"3.654.0","@aws-sdk/middleware-user-agent":"3.654.0","@aws-sdk/region-config-resolver":"3.654.0","@aws-sdk/signature-v4-multi-region":"3.654.0","@aws-sdk/types":"3.654.0","@aws-sdk/util-endpoints":"3.654.0","@aws-sdk/util-user-agent-browser":"3.654.0","@aws-sdk/util-user-agent-node":"3.654.0","@aws-sdk/xml-builder":"3.654.0","@smithy/config-resolver":"^3.0.8","@smithy/core":"^2.4.3","@smithy/eventstream-serde-browser":"^3.0.9","@smithy/eventstream-serde-config-resolver":"^3.0.6","@smithy/eventstream-serde-node":"^3.0.8","@smithy/fetch-http-handler":"^3.2.7","@smithy/hash-blob-browser":"^3.1.5","@smithy/hash-node":"^3.0.6","@smithy/hash-stream-node":"^3.1.5","@smithy/invalid-dependency":"^3.0.6","@smithy/md5-js":"^3.0.6","@smithy/middleware-content-length":"^3.0.8","@smithy/middleware-endpoint":"^3.1.3","@smithy/middleware-retry":"^3.0.18","@smithy/middleware-serde":"^3.0.6","@smithy/middleware-stack":"^3.0.6","@smithy/node-config-provider":"^3.1.7","@smithy/node-http-handler":"^3.2.2","@smithy/protocol-http":"^4.1.3","@smithy/smithy-client":"^3.3.2","@smithy/types":"^3.4.2","@smithy/url-parser":"^3.0.6","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.18","@smithy/util-defaults-mode-node":"^3.0.18","@smithy/util-endpoints":"^2.1.2","@smithy/util-middleware":"^3.0.6","@smithy/util-retry":"^3.0.6","@smithy/util-stream":"^3.1.6","@smithy/util-utf8":"^3.0.0","@smithy/util-waiter":"^3.1.5",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/signature-v4-crt":"3.654.0","@tsconfig/node16":"16.1.3","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-s3"}};var ee=U(Ls(),1);var sA="AWS_S3_USE_ARN_REGION",eA="s3_use_arn_region",Tm={environmentVariableSelector:(r)=>er(r,sA,fr.ENV),configFileSelector:(r)=>er(r,eA,fr.CONFIG),default:!1};var t=U(Er(),1);var Cm=U(Er(),1),Mm=function(r){for(let s=0;s<8;s++)r[s]^=255;for(let s=7;s>-1;s--)if(r[s]++,r[s]!==0)break};class Mr{constructor(r){if(this.bytes=r,r.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(r){if(r>9223372036854776000||r<-9223372036854776000)throw new Error(`${r} is too large (or, if negative, too small) to represent as an Int64`);const s=new Uint8Array(8);for(let e=7,f=Math.abs(Math.round(r));e>-1&&f>0;e--,f/=256)s[e]=f;if(r<0)Mm(s);return new Mr(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)Mm(r);return parseInt(Cm.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class Ff{constructor(r,s){this.toUtf8=r,this.fromUtf8=s}format(r){const s=[];for(let l of Object.keys(r)){const a=this.fromUtf8(l);s.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(r[l]))}const e=new Uint8Array(s.reduce((l,a)=>l+a.byteLength,0));let f=0;for(let l of s)e.set(l,f),f+=l.byteLength;return e}formatHeaderValue(r){switch(r.type){case"boolean":return Uint8Array.from([r.value?0:1]);case"byte":return Uint8Array.from([2,r.value]);case"short":const s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,r.value,!1),new Uint8Array(s.buffer);case"integer":const e=new DataView(new ArrayBuffer(5));return e.setUint8(0,4),e.setInt32(1,r.value,!1),new Uint8Array(e.buffer);case"long":const f=new Uint8Array(9);return f[0]=5,f.set(r.value.bytes,1),f;case"binary":const l=new DataView(new ArrayBuffer(3+r.value.byteLength));l.setUint8(0,6),l.setUint16(1,r.value.byteLength,!1);const a=new Uint8Array(l.buffer);return a.set(r.value,3),a;case"string":const h=this.fromUtf8(r.value),m=new DataView(new ArrayBuffer(3+h.byteLength));m.setUint8(0,7),m.setUint16(1,h.byteLength,!1);const g=new Uint8Array(m.buffer);return g.set(h,3),g;case"timestamp":const w=new Uint8Array(9);return w[0]=8,w.set(Mr.fromNumber(r.value.valueOf()).bytes,1),w;case"uuid":if(!DA.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const E=new Uint8Array(17);return E[0]=9,E.set(t.fromHex(r.value.replace(/\-/g,"")),1),E}}parse(r){const s={};let e=0;while(e<r.byteLength){const f=r.getUint8(e++),l=this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+e,f));switch(e+=f,r.getUint8(e++)){case 0:s[l]={type:vm,value:!0};break;case 1:s[l]={type:vm,value:!1};break;case 2:s[l]={type:RA,value:r.getInt8(e++)};break;case 3:s[l]={type:SA,value:r.getInt16(e,!1)},e+=2;break;case 4:s[l]={type:EA,value:r.getInt32(e,!1)},e+=4;break;case 5:s[l]={type:cA,value:new Mr(new Uint8Array(r.buffer,r.byteOffset+e,8))},e+=8;break;case 6:const a=r.getUint16(e,!1);e+=2,s[l]={type:IA,value:new Uint8Array(r.buffer,r.byteOffset+e,a)},e+=a;break;case 7:const h=r.getUint16(e,!1);e+=2,s[l]={type:PA,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+e,h))},e+=h;break;case 8:s[l]={type:kA,value:new Date(new Mr(new Uint8Array(r.buffer,r.byteOffset+e,8)).valueOf())},e+=8;break;case 9:const m=new Uint8Array(r.buffer,r.byteOffset+e,16);e+=16,s[l]={type:NA,value:`${t.toHex(m.subarray(0,4))}-${t.toHex(m.subarray(4,6))}-${t.toHex(m.subarray(6,8))}-${t.toHex(m.subarray(8,10))}-${t.toHex(m.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return s}}var Hm;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(Hm||(Hm={}));var vm="boolean",RA="byte",SA="short",EA="integer",cA="long",IA="binary",PA="string",kA="timestamp",NA="uuid",DA=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function zm({byteLength:r,byteOffset:s,buffer:e}){if(r<$A)throw new Error("Provided message too short to accommodate event stream message overhead");const f=new DataView(e,s,r),l=f.getUint32(0,!1);if(r!==l)throw new Error("Reported message length does not match received message length");const a=f.getUint32(Gm,!1),h=f.getUint32(rr,!1),m=f.getUint32(r-hr,!1),g=new sr().update(new Uint8Array(e,s,rr));if(h!==g.digest())throw new Error(`The prelude checksum specified in the message (${h}) does not match the calculated CRC32 checksum (${g.digest()})`);if(g.update(new Uint8Array(e,s+rr,r-(rr+hr))),m!==g.digest())throw new Error(`The message checksum (${g.digest()}) did not match the expected value of ${m}`);return{headers:new DataView(e,s+rr+hr,a),body:new Uint8Array(e,s+rr+hr+a,l-a-(rr+hr+hr))}}var Gm=4,rr=Gm*2,hr=4,$A=rr+hr*2;class Kf{constructor(r,s){this.headerMarshaller=new Ff(r,s),this.messageBuffer=[],this.isEndOfStream=!1}feed(r){this.messageBuffer.push(this.decode(r))}endOfStream(){this.isEndOfStream=!0}getMessage(){const r=this.messageBuffer.pop(),s=this.isEndOfStream;return{getMessage(){return r},isEndOfStream(){return s}}}getAvailableMessages(){const r=this.messageBuffer;this.messageBuffer=[];const s=this.isEndOfStream;return{getMessages(){return r},isEndOfStream(){return s}}}encode({headers:r,body:s}){const e=this.headerMarshaller.format(r),f=e.byteLength+s.byteLength+16,l=new Uint8Array(f),a=new DataView(l.buffer,l.byteOffset,l.byteLength),h=new sr;return a.setUint32(0,f,!1),a.setUint32(4,e.byteLength,!1),a.setUint32(8,h.update(l.subarray(0,8)).digest(),!1),l.set(e,12),l.set(s,e.byteLength+12),a.setUint32(f-4,h.update(l.subarray(8,f-4)).digest(),!1),l}decode(r){const{headers:s,body:e}=zm(r);return{headers:this.headerMarshaller.parse(s),body:e}}formatHeaders(r){return this.headerMarshaller.format(r)}}class Lf{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.decoder.decode(r)}}class Wf{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream)yield this.options.encoder.encode(r);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class Qf{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream){const s=await this.options.deserializer(r);if(s===void 0)continue;yield s}}}class Xf{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.serializer(r)}}function Fm(r){let s=0,e=0,f=null,l=null;const a=(m)=>{if(typeof m!=="number")throw new Error("Attempted to allocate an event message where size was not a number: "+m);s=m,e=4,f=new Uint8Array(m),new DataView(f.buffer).setUint32(0,m,!1)},h=async function*(){const m=r[Symbol.asyncIterator]();while(!0){const{value:g,done:w}=await m.next();if(w){if(!s)return;else if(s===e)yield f;else throw new Error("Truncated event message received.");return}const E=g.length;let I=0;while(I<E){if(!f){const N=E-I;if(!l)l=new Uint8Array(4);const y=Math.min(4-e,N);if(l.set(g.slice(I,I+y),e),e+=y,I+=y,e<4)break;a(new DataView(l.buffer).getUint32(0,!1)),l=null}const P=Math.min(s-e,E-I);if(f.set(g.slice(I,I+P),e),e+=P,I+=P,s&&s===e)yield f,f=null,s=0,e=0}}};return{[Symbol.asyncIterator]:h}}function Km(r,s){return async function(e){const{value:f}=e.headers[":message-type"];if(f==="error"){const l=new Error(e.headers[":error-message"].value||"UnknownError");throw l.name=e.headers[":error-code"].value,l}else if(f==="exception"){const l=e.headers[":exception-type"].value,a={[l]:e},h=await r(a);if(h.$unknown){const m=new Error(s(e.body));throw m.name=l,m}throw h[l]}else if(f==="event"){const l={[e.headers[":event-type"].value]:e},a=await r(l);if(a.$unknown)return;return a}else throw Error(`Unrecognizable event type: ${e.headers[":event-type"].value}`)}}class us{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new Kf(r,s),this.utfEncoder=r}deserialize(r,s){const e=Fm(r);return new Qf({messageStream:new Lf({inputStream:e,decoder:this.eventStreamCodec}),deserializer:Km(s,this.utfEncoder)})}serialize(r,s){return new Wf({messageStream:new Xf({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as yA} from"stream";async function*Lm(r){let s=!1,e=!1;const f=new Array;r.on("error",(l)=>{if(!s)s=!0;if(l)throw l}),r.on("data",(l)=>{f.push(l)}),r.on("end",()=>{s=!0});while(!e){const l=await new Promise((a)=>setTimeout(()=>a(f.shift()),0));if(l)yield l;e=s&&f.length===0}}class Zf{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new us({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const e=typeof r[Symbol.asyncIterator]==="function"?r:Lm(r);return this.universalMarshaller.deserialize(e,s)}serialize(r,s){return yA.from(this.universalMarshaller.serialize(r,s))}}var Wm=(r)=>new Zf(r);import{Writable as UA} from"stream";class ts extends UA{constructor(r,s){super(s);this.hash=r}_write(r,s,e){try{this.hash.update(Y(r))}catch(f){return e(f)}e()}}var Qm=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const e=new r,f=new ts(e);return s.pipe(f),new Promise((l,a)=>{s.on("error",(h)=>{f.end(),a(h)}),f.on("error",a),f.on("finish",()=>{e.digest().then(l).catch(a)})})};var re=U(Ls(),1);var Ym=U(TA(),1);var Om=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??Zm,base64Encoder:r?.base64Encoder??Vm,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??Ks,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??Jm,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??Ih,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new re.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new re.AwsSdkSigV4ASigner}],logger:r?.logger??new Rs,sdkStreamMixin:r?.sdkStreamMixin??Bm,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??Ke,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??Ym.parseUrl,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??Zr,utf8Encoder:r?.utf8Encoder??Xm}};var lg=(r)=>{im(process.version);const s=eg(r),e=()=>s().then(jm),f=Om(r);return ee.emitWarningIfUnsupportedVersion(process.version),{...f,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??sg,credentialDefaultProvider:r?.credentialDefaultProvider??fg,defaultUserAgentProvider:r?.defaultUserAgentProvider??rg({serviceId:f.serviceId,clientVersion:Um.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??q(He),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??Wm,maxAttempts:r?.maxAttempts??q(um),md5:r?.md5??se.bind(null,"md5"),region:r?.region??q(om,nm),requestChecksumCalculation:r?.requestChecksumCalculation??q(nf),requestHandler:_m.create(r?.requestHandler??e),responseChecksumValidation:r?.responseChecksumValidation??q(pf),retryMode:r?.retryMode??q({...tm,default:async()=>(await e()).retryMode||pm}),sha1:r?.sha1??se.bind(null,"sha1"),sha256:r?.sha256??se.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??q(ee.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??qm,streamHasher:r?.streamHasher??Qm,useArnRegion:r?.useArnRegion??q(Tm),useDualstackEndpoint:r?.useDualstackEndpoint??q(bm),useFipsEndpoint:r?.useFipsEndpoint??q(xm)}};var ag=(r)=>{const s=r.httpAuthSchemes;let{httpAuthSchemeProvider:e,credentials:f}=r;return{setHttpAuthScheme(l){const a=s.findIndex((h)=>h.schemeId===l.schemeId);if(a===-1)s.push(l);else s.splice(a,1,l)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(l){e=l},httpAuthSchemeProvider(){return e},setCredentials(l){f=l},credentials(){return f}}},hg=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var fe=(r)=>r,Sg=(r,s)=>{const e={...fe(Ag(r)),...fe(wg(r)),...fe(mg(r)),...fe(ag(r))};return s.forEach((f)=>f.configure(e)),{...r,...Rg(e),...dg(e),...gg(e),...hg(e)}};class Vf extends kg{constructor(...[r]){const s=lg(r||{}),e=kh(s),f=Ng(e),l=Al(f),a=Tg(l),h=$g(a),m=Eg(h),g=Ug(m),w=wa(g),E=Ph(w),I=fa(E,{session:[()=>this,zf]}),P=Sg(I,r?.extensions||[]);super(P);this.config=P,this.middlewareStack.use(Dg(this.config)),this.middlewareStack.use(Mg(this.config)),this.middlewareStack.use(yg(this.config)),this.middlewareStack.use(cg(this.config)),this.middlewareStack.use(Ig(this.config)),this.middlewareStack.use(Pg(this.config)),this.middlewareStack.use(Cr.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Sh,identityProviderConfigProvider:async(N)=>new Cr.DefaultIdentityProviderConfig({"aws.auth#sigv4":N.credentials,"aws.auth#sigv4a":N.credentials})})),this.middlewareStack.use(Cr.getHttpSigningPlugin(this.config)),this.middlewareStack.use(ga(this.config)),this.middlewareStack.use(jf(this.config)),this.middlewareStack.use(cl(this.config)),this.middlewareStack.use(ve(this.config)),this.middlewareStack.use(ze(this.config))}destroy(){super.destroy()}}function MA(r){return(s)=>async(e)=>{const f={...e.input},l=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let a of l){const h=f[a.target];if(h){let m;if(typeof h==="string")if(HA(h,r))m=r.base64Decoder(h);else m=r.utf8Decoder(h),f[a.target]=r.base64Encoder(m);else m=ArrayBuffer.isView(h)?new Uint8Array(h.buffer,h.byteOffset,h.byteLength):new Uint8Array(h),f[a.target]=r.base64Encoder(m);const g=new r.md5;g.update(m),f[a.hash]=r.base64Encoder(await g.digest())}}return s({...e,input:f})}}function HA(r,s){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(r))return!1;try{return s.base64Decoder(r).length===32}catch{return!1}}var CA={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},le=(r)=>({applyToStack:(s)=>{s.add(MA(r),CA)}});class Jf extends yr.classBuilder().ep({...kr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,e,f){return[Ur(e,this.serialize,this.deserialize),Tr(e,r.getEndpointParameterInstructions()),ds(e,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),le(e),Il(e)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(Uh,yh).ser(Bh).de(_h).build(){}class Bf extends yr.classBuilder().ep({...kr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,e,f){return[Ur(e,this.serialize,this.deserialize),Tr(e,r.getEndpointParameterInstructions()),ds(e,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),Rl(e),Ts(e),le(e)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(Ch,Mh).ser(Yh).de(qh).build(){}import{Buffer as Cg} from"buffer";class Hg extends mr{client;constructor(...r){super();this.client=new Vf(...r)}async put(r){let s,e,f,l=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,f=`${tr()}.${r.type.split("/")[1].split(";")[0]}`,e=r.type;else s=r.body,f=r.name,e=r.contentType;e=s instanceof Blob||s instanceof File?s.type:void 0;const a=s instanceof Cg?s:Cg.from(await s.arrayBuffer());return await this.client.send(new Bf({Bucket:l,Key:f,Body:a,ContentType:e})),f}async fetch(r){let s=process.env.BUCKET_NAME,e;if(typeof r==="string")e=r;else s=r.bucket??s,e=r.name;if(!e)throw new Error("Object name has to be specified");const f=await this.client.send(new Jf({Bucket:s,Key:e}));return new Response(f.Body.transformToWebStream(),{headers:{"Content-Type":f.ContentType,"Content-Length":f.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":f.LastModified?.toUTCString()||"",ETag:f.ETag||""}})}}class ae{}class he extends ae{constructor(){super(...arguments)}requests=new Map;consume(r,s){if(!this.requests.has(r))this.requests.set(r,{date:Date.now(),count:1});else{const e=this.requests.get(r),f=Date.now();if(f-e.date>=60000)this.requests.set(r,{date:f,count:1});else this.requests.set(r,{date:e.date,count:e.count+1})}return this.requests.get(r).count}}class vg extends B{constructor(){super(...arguments)}driver=new he;boot(){}}import*as KA from"react-dom/server";var Lg=U(vA(),1);import{Writable as XA} from"stream";var{defineProperty:GA,getOwnPropertySymbols:Gg}=Object,zA=Object.prototype.hasOwnProperty,FA=Object.prototype.propertyIsEnumerable,zg=(r,s,e)=>(s in r)?GA(r,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[s]=e,Yf=(r,s)=>{for(var e in s||(s={}))if(zA.call(s,e))zg(r,e,s[e]);if(Gg){for(var e of Gg(s))if(FA.call(s,e))zg(r,e,s[e])}return r},Of=(r,s,e)=>{return new Promise((f,l)=>{var a=(g)=>{try{m(e.next(g))}catch(w){l(w)}},h=(g)=>{try{m(e.throw(g))}catch(w){l(w)}},m=(g)=>g.done?f(g.value):Promise.resolve(g.value).then(a,h);m((e=e.apply(r,s)).next())})},LA={unformatted:["code","pre","em","strong","span"],indent_inner_html:!0,indent_char:" ",indent_size:2,sep:"\n"},WA=(r,s={})=>{return Lg.default.html(r,Yf(Yf({},LA),s))},QA=[{selector:"img",format:"skip"},{selector:"#__react-email-preview",format:"skip"},{selector:"a",options:{linkBrackets:!1}}];var Fg=new TextDecoder("utf-8"),Kg=(r)=>Of(void 0,null,function*(){let s="";if("pipeTo"in r){const e=new WritableStream({write(f){s+=Fg.decode(f)}});yield r.pipeTo(e)}else{const e=new XA({write(f,l,a){s+=Fg.decode(f),a()}});return r.pipe(e),new Promise((f,l)=>{e.on("error",l),e.on("close",()=>{f(s)})})}return s}),me=(r,s)=>Of(void 0,null,function*(){const{default:e}=yield import("react-dom/server");let f;if(Object.hasOwn(e,"renderToReadableStream"))f=yield Kg(yield e.renderToReadableStream(r));else yield new Promise((h,m)=>{const g=e.renderToPipeableStream(r,{onAllReady(){return Of(this,null,function*(){f=yield Kg(g),h()})},onError(w){m(w)}})});if(s==null?void 0:s.plainText)return _f(f,Yf({selectors:QA},s.htmlToTextOptions));const a=`${'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'}${f.replace(/<!DOCTYPE.*?>/,"")}`;if(s==null?void 0:s.pretty)return WA(a);return a});var{defineProperty:ZA,defineProperties:VA,getOwnPropertyDescriptors:JA,getOwnPropertySymbols:Wg}=Object,BA=Object.prototype.hasOwnProperty,YA=Object.prototype.propertyIsEnumerable,Qg=(r,s,e)=>(s in r)?ZA(r,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[s]=e,pr=(r,s)=>{for(var e in s||(s={}))if(BA.call(s,e))Qg(r,e,s[e]);if(Wg){for(var e of Wg(s))if(YA.call(s,e))Qg(r,e,s[e])}return r},OA=(r,s)=>VA(r,JA(s)),k=(r,s,e)=>{return new Promise((f,l)=>{var a=(g)=>{try{m(e.next(g))}catch(w){l(w)}},h=(g)=>{try{m(e.throw(g))}catch(w){l(w)}},m=(g)=>g.done?f(g.value):Promise.resolve(g.value).then(a,h);m((e=e.apply(r,s)).next())})},_A="3.5.0",qA=class{constructor(r){this.resend=r}create(r){return k(this,arguments,function*(s,e={}){return yield this.resend.post("/api-keys",s,e)})}list(){return k(this,null,function*(){return yield this.resend.get("/api-keys")})}remove(r){return k(this,null,function*(){return yield this.resend.delete(`/api-keys/${r}`)})}},jA=class{constructor(r){this.resend=r}create(r){return k(this,arguments,function*(s,e={}){return yield this.resend.post("/audiences",s,e)})}list(){return k(this,null,function*(){return yield this.resend.get("/audiences")})}get(r){return k(this,null,function*(){return yield this.resend.get(`/audiences/${r}`)})}remove(r){return k(this,null,function*(){return yield this.resend.delete(`/audiences/${r}`)})}},iA=class{constructor(r){this.resend=r}send(r){return k(this,arguments,function*(s,e={}){return this.create(s,e)})}create(r){return k(this,arguments,function*(s,e={}){for(let l of s)if(l.react)l.html=yield me(l.react),delete l.react;return yield this.resend.post("/emails/batch",s,e)})}},bA=class{constructor(r){this.resend=r}create(r){return k(this,arguments,function*(s,e={}){return yield this.resend.post(`/audiences/${s.audienceId}/contacts`,{unsubscribed:s.unsubscribed,email:s.email,first_name:s.firstName,last_name:s.lastName},e)})}list(r){return k(this,null,function*(){return yield this.resend.get(`/audiences/${r.audienceId}/contacts`)})}get(r){return k(this,null,function*(){return yield this.resend.get(`/audiences/${r.audienceId}/contacts/${r.id}`)})}update(r){return k(this,null,function*(){return yield this.resend.patch(`/audiences/${r.audienceId}/contacts/${r.id}`,{unsubscribed:r.unsubscribed,first_name:r.firstName,last_name:r.lastName})})}remove(r){return k(this,null,function*(){return yield this.resend.delete(`/audiences/${r.audienceId}/contacts/${(r==null?void 0:r.email)?r==null?void 0:r.email:r==null?void 0:r.id}`)})}},xA=class{constructor(r){this.resend=r}create(r){return k(this,arguments,function*(s,e={}){return yield this.resend.post("/domains",s,e)})}list(){return k(this,null,function*(){return yield this.resend.get("/domains")})}get(r){return k(this,null,function*(){return yield this.resend.get(`/domains/${r}`)})}update(r){return k(this,null,function*(){return yield this.resend.patch(`/domains/${r.id}`,{click_tracking:r.clickTracking,open_tracking:r.openTracking,tls:r.tls})})}remove(r){return k(this,null,function*(){return yield this.resend.delete(`/domains/${r}`)})}verify(r){return k(this,null,function*(){return yield this.resend.post(`/domains/${r}/verify`)})}},oA=class{constructor(r){this.resend=r}send(r){return k(this,arguments,function*(s,e={}){return this.create(s,e)})}create(r){return k(this,arguments,function*(s,e={}){if(s.react)s.html=yield me(s.react),delete s.react;return yield this.resend.post("/emails",s,e)})}get(r){return k(this,null,function*(){return yield this.resend.get(`/emails/${r}`)})}},Xg="https://api.resend.com",Zg=`resend-node:${_A}`,nA=typeof process!=="undefined"&&process.env?process.env.RESEND_BASE_URL||Xg:Xg,pA=typeof process!=="undefined"&&process.env?process.env.RESEND_USER_AGENT||Zg:Zg,Vg=class{constructor(r){if(this.key=r,this.apiKeys=new qA(this),this.audiences=new jA(this),this.batch=new iA(this),this.contacts=new bA(this),this.domains=new xA(this),this.emails=new oA(this),!r){if(typeof process!=="undefined"&&process.env)this.key=process.env.RESEND_API_KEY;if(!this.key)throw new Error('Missing API key. Pass it to the constructor `new Resend("re_123")`')}this.headers=new Headers({Authorization:`Bearer ${this.key}`,"User-Agent":pA,"Content-Type":"application/json"})}fetchRequest(r){return k(this,arguments,function*(s,e={}){try{const f=yield fetch(`${nA}${s}`,e);if(!f.ok)try{const a=yield f.text();return{data:null,error:JSON.parse(a)}}catch(a){if(a instanceof SyntaxError)return{data:null,error:{name:"application_error",message:"Internal server error. We are unable to process your request right now, please try again later."}};const h={message:f.statusText,name:"application_error"};if(a instanceof Error)return{data:null,error:OA(pr({},h),{message:a.message})};return{data:null,error:h}}return{data:yield f.json(),error:null}}catch(f){return{data:null,error:{name:"application_error",message:"Unable to fetch data. The request could not be resolved."}}}})}post(r,s){return k(this,arguments,function*(e,f,l={}){const a=pr({method:"POST",headers:this.headers,body:JSON.stringify(f)},l);return this.fetchRequest(e,a)})}get(r){return k(this,arguments,function*(s,e={}){const f=pr({method:"GET",headers:this.headers},e);return this.fetchRequest(s,f)})}put(r,s){return k(this,arguments,function*(e,f,l={}){const a=pr({method:"PUT",headers:this.headers,body:JSON.stringify(f)},l);return this.fetchRequest(e,a)})}patch(r,s){return k(this,arguments,function*(e,f,l={}){const a=pr({method:"PATCH",headers:this.headers,body:JSON.stringify(f)},l);return this.fetchRequest(e,a)})}delete(r,s){return k(this,null,function*(){const e={method:"DELETE",headers:this.headers,body:JSON.stringify(s)};return this.fetchRequest(r,e)})}};class ge{}class we extends ge{r;constructor(r=process.env.RESEND_API_KEY){super();this.apiKey=r}async send(r){const s=new Vg(this.apiKey);console.log(r);const{data:e,error:f}=await s.emails.send({...r});if(f)return console.error(f),!1;if(e)return!0}}class Jg extends B{constructor(){super(...arguments)}driver=new we;boot(){}}class Bg extends B{constructor(){super(...arguments)}channels={};boot(){}}class Yg extends B{constructor(){super(...arguments)}root;rootRouter;boot(){}}class Og extends B{constructor(){super(...arguments)}rootRouter;boot(){return"Origin"}}export{Yg as ViewRouterServiceProvider,Hg as S3Driver,we as ResendDriver,vg as RateLimiterServiceProvider,ae as RateLimiterDriver,he as InMemoryRateLimiter,rs as FileSystemDriver,qf as FileStorageServiceProvider,mr as FileStorageDriver,Jg as EmailServiceProvider,ge as EmailDriver,Bg as BroadcastingServiceProvider,Og as ApiRouterServiceProvider};export{qf as w,Og as x,vg as y,Jg as z,Bg as A,Yg as B};
|
|
12
|
-
|
|
13
|
-
//# debugId=2E6FA4962681BA2364756e2164756e21
|
|
4
|
+
//# debugId=7D7A12A40F1D2FDB64756e2164756e21
|