gemi 0.4.103 → 0.4.104

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 (52) hide show
  1. package/dist/{chunk-7bf700c2348ef918.js → chunk-1dcc74f569d82336.js} +2 -2
  2. package/dist/{chunk-7bf700c2348ef918.js.map → chunk-1dcc74f569d82336.js.map} +1 -1
  3. package/dist/{chunk-9037f8f927d4caff.js → chunk-213873f56884b132.js} +2 -2
  4. package/dist/{chunk-9037f8f927d4caff.js.map → chunk-213873f56884b132.js.map} +1 -1
  5. package/dist/chunk-3548ae4b3ab96c21.js +4 -0
  6. package/dist/{chunk-4b2790e55056a146.js.map → chunk-3548ae4b3ab96c21.js.map} +2 -2
  7. package/dist/chunk-3ab549e1278958db.js +4 -0
  8. package/dist/{chunk-ce40ec049b04e1d1.js.map → chunk-3ab549e1278958db.js.map} +2 -2
  9. package/dist/chunk-3bcacf5cc1e6cc17.js +3 -0
  10. package/dist/{chunk-79168b7162a45077.js.map → chunk-3bcacf5cc1e6cc17.js.map} +4 -4
  11. package/dist/chunk-402c227b95ad9a77.js +4 -0
  12. package/dist/{chunk-0a78bb530df845c9.js.map → chunk-402c227b95ad9a77.js.map} +5 -5
  13. package/dist/{chunk-0bc8cb0a7994c85d.js → chunk-4880adc4cf447a91.js} +2 -2
  14. package/dist/{chunk-0bc8cb0a7994c85d.js.map → chunk-4880adc4cf447a91.js.map} +1 -1
  15. package/dist/chunk-5376e4fd33eba40f.js +20 -0
  16. package/dist/{chunk-d8d25380b8f0c36e.js.map → chunk-5376e4fd33eba40f.js.map} +26 -18
  17. package/dist/chunk-611e511a95c844a7.js +4 -0
  18. package/dist/{chunk-4bda8e5e6ea82011.js.map → chunk-611e511a95c844a7.js.map} +2 -2
  19. package/dist/{chunk-f53ed6a7a3dad8ec.js → chunk-63ecca203d5f57d9.js} +2 -2
  20. package/dist/{chunk-f53ed6a7a3dad8ec.js.map → chunk-63ecca203d5f57d9.js.map} +1 -1
  21. package/dist/{chunk-643d1c40e2a0f67f.js → chunk-7d69aa73d7fc1f66.js} +2 -2
  22. package/dist/{chunk-643d1c40e2a0f67f.js.map → chunk-7d69aa73d7fc1f66.js.map} +1 -1
  23. package/dist/chunk-7f9e205bb6fc61db.js +4 -0
  24. package/dist/chunk-7f9e205bb6fc61db.js.map +10 -0
  25. package/dist/{chunk-087e1dd06f85d588.js → chunk-9ef7636cea963dff.js} +2 -2
  26. package/dist/{chunk-087e1dd06f85d588.js.map → chunk-9ef7636cea963dff.js.map} +1 -1
  27. package/dist/chunk-a433eaaec29698ba.js +5 -0
  28. package/dist/chunk-a433eaaec29698ba.js.map +72 -0
  29. package/dist/{chunk-e3363367fe4893a2.js → chunk-c7894ed595fd0b08.js} +3 -3
  30. package/dist/{chunk-e3363367fe4893a2.js.map → chunk-c7894ed595fd0b08.js.map} +1 -1
  31. package/dist/chunk-e3ee32f7c3f7bca2.js +4 -0
  32. package/dist/{chunk-28edd25587946042.js.map → chunk-e3ee32f7c3f7bca2.js.map} +4 -4
  33. package/dist/chunk-fbf888655f08faa6.js +8 -0
  34. package/dist/{chunk-c4a5b4177603f458.js.map → chunk-fbf888655f08faa6.js.map} +2 -2
  35. package/dist/client/index.js +1 -1
  36. package/dist/client/index.js.map +1 -1
  37. package/dist/kernel/index.js +1 -1
  38. package/dist/services/index.js +2 -2
  39. package/dist/services/index.js.map +2 -2
  40. package/package.json +1 -1
  41. package/dist/chunk-0a78bb530df845c9.js +0 -3
  42. package/dist/chunk-17c3f49735b660d5.js +0 -3
  43. package/dist/chunk-17c3f49735b660d5.js.map +0 -17
  44. package/dist/chunk-28edd25587946042.js +0 -4
  45. package/dist/chunk-4b2790e55056a146.js +0 -4
  46. package/dist/chunk-4bda8e5e6ea82011.js +0 -4
  47. package/dist/chunk-79168b7162a45077.js +0 -3
  48. package/dist/chunk-c4a5b4177603f458.js +0 -8
  49. package/dist/chunk-ce40ec049b04e1d1.js +0 -4
  50. package/dist/chunk-d8d25380b8f0c36e.js +0 -18
  51. package/dist/chunk-ebc6b30a0275d2f7.js +0 -7
  52. package/dist/chunk-ebc6b30a0275d2f7.js.map +0 -65
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import"../chunk-643d1c40e2a0f67f.js";import{H as c} from"../chunk-2c5231fcdfa1d6f2.js";import{I as z} from"../chunk-c83dcc500d5fefe3.js";import{O as Mf,P as Vd} from"../chunk-58fb175982676253.js";import{U as sg} from"../chunk-9e77cade8671df8d.js";import{$ as $m,Aa as sm,Ba as Km,Ca as $s,Da as em,Ea as Os,Fa as hm,Ga as _a,Ha as ja,Ia as am,Ja as km,Ka as Pm,V as br,W as Zf,X as Oa,Y as ss,Z as qa,_ as hl,aa as Dm,ba as Um,ca as Mm,da as Pg,ea as sr,fa as lr,ga as Gd,ha as gl,ia as Cm,ja as Ah,ka as Eh,la as Ih,ma as kh,na as Fm,oa as na,pa,qa as ua,ra as ta,sa as zm,ta as Gm,ua as Ph,va as Ur,wa as Mr,xa as ym,ya as rm,za as Wm} from"../chunk-d8d25380b8f0c36e.js";import{$a as H,Ab as fm,La as Rm,Ma as Am,Na as X,Oa as as,Qa as hs,Sa as Tm,Xa as Va,Ya as de,Za as ch,_a as Dr,bb as Yr,eb as Pr,fb as Yh,gb as Nr,hb as Bh,ib as Ks,jb as Xr,lb as ul,mb as Lr,nb as Ch,ob as j,pb as Oh,qb as xa,rb as oa,sb as Em,tb as Im,vb as y,xb as qh,zb as lm} from"../chunk-ebc6b30a0275d2f7.js";import{Bb as zd,Cb as q} from"../chunk-0a78bb530df845c9.js";import"../chunk-17c3f49735b660d5.js";import{Hb as mm} from"../chunk-e3363367fe4893a2.js";import"../chunk-79168b7162a45077.js";import"../chunk-9037f8f927d4caff.js";class ar{}class xr extends ar{r;constructor(r=`${process.env.ROOT_DIR}/storage`){super();this.folderPath=r}async put(r){let s,l;if(r instanceof Blob)s=r,l=`${br()}.${r.type.split("/")[1].split(";")[0]}`;else s=r.body,l=r.name;const f=s instanceof Buffer?s:Buffer.from(await s.arrayBuffer()),e=`${this.folderPath}/${l}`;return await Bun.write(e,f),l}async fetch(r){let s=process.env.BUCKET_NAME,l;if(typeof r==="string")l=r;else s=r.bucket??s,l=r.name;if(!l)throw new Error("Object name has to be specified");const f=`${this.folderPath}/${l}`,e=Bun.file(f),h=Bun.file(f).stream(),m=new Date(e.lastModified).toUTCString();return new Response(h,{headers:{"Content-Type":e.type,"Content-Length":String(e.size),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":m}})}}class Tf extends c{constructor(){super(...arguments)}driver=new xr;boot(){}}function om(r){return(s)=>async(l)=>{const{request:f}=l;if(X.isInstance(f)&&f.body&&r.runtime==="node"){if(r.requestHandler?.constructor?.name!=="FetchHttpHandler")f.headers={...f.headers,Expect:"100-continue"}}return s({...l,request:f})}}var nm={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},Cf=(r)=>({applyToStack:(s)=>{s.add(om(r),nm)}});var zr={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},or=zr.WHEN_SUPPORTED,us={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},nr=zr.WHEN_SUPPORTED,U;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(U||(U={}));var Ff;(function(r){r.HEADER="header",r.TRAILER="trailer"})(Ff||(Ff={}));var{MD5:zf,CRC32:Gf}=U;var x;(function(r){r.ENV="env",r.CONFIG="shared config entry"})(x||(x={}));var mr=(r,s,l,f)=>{if(!(s in r))return;const e=r[s].toUpperCase();if(!Object.values(l).includes(e))throw new TypeError(`Cannot load ${f} '${s}'. Expected one of ${Object.values(l)}, got '${r[s]}'.`);return e};var pm="AWS_REQUEST_CHECKSUM_CALCULATION",um="request_checksum_calculation",yf={environmentVariableSelector:(r)=>mr(r,pm,zr,x.ENV),configFileSelector:(r)=>mr(r,um,zr,x.CONFIG),default:or};var tm="AWS_RESPONSE_CHECKSUM_VALIDATION",rg="response_checksum_validation",Wf={environmentVariableSelector:(r)=>mr(r,tm,us,x.ENV),configFileSelector:(r)=>mr(r,rg,us,x.CONFIG),default:nr};var Gr=[U.CRC32,U.CRC32C,U.SHA1,U.SHA256],Kf=[U.CRC32,U.CRC32C,U.SHA1,U.SHA256];var Vf=(r,{requestChecksumRequired:s,requestAlgorithmMember:l},f)=>{const e=f?Gf:zf;if(!l||!r[l])return s?e:void 0;const h=r[l];if(!Gr.includes(h))throw new Error(`The checksum algorithm "${h}" is not supported by the client.`+` Select one of ${Gr}.`);return h};var gr=(r)=>r===U.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var Lf=(r,s)=>{const l=r.toLowerCase();for(let f of Object.keys(s))if(l===f.toLowerCase())return!0;return!1};var wr=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!Zf(r);var vf=z(sg(),1),{__extends:y3,__assign:W3,__rest:K3,__decorate:V3,__param:L3,__esDecorate:Z3,__runInitializers:v3,__propKey:H3,__setFunctionName:J3,__metadata:X3,__awaiter:pr,__generator:ur,__exportStar:Q3,__createBinding:c3,__values:tr,__read:Y3,__spread:B3,__spreadArrays:O3,__spreadArray:q3,__await:_3,__asyncGenerator:j3,__asyncDelegator:i3,__asyncValues:b3,__makeTemplateObject:x3,__importStar:o3,__importDefault:n3,__classPrivateFieldGet:p3,__classPrivateFieldSet:u3,__classPrivateFieldIn:t3,__addDisposableResource:rS,__disposeResources:sS}=vf.default;import{Buffer as Hf} from"buffer";var Jf=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?Hf.from(r,s):Hf.from(r)};var ts=(r)=>{const s=Jf(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function yr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return lg(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var lg=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:ts;function Wr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function Kr(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}function Vr(r){if(!Uint32Array.from){var s=new Uint32Array(r.length),l=0;while(l<r.length)s[l]=r[l],l+=1;return s}return Uint32Array.from(r)}var rl=function(){function r(){this.crc32=new rr}return r.prototype.update=function(s){if(Wr(s))return;this.crc32.update(yr(s))},r.prototype.digest=function(){return pr(this,void 0,void 0,function(){return ur(this,function(s){return[2,Kr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new rr},r}();var rr=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var l,f;try{for(var e=tr(s),h=e.next();!h.done;h=e.next()){var m=h.value;this.checksum=this.checksum>>>8^eg[(this.checksum^m)&255]}}catch(a){l={error:a}}finally{try{if(h&&!h.done&&(f=e.return))f.call(e)}finally{if(l)throw l.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var fg=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],eg=Vr(fg);var ll=function(){function r(){this.crc32c=new sl}return r.prototype.update=function(s){if(Wr(s))return;this.crc32c.update(yr(s))},r.prototype.digest=function(){return pr(this,void 0,void 0,function(){return ur(this,function(s){return[2,Kr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new sl},r}();var sl=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var l,f;try{for(var e=tr(s),h=e.next();!h.done;h=e.next()){var m=h.value;this.checksum=this.checksum>>>8^ag[(this.checksum^m)&255]}}catch(a){l={error:a}}finally{try{if(h&&!h.done&&(f=e.return))f.call(e)}finally{if(l)throw l.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var hg=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697],ag=Vr(hg);var rs=(r,s)=>({[U.MD5]:s.md5,[U.CRC32]:rl,[U.CRC32C]:ll,[U.SHA1]:s.sha1,[U.SHA256]:s.sha256})[r];var ls=(r,s)=>{const l=new r;return l.update(ss(s||"")),l.digest()};var Xf={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},Qf=(r,s)=>(l,f)=>async(e)=>{if(!X.isInstance(e.request))return l(e);const{request:h}=e,{body:m,headers:a}=h,{base64Encoder:g,streamHasher:R}=r,{input:N,requestChecksumRequired:$,requestAlgorithmMember:D}=s,M=Vf(N,{requestChecksumRequired:$,requestAlgorithmMember:D},!!f.isS3ExpressBucket);let Q=m,B=a;if(M){const i=gr(M),Fr=rs(M,r);if(wr(m)){const{getAwsChunkedEncodingStream:ps,bodyLengthChecker:xm}=r;Q=ps(m,{base64Encoder:g,bodyLengthChecker:xm,checksumLocationName:i,checksumAlgorithmFn:Fr,streamHasher:R}),B={...a,"content-encoding":a["content-encoding"]?`${a["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":a["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":i},delete B["content-length"]}else if(!Lf(i,a)){const ps=await ls(Fr,m);B={...a,[i]:g(ps)}}}return await l({...e,request:{...h,headers:B,body:Q}})};var fs=(r=[])=>{const s=[];for(let l of Kf){if(!r.includes(l)||!Gr.includes(l))continue;s.push(l)}return s};var cf=(r)=>{const s=r.lastIndexOf("-");if(s!==-1){const l=r.slice(s+1);if(!l.startsWith("0")){const f=parseInt(l,10);if(!isNaN(f)&&f>=1&&f<=1e4)return!0}}return!1};import{Transform as mg} from"stream";function fl(r){const s=new mg;return s.push(r),s.push(null),s}var Yf=async(r,{streamHasher:s,checksumAlgorithmFn:l,base64Encoder:f})=>{const e=wr(r)?s(l,r):ls(l,r);return f(await e)};var Bf=async(r,{config:s,responseAlgorithms:l})=>{const f=fs(l),{body:e,headers:h}=r;for(let m of f){const a=gr(m),g=h[a];if(g){const R=rs(m,s),{streamHasher:N,base64Encoder:$}=s,D=await Yf(e,{streamHasher:N,checksumAlgorithmFn:R,base64Encoder:$});if(D===g)break;throw new Error(`Checksum mismatch: expected "${D}" but received "${g}"`+` in response header "${a}".`)}}};var Of={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},qf=(r,s)=>(l,f)=>async(e)=>{if(!X.isInstance(e.request))return l(e);const h=e.input,m=await l(e),a=m.response;let g=void 0;const{requestValidationModeMember:R,responseAlgorithms:N}=s;if(R&&h[R]==="ENABLED"){const{clientName:$,commandName:D}=f;if($==="S3Client"&&D==="GetObjectCommand"&&fs(N).every((B)=>{const ir=gr(B),i=a.headers[ir];return!i||cf(i)}))return m;const Q=wr(a.body);if(Q)g=await r.streamCollector(a.body),a.body=fl(g);if(await Bf(m.response,{config:r,responseAlgorithms:N}),Q&&g)a.body=fl(g)}return m};var es=(r,s)=>({applyToStack:(l)=>{l.add(Qf(r,s),Xf),l.addRelativeTo(qf(r,s),Of)}});var el=z(hl(),1);var _f=(r)=>({...r,requestChecksumCalculation:el.normalizeProvider(r.requestChecksumCalculation??or),responseChecksumValidation:el.normalizeProvider(r.responseChecksumValidation??nr)});function wg(){return(r,s)=>async(l)=>{const{request:f}=l;if(X.isInstance(f)){if(!(gg in f.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof hs))s.logger.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.");else console.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.")}return r({...l})}}var gg="content-length",dg={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},jf=(r)=>({applyToStack:(s)=>{s.add(wg(),dg)}});var bf=(r)=>{return(s,l)=>async(f)=>{const e=await r.region(),h=r.region;let m=()=>{};if(l.__s3RegionRedirect)Object.defineProperty(r,"region",{writable:!1,value:async()=>{return l.__s3RegionRedirect}}),m=()=>Object.defineProperty(r,"region",{writable:!0,value:h});try{const a=await s(f);if(l.__s3RegionRedirect){m();const g=await r.region();if(e!==g)throw new Error("Region was not restored following S3 region redirect.")}return a}catch(a){throw m(),a}}},xf={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function Sg(r){return(s,l)=>async(f)=>{try{return await s(f)}catch(e){if(r.followRegionRedirects&&e?.$metadata?.httpStatusCode===301){try{const h=e.$response.headers["x-amz-bucket-region"];l.logger?.debug(`Redirecting from ${await r.region()} to ${h}`),l.__s3RegionRedirect=h}catch(h){throw new Error("Region redirect failed: "+h)}return s(f)}else throw e}}}var Rg={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},of=(r)=>({applyToStack:(s)=>{s.add(Sg(r),Rg),s.addRelativeTo(bf(r),xf)}});var Ag=(r)=>{return(s,l)=>async(f)=>{const e=await s(f),{response:h}=e;if(as.isInstance(h)){if(h.headers.expires){h.headers.expiresstring=h.headers.expires;try{Lr(h.headers.expires)}catch(m){l.logger?.warn(`AWS SDK Warning for ${l.clientName}::${l.commandName} response parsing (${h.headers.expires}): ${m}`),delete h.headers.expires}}}return e}},Eg={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},nf=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Ag(r),Eg)}});class dr{constructor(r={}){this.data=r,this.lastPurgeTime=Date.now()}get(r){const s=this.data[r];if(!s)return;return s}set(r,s){return this.data[r]=s,s}delete(r){delete this.data[r]}async purgeExpired(){const r=Date.now();if(this.lastPurgeTime+dr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>r)return;for(let s in this.data){const l=this.data[s];if(!l.isRefreshing){const f=await l.identity;if(f.expiration){if(f.expiration.getTime()<r)delete this.data[s]}}}}}dr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class Sr{constructor(r,s=!1,l=Date.now()){this._identity=r,this.isRefreshing=s,this.accessed=l}get identity(){return this.accessed=Date.now(),this._identity}}class Rr{constructor(r,s=new dr){this.createSessionFn=r,this.cache=s}async getS3ExpressIdentity(r,s){const l=s.Bucket,{cache:f}=this,e=f.get(l);if(e)return e.identity.then((h)=>{if((h.expiration?.getTime()??0)<Date.now())return f.set(l,new Sr(this.getIdentity(l))).identity;if((h.expiration?.getTime()??0)<Date.now()+Rr.REFRESH_WINDOW_MS&&!e.isRefreshing)e.isRefreshing=!0,this.getIdentity(l).then((g)=>{f.set(l,new Sr(Promise.resolve(g)))});return h});return f.set(l,new Sr(this.getIdentity(l))).identity}async getIdentity(r){await this.cache.purgeExpired().catch((f)=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+f)});const s=await this.createSessionFn(r);if(!s.Credentials?.AccessKeyId||!s.Credentials?.SecretAccessKey)throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:s.Credentials.AccessKeyId,secretAccessKey:s.Credentials.SecretAccessKey,sessionToken:s.Credentials.SessionToken,expiration:s.Credentials.Expiration?new Date(s.Credentials.Expiration):void 0}}}Rr.REFRESH_WINDOW_MS=60000;var le=z(Pg(),1);var pf="Directory",uf="S3Express",tf="sigv4-s3express",ms="X-Amz-S3session-Token",Zr=ms.toLowerCase(),Ig="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",kg="s3_disable_express_session_auth",al={environmentVariableSelector:(r)=>sr(r,Ig,lr.ENV),configFileSelector:(r)=>sr(r,kg,lr.CONFIG),default:!1};var re=function(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}},se=function(r,s){const l=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),f=r.credentialProvider,e=()=>{return clearTimeout(l),r.credentialProvider=f,Promise.resolve(s)};r.credentialProvider=e};class gs extends le.SignatureV4{async signWithCredentials(r,s,l){const f=re(s);r.headers[Zr]=s.sessionToken;const e=this;return se(e,f),e.signRequest(r,l??{})}async presignWithCredentials(r,s,l){const f=re(s);return delete r.headers[Zr],r.headers[ms]=s.sessionToken,r.query=r.query??{},r.query[ms]=s.sessionToken,se(this,f),this.presign(r,l)}}var fe=(r)=>{return(s,l)=>async(f)=>{if(l.endpointV2){const e=l.endpointV2,h=e.properties?.authSchemes?.[0]?.name===tf;if(e.properties?.backend===uf||e.properties?.bucketType===pf)l.isS3ExpressBucket=!0;if(h){const a=f.input.Bucket;if(a){const g=await r.s3ExpressIdentityProvider.getS3ExpressIdentity(await r.credentials(),{Bucket:a});if(l.s3ExpressIdentity=g,X.isInstance(f.request)&&g.sessionToken)f.request.headers[Zr]=g.sessionToken}}}return s(f)}},ee={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},ml=(r)=>({applyToStack:(s)=>{s.add(fe(r),ee)}});var ae=z(gl(),1);var me=z(hl(),1);var he=async(r,s,l,f)=>{const e=await f.signWithCredentials(l,r,{});if(e.headers["X-Amz-Security-Token"]||e.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return e};var Ng=(r)=>(s)=>{throw s},$g=(r,s)=>{};var ge=(r)=>(s,l)=>async(f)=>{if(!X.isInstance(f.request))return s(f);const h=me.getSmithyContext(l).selectedHttpAuthScheme;if(!h)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:m={}},identity:a,signer:g}=h;let R;if(l.s3ExpressIdentity)R=await he(l.s3ExpressIdentity,m,f.request,await r.signer());else R=await g.sign(f.request,a,m);const N=await s({...f,request:R}).catch((g.errorHandler||Ng)(m));return(g.successHandler||$g)(N.response,m),N},wl=(r)=>({applyToStack:(s)=>{s.addRelativeTo(ge(r),ae.httpSigningMiddlewareOptions)}});var we=(r,{session:s})=>{const[l,f]=s;return{...r,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,followRegionRedirects:r.followRegionRedirects??!1,s3ExpressIdentityProvider:r.s3ExpressIdentityProvider??new Rr(async(e)=>l().send(new f({Bucket:e,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var ws=z(de(),1),Dg={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Ug=3000,Mg=(r)=>(s,l)=>async(f)=>{const e=await s(f),{response:h}=e;if(!as.isInstance(h))return e;const{statusCode:m,body:a}=h;if(m<200||m>=300)return e;if(!(typeof a?.stream==="function"||typeof a?.pipe==="function"||typeof a?.tee==="function"))return e;let R=a,N=a;if(a&&typeof a==="object"&&!(a instanceof Uint8Array))[R,N]=await ws.splitStream(a);h.body=N;const $=await Tg(R,{streamCollector:async(M)=>{return ws.headStream(M,Ug)}});if(typeof R?.destroy==="function")R.destroy();const D=r.utf8Encoder($.subarray($.length-16));if($.length===0&&Dg[l.commandName]){const M=new Error("S3 aborted request");throw M.name="InternalError",M}if(D&&D.endsWith("</Error>"))h.statusCode=400;return e},Tg=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},Cg={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},ds=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Mg(r),Cg)}});var dl=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function Se(r){return(s,l)=>async(f)=>{if(r.bucketEndpoint){const e=l.endpointV2;if(e){const h=f.input.Bucket;if(typeof h==="string")try{const m=new URL(h);l.endpointV2={...e,url:m}}catch(m){const a=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${h} could not be parsed as URL.`;if(l.logger?.constructor?.name==="NoOpLogger")console.warn(a);else l.logger?.warn?.(a);throw m}}}return s(f)}}var Re={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Fg({bucketEndpoint:r}){return(s)=>async(l)=>{const{input:{Bucket:f}}=l;if(!r&&typeof f==="string"&&!dl(f)&&f.indexOf("/")>=0){const e=new Error(`Bucket name shouldn't contain '/', received '${f}'`);throw e.name="InvalidBucketName",e}return s({...l})}}var zg={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},Ae=(r)=>({applyToStack:(s)=>{s.add(Fg(r),zg),s.addRelativeTo(Se(r),Re)}});var Cr=z(gl(),1);var Ee=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var Ds=z($s(),1);var Ss={CrtSignerV4:null};class Sl{constructor(r){this.sigv4Signer=new gs(r),this.signerOptions=r}async sign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().sign(r,s)}return this.sigv4Signer.sign(r,s)}async signWithCredentials(r,s,l={}){if(l.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().signWithCredentials(r,s,l)}return this.sigv4Signer.signWithCredentials(r,s,l)}async presign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().presign(r,s)}return this.sigv4Signer.presign(r,s)}async presignWithCredentials(r,s,l={}){if(l.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(r,s,l)}getSigv4aSigner(){if(!this.sigv4aSigner){let r=null;try{if(r=Ss.CrtSignerV4,typeof r!=="function")throw new Error}catch(s){throw s.message=`${s.message}\n`+'Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. \nYou must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. \nFor more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt',s}this.sigv4aSigner=new r({...this.signerOptions,signingAlgorithm:1})}return this.sigv4aSigner}}var Jr=z(hl(),1);var Ar={["required"]:!1,["type"]:"String"},Er={["required"]:!0,default:!1,["type"]:"Boolean"},vr={["required"]:!1,["type"]:"Boolean"},O={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},P={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},k={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},C={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},hh={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},Ie={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},ks={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},Z={["ref"]:"Bucket"},L={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},Is={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},ah={["ref"]:"url"},mh={["fn"]:"uriEncode",["argv"]:[Z],["assign"]:"uri_encoded_bucket"},b={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},w={},gh={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Z,!1]},Rl={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},Ps={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},ke={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},Pe={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},d={["fn"]:"not",["argv"]:[C]},Ne={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},$e={["fn"]:"not",["argv"]:[ks]},De={["ref"]:"hardwareType"},Ue={["conditions"]:[d],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},Rs={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},Al={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},Gg={["ref"]:"ForcePathStyle"},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},G={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},W={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},E={["fn"]:"not",["argv"]:[G]},K={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},Me={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},F={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},V={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},A={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},Te={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},S={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},Ce={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Fe={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},El={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[ah,"isIp"]},!1]},Il={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:F,["headers"]:{}},Hl={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:F,["headers"]:{}},ze={["endpoint"]:Hl,["type"]:"endpoint"},kl={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Ge={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},As={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},J={["ref"]:"bucketArn"},wh={["ref"]:"arnType"},Pl={["fn"]:"getAttr",["argv"]:[J,"service"]},Jl={["ref"]:"accessPointName"},ye={["conditions"]:[k],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},We={["conditions"]:[O],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},Ke={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},Nl={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},dh={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},Sh={["fn"]:"getAttr",["argv"]:[J,"accountId"]},$l={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},Ve={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},Dl={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},Ul={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},Ml={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},Le={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},Ze={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Hr={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},ve={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},He={["fn"]:"aws.parseArn",["argv"]:[Z]},Je={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Xe={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Qe={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Tl={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},ce={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Ye={["ref"]:"UseObjectLambdaEndpoint"},Cl={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},Be={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Oe={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},qe={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Fl={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:F,["headers"]:{}},_e={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},zl=[{["ref"]:"Region"}],yg=[{["ref"]:"Endpoint"}],Wg=[Z],Gl=[k],Es=[O],fr=[C,L],je=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],ie=[Is],yl=[mh],Wl=[gh],Ir=[P],be=[{["fn"]:"substring",["argv"]:[Z,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Z,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],xe=[{["conditions"]:[P],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:b,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:b,["headers"]:{}},["type"]:"endpoint"}],oe=[{["fn"]:"substring",["argv"]:[Z,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Z,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],ne=[{["conditions"]:[P],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:Ps,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:Ps,["headers"]:{}},["type"]:"endpoint"}],Kg=[ks],pe=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],ue=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],Vg=["*"],o=[hh],te=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],n=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],Kl=[{["fn"]:"stringEquals",["argv"]:[wh,"accesspoint"]}],rh=[{["fn"]:"getAttr",["argv"]:[J,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[Jl,""]}]}],Lg=[J,"resourceId[1]"],Vl=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},""]}]}],sh=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[2]"]}]}]}],Zg=[J,"resourceId[2]"],Ll=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]}],["assign"]:"bucketPartition"}],lh=[{["fn"]:"stringEquals",["argv"]:[dh,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],Zl=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},!0]}],vl=[{["fn"]:"isValidHostLabel",["argv"]:[Sh,!1]}],fh=[{["fn"]:"isValidHostLabel",["argv"]:[Jl,!1]}],eh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],vg={version:"1.0",parameters:{Bucket:Ar,Region:Ar,UseFIPS:Er,UseDualStack:Er,Endpoint:Ar,ForcePathStyle:Er,Accelerate:Er,UseGlobalEndpoint:Er,UseObjectLambdaEndpoint:vr,Key:Ar,Prefix:Ar,CopySource:Ar,DisableAccessPoints:vr,DisableMultiRegionAccessPoints:Er,UseArnRegion:vr,UseS3ExpressControlEndpoint:vr,DisableS3ExpressSessionAuth:vr},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:zl}],rules:[{["conditions"]:[O,P],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[k,C],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[C,P],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[C,O],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[P,hh,Ie],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[ks,{["fn"]:"substring",["argv"]:[Z,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:Gl,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:Es,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:fr,rules:[{["conditions"]:je,rules:[{["conditions"]:ie,rules:[{["conditions"]:yl,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:b,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Wl,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:b,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Rl],["type"]:"tree"},{["conditions"]:ie,rules:[{["conditions"]:yl,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:Ps,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Wl,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:Ps,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Rl],["type"]:"tree"},{["conditions"]:[ke,Pe],rules:[{["conditions"]:[mh,d],rules:[{["conditions"]:Ir,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:b,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:b,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Wl,rules:[{["conditions"]:je,rules:[{["conditions"]:be,rules:xe,["type"]:"tree"},{["conditions"]:oe,rules:xe,["type"]:"tree"},Ne],["type"]:"tree"},{["conditions"]:be,rules:ne,["type"]:"tree"},{["conditions"]:oe,rules:ne,["type"]:"tree"},Ne],["type"]:"tree"},Rl],["type"]:"tree"},{["conditions"]:[$e,ke,Pe],rules:[{["conditions"]:fr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:b,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Ir,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com",["properties"]:b,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com",["properties"]:b,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[ks,{["fn"]:"substring",["argv"]:[Z,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[Z,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:[Z,0,7,!0],["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[Z,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:zl,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:pe,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[De,"e"]}],rules:[{["conditions"]:ue,rules:[Ue,{["conditions"]:fr,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:Rs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Rs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[De,"o"]}],rules:[{["conditions"]:ue,rules:[Ue,{["conditions"]:fr,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:Rs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Rs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Unrecognized hardware type: \"Expected hardware type o or e but got {hardwareType}\"",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",["type"]:"error"}],["type"]:"tree"},{["conditions"]:Kg,rules:[{["conditions"]:[C,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:yg}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[Al,gh],rules:[{["conditions"]:o,rules:[{["conditions"]:te,rules:[{["conditions"]:[O,Ie],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[k,P,T,d,G],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,P,T,d,E,K],rules:[{endpoint:Me,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,P,T,d,E,V],endpoint:Me,["type"]:"endpoint"},{["conditions"]:[A,P,T,d,G],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,P,T,d,E,K],rules:[{endpoint:Te,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,P,T,d,E,V],endpoint:Te,["type"]:"endpoint"},{["conditions"]:[k,S,O,d,G],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,S,O,d,E,K],rules:[{endpoint:Ce,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,S,O,d,E,V],endpoint:Ce,["type"]:"endpoint"},{["conditions"]:[k,S,T,d,G],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,S,T,d,E,K],rules:[{endpoint:Fe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,S,T,d,E,V],endpoint:Fe,["type"]:"endpoint"},{["conditions"]:[A,S,T,C,L,Is,G],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,T,C,L,El,G],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,T,C,L,Is,E,K],rules:[{["conditions"]:n,endpoint:Il,["type"]:"endpoint"},{endpoint:Il,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,S,T,C,L,El,E,K],rules:[{["conditions"]:n,endpoint:Hl,["type"]:"endpoint"},ze],["type"]:"tree"},{["conditions"]:[A,S,T,C,L,Is,E,V],endpoint:Il,["type"]:"endpoint"},{["conditions"]:[A,S,T,C,L,El,E,V],endpoint:Hl,["type"]:"endpoint"},{["conditions"]:[A,S,O,d,G],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,O,d,E,K],rules:[{["conditions"]:n,endpoint:kl,["type"]:"endpoint"},{endpoint:kl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,S,O,d,E,V],endpoint:kl,["type"]:"endpoint"},{["conditions"]:[A,S,T,d,G],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,T,d,E,K],rules:[{["conditions"]:n,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:w},["type"]:"endpoint"},{endpoint:Ge,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,S,T,d,E,V],endpoint:Ge,["type"]:"endpoint"}],["type"]:"tree"},As],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[C,L,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[ah,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Z,!0]},Al,S,A,T],rules:[{["conditions"]:o,rules:[{["conditions"]:te,rules:[ze],["type"]:"tree"},As],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Al,{["fn"]:"aws.parseArn",["argv"]:Wg,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[wh,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Pl,"s3-object-lambda"]}],rules:[{["conditions"]:Kl,rules:[{["conditions"]:rh,rules:[ye,We,{["conditions"]:Vl,rules:[Ke,{["conditions"]:sh,rules:[Nl,{["conditions"]:Ll,rules:[{["conditions"]:o,rules:[{["conditions"]:lh,rules:[{["conditions"]:Zl,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Sh,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:vl,rules:[{["conditions"]:fh,rules:[{["conditions"]:fr,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:$l,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Ir,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:$l,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:$l,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Ve],["type"]:"tree"},Dl],["type"]:"tree"},Ul],["type"]:"tree"},Ml],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Le],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},Ze],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:Kl,rules:[{["conditions"]:rh,rules:[{["conditions"]:Vl,rules:[{["conditions"]:Kl,rules:[{["conditions"]:Vl,rules:[Ke,{["conditions"]:sh,rules:[Nl,{["conditions"]:Ll,rules:[{["conditions"]:o,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[dh,"{partitionResult#name}"]}],rules:[{["conditions"]:Zl,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Pl,"s3"]}],rules:[{["conditions"]:vl,rules:[{["conditions"]:fh,rules:[{["conditions"]:Es,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:[P,k],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[P,A],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,k],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A,C,L],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Ve],["type"]:"tree"},Dl],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},Ul],["type"]:"tree"},Ml],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Le],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[Jl,!0]}],rules:[{["conditions"]:Gl,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:Ir,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:Es,error:"S3 MRAP does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableMultiRegionAccessPoints"},!0]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",["type"]:"error"},{["conditions"]:[{["fn"]:"aws.partition",["argv"]:zl,["assign"]:"mrapPartition"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[J,"partition"]}]}],rules:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:Vg}]},["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Access Point Name",["type"]:"error"}],["type"]:"tree"},Ze],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Pl,"s3-outposts"]}],rules:[{["conditions"]:Gl,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:Ir,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:Es,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:Lg,["assign"]:"outpostId"}],rules:[{["conditions"]:pe,rules:[Nl,{["conditions"]:Ll,rules:[{["conditions"]:o,rules:[{["conditions"]:lh,rules:[{["conditions"]:Zl,rules:[{["conditions"]:vl,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:Zg,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:fr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:ve,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:ve,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Expected an outpost type `accesspoint`, found {outpostType}",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: expected an access point name",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Expected a 4-component resource",["type"]:"error"}],["type"]:"tree"},Dl],["type"]:"tree"},Ul],["type"]:"tree"},Ml],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The Outpost Id was not set",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: No ARN type specified",["type"]:"error"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"substring",["argv"]:[Z,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[He]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[Gg,!0]},He],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:yl,rules:[{["conditions"]:o,rules:[{["conditions"]:[T],rules:[{["conditions"]:[k,d,P,G],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,d,P,E,K],rules:[{endpoint:Je,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,d,P,E,V],endpoint:Je,["type"]:"endpoint"},{["conditions"]:[A,d,P,G],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,d,P,E,K],rules:[{endpoint:Xe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,d,P,E,V],endpoint:Xe,["type"]:"endpoint"},{["conditions"]:[k,d,S,G],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,d,S,E,K],rules:[{endpoint:Qe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,d,S,E,V],endpoint:Qe,["type"]:"endpoint"},{["conditions"]:[A,C,L,S,G],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,C,L,S,E,K],rules:[{["conditions"]:n,endpoint:Tl,["type"]:"endpoint"},{endpoint:Tl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,C,L,S,E,V],endpoint:Tl,["type"]:"endpoint"},{["conditions"]:[A,d,S,G],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,d,S,E,K],rules:[{["conditions"]:n,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:w},["type"]:"endpoint"},{endpoint:ce,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,d,S,E,V],endpoint:ce,["type"]:"endpoint"}],["type"]:"tree"},{error:"Path-style addressing cannot be used with S3 Accelerate",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[Ye]},{["fn"]:"booleanEquals",["argv"]:[Ye,!0]}],rules:[{["conditions"]:o,rules:[{["conditions"]:eh,rules:[ye,We,{["conditions"]:fr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:Cl,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Ir,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:Cl,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:Cl,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},As],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[$e],rules:[{["conditions"]:o,rules:[{["conditions"]:eh,rules:[{["conditions"]:[P,k,d,G],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[P,k,d,E,K],rules:[{endpoint:Be,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[P,k,d,E,V],endpoint:Be,["type"]:"endpoint"},{["conditions"]:[P,A,d,G],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[P,A,d,E,K],rules:[{endpoint:Oe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[P,A,d,E,V],endpoint:Oe,["type"]:"endpoint"},{["conditions"]:[S,k,d,G],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,k,d,E,K],rules:[{endpoint:qe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,k,d,E,V],endpoint:qe,["type"]:"endpoint"},{["conditions"]:[S,A,C,L,G],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A,C,L,E,K],rules:[{["conditions"]:n,endpoint:Fl,["type"]:"endpoint"},{endpoint:Fl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,A,C,L,E,V],endpoint:Fl,["type"]:"endpoint"},{["conditions"]:[S,A,d,G],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:W,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A,d,E,K],rules:[{["conditions"]:n,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:w},["type"]:"endpoint"},{endpoint:_e,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,A,d,E,V],endpoint:_e,["type"]:"endpoint"}],["type"]:"tree"},As],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},Rh=vg;var Hg=new Ah({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),Ns=(r,s={})=>{return Hg.get(r,()=>Ih(Rh,{endpointParams:r,logger:s.logger}))};Eh.aws=kh;var $h=function(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,l)=>({signingProperties:{config:s,context:l}})}},Dh=function(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,l)=>({signingProperties:{config:s,context:l}})}},Jg=(r)=>async(s,l,f)=>{if(!f)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const e=await r(s,l,f),h=Jr.getSmithyContext(l)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!h)throw new Error(`getEndpointParameterInstructions() is not defined on \`${l.commandName}\``);const m=await Ph(f,{getEndpointParameterInstructions:h},s);return Object.assign(e,m)},Xg=async(r,s,l)=>{return{operation:Jr.getSmithyContext(s).operation,region:await Jr.normalizeProvider(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Nh=Jg(Xg),Qg=(r,s,l)=>{return(e)=>{const m=r(e).properties?.authSchemes;if(!m)return s(e);const a=[];for(let g of m){const{name:R,properties:N={},...$}=g,D=R.toLowerCase();if(R!==D)console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${R}\` to \`${D}\``);let M;if(D==="sigv4a"){M="aws.auth#sigv4a";const ir=m.find((i)=>{const Fr=i.name.toLowerCase();return Fr!=="sigv4a"&&Fr.startsWith("sigv4")});if(!Ss.CrtSignerV4&&ir)continue}else if(D.startsWith("sigv4"))M="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${D}\``);const Q=l[M];if(!Q)throw new Error(`Could not find HttpAuthOption create function for \`${M}\``);const B=Q(e);B.schemeId=M,B.signingProperties={...B.signingProperties||{},...$,...N},a.push(B)}return a}},cg=(r)=>{const s=[];switch(r.operation){default:s.push($h(r)),s.push(Dh(r))}return s},Uh=Qg(Ns,cg,{"aws.auth#sigv4":$h,"aws.auth#sigv4a":Dh}),Mh=(r)=>{const s=Ds.resolveAwsSdkSigV4Config(r);return{...Ds.resolveAwsSdkSigV4AConfig(s)}};var Th=(r)=>{return{...r,useFipsEndpoint:r.useFipsEndpoint??!1,useDualstackEndpoint:r.useDualstackEndpoint??!1,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,useGlobalEndpoint:r.useGlobalEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,defaultSigningName:"s3"}},kr={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class v extends Ch{constructor(r){super(r);Object.setPrototypeOf(this,v.prototype)}}class Us extends v{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,Us.prototype)}}class Ms extends v{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Ms.prototype)}}class Ts extends v{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,Ts.prototype)}}class Cs extends v{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,Cs.prototype)}}class Fs extends v{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,Fs.prototype)}}var Xl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Xl||(Xl={}));var Ql;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.ObjectSizeGreaterThan!==void 0)return l.ObjectSizeGreaterThan(s.ObjectSizeGreaterThan);if(s.ObjectSizeLessThan!==void 0)return l.ObjectSizeLessThan(s.ObjectSizeLessThan);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Ql||(Ql={}));var cl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.AccessPointArn!==void 0)return l.AccessPointArn(s.AccessPointArn);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(cl||(cl={}));var Yl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Yl||(Yl={}));class zs extends v{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,zs.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class Gs extends v{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,Gs.prototype)}}class ys extends v{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,ys.prototype)}}var Yg=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:H},...r.SessionToken&&{SessionToken:H}}),Fh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:H},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:H},...r.Credentials&&{Credentials:Yg(r.Credentials)}}),zh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:H},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:H}});var Gh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:H}}),yh=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:H}});var $r=z($s(),1);var Vs=z(gl(),1);class Ws extends v{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Ws.prototype)}}var Wh;(function(r){r.visit=(s,l)=>{if(s.Records!==void 0)return l.Records(s.Records);if(s.Stats!==void 0)return l.Stats(s.Stats);if(s.Progress!==void 0)return l.Progress(s.Progress);if(s.Cont!==void 0)return l.Cont(s.Cont);if(s.End!==void 0)return l.End(s.End);return l._(s.$unknown[0],s.$unknown[1])}})(Wh||(Wh={}));var Kh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:H},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:H}}),Vh=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:H},...r.SSEKMSKeyId&&{SSEKMSKeyId:H},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:H}});var _h=async(r,s)=>{const l=Vs.requestBuilder(r,s),f=y({},_,{[bw]:r[Fw],[qr]:r[Br],[_r]:r[Or],[Hs]:r[vs],[p]:[()=>_(r[er]),()=>r[er].toString()]});l.bp("/"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const e=y({[qw]:[,""]});let h;return l.m("GET").h(f).q(e).b(h),l.build()};var jh=async(r,s)=>{const l=Vs.requestBuilder(r,s),f=y({},_,{[Lw]:r[Sw],[Zw]:[()=>_(r[Lh]),()=>Xr(r[Lh]).toString()],[ka]:r[fa],[vw]:[()=>_(r[Zh]),()=>Xr(r[Zh]).toString()],[Jw]:r[kw],[Js]:r[Ls],[Ca]:r[ga],[Xs]:r[Zs],[Ma]:r[ma],[Na]:r[sa],[iw]:r[lw]});l.bp("/{Key+}"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1),l.p("Key",()=>r.Key,"{Key+}",!0);const e=y({[Ga]:[,"GetObject"],[Xw]:[,r[Pw]],[Qw]:[,r[Nw]],[cw]:[,r[$w]],[Yw]:[,r[Dw]],[Bw]:[,r[Uw]],[Ow]:[()=>r.ResponseExpires!==void 0,()=>Xr(r[Mw]).toString()],[_w]:[,r[ef]],[Hw]:[()=>r.PartNumber!==void 0,()=>r[Iw].toString()]});let h;return l.m("GET").h(f).q(e).b(h),l.build()};var ih=async(r,s)=>{const l=Vs.requestBuilder(r,s),f=y({},_,{[Ea]:r[ra]||"application/octet-stream",[jw]:r[tg],[da]:r[nh],[Sa]:r[ph],[Ra]:r[uh],[Aa]:r[th],[ol]:[()=>_(r[il]),()=>r[il].toString()],[Ww]:r[fw],[rd]:r[sw],[hf]:r[rf],[af]:r[sf],[mf]:r[lf],[gf]:r[ff],[nl]:[()=>_(r[bl]),()=>Xr(r[bl]).toString()],[ka]:r[fa],[xw]:r[mw],[ow]:r[gw],[nw]:r[ww],[pw]:r[dw],[qr]:r[Br],[Ta]:r[cr],[za]:r[wa],[Js]:r[Ls],[Ca]:r[ga],[Xs]:r[Zs],[_r]:r[Or],[Hs]:r[vs],[p]:[()=>_(r[er]),()=>r[er].toString()],[Ma]:r[ma],[sd]:r[zw],[Da]:r[ha],[pl]:[()=>_(r[xl]),()=>qh(r[xl]).toString()],[$a]:r[ea],[Na]:r[sa],...r.Metadata!==void 0&&Object.keys(r.Metadata).reduce((a,g)=>{return a[`x-amz-meta-${g.toLowerCase()}`]=r.Metadata[g],a},{})});l.bp("/{Key+}"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1),l.p("Key",()=>r.Key,"{Key+}",!0);const e=y({[Ga]:[,"PutObject"]});let h,m;if(r.Body!==void 0)m=r.Body,h=m;return l.m("PUT").h(f).q(e).b(h),l.build()};var bh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return tl(r,s);const l=y({$metadata:Y(r),[Br]:[,r.headers[qr]],[Or]:[,r.headers[_r]],[vs]:[,r.headers[Hs]],[er]:[()=>r.headers[p]!==void 0,()=>Yr(r.headers[p])]}),f=Pr(Yh(await $r.parseXmlBody(r.body,s)),"body");if(f[ql]!=null)l[ql]=ug(f[ql],s);return l};var xh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return tl(r,s);const l=y({$metadata:Y(r),[hw]:[()=>r.headers[Hh]!==void 0,()=>Yr(r.headers[Hh])],[rw]:[,r.headers[yw]],[Qr]:[,r.headers[Pa]],[Cw]:[,r.headers[uw]],[Rw]:[()=>r.headers[vh]!==void 0,()=>Pr(Lr(r.headers[vh]))],[il]:[()=>r.headers[ol]!==void 0,()=>Bh(r.headers[ol])],[la]:[,r.headers[Ia]],[rf]:[,r.headers[hf]],[sf]:[,r.headers[af]],[lf]:[,r.headers[mf]],[ff]:[,r.headers[gf]],[Aw]:[()=>r.headers[Jh]!==void 0,()=>Ks(r.headers[Jh])],[ef]:[,r.headers[Fa]],[nh]:[,r.headers[da]],[ph]:[,r.headers[Sa]],[uh]:[,r.headers[Ra]],[th]:[,r.headers[Aa]],[ew]:[,r.headers[Kw]],[ra]:[,r.headers[Ea]],[bl]:[()=>r.headers[nl]!==void 0,()=>Pr(Lr(r.headers[nl]))],[aw]:[,r.headers[Vw]],[wa]:[,r.headers[za]],[Br]:[,r.headers[qr]],[Ls]:[,r.headers[Js]],[Zs]:[,r.headers[Xs]],[Or]:[,r.headers[_r]],[er]:[()=>r.headers[p]!==void 0,()=>Yr(r.headers[p])],[cr]:[,r.headers[Ta]],[aa]:[,r.headers[Ua]],[Tw]:[,r.headers[tw]],[Ew]:[()=>r.headers[Xh]!==void 0,()=>Ks(r.headers[Xh])],[Gw]:[()=>r.headers[Qh]!==void 0,()=>Ks(r.headers[Qh])],[ha]:[,r.headers[Da]],[xl]:[()=>r.headers[pl]!==void 0,()=>Pr(ul(r.headers[pl]))],[ea]:[,r.headers[$a]],Metadata:[,Object.keys(r.headers).filter((e)=>e.startsWith("x-amz-meta-")).reduce((e,h)=>{return e[h.substring(11)]=r.headers[h],e},{})]}),f=r.body;return s.sdkStreamMixin(f),l.Body=f,l};var oh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return tl(r,s);const l=y({$metadata:Y(r),[Qr]:[,r.headers[Pa]],[la]:[,r.headers[Ia]],[rf]:[,r.headers[hf]],[sf]:[,r.headers[af]],[lf]:[,r.headers[mf]],[ff]:[,r.headers[gf]],[Br]:[,r.headers[qr]],[ef]:[,r.headers[Fa]],[Ls]:[,r.headers[Js]],[Zs]:[,r.headers[Xs]],[Or]:[,r.headers[_r]],[vs]:[,r.headers[Hs]],[er]:[()=>r.headers[p]!==void 0,()=>Yr(r.headers[p])],[aa]:[,r.headers[Ua]]});return await ch(r.body,s),l};var tl=async(r,s)=>{const l={...r,body:await $r.parseXmlErrorBody(r.body,s)},f=$r.loadRestXmlErrorCode(r,l.body);switch(f){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await xg(l,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await pg(l,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await qg(l,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await _g(l,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await ig(l,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await jg(l,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await bg(l,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await og(l,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await ng(l,s);default:const e=l.body;return Og({output:r,parsedBody:e,errorCode:f})}},Og=Oh(v),qg=async(r,s)=>{const l=y({}),f=r.body,e=new Ts({$metadata:Y(r),...l});return j(e,r.body)},_g=async(r,s)=>{const l=y({}),f=r.body,e=new Cs({$metadata:Y(r),...l});return j(e,r.body)},jg=async(r,s)=>{const l=y({}),f=r.body;if(f[Ol]!=null)l[Ol]=Nr(f[Ol]);if(f[cr]!=null)l[cr]=Nr(f[cr]);const e=new zs({$metadata:Y(r),...l});return j(e,r.body)},ig=async(r,s)=>{const l=y({}),f=r.body,e=new Fs({$metadata:Y(r),...l});return j(e,r.body)},bg=async(r,s)=>{const l=y({}),f=r.body,e=new Gs({$metadata:Y(r),...l});return j(e,r.body)},xg=async(r,s)=>{const l=y({}),f=r.body,e=new Us({$metadata:Y(r),...l});return j(e,r.body)},og=async(r,s)=>{const l=y({}),f=r.body,e=new ys({$metadata:Y(r),...l});return j(e,r.body)},ng=async(r,s)=>{const l=y({}),f=r.body,e=new Ws({$metadata:Y(r),...l});return j(e,r.body)},pg=async(r,s)=>{const l=y({}),f=r.body,e=new Ms({$metadata:Y(r),...l});return j(e,r.body)};var ug=(r,s)=>{const l={};if(r[Bl]!=null)l[Bl]=Nr(r[Bl]);if(r[_l]!=null)l[_l]=Nr(r[_l]);if(r[jl]!=null)l[jl]=Nr(r[jl]);if(r[Qr]!=null)l[Qr]=Pr(ul(r[Qr]));return l};var Y=(r)=>({httpStatusCode:r.statusCode,requestId:r.headers["x-amzn-requestid"]??r.headers["x-amzn-request-id"]??r.headers["x-amz-request-id"],extendedRequestId:r.headers["x-amz-id-2"],cfId:r.headers["x-amz-cf-id"]});var _=(r)=>r!==void 0&&r!==null&&r!==""&&(!Object.getOwnPropertyNames(r).includes("length")||r.length!=0)&&(!Object.getOwnPropertyNames(r).includes("size")||r.size!=0);var tg="ACL";var Bl="AccessKeyId";var rw="AcceptRanges";var Ol="AccessTier";var er="BucketKeyEnabled";var ql="Credentials",sw="ChecksumAlgorithm";var nh="CacheControl",rf="ChecksumCRC32",sf="ChecksumCRC32C",ph="ContentDisposition";var uh="ContentEncoding";var th="ContentLanguage",il="ContentLength",lw="ChecksumMode",fw="ContentMD5";var ew="ContentRange";var lf="ChecksumSHA1",ff="ChecksumSHA256";var ra="ContentType";var hw="DeleteMarker";var bl="Expires";var sa="ExpectedBucketOwner";var aw="ExpiresString";var la="ETag";var Qr="Expiration";var mw="GrantFullControl";var gw="GrantRead",ww="GrantReadACP";var dw="GrantWriteACP";var Sw="IfMatch",Lh="IfModifiedSince",fa="IfNoneMatch";var Zh="IfUnmodifiedSince";var Rw="LastModified";var Aw="MissingMeta";var ea="ObjectLockLegalHoldStatus",ha="ObjectLockMode";var xl="ObjectLockRetainUntilDate";var Ew="PartsCount";var Iw="PartNumber";var kw="Range";var aa="RequestCharged",Pw="ResponseCacheControl",Nw="ResponseContentDisposition",$w="ResponseContentEncoding",Dw="ResponseContentLanguage",Uw="ResponseContentType";var Mw="ResponseExpires";var ma="RequestPayer";var Tw="ReplicationStatus";var Cw="Restore";var _l="SecretAccessKey";var cr="StorageClass";var Fw="SessionMode";var Br="ServerSideEncryption";var Ls="SSECustomerAlgorithm",ga="SSECustomerKey",Zs="SSECustomerKeyMD5";var vs="SSEKMSEncryptionContext",Or="SSEKMSKeyId";var jl="SessionToken";var zw="Tagging";var Gw="TagCount";var ef="VersionId";var wa="WebsiteRedirectLocation";var yw="accept-ranges";var da="cache-control",Sa="content-disposition",Ra="content-encoding",Aa="content-language",ol="content-length",Ww="content-md5",Kw="content-range",Ea="content-type";var nl="expires";var Ia="etag",Vw="expiresstring";var Lw="if-match",Zw="if-modified-since";var ka="if-none-match";var vw="if-unmodified-since";var vh="last-modified";var Hw="partNumber";var Jw="range",Xw="response-cache-control",Qw="response-content-disposition",cw="response-content-encoding",Yw="response-content-language",Bw="response-content-type",Ow="response-expires";var qw="session";var _w="versionId";var jw="x-amz-acl";var hf="x-amz-checksum-crc32",af="x-amz-checksum-crc32c",iw="x-amz-checksum-mode";var mf="x-amz-checksum-sha1",gf="x-amz-checksum-sha256";var bw="x-amz-create-session-mode";var Hh="x-amz-delete-marker",Pa="x-amz-expiration",Na="x-amz-expected-bucket-owner";var xw="x-amz-grant-full-control",ow="x-amz-grant-read",nw="x-amz-grant-read-acp";var pw="x-amz-grant-write-acp";var Jh="x-amz-missing-meta";var Xh="x-amz-mp-parts-count";var $a="x-amz-object-lock-legal-hold",Da="x-amz-object-lock-mode",pl="x-amz-object-lock-retain-until-date";var uw="x-amz-restore",Ua="x-amz-request-charged";var Ma="x-amz-request-payer";var tw="x-amz-replication-status";var Ta="x-amz-storage-class",rd="x-amz-sdk-checksum-algorithm";var qr="x-amz-server-side-encryption",_r="x-amz-server-side-encryption-aws-kms-key-id",p="x-amz-server-side-encryption-bucket-key-enabled",Hs="x-amz-server-side-encryption-context",Js="x-amz-server-side-encryption-customer-algorithm",Ca="x-amz-server-side-encryption-customer-key",Xs="x-amz-server-side-encryption-customer-key-md5",sd="x-amz-tagging",Qh="x-amz-tagging-count";var Fa="x-amz-version-id",za="x-amz-website-redirect-location",Ga="x-id";class wf extends Dr.classBuilder().ep({...kr,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,l,f){return[Ur(l,this.serialize,this.deserialize),Mr(l,r.getEndpointParameterInstructions()),ds(l)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(zh,Fh).ser(_h).de(bh).build(){}var ya={name:"@aws-sdk/client-s3",description:"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",version:"3.654.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3",test:"yarn test:unit","test:e2e":"yarn test:e2e:node && yarn test:e2e:browser","test:e2e:browser":"ts-mocha test/**/*.browser.ispec.ts && karma start karma.conf.js","test:e2e:node":"jest --c jest.config.e2e.js","test:unit":"ts-mocha test/unit/**/*.spec.ts"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha1-browser":"5.2.0","@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.654.0","@aws-sdk/client-sts":"3.654.0","@aws-sdk/core":"3.654.0","@aws-sdk/credential-provider-node":"3.654.0","@aws-sdk/middleware-bucket-endpoint":"3.654.0","@aws-sdk/middleware-expect-continue":"3.654.0","@aws-sdk/middleware-flexible-checksums":"3.654.0","@aws-sdk/middleware-host-header":"3.654.0","@aws-sdk/middleware-location-constraint":"3.654.0","@aws-sdk/middleware-logger":"3.654.0","@aws-sdk/middleware-recursion-detection":"3.654.0","@aws-sdk/middleware-sdk-s3":"3.654.0","@aws-sdk/middleware-ssec":"3.654.0","@aws-sdk/middleware-user-agent":"3.654.0","@aws-sdk/region-config-resolver":"3.654.0","@aws-sdk/signature-v4-multi-region":"3.654.0","@aws-sdk/types":"3.654.0","@aws-sdk/util-endpoints":"3.654.0","@aws-sdk/util-user-agent-browser":"3.654.0","@aws-sdk/util-user-agent-node":"3.654.0","@aws-sdk/xml-builder":"3.654.0","@smithy/config-resolver":"^3.0.8","@smithy/core":"^2.4.3","@smithy/eventstream-serde-browser":"^3.0.9","@smithy/eventstream-serde-config-resolver":"^3.0.6","@smithy/eventstream-serde-node":"^3.0.8","@smithy/fetch-http-handler":"^3.2.7","@smithy/hash-blob-browser":"^3.1.5","@smithy/hash-node":"^3.0.6","@smithy/hash-stream-node":"^3.1.5","@smithy/invalid-dependency":"^3.0.6","@smithy/md5-js":"^3.0.6","@smithy/middleware-content-length":"^3.0.8","@smithy/middleware-endpoint":"^3.1.3","@smithy/middleware-retry":"^3.0.18","@smithy/middleware-serde":"^3.0.6","@smithy/middleware-stack":"^3.0.6","@smithy/node-config-provider":"^3.1.7","@smithy/node-http-handler":"^3.2.2","@smithy/protocol-http":"^4.1.3","@smithy/smithy-client":"^3.3.2","@smithy/types":"^3.4.2","@smithy/url-parser":"^3.0.6","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.18","@smithy/util-defaults-mode-node":"^3.0.18","@smithy/util-endpoints":"^2.1.2","@smithy/util-middleware":"^3.0.6","@smithy/util-retry":"^3.0.6","@smithy/util-stream":"^3.1.6","@smithy/util-utf8":"^3.0.0","@smithy/util-waiter":"^3.1.5",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/signature-v4-crt":"3.654.0","@tsconfig/node16":"16.1.3","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-s3"}};var qs=z($s(),1);var fd="AWS_S3_USE_ARN_REGION",ed="s3_use_arn_region",Wa={environmentVariableSelector:(r)=>sr(r,fd,lr.ENV),configFileSelector:(r)=>sr(r,ed,lr.CONFIG),default:!1};var u=z(Va(),1);var La=z(Va(),1),Ka=function(r){for(let s=0;s<8;s++)r[s]^=255;for(let s=7;s>-1;s--)if(r[s]++,r[s]!==0)break};class Tr{constructor(r){if(this.bytes=r,r.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(r){if(r>9223372036854776000||r<-9223372036854776000)throw new Error(`${r} is too large (or, if negative, too small) to represent as an Int64`);const s=new Uint8Array(8);for(let l=7,f=Math.abs(Math.round(r));l>-1&&f>0;l--,f/=256)s[l]=f;if(r<0)Ka(s);return new Tr(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)Ka(r);return parseInt(La.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class df{constructor(r,s){this.toUtf8=r,this.fromUtf8=s}format(r){const s=[];for(let e of Object.keys(r)){const h=this.fromUtf8(e);s.push(Uint8Array.from([h.byteLength]),h,this.formatHeaderValue(r[e]))}const l=new Uint8Array(s.reduce((e,h)=>e+h.byteLength,0));let f=0;for(let e of s)l.set(e,f),f+=e.byteLength;return l}formatHeaderValue(r){switch(r.type){case"boolean":return Uint8Array.from([r.value?0:1]);case"byte":return Uint8Array.from([2,r.value]);case"short":const s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,r.value,!1),new Uint8Array(s.buffer);case"integer":const l=new DataView(new ArrayBuffer(5));return l.setUint8(0,4),l.setInt32(1,r.value,!1),new Uint8Array(l.buffer);case"long":const f=new Uint8Array(9);return f[0]=5,f.set(r.value.bytes,1),f;case"binary":const e=new DataView(new ArrayBuffer(3+r.value.byteLength));e.setUint8(0,6),e.setUint16(1,r.value.byteLength,!1);const h=new Uint8Array(e.buffer);return h.set(r.value,3),h;case"string":const m=this.fromUtf8(r.value),a=new DataView(new ArrayBuffer(3+m.byteLength));a.setUint8(0,7),a.setUint16(1,m.byteLength,!1);const g=new Uint8Array(a.buffer);return g.set(m,3),g;case"timestamp":const R=new Uint8Array(9);return R[0]=8,R.set(Tr.fromNumber(r.value.valueOf()).bytes,1),R;case"uuid":if(!Md.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const N=new Uint8Array(17);return N[0]=9,N.set(u.fromHex(r.value.replace(/\-/g,"")),1),N}}parse(r){const s={};let l=0;while(l<r.byteLength){const f=r.getUint8(l++),e=this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+l,f));switch(l+=f,r.getUint8(l++)){case 0:s[e]={type:va,value:!0};break;case 1:s[e]={type:va,value:!1};break;case 2:s[e]={type:Ed,value:r.getInt8(l++)};break;case 3:s[e]={type:Id,value:r.getInt16(l,!1)},l+=2;break;case 4:s[e]={type:kd,value:r.getInt32(l,!1)},l+=4;break;case 5:s[e]={type:Pd,value:new Tr(new Uint8Array(r.buffer,r.byteOffset+l,8))},l+=8;break;case 6:const h=r.getUint16(l,!1);l+=2,s[e]={type:Nd,value:new Uint8Array(r.buffer,r.byteOffset+l,h)},l+=h;break;case 7:const m=r.getUint16(l,!1);l+=2,s[e]={type:$d,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+l,m))},l+=m;break;case 8:s[e]={type:Dd,value:new Date(new Tr(new Uint8Array(r.buffer,r.byteOffset+l,8)).valueOf())},l+=8;break;case 9:const a=new Uint8Array(r.buffer,r.byteOffset+l,16);l+=16,s[e]={type:Ud,value:`${u.toHex(a.subarray(0,4))}-${u.toHex(a.subarray(4,6))}-${u.toHex(a.subarray(6,8))}-${u.toHex(a.subarray(8,10))}-${u.toHex(a.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return s}}var Za;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(Za||(Za={}));var va="boolean",Ed="byte",Id="short",kd="integer",Pd="long",Nd="binary",$d="string",Dd="timestamp",Ud="uuid",Md=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function Ja({byteLength:r,byteOffset:s,buffer:l}){if(r<Td)throw new Error("Provided message too short to accommodate event stream message overhead");const f=new DataView(l,s,r),e=f.getUint32(0,!1);if(r!==e)throw new Error("Reported message length does not match received message length");const h=f.getUint32(Ha,!1),m=f.getUint32(t,!1),a=f.getUint32(r-hr,!1),g=new rr().update(new Uint8Array(l,s,t));if(m!==g.digest())throw new Error(`The prelude checksum specified in the message (${m}) does not match the calculated CRC32 checksum (${g.digest()})`);if(g.update(new Uint8Array(l,s+t,r-(t+hr))),a!==g.digest())throw new Error(`The message checksum (${g.digest()}) did not match the expected value of ${a}`);return{headers:new DataView(l,s+t+hr,h),body:new Uint8Array(l,s+t+hr+h,e-h-(t+hr+hr))}}var Ha=4,t=Ha*2,hr=4,Td=t+hr*2;class Sf{constructor(r,s){this.headerMarshaller=new df(r,s),this.messageBuffer=[],this.isEndOfStream=!1}feed(r){this.messageBuffer.push(this.decode(r))}endOfStream(){this.isEndOfStream=!0}getMessage(){const r=this.messageBuffer.pop(),s=this.isEndOfStream;return{getMessage(){return r},isEndOfStream(){return s}}}getAvailableMessages(){const r=this.messageBuffer;this.messageBuffer=[];const s=this.isEndOfStream;return{getMessages(){return r},isEndOfStream(){return s}}}encode({headers:r,body:s}){const l=this.headerMarshaller.format(r),f=l.byteLength+s.byteLength+16,e=new Uint8Array(f),h=new DataView(e.buffer,e.byteOffset,e.byteLength),m=new rr;return h.setUint32(0,f,!1),h.setUint32(4,l.byteLength,!1),h.setUint32(8,m.update(e.subarray(0,8)).digest(),!1),e.set(l,12),e.set(s,l.byteLength+12),h.setUint32(f-4,m.update(e.subarray(8,f-4)).digest(),!1),e}decode(r){const{headers:s,body:l}=Ja(r);return{headers:this.headerMarshaller.parse(s),body:l}}formatHeaders(r){return this.headerMarshaller.format(r)}}class Rf{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.decoder.decode(r)}}class Af{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream)yield this.options.encoder.encode(r);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class Ef{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream){const s=await this.options.deserializer(r);if(s===void 0)continue;yield s}}}class If{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.serializer(r)}}function Xa(r){let s=0,l=0,f=null,e=null;const h=(a)=>{if(typeof a!=="number")throw new Error("Attempted to allocate an event message where size was not a number: "+a);s=a,l=4,f=new Uint8Array(a),new DataView(f.buffer).setUint32(0,a,!1)},m=async function*(){const a=r[Symbol.asyncIterator]();while(!0){const{value:g,done:R}=await a.next();if(R){if(!s)return;else if(s===l)yield f;else throw new Error("Truncated event message received.");return}const N=g.length;let $=0;while($<N){if(!f){const M=N-$;if(!e)e=new Uint8Array(4);const Q=Math.min(4-l,M);if(e.set(g.slice($,$+Q),l),l+=Q,$+=Q,l<4)break;h(new DataView(e.buffer).getUint32(0,!1)),e=null}const D=Math.min(s-l,N-$);if(f.set(g.slice($,$+D),l),l+=D,$+=D,s&&s===l)yield f,f=null,s=0,l=0}}};return{[Symbol.asyncIterator]:m}}function Qa(r,s){return async function(l){const{value:f}=l.headers[":message-type"];if(f==="error"){const e=new Error(l.headers[":error-message"].value||"UnknownError");throw e.name=l.headers[":error-code"].value,e}else if(f==="exception"){const e=l.headers[":exception-type"].value,h={[e]:l},m=await r(h);if(m.$unknown){const a=new Error(s(l.body));throw a.name=e,a}throw m[e]}else if(f==="event"){const e={[l.headers[":event-type"].value]:l},h=await r(e);if(h.$unknown)return;return h}else throw Error(`Unrecognizable event type: ${l.headers[":event-type"].value}`)}}class Qs{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new Sf(r,s),this.utfEncoder=r}deserialize(r,s){const l=Xa(r);return new Ef({messageStream:new Rf({inputStream:l,decoder:this.eventStreamCodec}),deserializer:Qa(s,this.utfEncoder)})}serialize(r,s){return new Af({messageStream:new If({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as Cd} from"stream";async function*ca(r){let s=!1,l=!1;const f=new Array;r.on("error",(e)=>{if(!s)s=!0;if(e)throw e}),r.on("data",(e)=>{f.push(e)}),r.on("end",()=>{s=!0});while(!l){const e=await new Promise((h)=>setTimeout(()=>h(f.shift()),0));if(e)yield e;l=s&&f.length===0}}class kf{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new Qs({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const l=typeof r[Symbol.asyncIterator]==="function"?r:ca(r);return this.universalMarshaller.deserialize(l,s)}serialize(r,s){return Cd.from(this.universalMarshaller.serialize(r,s))}}var Ya=(r)=>new kf(r);import{Writable as Fd} from"stream";class cs extends Fd{constructor(r,s){super(s);this.hash=r}_write(r,s,l){try{this.hash.update(ss(r))}catch(f){return l(f)}l()}}var Ba=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const l=new r,f=new cs(l);return s.pipe(f),new Promise((e,h)=>{s.on("error",(m)=>{f.end(),h(m)}),f.on("error",h),f.on("finish",()=>{l.digest().then(e).catch(h)})})};var gm=z(Gd(),1);var Ys=z($s(),1);var ia=z(zd(),1);var Bs=z(de(),1);var ba=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??_a,base64Encoder:r?.base64Encoder??ja,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??Ns,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??Bs.getAwsChunkedEncodingStream,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??Uh,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Ys.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new Ys.AwsSdkSigV4ASigner}],logger:r?.logger??new hs,sdkStreamMixin:r?.sdkStreamMixin??Bs.sdkStreamMixin,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??Sl,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??ia.parseUrl,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??Oa,utf8Encoder:r?.utf8Encoder??qa}};var wm=(r)=>{oa(process.version);const s=am(r),l=()=>s().then(xa),f=ba(r);return qs.emitWarningIfUnsupportedVersion(process.version),{...f,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??hm,credentialDefaultProvider:r?.credentialDefaultProvider??mm,defaultUserAgentProvider:r?.defaultUserAgentProvider??em({serviceId:f.serviceId,clientVersion:ya.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??q(al),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??Ya,maxAttempts:r?.maxAttempts??q(rm),md5:r?.md5??Os.bind(null,"md5"),region:r?.region??q(ua,ta),requestChecksumCalculation:r?.requestChecksumCalculation??q(yf),requestHandler:lm.create(r?.requestHandler??l),responseChecksumValidation:r?.responseChecksumValidation??q(Wf),retryMode:r?.retryMode??q({...sm,default:async()=>(await l()).retryMode||gm.DEFAULT_RETRY_MODE}),sha1:r?.sha1??Os.bind(null,"sha1"),sha256:r?.sha256??Os.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??q(qs.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??fm,streamHasher:r?.streamHasher??Ba,useArnRegion:r?.useArnRegion??q(Wa),useDualstackEndpoint:r?.useDualstackEndpoint??q(na),useFipsEndpoint:r?.useFipsEndpoint??q(pa)}};var dm=(r)=>{const s=r.httpAuthSchemes;let{httpAuthSchemeProvider:l,credentials:f}=r;return{setHttpAuthScheme(e){const h=s.findIndex((m)=>m.schemeId===e.schemeId);if(h===-1)s.push(e);else s.splice(h,1,e)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(e){l=e},httpAuthSchemeProvider(){return l},setCredentials(e){f=e},credentials(){return f}}},Sm=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var _s=(r)=>r,Nm=(r,s)=>{const l={..._s(km(r)),..._s(Em(r)),..._s(Rm(r)),..._s(dm(r))};return s.forEach((f)=>f.configure(l)),{...r,...Pm(l),...Im(l),...Am(l),...Sm(l)}};class Pf extends Tm{constructor(...[r]){const s=wm(r||{}),l=Th(s),f=Cm(l),e=_f(f),h=Wm(e),m=zm(h),a=$m(m),g=ym(a),R=Ee(g),N=Mh(R),$=we(N,{session:[()=>this,wf]}),D=Nm($,r?.extensions||[]);super(D);this.config=D,this.middlewareStack.use(Fm(this.config)),this.middlewareStack.use(Km(this.config)),this.middlewareStack.use(Gm(this.config)),this.middlewareStack.use(Dm(this.config)),this.middlewareStack.use(Um(this.config)),this.middlewareStack.use(Mm(this.config)),this.middlewareStack.use(Cr.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Nh,identityProviderConfigProvider:async(M)=>new Cr.DefaultIdentityProviderConfig({"aws.auth#sigv4":M.credentials,"aws.auth#sigv4a":M.credentials})})),this.middlewareStack.use(Cr.getHttpSigningPlugin(this.config)),this.middlewareStack.use(Ae(this.config)),this.middlewareStack.use(Cf(this.config)),this.middlewareStack.use(of(this.config)),this.middlewareStack.use(ml(this.config)),this.middlewareStack.use(wl(this.config))}destroy(){super.destroy()}}function yd(r){return(s)=>async(l)=>{const f={...l.input},e=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let h of e){const m=f[h.target];if(m){let a;if(typeof m==="string")if(Kd(m,r))a=r.base64Decoder(m);else a=r.utf8Decoder(m),f[h.target]=r.base64Encoder(a);else a=ArrayBuffer.isView(m)?new Uint8Array(m.buffer,m.byteOffset,m.byteLength):new Uint8Array(m),f[h.target]=r.base64Encoder(a);const g=new r.md5;g.update(a),f[h.hash]=r.base64Encoder(await g.digest())}}return s({...l,input:f})}}function Kd(r,s){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(r))return!1;try{return s.base64Decoder(r).length===32}catch{return!1}}var Wd={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},js=(r)=>({applyToStack:(s)=>{s.add(yd(r),Wd)}});class Nf extends Dr.classBuilder().ep({...kr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,l,f){return[Ur(l,this.serialize,this.deserialize),Mr(l,r.getEndpointParameterInstructions()),es(l,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),js(l),nf(l)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(yh,Gh).ser(jh).de(xh).build(){}class $f extends Dr.classBuilder().ep({...kr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,l,f){return[Ur(l,this.serialize,this.deserialize),Mr(l,r.getEndpointParameterInstructions()),es(l,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),jf(l),ds(l),js(l)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(Vh,Kh).ser(ih).de(oh).build(){}import{Buffer as Vm} from"buffer";class Lm extends ar{client;constructor(...r){super();this.client=new Pf(...r)}async put(r){let s,l,f,e=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,f=`${br()}.${r.type.split("/")[1].split(";")[0]}`,l=r.type;else s=r.body,f=r.name,l=r.contentType;l=s instanceof Blob||s instanceof File?s.type:void 0;const h=s instanceof Vm?s:Vm.from(await s.arrayBuffer());return await this.client.send(new $f({Bucket:e,Key:f,Body:h,ContentType:l})),f}async fetch(r){let s=process.env.BUCKET_NAME,l;if(typeof r==="string")l=r;else s=r.bucket??s,l=r.name;if(!l)throw new Error("Object name has to be specified");const f=await this.client.send(new Nf({Bucket:s,Key:l}));return new Response(f.Body.transformToWebStream(),{headers:{"Content-Type":f.ContentType,"Content-Length":f.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":f.LastModified?.toUTCString()||"",ETag:f.ETag||""}})}}class is{}class bs extends is{constructor(){super(...arguments)}requests=new Map;consume(r,s){if(!this.requests.has(r))this.requests.set(r,{date:Date.now(),count:1});else{const l=this.requests.get(r),f=Date.now();if(f-l.date>=60000)this.requests.set(r,{date:f,count:1});else this.requests.set(r,{date:l.date,count:l.count+1})}return this.requests.get(r).count}}class Zm extends c{constructor(){super(...arguments)}driver=new bs;boot(){}}import*as Hd from"react-dom/server";var Qm=z(Vd(),1);import{Writable as cd} from"stream";var{defineProperty:Ld,getOwnPropertySymbols:vm}=Object,Zd=Object.prototype.hasOwnProperty,vd=Object.prototype.propertyIsEnumerable,Hm=(r,s,l)=>(s in r)?Ld(r,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[s]=l,Df=(r,s)=>{for(var l in s||(s={}))if(Zd.call(s,l))Hm(r,l,s[l]);if(vm){for(var l of vm(s))if(vd.call(s,l))Hm(r,l,s[l])}return r},Uf=(r,s,l)=>{return new Promise((f,e)=>{var h=(g)=>{try{a(l.next(g))}catch(R){e(R)}},m=(g)=>{try{a(l.throw(g))}catch(R){e(R)}},a=(g)=>g.done?f(g.value):Promise.resolve(g.value).then(h,m);a((l=l.apply(r,s)).next())})},Jd={unformatted:["code","pre","em","strong","span"],indent_inner_html:!0,indent_char:" ",indent_size:2,sep:"\n"},Xd=(r,s={})=>{return Qm.default.html(r,Df(Df({},Jd),s))},Qd=[{selector:"img",format:"skip"},{selector:"#__react-email-preview",format:"skip"},{selector:"a",options:{linkBrackets:!1}}];var Jm=new TextDecoder("utf-8"),Xm=(r)=>Uf(void 0,null,function*(){let s="";if("pipeTo"in r){const l=new WritableStream({write(f){s+=Jm.decode(f)}});yield r.pipeTo(l)}else{const l=new cd({write(f,e,h){s+=Jm.decode(f),h()}});return r.pipe(l),new Promise((f,e)=>{l.on("error",e),l.on("close",()=>{f(s)})})}return s}),xs=(r,s)=>Uf(void 0,null,function*(){const{default:l}=yield import("react-dom/server");let f;if(Object.hasOwn(l,"renderToReadableStream"))f=yield Xm(yield l.renderToReadableStream(r));else yield new Promise((m,a)=>{const g=l.renderToPipeableStream(r,{onAllReady(){return Uf(this,null,function*(){f=yield Xm(g),m()})},onError(R){a(R)}})});if(s==null?void 0:s.plainText)return Mf(f,Df({selectors:Qd},s.htmlToTextOptions));const h=`${'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'}${f.replace(/<!DOCTYPE.*?>/,"")}`;if(s==null?void 0:s.pretty)return Xd(h);return h});var{defineProperty:Yd,defineProperties:Bd,getOwnPropertyDescriptors:Od,getOwnPropertySymbols:cm}=Object,qd=Object.prototype.hasOwnProperty,_d=Object.prototype.propertyIsEnumerable,Ym=(r,s,l)=>(s in r)?Yd(r,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[s]=l,jr=(r,s)=>{for(var l in s||(s={}))if(qd.call(s,l))Ym(r,l,s[l]);if(cm){for(var l of cm(s))if(_d.call(s,l))Ym(r,l,s[l])}return r},jd=(r,s)=>Bd(r,Od(s)),I=(r,s,l)=>{return new Promise((f,e)=>{var h=(g)=>{try{a(l.next(g))}catch(R){e(R)}},m=(g)=>{try{a(l.throw(g))}catch(R){e(R)}},a=(g)=>g.done?f(g.value):Promise.resolve(g.value).then(h,m);a((l=l.apply(r,s)).next())})},id="3.5.0",bd=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post("/api-keys",s,l)})}list(){return I(this,null,function*(){return yield this.resend.get("/api-keys")})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/api-keys/${r}`)})}},xd=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post("/audiences",s,l)})}list(){return I(this,null,function*(){return yield this.resend.get("/audiences")})}get(r){return I(this,null,function*(){return yield this.resend.get(`/audiences/${r}`)})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/audiences/${r}`)})}},od=class{constructor(r){this.resend=r}send(r){return I(this,arguments,function*(s,l={}){return this.create(s,l)})}create(r){return I(this,arguments,function*(s,l={}){for(let e of s)if(e.react)e.html=yield xs(e.react),delete e.react;return yield this.resend.post("/emails/batch",s,l)})}},nd=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post(`/audiences/${s.audienceId}/contacts`,{unsubscribed:s.unsubscribed,email:s.email,first_name:s.firstName,last_name:s.lastName},l)})}list(r){return I(this,null,function*(){return yield this.resend.get(`/audiences/${r.audienceId}/contacts`)})}get(r){return I(this,null,function*(){return yield this.resend.get(`/audiences/${r.audienceId}/contacts/${r.id}`)})}update(r){return I(this,null,function*(){return yield this.resend.patch(`/audiences/${r.audienceId}/contacts/${r.id}`,{unsubscribed:r.unsubscribed,first_name:r.firstName,last_name:r.lastName})})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/audiences/${r.audienceId}/contacts/${(r==null?void 0:r.email)?r==null?void 0:r.email:r==null?void 0:r.id}`)})}},pd=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post("/domains",s,l)})}list(){return I(this,null,function*(){return yield this.resend.get("/domains")})}get(r){return I(this,null,function*(){return yield this.resend.get(`/domains/${r}`)})}update(r){return I(this,null,function*(){return yield this.resend.patch(`/domains/${r.id}`,{click_tracking:r.clickTracking,open_tracking:r.openTracking,tls:r.tls})})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/domains/${r}`)})}verify(r){return I(this,null,function*(){return yield this.resend.post(`/domains/${r}/verify`)})}},ud=class{constructor(r){this.resend=r}send(r){return I(this,arguments,function*(s,l={}){return this.create(s,l)})}create(r){return I(this,arguments,function*(s,l={}){if(s.react)s.html=yield xs(s.react),delete s.react;return yield this.resend.post("/emails",s,l)})}get(r){return I(this,null,function*(){return yield this.resend.get(`/emails/${r}`)})}},Bm="https://api.resend.com",Om=`resend-node:${id}`,td=typeof process!=="undefined"&&process.env?process.env.RESEND_BASE_URL||Bm:Bm,r3=typeof process!=="undefined"&&process.env?process.env.RESEND_USER_AGENT||Om:Om,qm=class{constructor(r){if(this.key=r,this.apiKeys=new bd(this),this.audiences=new xd(this),this.batch=new od(this),this.contacts=new nd(this),this.domains=new pd(this),this.emails=new ud(this),!r){if(typeof process!=="undefined"&&process.env)this.key=process.env.RESEND_API_KEY;if(!this.key)throw new Error('Missing API key. Pass it to the constructor `new Resend("re_123")`')}this.headers=new Headers({Authorization:`Bearer ${this.key}`,"User-Agent":r3,"Content-Type":"application/json"})}fetchRequest(r){return I(this,arguments,function*(s,l={}){try{const f=yield fetch(`${td}${s}`,l);if(!f.ok)try{const h=yield f.text();return{data:null,error:JSON.parse(h)}}catch(h){if(h instanceof SyntaxError)return{data:null,error:{name:"application_error",message:"Internal server error. We are unable to process your request right now, please try again later."}};const m={message:f.statusText,name:"application_error"};if(h instanceof Error)return{data:null,error:jd(jr({},m),{message:h.message})};return{data:null,error:m}}return{data:yield f.json(),error:null}}catch(f){return{data:null,error:{name:"application_error",message:"Unable to fetch data. The request could not be resolved."}}}})}post(r,s){return I(this,arguments,function*(l,f,e={}){const h=jr({method:"POST",headers:this.headers,body:JSON.stringify(f)},e);return this.fetchRequest(l,h)})}get(r){return I(this,arguments,function*(s,l={}){const f=jr({method:"GET",headers:this.headers},l);return this.fetchRequest(s,f)})}put(r,s){return I(this,arguments,function*(l,f,e={}){const h=jr({method:"PUT",headers:this.headers,body:JSON.stringify(f)},e);return this.fetchRequest(l,h)})}patch(r,s){return I(this,arguments,function*(l,f,e={}){const h=jr({method:"PATCH",headers:this.headers,body:JSON.stringify(f)},e);return this.fetchRequest(l,h)})}delete(r,s){return I(this,null,function*(){const l={method:"DELETE",headers:this.headers,body:JSON.stringify(s)};return this.fetchRequest(r,l)})}};class os{}class ns extends os{r;constructor(r=process.env.RESEND_API_KEY){super();this.apiKey=r}async send(r){const s=new qm(this.apiKey);console.log(r);const{data:l,error:f}=await s.emails.send({...r});if(f)return console.error(f),!1;if(l)return!0}}class _m extends c{constructor(){super(...arguments)}driver=new ns;boot(){}}class jm extends c{constructor(){super(...arguments)}channels={};boot(){}}class im extends c{constructor(){super(...arguments)}root;rootRouter;boot(){}}class bm extends c{constructor(){super(...arguments)}rootRouter;boot(){return"Origin"}}export{im as ViewRouterServiceProvider,Lm as S3Driver,ns as ResendDriver,Zm as RateLimiterServiceProvider,is as RateLimiterDriver,bs as InMemoryRateLimiter,xr as FileSystemDriver,Tf as FileStorageServiceProvider,ar as FileStorageDriver,_m as EmailServiceProvider,os as EmailDriver,jm as BroadcastingServiceProvider,bm as ApiRouterServiceProvider};export{Tf as w,bm as x,Zm as y,_m as z,jm as A,im as B};
2
+ import"../chunk-7d69aa73d7fc1f66.js";import{H as c} from"../chunk-2c5231fcdfa1d6f2.js";import{I as V} from"../chunk-c83dcc500d5fefe3.js";import{O as Df,P as Ld} from"../chunk-58fb175982676253.js";import{U as lg} from"../chunk-9e77cade8671df8d.js";import{$ as Ng,Aa as Ys,Ba as mm,Ca as gm,Da as Pm,Ea as Nm,V as br,W as fl,X as Dm,Y as Um,Z as Mm,_ as Tm,aa as sr,ba as lr,ca as al,da as Fm,ea as Rh,fa as Ah,ga as Eh,ha as Ih,ia as zm,ja as ta,ka as rm,la as sm,ma as lm,na as Gm,oa as ym,pa as kh,qa as Ur,ra as Mr,sa as Wm,ta as fm,ua as em,va as Km,wa as hm,xa as Vm,ya as Ns,za as am} from"../chunk-5376e4fd33eba40f.js";import{Ab as ua,Bb as Im,Cb as km,Eb as G,Fa as Am,Ga as Em,Gb as Oh,Ha as X,Ia as as,Ja as Vf,Ma as Ba,Na as ss,Oa,Pa as hs,Qa as Cm,Ra as qa,Sa as _a,Ta as ja,Va as oa,Wa as na,cb as Ka,db as ia,eb as ge,fb as we,gb as Qh,hb as Dr,ib as H,kb as Yr,nb as Pr,ob as ch,pb as Nr,qb as Yh,rb as Ws,sb as Xr,ub as nl,vb as Lr,wb as Th,xb as j,yb as Bh,zb as pa} from"../chunk-a433eaaec29698ba.js";import{Jb as q,Kb as ba} from"../chunk-402c227b95ad9a77.js";import{Lb as $g} from"../chunk-7f9e205bb6fc61db.js";import{Mb as wm} from"../chunk-c7894ed595fd0b08.js";import"../chunk-3bcacf5cc1e6cc17.js";import"../chunk-213873f56884b132.js";class ar{}class xr extends ar{r;constructor(r=`${process.env.ROOT_DIR}/storage`){super();this.folderPath=r}async put(r){let s,l;if(r instanceof Blob)s=r,l=`${br()}.${r.type.split("/")[1].split(";")[0]}`;else s=r.body,l=r.name;const f=s instanceof Buffer?s:Buffer.from(await s.arrayBuffer()),e=`${this.folderPath}/${l}`;return await Bun.write(e,f),l}async fetch(r){let s=process.env.BUCKET_NAME,l;if(typeof r==="string")l=r;else s=r.bucket??s,l=r.name;if(!l)throw new Error("Object name has to be specified");const f=`${this.folderPath}/${l}`,e=Bun.file(f),h=Bun.file(f).stream(),m=new Date(e.lastModified).toUTCString();return new Response(h,{headers:{"Content-Type":e.type,"Content-Length":String(e.size),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":m}})}}class Uf extends c{constructor(){super(...arguments)}driver=new xr;boot(){}}function nm(r){return(s)=>async(l)=>{const{request:f}=l;if(X.isInstance(f)&&f.body&&r.runtime==="node"){if(r.requestHandler?.constructor?.name!=="FetchHttpHandler")f.headers={...f.headers,Expect:"100-continue"}}return s({...l,request:f})}}var pm={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},Mf=(r)=>({applyToStack:(s)=>{s.add(nm(r),pm)}});var zr={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},or=zr.WHEN_SUPPORTED,ns={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},nr=zr.WHEN_SUPPORTED,U;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(U||(U={}));var Tf;(function(r){r.HEADER="header",r.TRAILER="trailer"})(Tf||(Tf={}));var{MD5:Cf,CRC32:Ff}=U;var x;(function(r){r.ENV="env",r.CONFIG="shared config entry"})(x||(x={}));var mr=(r,s,l,f)=>{if(!(s in r))return;const e=r[s].toUpperCase();if(!Object.values(l).includes(e))throw new TypeError(`Cannot load ${f} '${s}'. Expected one of ${Object.values(l)}, got '${r[s]}'.`);return e};var um="AWS_REQUEST_CHECKSUM_CALCULATION",tm="request_checksum_calculation",zf={environmentVariableSelector:(r)=>mr(r,um,zr,x.ENV),configFileSelector:(r)=>mr(r,tm,zr,x.CONFIG),default:or};var rg="AWS_RESPONSE_CHECKSUM_VALIDATION",sg="response_checksum_validation",Gf={environmentVariableSelector:(r)=>mr(r,rg,ns,x.ENV),configFileSelector:(r)=>mr(r,sg,ns,x.CONFIG),default:nr};var Gr=[U.CRC32,U.CRC32C,U.SHA1,U.SHA256],yf=[U.CRC32,U.CRC32C,U.SHA1,U.SHA256];var Wf=(r,{requestChecksumRequired:s,requestAlgorithmMember:l},f)=>{const e=f?Ff:Cf;if(!l||!r[l])return s?e:void 0;const h=r[l];if(!Gr.includes(h))throw new Error(`The checksum algorithm "${h}" is not supported by the client.`+` Select one of ${Gr}.`);return h};var gr=(r)=>r===U.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var Kf=(r,s)=>{const l=r.toLowerCase();for(let f of Object.keys(s))if(l===f.toLowerCase())return!0;return!1};var wr=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!Vf(r);var Lf=V(lg(),1),{__extends:W3,__assign:K3,__rest:V3,__decorate:L3,__param:Z3,__esDecorate:v3,__runInitializers:H3,__propKey:J3,__setFunctionName:X3,__metadata:Q3,__awaiter:pr,__generator:ur,__exportStar:c3,__createBinding:Y3,__values:tr,__read:B3,__spread:O3,__spreadArrays:q3,__spreadArray:_3,__await:j3,__asyncGenerator:i3,__asyncDelegator:b3,__asyncValues:x3,__makeTemplateObject:o3,__importStar:n3,__importDefault:p3,__classPrivateFieldGet:u3,__classPrivateFieldSet:t3,__classPrivateFieldIn:rS,__addDisposableResource:sS,__disposeResources:lS}=Lf.default;import{Buffer as Zf} from"buffer";var vf=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?Zf.from(r,s):Zf.from(r)};var ps=(r)=>{const s=vf(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function yr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return fg(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var fg=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:ps;function Wr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function Kr(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}function Vr(r){if(!Uint32Array.from){var s=new Uint32Array(r.length),l=0;while(l<r.length)s[l]=r[l],l+=1;return s}return Uint32Array.from(r)}var us=function(){function r(){this.crc32=new rr}return r.prototype.update=function(s){if(Wr(s))return;this.crc32.update(yr(s))},r.prototype.digest=function(){return pr(this,void 0,void 0,function(){return ur(this,function(s){return[2,Kr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new rr},r}();var rr=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var l,f;try{for(var e=tr(s),h=e.next();!h.done;h=e.next()){var m=h.value;this.checksum=this.checksum>>>8^hg[(this.checksum^m)&255]}}catch(a){l={error:a}}finally{try{if(h&&!h.done&&(f=e.return))f.call(e)}finally{if(l)throw l.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var eg=[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],hg=Vr(eg);var rl=function(){function r(){this.crc32c=new ts}return r.prototype.update=function(s){if(Wr(s))return;this.crc32c.update(yr(s))},r.prototype.digest=function(){return pr(this,void 0,void 0,function(){return ur(this,function(s){return[2,Kr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new ts},r}();var ts=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var l,f;try{for(var e=tr(s),h=e.next();!h.done;h=e.next()){var m=h.value;this.checksum=this.checksum>>>8^mg[(this.checksum^m)&255]}}catch(a){l={error:a}}finally{try{if(h&&!h.done&&(f=e.return))f.call(e)}finally{if(l)throw l.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var ag=[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],mg=Vr(ag);var rs=(r,s)=>({[U.MD5]:s.md5,[U.CRC32]:us,[U.CRC32C]:rl,[U.SHA1]:s.sha1,[U.SHA256]:s.sha256})[r];var ls=(r,s)=>{const l=new r;return l.update(ss(s||"")),l.digest()};var Hf={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},Jf=(r,s)=>(l,f)=>async(e)=>{if(!X.isInstance(e.request))return l(e);const{request:h}=e,{body:m,headers:a}=h,{base64Encoder:g,streamHasher:R}=r,{input:N,requestChecksumRequired:$,requestAlgorithmMember:D}=s,M=Wf(N,{requestChecksumRequired:$,requestAlgorithmMember:D},!!f.isS3ExpressBucket);let Q=m,B=a;if(M){const i=gr(M),Fr=rs(M,r);if(wr(m)){const{getAwsChunkedEncodingStream:os,bodyLengthChecker:om}=r;Q=os(m,{base64Encoder:g,bodyLengthChecker:om,checksumLocationName:i,checksumAlgorithmFn:Fr,streamHasher:R}),B={...a,"content-encoding":a["content-encoding"]?`${a["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":a["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":i},delete B["content-length"]}else if(!Kf(i,a)){const os=await ls(Fr,m);B={...a,[i]:g(os)}}}return await l({...e,request:{...h,headers:B,body:Q}})};var fs=(r=[])=>{const s=[];for(let l of yf){if(!r.includes(l)||!Gr.includes(l))continue;s.push(l)}return s};var Xf=(r)=>{const s=r.lastIndexOf("-");if(s!==-1){const l=r.slice(s+1);if(!l.startsWith("0")){const f=parseInt(l,10);if(!isNaN(f)&&f>=1&&f<=1e4)return!0}}return!1};import{Transform as gg} from"stream";function sl(r){const s=new gg;return s.push(r),s.push(null),s}var Qf=async(r,{streamHasher:s,checksumAlgorithmFn:l,base64Encoder:f})=>{const e=wr(r)?s(l,r):ls(l,r);return f(await e)};var cf=async(r,{config:s,responseAlgorithms:l})=>{const f=fs(l),{body:e,headers:h}=r;for(let m of f){const a=gr(m),g=h[a];if(g){const R=rs(m,s),{streamHasher:N,base64Encoder:$}=s,D=await Qf(e,{streamHasher:N,checksumAlgorithmFn:R,base64Encoder:$});if(D===g)break;throw new Error(`Checksum mismatch: expected "${D}" but received "${g}"`+` in response header "${a}".`)}}};var Yf={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},Bf=(r,s)=>(l,f)=>async(e)=>{if(!X.isInstance(e.request))return l(e);const h=e.input,m=await l(e),a=m.response;let g=void 0;const{requestValidationModeMember:R,responseAlgorithms:N}=s;if(R&&h[R]==="ENABLED"){const{clientName:$,commandName:D}=f;if($==="S3Client"&&D==="GetObjectCommand"&&fs(N).every((B)=>{const ir=gr(B),i=a.headers[ir];return!i||Xf(i)}))return m;const Q=wr(a.body);if(Q)g=await r.streamCollector(a.body),a.body=sl(g);if(await cf(m.response,{config:r,responseAlgorithms:N}),Q&&g)a.body=sl(g)}return m};var es=(r,s)=>({applyToStack:(l)=>{l.add(Jf(r,s),Hf),l.addRelativeTo(Bf(r,s),Yf)}});var ll=V(fl(),1);var Of=(r)=>({...r,requestChecksumCalculation:ll.normalizeProvider(r.requestChecksumCalculation??or),responseChecksumValidation:ll.normalizeProvider(r.responseChecksumValidation??nr)});function dg(){return(r,s)=>async(l)=>{const{request:f}=l;if(X.isInstance(f)){if(!(wg in f.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof hs))s.logger.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.");else console.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.")}return r({...l})}}var wg="content-length",Sg={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},qf=(r)=>({applyToStack:(s)=>{s.add(dg(),Sg)}});var _f=(r)=>{return(s,l)=>async(f)=>{const e=await r.region(),h=r.region;let m=()=>{};if(l.__s3RegionRedirect)Object.defineProperty(r,"region",{writable:!1,value:async()=>{return l.__s3RegionRedirect}}),m=()=>Object.defineProperty(r,"region",{writable:!0,value:h});try{const a=await s(f);if(l.__s3RegionRedirect){m();const g=await r.region();if(e!==g)throw new Error("Region was not restored following S3 region redirect.")}return a}catch(a){throw m(),a}}},jf={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function Rg(r){return(s,l)=>async(f)=>{try{return await s(f)}catch(e){if(r.followRegionRedirects&&e?.$metadata?.httpStatusCode===301){try{const h=e.$response.headers["x-amz-bucket-region"];l.logger?.debug(`Redirecting from ${await r.region()} to ${h}`),l.__s3RegionRedirect=h}catch(h){throw new Error("Region redirect failed: "+h)}return s(f)}else throw e}}}var Ag={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},bf=(r)=>({applyToStack:(s)=>{s.add(Rg(r),Ag),s.addRelativeTo(_f(r),jf)}});var Eg=(r)=>{return(s,l)=>async(f)=>{const e=await s(f),{response:h}=e;if(as.isInstance(h)){if(h.headers.expires){h.headers.expiresstring=h.headers.expires;try{Lr(h.headers.expires)}catch(m){l.logger?.warn(`AWS SDK Warning for ${l.clientName}::${l.commandName} response parsing (${h.headers.expires}): ${m}`),delete h.headers.expires}}}return e}},Ig={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},xf=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Eg(r),Ig)}});class dr{constructor(r={}){this.data=r,this.lastPurgeTime=Date.now()}get(r){const s=this.data[r];if(!s)return;return s}set(r,s){return this.data[r]=s,s}delete(r){delete this.data[r]}async purgeExpired(){const r=Date.now();if(this.lastPurgeTime+dr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>r)return;for(let s in this.data){const l=this.data[s];if(!l.isRefreshing){const f=await l.identity;if(f.expiration){if(f.expiration.getTime()<r)delete this.data[s]}}}}}dr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class Sr{constructor(r,s=!1,l=Date.now()){this._identity=r,this.isRefreshing=s,this.accessed=l}get identity(){return this.accessed=Date.now(),this._identity}}class Rr{constructor(r,s=new dr){this.createSessionFn=r,this.cache=s}async getS3ExpressIdentity(r,s){const l=s.Bucket,{cache:f}=this,e=f.get(l);if(e)return e.identity.then((h)=>{if((h.expiration?.getTime()??0)<Date.now())return f.set(l,new Sr(this.getIdentity(l))).identity;if((h.expiration?.getTime()??0)<Date.now()+Rr.REFRESH_WINDOW_MS&&!e.isRefreshing)e.isRefreshing=!0,this.getIdentity(l).then((g)=>{f.set(l,new Sr(Promise.resolve(g)))});return h});return f.set(l,new Sr(this.getIdentity(l))).identity}async getIdentity(r){await this.cache.purgeExpired().catch((f)=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+f)});const s=await this.createSessionFn(r);if(!s.Credentials?.AccessKeyId||!s.Credentials?.SecretAccessKey)throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:s.Credentials.AccessKeyId,secretAccessKey:s.Credentials.SecretAccessKey,sessionToken:s.Credentials.SessionToken,expiration:s.Credentials.Expiration?new Date(s.Credentials.Expiration):void 0}}}Rr.REFRESH_WINDOW_MS=60000;var re=V(Ng(),1);var of="Directory",nf="S3Express",pf="sigv4-s3express",ms="X-Amz-S3session-Token",Zr=ms.toLowerCase(),kg="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",Pg="s3_disable_express_session_auth",el={environmentVariableSelector:(r)=>sr(r,kg,lr.ENV),configFileSelector:(r)=>sr(r,Pg,lr.CONFIG),default:!1};var uf=function(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}},tf=function(r,s){const l=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),f=r.credentialProvider,e=()=>{return clearTimeout(l),r.credentialProvider=f,Promise.resolve(s)};r.credentialProvider=e};class gs extends re.SignatureV4{async signWithCredentials(r,s,l){const f=uf(s);r.headers[Zr]=s.sessionToken;const e=this;return tf(e,f),e.signRequest(r,l??{})}async presignWithCredentials(r,s,l){const f=uf(s);return delete r.headers[Zr],r.headers[ms]=s.sessionToken,r.query=r.query??{},r.query[ms]=s.sessionToken,tf(this,f),this.presign(r,l)}}var se=(r)=>{return(s,l)=>async(f)=>{if(l.endpointV2){const e=l.endpointV2,h=e.properties?.authSchemes?.[0]?.name===pf;if(e.properties?.backend===nf||e.properties?.bucketType===of)l.isS3ExpressBucket=!0;if(h){const a=f.input.Bucket;if(a){const g=await r.s3ExpressIdentityProvider.getS3ExpressIdentity(await r.credentials(),{Bucket:a});if(l.s3ExpressIdentity=g,X.isInstance(f.request)&&g.sessionToken)f.request.headers[Zr]=g.sessionToken}}}return s(f)}},le={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},hl=(r)=>({applyToStack:(s)=>{s.add(se(r),le)}});var ee=V(al(),1);var Dg=V($g(),1),he=V(fl(),1);var fe=async(r,s,l,f)=>{const e=await f.signWithCredentials(l,r,{});if(e.headers["X-Amz-Security-Token"]||e.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return e};var Ug=(r)=>(s)=>{throw s},Mg=(r,s)=>{};var ae=(r)=>(s,l)=>async(f)=>{if(!X.isInstance(f.request))return s(f);const h=he.getSmithyContext(l).selectedHttpAuthScheme;if(!h)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:m={}},identity:a,signer:g}=h;let R;if(l.s3ExpressIdentity)R=await fe(l.s3ExpressIdentity,m,f.request,await r.signer());else R=await g.sign(f.request,a,m);const N=await s({...f,request:R}).catch((g.errorHandler||Ug)(m));return(g.successHandler||Mg)(N.response,m),N},ml=(r)=>({applyToStack:(s)=>{s.addRelativeTo(ae(r),ee.httpSigningMiddlewareOptions)}});var me=(r,{session:s})=>{const[l,f]=s;return{...r,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,followRegionRedirects:r.followRegionRedirects??!1,s3ExpressIdentityProvider:r.s3ExpressIdentityProvider??new Rr(async(e)=>l().send(new f({Bucket:e,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var Tg={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Cg=3000,Fg=(r)=>(s,l)=>async(f)=>{const e=await s(f),{response:h}=e;if(!as.isInstance(h))return e;const{statusCode:m,body:a}=h;if(m<200||m>=300)return e;if(!(typeof a?.stream==="function"||typeof a?.pipe==="function"||typeof a?.tee==="function"))return e;let R=a,N=a;if(a&&typeof a==="object"&&!(a instanceof Uint8Array))[R,N]=await ge(a);h.body=N;const $=await zg(R,{streamCollector:async(M)=>{return we(M,Cg)}});if(typeof R?.destroy==="function")R.destroy();const D=r.utf8Encoder($.subarray($.length-16));if($.length===0&&Tg[l.commandName]){const M=new Error("S3 aborted request");throw M.name="InternalError",M}if(D&&D.endsWith("</Error>"))h.statusCode=400;return e},zg=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},Gg={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},ws=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Fg(r),Gg)}});var gl=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function de(r){return(s,l)=>async(f)=>{if(r.bucketEndpoint){const e=l.endpointV2;if(e){const h=f.input.Bucket;if(typeof h==="string")try{const m=new URL(h);l.endpointV2={...e,url:m}}catch(m){const a=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${h} could not be parsed as URL.`;if(l.logger?.constructor?.name==="NoOpLogger")console.warn(a);else l.logger?.warn?.(a);throw m}}}return s(f)}}var Se={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function yg({bucketEndpoint:r}){return(s)=>async(l)=>{const{input:{Bucket:f}}=l;if(!r&&typeof f==="string"&&!gl(f)&&f.indexOf("/")>=0){const e=new Error(`Bucket name shouldn't contain '/', received '${f}'`);throw e.name="InvalidBucketName",e}return s({...l})}}var Wg={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},Re=(r)=>({applyToStack:(s)=>{s.add(yg(r),Wg),s.addRelativeTo(de(r),Se)}});var Cr=V(al(),1);var Ae=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var $s=V(Ns(),1);var ds={CrtSignerV4:null};class wl{constructor(r){this.sigv4Signer=new gs(r),this.signerOptions=r}async sign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().sign(r,s)}return this.sigv4Signer.sign(r,s)}async signWithCredentials(r,s,l={}){if(l.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().signWithCredentials(r,s,l)}return this.sigv4Signer.signWithCredentials(r,s,l)}async presign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().presign(r,s)}return this.sigv4Signer.presign(r,s)}async presignWithCredentials(r,s,l={}){if(l.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(r,s,l)}getSigv4aSigner(){if(!this.sigv4aSigner){let r=null;try{if(r=ds.CrtSignerV4,typeof r!=="function")throw new Error}catch(s){throw s.message=`${s.message}\n`+'Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. \nYou must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. \nFor more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt',s}this.sigv4aSigner=new r({...this.signerOptions,signingAlgorithm:1})}return this.sigv4aSigner}}var Jr=V(fl(),1);var Ar={["required"]:!1,["type"]:"String"},Er={["required"]:!0,default:!1,["type"]:"Boolean"},vr={["required"]:!1,["type"]:"Boolean"},O={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},P={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},k={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},C={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},eh={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},Ee={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},Is={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},Z={["ref"]:"Bucket"},L={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},Es={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},hh={["ref"]:"url"},ah={["fn"]:"uriEncode",["argv"]:[Z],["assign"]:"uri_encoded_bucket"},b={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},w={},mh={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Z,!1]},dl={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},ks={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},Ie={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},ke={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},d={["fn"]:"not",["argv"]:[C]},Pe={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},Ne={["fn"]:"not",["argv"]:[Is]},$e={["ref"]:"hardwareType"},De={["conditions"]:[d],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},Ss={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},Sl={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},Kg={["ref"]:"ForcePathStyle"},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},z={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},y={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},E={["fn"]:"not",["argv"]:[z]},W={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},Ue={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},F={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},K={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},A={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},Me={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},S={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},Te={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Ce={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Rl={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[hh,"isIp"]},!1]},Al={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:F,["headers"]:{}},Zl={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:F,["headers"]:{}},Fe={["endpoint"]:Zl,["type"]:"endpoint"},El={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},ze={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Rs={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},J={["ref"]:"bucketArn"},gh={["ref"]:"arnType"},Il={["fn"]:"getAttr",["argv"]:[J,"service"]},vl={["ref"]:"accessPointName"},Ge={["conditions"]:[k],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},ye={["conditions"]:[O],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},We={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},kl={["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"},wh={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},dh={["fn"]:"getAttr",["argv"]:[J,"accountId"]},Pl={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},Ke={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},Nl={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},$l={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},Dl={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},Ve={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},Le={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Hr={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},Ze={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},ve={["fn"]:"aws.parseArn",["argv"]:[Z]},He={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Je={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Xe={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Ul={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},Qe={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:{}},ce={["ref"]:"UseObjectLambdaEndpoint"},Ml={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},Ye={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Be={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Oe={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Tl={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:F,["headers"]:{}},qe={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:{}},Cl=[{["ref"]:"Region"}],Vg=[{["ref"]:"Endpoint"}],Lg=[Z],Fl=[k],As=[O],fr=[C,L],_e=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],je=[Es],zl=[ah],Gl=[mh],Ir=[P],ie=[{["fn"]:"substring",["argv"]:[Z,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Z,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],be=[{["conditions"]:[P],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:b,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:b,["headers"]:{}},["type"]:"endpoint"}],xe=[{["fn"]:"substring",["argv"]:[Z,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Z,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],oe=[{["conditions"]:[P],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:ks,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:ks,["headers"]:{}},["type"]:"endpoint"}],Zg=[Is],ne=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],pe=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],vg=["*"],o=[eh],ue=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],n=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],yl=[{["fn"]:"stringEquals",["argv"]:[gh,"accesspoint"]}],te=[{["fn"]:"getAttr",["argv"]:[J,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[vl,""]}]}],Hg=[J,"resourceId[1]"],Wl=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},""]}]}],rh=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[2]"]}]}]}],Jg=[J,"resourceId[2]"],Kl=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]}],["assign"]:"bucketPartition"}],sh=[{["fn"]:"stringEquals",["argv"]:[wh,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],Vl=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[J,"region"]},!0]}],Ll=[{["fn"]:"isValidHostLabel",["argv"]:[dh,!1]}],lh=[{["fn"]:"isValidHostLabel",["argv"]:[vl,!1]}],fh=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],Xg={version:"1.0",parameters:{Bucket:Ar,Region:Ar,UseFIPS:Er,UseDualStack:Er,Endpoint:Ar,ForcePathStyle:Er,Accelerate:Er,UseGlobalEndpoint:Er,UseObjectLambdaEndpoint:vr,Key:Ar,Prefix:Ar,CopySource:Ar,DisableAccessPoints:vr,DisableMultiRegionAccessPoints:Er,UseArnRegion:vr,UseS3ExpressControlEndpoint:vr,DisableS3ExpressSessionAuth:vr},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:Cl}],rules:[{["conditions"]:[O,P],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[k,C],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[C,P],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[C,O],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[P,eh,Ee],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[Is,{["fn"]:"substring",["argv"]:[Z,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:Fl,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:As,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:fr,rules:[{["conditions"]:_e,rules:[{["conditions"]:je,rules:[{["conditions"]:zl,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:b,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Gl,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:b,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},dl],["type"]:"tree"},{["conditions"]:je,rules:[{["conditions"]:zl,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:ks,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Gl,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:ks,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},dl],["type"]:"tree"},{["conditions"]:[Ie,ke],rules:[{["conditions"]:[ah,d],rules:[{["conditions"]:Ir,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:b,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:b,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Gl,rules:[{["conditions"]:_e,rules:[{["conditions"]:ie,rules:be,["type"]:"tree"},{["conditions"]:xe,rules:be,["type"]:"tree"},Pe],["type"]:"tree"},{["conditions"]:ie,rules:oe,["type"]:"tree"},{["conditions"]:xe,rules:oe,["type"]:"tree"},Pe],["type"]:"tree"},dl],["type"]:"tree"},{["conditions"]:[Ne,Ie,ke],rules:[{["conditions"]:fr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:b,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Ir,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com",["properties"]:b,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com",["properties"]:b,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[Is,{["fn"]:"substring",["argv"]:[Z,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[Z,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:[Z,0,7,!0],["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[Z,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:Cl,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:ne,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[$e,"e"]}],rules:[{["conditions"]:pe,rules:[De,{["conditions"]:fr,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:Ss,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Ss,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[$e,"o"]}],rules:[{["conditions"]:pe,rules:[De,{["conditions"]:fr,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:Ss,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:Ss,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Unrecognized hardware type: \"Expected hardware type o or e but got {hardwareType}\"",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",["type"]:"error"}],["type"]:"tree"},{["conditions"]:Zg,rules:[{["conditions"]:[C,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:Vg}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[Sl,mh],rules:[{["conditions"]:o,rules:[{["conditions"]:ue,rules:[{["conditions"]:[O,Ee],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[k,P,T,d,z],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,P,T,d,E,W],rules:[{endpoint:Ue,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,P,T,d,E,K],endpoint:Ue,["type"]:"endpoint"},{["conditions"]:[A,P,T,d,z],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,P,T,d,E,W],rules:[{endpoint:Me,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,P,T,d,E,K],endpoint:Me,["type"]:"endpoint"},{["conditions"]:[k,S,O,d,z],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,S,O,d,E,W],rules:[{endpoint:Te,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,S,O,d,E,K],endpoint:Te,["type"]:"endpoint"},{["conditions"]:[k,S,T,d,z],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,S,T,d,E,W],rules:[{endpoint:Ce,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,S,T,d,E,K],endpoint:Ce,["type"]:"endpoint"},{["conditions"]:[A,S,T,C,L,Es,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,T,C,L,Rl,z],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,T,C,L,Es,E,W],rules:[{["conditions"]:n,endpoint:Al,["type"]:"endpoint"},{endpoint:Al,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,S,T,C,L,Rl,E,W],rules:[{["conditions"]:n,endpoint:Zl,["type"]:"endpoint"},Fe],["type"]:"tree"},{["conditions"]:[A,S,T,C,L,Es,E,K],endpoint:Al,["type"]:"endpoint"},{["conditions"]:[A,S,T,C,L,Rl,E,K],endpoint:Zl,["type"]:"endpoint"},{["conditions"]:[A,S,O,d,z],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,O,d,E,W],rules:[{["conditions"]:n,endpoint:El,["type"]:"endpoint"},{endpoint:El,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,S,O,d,E,K],endpoint:El,["type"]:"endpoint"},{["conditions"]:[A,S,T,d,z],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,S,T,d,E,W],rules:[{["conditions"]:n,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:w},["type"]:"endpoint"},{endpoint:ze,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,S,T,d,E,K],endpoint:ze,["type"]:"endpoint"}],["type"]:"tree"},Rs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[C,L,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[hh,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Z,!0]},Sl,S,A,T],rules:[{["conditions"]:o,rules:[{["conditions"]:ue,rules:[Fe],["type"]:"tree"},Rs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Sl,{["fn"]:"aws.parseArn",["argv"]:Lg,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[gh,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Il,"s3-object-lambda"]}],rules:[{["conditions"]:yl,rules:[{["conditions"]:te,rules:[Ge,ye,{["conditions"]:Wl,rules:[We,{["conditions"]:rh,rules:[kl,{["conditions"]:Kl,rules:[{["conditions"]:o,rules:[{["conditions"]:sh,rules:[{["conditions"]:Vl,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[dh,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:Ll,rules:[{["conditions"]:lh,rules:[{["conditions"]:fr,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Pl,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Ir,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Pl,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Pl,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Ke],["type"]:"tree"},Nl],["type"]:"tree"},$l],["type"]:"tree"},Dl],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Ve],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},Le],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:yl,rules:[{["conditions"]:te,rules:[{["conditions"]:Wl,rules:[{["conditions"]:yl,rules:[{["conditions"]:Wl,rules:[We,{["conditions"]:rh,rules:[kl,{["conditions"]:Kl,rules:[{["conditions"]:o,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[wh,"{partitionResult#name}"]}],rules:[{["conditions"]:Vl,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Il,"s3"]}],rules:[{["conditions"]:Ll,rules:[{["conditions"]:lh,rules:[{["conditions"]:As,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:[P,k],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[P,A],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,k],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A,C,L],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Hr,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Ke],["type"]:"tree"},Nl],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},$l],["type"]:"tree"},Dl],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Ve],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[vl,!0]}],rules:[{["conditions"]:Fl,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:Ir,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:As,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"]:Cl,["assign"]:"mrapPartition"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[J,"partition"]}]}],rules:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:vg}]},["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Access Point Name",["type"]:"error"}],["type"]:"tree"},Le],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Il,"s3-outposts"]}],rules:[{["conditions"]:Fl,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:Ir,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:As,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"]:Hg,["assign"]:"outpostId"}],rules:[{["conditions"]:ne,rules:[kl,{["conditions"]:Kl,rules:[{["conditions"]:o,rules:[{["conditions"]:sh,rules:[{["conditions"]:Vl,rules:[{["conditions"]:Ll,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:Jg,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:fr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:Ze,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ze,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Expected an outpost type `accesspoint`, found {outpostType}",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: expected an access point name",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Expected a 4-component resource",["type"]:"error"}],["type"]:"tree"},Nl],["type"]:"tree"},$l],["type"]:"tree"},Dl],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The Outpost Id was not set",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: No ARN type specified",["type"]:"error"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"substring",["argv"]:[Z,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[ve]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[Kg,!0]},ve],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:zl,rules:[{["conditions"]:o,rules:[{["conditions"]:[T],rules:[{["conditions"]:[k,d,P,z],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,d,P,E,W],rules:[{endpoint:He,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,d,P,E,K],endpoint:He,["type"]:"endpoint"},{["conditions"]:[A,d,P,z],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,d,P,E,W],rules:[{endpoint:Je,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,d,P,E,K],endpoint:Je,["type"]:"endpoint"},{["conditions"]:[k,d,S,z],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[k,d,S,E,W],rules:[{endpoint:Xe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[k,d,S,E,K],endpoint:Xe,["type"]:"endpoint"},{["conditions"]:[A,C,L,S,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,C,L,S,E,W],rules:[{["conditions"]:n,endpoint:Ul,["type"]:"endpoint"},{endpoint:Ul,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,C,L,S,E,K],endpoint:Ul,["type"]:"endpoint"},{["conditions"]:[A,d,S,z],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[A,d,S,E,W],rules:[{["conditions"]:n,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:F,["headers"]:w},["type"]:"endpoint"},{endpoint:Qe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[A,d,S,E,K],endpoint:Qe,["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"]:[ce]},{["fn"]:"booleanEquals",["argv"]:[ce,!0]}],rules:[{["conditions"]:o,rules:[{["conditions"]:fh,rules:[Ge,ye,{["conditions"]:fr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:Ml,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Ir,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:Ml,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:Ml,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Rs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Ne],rules:[{["conditions"]:o,rules:[{["conditions"]:fh,rules:[{["conditions"]:[P,k,d,z],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[P,k,d,E,W],rules:[{endpoint:Ye,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[P,k,d,E,K],endpoint:Ye,["type"]:"endpoint"},{["conditions"]:[P,A,d,z],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[P,A,d,E,W],rules:[{endpoint:Be,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[P,A,d,E,K],endpoint:Be,["type"]:"endpoint"},{["conditions"]:[S,k,d,z],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,k,d,E,W],rules:[{endpoint:Oe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,k,d,E,K],endpoint:Oe,["type"]:"endpoint"},{["conditions"]:[S,A,C,L,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A,C,L,E,W],rules:[{["conditions"]:n,endpoint:Tl,["type"]:"endpoint"},{endpoint:Tl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,A,C,L,E,K],endpoint:Tl,["type"]:"endpoint"},{["conditions"]:[S,A,d,z],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:y,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,A,d,E,W],rules:[{["conditions"]:n,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:F,["headers"]:w},["type"]:"endpoint"},{endpoint:qe,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,A,d,E,K],endpoint:qe,["type"]:"endpoint"}],["type"]:"tree"},Rs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},Sh=Xg;var Qg=new Rh({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),Ps=(r,s={})=>{return Qg.get(r,()=>Eh(Sh,{endpointParams:r,logger:s.logger}))};Ah.aws=Ih;var Nh=function(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,l)=>({signingProperties:{config:s,context:l}})}},$h=function(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,l)=>({signingProperties:{config:s,context:l}})}},cg=(r)=>async(s,l,f)=>{if(!f)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const e=await r(s,l,f),h=Jr.getSmithyContext(l)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!h)throw new Error(`getEndpointParameterInstructions() is not defined on \`${l.commandName}\``);const m=await kh(f,{getEndpointParameterInstructions:h},s);return Object.assign(e,m)},Yg=async(r,s,l)=>{return{operation:Jr.getSmithyContext(s).operation,region:await Jr.normalizeProvider(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Ph=cg(Yg),Bg=(r,s,l)=>{return(e)=>{const m=r(e).properties?.authSchemes;if(!m)return s(e);const a=[];for(let g of m){const{name:R,properties:N={},...$}=g,D=R.toLowerCase();if(R!==D)console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${R}\` to \`${D}\``);let M;if(D==="sigv4a"){M="aws.auth#sigv4a";const ir=m.find((i)=>{const Fr=i.name.toLowerCase();return Fr!=="sigv4a"&&Fr.startsWith("sigv4")});if(!ds.CrtSignerV4&&ir)continue}else if(D.startsWith("sigv4"))M="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${D}\``);const Q=l[M];if(!Q)throw new Error(`Could not find HttpAuthOption create function for \`${M}\``);const B=Q(e);B.schemeId=M,B.signingProperties={...B.signingProperties||{},...$,...N},a.push(B)}return a}},Og=(r)=>{const s=[];switch(r.operation){default:s.push(Nh(r)),s.push($h(r))}return s},Dh=Bg(Ps,Og,{"aws.auth#sigv4":Nh,"aws.auth#sigv4a":$h}),Uh=(r)=>{const s=$s.resolveAwsSdkSigV4Config(r);return{...$s.resolveAwsSdkSigV4AConfig(s)}};var Mh=(r)=>{return{...r,useFipsEndpoint:r.useFipsEndpoint??!1,useDualstackEndpoint:r.useDualstackEndpoint??!1,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,useGlobalEndpoint:r.useGlobalEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,defaultSigningName:"s3"}},kr={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class v extends Th{constructor(r){super(r);Object.setPrototypeOf(this,v.prototype)}}class Ds extends v{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,Ds.prototype)}}class Us extends v{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Us.prototype)}}class Ms extends v{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,Ms.prototype)}}class Ts extends v{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,Ts.prototype)}}class Cs extends v{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,Cs.prototype)}}var Hl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Hl||(Hl={}));var Jl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.ObjectSizeGreaterThan!==void 0)return l.ObjectSizeGreaterThan(s.ObjectSizeGreaterThan);if(s.ObjectSizeLessThan!==void 0)return l.ObjectSizeLessThan(s.ObjectSizeLessThan);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Jl||(Jl={}));var Xl;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.AccessPointArn!==void 0)return l.AccessPointArn(s.AccessPointArn);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Xl||(Xl={}));var Ql;(function(r){r.visit=(s,l)=>{if(s.Prefix!==void 0)return l.Prefix(s.Prefix);if(s.Tag!==void 0)return l.Tag(s.Tag);if(s.And!==void 0)return l.And(s.And);return l._(s.$unknown[0],s.$unknown[1])}})(Ql||(Ql={}));class Fs extends v{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,Fs.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class zs extends v{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,zs.prototype)}}class Gs extends v{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,Gs.prototype)}}var qg=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:H},...r.SessionToken&&{SessionToken:H}}),Ch=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:H},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:H},...r.Credentials&&{Credentials:qg(r.Credentials)}}),Fh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:H},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:H}});var zh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:H}}),Gh=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:H}});var $r=V(Ns(),1);var Ks=V(al(),1);class ys extends v{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,ys.prototype)}}var yh;(function(r){r.visit=(s,l)=>{if(s.Records!==void 0)return l.Records(s.Records);if(s.Stats!==void 0)return l.Stats(s.Stats);if(s.Progress!==void 0)return l.Progress(s.Progress);if(s.Cont!==void 0)return l.Cont(s.Cont);if(s.End!==void 0)return l.End(s.End);return l._(s.$unknown[0],s.$unknown[1])}})(yh||(yh={}));var Wh=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:H},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:H}}),Kh=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:H},...r.SSEKMSKeyId&&{SSEKMSKeyId:H},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:H}});var qh=async(r,s)=>{const l=Ks.requestBuilder(r,s),f=G({},_,{[nw]:r[yw],[qr]:r[Br],[_r]:r[Or],[vs]:r[Zs],[p]:[()=>_(r[er]),()=>r[er].toString()]});l.bp("/"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const e=G({[iw]:[,""]});let h;return l.m("GET").h(f).q(e).b(h),l.build()};var _h=async(r,s)=>{const l=Ks.requestBuilder(r,s),f=G({},_,{[Hw]:r[Ew],[Jw]:[()=>_(r[Vh]),()=>Xr(r[Vh]).toString()],[Ia]:r[la],[Xw]:[()=>_(r[Lh]),()=>Xr(r[Lh]).toString()],[cw]:r[$w],[Hs]:r[Vs],[Ta]:r[ma],[Js]:r[Ls],[Ua]:r[aa],[Pa]:r[ra],[ow]:r[hw]});l.bp("/{Key+}"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1),l.p("Key",()=>r.Key,"{Key+}",!0);const e=G({[za]:[,"GetObject"],[Yw]:[,r[Dw]],[Bw]:[,r[Uw]],[Ow]:[,r[Mw]],[qw]:[,r[Tw]],[_w]:[,r[Cw]],[jw]:[()=>r.ResponseExpires!==void 0,()=>Xr(r[Fw]).toString()],[bw]:[,r[lf]],[Qw]:[()=>r.PartNumber!==void 0,()=>r[Nw].toString()]});let h;return l.m("GET").h(f).q(e).b(h),l.build()};var jh=async(r,s)=>{const l=Ks.requestBuilder(r,s),f=G({},_,{[Aa]:r[th]||"application/octet-stream",[xw]:r[lw],[wa]:r[oh],[da]:r[nh],[Sa]:r[ph],[Ra]:r[uh],[bl]:[()=>_(r[_l]),()=>r[_l].toString()],[Lw]:r[aw],[fd]:r[ew],[ff]:r[ul],[ef]:r[tl],[hf]:r[rf],[af]:r[sf],[xl]:[()=>_(r[jl]),()=>Xr(r[jl]).toString()],[Ia]:r[la],[pw]:r[dw],[uw]:r[Sw],[tw]:r[Rw],[rd]:r[Aw],[qr]:r[Br],[Ma]:r[cr],[Fa]:r[ga],[Hs]:r[Vs],[Ta]:r[ma],[Js]:r[Ls],[_r]:r[Or],[vs]:r[Zs],[p]:[()=>_(r[er]),()=>r[er].toString()],[Ua]:r[aa],[ed]:r[Ww],[$a]:r[ea],[ol]:[()=>_(r[il]),()=>Oh(r[il]).toString()],[Na]:r[fa],[Pa]:r[ra],...r.Metadata!==void 0&&Object.keys(r.Metadata).reduce((a,g)=>{return a[`x-amz-meta-${g.toLowerCase()}`]=r.Metadata[g],a},{})});l.bp("/{Key+}"),l.p("Bucket",()=>r.Bucket,"{Bucket}",!1),l.p("Key",()=>r.Key,"{Key+}",!0);const e=G({[za]:[,"PutObject"]});let h,m;if(r.Body!==void 0)m=r.Body,h=m;return l.m("PUT").h(f).q(e).b(h),l.build()};var ih=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return pl(r,s);const l=G({$metadata:Y(r),[Br]:[,r.headers[qr]],[Or]:[,r.headers[_r]],[Zs]:[,r.headers[vs]],[er]:[()=>r.headers[p]!==void 0,()=>Yr(r.headers[p])]}),f=Pr(ch(await $r.parseXmlBody(r.body,s)),"body");if(f[Bl]!=null)l[Bl]=sw(f[Bl],s);return l};var bh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return pl(r,s);const l=G({$metadata:Y(r),[gw]:[()=>r.headers[vh]!==void 0,()=>Yr(r.headers[vh])],[fw]:[,r.headers[Vw]],[Qr]:[,r.headers[ka]],[Gw]:[,r.headers[sd]],[Iw]:[()=>r.headers[Zh]!==void 0,()=>Pr(Lr(r.headers[Zh]))],[_l]:[()=>r.headers[bl]!==void 0,()=>Yh(r.headers[bl])],[sa]:[,r.headers[Ea]],[ul]:[,r.headers[ff]],[tl]:[,r.headers[ef]],[rf]:[,r.headers[hf]],[sf]:[,r.headers[af]],[kw]:[()=>r.headers[Hh]!==void 0,()=>Ws(r.headers[Hh])],[lf]:[,r.headers[Ca]],[oh]:[,r.headers[wa]],[nh]:[,r.headers[da]],[ph]:[,r.headers[Sa]],[uh]:[,r.headers[Ra]],[mw]:[,r.headers[Zw]],[th]:[,r.headers[Aa]],[jl]:[()=>r.headers[xl]!==void 0,()=>Pr(Lr(r.headers[xl]))],[ww]:[,r.headers[vw]],[ga]:[,r.headers[Fa]],[Br]:[,r.headers[qr]],[Vs]:[,r.headers[Hs]],[Ls]:[,r.headers[Js]],[Or]:[,r.headers[_r]],[er]:[()=>r.headers[p]!==void 0,()=>Yr(r.headers[p])],[cr]:[,r.headers[Ma]],[ha]:[,r.headers[Da]],[zw]:[,r.headers[ld]],[Pw]:[()=>r.headers[Jh]!==void 0,()=>Ws(r.headers[Jh])],[Kw]:[()=>r.headers[Xh]!==void 0,()=>Ws(r.headers[Xh])],[ea]:[,r.headers[$a]],[il]:[()=>r.headers[ol]!==void 0,()=>Pr(nl(r.headers[ol]))],[fa]:[,r.headers[Na]],Metadata:[,Object.keys(r.headers).filter((e)=>e.startsWith("x-amz-meta-")).reduce((e,h)=>{return e[h.substring(11)]=r.headers[h],e},{})]}),f=r.body;return s.sdkStreamMixin(f),l.Body=f,l};var xh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return pl(r,s);const l=G({$metadata:Y(r),[Qr]:[,r.headers[ka]],[sa]:[,r.headers[Ea]],[ul]:[,r.headers[ff]],[tl]:[,r.headers[ef]],[rf]:[,r.headers[hf]],[sf]:[,r.headers[af]],[Br]:[,r.headers[qr]],[lf]:[,r.headers[Ca]],[Vs]:[,r.headers[Hs]],[Ls]:[,r.headers[Js]],[Or]:[,r.headers[_r]],[Zs]:[,r.headers[vs]],[er]:[()=>r.headers[p]!==void 0,()=>Yr(r.headers[p])],[ha]:[,r.headers[Da]]});return await Qh(r.body,s),l};var pl=async(r,s)=>{const l={...r,body:await $r.parseXmlErrorBody(r.body,s)},f=$r.loadRestXmlErrorCode(r,l.body);switch(f){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await pg(l,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await rw(l,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await ig(l,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await bg(l,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await og(l,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await xg(l,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await ng(l,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await ug(l,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await tg(l,s);default:const e=l.body;return jg({output:r,parsedBody:e,errorCode:f})}},jg=Bh(v),ig=async(r,s)=>{const l=G({}),f=r.body,e=new Ms({$metadata:Y(r),...l});return j(e,r.body)},bg=async(r,s)=>{const l=G({}),f=r.body,e=new Ts({$metadata:Y(r),...l});return j(e,r.body)},xg=async(r,s)=>{const l=G({}),f=r.body;if(f[Yl]!=null)l[Yl]=Nr(f[Yl]);if(f[cr]!=null)l[cr]=Nr(f[cr]);const e=new Fs({$metadata:Y(r),...l});return j(e,r.body)},og=async(r,s)=>{const l=G({}),f=r.body,e=new Cs({$metadata:Y(r),...l});return j(e,r.body)},ng=async(r,s)=>{const l=G({}),f=r.body,e=new zs({$metadata:Y(r),...l});return j(e,r.body)},pg=async(r,s)=>{const l=G({}),f=r.body,e=new Ds({$metadata:Y(r),...l});return j(e,r.body)},ug=async(r,s)=>{const l=G({}),f=r.body,e=new Gs({$metadata:Y(r),...l});return j(e,r.body)},tg=async(r,s)=>{const l=G({}),f=r.body,e=new ys({$metadata:Y(r),...l});return j(e,r.body)},rw=async(r,s)=>{const l=G({}),f=r.body,e=new Us({$metadata:Y(r),...l});return j(e,r.body)};var sw=(r,s)=>{const l={};if(r[cl]!=null)l[cl]=Nr(r[cl]);if(r[Ol]!=null)l[Ol]=Nr(r[Ol]);if(r[ql]!=null)l[ql]=Nr(r[ql]);if(r[Qr]!=null)l[Qr]=Pr(nl(r[Qr]));return l};var Y=(r)=>({httpStatusCode:r.statusCode,requestId:r.headers["x-amzn-requestid"]??r.headers["x-amzn-request-id"]??r.headers["x-amz-request-id"],extendedRequestId:r.headers["x-amz-id-2"],cfId:r.headers["x-amz-cf-id"]});var _=(r)=>r!==void 0&&r!==null&&r!==""&&(!Object.getOwnPropertyNames(r).includes("length")||r.length!=0)&&(!Object.getOwnPropertyNames(r).includes("size")||r.size!=0);var lw="ACL";var cl="AccessKeyId";var fw="AcceptRanges";var Yl="AccessTier";var er="BucketKeyEnabled";var Bl="Credentials",ew="ChecksumAlgorithm";var oh="CacheControl",ul="ChecksumCRC32",tl="ChecksumCRC32C",nh="ContentDisposition";var ph="ContentEncoding";var uh="ContentLanguage",_l="ContentLength",hw="ChecksumMode",aw="ContentMD5";var mw="ContentRange";var rf="ChecksumSHA1",sf="ChecksumSHA256";var th="ContentType";var gw="DeleteMarker";var jl="Expires";var ra="ExpectedBucketOwner";var ww="ExpiresString";var sa="ETag";var Qr="Expiration";var dw="GrantFullControl";var Sw="GrantRead",Rw="GrantReadACP";var Aw="GrantWriteACP";var Ew="IfMatch",Vh="IfModifiedSince",la="IfNoneMatch";var Lh="IfUnmodifiedSince";var Iw="LastModified";var kw="MissingMeta";var fa="ObjectLockLegalHoldStatus",ea="ObjectLockMode";var il="ObjectLockRetainUntilDate";var Pw="PartsCount";var Nw="PartNumber";var $w="Range";var ha="RequestCharged",Dw="ResponseCacheControl",Uw="ResponseContentDisposition",Mw="ResponseContentEncoding",Tw="ResponseContentLanguage",Cw="ResponseContentType";var Fw="ResponseExpires";var aa="RequestPayer";var zw="ReplicationStatus";var Gw="Restore";var Ol="SecretAccessKey";var cr="StorageClass";var yw="SessionMode";var Br="ServerSideEncryption";var Vs="SSECustomerAlgorithm",ma="SSECustomerKey",Ls="SSECustomerKeyMD5";var Zs="SSEKMSEncryptionContext",Or="SSEKMSKeyId";var ql="SessionToken";var Ww="Tagging";var Kw="TagCount";var lf="VersionId";var ga="WebsiteRedirectLocation";var Vw="accept-ranges";var wa="cache-control",da="content-disposition",Sa="content-encoding",Ra="content-language",bl="content-length",Lw="content-md5",Zw="content-range",Aa="content-type";var xl="expires";var Ea="etag",vw="expiresstring";var Hw="if-match",Jw="if-modified-since";var Ia="if-none-match";var Xw="if-unmodified-since";var Zh="last-modified";var Qw="partNumber";var cw="range",Yw="response-cache-control",Bw="response-content-disposition",Ow="response-content-encoding",qw="response-content-language",_w="response-content-type",jw="response-expires";var iw="session";var bw="versionId";var xw="x-amz-acl";var ff="x-amz-checksum-crc32",ef="x-amz-checksum-crc32c",ow="x-amz-checksum-mode";var hf="x-amz-checksum-sha1",af="x-amz-checksum-sha256";var nw="x-amz-create-session-mode";var vh="x-amz-delete-marker",ka="x-amz-expiration",Pa="x-amz-expected-bucket-owner";var pw="x-amz-grant-full-control",uw="x-amz-grant-read",tw="x-amz-grant-read-acp";var rd="x-amz-grant-write-acp";var Hh="x-amz-missing-meta";var Jh="x-amz-mp-parts-count";var Na="x-amz-object-lock-legal-hold",$a="x-amz-object-lock-mode",ol="x-amz-object-lock-retain-until-date";var sd="x-amz-restore",Da="x-amz-request-charged";var Ua="x-amz-request-payer";var ld="x-amz-replication-status";var Ma="x-amz-storage-class",fd="x-amz-sdk-checksum-algorithm";var qr="x-amz-server-side-encryption",_r="x-amz-server-side-encryption-aws-kms-key-id",p="x-amz-server-side-encryption-bucket-key-enabled",vs="x-amz-server-side-encryption-context",Hs="x-amz-server-side-encryption-customer-algorithm",Ta="x-amz-server-side-encryption-customer-key",Js="x-amz-server-side-encryption-customer-key-md5",ed="x-amz-tagging",Xh="x-amz-tagging-count";var Ca="x-amz-version-id",Fa="x-amz-website-redirect-location",za="x-id";class mf extends Dr.classBuilder().ep({...kr,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,l,f){return[Ur(l,this.serialize,this.deserialize),Mr(l,r.getEndpointParameterInstructions()),ws(l)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(Fh,Ch).ser(qh).de(ih).build(){}var Ga={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 Bs=V(Ns(),1);var ad="AWS_S3_USE_ARN_REGION",md="s3_use_arn_region",ya={environmentVariableSelector:(r)=>sr(r,ad,lr.ENV),configFileSelector:(r)=>sr(r,md,lr.CONFIG),default:!1};var u=V(Ka(),1);var Va=V(Ka(),1),Wa=function(r){for(let s=0;s<8;s++)r[s]^=255;for(let s=7;s>-1;s--)if(r[s]++,r[s]!==0)break};class Tr{constructor(r){if(this.bytes=r,r.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(r){if(r>9223372036854776000||r<-9223372036854776000)throw new Error(`${r} is too large (or, if negative, too small) to represent as an Int64`);const s=new Uint8Array(8);for(let l=7,f=Math.abs(Math.round(r));l>-1&&f>0;l--,f/=256)s[l]=f;if(r<0)Wa(s);return new Tr(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)Wa(r);return parseInt(Va.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 e of Object.keys(r)){const h=this.fromUtf8(e);s.push(Uint8Array.from([h.byteLength]),h,this.formatHeaderValue(r[e]))}const l=new Uint8Array(s.reduce((e,h)=>e+h.byteLength,0));let f=0;for(let e of s)l.set(e,f),f+=e.byteLength;return l}formatHeaderValue(r){switch(r.type){case"boolean":return Uint8Array.from([r.value?0:1]);case"byte":return Uint8Array.from([2,r.value]);case"short":const s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,r.value,!1),new Uint8Array(s.buffer);case"integer":const l=new DataView(new ArrayBuffer(5));return l.setUint8(0,4),l.setInt32(1,r.value,!1),new Uint8Array(l.buffer);case"long":const f=new Uint8Array(9);return f[0]=5,f.set(r.value.bytes,1),f;case"binary":const e=new DataView(new ArrayBuffer(3+r.value.byteLength));e.setUint8(0,6),e.setUint16(1,r.value.byteLength,!1);const h=new Uint8Array(e.buffer);return h.set(r.value,3),h;case"string":const m=this.fromUtf8(r.value),a=new DataView(new ArrayBuffer(3+m.byteLength));a.setUint8(0,7),a.setUint16(1,m.byteLength,!1);const g=new Uint8Array(a.buffer);return g.set(m,3),g;case"timestamp":const R=new Uint8Array(9);return R[0]=8,R.set(Tr.fromNumber(r.value.valueOf()).bytes,1),R;case"uuid":if(!Fd.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const N=new Uint8Array(17);return N[0]=9,N.set(u.fromHex(r.value.replace(/\-/g,"")),1),N}}parse(r){const s={};let l=0;while(l<r.byteLength){const f=r.getUint8(l++),e=this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+l,f));switch(l+=f,r.getUint8(l++)){case 0:s[e]={type:Za,value:!0};break;case 1:s[e]={type:Za,value:!1};break;case 2:s[e]={type:Pd,value:r.getInt8(l++)};break;case 3:s[e]={type:Nd,value:r.getInt16(l,!1)},l+=2;break;case 4:s[e]={type:$d,value:r.getInt32(l,!1)},l+=4;break;case 5:s[e]={type:Dd,value:new Tr(new Uint8Array(r.buffer,r.byteOffset+l,8))},l+=8;break;case 6:const h=r.getUint16(l,!1);l+=2,s[e]={type:Ud,value:new Uint8Array(r.buffer,r.byteOffset+l,h)},l+=h;break;case 7:const m=r.getUint16(l,!1);l+=2,s[e]={type:Md,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+l,m))},l+=m;break;case 8:s[e]={type:Td,value:new Date(new Tr(new Uint8Array(r.buffer,r.byteOffset+l,8)).valueOf())},l+=8;break;case 9:const a=new Uint8Array(r.buffer,r.byteOffset+l,16);l+=16,s[e]={type:Cd,value:`${u.toHex(a.subarray(0,4))}-${u.toHex(a.subarray(4,6))}-${u.toHex(a.subarray(6,8))}-${u.toHex(a.subarray(8,10))}-${u.toHex(a.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return s}}var La;(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"})(La||(La={}));var Za="boolean",Pd="byte",Nd="short",$d="integer",Dd="long",Ud="binary",Md="string",Td="timestamp",Cd="uuid",Fd=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function Ha({byteLength:r,byteOffset:s,buffer:l}){if(r<zd)throw new Error("Provided message too short to accommodate event stream message overhead");const f=new DataView(l,s,r),e=f.getUint32(0,!1);if(r!==e)throw new Error("Reported message length does not match received message length");const h=f.getUint32(va,!1),m=f.getUint32(t,!1),a=f.getUint32(r-hr,!1),g=new rr().update(new Uint8Array(l,s,t));if(m!==g.digest())throw new Error(`The prelude checksum specified in the message (${m}) does not match the calculated CRC32 checksum (${g.digest()})`);if(g.update(new Uint8Array(l,s+t,r-(t+hr))),a!==g.digest())throw new Error(`The message checksum (${g.digest()}) did not match the expected value of ${a}`);return{headers:new DataView(l,s+t+hr,h),body:new Uint8Array(l,s+t+hr+h,e-h-(t+hr+hr))}}var va=4,t=va*2,hr=4,zd=t+hr*2;class wf{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 l=this.headerMarshaller.format(r),f=l.byteLength+s.byteLength+16,e=new Uint8Array(f),h=new DataView(e.buffer,e.byteOffset,e.byteLength),m=new rr;return h.setUint32(0,f,!1),h.setUint32(4,l.byteLength,!1),h.setUint32(8,m.update(e.subarray(0,8)).digest(),!1),e.set(l,12),e.set(s,l.byteLength+12),h.setUint32(f-4,m.update(e.subarray(8,f-4)).digest(),!1),e}decode(r){const{headers:s,body:l}=Ha(r);return{headers:this.headerMarshaller.parse(s),body:l}}formatHeaders(r){return this.headerMarshaller.format(r)}}class df{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 Sf{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 Rf{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 Af{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 Ja(r){let s=0,l=0,f=null,e=null;const h=(a)=>{if(typeof a!=="number")throw new Error("Attempted to allocate an event message where size was not a number: "+a);s=a,l=4,f=new Uint8Array(a),new DataView(f.buffer).setUint32(0,a,!1)},m=async function*(){const a=r[Symbol.asyncIterator]();while(!0){const{value:g,done:R}=await a.next();if(R){if(!s)return;else if(s===l)yield f;else throw new Error("Truncated event message received.");return}const N=g.length;let $=0;while($<N){if(!f){const M=N-$;if(!e)e=new Uint8Array(4);const Q=Math.min(4-l,M);if(e.set(g.slice($,$+Q),l),l+=Q,$+=Q,l<4)break;h(new DataView(e.buffer).getUint32(0,!1)),e=null}const D=Math.min(s-l,N-$);if(f.set(g.slice($,$+D),l),l+=D,$+=D,s&&s===l)yield f,f=null,s=0,l=0}}};return{[Symbol.asyncIterator]:m}}function Xa(r,s){return async function(l){const{value:f}=l.headers[":message-type"];if(f==="error"){const e=new Error(l.headers[":error-message"].value||"UnknownError");throw e.name=l.headers[":error-code"].value,e}else if(f==="exception"){const e=l.headers[":exception-type"].value,h={[e]:l},m=await r(h);if(m.$unknown){const a=new Error(s(l.body));throw a.name=e,a}throw m[e]}else if(f==="event"){const e={[l.headers[":event-type"].value]:l},h=await r(e);if(h.$unknown)return;return h}else throw Error(`Unrecognizable event type: ${l.headers[":event-type"].value}`)}}class Xs{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new wf(r,s),this.utfEncoder=r}deserialize(r,s){const l=Ja(r);return new Rf({messageStream:new df({inputStream:l,decoder:this.eventStreamCodec}),deserializer:Xa(s,this.utfEncoder)})}serialize(r,s){return new Sf({messageStream:new Af({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as Gd} from"stream";async function*Qa(r){let s=!1,l=!1;const f=new Array;r.on("error",(e)=>{if(!s)s=!0;if(e)throw e}),r.on("data",(e)=>{f.push(e)}),r.on("end",()=>{s=!0});while(!l){const e=await new Promise((h)=>setTimeout(()=>h(f.shift()),0));if(e)yield e;l=s&&f.length===0}}class Ef{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new Xs({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const l=typeof r[Symbol.asyncIterator]==="function"?r:Qa(r);return this.universalMarshaller.deserialize(l,s)}serialize(r,s){return Gd.from(this.universalMarshaller.serialize(r,s))}}var ca=(r)=>new Ef(r);import{Writable as yd} from"stream";class Qs extends yd{constructor(r,s){super(s);this.hash=r}_write(r,s,l){try{this.hash.update(ss(r))}catch(f){return l(f)}l()}}var Ya=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const l=new r,f=new Qs(l);return s.pipe(f),new Promise((e,h)=>{s.on("error",(m)=>{f.end(),h(m)}),f.on("error",h),f.on("finish",()=>{l.digest().then(e).catch(h)})})};var cs=V(Ns(),1);var xa=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??qa,base64Encoder:r?.base64Encoder??_a,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??Ps,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??ja,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??Dh,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new cs.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new cs.AwsSdkSigV4ASigner}],logger:r?.logger??new hs,sdkStreamMixin:r?.sdkStreamMixin??ia,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??wl,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??ba,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??Ba,utf8Encoder:r?.utf8Encoder??Oa}};var dm=(r)=>{ua(process.version);const s=gm(r),l=()=>s().then(pa),f=xa(r);return Bs.emitWarningIfUnsupportedVersion(process.version),{...f,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??mm,credentialDefaultProvider:r?.credentialDefaultProvider??wm,defaultUserAgentProvider:r?.defaultUserAgentProvider??am({serviceId:f.serviceId,clientVersion:Ga.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??q(el),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??ca,maxAttempts:r?.maxAttempts??q(em),md5:r?.md5??Ys.bind(null,"md5"),region:r?.region??q(sm,lm),requestChecksumCalculation:r?.requestChecksumCalculation??q(zf),requestHandler:oa.create(r?.requestHandler??l),responseChecksumValidation:r?.responseChecksumValidation??q(Gf),retryMode:r?.retryMode??q({...hm,default:async()=>(await l()).retryMode||fm}),sha1:r?.sha1??Ys.bind(null,"sha1"),sha256:r?.sha256??Ys.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??q(Bs.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??na,streamHasher:r?.streamHasher??Ya,useArnRegion:r?.useArnRegion??q(ya),useDualstackEndpoint:r?.useDualstackEndpoint??q(ta),useFipsEndpoint:r?.useFipsEndpoint??q(rm)}};var Sm=(r)=>{const s=r.httpAuthSchemes;let{httpAuthSchemeProvider:l,credentials:f}=r;return{setHttpAuthScheme(e){const h=s.findIndex((m)=>m.schemeId===e.schemeId);if(h===-1)s.push(e);else s.splice(h,1,e)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(e){l=e},httpAuthSchemeProvider(){return l},setCredentials(e){f=e},credentials(){return f}}},Rm=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var Os=(r)=>r,$m=(r,s)=>{const l={...Os(Pm(r)),...Os(Im(r)),...Os(Am(r)),...Os(Sm(r))};return s.forEach((f)=>f.configure(l)),{...r,...Nm(l),...km(l),...Em(l),...Rm(l)}};class If extends Cm{constructor(...[r]){const s=dm(r||{}),l=Mh(s),f=Fm(l),e=Of(f),h=Km(e),m=Gm(h),a=Dm(m),g=Wm(a),R=Ae(g),N=Uh(R),$=me(N,{session:[()=>this,mf]}),D=$m($,r?.extensions||[]);super(D);this.config=D,this.middlewareStack.use(zm(this.config)),this.middlewareStack.use(Vm(this.config)),this.middlewareStack.use(ym(this.config)),this.middlewareStack.use(Um(this.config)),this.middlewareStack.use(Mm(this.config)),this.middlewareStack.use(Tm(this.config)),this.middlewareStack.use(Cr.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Ph,identityProviderConfigProvider:async(M)=>new Cr.DefaultIdentityProviderConfig({"aws.auth#sigv4":M.credentials,"aws.auth#sigv4a":M.credentials})})),this.middlewareStack.use(Cr.getHttpSigningPlugin(this.config)),this.middlewareStack.use(Re(this.config)),this.middlewareStack.use(Mf(this.config)),this.middlewareStack.use(bf(this.config)),this.middlewareStack.use(hl(this.config)),this.middlewareStack.use(ml(this.config))}destroy(){super.destroy()}}function Wd(r){return(s)=>async(l)=>{const f={...l.input},e=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let h of e){const m=f[h.target];if(m){let a;if(typeof m==="string")if(Vd(m,r))a=r.base64Decoder(m);else a=r.utf8Decoder(m),f[h.target]=r.base64Encoder(a);else a=ArrayBuffer.isView(m)?new Uint8Array(m.buffer,m.byteOffset,m.byteLength):new Uint8Array(m),f[h.target]=r.base64Encoder(a);const g=new r.md5;g.update(a),f[h.hash]=r.base64Encoder(await g.digest())}}return s({...l,input:f})}}function Vd(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 Kd={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},qs=(r)=>({applyToStack:(s)=>{s.add(Wd(r),Kd)}});class kf extends Dr.classBuilder().ep({...kr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,l,f){return[Ur(l,this.serialize,this.deserialize),Mr(l,r.getEndpointParameterInstructions()),es(l,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),qs(l),xf(l)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(Gh,zh).ser(_h).de(bh).build(){}class Pf extends Dr.classBuilder().ep({...kr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,l,f){return[Ur(l,this.serialize,this.deserialize),Mr(l,r.getEndpointParameterInstructions()),es(l,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),qf(l),ws(l),qs(l)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(Kh,Wh).ser(jh).de(xh).build(){}import{Buffer as Lm} from"buffer";class Zm extends ar{client;constructor(...r){super();this.client=new If(...r)}async put(r){let s,l,f,e=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,f=`${br()}.${r.type.split("/")[1].split(";")[0]}`,l=r.type;else s=r.body,f=r.name,l=r.contentType;l=s instanceof Blob||s instanceof File?s.type:void 0;const h=s instanceof Lm?s:Lm.from(await s.arrayBuffer());return await this.client.send(new Pf({Bucket:e,Key:f,Body:h,ContentType:l})),f}async fetch(r){let s=process.env.BUCKET_NAME,l;if(typeof r==="string")l=r;else s=r.bucket??s,l=r.name;if(!l)throw new Error("Object name has to be specified");const f=await this.client.send(new kf({Bucket:s,Key:l}));return new Response(f.Body.transformToWebStream(),{headers:{"Content-Type":f.ContentType,"Content-Length":f.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":f.LastModified?.toUTCString()||"",ETag:f.ETag||""}})}}class _s{}class js extends _s{constructor(){super(...arguments)}requests=new Map;consume(r,s){if(!this.requests.has(r))this.requests.set(r,{date:Date.now(),count:1});else{const l=this.requests.get(r),f=Date.now();if(f-l.date>=60000)this.requests.set(r,{date:f,count:1});else this.requests.set(r,{date:l.date,count:l.count+1})}return this.requests.get(r).count}}class vm extends c{constructor(){super(...arguments)}driver=new js;boot(){}}import*as Jd from"react-dom/server";var cm=V(Ld(),1);import{Writable as Yd} from"stream";var{defineProperty:Zd,getOwnPropertySymbols:Hm}=Object,vd=Object.prototype.hasOwnProperty,Hd=Object.prototype.propertyIsEnumerable,Jm=(r,s,l)=>(s in r)?Zd(r,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[s]=l,Nf=(r,s)=>{for(var l in s||(s={}))if(vd.call(s,l))Jm(r,l,s[l]);if(Hm){for(var l of Hm(s))if(Hd.call(s,l))Jm(r,l,s[l])}return r},$f=(r,s,l)=>{return new Promise((f,e)=>{var h=(g)=>{try{a(l.next(g))}catch(R){e(R)}},m=(g)=>{try{a(l.throw(g))}catch(R){e(R)}},a=(g)=>g.done?f(g.value):Promise.resolve(g.value).then(h,m);a((l=l.apply(r,s)).next())})},Xd={unformatted:["code","pre","em","strong","span"],indent_inner_html:!0,indent_char:" ",indent_size:2,sep:"\n"},Qd=(r,s={})=>{return cm.default.html(r,Nf(Nf({},Xd),s))},cd=[{selector:"img",format:"skip"},{selector:"#__react-email-preview",format:"skip"},{selector:"a",options:{linkBrackets:!1}}];var Xm=new TextDecoder("utf-8"),Qm=(r)=>$f(void 0,null,function*(){let s="";if("pipeTo"in r){const l=new WritableStream({write(f){s+=Xm.decode(f)}});yield r.pipeTo(l)}else{const l=new Yd({write(f,e,h){s+=Xm.decode(f),h()}});return r.pipe(l),new Promise((f,e)=>{l.on("error",e),l.on("close",()=>{f(s)})})}return s}),is=(r,s)=>$f(void 0,null,function*(){const{default:l}=yield import("react-dom/server");let f;if(Object.hasOwn(l,"renderToReadableStream"))f=yield Qm(yield l.renderToReadableStream(r));else yield new Promise((m,a)=>{const g=l.renderToPipeableStream(r,{onAllReady(){return $f(this,null,function*(){f=yield Qm(g),m()})},onError(R){a(R)}})});if(s==null?void 0:s.plainText)return Df(f,Nf({selectors:cd},s.htmlToTextOptions));const h=`${'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'}${f.replace(/<!DOCTYPE.*?>/,"")}`;if(s==null?void 0:s.pretty)return Qd(h);return h});var{defineProperty:Bd,defineProperties:Od,getOwnPropertyDescriptors:qd,getOwnPropertySymbols:Ym}=Object,_d=Object.prototype.hasOwnProperty,jd=Object.prototype.propertyIsEnumerable,Bm=(r,s,l)=>(s in r)?Bd(r,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[s]=l,jr=(r,s)=>{for(var l in s||(s={}))if(_d.call(s,l))Bm(r,l,s[l]);if(Ym){for(var l of Ym(s))if(jd.call(s,l))Bm(r,l,s[l])}return r},id=(r,s)=>Od(r,qd(s)),I=(r,s,l)=>{return new Promise((f,e)=>{var h=(g)=>{try{a(l.next(g))}catch(R){e(R)}},m=(g)=>{try{a(l.throw(g))}catch(R){e(R)}},a=(g)=>g.done?f(g.value):Promise.resolve(g.value).then(h,m);a((l=l.apply(r,s)).next())})},bd="3.5.0",xd=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post("/api-keys",s,l)})}list(){return I(this,null,function*(){return yield this.resend.get("/api-keys")})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/api-keys/${r}`)})}},od=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post("/audiences",s,l)})}list(){return I(this,null,function*(){return yield this.resend.get("/audiences")})}get(r){return I(this,null,function*(){return yield this.resend.get(`/audiences/${r}`)})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/audiences/${r}`)})}},nd=class{constructor(r){this.resend=r}send(r){return I(this,arguments,function*(s,l={}){return this.create(s,l)})}create(r){return I(this,arguments,function*(s,l={}){for(let e of s)if(e.react)e.html=yield is(e.react),delete e.react;return yield this.resend.post("/emails/batch",s,l)})}},pd=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post(`/audiences/${s.audienceId}/contacts`,{unsubscribed:s.unsubscribed,email:s.email,first_name:s.firstName,last_name:s.lastName},l)})}list(r){return I(this,null,function*(){return yield this.resend.get(`/audiences/${r.audienceId}/contacts`)})}get(r){return I(this,null,function*(){return yield this.resend.get(`/audiences/${r.audienceId}/contacts/${r.id}`)})}update(r){return I(this,null,function*(){return yield this.resend.patch(`/audiences/${r.audienceId}/contacts/${r.id}`,{unsubscribed:r.unsubscribed,first_name:r.firstName,last_name:r.lastName})})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/audiences/${r.audienceId}/contacts/${(r==null?void 0:r.email)?r==null?void 0:r.email:r==null?void 0:r.id}`)})}},ud=class{constructor(r){this.resend=r}create(r){return I(this,arguments,function*(s,l={}){return yield this.resend.post("/domains",s,l)})}list(){return I(this,null,function*(){return yield this.resend.get("/domains")})}get(r){return I(this,null,function*(){return yield this.resend.get(`/domains/${r}`)})}update(r){return I(this,null,function*(){return yield this.resend.patch(`/domains/${r.id}`,{click_tracking:r.clickTracking,open_tracking:r.openTracking,tls:r.tls})})}remove(r){return I(this,null,function*(){return yield this.resend.delete(`/domains/${r}`)})}verify(r){return I(this,null,function*(){return yield this.resend.post(`/domains/${r}/verify`)})}},td=class{constructor(r){this.resend=r}send(r){return I(this,arguments,function*(s,l={}){return this.create(s,l)})}create(r){return I(this,arguments,function*(s,l={}){if(s.react)s.html=yield is(s.react),delete s.react;return yield this.resend.post("/emails",s,l)})}get(r){return I(this,null,function*(){return yield this.resend.get(`/emails/${r}`)})}},Om="https://api.resend.com",qm=`resend-node:${bd}`,r3=typeof process!=="undefined"&&process.env?process.env.RESEND_BASE_URL||Om:Om,s3=typeof process!=="undefined"&&process.env?process.env.RESEND_USER_AGENT||qm:qm,_m=class{constructor(r){if(this.key=r,this.apiKeys=new xd(this),this.audiences=new od(this),this.batch=new nd(this),this.contacts=new pd(this),this.domains=new ud(this),this.emails=new td(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":s3,"Content-Type":"application/json"})}fetchRequest(r){return I(this,arguments,function*(s,l={}){try{const f=yield fetch(`${r3}${s}`,l);if(!f.ok)try{const h=yield f.text();return{data:null,error:JSON.parse(h)}}catch(h){if(h instanceof SyntaxError)return{data:null,error:{name:"application_error",message:"Internal server error. We are unable to process your request right now, please try again later."}};const m={message:f.statusText,name:"application_error"};if(h instanceof Error)return{data:null,error:id(jr({},m),{message:h.message})};return{data:null,error:m}}return{data:yield f.json(),error:null}}catch(f){return{data:null,error:{name:"application_error",message:"Unable to fetch data. The request could not be resolved."}}}})}post(r,s){return I(this,arguments,function*(l,f,e={}){const h=jr({method:"POST",headers:this.headers,body:JSON.stringify(f)},e);return this.fetchRequest(l,h)})}get(r){return I(this,arguments,function*(s,l={}){const f=jr({method:"GET",headers:this.headers},l);return this.fetchRequest(s,f)})}put(r,s){return I(this,arguments,function*(l,f,e={}){const h=jr({method:"PUT",headers:this.headers,body:JSON.stringify(f)},e);return this.fetchRequest(l,h)})}patch(r,s){return I(this,arguments,function*(l,f,e={}){const h=jr({method:"PATCH",headers:this.headers,body:JSON.stringify(f)},e);return this.fetchRequest(l,h)})}delete(r,s){return I(this,null,function*(){const l={method:"DELETE",headers:this.headers,body:JSON.stringify(s)};return this.fetchRequest(r,l)})}};class bs{}class xs extends bs{r;constructor(r=process.env.RESEND_API_KEY){super();this.apiKey=r}async send(r){const s=new _m(this.apiKey);console.log(r);const{data:l,error:f}=await s.emails.send({...r});if(f)return console.error(f),!1;if(l)return!0}}class jm extends c{constructor(){super(...arguments)}driver=new xs;boot(){}}class im extends c{constructor(){super(...arguments)}channels={};boot(){}}class bm extends c{constructor(){super(...arguments)}root;rootRouter;boot(){}}class xm extends c{constructor(){super(...arguments)}rootRouter;boot(){return"Origin"}}export{bm as ViewRouterServiceProvider,Zm as S3Driver,xs as ResendDriver,vm as RateLimiterServiceProvider,_s as RateLimiterDriver,js as InMemoryRateLimiter,xr as FileSystemDriver,Uf as FileStorageServiceProvider,ar as FileStorageDriver,jm as EmailServiceProvider,bs as EmailDriver,im as BroadcastingServiceProvider,xm as ApiRouterServiceProvider};export{Uf as w,xm as x,vm as y,jm as z,im as A,bm as B};
3
3
 
4
- //# debugId=7D7A12A40F1D2FDB64756e2164756e21
4
+ //# debugId=3DC11D45084A586D64756e2164756e21