gemi 0.4.111 → 0.4.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/app/index.js +1 -1
  2. package/dist/{chunk-0wt838y6.js → chunk-0z7rregx.js} +2 -2
  3. package/dist/{chunk-0wt838y6.js.map → chunk-0z7rregx.js.map} +1 -1
  4. package/dist/chunk-3tkcbjr7.js +4 -0
  5. package/dist/{chunk-f0k8kxnp.js.map → chunk-3tkcbjr7.js.map} +5 -5
  6. package/dist/{chunk-r06tvhy1.js → chunk-6mhs44ws.js} +2 -2
  7. package/dist/{chunk-r06tvhy1.js.map → chunk-6mhs44ws.js.map} +1 -1
  8. package/dist/chunk-7dzytwxa.js +4 -0
  9. package/dist/{chunk-y56jme0t.js.map → chunk-7dzytwxa.js.map} +5 -5
  10. package/dist/chunk-7z68xeph.js +4 -0
  11. package/dist/{chunk-emb8fan6.js.map → chunk-7z68xeph.js.map} +2 -2
  12. package/dist/chunk-8r4gf4db.js +4 -0
  13. package/dist/{chunk-dw6fyde0.js.map → chunk-8r4gf4db.js.map} +2 -2
  14. package/dist/chunk-9nrnhtax.js +11 -0
  15. package/dist/{chunk-ck4b2z5a.js.map → chunk-9nrnhtax.js.map} +5 -5
  16. package/dist/{chunk-ss47s88c.js → chunk-a8p9qrrx.js} +2 -2
  17. package/dist/{chunk-ss47s88c.js.map → chunk-a8p9qrrx.js.map} +1 -1
  18. package/dist/chunk-bvznvw9v.js +4 -0
  19. package/dist/{chunk-w7d8nbgw.js.map → chunk-bvznvw9v.js.map} +6 -6
  20. package/dist/chunk-d5sps5cz.js +5 -0
  21. package/dist/chunk-d5sps5cz.js.map +64 -0
  22. package/dist/chunk-g31s71mt.js +4 -0
  23. package/dist/{chunk-nv02r6kq.js.map → chunk-g31s71mt.js.map} +2 -2
  24. package/dist/chunk-gmfpzjq8.js +4 -0
  25. package/dist/{chunk-s5natt4n.js.map → chunk-gmfpzjq8.js.map} +5 -5
  26. package/dist/{chunk-djyzfn1b.js → chunk-h32wyhch.js} +2 -2
  27. package/dist/{chunk-djyzfn1b.js.map → chunk-h32wyhch.js.map} +1 -1
  28. package/dist/chunk-k95a7x24.js +8 -0
  29. package/dist/{chunk-vfq8m4st.js.map → chunk-k95a7x24.js.map} +2 -2
  30. package/dist/chunk-mv6z1e1k.js +20 -0
  31. package/dist/{chunk-vtq6at24.js.map → chunk-mv6z1e1k.js.map} +14 -6
  32. package/dist/{chunk-p9qbw9m8.js → chunk-qsz9qyck.js} +2 -2
  33. package/dist/{chunk-p9qbw9m8.js.map → chunk-qsz9qyck.js.map} +1 -1
  34. package/dist/chunk-vp9qt0ma.js +4 -0
  35. package/dist/chunk-vp9qt0ma.js.map +10 -0
  36. package/dist/http/HttpRequest.d.ts +2 -3
  37. package/dist/http/HttpRequest.d.ts.map +1 -1
  38. package/dist/http/index.js +2 -2
  39. package/dist/http/index.js.map +3 -3
  40. package/dist/kernel/index.js +1 -1
  41. package/dist/services/index.js +5 -5
  42. package/dist/services/index.js.map +5 -5
  43. package/package.json +1 -1
  44. package/dist/chunk-3aebg4t6.js +0 -5
  45. package/dist/chunk-3aebg4t6.js.map +0 -73
  46. package/dist/chunk-5pasfeez.js +0 -3
  47. package/dist/chunk-5pasfeez.js.map +0 -15
  48. package/dist/chunk-ck4b2z5a.js +0 -11
  49. package/dist/chunk-dw6fyde0.js +0 -4
  50. package/dist/chunk-emb8fan6.js +0 -4
  51. package/dist/chunk-f0k8kxnp.js +0 -4
  52. package/dist/chunk-nv02r6kq.js +0 -4
  53. package/dist/chunk-s5natt4n.js +0 -4
  54. package/dist/chunk-vfq8m4st.js +0 -8
  55. package/dist/chunk-vtq6at24.js +0 -20
  56. package/dist/chunk-w7d8nbgw.js +0 -4
  57. package/dist/chunk-y56jme0t.js +0 -4
  58. /package/dist/{chunk-sd6qmtfs.js → chunk-25y8fca8.js} +0 -0
  59. /package/dist/{chunk-sd6qmtfs.js.map → chunk-25y8fca8.js.map} +0 -0
@@ -1,13 +1,13 @@
1
1
  // @bun
2
- import"../chunk-nv02r6kq.js";import{H as B}from"../chunk-ktwy9nyn.js";import{I as j}from"../chunk-td079vg9.js";import{O as Jf,P as PA}from"../chunk-t3g9fdba.js";import{U as Bg}from"../chunk-wfc30gdx.js";import{$ as mg,Aa as ts,Ba as jm,Ca as im,Da as sg,Ea as eg,V as tr,W as Br,X as p,Y as lg,Z as ag,_ as hg,aa as fr,ba as lr,ca as Me,da as wg,ea as ta,fa as rh,ga as sh,ha as eh,ia as dg,ja as Zm,ka as Vm,la as Jm,ma as Bm,na as Ag,oa as Rg,pa as fh,qa as Tr,ra as Mr,sa as Sg,ta as Ym,ua as Om,va as Eg,wa as _m,xa as cg,ya as Fs,za as qm}from"../chunk-vtq6at24.js";import{Ab as b,Bb as vh,Cb as Qm,Db as Xm,Eb as tm,Fa as pm,Fb as rg,Ga as um,Ha as L,Hb as G,Ia as Rs,Ja as fs,Jb as Gh,Ma as Vr,Na as Y,Oa as Cm,Pa as As,Ra as gg,Sa as Hm,Ta as vm,Ua as Gm,Va as cr,Wa as Lm,Xa as Wm,eb as Ps,fb as H,gb as zm,hb as ol,ib as nl,jb as Mh,kb as Ur,lb as Z,nb as ir,qb as Dr,rb as Ch,sb as $r,tb as Hh,ub as Os,vb as _r,xb as cf,yb as Qr,zb as dh}from"../chunk-3aebg4t6.js";import{Lb as lw}from"../chunk-r06tvhy1.js";import{Mb as q,Nb as Fm}from"../chunk-y56jme0t.js";import"../chunk-5pasfeez.js";import{Ub as bm}from"../chunk-ck4b2z5a.js";import"../chunk-ss47s88c.js";class gr{}class rs extends gr{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 Bf extends B{driver=new rs;boot(){}}function Wg(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 Qg={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},Yf=(r)=>({applyToStack:(s)=>{s.add(Wg(r),Qg)}});var Gr={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},ss=Gr.WHEN_SUPPORTED,we={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},es=Gr.WHEN_SUPPORTED,U;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(U||(U={}));var Of;(function(r){r.HEADER="header",r.TRAILER="trailer"})(Of||(Of={}));var{MD5:_f,CRC32:qf}=U;var n;(function(r){r.ENV="env",r.CONFIG="shared config entry"})(n||(n={}));var wr=(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 Xg="AWS_REQUEST_CHECKSUM_CALCULATION",Zg="request_checksum_calculation",jf={environmentVariableSelector:(r)=>wr(r,Xg,Gr,n.ENV),configFileSelector:(r)=>wr(r,Zg,Gr,n.CONFIG),default:ss};var Vg="AWS_RESPONSE_CHECKSUM_VALIDATION",Jg="response_checksum_validation",bf={environmentVariableSelector:(r)=>wr(r,Vg,we,n.ENV),configFileSelector:(r)=>wr(r,Jg,we,n.CONFIG),default:es};var zr=[U.CRC32,U.CRC32C,U.SHA1,U.SHA256],xf=[U.CRC32,U.CRC32C,U.SHA1,U.SHA256];var of=(r,{requestChecksumRequired:s,requestAlgorithmMember:e},f)=>{const l=f?qf:_f;if(!e||!r[e])return s?l:void 0;const a=r[e];if(!zr.includes(a))throw new Error(`The checksum algorithm "${a}" is not supported by the client. Select one of ${zr}.`);return a};var dr=(r)=>r===U.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var nf=(r,s)=>{const e=r.toLowerCase();for(let f of Object.keys(s))if(e===f.toLowerCase())return!0;return!1};var Ar=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!fs(r);var pf=j(Bg(),1),{__extends:ER,__assign:cR,__rest:IR,__decorate:PR,__param:kR,__esDecorate:NR,__runInitializers:DR,__propKey:$R,__setFunctionName:yR,__metadata:UR,__awaiter:ls,__generator:as,__exportStar:TR,__createBinding:MR,__values:hs,__read:CR,__spread:HR,__spreadArrays:vR,__spreadArray:GR,__await:zR,__asyncGenerator:FR,__asyncDelegator:KR,__asyncValues:LR,__makeTemplateObject:WR,__importStar:QR,__importDefault:XR,__classPrivateFieldGet:ZR,__classPrivateFieldSet:VR,__classPrivateFieldIn:JR,__addDisposableResource:BR,__disposeResources:YR}=pf.default;import{Buffer as uf}from"buffer";var tf=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?uf.from(r,s):uf.from(r)};var de=(r)=>{const s=tf(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function Fr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return Yg(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var Yg=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:de;function Kr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function Lr(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}function Wr(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 Ae=function(){function r(){this.crc32=new er}return r.prototype.update=function(s){if(Kr(s))return;this.crc32.update(Fr(s))},r.prototype.digest=function(){return ls(this,void 0,void 0,function(){return as(this,function(s){return[2,Lr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new er},r}();var er=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^_g[(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 Og=[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],_g=Wr(Og);var Se=function(){function r(){this.crc32c=new Re}return r.prototype.update=function(s){if(Kr(s))return;this.crc32c.update(Fr(s))},r.prototype.digest=function(){return ls(this,void 0,void 0,function(){return as(this,function(s){return[2,Lr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new Re},r}();var Re=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^jg[(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 qg=[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],jg=Wr(qg);var ms=(r,s)=>({[U.MD5]:s.md5,[U.CRC32]:Ae,[U.CRC32C]:Se,[U.SHA1]:s.sha1,[U.SHA256]:s.sha256})[r];var gs=(r,s)=>{const e=new r;return e.update(Y(s||"")),e.digest()};var rl={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},sl=(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=of(E,{requestChecksumRequired:I,requestAlgorithmMember:P},!!f.isS3ExpressBucket);let y=h,V=m;if(N){const x=dr(N),vr=ms(N,r);if(Ar(h)){const{getAwsChunkedEncodingStream:ge,bodyLengthChecker:Lg}=r;y=ge(h,{base64Encoder:g,bodyLengthChecker:Lg,checksumLocationName:x,checksumAlgorithmFn:vr,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":x},delete V["content-length"]}else if(!nf(x,m)){const ge=await gs(vr,h);V={...m,[x]:g(ge)}}}return await e({...l,request:{...a,headers:V,body:y}})};var ws=(r=[])=>{const s=[];for(let e of xf){if(!r.includes(e)||!zr.includes(e))continue;s.push(e)}return s};var el=(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 ig}from"stream";function Ee(r){const s=new ig;return s.push(r),s.push(null),s}var fl=async(r,{streamHasher:s,checksumAlgorithmFn:e,base64Encoder:f})=>{const l=Ar(r)?s(e,r):gs(e,r);return f(await l)};var ll=async(r,{config:s,responseAlgorithms:e})=>{const f=ws(e),{body:l,headers:a}=r;for(let h of f){const m=dr(h),g=a[m];if(g){const w=ms(h,s),{streamHasher:E,base64Encoder:I}=s,P=await fl(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 al={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},hl=(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=dr(V),x=m.headers[ur];return!x||el(x)}))return h;const y=Ar(m.body);if(y)g=await r.streamCollector(m.body),m.body=Ee(g);if(await ll(h.response,{config:r,responseAlgorithms:E}),y&&g)m.body=Ee(g)}return h};var ds=(r,s)=>({applyToStack:(e)=>{e.add(sl(r,s),rl),e.addRelativeTo(hl(r,s),al)}});var ml=(r)=>({...r,requestChecksumCalculation:p(r.requestChecksumCalculation??ss),responseChecksumValidation:p(r.responseChecksumValidation??es)});function xg(){return(r,s)=>async(e)=>{const{request:f}=e;if(L.isInstance(f)){if(!(bg in f.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof As))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 bg="content-length",og={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},gl=(r)=>({applyToStack:(s)=>{s.add(xg(),og)}});var wl=(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}}},dl={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function ng(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 pg={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},Al=(r)=>({applyToStack:(s)=>{s.add(ng(r),pg),s.addRelativeTo(wl(r),dl)}});var ug=(r)=>{return(s,e)=>async(f)=>{const l=await s(f),{response:a}=l;if(Rs.isInstance(a)){if(a.headers.expires){a.headers.expiresstring=a.headers.expires;try{Qr(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}},tg={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},Rl=(r)=>({applyToStack:(s)=>{s.addRelativeTo(ug(r),tg)}});class Rr{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+Rr.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]}}}}}Rr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class Sr{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 Er{constructor(r,s=new Rr){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 Sr(this.getIdentity(e))).identity;if((a.expiration?.getTime()??0)<Date.now()+Er.REFRESH_WINDOW_MS&&!l.isRefreshing)l.isRefreshing=!0,this.getIdentity(e).then((g)=>{f.set(e,new Sr(Promise.resolve(g)))});return a});return f.set(e,new Sr(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}}}Er.REFRESH_WINDOW_MS=60000;var Sl="X-Amz-Algorithm",El="X-Amz-Credential",cl="X-Amz-Date",Il="X-Amz-SignedHeaders",Pl="X-Amz-Expires",kl="X-Amz-Signature",Nl="X-Amz-Security-Token";var Dl="authorization",ce="X-Amz-Date".toLowerCase();var $l=["authorization",ce,"date"],yl="X-Amz-Signature".toLowerCase(),Xr="x-amz-content-sha256",Ul="X-Amz-Security-Token".toLowerCase();var Tl={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},Ml=/^proxy-/,Cl=/^sec-/;var Ss="AWS4-HMAC-SHA256";var Hl="AWS4-HMAC-SHA256-PAYLOAD",vl="UNSIGNED-PAYLOAD",Gl=50,Ie="aws4_request",zl=604800;var Es={},Pe=[],cs=(r,s,e)=>`${r}/${s}/${e}/${Ie}`,Kl=async(r,s,e,f,l)=>{const a=await Fl(r,s.secretAccessKey,s.accessKeyId),h=`${e}:${f}:${l}:${H(a)}:${s.sessionToken}`;if(h in Es)return Es[h];Pe.push(h);while(Pe.length>Gl)delete Es[Pe.shift()];let m=`AWS4${s.secretAccessKey}`;for(let g of[e,f,l,Ie])m=await Fl(r,m,g);return Es[h]=m};var Fl=(r,s,e)=>{const f=new r(s);return f.update(Y(e)),f.digest()};var Is=({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 Tl||s?.has(a)||Ml.test(a)||Cl.test(a)){if(!e||e&&!e.has(a))continue}f[a]=r[l].trim().replace(/\s+/g," ")}return f};var ke=({query:r={}})=>{const s=[],e={};for(let f of Object.keys(r)){if(f.toLowerCase()===yl)continue;const l=cr(f);s.push(l);const a=r[f];if(typeof a==="string")e[l]=`${l}=${cr(a)}`;else if(Array.isArray(a))e[l]=a.slice(0).reduce((h,m)=>h.concat([`${l}=${cr(m)}`]),[]).sort().join("&")}return s.sort().map((f)=>e[f]).filter((f)=>f).join("&")};var Zr=async({headers:r,body:s},e)=>{for(let f of Object.keys(r))if(f.toLowerCase()===Xr)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)),H(await f.digest())}return vl};function Wl(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 Ne{format(r){const s=[];for(let l of Object.keys(r)){const a=Vr(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=Vr(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(De.fromNumber(r.value.valueOf()).bytes,1),w;case"uuid":if(!rw.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const E=new Uint8Array(17);return E[0]=9,E.set(Ps(r.value.replace(/\-/g,"")),1),E}}}var Ll;(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"})(Ll||(Ll={}));var rw=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class De{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)Wl(s);return new De(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)Wl(r);return parseInt(H(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}var Ql=(r,s)=>{r=r.toLowerCase();for(let e of Object.keys(s))if(r===e.toLowerCase())return!0;return!1};var $e=(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 ks=(r)=>{r=L.clone(r);for(let s of Object.keys(r.headers))if($l.indexOf(s.toLowerCase())>-1)delete r.headers[s];return r};var Xl=(r)=>sw(r).toISOString().replace(/\.\d{3}Z$/,"Z"),sw=(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 ye{constructor({applyChecksum:r,credentials:s,region:e,service:f,sha256:l,uriEscapePath:a=!0}){this.headerFormatter=new Ne,this.service=f,this.sha256=l,this.uriEscapePath=a,this.applyChecksum=typeof r==="boolean"?r:!0,this.regionProvider=p(e),this.credentialProvider=p(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}=Ns(e);if(f>zl)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const N=cs(P,E,g??this.service),y=$e(ks(r),{unhoistableHeaders:a});if(w.sessionToken)y.query[Nl]=w.sessionToken;y.query[Sl]=Ss,y.query[El]=`${w.accessKeyId}/${N}`,y.query[cl]=I,y.query[Pl]=f.toString(10);const V=Is(y,l,h);return y.query[Il]=Zl(V),y.query[kl]=await this.getSignature(I,N,this.getSigningKey(w,E,P,g),this.createCanonicalRequest(y,V,await Zr(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}=Ns(e),w=cs(m,h,a??this.service),E=await Zr({headers:{},body:s},this.sha256),I=new this.sha256;I.update(r);const P=H(await I.digest()),N=[Hl,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}=Ns(s),m=new this.sha256(await this.getSigningKey(l,a,h,f));return m.update(Y(r)),H(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=ks(r),{longDate:w,shortDate:E}=Ns(s),I=cs(E,m,a??this.service);if(g.headers[ce]=w,h.sessionToken)g.headers[Ul]=h.sessionToken;const P=await Zr(g,this.sha256);if(!Ql(Xr,g.headers)&&this.applyChecksum)g.headers[Xr]=P;const N=Is(g,f,e),y=await this.getSignature(w,I,this.getSigningKey(h,m,E,a),this.createCanonicalRequest(g,N,P));return g.headers[Dl]=`${Ss} Credential=${h.accessKeyId}/${I}, SignedHeaders=${Zl(N)}, Signature=${y}`,g}createCanonicalRequest(r,s,e){const f=Object.keys(s).sort();return`${r.method}
2
+ import"../chunk-g31s71mt.js";import{H as B}from"../chunk-ktwy9nyn.js";import{I as G}from"../chunk-td079vg9.js";import{O as Yf,P as TA}from"../chunk-t3g9fdba.js";import{U as bg}from"../chunk-wfc30gdx.js";import{$ as Eg,Aa as se,Ba as um,Ca as tm,Da as gg,Ea as wg,V as rs,W as Yr,X as n,Y as Ag,Z as Rg,_ as Sg,aa as fr,ba as lr,ca as He,da as Ig,ea as ah,fa as hh,ga as mh,ha as gh,ia as Pg,ja as qm,ka as jm,la as im,ma as bm,na as kg,oa as Ng,pa as wh,qa as Tr,ra as Mr,sa as Dg,ta as xm,ua as om,va as $g,wa as nm,xa as yg,ya as Ls,za as pm}from"../chunk-mv6z1e1k.js";import{$a as Fh,Fa as lg,Ga as ag,Ha as L,Ia as Ss,Ja as ls,Ma as Vr,Na as Y,Oa as Lm,Pa as Rs,Qa as cg,Ra as Wm,Sa as Qm,Ta as Xm,Ua as Xl,Va as Bm,Wa as Ym,Xa as cr,Ya as Zm,Za as sa,_a as ea,ab as Ur,bb as Z,db as br,gb as Dr,hb as Kh,ib as $r,jb as Lh,kb as qs,lb as qr,nb as Pf,ob as Qr,pb as Ih,qb as i,rb as Wh,sb as Om,tb as _m,ub as hg,vb as mg,xb as v,zb as Qh}from"../chunk-d5sps5cz.js";import{Bb as Aw}from"../chunk-6mhs44ws.js";import{Cb as q,Db as Vm}from"../chunk-7dzytwxa.js";import"../chunk-vp9qt0ma.js";import{Fb as rg}from"../chunk-9nrnhtax.js";import"../chunk-a8p9qrrx.js";class gr{}class ss extends gr{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=`${rs()}.${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 Of extends B{driver=new ss;boot(){}}function Yg(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 Og={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},_f=(r)=>({applyToStack:(s)=>{s.add(Yg(r),Og)}});var Gr={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},es=Gr.WHEN_SUPPORTED,Ae={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},fs=Gr.WHEN_SUPPORTED,U;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(U||(U={}));var qf;(function(r){r.HEADER="header",r.TRAILER="trailer"})(qf||(qf={}));var{MD5:jf,CRC32:bf}=U;var o;(function(r){r.ENV="env",r.CONFIG="shared config entry"})(o||(o={}));var wr=(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 _g="AWS_REQUEST_CHECKSUM_CALCULATION",qg="request_checksum_calculation",xf={environmentVariableSelector:(r)=>wr(r,_g,Gr,o.ENV),configFileSelector:(r)=>wr(r,qg,Gr,o.CONFIG),default:es};var jg="AWS_RESPONSE_CHECKSUM_VALIDATION",ig="response_checksum_validation",of={environmentVariableSelector:(r)=>wr(r,jg,Ae,o.ENV),configFileSelector:(r)=>wr(r,ig,Ae,o.CONFIG),default:fs};var zr=[U.CRC32,U.CRC32C,U.SHA1,U.SHA256],nf=[U.CRC32,U.CRC32C,U.SHA1,U.SHA256];var pf=(r,{requestChecksumRequired:s,requestAlgorithmMember:e},f)=>{const l=f?bf:jf;if(!e||!r[e])return s?l:void 0;const a=r[e];if(!zr.includes(a))throw new Error(`The checksum algorithm "${a}" is not supported by the client. Select one of ${zr}.`);return a};var dr=(r)=>r===U.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var uf=(r,s)=>{const e=r.toLowerCase();for(let f of Object.keys(s))if(e===f.toLowerCase())return!0;return!1};var Ar=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!ls(r);var tf=G(bg(),1),{__extends:$R,__assign:yR,__rest:UR,__decorate:TR,__param:MR,__esDecorate:CR,__runInitializers:HR,__propKey:vR,__setFunctionName:GR,__metadata:zR,__awaiter:as,__generator:hs,__exportStar:FR,__createBinding:KR,__values:ms,__read:LR,__spread:WR,__spreadArrays:QR,__spreadArray:XR,__await:ZR,__asyncGenerator:VR,__asyncDelegator:JR,__asyncValues:BR,__makeTemplateObject:YR,__importStar:OR,__importDefault:_R,__classPrivateFieldGet:qR,__classPrivateFieldSet:jR,__classPrivateFieldIn:iR,__addDisposableResource:bR,__disposeResources:xR}=tf.default;import{Buffer as rl}from"buffer";var sl=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?rl.from(r,s):rl.from(r)};var Re=(r)=>{const s=sl(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function Fr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return xg(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var xg=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:Re;function Kr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function Lr(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}function Wr(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 er}return r.prototype.update=function(s){if(Kr(s))return;this.crc32.update(Fr(s))},r.prototype.digest=function(){return as(this,void 0,void 0,function(){return hs(this,function(s){return[2,Lr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new er},r}();var er=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var e,f;try{for(var l=ms(s),a=l.next();!a.done;a=l.next()){var h=a.value;this.checksum=this.checksum>>>8^ng[(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 og=[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],ng=Wr(og);var ce=function(){function r(){this.crc32c=new Ee}return r.prototype.update=function(s){if(Kr(s))return;this.crc32c.update(Fr(s))},r.prototype.digest=function(){return as(this,void 0,void 0,function(){return hs(this,function(s){return[2,Lr(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=ms(s),a=l.next();!a.done;a=l.next()){var h=a.value;this.checksum=this.checksum>>>8^ug[(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 pg=[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],ug=Wr(pg);var gs=(r,s)=>({[U.MD5]:s.md5,[U.CRC32]:Se,[U.CRC32C]:ce,[U.SHA1]:s.sha1,[U.SHA256]:s.sha256})[r];var ws=(r,s)=>{const e=new r;return e.update(Y(s||"")),e.digest()};var el={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},fl=(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=pf(E,{requestChecksumRequired:I,requestAlgorithmMember:P},!!f.isS3ExpressBucket);let y=h,V=m;if(N){const b=dr(N),vr=gs(N,r);if(Ar(h)){const{getAwsChunkedEncodingStream:de,bodyLengthChecker:Bg}=r;y=de(h,{base64Encoder:g,bodyLengthChecker:Bg,checksumLocationName:b,checksumAlgorithmFn:vr,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(!uf(b,m)){const de=await ws(vr,h);V={...m,[b]:g(de)}}}return await e({...l,request:{...a,headers:V,body:y}})};var ds=(r=[])=>{const s=[];for(let e of nf){if(!r.includes(e)||!zr.includes(e))continue;s.push(e)}return s};var ll=(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 tg}from"stream";function Ie(r){const s=new tg;return s.push(r),s.push(null),s}var al=async(r,{streamHasher:s,checksumAlgorithmFn:e,base64Encoder:f})=>{const l=Ar(r)?s(e,r):ws(e,r);return f(await l)};var hl=async(r,{config:s,responseAlgorithms:e})=>{const f=ds(e),{body:l,headers:a}=r;for(let h of f){const m=dr(h),g=a[m];if(g){const w=gs(h,s),{streamHasher:E,base64Encoder:I}=s,P=await al(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 ml={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},gl=(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"&&ds(E).every((V)=>{const tr=dr(V),b=m.headers[tr];return!b||ll(b)}))return h;const y=Ar(m.body);if(y)g=await r.streamCollector(m.body),m.body=Ie(g);if(await hl(h.response,{config:r,responseAlgorithms:E}),y&&g)m.body=Ie(g)}return h};var As=(r,s)=>({applyToStack:(e)=>{e.add(fl(r,s),el),e.addRelativeTo(gl(r,s),ml)}});var wl=(r)=>({...r,requestChecksumCalculation:n(r.requestChecksumCalculation??es),responseChecksumValidation:n(r.responseChecksumValidation??fs)});function sw(){return(r,s)=>async(e)=>{const{request:f}=e;if(L.isInstance(f)){if(!(rw 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 rw="content-length",ew={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},dl=(r)=>({applyToStack:(s)=>{s.add(sw(),ew)}});var Al=(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}}},Rl={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function fw(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 lw={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},Sl=(r)=>({applyToStack:(s)=>{s.add(fw(r),lw),s.addRelativeTo(Al(r),Rl)}});var aw=(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{Qr(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}},hw={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},El=(r)=>({applyToStack:(s)=>{s.addRelativeTo(aw(r),hw)}});class Rr{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+Rr.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]}}}}}Rr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class Sr{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 Er{constructor(r,s=new Rr){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 Sr(this.getIdentity(e))).identity;if((a.expiration?.getTime()??0)<Date.now()+Er.REFRESH_WINDOW_MS&&!l.isRefreshing)l.isRefreshing=!0,this.getIdentity(e).then((g)=>{f.set(e,new Sr(Promise.resolve(g)))});return a});return f.set(e,new Sr(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}}}Er.REFRESH_WINDOW_MS=60000;var Jr=G(cr(),1);var _l=G(Xl(),1);var cl="X-Amz-Algorithm",Il="X-Amz-Credential",Pl="X-Amz-Date",kl="X-Amz-SignedHeaders",Nl="X-Amz-Expires",Dl="X-Amz-Signature",$l="X-Amz-Security-Token";var yl="authorization",Pe="X-Amz-Date".toLowerCase();var Ul=["authorization",Pe,"date"],Tl="X-Amz-Signature".toLowerCase(),Xr="x-amz-content-sha256",Ml="X-Amz-Security-Token".toLowerCase();var Cl={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},Hl=/^proxy-/,vl=/^sec-/;var Es="AWS4-HMAC-SHA256";var Gl="AWS4-HMAC-SHA256-PAYLOAD",zl="UNSIGNED-PAYLOAD",Fl=50,ke="aws4_request",Kl=604800;var Wl=G(cr(),1);var cs={},Ne=[],Is=(r,s,e)=>`${r}/${s}/${e}/${ke}`,Ql=async(r,s,e,f,l)=>{const a=await Ll(r,s.secretAccessKey,s.accessKeyId),h=`${e}:${f}:${l}:${Wl.toHex(a)}:${s.sessionToken}`;if(h in cs)return cs[h];Ne.push(h);while(Ne.length>Fl)delete cs[Ne.shift()];let m=`AWS4${s.secretAccessKey}`;for(let g of[e,f,l,ke])m=await Ll(r,m,g);return cs[h]=m};var Ll=(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 Cl||s?.has(a)||Hl.test(a)||vl.test(a)){if(!e||e&&!e.has(a))continue}f[a]=r[l].trim().replace(/\s+/g," ")}return f};var ks=G(Xl(),1);var De=({query:r={}})=>{const s=[],e={};for(let f of Object.keys(r)){if(f.toLowerCase()===Tl)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 Zl=G(cr(),1);var Zr=async({headers:r,body:s},e)=>{for(let f of Object.keys(r))if(f.toLowerCase()===Xr)return r[f];if(s==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof s==="string"||ArrayBuffer.isView(s)||ls(s)){const f=new e;return f.update(Y(s)),Zl.toHex(await f.digest())}return zl};var Ns=G(cr(),1);function Jl(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 $e{format(r){const s=[];for(let l of Object.keys(r)){const a=Vr(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=Vr(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(ye.fromNumber(r.value.valueOf()).bytes,1),w;case"uuid":if(!mw.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 Vl;(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"})(Vl||(Vl={}));var mw=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class ye{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)Jl(s);return new ye(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)Jl(r);return parseInt(Ns.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}var Bl=(r,s)=>{r=r.toLowerCase();for(let e of Object.keys(s))if(r===e.toLowerCase())return!0;return!1};var Ue=(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(Ul.indexOf(s.toLowerCase())>-1)delete r.headers[s];return r};var Yl=(r)=>gw(r).toISOString().replace(/\.\d{3}Z$/,"Z"),gw=(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 Te{constructor({applyChecksum:r,credentials:s,region:e,service:f,sha256:l,uriEscapePath:a=!0}){this.headerFormatter=new $e,this.service=f,this.sha256=l,this.uriEscapePath=a,this.applyChecksum=typeof r==="boolean"?r:!0,this.regionProvider=n(e),this.credentialProvider=n(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>Kl)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=Ue(Ds(r),{unhoistableHeaders:a});if(w.sessionToken)y.query[$l]=w.sessionToken;y.query[cl]=Es,y.query[Il]=`${w.accessKeyId}/${N}`,y.query[Pl]=I,y.query[Nl]=f.toString(10);const V=Ps(y,l,h);return y.query[kl]=Ol(V),y.query[Dl]=await this.getSignature(I,N,this.getSigningKey(w,E,P,g),this.createCanonicalRequest(y,V,await Zr(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 Zr({headers:{},body:s},this.sha256),I=new this.sha256;I.update(r);const P=Jr.toHex(await I.digest()),N=[Gl,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)),Jr.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[Pe]=w,h.sessionToken)g.headers[Ml]=h.sessionToken;const P=await Zr(g,this.sha256);if(!Bl(Xr,g.headers)&&this.applyChecksum)g.headers[Xr]=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[yl]=`${Es} Credential=${h.accessKeyId}/${I}, SignedHeaders=${Ol(N)}, Signature=${y}`,g}createCanonicalRequest(r,s,e){const f=Object.keys(s).sort();return`${r.method}
3
3
  ${this.getCanonicalPath(r)}
4
- ${ke(r)}
4
+ ${De(r)}
5
5
  ${f.map((l)=>`${l}:${s[l]}`).join("\n")}
6
6
 
7
7
  ${f.join(";")}
8
- ${e}`}async createStringToSign(r,s,e){const f=new this.sha256;f.update(Y(e));const l=await f.digest();return`${Ss}
8
+ ${e}`}async createStringToSign(r,s,e){const f=new this.sha256;f.update(Y(e));const l=await f.digest();return`${Es}
9
9
  ${r}
10
10
  ${s}
11
- ${H(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 cr(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)),H(await a.digest())}getSigningKey(r,s,e,f){return Kl(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 Ns=(r)=>{const s=Xl(r).replace(/[\-:]/g,"");return{longDate:s,shortDate:s.slice(0,8)}},Zl=(r)=>Object.keys(r).sort().join(";");var Vl="Directory",Jl="S3Express",Bl="sigv4-s3express",Ds="X-Amz-S3session-Token",Jr=Ds.toLowerCase(),ew="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",fw="s3_disable_express_session_auth",Ue={environmentVariableSelector:(r)=>fr(r,ew,lr.ENV),configFileSelector:(r)=>fr(r,fw,lr.CONFIG),default:!1};function Yl(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}}function Ol(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 $s extends ye{async signWithCredentials(r,s,e){const f=Yl(s);r.headers[Jr]=s.sessionToken;const l=this;return Ol(l,f),l.signRequest(r,e??{})}async presignWithCredentials(r,s,e){const f=Yl(s);return delete r.headers[Jr],r.headers[Ds]=s.sessionToken,r.query=r.query??{},r.query[Ds]=s.sessionToken,Ol(this,f),this.presign(r,e)}}var _l=(r)=>{return(s,e)=>async(f)=>{if(e.endpointV2){const l=e.endpointV2,a=l.properties?.authSchemes?.[0]?.name===Bl;if(l.properties?.backend===Jl||l.properties?.bucketType===Vl)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)}},ql={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},Te=(r)=>({applyToStack:(s)=>{s.add(_l(r),ql)}});var il=j(Me(),1);var aw=j(lw(),1);var jl=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 hw=(r)=>(s)=>{throw s},mw=(r,s)=>{};var bl=(r)=>(s,e)=>async(f)=>{if(!L.isInstance(f.request))return s(f);const a=Br(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 jl(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||hw)(h));return(g.successHandler||mw)(E.response,h),E},Ce=(r)=>({applyToStack:(s)=>{s.addRelativeTo(bl(r),il.httpSigningMiddlewareOptions)}});var xl=(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 Er(async(l)=>e().send(new f({Bucket:l,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var gw={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},ww=3000,dw=(r)=>(s,e)=>async(f)=>{const l=await s(f),{response:a}=l;if(!Rs.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 ol(m);a.body=E;const I=await Aw(w,{streamCollector:async(N)=>{return nl(N,ww)}});if(typeof w?.destroy==="function")w.destroy();const P=r.utf8Encoder(I.subarray(I.length-16));if(I.length===0&&gw[e.commandName]){const N=new Error("S3 aborted request");throw N.name="InternalError",N}if(P&&P.endsWith("</Error>"))a.statusCode=400;return l},Aw=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},Rw={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},ys=(r)=>({applyToStack:(s)=>{s.addRelativeTo(dw(r),Rw)}});var He=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function pl(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 ul={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Sw({bucketEndpoint:r}){return(s)=>async(e)=>{const{input:{Bucket:f}}=e;if(!r&&typeof f==="string"&&!He(f)&&f.indexOf("/")>=0){const l=new Error(`Bucket name shouldn't contain '/', received '${f}'`);throw l.name="InvalidBucketName",l}return s({...e})}}var Ew={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},tl=(r)=>({applyToStack:(s)=>{s.add(Sw(r),Ew),s.addRelativeTo(pl(r),ul)}});var Hr=j(Me(),1);var ra=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var Ks=j(Fs(),1);var Us={CrtSignerV4:null};class ve{constructor(r){this.sigv4Signer=new $s(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=Us.CrtSignerV4,typeof r!=="function")throw new Error}catch(s){throw s.message=`${s.message}\nPlease 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 Ir={["required"]:!1,["type"]:"String"},Pr={["required"]:!0,default:!1,["type"]:"Boolean"},Yr={["required"]:!1,["type"]:"Boolean"},_={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},$={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},D={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},M={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},ja={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},sa={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},vs={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},Q={["ref"]:"Bucket"},W={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},Hs={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},ia={["ref"]:"url"},ba={["fn"]:"uriEncode",["argv"]:[Q],["assign"]:"uri_encoded_bucket"},o={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},d={},xa={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Q,!1]},Ge={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},Gs={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},ea={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},fa={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},A={["fn"]:"not",["argv"]:[M]},la={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},aa={["fn"]:"not",["argv"]:[vs]},ha={["ref"]:"hardwareType"},ma={["conditions"]:[A],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},Ts={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},ze={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},cw={["ref"]:"ForcePathStyle"},T={["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]},ga={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},C={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},K={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},S={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},wa={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},R={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},da={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Aa={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Fe={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[ia,"isIp"]},!1]},Ke={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:C,["headers"]:{}},ue={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:C,["headers"]:{}},Ra={["endpoint"]:ue,["type"]:"endpoint"},Le={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Sa={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Ms={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},J={["ref"]:"bucketArn"},oa={["ref"]:"arnType"},We={["fn"]:"getAttr",["argv"]:[J,"service"]},te={["ref"]:"accessPointName"},Ea={["conditions"]:[D],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},ca={["conditions"]:[_],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},Ia={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},Qe={["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"},na={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},pa={["fn"]:"getAttr",["argv"]:[J,"accountId"]},Xe={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},Pa={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},Ze={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},Ve={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},Je={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},ka={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},Na={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Or={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},Da={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},$a={["fn"]:"aws.parseArn",["argv"]:[Q]},ya={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},Ua={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},Ta={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},Be={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},Ma={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},Ca={["ref"]:"UseObjectLambdaEndpoint"},Ye={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},Ha={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},va={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Ga={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Oe={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:C,["headers"]:{}},za={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},_e=[{["ref"]:"Region"}],Iw=[{["ref"]:"Endpoint"}],Pw=[Q],qe=[D],Cs=[_],ar=[M,W],Fa=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],Ka=[Hs],je=[ba],ie=[xa],kr=[$],La=[{["fn"]:"substring",["argv"]:[Q,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Q,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],Wa=[{["conditions"]:[$],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:o,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:o,["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"},"--"]}],Xa=[{["conditions"]:[$],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:Gs,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:Gs,["headers"]:{}},["type"]:"endpoint"}],kw=[vs],Za=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],Va=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],Nw=["*"],u=[ja],Ja=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],t=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],be=[{["fn"]:"stringEquals",["argv"]:[oa,"accesspoint"]}],Ba=[{["fn"]:"getAttr",["argv"]:[J,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[te,""]}]}],Dw=[J,"resourceId[1]"],xe=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},""]}]}],Ya=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[2]"]}]}]}],$w=[J,"resourceId[2]"],oe=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]}],["assign"]:"bucketPartition"}],Oa=[{["fn"]:"stringEquals",["argv"]:[na,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],ne=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},!0]}],pe=[{["fn"]:"isValidHostLabel",["argv"]:[pa,!1]}],_a=[{["fn"]:"isValidHostLabel",["argv"]:[te,!1]}],qa=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],yw={version:"1.0",parameters:{Bucket:Ir,Region:Ir,UseFIPS:Pr,UseDualStack:Pr,Endpoint:Ir,ForcePathStyle:Pr,Accelerate:Pr,UseGlobalEndpoint:Pr,UseObjectLambdaEndpoint:Yr,Key:Ir,Prefix:Ir,CopySource:Ir,DisableAccessPoints:Yr,DisableMultiRegionAccessPoints:Pr,UseArnRegion:Yr,UseS3ExpressControlEndpoint:Yr,DisableS3ExpressSessionAuth:Yr},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:_e}],rules:[{["conditions"]:[_,$],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[D,M],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[M,$],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[M,_],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[$,ja,sa],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[vs,{["fn"]:"substring",["argv"]:[Q,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:qe,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:Cs,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:ar,rules:[{["conditions"]:Fa,rules:[{["conditions"]:Ka,rules:[{["conditions"]:je,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:o,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:ie,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:o,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},Ge],["type"]:"tree"},{["conditions"]:Ka,rules:[{["conditions"]:je,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:Gs,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:ie,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:Gs,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},Ge],["type"]:"tree"},{["conditions"]:[ea,fa],rules:[{["conditions"]:[ba,A],rules:[{["conditions"]:kr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:o,["headers"]:d},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:o,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:ie,rules:[{["conditions"]:Fa,rules:[{["conditions"]:La,rules:Wa,["type"]:"tree"},{["conditions"]:Qa,rules:Wa,["type"]:"tree"},la],["type"]:"tree"},{["conditions"]:La,rules:Xa,["type"]:"tree"},{["conditions"]:Qa,rules:Xa,["type"]:"tree"},la],["type"]:"tree"},Ge],["type"]:"tree"},{["conditions"]:[aa,ea,fa],rules:[{["conditions"]:ar,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:o,["headers"]:d},["type"]:"endpoint"},{["conditions"]:kr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com",["properties"]:o,["headers"]:d},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com",["properties"]:o,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[vs,{["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"]:_e,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:Za,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[ha,"e"]}],rules:[{["conditions"]:Va,rules:[ma,{["conditions"]:ar,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:Ts,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Ts,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[ha,"o"]}],rules:[{["conditions"]:Va,rules:[ma,{["conditions"]:ar,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:Ts,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Ts,["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"]:kw,rules:[{["conditions"]:[M,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:Iw}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[ze,xa],rules:[{["conditions"]:u,rules:[{["conditions"]:Ja,rules:[{["conditions"]:[_,sa],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[D,$,T,A,v],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[D,$,T,A,c,F],rules:[{endpoint:ga,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,$,T,A,c,K],endpoint:ga,["type"]:"endpoint"},{["conditions"]:[S,$,T,A,v],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,$,T,A,c,F],rules:[{endpoint:wa,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,$,T,A,c,K],endpoint:wa,["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:da,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,R,_,A,c,K],endpoint:da,["type"]:"endpoint"},{["conditions"]:[D,R,T,A,v],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[D,R,T,A,c,F],rules:[{endpoint:Aa,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,R,T,A,c,K],endpoint:Aa,["type"]:"endpoint"},{["conditions"]:[S,R,T,M,W,Hs,v],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,R,T,M,W,Fe,v],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,R,T,M,W,Hs,c,F],rules:[{["conditions"]:t,endpoint:Ke,["type"]:"endpoint"},{endpoint:Ke,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,R,T,M,W,Fe,c,F],rules:[{["conditions"]:t,endpoint:ue,["type"]:"endpoint"},Ra],["type"]:"tree"},{["conditions"]:[S,R,T,M,W,Hs,c,K],endpoint:Ke,["type"]:"endpoint"},{["conditions"]:[S,R,T,M,W,Fe,c,K],endpoint:ue,["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"]:t,endpoint:Le,["type"]:"endpoint"},{endpoint:Le,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,R,_,A,c,K],endpoint:Le,["type"]:"endpoint"},{["conditions"]:[S,R,T,A,v],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,R,T,A,c,F],rules:[{["conditions"]:t,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:d},["type"]:"endpoint"},{endpoint:Sa,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,R,T,A,c,K],endpoint:Sa,["type"]:"endpoint"}],["type"]:"tree"},Ms],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[M,W,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[ia,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Q,!0]},ze,R,S,T],rules:[{["conditions"]:u,rules:[{["conditions"]:Ja,rules:[Ra],["type"]:"tree"},Ms],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[ze,{["fn"]:"aws.parseArn",["argv"]:Pw,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[oa,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[We,"s3-object-lambda"]}],rules:[{["conditions"]:be,rules:[{["conditions"]:Ba,rules:[Ea,ca,{["conditions"]:xe,rules:[Ia,{["conditions"]:Ya,rules:[Qe,{["conditions"]:oe,rules:[{["conditions"]:u,rules:[{["conditions"]:Oa,rules:[{["conditions"]:ne,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[pa,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:pe,rules:[{["conditions"]:_a,rules:[{["conditions"]:ar,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Xe,["headers"]:d},["type"]:"endpoint"},{["conditions"]:kr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Xe,["headers"]:d},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Xe,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},Pa],["type"]:"tree"},Ze],["type"]:"tree"},Ve],["type"]:"tree"},Je],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},ka],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},Na],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:be,rules:[{["conditions"]:Ba,rules:[{["conditions"]:xe,rules:[{["conditions"]:be,rules:[{["conditions"]:xe,rules:[Ia,{["conditions"]:Ya,rules:[Qe,{["conditions"]:oe,rules:[{["conditions"]:u,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[na,"{partitionResult#name}"]}],rules:[{["conditions"]:ne,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[We,"s3"]}],rules:[{["conditions"]:pe,rules:[{["conditions"]:_a,rules:[{["conditions"]:Cs,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"]:Or,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[$,S],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Or,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[R,D],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Or,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[R,S,M,W],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Or,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[R,S],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Or,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},Pa],["type"]:"tree"},Ze],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},Ve],["type"]:"tree"},Je],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},ka],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[te,!0]}],rules:[{["conditions"]:qe,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:kr,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:Cs,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"]:_e,["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"]:Nw}]},["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"},Na],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[We,"s3-outposts"]}],rules:[{["conditions"]:qe,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:kr,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:Cs,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"]:Dw,["assign"]:"outpostId"}],rules:[{["conditions"]:Za,rules:[Qe,{["conditions"]:oe,rules:[{["conditions"]:u,rules:[{["conditions"]:Oa,rules:[{["conditions"]:ne,rules:[{["conditions"]:pe,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:$w,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:ar,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:Da,["headers"]:d},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Da,["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"},Ze],["type"]:"tree"},Ve],["type"]:"tree"},Je],["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"]:[$a]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[cw,!0]},$a],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:je,rules:[{["conditions"]:u,rules:[{["conditions"]:[T],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:ya,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,A,$,c,K],endpoint:ya,["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:Ua,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,A,$,c,K],endpoint:Ua,["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:Ta,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,A,R,c,K],endpoint:Ta,["type"]:"endpoint"},{["conditions"]:[S,M,W,R,v],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,M,W,R,c,F],rules:[{["conditions"]:t,endpoint:Be,["type"]:"endpoint"},{endpoint:Be,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,M,W,R,c,K],endpoint:Be,["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"]:t,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:d},["type"]:"endpoint"},{endpoint:Ma,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,A,R,c,K],endpoint:Ma,["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"]:[Ca]},{["fn"]:"booleanEquals",["argv"]:[Ca,!0]}],rules:[{["conditions"]:u,rules:[{["conditions"]:qa,rules:[Ea,ca,{["conditions"]:ar,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:Ye,["headers"]:d},["type"]:"endpoint"},{["conditions"]:kr,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:Ye,["headers"]:d},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:Ye,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},Ms],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[aa],rules:[{["conditions"]:u,rules:[{["conditions"]:qa,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:Ha,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[$,D,A,c,K],endpoint:Ha,["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:va,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[$,S,A,c,K],endpoint:va,["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:Ga,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,D,A,c,K],endpoint:Ga,["type"]:"endpoint"},{["conditions"]:[R,S,M,W,v],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[R,S,M,W,c,F],rules:[{["conditions"]:t,endpoint:Oe,["type"]:"endpoint"},{endpoint:Oe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,S,M,W,c,K],endpoint:Oe,["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"]:t,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:d},["type"]:"endpoint"},{endpoint:za,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,S,A,c,K],endpoint:za,["type"]:"endpoint"}],["type"]:"tree"},Ms],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},ua=yw;var Uw=new ta({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),zs=(r,s={})=>{return Uw.get(r,()=>sh(ua,{endpointParams:r,logger:s.logger}))};rh.aws=eh;function ah(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,e)=>({signingProperties:{config:s,context:e}})}}function hh(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,e)=>({signingProperties:{config:s,context:e}})}}var Tw=(r)=>async(s,e,f)=>{if(!f)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const l=await r(s,e,f),a=Br(e)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!a)throw new Error(`getEndpointParameterInstructions() is not defined on \`${e.commandName}\``);const h=await fh(f,{getEndpointParameterInstructions:a},s);return Object.assign(l,h)},Mw=async(r,s,e)=>{return{operation:Br(s).operation,region:await p(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},lh=Tw(Mw),Cw=(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((x)=>{const vr=x.name.toLowerCase();return vr!=="sigv4a"&&vr.startsWith("sigv4")});if(!Us.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}},Hw=(r)=>{const s=[];switch(r.operation){default:s.push(ah(r)),s.push(hh(r))}return s},mh=Cw(zs,Hw,{"aws.auth#sigv4":ah,"aws.auth#sigv4a":hh}),gh=(r)=>{const s=Ks.resolveAwsSdkSigV4Config(r);return{...Ks.resolveAwsSdkSigV4AConfig(s)}};var wh=(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"}},Nr={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 dh{constructor(r){super(r);Object.setPrototypeOf(this,X.prototype)}}class Ls extends X{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,Ls.prototype)}}class Ws extends X{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Ws.prototype)}}class Qs extends X{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,Qs.prototype)}}class Xs extends X{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,Xs.prototype)}}class Zs extends X{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,Zs.prototype)}}var rf;(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])}})(rf||(rf={}));var sf;(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])}})(sf||(sf={}));var ef;(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])}})(ef||(ef={}));var ff;(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])}})(ff||(ff={}));class Vs extends X{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,Vs.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class Js extends X{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,Js.prototype)}}class Bs extends X{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,Bs.prototype)}}var vw=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:Z},...r.SessionToken&&{SessionToken:Z}}),Ah=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:Z},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Z},...r.Credentials&&{Credentials:vw(r.Credentials)}}),Rh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:Z},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Z}});var Sh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:Z}}),Eh=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:Z}});var yr=j(Fs(),1);var _s=j(Me(),1);class Ys extends X{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Ys.prototype)}}var ch;(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])}})(ch||(ch={}));var Ih=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:Z},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Z}}),Ph=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:Z},...r.SSEKMSKeyId&&{SSEKMSKeyId:Z},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Z}});var zh=async(r,s)=>{const e=_s.requestBuilder(r,s),f=G({},i,{[Qd]:r[Sd],[or]:r[br],[nr]:r[xr],[bs]:r[is],[rr]:[()=>i(r[hr]),()=>r[hr].toString()]});e.bp("/"),e.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const l=G({[Fd]:[,""]});let a;return e.m("GET").h(f).q(l).b(a),e.build()};var Fh=async(r,s)=>{const e=_s.requestBuilder(r,s),f=G({},i,{[Dd]:r[tw],[$d]:[()=>i(r[kh]),()=>_r(r[kh]).toString()],[em]:r[_h],[yd]:[()=>i(r[Nh]),()=>_r(r[Nh]).toString()],[Td]:r[ld],[xs]:r[qs],[dm]:r[xh],[os]:r[js],[gm]:r[bh],[lm]:r[Yh],[Wd]:r[qw]});e.bp("/{Key+}"),e.p("Bucket",()=>r.Bucket,"{Bucket}",!1),e.p("Key",()=>r.Key,"{Key+}",!0);const l=G({[Sm]:[,"GetObject"],[Md]:[,r[ad]],[Cd]:[,r[hd]],[Hd]:[,r[md]],[vd]:[,r[gd]],[Gd]:[,r[wd]],[zd]:[()=>r.ResponseExpires!==void 0,()=>_r(r[dd]).toString()],[Kd]:[,r[$f]],[Ud]:[()=>r.PartNumber!==void 0,()=>r[fd].toString()]});let a;return e.m("GET").h(f).q(l).b(a),e.build()};var Kh=async(r,s)=>{const e=_s.requestBuilder(r,s),f=G({},i,{[rm]:r[Bh]||"application/octet-stream",[Ld]:r[Yw],[nh]:r[Xh],[ph]:r[Zh],[uh]:r[Vh],[th]:r[Jh],[Rf]:[()=>i(r[wf]),()=>r[wf].toString()],[Pd]:r[jw],[Od]:r[_w],[yf]:r[Pf],[Uf]:r[kf],[Tf]:r[Nf],[Mf]:r[Df],[Sf]:[()=>i(r[df]),()=>_r(r[df]).toString()],[em]:r[_h],[Xd]:r[ow],[Zd]:r[nw],[Vd]:r[pw],[Jd]:r[uw],[or]:r[br],[wm]:r[jr],[Rm]:r[oh],[xs]:r[qs],[dm]:r[xh],[os]:r[js],[nr]:r[xr],[bs]:r[is],[rr]:[()=>i(r[hr]),()=>r[hr].toString()],[gm]:r[bh],[_d]:r[Ed],[hm]:r[jh],[Ef]:[()=>i(r[Af]),()=>Gh(r[Af]).toString()],[am]:r[qh],[lm]:r[Yh],...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({[Sm]:[,"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 Lh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return If(r,s);const e=G({$metadata:O(r),[br]:[,r.headers[or]],[xr]:[,r.headers[nr]],[is]:[,r.headers[bs]],[hr]:[()=>r.headers[rr]!==void 0,()=>ir(r.headers[rr])]}),f=Dr(Ch(await yr.parseXmlBody(r.body,s)),"body");if(f[hf]!=null)e[hf]=Bw(f[hf],s);return e};var Wh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return If(r,s);const e=G({$metadata:O(r),[bw]:[()=>r.headers[$h]!==void 0,()=>ir(r.headers[$h])],[Ow]:[,r.headers[Id]],[qr]:[,r.headers[fm]],[Rd]:[,r.headers[Bd]],[rd]:[()=>r.headers[Dh]!==void 0,()=>Dr(Qr(r.headers[Dh]))],[wf]:[()=>r.headers[Rf]!==void 0,()=>Hh(r.headers[Rf])],[Oh]:[,r.headers[sm]],[Pf]:[,r.headers[yf]],[kf]:[,r.headers[Uf]],[Nf]:[,r.headers[Tf]],[Df]:[,r.headers[Mf]],[sd]:[()=>r.headers[yh]!==void 0,()=>Os(r.headers[yh])],[$f]:[,r.headers[Am]],[Xh]:[,r.headers[nh]],[Zh]:[,r.headers[ph]],[Vh]:[,r.headers[uh]],[Jh]:[,r.headers[th]],[iw]:[,r.headers[kd]],[Bh]:[,r.headers[rm]],[df]:[()=>r.headers[Sf]!==void 0,()=>Dr(Qr(r.headers[Sf]))],[xw]:[,r.headers[Nd]],[oh]:[,r.headers[Rm]],[br]:[,r.headers[or]],[qs]:[,r.headers[xs]],[js]:[,r.headers[os]],[xr]:[,r.headers[nr]],[hr]:[()=>r.headers[rr]!==void 0,()=>ir(r.headers[rr])],[jr]:[,r.headers[wm]],[ih]:[,r.headers[mm]],[Ad]:[,r.headers[Yd]],[ed]:[()=>r.headers[Uh]!==void 0,()=>Os(r.headers[Uh])],[cd]:[()=>r.headers[Th]!==void 0,()=>Os(r.headers[Th])],[jh]:[,r.headers[hm]],[Af]:[()=>r.headers[Ef]!==void 0,()=>Dr(cf(r.headers[Ef]))],[qh]:[,r.headers[am]],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 If(r,s);const e=G({$metadata:O(r),[qr]:[,r.headers[fm]],[Oh]:[,r.headers[sm]],[Pf]:[,r.headers[yf]],[kf]:[,r.headers[Uf]],[Nf]:[,r.headers[Tf]],[Df]:[,r.headers[Mf]],[br]:[,r.headers[or]],[$f]:[,r.headers[Am]],[qs]:[,r.headers[xs]],[js]:[,r.headers[os]],[xr]:[,r.headers[nr]],[is]:[,r.headers[bs]],[hr]:[()=>r.headers[rr]!==void 0,()=>ir(r.headers[rr])],[ih]:[,r.headers[mm]]});return await Mh(r.body,s),e};var If=async(r,s)=>{const e={...r,body:await yr.parseXmlErrorBody(r.body,s)},f=yr.loadRestXmlErrorCode(r,e.body);switch(f){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await Xw(e,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await Jw(e,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await Fw(e,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await Kw(e,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await Ww(e,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await Lw(e,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await Qw(e,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await Zw(e,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await Vw(e,s);default:const l=e.body;return zw({output:r,parsedBody:l,errorCode:f})}},zw=vh(X),Fw=async(r,s)=>{const e=G({}),f=r.body,l=new Qs({$metadata:O(r),...e});return b(l,r.body)},Kw=async(r,s)=>{const e=G({}),f=r.body,l=new Xs({$metadata:O(r),...e});return b(l,r.body)},Lw=async(r,s)=>{const e=G({}),f=r.body;if(f[af]!=null)e[af]=$r(f[af]);if(f[jr]!=null)e[jr]=$r(f[jr]);const l=new Vs({$metadata:O(r),...e});return b(l,r.body)},Ww=async(r,s)=>{const e=G({}),f=r.body,l=new Zs({$metadata:O(r),...e});return b(l,r.body)},Qw=async(r,s)=>{const e=G({}),f=r.body,l=new Js({$metadata:O(r),...e});return b(l,r.body)},Xw=async(r,s)=>{const e=G({}),f=r.body,l=new Ls({$metadata:O(r),...e});return b(l,r.body)},Zw=async(r,s)=>{const e=G({}),f=r.body,l=new Bs({$metadata:O(r),...e});return b(l,r.body)},Vw=async(r,s)=>{const e=G({}),f=r.body,l=new Ys({$metadata:O(r),...e});return b(l,r.body)},Jw=async(r,s)=>{const e=G({}),f=r.body,l=new Ws({$metadata:O(r),...e});return b(l,r.body)};var Bw=(r,s)=>{const e={};if(r[lf]!=null)e[lf]=$r(r[lf]);if(r[mf]!=null)e[mf]=$r(r[mf]);if(r[gf]!=null)e[gf]=$r(r[gf]);if(r[qr]!=null)e[qr]=Dr(cf(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 i=(r)=>r!==void 0&&r!==null&&r!==""&&(!Object.getOwnPropertyNames(r).includes("length")||r.length!=0)&&(!Object.getOwnPropertyNames(r).includes("size")||r.size!=0);var Yw="ACL";var lf="AccessKeyId";var Ow="AcceptRanges";var af="AccessTier";var hr="BucketKeyEnabled";var hf="Credentials",_w="ChecksumAlgorithm";var Xh="CacheControl",Pf="ChecksumCRC32",kf="ChecksumCRC32C",Zh="ContentDisposition";var Vh="ContentEncoding";var Jh="ContentLanguage",wf="ContentLength",qw="ChecksumMode",jw="ContentMD5";var iw="ContentRange";var Nf="ChecksumSHA1",Df="ChecksumSHA256";var Bh="ContentType";var bw="DeleteMarker";var df="Expires";var Yh="ExpectedBucketOwner";var xw="ExpiresString";var Oh="ETag";var qr="Expiration";var ow="GrantFullControl";var nw="GrantRead",pw="GrantReadACP";var uw="GrantWriteACP";var tw="IfMatch",kh="IfModifiedSince",_h="IfNoneMatch";var Nh="IfUnmodifiedSince";var rd="LastModified";var sd="MissingMeta";var qh="ObjectLockLegalHoldStatus",jh="ObjectLockMode";var Af="ObjectLockRetainUntilDate";var ed="PartsCount";var fd="PartNumber";var ld="Range";var ih="RequestCharged",ad="ResponseCacheControl",hd="ResponseContentDisposition",md="ResponseContentEncoding",gd="ResponseContentLanguage",wd="ResponseContentType";var dd="ResponseExpires";var bh="RequestPayer";var Ad="ReplicationStatus";var Rd="Restore";var mf="SecretAccessKey";var jr="StorageClass";var Sd="SessionMode";var br="ServerSideEncryption";var qs="SSECustomerAlgorithm",xh="SSECustomerKey",js="SSECustomerKeyMD5";var is="SSEKMSEncryptionContext",xr="SSEKMSKeyId";var gf="SessionToken";var Ed="Tagging";var cd="TagCount";var $f="VersionId";var oh="WebsiteRedirectLocation";var Id="accept-ranges";var nh="cache-control",ph="content-disposition",uh="content-encoding",th="content-language",Rf="content-length",Pd="content-md5",kd="content-range",rm="content-type";var Sf="expires";var sm="etag",Nd="expiresstring";var Dd="if-match",$d="if-modified-since";var em="if-none-match";var yd="if-unmodified-since";var Dh="last-modified";var Ud="partNumber";var Td="range",Md="response-cache-control",Cd="response-content-disposition",Hd="response-content-encoding",vd="response-content-language",Gd="response-content-type",zd="response-expires";var Fd="session";var Kd="versionId";var Ld="x-amz-acl";var yf="x-amz-checksum-crc32",Uf="x-amz-checksum-crc32c",Wd="x-amz-checksum-mode";var Tf="x-amz-checksum-sha1",Mf="x-amz-checksum-sha256";var Qd="x-amz-create-session-mode";var $h="x-amz-delete-marker",fm="x-amz-expiration",lm="x-amz-expected-bucket-owner";var Xd="x-amz-grant-full-control",Zd="x-amz-grant-read",Vd="x-amz-grant-read-acp";var Jd="x-amz-grant-write-acp";var yh="x-amz-missing-meta";var Uh="x-amz-mp-parts-count";var am="x-amz-object-lock-legal-hold",hm="x-amz-object-lock-mode",Ef="x-amz-object-lock-retain-until-date";var Bd="x-amz-restore",mm="x-amz-request-charged";var gm="x-amz-request-payer";var Yd="x-amz-replication-status";var wm="x-amz-storage-class",Od="x-amz-sdk-checksum-algorithm";var or="x-amz-server-side-encryption",nr="x-amz-server-side-encryption-aws-kms-key-id",rr="x-amz-server-side-encryption-bucket-key-enabled",bs="x-amz-server-side-encryption-context",xs="x-amz-server-side-encryption-customer-algorithm",dm="x-amz-server-side-encryption-customer-key",os="x-amz-server-side-encryption-customer-key-md5",_d="x-amz-tagging",Th="x-amz-tagging-count";var Am="x-amz-version-id",Rm="x-amz-website-redirect-location",Sm="x-id";class Cf extends Ur.classBuilder().ep({...Nr,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,e,f){return[Tr(e,this.serialize,this.deserialize),Mr(e,r.getEndpointParameterInstructions()),ys(e)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(Rh,Ah).ser(zh).de(Lh).build(){}var Em={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 re=j(Fs(),1);var jd="AWS_S3_USE_ARN_REGION",id="s3_use_arn_region",cm={environmentVariableSelector:(r)=>fr(r,jd,lr.ENV),configFileSelector:(r)=>fr(r,id,lr.CONFIG),default:!1};function Im(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 Cr{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)Im(s);return new Cr(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)Im(r);return parseInt(H(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class Hf{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(Cr.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(Ps(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:km,value:!0};break;case 1:s[l]={type:km,value:!1};break;case 2:s[l]={type:eA,value:r.getInt8(e++)};break;case 3:s[l]={type:fA,value:r.getInt16(e,!1)},e+=2;break;case 4:s[l]={type:lA,value:r.getInt32(e,!1)},e+=4;break;case 5:s[l]={type:aA,value:new Cr(new Uint8Array(r.buffer,r.byteOffset+e,8))},e+=8;break;case 6:const a=r.getUint16(e,!1);e+=2,s[l]={type:hA,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:mA,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+e,h))},e+=h;break;case 8:s[l]={type:gA,value:new Date(new Cr(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:wA,value:`${H(m.subarray(0,4))}-${H(m.subarray(4,6))}-${H(m.subarray(6,8))}-${H(m.subarray(8,10))}-${H(m.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return s}}var Pm;(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"})(Pm||(Pm={}));var km="boolean",eA="byte",fA="short",lA="integer",aA="long",hA="binary",mA="string",gA="timestamp",wA="uuid",dA=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function Dm({byteLength:r,byteOffset:s,buffer:e}){if(r<AA)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(Nm,!1),h=f.getUint32(sr,!1),m=f.getUint32(r-mr,!1),g=new er().update(new Uint8Array(e,s,sr));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+sr,r-(sr+mr))),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+sr+mr,a),body:new Uint8Array(e,s+sr+mr+a,l-a-(sr+mr+mr))}}var Nm=4,sr=Nm*2,mr=4,AA=sr+mr*2;class vf{constructor(r,s){this.headerMarshaller=new Hf(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 er;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}=Dm(r);return{headers:this.headerMarshaller.parse(s),body:e}}formatHeaders(r){return this.headerMarshaller.format(r)}}class Gf{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 zf{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 Ff{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 Kf{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 $m(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 ym(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 ns{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new vf(r,s),this.utfEncoder=r}deserialize(r,s){const e=$m(r);return new Ff({messageStream:new Gf({inputStream:e,decoder:this.eventStreamCodec}),deserializer:ym(s,this.utfEncoder)})}serialize(r,s){return new zf({messageStream:new Kf({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as RA}from"stream";async function*Um(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 Lf{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new ns({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const e=typeof r[Symbol.asyncIterator]==="function"?r:Um(r);return this.universalMarshaller.deserialize(e,s)}serialize(r,s){return RA.from(this.universalMarshaller.serialize(r,s))}}var Tm=(r)=>new Lf(r);import{Writable as SA}from"stream";class ps extends SA{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 Mm=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const e=new r,f=new ps(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 us=j(Fs(),1);var Km=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??Hm,base64Encoder:r?.base64Encoder??vm,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??zs,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??Gm,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??mh,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new us.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new us.AwsSdkSigV4ASigner}],logger:r?.logger??new As,sdkStreamMixin:r?.sdkStreamMixin??zm,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??ve,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??Fm,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??Vr,utf8Encoder:r?.utf8Encoder??Cm}};var xm=(r)=>{Xm(process.version);const s=im(r),e=()=>s().then(Qm),f=Km(r);return re.emitWarningIfUnsupportedVersion(process.version),{...f,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??jm,credentialDefaultProvider:r?.credentialDefaultProvider??bm,defaultUserAgentProvider:r?.defaultUserAgentProvider??qm({serviceId:f.serviceId,clientVersion:Em.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??q(Ue),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??Tm,maxAttempts:r?.maxAttempts??q(Om),md5:r?.md5??ts.bind(null,"md5"),region:r?.region??q(Jm,Bm),requestChecksumCalculation:r?.requestChecksumCalculation??q(jf),requestHandler:Lm.create(r?.requestHandler??e),responseChecksumValidation:r?.responseChecksumValidation??q(bf),retryMode:r?.retryMode??q({..._m,default:async()=>(await e()).retryMode||Ym}),sha1:r?.sha1??ts.bind(null,"sha1"),sha256:r?.sha256??ts.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??q(re.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??Wm,streamHasher:r?.streamHasher??Mm,useArnRegion:r?.useArnRegion??q(cm),useDualstackEndpoint:r?.useDualstackEndpoint??q(Zm),useFipsEndpoint:r?.useFipsEndpoint??q(Vm)}};var om=(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}}},nm=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var se=(r)=>r,fg=(r,s)=>{const e={...se(sg(r)),...se(tm(r)),...se(pm(r)),...se(om(r))};return s.forEach((f)=>f.configure(e)),{...r,...eg(e),...rg(e),...um(e),...nm(e)}};class Wf extends gg{constructor(...[r]){const s=xm(r||{}),e=wh(s),f=wg(e),l=ml(f),a=Eg(l),h=Ag(a),m=lg(h),g=Sg(m),w=ra(g),E=gh(w),I=xl(E,{session:[()=>this,Cf]}),P=fg(I,r?.extensions||[]);super(P);this.config=P,this.middlewareStack.use(dg(this.config)),this.middlewareStack.use(cg(this.config)),this.middlewareStack.use(Rg(this.config)),this.middlewareStack.use(ag(this.config)),this.middlewareStack.use(hg(this.config)),this.middlewareStack.use(mg(this.config)),this.middlewareStack.use(Hr.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:lh,identityProviderConfigProvider:async(N)=>new Hr.DefaultIdentityProviderConfig({"aws.auth#sigv4":N.credentials,"aws.auth#sigv4a":N.credentials})})),this.middlewareStack.use(Hr.getHttpSigningPlugin(this.config)),this.middlewareStack.use(tl(this.config)),this.middlewareStack.use(Yf(this.config)),this.middlewareStack.use(Al(this.config)),this.middlewareStack.use(Te(this.config)),this.middlewareStack.use(Ce(this.config))}destroy(){super.destroy()}}function EA(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(IA(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 IA(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},ee=(r)=>({applyToStack:(s)=>{s.add(EA(r),cA)}});class Qf extends Ur.classBuilder().ep({...Nr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,e,f){return[Tr(e,this.serialize,this.deserialize),Mr(e,r.getEndpointParameterInstructions()),ds(e,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),ee(e),Rl(e)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(Eh,Sh).ser(Fh).de(Wh).build(){}class Xf extends Ur.classBuilder().ep({...Nr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,e,f){return[Tr(e,this.serialize,this.deserialize),Mr(e,r.getEndpointParameterInstructions()),ds(e,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),gl(e),ys(e),ee(e)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(Ph,Ih).ser(Kh).de(Qh).build(){}import{Buffer as Ig}from"buffer";class Pg extends gr{client;constructor(...r){super();this.client=new Wf(...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 Ig?s:Ig.from(await s.arrayBuffer());return await this.client.send(new Xf({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 Qf({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 fe{}class le extends fe{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 kg extends B{driver=new le;boot(){}}import*as $A from"react-dom/server";var Ug=j(PA(),1);import{Writable as MA}from"stream";var{defineProperty:kA,getOwnPropertySymbols:Ng}=Object,NA=Object.prototype.hasOwnProperty,DA=Object.prototype.propertyIsEnumerable,Dg=(r,s,e)=>(s in r)?kA(r,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[s]=e,Zf=(r,s)=>{for(var e in s||(s={}))if(NA.call(s,e))Dg(r,e,s[e]);if(Ng){for(var e of Ng(s))if(DA.call(s,e))Dg(r,e,s[e])}return r},Vf=(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())})},yA={unformatted:["code","pre","em","strong","span"],indent_inner_html:!0,indent_char:" ",indent_size:2,sep:"\n"},UA=(r,s={})=>{return Ug.default.html(r,Zf(Zf({},yA),s))},TA=[{selector:"img",format:"skip"},{selector:"#__react-email-preview",format:"skip"},{selector:"a",options:{linkBrackets:!1}}];var $g=new TextDecoder("utf-8"),yg=(r)=>Vf(void 0,null,function*(){let s="";if("pipeTo"in r){const e=new WritableStream({write(f){s+=$g.decode(f)}});yield r.pipeTo(e)}else{const e=new MA({write(f,l,a){s+=$g.decode(f),a()}});return r.pipe(e),new Promise((f,l)=>{e.on("error",l),e.on("close",()=>{f(s)})})}return s}),ae=(r,s)=>Vf(void 0,null,function*(){const{default:e}=yield import("react-dom/server");let f;if(Object.hasOwn(e,"renderToReadableStream"))f=yield yg(yield e.renderToReadableStream(r));else yield new Promise((h,m)=>{const g=e.renderToPipeableStream(r,{onAllReady(){return Vf(this,null,function*(){f=yield yg(g),h()})},onError(w){m(w)}})});if(s==null?void 0:s.plainText)return Jf(f,Zf({selectors:TA},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 UA(a);return a});var{defineProperty:CA,defineProperties:HA,getOwnPropertyDescriptors:vA,getOwnPropertySymbols:Tg}=Object,GA=Object.prototype.hasOwnProperty,zA=Object.prototype.propertyIsEnumerable,Mg=(r,s,e)=>(s in r)?CA(r,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[s]=e,pr=(r,s)=>{for(var e in s||(s={}))if(GA.call(s,e))Mg(r,e,s[e]);if(Tg){for(var e of Tg(s))if(zA.call(s,e))Mg(r,e,s[e])}return r},FA=(r,s)=>HA(r,vA(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())})},KA="3.5.0",LA=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}`)})}},WA=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}`)})}},QA=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 ae(l.react),delete l.react;return yield this.resend.post("/emails/batch",s,e)})}},XA=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}`)})}},ZA=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`)})}},VA=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 ae(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}`)})}},Cg="https://api.resend.com",Hg=`resend-node:${KA}`,JA=typeof process!=="undefined"&&process.env?process.env.RESEND_BASE_URL||Cg:Cg,BA=typeof process!=="undefined"&&process.env?process.env.RESEND_USER_AGENT||Hg:Hg,vg=class{constructor(r){if(this.key=r,this.apiKeys=new LA(this),this.audiences=new WA(this),this.batch=new QA(this),this.contacts=new XA(this),this.domains=new ZA(this),this.emails=new VA(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":BA,"Content-Type":"application/json"})}fetchRequest(r){return k(this,arguments,function*(s,e={}){try{const f=yield fetch(`${JA}${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:FA(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 he{}class me extends he{r;constructor(r=process.env.RESEND_API_KEY){super();this.apiKey=r}async send(r){const s=new vg(this.apiKey),{data:e,error:f}=await s.emails.send({...r});if(f)return console.error(f),!1;if(e)return!0}}class Gg extends B{driver=new me;boot(){}}class zg extends B{channels={};boot(){}}class Fg extends B{root;rootRouter;boot(){}}class Kg extends B{rootRouter;boot(){return"Origin"}}export{Fg as ViewRouterServiceProvider,Pg as S3Driver,me as ResendDriver,kg as RateLimiterServiceProvider,fe as RateLimiterDriver,le as InMemoryRateLimiter,rs as FileSystemDriver,Bf as FileStorageServiceProvider,gr as FileStorageDriver,Gg as EmailServiceProvider,he as EmailDriver,zg as BroadcastingServiceProvider,Kg as ApiRouterServiceProvider};export{Bf as w,Kg as x,kg as y,Gg as z,zg as A,Fg as B};
11
+ ${Jr.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 _l.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)),Jr.toHex(await a.digest())}getSigningKey(r,s,e,f){return Ql(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=Yl(r).replace(/[\-:]/g,"");return{longDate:s,shortDate:s.slice(0,8)}},Ol=(r)=>Object.keys(r).sort().join(";");var ql="Directory",jl="S3Express",il="sigv4-s3express",ys="X-Amz-S3session-Token",Br=ys.toLowerCase(),ww="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",dw="s3_disable_express_session_auth",Me={environmentVariableSelector:(r)=>fr(r,ww,lr.ENV),configFileSelector:(r)=>fr(r,dw,lr.CONFIG),default:!1};function bl(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}}function xl(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 Te{async signWithCredentials(r,s,e){const f=bl(s);r.headers[Br]=s.sessionToken;const l=this;return xl(l,f),l.signRequest(r,e??{})}async presignWithCredentials(r,s,e){const f=bl(s);return delete r.headers[Br],r.headers[ys]=s.sessionToken,r.query=r.query??{},r.query[ys]=s.sessionToken,xl(this,f),this.presign(r,e)}}var ol=(r)=>{return(s,e)=>async(f)=>{if(e.endpointV2){const l=e.endpointV2,a=l.properties?.authSchemes?.[0]?.name===il;if(l.properties?.backend===jl||l.properties?.bucketType===ql)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[Br]=g.sessionToken}}}return s(f)}},nl={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},Ce=(r)=>({applyToStack:(s)=>{s.add(ol(r),nl)}});var ul=G(He(),1);var Rw=G(Aw(),1);var pl=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 Sw=(r)=>(s)=>{throw s},Ew=(r,s)=>{};var tl=(r)=>(s,e)=>async(f)=>{if(!L.isInstance(f.request))return s(f);const a=Yr(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 pl(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||Sw)(h));return(g.successHandler||Ew)(E.response,h),E},ve=(r)=>({applyToStack:(s)=>{s.addRelativeTo(tl(r),ul.httpSigningMiddlewareOptions)}});var ra=(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 Er(async(l)=>e().send(new f({Bucket:l,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var cw={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Iw=3000,Pw=(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 sa(m);a.body=E;const I=await kw(w,{streamCollector:async(N)=>{return ea(N,Iw)}});if(typeof w?.destroy==="function")w.destroy();const P=r.utf8Encoder(I.subarray(I.length-16));if(I.length===0&&cw[e.commandName]){const N=new Error("S3 aborted request");throw N.name="InternalError",N}if(P&&P.endsWith("</Error>"))a.statusCode=400;return l},kw=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},Nw={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},Ts=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Pw(r),Nw)}});var Ge=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function fa(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 la={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Dw({bucketEndpoint:r}){return(s)=>async(e)=>{const{input:{Bucket:f}}=e;if(!r&&typeof f==="string"&&!Ge(f)&&f.indexOf("/")>=0){const l=new Error(`Bucket name shouldn't contain '/', received '${f}'`);throw l.name="InvalidBucketName",l}return s({...e})}}var $w={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},aa=(r)=>({applyToStack:(s)=>{s.add(Dw(r),$w),s.addRelativeTo(fa(r),la)}});var Hr=G(He(),1);var ha=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var Ws=G(Ls(),1);var Ms={CrtSignerV4:null};class ze{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}\nPlease 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 Ir={["required"]:!1,["type"]:"String"},Pr={["required"]:!0,default:!1,["type"]:"Boolean"},Or={["required"]:!1,["type"]:"Boolean"},_={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},$={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},D={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},M={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},pa={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},ma={["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]},ua={["ref"]:"url"},ta={["fn"]:"uriEncode",["argv"]:[Q],["assign"]:"uri_encoded_bucket"},x={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},d={},rh={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Q,!1]},Fe={["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}"}]},ga={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},wa={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},A={["fn"]:"not",["argv"]:[M]},da={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},Aa={["fn"]:"not",["argv"]:[zs]},Ra={["ref"]:"hardwareType"},Sa={["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}"}]},Ke={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},yw={["ref"]:"ForcePathStyle"},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},H={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},z={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},c={["fn"]:"not",["argv"]:[H]},F={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},Ea={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},C={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},K={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},S={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},ca={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},R={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},Ia={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Pa={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Le={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[ua,"isIp"]},!1]},We={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:C,["headers"]:{}},rf={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:C,["headers"]:{}},ka={["endpoint"]:rf,["type"]:"endpoint"},Qe={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Na={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Hs={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},J={["ref"]:"bucketArn"},sh={["ref"]:"arnType"},Xe={["fn"]:"getAttr",["argv"]:[J,"service"]},sf={["ref"]:"accessPointName"},Da={["conditions"]:[D],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},$a={["conditions"]:[_],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},ya={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},Ze={["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"},eh={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},fh={["fn"]:"getAttr",["argv"]:[J,"accountId"]},Ve={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},Ua={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},Je={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},Be={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},Ye={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},Ta={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},Ma={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},_r={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},Ca={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},Ha={["fn"]:"aws.parseArn",["argv"]:[Q]},va={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},Ga={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},za={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},Oe={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},Fa={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},Ka={["ref"]:"UseObjectLambdaEndpoint"},_e={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},La={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Wa={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Qa={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},qe={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:C,["headers"]:{}},Xa={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},je=[{["ref"]:"Region"}],Uw=[{["ref"]:"Endpoint"}],Tw=[Q],ie=[D],vs=[_],ar=[M,W],Za=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],Va=[Gs],be=[ta],xe=[rh],kr=[$],Ja=[{["fn"]:"substring",["argv"]:[Q,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Q,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],Ba=[{["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"}],Ya=[{["fn"]:"substring",["argv"]:[Q,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Q,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],Oa=[{["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"}],Mw=[zs],_a=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],qa=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],Cw=["*"],p=[pa],ja=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],u=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],oe=[{["fn"]:"stringEquals",["argv"]:[sh,"accesspoint"]}],ia=[{["fn"]:"getAttr",["argv"]:[J,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[sf,""]}]}],Hw=[J,"resourceId[1]"],ne=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},""]}]}],ba=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[2]"]}]}]}],vw=[J,"resourceId[2]"],pe=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]}],["assign"]:"bucketPartition"}],xa=[{["fn"]:"stringEquals",["argv"]:[eh,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],ue=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},!0]}],te=[{["fn"]:"isValidHostLabel",["argv"]:[fh,!1]}],oa=[{["fn"]:"isValidHostLabel",["argv"]:[sf,!1]}],na=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],Gw={version:"1.0",parameters:{Bucket:Ir,Region:Ir,UseFIPS:Pr,UseDualStack:Pr,Endpoint:Ir,ForcePathStyle:Pr,Accelerate:Pr,UseGlobalEndpoint:Pr,UseObjectLambdaEndpoint:Or,Key:Ir,Prefix:Ir,CopySource:Ir,DisableAccessPoints:Or,DisableMultiRegionAccessPoints:Pr,UseArnRegion:Or,UseS3ExpressControlEndpoint:Or,DisableS3ExpressSessionAuth:Or},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:je}],rules:[{["conditions"]:[_,$],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[D,M],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[M,$],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[M,_],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[$,pa,ma],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"]:ie,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:vs,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:ar,rules:[{["conditions"]:Za,rules:[{["conditions"]:Va,rules:[{["conditions"]:be,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:x,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:xe,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:x,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},Fe],["type"]:"tree"},{["conditions"]:Va,rules:[{["conditions"]:be,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:Fs,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:xe,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:Fs,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},Fe],["type"]:"tree"},{["conditions"]:[ga,wa],rules:[{["conditions"]:[ta,A],rules:[{["conditions"]:kr,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"]:xe,rules:[{["conditions"]:Za,rules:[{["conditions"]:Ja,rules:Ba,["type"]:"tree"},{["conditions"]:Ya,rules:Ba,["type"]:"tree"},da],["type"]:"tree"},{["conditions"]:Ja,rules:Oa,["type"]:"tree"},{["conditions"]:Ya,rules:Oa,["type"]:"tree"},da],["type"]:"tree"},Fe],["type"]:"tree"},{["conditions"]:[Aa,ga,wa],rules:[{["conditions"]:ar,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:x,["headers"]:d},["type"]:"endpoint"},{["conditions"]:kr,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"]:je,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:_a,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Ra,"e"]}],rules:[{["conditions"]:qa,rules:[Sa,{["conditions"]:ar,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"]:[Ra,"o"]}],rules:[{["conditions"]:qa,rules:[Sa,{["conditions"]:ar,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"]:Mw,rules:[{["conditions"]:[M,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:Uw}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[Ke,rh],rules:[{["conditions"]:p,rules:[{["conditions"]:ja,rules:[{["conditions"]:[_,ma],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[D,$,T,A,H],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[D,$,T,A,c,F],rules:[{endpoint:Ea,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,$,T,A,c,K],endpoint:Ea,["type"]:"endpoint"},{["conditions"]:[S,$,T,A,H],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,$,T,A,c,F],rules:[{endpoint:ca,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,$,T,A,c,K],endpoint:ca,["type"]:"endpoint"},{["conditions"]:[D,R,_,A,H],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:Ia,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,R,_,A,c,K],endpoint:Ia,["type"]:"endpoint"},{["conditions"]:[D,R,T,A,H],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[D,R,T,A,c,F],rules:[{endpoint:Pa,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,R,T,A,c,K],endpoint:Pa,["type"]:"endpoint"},{["conditions"]:[S,R,T,M,W,Gs,H],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,R,T,M,W,Le,H],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,R,T,M,W,Gs,c,F],rules:[{["conditions"]:u,endpoint:We,["type"]:"endpoint"},{endpoint:We,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,R,T,M,W,Le,c,F],rules:[{["conditions"]:u,endpoint:rf,["type"]:"endpoint"},ka],["type"]:"tree"},{["conditions"]:[S,R,T,M,W,Gs,c,K],endpoint:We,["type"]:"endpoint"},{["conditions"]:[S,R,T,M,W,Le,c,K],endpoint:rf,["type"]:"endpoint"},{["conditions"]:[S,R,_,A,H],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,R,_,A,c,F],rules:[{["conditions"]:u,endpoint:Qe,["type"]:"endpoint"},{endpoint:Qe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,R,_,A,c,K],endpoint:Qe,["type"]:"endpoint"},{["conditions"]:[S,R,T,A,H],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,R,T,A,c,F],rules:[{["conditions"]:u,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:d},["type"]:"endpoint"},{endpoint:Na,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,R,T,A,c,K],endpoint:Na,["type"]:"endpoint"}],["type"]:"tree"},Hs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[M,W,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[ua,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Q,!0]},Ke,R,S,T],rules:[{["conditions"]:p,rules:[{["conditions"]:ja,rules:[ka],["type"]:"tree"},Hs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Ke,{["fn"]:"aws.parseArn",["argv"]:Tw,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[sh,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Xe,"s3-object-lambda"]}],rules:[{["conditions"]:oe,rules:[{["conditions"]:ia,rules:[Da,$a,{["conditions"]:ne,rules:[ya,{["conditions"]:ba,rules:[Ze,{["conditions"]:pe,rules:[{["conditions"]:p,rules:[{["conditions"]:xa,rules:[{["conditions"]:ue,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[fh,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:te,rules:[{["conditions"]:oa,rules:[{["conditions"]:ar,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Ve,["headers"]:d},["type"]:"endpoint"},{["conditions"]:kr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ve,["headers"]:d},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ve,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},Ua],["type"]:"tree"},Je],["type"]:"tree"},Be],["type"]:"tree"},Ye],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Ta],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},Ma],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:oe,rules:[{["conditions"]:ia,rules:[{["conditions"]:ne,rules:[{["conditions"]:oe,rules:[{["conditions"]:ne,rules:[ya,{["conditions"]:ba,rules:[Ze,{["conditions"]:pe,rules:[{["conditions"]:p,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[eh,"{partitionResult#name}"]}],rules:[{["conditions"]:ue,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Xe,"s3"]}],rules:[{["conditions"]:te,rules:[{["conditions"]:oa,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"]:_r,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[$,S],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:_r,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[R,D],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:_r,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[R,S,M,W],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:_r,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[R,S],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:_r,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},Ua],["type"]:"tree"},Je],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},Be],["type"]:"tree"},Ye],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Ta],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[sf,!0]}],rules:[{["conditions"]:ie,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:kr,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"]:je,["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"]:Cw}]},["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"},Ma],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Xe,"s3-outposts"]}],rules:[{["conditions"]:ie,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:kr,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"]:Hw,["assign"]:"outpostId"}],rules:[{["conditions"]:_a,rules:[Ze,{["conditions"]:pe,rules:[{["conditions"]:p,rules:[{["conditions"]:xa,rules:[{["conditions"]:ue,rules:[{["conditions"]:te,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:vw,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:ar,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:Ca,["headers"]:d},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ca,["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"},Je],["type"]:"tree"},Be],["type"]:"tree"},Ye],["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"]:[Ha]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[yw,!0]},Ha],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:be,rules:[{["conditions"]:p,rules:[{["conditions"]:[T],rules:[{["conditions"]:[D,A,$,H],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:va,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,A,$,c,K],endpoint:va,["type"]:"endpoint"},{["conditions"]:[S,A,$,H],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:Ga,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,A,$,c,K],endpoint:Ga,["type"]:"endpoint"},{["conditions"]:[D,A,R,H],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:za,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,A,R,c,K],endpoint:za,["type"]:"endpoint"},{["conditions"]:[S,M,W,R,H],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,M,W,R,c,F],rules:[{["conditions"]:u,endpoint:Oe,["type"]:"endpoint"},{endpoint:Oe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,M,W,R,c,K],endpoint:Oe,["type"]:"endpoint"},{["conditions"]:[S,A,R,H],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[S,A,R,c,F],rules:[{["conditions"]:u,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:d},["type"]:"endpoint"},{endpoint:Fa,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,A,R,c,K],endpoint:Fa,["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"]:[Ka]},{["fn"]:"booleanEquals",["argv"]:[Ka,!0]}],rules:[{["conditions"]:p,rules:[{["conditions"]:na,rules:[Da,$a,{["conditions"]:ar,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:_e,["headers"]:d},["type"]:"endpoint"},{["conditions"]:kr,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:_e,["headers"]:d},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:_e,["headers"]:d},["type"]:"endpoint"}],["type"]:"tree"},Hs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Aa],rules:[{["conditions"]:p,rules:[{["conditions"]:na,rules:[{["conditions"]:[$,D,A,H],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[$,D,A,c,F],rules:[{endpoint:La,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[$,D,A,c,K],endpoint:La,["type"]:"endpoint"},{["conditions"]:[$,S,A,H],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[$,S,A,c,F],rules:[{endpoint:Wa,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[$,S,A,c,K],endpoint:Wa,["type"]:"endpoint"},{["conditions"]:[R,D,A,H],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[R,D,A,c,F],rules:[{endpoint:Qa,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,D,A,c,K],endpoint:Qa,["type"]:"endpoint"},{["conditions"]:[R,S,M,W,H],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[R,S,M,W,c,F],rules:[{["conditions"]:u,endpoint:qe,["type"]:"endpoint"},{endpoint:qe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,S,M,W,c,K],endpoint:qe,["type"]:"endpoint"},{["conditions"]:[R,S,A,H],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:z,["headers"]:d},["type"]:"endpoint"},{["conditions"]:[R,S,A,c,F],rules:[{["conditions"]:u,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:d},["type"]:"endpoint"},{endpoint:Xa,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,S,A,c,K],endpoint:Xa,["type"]:"endpoint"}],["type"]:"tree"},Hs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},lh=Gw;var zw=new ah({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),Ks=(r,s={})=>{return zw.get(r,()=>mh(lh,{endpointParams:r,logger:s.logger}))};hh.aws=gh;function Ah(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,e)=>({signingProperties:{config:s,context:e}})}}function Rh(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,e)=>({signingProperties:{config:s,context:e}})}}var Fw=(r)=>async(s,e,f)=>{if(!f)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const l=await r(s,e,f),a=Yr(e)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!a)throw new Error(`getEndpointParameterInstructions() is not defined on \`${e.commandName}\``);const h=await wh(f,{getEndpointParameterInstructions:a},s);return Object.assign(l,h)},Kw=async(r,s,e)=>{return{operation:Yr(s).operation,region:await n(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},dh=Fw(Kw),Lw=(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 tr=h.find((b)=>{const vr=b.name.toLowerCase();return vr!=="sigv4a"&&vr.startsWith("sigv4")});if(!Ms.CrtSignerV4&&tr)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}},Ww=(r)=>{const s=[];switch(r.operation){default:s.push(Ah(r)),s.push(Rh(r))}return s},Sh=Lw(Ks,Ww,{"aws.auth#sigv4":Ah,"aws.auth#sigv4a":Rh}),Eh=(r)=>{const s=Ws.resolveAwsSdkSigV4Config(r);return{...Ws.resolveAwsSdkSigV4AConfig(s)}};var ch=(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"}},Nr={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 Ih{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 ef;(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])}})(ef||(ef={}));var ff;(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])}})(ff||(ff={}));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.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])}})(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.And!==void 0)return e.And(s.And);return e._(s.$unknown[0],s.$unknown[1])}})(af||(af={}));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 Qw=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:Z},...r.SessionToken&&{SessionToken:Z}}),Ph=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:Z},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Z},...r.Credentials&&{Credentials:Qw(r.Credentials)}}),kh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:Z},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Z}});var Nh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:Z}}),Dh=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:Z}});var yr=G(Ls(),1);var js=G(He(),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 $h;(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])}})($h||($h={}));var yh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:Z},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Z}}),Uh=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:Z},...r.SSEKMSKeyId&&{SSEKMSKeyId:Z},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Z}});var Xh=async(r,s)=>{const e=js.requestBuilder(r,s),f=v({},j,{[Od]:r[Dd],[nr]:r[xr],[pr]:r[or],[os]:r[xs],[t]:[()=>j(r[hr]),()=>r[hr].toString()]});e.bp("/"),e.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const l=v({[Vd]:[,""]});let a;return e.m("GET").h(f).q(l).b(a),e.build()};var Zh=async(r,s)=>{const e=js.requestBuilder(r,s),f=v({},j,{[Hd]:r[hd],[vd]:[()=>j(r[Th]),()=>qr(r[Th]).toString()],[gm]:r[oh],[Gd]:[()=>j(r[Mh]),()=>qr(r[Mh]).toString()],[Fd]:r[Ad],[ns]:r[is],[Im]:r[rm],[ps]:r[bs],[Em]:r[th],[dm]:r[bh],[Yd]:r[pw]});e.bp("/{Key+}"),e.p("Bucket",()=>r.Bucket,"{Bucket}",!1),e.p("Key",()=>r.Key,"{Key+}",!0);const l=v({[Nm]:[,"GetObject"],[Kd]:[,r[Rd]],[Ld]:[,r[Sd]],[Wd]:[,r[Ed]],[Qd]:[,r[cd]],[Xd]:[,r[Id]],[Zd]:[()=>r.ResponseExpires!==void 0,()=>qr(r[Pd]).toString()],[Jd]:[,r[Uf]],[zd]:[()=>r.PartNumber!==void 0,()=>r[dd].toString()]});let a;return e.m("GET").h(f).q(l).b(a),e.build()};var Vh=async(r,s)=>{const e=js.requestBuilder(r,s),f=v({},j,{[hm]:r[ih]||"application/octet-stream",[Bd]:r[xw],[em]:r[Oh],[fm]:r[_h],[lm]:r[qh],[am]:r[jh],[Ef]:[()=>j(r[Af]),()=>r[Af].toString()],[Td]:r[uw],[od]:r[nw],[Tf]:r[Nf],[Mf]:r[Df],[Cf]:r[$f],[Hf]:r[yf],[cf]:[()=>j(r[Rf]),()=>qr(r[Rf]).toString()],[gm]:r[oh],[_d]:r[ed],[qd]:r[fd],[jd]:r[ld],[id]:r[ad],[nr]:r[xr],[cm]:r[ir],[km]:r[sm],[ns]:r[is],[Im]:r[rm],[ps]:r[bs],[pr]:r[or],[os]:r[xs],[t]:[()=>j(r[hr]),()=>r[hr].toString()],[Em]:r[th],[nd]:r[$d],[Rm]:r[ph],[If]:[()=>j(r[Sf]),()=>Qh(r[Sf]).toString()],[Am]:r[nh],[dm]:r[bh],...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=v({[Nm]:[,"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 Jh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return kf(r,s);const e=v({$metadata:O(r),[xr]:[,r.headers[nr]],[or]:[,r.headers[pr]],[xs]:[,r.headers[os]],[hr]:[()=>r.headers[t]!==void 0,()=>br(r.headers[t])]}),f=Dr(Kh(await yr.parseXmlBody(r.body,s)),"body");if(f[gf]!=null)e[gf]=bw(f[gf],s);return e};var Bh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return kf(r,s);const e=v({$metadata:O(r),[rd]:[()=>r.headers[Hh]!==void 0,()=>br(r.headers[Hh])],[ow]:[,r.headers[Ud]],[jr]:[,r.headers[wm]],[Nd]:[,r.headers[bd]],[md]:[()=>r.headers[Ch]!==void 0,()=>Dr(Qr(r.headers[Ch]))],[Af]:[()=>r.headers[Ef]!==void 0,()=>Lh(r.headers[Ef])],[xh]:[,r.headers[mm]],[Nf]:[,r.headers[Tf]],[Df]:[,r.headers[Mf]],[$f]:[,r.headers[Cf]],[yf]:[,r.headers[Hf]],[gd]:[()=>r.headers[vh]!==void 0,()=>qs(r.headers[vh])],[Uf]:[,r.headers[Pm]],[Oh]:[,r.headers[em]],[_h]:[,r.headers[fm]],[qh]:[,r.headers[lm]],[jh]:[,r.headers[am]],[tw]:[,r.headers[Md]],[ih]:[,r.headers[hm]],[Rf]:[()=>r.headers[cf]!==void 0,()=>Dr(Qr(r.headers[cf]))],[sd]:[,r.headers[Cd]],[sm]:[,r.headers[km]],[xr]:[,r.headers[nr]],[is]:[,r.headers[ns]],[bs]:[,r.headers[ps]],[or]:[,r.headers[pr]],[hr]:[()=>r.headers[t]!==void 0,()=>br(r.headers[t])],[ir]:[,r.headers[cm]],[uh]:[,r.headers[Sm]],[kd]:[,r.headers[xd]],[wd]:[()=>r.headers[Gh]!==void 0,()=>qs(r.headers[Gh])],[yd]:[()=>r.headers[zh]!==void 0,()=>qs(r.headers[zh])],[ph]:[,r.headers[Rm]],[Sf]:[()=>r.headers[If]!==void 0,()=>Dr(Pf(r.headers[If]))],[nh]:[,r.headers[Am]],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 Yh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return kf(r,s);const e=v({$metadata:O(r),[jr]:[,r.headers[wm]],[xh]:[,r.headers[mm]],[Nf]:[,r.headers[Tf]],[Df]:[,r.headers[Mf]],[$f]:[,r.headers[Cf]],[yf]:[,r.headers[Hf]],[xr]:[,r.headers[nr]],[Uf]:[,r.headers[Pm]],[is]:[,r.headers[ns]],[bs]:[,r.headers[ps]],[or]:[,r.headers[pr]],[xs]:[,r.headers[os]],[hr]:[()=>r.headers[t]!==void 0,()=>br(r.headers[t])],[uh]:[,r.headers[Sm]]});return await Fh(r.body,s),e};var kf=async(r,s)=>{const e={...r,body:await yr.parseXmlErrorBody(r.body,s)},f=yr.loadRestXmlErrorCode(r,e.body);switch(f){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await _w(e,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await iw(e,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await Vw(e,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await Jw(e,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await Yw(e,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await Bw(e,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await Ow(e,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await qw(e,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await jw(e,s);default:const l=e.body;return Zw({output:r,parsedBody:l,errorCode:f})}},Zw=Wh(X),Vw=async(r,s)=>{const e=v({}),f=r.body,l=new Zs({$metadata:O(r),...e});return i(l,r.body)},Jw=async(r,s)=>{const e=v({}),f=r.body,l=new Vs({$metadata:O(r),...e});return i(l,r.body)},Bw=async(r,s)=>{const e=v({}),f=r.body;if(f[mf]!=null)e[mf]=$r(f[mf]);if(f[ir]!=null)e[ir]=$r(f[ir]);const l=new Bs({$metadata:O(r),...e});return i(l,r.body)},Yw=async(r,s)=>{const e=v({}),f=r.body,l=new Js({$metadata:O(r),...e});return i(l,r.body)},Ow=async(r,s)=>{const e=v({}),f=r.body,l=new Ys({$metadata:O(r),...e});return i(l,r.body)},_w=async(r,s)=>{const e=v({}),f=r.body,l=new Qs({$metadata:O(r),...e});return i(l,r.body)},qw=async(r,s)=>{const e=v({}),f=r.body,l=new Os({$metadata:O(r),...e});return i(l,r.body)},jw=async(r,s)=>{const e=v({}),f=r.body,l=new _s({$metadata:O(r),...e});return i(l,r.body)},iw=async(r,s)=>{const e=v({}),f=r.body,l=new Xs({$metadata:O(r),...e});return i(l,r.body)};var bw=(r,s)=>{const e={};if(r[hf]!=null)e[hf]=$r(r[hf]);if(r[wf]!=null)e[wf]=$r(r[wf]);if(r[df]!=null)e[df]=$r(r[df]);if(r[jr]!=null)e[jr]=Dr(Pf(r[jr]));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 xw="ACL";var hf="AccessKeyId";var ow="AcceptRanges";var mf="AccessTier";var hr="BucketKeyEnabled";var gf="Credentials",nw="ChecksumAlgorithm";var Oh="CacheControl",Nf="ChecksumCRC32",Df="ChecksumCRC32C",_h="ContentDisposition";var qh="ContentEncoding";var jh="ContentLanguage",Af="ContentLength",pw="ChecksumMode",uw="ContentMD5";var tw="ContentRange";var $f="ChecksumSHA1",yf="ChecksumSHA256";var ih="ContentType";var rd="DeleteMarker";var Rf="Expires";var bh="ExpectedBucketOwner";var sd="ExpiresString";var xh="ETag";var jr="Expiration";var ed="GrantFullControl";var fd="GrantRead",ld="GrantReadACP";var ad="GrantWriteACP";var hd="IfMatch",Th="IfModifiedSince",oh="IfNoneMatch";var Mh="IfUnmodifiedSince";var md="LastModified";var gd="MissingMeta";var nh="ObjectLockLegalHoldStatus",ph="ObjectLockMode";var Sf="ObjectLockRetainUntilDate";var wd="PartsCount";var dd="PartNumber";var Ad="Range";var uh="RequestCharged",Rd="ResponseCacheControl",Sd="ResponseContentDisposition",Ed="ResponseContentEncoding",cd="ResponseContentLanguage",Id="ResponseContentType";var Pd="ResponseExpires";var th="RequestPayer";var kd="ReplicationStatus";var Nd="Restore";var wf="SecretAccessKey";var ir="StorageClass";var Dd="SessionMode";var xr="ServerSideEncryption";var is="SSECustomerAlgorithm",rm="SSECustomerKey",bs="SSECustomerKeyMD5";var xs="SSEKMSEncryptionContext",or="SSEKMSKeyId";var df="SessionToken";var $d="Tagging";var yd="TagCount";var Uf="VersionId";var sm="WebsiteRedirectLocation";var Ud="accept-ranges";var em="cache-control",fm="content-disposition",lm="content-encoding",am="content-language",Ef="content-length",Td="content-md5",Md="content-range",hm="content-type";var cf="expires";var mm="etag",Cd="expiresstring";var Hd="if-match",vd="if-modified-since";var gm="if-none-match";var Gd="if-unmodified-since";var Ch="last-modified";var zd="partNumber";var Fd="range",Kd="response-cache-control",Ld="response-content-disposition",Wd="response-content-encoding",Qd="response-content-language",Xd="response-content-type",Zd="response-expires";var Vd="session";var Jd="versionId";var Bd="x-amz-acl";var Tf="x-amz-checksum-crc32",Mf="x-amz-checksum-crc32c",Yd="x-amz-checksum-mode";var Cf="x-amz-checksum-sha1",Hf="x-amz-checksum-sha256";var Od="x-amz-create-session-mode";var Hh="x-amz-delete-marker",wm="x-amz-expiration",dm="x-amz-expected-bucket-owner";var _d="x-amz-grant-full-control",qd="x-amz-grant-read",jd="x-amz-grant-read-acp";var id="x-amz-grant-write-acp";var vh="x-amz-missing-meta";var Gh="x-amz-mp-parts-count";var Am="x-amz-object-lock-legal-hold",Rm="x-amz-object-lock-mode",If="x-amz-object-lock-retain-until-date";var bd="x-amz-restore",Sm="x-amz-request-charged";var Em="x-amz-request-payer";var xd="x-amz-replication-status";var cm="x-amz-storage-class",od="x-amz-sdk-checksum-algorithm";var nr="x-amz-server-side-encryption",pr="x-amz-server-side-encryption-aws-kms-key-id",t="x-amz-server-side-encryption-bucket-key-enabled",os="x-amz-server-side-encryption-context",ns="x-amz-server-side-encryption-customer-algorithm",Im="x-amz-server-side-encryption-customer-key",ps="x-amz-server-side-encryption-customer-key-md5",nd="x-amz-tagging",zh="x-amz-tagging-count";var Pm="x-amz-version-id",km="x-amz-website-redirect-location",Nm="x-id";class vf extends Ur.classBuilder().ep({...Nr,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,e,f){return[Tr(e,this.serialize,this.deserialize),Mr(e,r.getEndpointParameterInstructions()),Ts(e)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(kh,Ph).ser(Xh).de(Jh).build(){}var Dm={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=G(Ls(),1);var ud="AWS_S3_USE_ARN_REGION",td="s3_use_arn_region",$m={environmentVariableSelector:(r)=>fr(r,ud,lr.ENV),configFileSelector:(r)=>fr(r,td,lr.CONFIG),default:!1};var rr=G(cr(),1);var Um=G(cr(),1);function ym(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 Cr{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)ym(s);return new Cr(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)ym(r);return parseInt(Um.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class Gf{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(Cr.fromNumber(r.value.valueOf()).bytes,1),w;case"uuid":if(!PA.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const E=new Uint8Array(17);return E[0]=9,E.set(rr.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:Mm,value:!0};break;case 1:s[l]={type:Mm,value:!1};break;case 2:s[l]={type:wA,value:r.getInt8(e++)};break;case 3:s[l]={type:dA,value:r.getInt16(e,!1)},e+=2;break;case 4:s[l]={type:AA,value:r.getInt32(e,!1)},e+=4;break;case 5:s[l]={type:RA,value:new Cr(new Uint8Array(r.buffer,r.byteOffset+e,8))},e+=8;break;case 6:const a=r.getUint16(e,!1);e+=2,s[l]={type:SA,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:EA,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+e,h))},e+=h;break;case 8:s[l]={type:cA,value:new Date(new Cr(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:IA,value:`${rr.toHex(m.subarray(0,4))}-${rr.toHex(m.subarray(4,6))}-${rr.toHex(m.subarray(6,8))}-${rr.toHex(m.subarray(8,10))}-${rr.toHex(m.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return s}}var Tm;(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"})(Tm||(Tm={}));var Mm="boolean",wA="byte",dA="short",AA="integer",RA="long",SA="binary",EA="string",cA="timestamp",IA="uuid",PA=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function Hm({byteLength:r,byteOffset:s,buffer:e}){if(r<kA)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(Cm,!1),h=f.getUint32(sr,!1),m=f.getUint32(r-mr,!1),g=new er().update(new Uint8Array(e,s,sr));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+sr,r-(sr+mr))),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+sr+mr,a),body:new Uint8Array(e,s+sr+mr+a,l-a-(sr+mr+mr))}}var Cm=4,sr=Cm*2,mr=4,kA=sr+mr*2;class zf{constructor(r,s){this.headerMarshaller=new Gf(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 er;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}=Hm(r);return{headers:this.headerMarshaller.parse(s),body:e}}formatHeaders(r){return this.headerMarshaller.format(r)}}class Ff{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 Kf{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 Lf{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 Wf{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 vm(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 Gm(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 zf(r,s),this.utfEncoder=r}deserialize(r,s){const e=vm(r);return new Lf({messageStream:new Ff({inputStream:e,decoder:this.eventStreamCodec}),deserializer:Gm(s,this.utfEncoder)})}serialize(r,s){return new Kf({messageStream:new Wf({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as NA}from"stream";async function*zm(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 Qf{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new us({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const e=typeof r[Symbol.asyncIterator]==="function"?r:zm(r);return this.universalMarshaller.deserialize(e,s)}serialize(r,s){return NA.from(this.universalMarshaller.serialize(r,s))}}var Fm=(r)=>new Qf(r);import{Writable as DA}from"stream";class ts extends DA{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 Km=(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=G(Ls(),1);var Jm=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??Wm,base64Encoder:r?.base64Encoder??Qm,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??Ks,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??Xm,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??Sh,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??Zm,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??ze,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??Vm,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??Vr,utf8Encoder:r?.utf8Encoder??Lm}};var sg=(r)=>{_m(process.version);const s=tm(r),e=()=>s().then(Om),f=Jm(r);return ee.emitWarningIfUnsupportedVersion(process.version),{...f,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??um,credentialDefaultProvider:r?.credentialDefaultProvider??rg,defaultUserAgentProvider:r?.defaultUserAgentProvider??pm({serviceId:f.serviceId,clientVersion:Dm.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??q(Me),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??Fm,maxAttempts:r?.maxAttempts??q(om),md5:r?.md5??se.bind(null,"md5"),region:r?.region??q(im,bm),requestChecksumCalculation:r?.requestChecksumCalculation??q(xf),requestHandler:Bm.create(r?.requestHandler??e),responseChecksumValidation:r?.responseChecksumValidation??q(of),retryMode:r?.retryMode??q({...nm,default:async()=>(await e()).retryMode||xm}),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??Ym,streamHasher:r?.streamHasher??Km,useArnRegion:r?.useArnRegion??q($m),useDualstackEndpoint:r?.useDualstackEndpoint??q(qm),useFipsEndpoint:r?.useFipsEndpoint??q(jm)}};var eg=(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}}},fg=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var fe=(r)=>r,dg=(r,s)=>{const e={...fe(gg(r)),...fe(hg(r)),...fe(lg(r)),...fe(eg(r))};return s.forEach((f)=>f.configure(e)),{...r,...wg(e),...mg(e),...ag(e),...fg(e)}};class Xf extends cg{constructor(...[r]){const s=sg(r||{}),e=ch(s),f=Ig(e),l=wl(f),a=$g(l),h=kg(a),m=Ag(h),g=Dg(m),w=ha(g),E=Eh(w),I=ra(E,{session:[()=>this,vf]}),P=dg(I,r?.extensions||[]);super(P);this.config=P,this.middlewareStack.use(Pg(this.config)),this.middlewareStack.use(yg(this.config)),this.middlewareStack.use(Ng(this.config)),this.middlewareStack.use(Rg(this.config)),this.middlewareStack.use(Sg(this.config)),this.middlewareStack.use(Eg(this.config)),this.middlewareStack.use(Hr.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:dh,identityProviderConfigProvider:async(N)=>new Hr.DefaultIdentityProviderConfig({"aws.auth#sigv4":N.credentials,"aws.auth#sigv4a":N.credentials})})),this.middlewareStack.use(Hr.getHttpSigningPlugin(this.config)),this.middlewareStack.use(aa(this.config)),this.middlewareStack.use(_f(this.config)),this.middlewareStack.use(Sl(this.config)),this.middlewareStack.use(Ce(this.config)),this.middlewareStack.use(ve(this.config))}destroy(){super.destroy()}}function $A(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(UA(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 UA(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 yA={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},le=(r)=>({applyToStack:(s)=>{s.add($A(r),yA)}});class Zf extends Ur.classBuilder().ep({...Nr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,e,f){return[Tr(e,this.serialize,this.deserialize),Mr(e,r.getEndpointParameterInstructions()),As(e,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),le(e),El(e)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(Dh,Nh).ser(Zh).de(Bh).build(){}class Vf extends Ur.classBuilder().ep({...Nr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,e,f){return[Tr(e,this.serialize,this.deserialize),Mr(e,r.getEndpointParameterInstructions()),As(e,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),dl(e),Ts(e),le(e)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(Uh,yh).ser(Vh).de(Yh).build(){}import{Buffer as Ug}from"buffer";class Tg extends gr{client;constructor(...r){super();this.client=new Xf(...r)}async put(r){let s,e,f,l=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,f=`${rs()}.${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 Ug?s:Ug.from(await s.arrayBuffer());return await this.client.send(new Vf({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 Zf({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{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 Mg extends B{driver=new he;boot(){}}import*as vA from"react-dom/server";var zg=G(TA(),1);import{Writable as KA}from"stream";var{defineProperty:MA,getOwnPropertySymbols:Cg}=Object,CA=Object.prototype.hasOwnProperty,HA=Object.prototype.propertyIsEnumerable,Hg=(r,s,e)=>(s in r)?MA(r,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[s]=e,Jf=(r,s)=>{for(var e in s||(s={}))if(CA.call(s,e))Hg(r,e,s[e]);if(Cg){for(var e of Cg(s))if(HA.call(s,e))Hg(r,e,s[e])}return r},Bf=(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())})},GA={unformatted:["code","pre","em","strong","span"],indent_inner_html:!0,indent_char:" ",indent_size:2,sep:"\n"},zA=(r,s={})=>{return zg.default.html(r,Jf(Jf({},GA),s))},FA=[{selector:"img",format:"skip"},{selector:"#__react-email-preview",format:"skip"},{selector:"a",options:{linkBrackets:!1}}];var vg=new TextDecoder("utf-8"),Gg=(r)=>Bf(void 0,null,function*(){let s="";if("pipeTo"in r){const e=new WritableStream({write(f){s+=vg.decode(f)}});yield r.pipeTo(e)}else{const e=new KA({write(f,l,a){s+=vg.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)=>Bf(void 0,null,function*(){const{default:e}=yield import("react-dom/server");let f;if(Object.hasOwn(e,"renderToReadableStream"))f=yield Gg(yield e.renderToReadableStream(r));else yield new Promise((h,m)=>{const g=e.renderToPipeableStream(r,{onAllReady(){return Bf(this,null,function*(){f=yield Gg(g),h()})},onError(w){m(w)}})});if(s==null?void 0:s.plainText)return Yf(f,Jf({selectors:FA},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 zA(a);return a});var{defineProperty:LA,defineProperties:WA,getOwnPropertyDescriptors:QA,getOwnPropertySymbols:Fg}=Object,XA=Object.prototype.hasOwnProperty,ZA=Object.prototype.propertyIsEnumerable,Kg=(r,s,e)=>(s in r)?LA(r,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[s]=e,ur=(r,s)=>{for(var e in s||(s={}))if(XA.call(s,e))Kg(r,e,s[e]);if(Fg){for(var e of Fg(s))if(ZA.call(s,e))Kg(r,e,s[e])}return r},VA=(r,s)=>WA(r,QA(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())})},JA="3.5.0",BA=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}`)})}},YA=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}`)})}},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={}){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)})}},_A=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}`)})}},qA=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`)})}},jA=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}`)})}},Lg="https://api.resend.com",Wg=`resend-node:${JA}`,iA=typeof process!=="undefined"&&process.env?process.env.RESEND_BASE_URL||Lg:Lg,bA=typeof process!=="undefined"&&process.env?process.env.RESEND_USER_AGENT||Wg:Wg,Qg=class{constructor(r){if(this.key=r,this.apiKeys=new BA(this),this.audiences=new YA(this),this.batch=new OA(this),this.contacts=new _A(this),this.domains=new qA(this),this.emails=new jA(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":bA,"Content-Type":"application/json"})}fetchRequest(r){return k(this,arguments,function*(s,e={}){try{const f=yield fetch(`${iA}${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:VA(ur({},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=ur({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=ur({method:"GET",headers:this.headers},e);return this.fetchRequest(s,f)})}put(r,s){return k(this,arguments,function*(e,f,l={}){const a=ur({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=ur({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 Qg(this.apiKey),{data:e,error:f}=await s.emails.send({...r});if(f)return console.error(f),!1;if(e)return!0}}class Xg extends B{driver=new we;boot(){}}class Zg extends B{channels={};boot(){}}class Vg extends B{root;rootRouter;boot(){}}class Jg extends B{rootRouter;boot(){return"Origin"}}export{Vg as ViewRouterServiceProvider,Tg as S3Driver,we as ResendDriver,Mg as RateLimiterServiceProvider,ae as RateLimiterDriver,he as InMemoryRateLimiter,ss as FileSystemDriver,Of as FileStorageServiceProvider,gr as FileStorageDriver,Xg as EmailServiceProvider,ge as EmailDriver,Zg as BroadcastingServiceProvider,Jg as ApiRouterServiceProvider};export{Of as w,Jg as x,Mg as y,Xg as z,Zg as A,Vg as B};
12
12
 
13
- //# debugId=08638BE11458281764756E2164756E21
13
+ //# debugId=6C929B9CE22D02DB64756E2164756E21