@agentlang/lstudio 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/fs-BFPzyhvM.js +1 -0
- package/assets/index-BZcC_1YB.css +1 -0
- package/assets/{index-r7-q4_iF-Cr8pMb-3.js → index-Bz3SWrlh-BOC9aAgh.js} +1 -1
- package/assets/{index-Bv8Vsab1.js → index-CWcv-6Zk.js} +442 -389
- package/assets/{index-DjgOAzh3.js → index-CuvfCO6A.js} +1 -1
- package/assets/{index-D4z_hbl0-CUGEU9es.js → index-D4z_hbl0-y_rvYJag.js} +1 -1
- package/assets/index-Dcg-T9P7.js +1 -0
- package/assets/index-Dsv5Y1bn.js +1 -0
- package/assets/{index-BGkQxT4m-C1mCQewh.js → index-hklP5STE-Bcq23IoH.js} +5 -5
- package/assets/{index-C8iIEab-.js → index-v-qSLw3O.js} +1 -1
- package/assets/{index.browser-DeDPTzNn.js → index.browser-CNuJpQRF.js} +3 -3
- package/assets/loadCognitoIdentity-CyU-paEc.js +1 -0
- package/assets/loadSts-_086JMFD.js +1 -0
- package/assets/{normalizeProvider-EC8cbfMc.js → normalizeProvider-BrOPyH3l.js} +1 -1
- package/assets/{replService-CCPvmbEx.js → replService-zFxUAnXb.js} +1 -1
- package/assets/resolveDefaultsModeConfig-D1zWPouA.js +15 -0
- package/assets/{util-Bzh8z3-b.js → util-DRQhMG0c.js} +1 -1
- package/assets/{winston-1qzyIKCb-Co5uzAFy.js → winston-1qzyIKCb-DrBzcKjE.js} +1 -1
- package/assets/{winston-9LLUP2iD.js → winston-BBhfKzmi.js} +1 -1
- package/assets/{winston-CtxF18qc-yrByRl6_.js → winston-CtxF18qc-R9Ff3XLo.js} +1 -1
- package/assets/{winston-BmZyhpGP.js → winston-oUPj17yo.js} +1 -1
- package/index.html +3 -3
- package/package.json +1 -1
- package/assets/AwsJson1_1Protocol-BuTiU31K.js +0 -1
- package/assets/index-B-OvH2Yt.css +0 -1
- package/assets/index-CIghMZpI.js +0 -1
- package/assets/index-CSWrk3qy.js +0 -15
- package/assets/index-Dds8U7KS.js +0 -1
- package/assets/loadCognitoIdentity-ieB3gz6G.js +0 -1
- package/assets/loadSts-BPFRej1_.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as On,g as Tn}from"./_commonjsHelpers-D6-XlEtG.js";import{a as En,b as Nn,c as In,r as An}from"./winston-
|
|
1
|
+
import{a as On,g as Tn}from"./_commonjsHelpers-D6-XlEtG.js";import{a as En,b as Nn,c as In,r as An}from"./winston-oUPj17yo.js";import{c as it,r as Pe}from"./_commonjs-dynamic-modules-B7n8ZNar.js";import{r as Fr}from"./util-DRQhMG0c.js";function Fn(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const u=Object.getOwnPropertyDescriptor(n,s);u&&Object.defineProperty(e,s,u.get?u:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Ut={exports:{}},Dr;function Rn(){return Dr||(Dr=1,(function(e,t){(function(r){e.exports=r()})(function(){return(function r(n,s,u){function g(L,j){if(!s[L]){if(!n[L]){var ee=typeof it=="function"&⁢if(!j&&ee)return ee(L,!0);if(T)return T(L,!0);throw new Error("Cannot find module '"+L+"'")}j=s[L]={exports:{}},n[L][0].call(j.exports,function(k){var Q=n[L][1][k];return g(Q||k)},j,j.exports,r,n,s,u)}return s[L].exports}for(var T=typeof it=="function"&&it,F=0;F<u.length;F++)g(u[F]);return g})({1:[function(r,n,s){(function(u,g,T,F,L,j,ee,k,Q){var M=r("crypto");function _(c,w){w=v(c,w);var o;return(o=w.algorithm!=="passthrough"?M.createHash(w.algorithm):new D).write===void 0&&(o.write=o.update,o.end=o.update),b(w,o).dispatch(c),o.update||o.end(""),o.digest?o.digest(w.encoding==="buffer"?void 0:w.encoding):(c=o.read(),w.encoding!=="buffer"?c.toString(w.encoding):c)}(s=n.exports=_).sha1=function(c){return _(c)},s.keys=function(c){return _(c,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},s.MD5=function(c){return _(c,{algorithm:"md5",encoding:"hex"})},s.keysMD5=function(c){return _(c,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var d=M.getHashes?M.getHashes().slice():["sha1","md5"],m=(d.push("passthrough"),["buffer","hex","binary","base64"]);function v(c,w){var o={};if(o.algorithm=(w=w||{}).algorithm||"sha1",o.encoding=w.encoding||"hex",o.excludeValues=!!w.excludeValues,o.algorithm=o.algorithm.toLowerCase(),o.encoding=o.encoding.toLowerCase(),o.ignoreUnknown=w.ignoreUnknown===!0,o.respectType=w.respectType!==!1,o.respectFunctionNames=w.respectFunctionNames!==!1,o.respectFunctionProperties=w.respectFunctionProperties!==!1,o.unorderedArrays=w.unorderedArrays===!0,o.unorderedSets=w.unorderedSets!==!1,o.unorderedObjects=w.unorderedObjects!==!1,o.replacer=w.replacer||void 0,o.excludeKeys=w.excludeKeys||void 0,c===void 0)throw new Error("Object argument required.");for(var f=0;f<d.length;++f)d[f].toLowerCase()===o.algorithm.toLowerCase()&&(o.algorithm=d[f]);if(d.indexOf(o.algorithm)===-1)throw new Error('Algorithm "'+o.algorithm+'" not supported. supported values: '+d.join(", "));if(m.indexOf(o.encoding)===-1&&o.algorithm!=="passthrough")throw new Error('Encoding "'+o.encoding+'" not supported. supported values: '+m.join(", "));return o}function S(c){if(typeof c=="function")return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(c))!=null}function b(c,w,o){o=o||[];function f(a){return w.update?w.update(a,"utf8"):w.write(a,"utf8")}return{dispatch:function(a){return this["_"+((a=c.replacer?c.replacer(a):a)===null?"null":typeof a)](a)},_object:function(a){var y,p=Object.prototype.toString.call(a),P=/\[object (.*)\]/i.exec(p);if(P=(P=P?P[1]:"unknown:["+p+"]").toLowerCase(),0<=(p=o.indexOf(a)))return this.dispatch("[CIRCULAR:"+p+"]");if(o.push(a),T!==void 0&&T.isBuffer&&T.isBuffer(a))return f("buffer:"),f(a);if(P==="object"||P==="function"||P==="asyncfunction")return p=Object.keys(a),c.unorderedObjects&&(p=p.sort()),c.respectType===!1||S(a)||p.splice(0,0,"prototype","__proto__","constructor"),c.excludeKeys&&(p=p.filter(function(U){return!c.excludeKeys(U)})),f("object:"+p.length+":"),y=this,p.forEach(function(U){y.dispatch(U),f(":"),c.excludeValues||y.dispatch(a[U]),f(",")});if(!this["_"+P]){if(c.ignoreUnknown)return f("["+P+"]");throw new Error('Unknown object type "'+P+'"')}this["_"+P](a)},_array:function(a,U){U=U!==void 0?U:c.unorderedArrays!==!1;var p=this;if(f("array:"+a.length+":"),!U||a.length<=1)return a.forEach(function(C){return p.dispatch(C)});var P=[],U=a.map(function(C){var R=new D,B=o.slice();return b(c,R,B).dispatch(C),P=P.concat(B.slice(o.length)),R.read().toString()});return o=o.concat(P),U.sort(),this._array(U,!1)},_date:function(a){return f("date:"+a.toJSON())},_symbol:function(a){return f("symbol:"+a.toString())},_error:function(a){return f("error:"+a.toString())},_boolean:function(a){return f("bool:"+a.toString())},_string:function(a){f("string:"+a.length+":"),f(a.toString())},_function:function(a){f("fn:"),S(a)?this.dispatch("[native]"):this.dispatch(a.toString()),c.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(a.name)),c.respectFunctionProperties&&this._object(a)},_number:function(a){return f("number:"+a.toString())},_xml:function(a){return f("xml:"+a.toString())},_null:function(){return f("Null")},_undefined:function(){return f("Undefined")},_regexp:function(a){return f("regex:"+a.toString())},_uint8array:function(a){return f("uint8array:"),this.dispatch(Array.prototype.slice.call(a))},_uint8clampedarray:function(a){return f("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(a))},_int8array:function(a){return f("int8array:"),this.dispatch(Array.prototype.slice.call(a))},_uint16array:function(a){return f("uint16array:"),this.dispatch(Array.prototype.slice.call(a))},_int16array:function(a){return f("int16array:"),this.dispatch(Array.prototype.slice.call(a))},_uint32array:function(a){return f("uint32array:"),this.dispatch(Array.prototype.slice.call(a))},_int32array:function(a){return f("int32array:"),this.dispatch(Array.prototype.slice.call(a))},_float32array:function(a){return f("float32array:"),this.dispatch(Array.prototype.slice.call(a))},_float64array:function(a){return f("float64array:"),this.dispatch(Array.prototype.slice.call(a))},_arraybuffer:function(a){return f("arraybuffer:"),this.dispatch(new Uint8Array(a))},_url:function(a){return f("url:"+a.toString())},_map:function(a){return f("map:"),a=Array.from(a),this._array(a,c.unorderedSets!==!1)},_set:function(a){return f("set:"),a=Array.from(a),this._array(a,c.unorderedSets!==!1)},_file:function(a){return f("file:"),this.dispatch([a.name,a.size,a.type,a.lastModfied])},_blob:function(){if(c.ignoreUnknown)return f("[blob]");throw Error(`Hashing Blob objects is currently not supported
|
|
2
2
|
(see https://github.com/puleos/object-hash/issues/26)
|
|
3
3
|
Use "options.replacer" or "options.ignoreUnknown"
|
|
4
4
|
`)},_domwindow:function(){return f("domwindow")},_bigint:function(a){return f("bigint:"+a.toString())},_process:function(){return f("process")},_timer:function(){return f("timer")},_pipe:function(){return f("pipe")},_tcp:function(){return f("tcp")},_udp:function(){return f("udp")},_tty:function(){return f("tty")},_statwatcher:function(){return f("statwatcher")},_securecontext:function(){return f("securecontext")},_connection:function(){return f("connection")},_zlib:function(){return f("zlib")},_context:function(){return f("context")},_nodescript:function(){return f("nodescript")},_httpparser:function(){return f("httpparser")},_dataview:function(){return f("dataview")},_signal:function(){return f("signal")},_fsevent:function(){return f("fsevent")},_tlswrap:function(){return f("tlswrap")}}}function D(){return{buf:"",write:function(c){this.buf+=c},end:function(c){this.buf+=c},read:function(){return this.buf}}}s.writeToStream=function(c,w,o){return o===void 0&&(o=w,w={}),b(w=v(c,w),o).dispatch(c)}}).call(this,r("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},r("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(r,n,s){(function(u,g,T,F,L,j,ee,k,Q){(function(M){var _=typeof Uint8Array<"u"?Uint8Array:Array,d=43,m=47,v=48,S=97,b=65,D=45,c=95;function w(o){return o=o.charCodeAt(0),o===d||o===D?62:o===m||o===c?63:o<v?-1:o<v+10?o-v+26+26:o<b+26?o-b:o<S+26?o-S+26:void 0}M.toByteArray=function(o){var f,a;if(0<o.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var y=o.length,y=o.charAt(y-2)==="="?2:o.charAt(y-1)==="="?1:0,p=new _(3*o.length/4-y),P=0<y?o.length-4:o.length,U=0;function C(R){p[U++]=R}for(f=0;f<P;f+=4,0)C((16711680&(a=w(o.charAt(f))<<18|w(o.charAt(f+1))<<12|w(o.charAt(f+2))<<6|w(o.charAt(f+3))))>>16),C((65280&a)>>8),C(255&a);return y==2?C(255&(a=w(o.charAt(f))<<2|w(o.charAt(f+1))>>4)):y==1&&(C((a=w(o.charAt(f))<<10|w(o.charAt(f+1))<<4|w(o.charAt(f+2))>>2)>>8&255),C(255&a)),p},M.fromByteArray=function(o){var f,a,y,p,P=o.length%3,U="";function C(R){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(R)}for(f=0,y=o.length-P;f<y;f+=3)a=(o[f]<<16)+(o[f+1]<<8)+o[f+2],U+=C((p=a)>>18&63)+C(p>>12&63)+C(p>>6&63)+C(63&p);switch(P){case 1:U=(U+=C((a=o[o.length-1])>>2))+C(a<<4&63)+"==";break;case 2:U=(U=(U+=C((a=(o[o.length-2]<<8)+o[o.length-1])>>10))+C(a>>4&63))+C(a<<2&63)+"="}return U}})(s===void 0?this.base64js={}:s)}).call(this,r("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},r("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(r,n,s){(function(u,g,d,F,L,j,ee,k,Q){var M=r("base64-js"),_=r("ieee754");function d(i,l,h){if(!(this instanceof d))return new d(i,l,h);var O,x,I,$,se=typeof i;if(l==="base64"&&se=="string")for(i=($=i).trim?$.trim():$.replace(/^\s+|\s+$/g,"");i.length%4!=0;)i+="=";if(se=="number")O=V(i);else if(se=="string")O=d.byteLength(i,l);else{if(se!="object")throw new Error("First argument needs to be a number, array or string.");O=V(i.length)}if(d._useTypedArrays?x=d._augment(new Uint8Array(O)):((x=this).length=O,x._isBuffer=!0),d._useTypedArrays&&typeof i.byteLength=="number")x._set(i);else if(K($=i)||d.isBuffer($)||$&&typeof $=="object"&&typeof $.length=="number")for(I=0;I<O;I++)d.isBuffer(i)?x[I]=i.readUInt8(I):x[I]=i[I];else if(se=="string")x.write(i,0,l);else if(se=="number"&&!d._useTypedArrays&&!h)for(I=0;I<O;I++)x[I]=0;return x}function m(i,l,h,O){return d._charsWritten=ye((function(x){for(var I=[],$=0;$<x.length;$++)I.push(255&x.charCodeAt($));return I})(l),i,h,O)}function v(i,l,h,O){return d._charsWritten=ye((function(x){for(var I,$,se=[],ue=0;ue<x.length;ue++)$=x.charCodeAt(ue),I=$>>8,$=$%256,se.push($),se.push(I);return se})(l),i,h,O)}function S(i,l,h){var O="";h=Math.min(i.length,h);for(var x=l;x<h;x++)O+=String.fromCharCode(i[x]);return O}function b(i,l,h,I){I||(E(typeof h=="boolean","missing or invalid endian"),E(l!=null,"missing offset"),E(l+1<i.length,"Trying to read beyond buffer length"));var x,I=i.length;if(!(I<=l))return h?(x=i[l],l+1<I&&(x|=i[l+1]<<8)):(x=i[l]<<8,l+1<I&&(x|=i[l+1])),x}function D(i,l,h,I){I||(E(typeof h=="boolean","missing or invalid endian"),E(l!=null,"missing offset"),E(l+3<i.length,"Trying to read beyond buffer length"));var x,I=i.length;if(!(I<=l))return h?(l+2<I&&(x=i[l+2]<<16),l+1<I&&(x|=i[l+1]<<8),x|=i[l],l+3<I&&(x+=i[l+3]<<24>>>0)):(l+1<I&&(x=i[l+1]<<16),l+2<I&&(x|=i[l+2]<<8),l+3<I&&(x|=i[l+3]),x+=i[l]<<24>>>0),x}function c(i,l,h,O){if(O||(E(typeof h=="boolean","missing or invalid endian"),E(l!=null,"missing offset"),E(l+1<i.length,"Trying to read beyond buffer length")),!(i.length<=l))return O=b(i,l,h,!0),32768&O?-1*(65535-O+1):O}function w(i,l,h,O){if(O||(E(typeof h=="boolean","missing or invalid endian"),E(l!=null,"missing offset"),E(l+3<i.length,"Trying to read beyond buffer length")),!(i.length<=l))return O=D(i,l,h,!0),2147483648&O?-1*(4294967295-O+1):O}function o(i,l,h,O){return O||(E(typeof h=="boolean","missing or invalid endian"),E(l+3<i.length,"Trying to read beyond buffer length")),_.read(i,l,h,23,4)}function f(i,l,h,O){return O||(E(typeof h=="boolean","missing or invalid endian"),E(l+7<i.length,"Trying to read beyond buffer length")),_.read(i,l,h,52,8)}function a(i,l,h,O,x){if(x||(E(l!=null,"missing value"),E(typeof O=="boolean","missing or invalid endian"),E(h!=null,"missing offset"),E(h+1<i.length,"trying to write beyond buffer length"),Lt(l,65535)),x=i.length,!(x<=h))for(var I=0,$=Math.min(x-h,2);I<$;I++)i[h+I]=(l&255<<8*(O?I:1-I))>>>8*(O?I:1-I)}function y(i,l,h,O,x){if(x||(E(l!=null,"missing value"),E(typeof O=="boolean","missing or invalid endian"),E(h!=null,"missing offset"),E(h+3<i.length,"trying to write beyond buffer length"),Lt(l,4294967295)),x=i.length,!(x<=h))for(var I=0,$=Math.min(x-h,4);I<$;I++)i[h+I]=l>>>8*(O?I:3-I)&255}function p(i,l,h,O,x){x||(E(l!=null,"missing value"),E(typeof O=="boolean","missing or invalid endian"),E(h!=null,"missing offset"),E(h+1<i.length,"Trying to write beyond buffer length"),Wt(l,32767,-32768)),i.length<=h||a(i,0<=l?l:65535+l+1,h,O,x)}function P(i,l,h,O,x){x||(E(l!=null,"missing value"),E(typeof O=="boolean","missing or invalid endian"),E(h!=null,"missing offset"),E(h+3<i.length,"Trying to write beyond buffer length"),Wt(l,2147483647,-2147483648)),i.length<=h||y(i,0<=l?l:4294967295+l+1,h,O,x)}function U(i,l,h,O,x){x||(E(l!=null,"missing value"),E(typeof O=="boolean","missing or invalid endian"),E(h!=null,"missing offset"),E(h+3<i.length,"Trying to write beyond buffer length"),Sr(l,34028234663852886e22,-34028234663852886e22)),i.length<=h||_.write(i,l,h,O,23,4)}function C(i,l,h,O,x){x||(E(l!=null,"missing value"),E(typeof O=="boolean","missing or invalid endian"),E(h!=null,"missing offset"),E(h+7<i.length,"Trying to write beyond buffer length"),Sr(l,17976931348623157e292,-17976931348623157e292)),i.length<=h||_.write(i,l,h,O,52,8)}s.Buffer=d,s.SlowBuffer=d,s.INSPECT_MAX_BYTES=50,d.poolSize=8192,d._useTypedArrays=(function(){try{var i=new ArrayBuffer(0),l=new Uint8Array(i);return l.foo=function(){return 42},l.foo()===42&&typeof l.subarray=="function"}catch{return!1}})(),d.isEncoding=function(i){switch(String(i).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.isBuffer=function(i){return!(i==null||!i._isBuffer)},d.byteLength=function(i,l){var h;switch(i+="",l||"utf8"){case"hex":h=i.length/2;break;case"utf8":case"utf-8":h=de(i).length;break;case"ascii":case"binary":case"raw":h=i.length;break;case"base64":h=Te(i).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":h=2*i.length;break;default:throw new Error("Unknown encoding")}return h},d.concat=function(i,l){if(E(K(i),`Usage: Buffer.concat(list, [totalLength])
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/loadCognitoIdentity-
|
|
2
|
-
import{_ as I}from"./preload-helper-BlTxHScW.js";import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/loadCognitoIdentity-CyU-paEc.js","assets/normalizeProvider-BrOPyH3l.js","assets/resolveDefaultsModeConfig-D1zWPouA.js","assets/preload-helper-BlTxHScW.js","assets/index-CWcv-6Zk.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-ChvoNxcO.js","assets/__vite-browser-external-DLjrMatA.js","assets/inherits_browser-nmOknR35-Bp0mvRSL.js","assets/index-6mKfgpcs-DsgiI2lM.js","assets/_commonjsHelpers-B4e78b8K-W3E8ocG7.js","assets/index-DsIu-45t-Bejjlpz4.js","assets/index-DSosZ5sh-Ceejs_jv.js","assets/index-69shuAsh-DF18H7zf.js","assets/index-BJBOx-Z---hbiLl7B.js","assets/index.browser-BHPvGrwi-6Mh8eUw-.js","assets/_commonjs-dynamic-modules-BpilXLfW-DfYEAvWy.js","assets/_commonjs-dynamic-modules-B7n8ZNar.js","assets/index-BZcC_1YB.css","assets/loadSts-_086JMFD.js","assets/index-Dsv5Y1bn.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as I}from"./preload-helper-BlTxHScW.js";import{a as O,b as N,t as x,s as D,H as K,p as H,F as j,n as q}from"./normalizeProvider-BrOPyH3l.js";class A extends Error{name="ProviderError";tryNextLink;constructor(t,o=!0){let r,n=!0;typeof o=="boolean"?(r=void 0,n=o):o!=null&&typeof o=="object"&&(r=o.logger,n=o.tryNextLink??!0),super(t),this.tryNextLink=n,Object.setPrototypeOf(this,A.prototype),r?.debug?.(`@smithy/property-provider ${n?"->":"(!)"} ${t}`)}static from(t,o=!0){return Object.assign(new this(t.message,o),t)}}class l extends A{name="CredentialsProviderError";constructor(t,o=!0){super(t,o),Object.setPrototypeOf(this,l.prototype)}}function _(e){return Promise.all(Object.keys(e).reduce((t,o)=>{const r=e[o];return typeof r=="string"?t.push([o,r]):t.push(r().then(n=>[o,n])),t},[])).then(t=>t.reduce((o,[r,n])=>(o[r]=n,o),{}))}function k(e){return async t=>{e.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");const{GetCredentialsForIdentityCommand:o,CognitoIdentityClient:r}=await I(async()=>{const{GetCredentialsForIdentityCommand:c,CognitoIdentityClient:f}=await import("./loadCognitoIdentity-CyU-paEc.js");return{GetCredentialsForIdentityCommand:c,CognitoIdentityClient:f}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])),n=c=>e.clientConfig?.[c]??e.parentClientConfig?.[c]??t?.callerClientConfig?.[c],{Credentials:{AccessKeyId:s=L(e.logger),Expiration:i,SecretKey:d=M(e.logger),SessionToken:u}=$(e.logger)}=await(e.client??new r(Object.assign({},e.clientConfig??{},{region:n("region"),profile:n("profile"),userAgentAppId:n("userAgentAppId")}))).send(new o({CustomRoleArn:e.customRoleArn,IdentityId:e.identityId,Logins:e.logins?await _(e.logins):void 0}));return{identityId:e.identityId,accessKeyId:s,secretAccessKey:d,sessionToken:u,expiration:i}}}function L(e){throw new l("Response from Amazon Cognito contained no access key ID",{logger:e})}function $(e){throw new l("Response from Amazon Cognito contained no credentials",{logger:e})}function M(e){throw new l("Response from Amazon Cognito contained no secret key",{logger:e})}const b="IdentityIds";class B{dbName;constructor(t="aws:cognito-identity-ids"){this.dbName=t}getItem(t){return this.withObjectStore("readonly",o=>{const r=o.get(t);return new Promise(n=>{r.onerror=()=>n(null),r.onsuccess=()=>n(r.result?r.result.value:null)})}).catch(()=>null)}removeItem(t){return this.withObjectStore("readwrite",o=>{const r=o.delete(t);return new Promise((n,s)=>{r.onerror=()=>s(r.error),r.onsuccess=()=>n()})})}setItem(t,o){return this.withObjectStore("readwrite",r=>{const n=r.put({id:t,value:o});return new Promise((s,i)=>{n.onerror=()=>i(n.error),n.onsuccess=()=>s()})})}getDb(){const t=self.indexedDB.open(this.dbName,1);return new Promise((o,r)=>{t.onsuccess=()=>{o(t.result)},t.onerror=()=>{r(t.error)},t.onblocked=()=>{r(new Error("Unable to access DB"))},t.onupgradeneeded=()=>{const n=t.result;n.onerror=()=>{r(new Error("Failed to create object store"))},n.createObjectStore(b,{keyPath:"id"})}})}withObjectStore(t,o){return this.getDb().then(r=>{const n=r.transaction(b,t);return n.oncomplete=()=>r.close(),new Promise((s,i)=>{n.onerror=()=>i(n.error),s(o(n.objectStore(b)))}).catch(s=>{throw r.close(),s})})}}class W{store;constructor(t={}){this.store=t}getItem(t){return t in this.store?this.store[t]:null}removeItem(t){delete this.store[t]}setItem(t,o){this.store[t]=o}}const U=new W;function F(){return typeof self=="object"&&self.indexedDB?new B:typeof window=="object"&&window.localStorage?window.localStorage:U}function z({accountId:e,cache:t=F(),client:o,clientConfig:r,customRoleArn:n,identityPoolId:s,logins:i,userIdentifier:d=!i||Object.keys(i).length===0?"ANONYMOUS":void 0,logger:u,parentClientConfig:c}){u?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");const f=d?`aws:cognito-identity-credentials:${s}:${d}`:void 0;let a=async w=>{const{GetIdCommand:m,CognitoIdentityClient:y}=await I(async()=>{const{GetIdCommand:g,CognitoIdentityClient:P}=await import("./loadCognitoIdentity-CyU-paEc.js");return{GetIdCommand:g,CognitoIdentityClient:P}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])),h=g=>r?.[g]??c?.[g]??w?.callerClientConfig?.[g],C=o??new y(Object.assign({},r??{},{region:h("region"),profile:h("profile"),userAgentAppId:h("userAgentAppId")}));let p=f&&await t.getItem(f);if(!p){const{IdentityId:g=G(u)}=await C.send(new m({AccountId:e,IdentityPoolId:s,Logins:i?await _(i):void 0}));p=g,f&&Promise.resolve(t.setItem(f,p)).catch(()=>{})}return a=k({client:C,customRoleArn:n,logins:i,identityId:p}),a(w)};return w=>a(w).catch(async m=>{throw f&&Promise.resolve(t.removeItem(f)).catch(()=>{}),m})}function G(e){throw new l("Response from Amazon Cognito contained no identity ID",{logger:e})}const ie=e=>k({...e}),ae=e=>z({...e}),V="169.254.170.2",J="169.254.170.23",Y="[fd00:ec2::23]",Q=(e,t)=>{if(e.protocol!=="https:"&&!(e.hostname===V||e.hostname===J||e.hostname===Y)){if(e.hostname.includes("[")){if(e.hostname==="[::1]"||e.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(e.hostname==="localhost")return;const o=e.hostname.split("."),r=n=>{const s=parseInt(n,10);return 0<=s&&s<=255};if(o[0]==="127"&&r(o[1])&&r(o[2])&&r(o[3])&&o.length===4)return}throw new l(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
3
3
|
- loopback CIDR 127.0.0.0/8 or [::1/128]
|
|
4
4
|
- ECS container host 169.254.170.2
|
|
5
5
|
- EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:t})}},T=e=>typeof ReadableStream=="function"&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),R="The stream has already been transformed.",X=e=>{if(!E(e)&&!T(e)){const n=e?.__proto__?.constructor?.name||e;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${n}`)}let t=!1;const o=async()=>{if(t)throw new Error(R);return t=!0,await D(e)},r=n=>{if(typeof n.stream!="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
|
|
6
|
-
If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return n.stream()};return Object.assign(e,{transformToByteArray:o,transformToString:async n=>{const s=await o();if(n==="base64")return O(s);if(n==="hex")return N(s);if(n===void 0||n==="utf8"||n==="utf-8")return x(s);if(typeof TextDecoder=="function")return new TextDecoder(n).decode(s);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw new Error(R);if(t=!0,E(e))return r(e);if(T(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},E=e=>typeof Blob=="function"&&e instanceof Blob;function Z(e){return new K({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((t,[o,r])=>(t[o]=r,t),{}),fragment:e.hash})}async function ee(e,t){const r=await X(e.body).transformToString();if(e.statusCode===200){const n=JSON.parse(r);if(typeof n.AccessKeyId!="string"||typeof n.SecretAccessKey!="string"||typeof n.Token!="string"||typeof n.Expiration!="string")throw new l("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:t});return{accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,sessionToken:n.Token,expiration:H(n.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let n={};try{n=JSON.parse(r)}catch{}throw Object.assign(new l(`Server responded with status: ${e.statusCode}`,{logger:t}),{Code:n.Code,Message:n.Message})}throw new l(`Server responded with status: ${e.statusCode}`,{logger:t})}const te=(e,t,o)=>async()=>{for(let r=0;r<t;++r)try{return await e()}catch{await new Promise(s=>setTimeout(s,o))}return await e()},ce=(e={})=>{e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let t;const o=e.credentialsFullUri;if(o)t=o;else throw new l("No HTTP credential provider host provided.",{logger:e.logger});const r=new URL(t);Q(r,e.logger);const n=new j;return te(async()=>{const s=Z(r);e.authorizationToken&&(s.headers.Authorization=e.authorizationToken);const i=await n.handle(s);return ee(i.response)},e.maxRetries??3,e.timeout??1e3)},ne="us-east-1",le=(e,t,o)=>{let r;return async(n={})=>{const{callerClientConfig:s}=n,i=e.clientConfig?.profile??s?.profile,d=e.logger??s?.logger;d?.debug("@aws-sdk/credential-providers - fromTemporaryCredentials (STS)");const u={...e.params,RoleSessionName:e.params.RoleSessionName??"aws-sdk-js-"+Date.now()};if(u?.SerialNumber){if(!e.mfaCodeProvider)throw new l("Temporary credential requires multi-factor authentication, but no MFA code callback was provided.",{tryNextLink:!1,logger:d});u.TokenCode=await e.mfaCodeProvider(u?.SerialNumber)}const{AssumeRoleCommand:c,STSClient:f}=await I(async()=>{const{AssumeRoleCommand:w,STSClient:m}=await import("./loadSts-
|
|
6
|
+
If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return n.stream()};return Object.assign(e,{transformToByteArray:o,transformToString:async n=>{const s=await o();if(n==="base64")return O(s);if(n==="hex")return N(s);if(n===void 0||n==="utf8"||n==="utf-8")return x(s);if(typeof TextDecoder=="function")return new TextDecoder(n).decode(s);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw new Error(R);if(t=!0,E(e))return r(e);if(T(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},E=e=>typeof Blob=="function"&&e instanceof Blob;function Z(e){return new K({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((t,[o,r])=>(t[o]=r,t),{}),fragment:e.hash})}async function ee(e,t){const r=await X(e.body).transformToString();if(e.statusCode===200){const n=JSON.parse(r);if(typeof n.AccessKeyId!="string"||typeof n.SecretAccessKey!="string"||typeof n.Token!="string"||typeof n.Expiration!="string")throw new l("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:t});return{accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,sessionToken:n.Token,expiration:H(n.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let n={};try{n=JSON.parse(r)}catch{}throw Object.assign(new l(`Server responded with status: ${e.statusCode}`,{logger:t}),{Code:n.Code,Message:n.Message})}throw new l(`Server responded with status: ${e.statusCode}`,{logger:t})}const te=(e,t,o)=>async()=>{for(let r=0;r<t;++r)try{return await e()}catch{await new Promise(s=>setTimeout(s,o))}return await e()},ce=(e={})=>{e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let t;const o=e.credentialsFullUri;if(o)t=o;else throw new l("No HTTP credential provider host provided.",{logger:e.logger});const r=new URL(t);Q(r,e.logger);const n=new j;return te(async()=>{const s=Z(r);e.authorizationToken&&(s.headers.Authorization=e.authorizationToken);const i=await n.handle(s);return ee(i.response)},e.maxRetries??3,e.timeout??1e3)},ne="us-east-1",le=(e,t,o)=>{let r;return async(n={})=>{const{callerClientConfig:s}=n,i=e.clientConfig?.profile??s?.profile,d=e.logger??s?.logger;d?.debug("@aws-sdk/credential-providers - fromTemporaryCredentials (STS)");const u={...e.params,RoleSessionName:e.params.RoleSessionName??"aws-sdk-js-"+Date.now()};if(u?.SerialNumber){if(!e.mfaCodeProvider)throw new l("Temporary credential requires multi-factor authentication, but no MFA code callback was provided.",{tryNextLink:!1,logger:d});u.TokenCode=await e.mfaCodeProvider(u?.SerialNumber)}const{AssumeRoleCommand:c,STSClient:f}=await I(async()=>{const{AssumeRoleCommand:w,STSClient:m}=await import("./loadSts-_086JMFD.js").then(y=>y.w);return{AssumeRoleCommand:w,STSClient:m}},__vite__mapDeps([19,2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]));if(!r){const w=typeof t=="function"?t():void 0,m=[e.masterCredentials,e.clientConfig?.credentials,void s?.credentials,s?.credentialDefaultProvider?.(),w];let y="STS client default credentials";if(m[0])y="options.masterCredentials";else if(m[1])y="options.clientConfig.credentials";else{if(m[2])throw y="caller client's credentials",new Error("fromTemporaryCredentials recursion in callerClientConfig.credentials");m[3]?y="caller client's credentialDefaultProvider":m[4]&&(y="AWS SDK default credentials")}const h=[e.clientConfig?.region,s?.region,await o?.({profile:i}),ne];let C="default partition's default region";h[0]?C="options.clientConfig.region":h[1]?C="caller client's region":h[2]&&(C="file or env region");const p=[v(e.clientConfig?.requestHandler),v(s?.requestHandler)];let g="STS default requestHandler";p[0]?g="options.clientConfig.requestHandler":p[1]&&(g="caller client's requestHandler"),d?.debug?.(`@aws-sdk/credential-providers - fromTemporaryCredentials STS client init with ${C}=${await q(S(h))()}, ${y}, ${g}.`),r=new f({userAgentAppId:s?.userAgentAppId,...e.clientConfig,credentials:S(m),logger:d,profile:i,region:S(h),requestHandler:S(p)})}if(e.clientPlugins)for(const w of e.clientPlugins)r.middlewareStack.use(w);const{Credentials:a}=await r.send(new c(u));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw new l(`Invalid response from STS.assumeRole call with role ${u.RoleArn}`,{logger:d});return{accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration,credentialScope:a.CredentialScope}}},v=e=>e?.metadata?.handlerProtocol==="h2"?void 0:e,S=e=>{for(const t of e)if(t!==void 0)return t},re=e=>async t=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");const{roleArn:o,roleSessionName:r,webIdentityToken:n,providerId:s,policyArns:i,policy:d,durationSeconds:u}=e;let{roleAssumerWithWebIdentity:c}=e;if(!c){const{getDefaultRoleAssumerWithWebIdentity:f}=await I(async()=>{const{getDefaultRoleAssumerWithWebIdentity:a}=await import("./index-Dsv5Y1bn.js");return{getDefaultRoleAssumerWithWebIdentity:a}},__vite__mapDeps([20,19,2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]));c=f({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...t?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return c({RoleArn:o,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:n,ProviderId:s,PolicyArns:i,Policy:d,DurationSeconds:u})},de=e=>re({...e});export{ie as fromCognitoIdentity,ae as fromCognitoIdentityPool,ce as fromHttp,le as fromTemporaryCredentials,de as fromWebToken};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{H,n as N,c as qe,t as Ae,d as xe,e as Ve,g as Je,h as We,a as L,i as Ke,f as Qe,s as Xe,F as Ye}from"./normalizeProvider-BrOPyH3l.js";import{i as Ze,b as et,c as _e,S as re,m as tt,d as st,e as nt,T as y,f as ie,N as R,h as P,j as rt,L as Pe,k as Re,v as it,R as ot,l as at,n as ke,o as ct,E as ut,r as dt,p as pt,q as lt,s as gt,t as ft,u as mt,D as ht,w as St,x as yt,y as Et,z as wt,A as Ct,B as It,F as bt,G as At,H as xt,I as _t,a as Pt,J as Rt,K as kt,M as vt,O as Ot,P as Dt,Q as Tt,U as Nt,V as Mt,W as Ut,X as $t,C as ve,g as Oe}from"./resolveDefaultsModeConfig-D1zWPouA.js";import"./preload-helper-BlTxHScW.js";import"./index-CWcv-6Zk.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-ChvoNxcO.js";import"./__vite-browser-external-DLjrMatA.js";import"./inherits_browser-nmOknR35-Bp0mvRSL.js";import"./index-6mKfgpcs-DsgiI2lM.js";import"./_commonjsHelpers-B4e78b8K-W3E8ocG7.js";import"./index-DsIu-45t-Bejjlpz4.js";import"./index-DSosZ5sh-Ceejs_jv.js";import"./index-69shuAsh-DF18H7zf.js";import"./index-BJBOx-Z---hbiLl7B.js";import"./index.browser-BHPvGrwi-6Mh8eUw-.js";import"./_commonjs-dynamic-modules-BpilXLfW-DfYEAvWy.js";import"./_commonjs-dynamic-modules-B7n8ZNar.js";const Ft=t=>e=>async s=>{if(!H.isInstance(s.request))return e(s);const{request:n}=s,{handlerProtocol:r=""}=t.requestHandler.metadata||{};if(r.indexOf("h2")>=0&&!n.headers[":authority"])delete n.headers.host,n.headers[":authority"]=n.hostname+(n.port?":"+n.port:"");else if(!n.headers.host){let i=n.hostname;n.port!=null&&(i+=`:${n.port}`),n.headers.host=i}return e(s)},zt={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},jt=t=>({applyToStack:e=>{e.add(Ft(t),zt)}}),Lt=()=>(t,e)=>async s=>{try{const n=await t(s),{clientName:r,commandName:i,logger:o,dynamoDbDocumentClientOptions:a={}}=e,{overrideInputFilterSensitiveLog:u,overrideOutputFilterSensitiveLog:c}=a,d=u??e.inputFilterSensitiveLog,p=c??e.outputFilterSensitiveLog,{$metadata:g,...m}=n.output;return o?.info?.({clientName:r,commandName:i,input:d(s.input),output:p(m),metadata:g}),n}catch(n){const{clientName:r,commandName:i,logger:o,dynamoDbDocumentClientOptions:a={}}=e,{overrideInputFilterSensitiveLog:u}=a,c=u??e.inputFilterSensitiveLog;throw o?.error?.({clientName:r,commandName:i,input:c(s.input),error:n,metadata:n.$metadata}),n}},Ht={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},Gt=t=>({applyToStack:e=>{e.add(Lt(),Ht)}}),Bt={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},qt=()=>t=>async e=>t(e),Vt=t=>({applyToStack:e=>{e.add(qt(),Bt)}}),Jt=void 0;function Wt(t){return t===void 0?!0:typeof t=="string"&&t.length<=50}function Kt(t){const e=N(t.userAgentAppId??Jt),{customUserAgent:s}=t;return Object.assign(t,{customUserAgent:typeof s=="string"?[[s]]:s,userAgentAppId:async()=>{const n=await e();if(!Wt(n)){const r=t.logger?.constructor?.name==="NoOpLogger"||!t.logger?console:t.logger;typeof n!="string"?r?.warn("userAgentAppId must be a string or undefined."):n.length>50&&r?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return n}})}const De=(t,e=!1)=>{if(e){for(const s of t.split("."))if(!De(s))return!1;return!0}return!(!Ze(t)||t.length<3||t.length>63||t!==t.toLowerCase()||et(t))},oe=":",Qt="/",Xt=t=>{const e=t.split(oe);if(e.length<6)return null;const[s,n,r,i,o,...a]=e;if(s!=="arn"||n===""||r===""||a.join(oe)==="")return null;const u=a.map(c=>c.split(Qt)).flat();return{partition:n,service:r,region:i,accountId:o,resourceId:u}},Yt=[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"EU (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],Zt={partitions:Yt};let es=Zt;const ts=t=>{const{partitions:e}=es;for(const n of e){const{regions:r,outputs:i}=n;for(const[o,a]of Object.entries(r))if(o===t)return{...i,...a}}for(const n of e){const{regionRegex:r,outputs:i}=n;if(new RegExp(r).test(t))return{...i}}const s=e.find(n=>n.id==="aws");if(!s)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...s.outputs}},Te={isVirtualHostableS3Bucket:De,parseArn:Xt,partition:ts};_e.aws=Te;function ss(t,e,s){return t.$source||(t.$source={}),t.$source[e]=s,t}function I(t,e,s){t.__aws_sdk_context?t.__aws_sdk_context.features||(t.__aws_sdk_context.features={}):t.__aws_sdk_context={features:{}},t.__aws_sdk_context.features[e]=s}const ae=t=>qe.isInstance(t)?t.headers?.date??t.headers?.Date:void 0,Ne=t=>new Date(Date.now()+t),ns=(t,e)=>Math.abs(Ne(e).getTime()-t)>=3e5,ce=(t,e)=>{const s=Date.parse(t);return ns(s,e)?s-Date.now():e},M=(t,e)=>{if(!e)throw new Error(`Property \`${t}\` is not resolved for AWS SDK SigV4Auth`);return e},rs=async t=>{const e=M("context",t.context),s=M("config",t.config),n=e.endpointV2?.properties?.authSchemes?.[0],i=await M("signer",s.signer)(n),o=t?.signingRegion,a=t?.signingRegionSet,u=t?.signingName;return{config:s,signer:i,signingRegion:o,signingRegionSet:a,signingName:u}};class is{async sign(e,s,n){if(!H.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const r=await rs(n),{config:i,signer:o}=r;let{signingRegion:a,signingName:u}=r;const c=n.context;if(c?.authSchemes?.length??!1){const[p,g]=c.authSchemes;p?.name==="sigv4a"&&g?.name==="sigv4"&&(a=g?.signingRegion??a,u=g?.signingName??u)}return await o.sign(e,{signingDate:Ne(i.systemClockOffset),signingRegion:a,signingService:u})}errorHandler(e){return s=>{const n=s.ServerTime??ae(s.$response);if(n){const r=M("config",e.config),i=r.systemClockOffset;r.systemClockOffset=ce(n,r.systemClockOffset),r.systemClockOffset!==i&&s.$metadata&&(s.$metadata.clockSkewCorrected=!0)}throw s}}successHandler(e,s){const n=ae(e);if(n){const r=M("config",s.config);r.systemClockOffset=ce(n,r.systemClockOffset)}}}const os=t=>{let e=t.credentials,s=!!t.credentials,n;Object.defineProperty(t,"credentials",{set(c){c&&c!==e&&c!==n&&(s=!0),e=c;const d=as(t,{credentials:e,credentialDefaultProvider:t.credentialDefaultProvider}),p=cs(t,d);s&&!p.attributed?(n=async g=>p(g).then(m=>ss(m,"CREDENTIALS_CODE","e")),n.memoized=p.memoized,n.configBound=p.configBound,n.attributed=!0):n=p},get(){return n},enumerable:!0,configurable:!0}),t.credentials=e;const{signingEscapePath:r=!0,systemClockOffset:i=t.systemClockOffset||0,sha256:o}=t;let a;return t.signer?a=N(t.signer):t.regionInfoProvider?a=()=>N(t.region)().then(async c=>[await t.regionInfoProvider(c,{useFipsEndpoint:await t.useFipsEndpoint(),useDualstackEndpoint:await t.useDualstackEndpoint()})||{},c]).then(([c,d])=>{const{signingRegion:p,signingService:g}=c;t.signingRegion=t.signingRegion||p||d,t.signingName=t.signingName||g||t.serviceId;const m={...t,credentials:t.credentials,region:t.signingRegion,service:t.signingName,sha256:o,uriEscapePath:r},k=t.signerConstructor||re;return new k(m)}):a=async c=>{c=Object.assign({},{name:"sigv4",signingName:t.signingName||t.defaultSigningName,signingRegion:await N(t.region)(),properties:{}},c);const d=c.signingRegion,p=c.signingName;t.signingRegion=t.signingRegion||d,t.signingName=t.signingName||p||t.serviceId;const g={...t,credentials:t.credentials,region:t.signingRegion,service:t.signingName,sha256:o,uriEscapePath:r},m=t.signerConstructor||re;return new m(g)},Object.assign(t,{systemClockOffset:i,signingEscapePath:r,signer:a})};function as(t,{credentials:e,credentialDefaultProvider:s}){let n;return e?e?.memoized?n=e:n=tt(e,nt,st):s?n=N(s(Object.assign({},t,{parentClientConfig:t}))):n=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},n.memoized=!0,n}function cs(t,e){if(e.configBound)return e;const s=async n=>e({...n,callerClientConfig:t});return s.memoized=e.memoized,s.configBound=!0,s}class us{queryCompat;constructor(e=!1){this.queryCompat=e}resolveRestContentType(e,s){const n=s.getMemberSchemas(),r=Object.values(n).find(i=>!!i.getMergedTraits().httpPayload);if(r){const i=r.getMergedTraits().mediaType;return i||(r.isStringSchema()?"text/plain":r.isBlobSchema()?"application/octet-stream":e)}else if(!s.isUnitSchema()&&Object.values(n).find(o=>{const{httpQuery:a,httpQueryParams:u,httpHeader:c,httpLabel:d,httpPrefixHeaders:p}=o.getMergedTraits();return!a&&!u&&!c&&!d&&p===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,s,n,r,i,o){let a=s,u=e;e.includes("#")&&([a,u]=e.split("#"));const c={$metadata:i,$fault:n.statusCode<500?"client":"server"},d=y.for(a);try{return{errorSchema:o?.(d,u)??d.getSchema(e),errorMetadata:c}}catch{r.message=r.message??r.Message??"UnknownError";const g=y.for("smithy.ts.sdk.synthetic."+a),m=g.getBaseException();if(m){const k=g.getErrorCtor(m)??Error;throw this.decorateServiceException(Object.assign(new k({name:u}),c),r)}throw this.decorateServiceException(Object.assign(new Error(u),c),r)}}decorateServiceException(e,s={}){if(this.queryCompat){const n=e.Message??s.Message,r=ie(e,s);n&&(r.message=n),r.Error={...r.Error,Type:r.Error.Type,Code:r.Error.Code,Message:r.Error.message??r.Error.Message??n};const i=r.$metadata.requestId;return i&&(r.RequestId=i),r}return ie(e,s)}setQueryCompatError(e,s){const n=s.headers?.["x-amzn-query-error"];if(e!==void 0&&n!=null){const[r,i]=n.split(";"),o=Object.entries(e),a={Code:r,Type:i};Object.assign(e,a);for(const[u,c]of o)a[u==="message"?"Message":u]=c;delete a.__type,e.Error=a}}queryCompatOutput(e,s){e.Error&&(s.Error=e.Error),e.Type&&(s.Type=e.Type),e.Code&&(s.Code=e.Code)}findQueryCompatibleError(e,s){try{return e.getSchema(s)}catch{return e.find(r=>R.of(r).getMergedTraits().awsQueryError?.[0]===s)}}}class G{serdeContext;setSerdeContext(e){this.serdeContext=e}}function*ds(t,e){if(t.isUnitSchema())return;const s=t.getSchema();for(let n=0;n<s[4].length;++n){const r=s[4][n],i=s[5][n],o=new R([i,0],r);!(r in e)&&!o.isIdempotencyToken()||(yield[r,o])}}function*ps(t,e,s){if(t.isUnitSchema())return;const n=t.getSchema();let r=Object.keys(e).filter(i=>i!=="__type").length;for(let i=0;i<n[4].length&&r!==0;++i){const o=n[4][i],a=n[5][i],u=new R([a,0],o);let c=o;s&&(c=u.getMergedTraits()[s]??o),c in e&&(yield[o,u],r-=1)}}class ls{from;to;keys;constructor(e,s){this.from=e,this.to=s,this.keys=new Set(Object.keys(this.from).filter(n=>n!=="__type"))}mark(e){this.keys.delete(e)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){const e=this.keys.values().next().value,s=this.from[e];this.to.$unknown=[e,s]}}}function gs(t,e,s){if(s?.source){const n=s.source;if(typeof e=="number"&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER||n!==String(e)))return n.includes(".")?new P(n,"bigDecimal"):BigInt(n)}return e}const fs=(t,e)=>rt(t,e).then(s=>(e?.utf8Encoder??Ae)(s)),ms=(t,e)=>fs(t,e).then(s=>{if(s.length)try{return JSON.parse(s)}catch(n){throw n?.name==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:s}),n}return{}}),hs=(t,e)=>{const s=(i,o)=>Object.keys(i).find(a=>a.toLowerCase()===o.toLowerCase()),n=i=>{let o=i;return typeof o=="number"&&(o=o.toString()),o.indexOf(",")>=0&&(o=o.split(",")[0]),o.indexOf(":")>=0&&(o=o.split(":")[0]),o.indexOf("#")>=0&&(o=o.split("#")[1]),o},r=s(t.headers,"x-amzn-errortype");if(r!==void 0)return n(t.headers[r]);if(e&&typeof e=="object"){const i=s(e,"code");if(i&&e[i]!==void 0)return n(e[i]);if(e.__type!==void 0)return n(e.__type)}};class Ss extends G{settings;constructor(e){super(),this.settings=e}async read(e,s){return this._read(e,typeof s=="string"?JSON.parse(s,gs):await ms(s,this.serdeContext))}readObject(e,s){return this._read(e,s)}_read(e,s){const n=s!==null&&typeof s=="object",r=R.of(e);if(n){if(r.isStructSchema()){const o=r.isUnionSchema(),a={};let u;o&&(u=new ls(s,a));for(const[c,d]of ps(r,s,this.settings.jsonName?"jsonName":!1)){const p=this.settings.jsonName?d.getMergedTraits().jsonName??c:c;o&&u.mark(p),s[p]!=null&&(a[c]=this._read(d,s[p]))}return o&&u.writeUnknown(),a}if(Array.isArray(s)&&r.isListSchema()){const o=r.getValueSchema(),a=[],u=!!r.getMergedTraits().sparse;for(const c of s)(u||c!=null)&&a.push(this._read(o,c));return a}if(r.isMapSchema()){const o=r.getValueSchema(),a={},u=!!r.getMergedTraits().sparse;for(const[c,d]of Object.entries(s))(u||d!=null)&&(a[c]=this._read(o,d));return a}}if(r.isBlobSchema()&&typeof s=="string")return xe(s);const i=r.getMergedTraits().mediaType;if(r.isStringSchema()&&typeof s=="string"&&i)return i==="application/json"||i.endsWith("+json")?Pe.from(s):s;if(r.isTimestampSchema()&&s!=null)switch(Re(r,this.settings)){case 5:return We(s);case 6:return Je(s);case 7:return Ve(s);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",s),new Date(s)}if(r.isBigIntegerSchema()&&(typeof s=="number"||typeof s=="string"))return BigInt(s);if(r.isBigDecimalSchema()&&s!=null){if(s instanceof P)return s;const o=s;return o.type==="bigDecimal"&&"string"in o?new P(o.string,o.type):new P(String(s),"bigDecimal")}if(r.isNumericSchema()&&typeof s=="string"){switch(s){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return s}if(r.isDocumentSchema())if(n){const o=Array.isArray(s)?[]:{};for(const[a,u]of Object.entries(s))u instanceof P?o[a]=u:o[a]=this._read(r,u);return o}else return structuredClone(s);return s}}const ue="Ν";class ys{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(e,s)=>{if(s instanceof P){const n=`${ue+"nv"+this.counter++}_`+s.string;return this.values.set(`"${n}"`,s.string),n}if(typeof s=="bigint"){const n=s.toString(),r=`${ue+"b"+this.counter++}_`+n;return this.values.set(`"${r}"`,n),r}return s}}replaceInJson(e){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return e;for(const[s,n]of this.values)e=e.replace(s,n);return e}}class Es extends G{settings;buffer;useReplacer=!1;rootSchema;constructor(e){super(),this.settings=e}write(e,s){this.rootSchema=R.of(e),this.buffer=this._write(this.rootSchema,s)}writeDiscriminatedDocument(e,s){this.write(e,s),typeof this.buffer=="object"&&(this.buffer.__type=R.of(e).getName(!0))}flush(){const{rootSchema:e,useReplacer:s}=this;if(this.rootSchema=void 0,this.useReplacer=!1,e?.isStructSchema()||e?.isDocumentSchema()){if(!s)return JSON.stringify(this.buffer);const n=new ys;return n.replaceInJson(JSON.stringify(this.buffer,n.createReplacer(),0))}return this.buffer}_write(e,s,n){const r=s!==null&&typeof s=="object",i=R.of(e);if(r){if(i.isStructSchema()){const o={};for(const[a,u]of ds(i,s)){const c=this._write(u,s[a],i);if(c!==void 0){const d=u.getMergedTraits().jsonName,p=this.settings.jsonName?d??a:a;o[p]=c}}if(i.isUnionSchema()&&Object.keys(o).length===0){const{$unknown:a}=s;if(Array.isArray(a)){const[u,c]=a;o[u]=this._write(15,c)}}return o}if(Array.isArray(s)&&i.isListSchema()){const o=i.getValueSchema(),a=[],u=!!i.getMergedTraits().sparse;for(const c of s)(u||c!=null)&&a.push(this._write(o,c));return a}if(i.isMapSchema()){const o=i.getValueSchema(),a={},u=!!i.getMergedTraits().sparse;for(const[c,d]of Object.entries(s))(u||d!=null)&&(a[c]=this._write(o,d));return a}if(s instanceof Uint8Array&&(i.isBlobSchema()||i.isDocumentSchema()))return i===this.rootSchema?s:(this.serdeContext?.base64Encoder??L)(s);if(s instanceof Date&&(i.isTimestampSchema()||i.isDocumentSchema()))switch(Re(i,this.settings)){case 5:return s.toISOString().replace(".000Z","Z");case 6:return Ke(s);case 7:return s.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",s),s.getTime()/1e3}s instanceof P&&(this.useReplacer=!0)}if(!(s===null&&n?.isStructSchema())){if(i.isStringSchema()){if(typeof s>"u"&&i.isIdempotencyToken())return it();const o=i.getMergedTraits().mediaType;return s!=null&&o&&(o==="application/json"||o.endsWith("+json"))?Pe.from(s):s}if(typeof s=="number"&&i.isNumericSchema())return Math.abs(s)===1/0||isNaN(s)?String(s):s;if(typeof s=="string"&&i.isBlobSchema())return i===this.rootSchema?s:(this.serdeContext?.base64Encoder??L)(s);if(typeof s=="bigint"&&(this.useReplacer=!0),i.isDocumentSchema())if(r){const o=Array.isArray(s)?[]:{};for(const[a,u]of Object.entries(s))u instanceof P?(this.useReplacer=!0,o[a]=u):o[a]=this._write(i,u);return o}else return structuredClone(s);return s}}}class ws extends G{settings;constructor(e){super(),this.settings=e}createSerializer(){const e=new Es(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){const e=new Ss(this.settings);return e.setSerdeContext(this.serdeContext),e}}class Cs extends ot{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:e,serviceTarget:s,awsQueryCompatible:n,jsonCodec:r}){super({defaultNamespace:e}),this.serviceTarget=s,this.codec=r??new ws({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!n,this.mixin=new us(this.awsQueryCompatible)}async serializeRequest(e,s,n){const r=await super.serializeRequest(e,s,n);return r.path.endsWith("/")||(r.path+="/"),Object.assign(r.headers,{"content-type":`application/x-amz-json-${this.getJsonRpcVersion()}`,"x-amz-target":`${this.serviceTarget}.${e.name}`}),this.awsQueryCompatible&&(r.headers["x-amzn-query-mode"]="true"),(at(e.input)==="unit"||!r.body)&&(r.body="{}"),r}getPayloadCodec(){return this.codec}async handleError(e,s,n,r,i){this.awsQueryCompatible&&this.mixin.setQueryCompatError(r,n);const o=hs(n,r)??"Unknown",{errorSchema:a,errorMetadata:u}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,n,r,i,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),c=R.of(a),d=r.message??r.Message??"Unknown",p=y.for(a[1]).getErrorCtor(a)??Error,g=new p(d),m={};for(const[k,Be]of c.structIterator())r[k]!=null&&(m[k]=this.codec.createDeserializer().readObject(Be,r[k]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(r,m),this.mixin.decorateServiceException(Object.assign(g,u,{$fault:c.getMergedTraits().error,message:d},m),r)}}class Is extends Cs{constructor({defaultNamespace:e,serviceTarget:s,awsQueryCompatible:n,jsonCodec:r}){super({defaultNamespace:e,serviceTarget:s,awsQueryCompatible:n,jsonCodec:r})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}const bs=/\d{12}\.ddb/;async function As(t,e,s){if(s.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&I(t,"PROTOCOL_RPC_V2_CBOR","M"),typeof e.retryStrategy=="function"){const i=await e.retryStrategy();typeof i.acquireInitialRetryToken=="function"?i.constructor?.name?.includes("Adaptive")?I(t,"RETRY_MODE_ADAPTIVE","F"):I(t,"RETRY_MODE_STANDARD","E"):I(t,"RETRY_MODE_LEGACY","D")}if(typeof e.accountIdEndpointMode=="function"){const i=t.endpointV2;switch(String(i?.url?.hostname).match(bs)&&I(t,"ACCOUNT_ID_ENDPOINT","O"),await e.accountIdEndpointMode?.()){case"disabled":I(t,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":I(t,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":I(t,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const r=t.__smithy_context?.selectedHttpAuthScheme?.identity;if(r?.$source){const i=r;i.accountId&&I(t,"RESOLVED_ACCOUNT_ID","T");for(const[o,a]of Object.entries(i.$source??{}))I(t,o,a)}}const de="user-agent",z="x-amz-user-agent",pe=" ",j="/",xs=/[^!$%&'*+\-.^_`|~\w]/g,_s=/[^!$%&'*+\-.^_`|~\w#]/g,le="-",Ps=1024;function Rs(t){let e="";for(const s in t){const n=t[s];if(e.length+n.length+1<=Ps){e.length?e+=","+n:e+=n;continue}break}return e}const ks=t=>(e,s)=>async n=>{const{request:r}=n;if(!H.isInstance(r))return e(n);const{headers:i}=r,o=s?.userAgent?.map($)||[],a=(await t.defaultUserAgentProvider()).map($);await As(s,t,n);const u=s;a.push(`m/${Rs(Object.assign({},s.__smithy_context?.features,u.__aws_sdk_context?.features))}`);const c=t?.customUserAgent?.map($)||[],d=await t.userAgentAppId();d&&a.push($(["app",`${d}`]));const p=[].concat([...a,...o,...c]).join(pe),g=[...a.filter(m=>m.startsWith("aws-sdk-")),...c].join(pe);return t.runtime!=="browser"?(g&&(i[z]=i[z]?`${i[de]} ${g}`:g),i[de]=p):i[z]=p,e({...n,request:r})},$=t=>{const e=t[0].split(j).map(o=>o.replace(xs,le)).join(j),s=t[1]?.replace(_s,le),n=e.indexOf(j),r=e.substring(0,n);let i=e.substring(n+1);return r==="api"&&(i=i.toLowerCase()),[r,i,s].filter(o=>o&&o.length>0).reduce((o,a,u)=>{switch(u){case 0:return a;case 1:return`${o}/${a}`;default:return`${o}#${a}`}},"")},vs={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},Os=t=>({applyToStack:e=>{e.add(ks(t),vs)}}),Ds=async(t,e,s)=>({operation:ct(e).operation,region:await ke(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Ts(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-identity",region:t.region},propertiesExtractor:(e,s)=>({signingProperties:{config:e,context:s}})}}function F(t){return{schemeId:"smithy.api#noAuth"}}const Ns=t=>{const e=[];switch(t.operation){case"GetCredentialsForIdentity":{e.push(F());break}case"GetId":{e.push(F());break}case"GetOpenIdToken":{e.push(F());break}case"UnlinkIdentity":{e.push(F());break}default:e.push(Ts(t))}return e},Ms=t=>{const e=os(t);return Object.assign(e,{authSchemePreference:ke(t.authSchemePreference??[])})},Us=t=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"cognito-identity"}),Me={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},$s="3.958.0",Fs={version:$s},zs=({serviceId:t,clientVersion:e})=>async s=>{const n=typeof window<"u"?window.navigator:void 0,r=n?.userAgent??"",i=n?.userAgentData?.platform??ge.os(r)??"other",o=void 0,a=n?.userAgentData?.brands??[],u=a[a.length-1],c=u?.brand??ge.browser(r)??"unknown",d=u?.version??"unknown",p=[["aws-sdk-js",e],["ua","2.1"],[`os/${i}`,o],["lang/js"],["md/browser",`${c}_${d}`]];t&&p.push([`api/${t}`,e]);const g=await s?.userAgentAppId?.();return g&&p.push([`app/${g}`]),p},ge={os(t){if(/iPhone|iPad|iPod/.test(t))return"iOS";if(/Macintosh|Mac OS X/.test(t))return"macOS";if(/Windows NT/.test(t))return"Windows";if(/Android/.test(t))return"Android";if(/Linux/.test(t))return"Linux"},browser(t){if(/EdgiOS|EdgA|Edg\//.test(t))return"Microsoft Edge";if(/Firefox\//.test(t))return"Firefox";if(/Chrome\//.test(t))return"Chrome";if(/Safari\//.test(t))return"Safari"}},Ue="required",h="fn",S="argv",O="ref",fe=!0,me="isSet",U="booleanEquals",v="error",b="endpoint",_="tree",B="PartitionResult",q="getAttr",D="stringEquals",he={[Ue]:!1,type:"string"},Se={[Ue]:!0,default:!1,type:"boolean"},ye={[O]:"Endpoint"},$e={[h]:U,[S]:[{[O]:"UseFIPS"},!0]},Fe={[h]:U,[S]:[{[O]:"UseDualStack"},!0]},f={},T={[O]:"Region"},Ee={[h]:q,[S]:[{[O]:B},"supportsFIPS"]},ze={[O]:B},we={[h]:U,[S]:[!0,{[h]:q,[S]:[ze,"supportsDualStack"]}]},Ce=[$e],Ie=[Fe],be=[T],js={parameters:{Region:he,UseDualStack:Se,UseFIPS:Se,Endpoint:he},rules:[{conditions:[{[h]:me,[S]:[ye]}],rules:[{conditions:Ce,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:v},{conditions:Ie,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:v},{endpoint:{url:ye,properties:f,headers:f},type:b}],type:_},{conditions:[{[h]:me,[S]:be}],rules:[{conditions:[{[h]:"aws.partition",[S]:be,assign:B}],rules:[{conditions:[$e,Fe],rules:[{conditions:[{[h]:U,[S]:[fe,Ee]},we],rules:[{conditions:[{[h]:D,[S]:[T,"us-east-1"]}],endpoint:{url:"https://cognito-identity-fips.us-east-1.amazonaws.com",properties:f,headers:f},type:b},{conditions:[{[h]:D,[S]:[T,"us-east-2"]}],endpoint:{url:"https://cognito-identity-fips.us-east-2.amazonaws.com",properties:f,headers:f},type:b},{conditions:[{[h]:D,[S]:[T,"us-west-1"]}],endpoint:{url:"https://cognito-identity-fips.us-west-1.amazonaws.com",properties:f,headers:f},type:b},{conditions:[{[h]:D,[S]:[T,"us-west-2"]}],endpoint:{url:"https://cognito-identity-fips.us-west-2.amazonaws.com",properties:f,headers:f},type:b},{endpoint:{url:"https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:f,headers:f},type:b}],type:_},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:v}],type:_},{conditions:Ce,rules:[{conditions:[{[h]:U,[S]:[Ee,fe]}],rules:[{endpoint:{url:"https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}",properties:f,headers:f},type:b}],type:_},{error:"FIPS is enabled but this partition does not support FIPS",type:v}],type:_},{conditions:Ie,rules:[{conditions:[we],rules:[{conditions:[{[h]:D,[S]:["aws",{[h]:q,[S]:[ze,"name"]}]}],endpoint:{url:"https://cognito-identity.{Region}.amazonaws.com",properties:f,headers:f},type:b},{endpoint:{url:"https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:f,headers:f},type:b}],type:_},{error:"DualStack is enabled but this partition does not support DualStack",type:v}],type:_},{endpoint:{url:"https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",properties:f,headers:f},type:b}],type:_}],type:_},{error:"Invalid Configuration: Missing Region",type:v}]},Ls=js,Hs=new ut({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Gs=(t,e={})=>Hs.get(t,()=>dt(Ls,{endpointParams:t,logger:e.logger}));_e.aws=Te;const Bs=t=>({apiVersion:"2014-06-30",base64Decoder:t?.base64Decoder??xe,base64Encoder:t?.base64Encoder??L,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??Gs,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??Ns,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new is},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new gt}],logger:t?.logger??new lt,protocol:t?.protocol??Is,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.cognitoidentity",xmlNamespace:"http://cognito-identity.amazonaws.com/doc/2014-06-30/",version:"2014-06-30",serviceTarget:"AWSCognitoIdentityService"},serviceId:t?.serviceId??"Cognito Identity",urlParser:t?.urlParser??pt,utf8Decoder:t?.utf8Decoder??Qe,utf8Encoder:t?.utf8Encoder??Ae}),qs=t=>{const e=ft(t),s=()=>e().then(It),n=Bs(t);return{...n,...t,runtime:"browser",defaultsMode:e,bodyLengthChecker:t?.bodyLengthChecker??Et,credentialDefaultProvider:t?.credentialDefaultProvider??(r=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:t?.defaultUserAgentProvider??zs({serviceId:n.serviceId,clientVersion:Fs.version}),maxAttempts:t?.maxAttempts??yt,region:t?.region??St("Region is missing"),requestHandler:Ye.create(t?.requestHandler??s),retryMode:t?.retryMode??(async()=>(await s()).retryMode||ht),sha256:t?.sha256??mt,streamCollector:t?.streamCollector??Xe,useDualstackEndpoint:t?.useDualstackEndpoint??(()=>Promise.resolve(Ct)),useFipsEndpoint:t?.useFipsEndpoint??(()=>Promise.resolve(wt))}},Vs=t=>({setRegion(e){t.region=e},region(){return t.region}}),Js=t=>({region:t.region()}),Ws=t=>{const e=t.httpAuthSchemes;let s=t.httpAuthSchemeProvider,n=t.credentials;return{setHttpAuthScheme(r){const i=e.findIndex(o=>o.schemeId===r.schemeId);i===-1?e.push(r):e.splice(i,1,r)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(r){s=r},httpAuthSchemeProvider(){return s},setCredentials(r){n=r},credentials(){return n}}},Ks=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()}),Qs=(t,e)=>{const s=Object.assign(Vs(t),bt(t),At(t),Ws(t));return e.forEach(n=>n.configure(s)),Object.assign(t,Js(s),xt(s),_t(s),Ks(s))};class dr extends Pt{config;constructor(...[e]){const s=qs(e||{});super(s),this.initConfig=s;const n=Us(s),r=Kt(n),i=Rt(r),o=kt(i),a=o,u=vt(a),c=Ms(u),d=Qs(c,e?.extensions||[]);this.config=d,this.middlewareStack.use(Ot(this.config)),this.middlewareStack.use(Os(this.config)),this.middlewareStack.use(Dt(this.config)),this.middlewareStack.use(Tt(this.config)),this.middlewareStack.use(jt(this.config)),this.middlewareStack.use(Gt(this.config)),this.middlewareStack.use(Vt(this.config)),this.middlewareStack.use(Nt(this.config,{httpAuthSchemeParametersProvider:Ds,identityProviderConfigProvider:async p=>new Ut({"aws.auth#sigv4":p.credentials})})),this.middlewareStack.use(Mt(this.config))}destroy(){super.destroy()}}class E extends $t{constructor(e){super(e),Object.setPrototypeOf(this,E.prototype)}}class V extends E{name="InternalErrorException";$fault="server";constructor(e){super({name:"InternalErrorException",$fault:"server",...e}),Object.setPrototypeOf(this,V.prototype)}}class J extends E{name="InvalidParameterException";$fault="client";constructor(e){super({name:"InvalidParameterException",$fault:"client",...e}),Object.setPrototypeOf(this,J.prototype)}}class W extends E{name="LimitExceededException";$fault="client";constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),Object.setPrototypeOf(this,W.prototype)}}class K extends E{name="NotAuthorizedException";$fault="client";constructor(e){super({name:"NotAuthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,K.prototype)}}class Q extends E{name="ResourceConflictException";$fault="client";constructor(e){super({name:"ResourceConflictException",$fault:"client",...e}),Object.setPrototypeOf(this,Q.prototype)}}class X extends E{name="TooManyRequestsException";$fault="client";constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),Object.setPrototypeOf(this,X.prototype)}}class Y extends E{name="ResourceNotFoundException";$fault="client";constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,Y.prototype)}}class Z extends E{name="ExternalServiceException";$fault="client";constructor(e){super({name:"ExternalServiceException",$fault:"client",...e}),Object.setPrototypeOf(this,Z.prototype)}}class ee extends E{name="InvalidIdentityPoolConfigurationException";$fault="client";constructor(e){super({name:"InvalidIdentityPoolConfigurationException",$fault:"client",...e}),Object.setPrototypeOf(this,ee.prototype)}}class te extends E{name="DeveloperUserAlreadyRegisteredException";$fault="client";constructor(e){super({name:"DeveloperUserAlreadyRegisteredException",$fault:"client",...e}),Object.setPrototypeOf(this,te.prototype)}}class se extends E{name="ConcurrentModificationException";$fault="client";constructor(e){super({name:"ConcurrentModificationException",$fault:"client",...e}),Object.setPrototypeOf(this,se.prototype)}}const Xs="AccountId",Ys="AccessKeyId",je="Credentials",Zs="ConcurrentModificationException",en="CustomRoleArn",tn="DeveloperUserAlreadyRegisteredException",sn="Expiration",nn="ExternalServiceException",rn="GetCredentialsForIdentity",on="GetCredentialsForIdentityInput",an="GetCredentialsForIdentityResponse",cn="GetId",un="GetIdInput",dn="GetIdResponse",pn="InternalErrorException",ne="IdentityId",ln="InvalidIdentityPoolConfigurationException",gn="InvalidParameterException",fn="IdentityPoolId",mn="IdentityProviderToken",Le="Logins",hn="LimitExceededException",Sn="LoginsMap",yn="NotAuthorizedException",En="ResourceConflictException",wn="ResourceNotFoundException",Cn="SecretKey",In="SecretKeyString",bn="SessionToken",An="TooManyRequestsException",A="client",w="error",x="httpError",C="message",xn="server",He="smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentity",l="com.amazonaws.cognitoidentity";var _n=[0,l,mn,8,0],Pn=[0,l,In,8,0],Rn=[-3,l,Zs,{[w]:A,[x]:400},[C],[0]];y.for(l).registerError(Rn,se);var kn=[3,l,je,0,[Ys,Cn,bn,sn],[0,[()=>Pn,0],0,4]],vn=[-3,l,tn,{[w]:A,[x]:400},[C],[0]];y.for(l).registerError(vn,te);var On=[-3,l,nn,{[w]:A,[x]:400},[C],[0]];y.for(l).registerError(On,Z);var Dn=[3,l,on,0,[ne,Le,en],[0,[()=>Ge,0],0]],Tn=[3,l,an,0,[ne,je],[0,[()=>kn,0]]],Nn=[3,l,un,0,[Xs,fn,Le],[0,0,[()=>Ge,0]]],Mn=[3,l,dn,0,[ne],[0]],Un=[-3,l,pn,{[w]:xn},[C],[0]];y.for(l).registerError(Un,V);var $n=[-3,l,ln,{[w]:A,[x]:400},[C],[0]];y.for(l).registerError($n,ee);var Fn=[-3,l,gn,{[w]:A,[x]:400},[C],[0]];y.for(l).registerError(Fn,J);var zn=[-3,l,hn,{[w]:A,[x]:400},[C],[0]];y.for(l).registerError(zn,W);var jn=[-3,l,yn,{[w]:A,[x]:403},[C],[0]];y.for(l).registerError(jn,K);var Ln=[-3,l,En,{[w]:A,[x]:409},[C],[0]];y.for(l).registerError(Ln,Q);var Hn=[-3,l,wn,{[w]:A,[x]:404},[C],[0]];y.for(l).registerError(Hn,Y);var Gn=[-3,l,An,{[w]:A,[x]:429},[C],[0]];y.for(l).registerError(Gn,X);var Bn=[-3,He,"CognitoIdentityServiceException",0,[],[]];y.for(He).registerError(Bn,E);var Ge=[2,l,Sn,0,[0,0],[()=>_n,0]],qn=[9,l,rn,0,()=>Dn,()=>Tn],Vn=[9,l,cn,0,()=>Nn,()=>Mn];class pr extends ve.classBuilder().ep(Me).m(function(e,s,n,r){return[Oe(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetCredentialsForIdentity",{}).n("CognitoIdentityClient","GetCredentialsForIdentityCommand").sc(qn).build(){}class lr extends ve.classBuilder().ep(Me).m(function(e,s,n,r){return[Oe(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetId",{}).n("CognitoIdentityClient","GetIdCommand").sc(Vn).build(){}export{dr as CognitoIdentityClient,pr as GetCredentialsForIdentityCommand,lr as GetIdCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Y as gt,N as x,k as Oe,L as ft,h as $e,i as ht,b as St,c as Me,S as pe,m as yt,d as wt,e as Et,T,f as me,v as bt,R as At,l as Pt,j as ge,n as Ue,o as Tt,E as Ct,r as Rt,p as _t,q as It,s as kt,t as xt,u as Dt,D as vt,w as Nt,x as Ot,y as $t,z as Mt,A as Ut,B as Ft,F as Lt,G as zt,H as Ht,I as jt,a as Wt,J as Vt,K as Bt,M as Kt,O as qt,P as Gt,Q as Qt,U as Xt,V as Jt,W as Yt,X as Zt,C as es,g as ts}from"./resolveDefaultsModeConfig-D1zWPouA.js";import{d as q,t as G,H as Q,n as L,c as ss,a as Fe,i as rs,f as ns,s as is,F as os}from"./normalizeProvider-BrOPyH3l.js";function fe(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}const X="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",J="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",Y="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",Le="(\\d?\\d)",ze="(\\d{4})",as=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),cs=new RegExp(`^${X}, ${Le} ${J} ${ze} ${Y} GMT$`),ds=new RegExp(`^${X}, ${Le}-${J}-(\\d\\d) ${Y} GMT$`),us=new RegExp(`^${X} ${J} ( [1-9]|\\d\\d) ${Y} ${ze}$`),ls=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ps=e=>{if(e==null)return;let t=NaN;if(typeof e=="number")t=e;else if(typeof e=="string"){if(!/^-?\d*\.?\d+$/.test(e))throw new TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e)}else typeof e=="object"&&e.tag===1&&(t=e.value);if(isNaN(t)||Math.abs(t)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(t*1e3))},ms=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC3339 timestamps must be strings");const t=as.exec(e);if(!t)throw new TypeError(`Invalid RFC3339 timestamp format ${e}`);const[,s,r,n,i,o,a,,d,c]=t;I(r,1,12),I(n,1,31),I(i,0,23),I(o,0,59),I(a,0,60);const u=new Date(Date.UTC(Number(s),Number(r)-1,Number(n),Number(i),Number(o),Number(a),Number(d)?Math.round(parseFloat(`0.${d}`)*1e3):0));if(u.setUTCFullYear(Number(s)),c.toUpperCase()!="Z"){const[,l,m,S]=/([+-])(\d\d):(\d\d)/.exec(c)||[void 0,"+",0,0],P=l==="-"?1:-1;u.setTime(u.getTime()+P*(Number(m)*60*60*1e3+Number(S)*60*1e3))}return u},gs=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC7231 timestamps must be strings.");let t,s,r,n,i,o,a,d;if((d=cs.exec(e))?[,t,s,r,n,i,o,a]=d:(d=ds.exec(e))?([,t,s,r,n,i,o,a]=d,r=(Number(r)+1900).toString()):(d=us.exec(e))&&([,s,t,n,i,o,a,r]=d),r&&o){const c=Date.UTC(Number(r),ls.indexOf(s),Number(t),Number(n),Number(i),Number(o),a?Math.round(parseFloat(`0.${a}`)*1e3):0);I(t,1,31),I(n,0,23),I(i,0,59),I(o,0,60);const u=new Date(c);return u.setUTCFullYear(Number(r)),u}throw new TypeError(`Invalid RFC7231 date-time value ${e}.`)};function I(e,t,s){const r=Number(e);if(r<t||r>s)throw new Error(`Value ${r} out of range [${t}, ${s}]`)}const fs=e=>{const t=e.length,s=[];let r=!1,n,i=0;for(let o=0;o<t;++o){const a=e[o];switch(a){case'"':n!=="\\"&&(r=!r);break;case",":r||(s.push(e.slice(i,o)),i=o+1);break}n=a}return s.push(e.slice(i)),s.map(o=>{o=o.trim();const a=o.length;return a<2?o:(o[0]==='"'&&o[a-1]==='"'&&(o=o.slice(1,a-1)),o.replace(/\\"/g,'"'))})};class hs extends gt{settings;constructor(t){super(),this.settings=t}read(t,s){const r=x.of(t);if(r.isListSchema())return fs(s).map(n=>this.read(r.getValueSchema(),n));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??q)(s);if(r.isTimestampSchema())switch(Oe(r,this.settings)){case 5:return ms(s);case 6:return gs(s);case 7:return ps(s);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",s),new Date(s)}if(r.isStringSchema()){const n=r.getMergedTraits().mediaType;let i=s;if(n)return r.getMergedTraits().httpHeader&&(i=this.base64ToUtf8(i)),(n==="application/json"||n.endsWith("+json"))&&(i=ft.from(i)),i}return r.isNumericSchema()?Number(s):r.isBigIntegerSchema()?BigInt(s):r.isBigDecimalSchema()?new $e(s,"bigDecimal"):r.isBooleanSchema()?String(s).toLowerCase()==="true":s}base64ToUtf8(t){return(this.serdeContext?.utf8Encoder??G)((this.serdeContext?.base64Decoder??q)(t))}}const He=e=>{const t="#text";for(const s in e)e.hasOwnProperty(s)&&e[s][t]!==void 0?e[s]=e[s][t]:typeof e[s]=="object"&&e[s]!==null&&(e[s]=He(e[s]));return e};const Ss=e=>t=>async s=>{if(!Q.isInstance(s.request))return t(s);const{request:r}=s,{handlerProtocol:n=""}=e.requestHandler.metadata||{};if(n.indexOf("h2")>=0&&!r.headers[":authority"])delete r.headers.host,r.headers[":authority"]=r.hostname+(r.port?":"+r.port:"");else if(!r.headers.host){let i=r.hostname;r.port!=null&&(i+=`:${r.port}`),r.headers.host=i}return t(s)},ys={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},ws=e=>({applyToStack:t=>{t.add(Ss(e),ys)}}),Es=()=>(e,t)=>async s=>{try{const r=await e(s),{clientName:n,commandName:i,logger:o,dynamoDbDocumentClientOptions:a={}}=t,{overrideInputFilterSensitiveLog:d,overrideOutputFilterSensitiveLog:c}=a,u=d??t.inputFilterSensitiveLog,l=c??t.outputFilterSensitiveLog,{$metadata:m,...S}=r.output;return o?.info?.({clientName:n,commandName:i,input:u(s.input),output:l(S),metadata:m}),r}catch(r){const{clientName:n,commandName:i,logger:o,dynamoDbDocumentClientOptions:a={}}=t,{overrideInputFilterSensitiveLog:d}=a,c=d??t.inputFilterSensitiveLog;throw o?.error?.({clientName:n,commandName:i,input:c(s.input),error:r,metadata:r.$metadata}),r}},bs={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},As=e=>({applyToStack:t=>{t.add(Es(),bs)}}),Ps={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},Ts=()=>e=>async t=>e(t),Cs=e=>({applyToStack:t=>{t.add(Ts(),Ps)}}),Rs=void 0;function _s(e){return e===void 0?!0:typeof e=="string"&&e.length<=50}function Is(e){const t=L(e.userAgentAppId??Rs),{customUserAgent:s}=e;return Object.assign(e,{customUserAgent:typeof s=="string"?[[s]]:s,userAgentAppId:async()=>{const r=await t();if(!_s(r)){const n=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console:e.logger;typeof r!="string"?n?.warn("userAgentAppId must be a string or undefined."):r.length>50&&n?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return r}})}const je=(e,t=!1)=>{if(t){for(const s of e.split("."))if(!je(s))return!1;return!0}return!(!ht(e)||e.length<3||e.length>63||e!==e.toLowerCase()||St(e))},he=":",ks="/",xs=e=>{const t=e.split(he);if(t.length<6)return null;const[s,r,n,i,o,...a]=t;if(s!=="arn"||r===""||n===""||a.join(he)==="")return null;const d=a.map(c=>c.split(ks)).flat();return{partition:r,service:n,region:i,accountId:o,resourceId:d}},Ds=[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"EU (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],vs={partitions:Ds};let Ns=vs;const Os=e=>{const{partitions:t}=Ns;for(const r of t){const{regions:n,outputs:i}=r;for(const[o,a]of Object.entries(n))if(o===e)return{...i,...a}}for(const r of t){const{regionRegex:n,outputs:i}=r;if(new RegExp(n).test(e))return{...i}}const s=t.find(r=>r.id==="aws");if(!s)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...s.outputs}},We={isVirtualHostableS3Bucket:je,parseArn:xs,partition:Os};Me.aws=We;function $s(e,t,s){return e.$source||(e.$source={}),e.$source[t]=s,e}function C(e,t,s){e.__aws_sdk_context?e.__aws_sdk_context.features||(e.__aws_sdk_context.features={}):e.__aws_sdk_context={features:{}},e.__aws_sdk_context.features[t]=s}const Se=e=>ss.isInstance(e)?e.headers?.date??e.headers?.Date:void 0,Ve=e=>new Date(Date.now()+e),Ms=(e,t)=>Math.abs(Ve(t).getTime()-e)>=3e5,ye=(e,t)=>{const s=Date.parse(e);return Ms(s,t)?s-Date.now():t},z=(e,t)=>{if(!t)throw new Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return t},Us=async e=>{const t=z("context",e.context),s=z("config",e.config),r=t.endpointV2?.properties?.authSchemes?.[0],i=await z("signer",s.signer)(r),o=e?.signingRegion,a=e?.signingRegionSet,d=e?.signingName;return{config:s,signer:i,signingRegion:o,signingRegionSet:a,signingName:d}};class Fs{async sign(t,s,r){if(!Q.isInstance(t))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const n=await Us(r),{config:i,signer:o}=n;let{signingRegion:a,signingName:d}=n;const c=r.context;if(c?.authSchemes?.length??!1){const[l,m]=c.authSchemes;l?.name==="sigv4a"&&m?.name==="sigv4"&&(a=m?.signingRegion??a,d=m?.signingName??d)}return await o.sign(t,{signingDate:Ve(i.systemClockOffset),signingRegion:a,signingService:d})}errorHandler(t){return s=>{const r=s.ServerTime??Se(s.$response);if(r){const n=z("config",t.config),i=n.systemClockOffset;n.systemClockOffset=ye(r,n.systemClockOffset),n.systemClockOffset!==i&&s.$metadata&&(s.$metadata.clockSkewCorrected=!0)}throw s}}successHandler(t,s){const r=Se(t);if(r){const n=z("config",s.config);n.systemClockOffset=ye(r,n.systemClockOffset)}}}const Ls=e=>{let t=e.credentials,s=!!e.credentials,r;Object.defineProperty(e,"credentials",{set(c){c&&c!==t&&c!==r&&(s=!0),t=c;const u=zs(e,{credentials:t,credentialDefaultProvider:e.credentialDefaultProvider}),l=Hs(e,u);s&&!l.attributed?(r=async m=>l(m).then(S=>$s(S,"CREDENTIALS_CODE","e")),r.memoized=l.memoized,r.configBound=l.configBound,r.attributed=!0):r=l},get(){return r},enumerable:!0,configurable:!0}),e.credentials=t;const{signingEscapePath:n=!0,systemClockOffset:i=e.systemClockOffset||0,sha256:o}=e;let a;return e.signer?a=L(e.signer):e.regionInfoProvider?a=()=>L(e.region)().then(async c=>[await e.regionInfoProvider(c,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},c]).then(([c,u])=>{const{signingRegion:l,signingService:m}=c;e.signingRegion=e.signingRegion||l||u,e.signingName=e.signingName||m||e.serviceId;const S={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:n},P=e.signerConstructor||pe;return new P(S)}):a=async c=>{c=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await L(e.region)(),properties:{}},c);const u=c.signingRegion,l=c.signingName;e.signingRegion=e.signingRegion||u,e.signingName=e.signingName||l||e.serviceId;const m={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:n},S=e.signerConstructor||pe;return new S(m)},Object.assign(e,{systemClockOffset:i,signingEscapePath:n,signer:a})};function zs(e,{credentials:t,credentialDefaultProvider:s}){let r;return t?t?.memoized?r=t:r=yt(t,Et,wt):s?r=L(s(Object.assign({},e,{parentClientConfig:e}))):r=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},r.memoized=!0,r}function Hs(e,t){if(t.configBound)return t;const s=async r=>t({...r,callerClientConfig:e});return s.memoized=t.memoized,s.configBound=!0,s}class js{queryCompat;constructor(t=!1){this.queryCompat=t}resolveRestContentType(t,s){const r=s.getMemberSchemas(),n=Object.values(r).find(i=>!!i.getMergedTraits().httpPayload);if(n){const i=n.getMergedTraits().mediaType;return i||(n.isStringSchema()?"text/plain":n.isBlobSchema()?"application/octet-stream":t)}else if(!s.isUnitSchema()&&Object.values(r).find(o=>{const{httpQuery:a,httpQueryParams:d,httpHeader:c,httpLabel:u,httpPrefixHeaders:l}=o.getMergedTraits();return!a&&!d&&!c&&!u&&l===void 0}))return t}async getErrorSchemaOrThrowBaseException(t,s,r,n,i,o){let a=s,d=t;t.includes("#")&&([a,d]=t.split("#"));const c={$metadata:i,$fault:r.statusCode<500?"client":"server"},u=T.for(a);try{return{errorSchema:o?.(u,d)??u.getSchema(t),errorMetadata:c}}catch{n.message=n.message??n.Message??"UnknownError";const m=T.for("smithy.ts.sdk.synthetic."+a),S=m.getBaseException();if(S){const P=m.getErrorCtor(S)??Error;throw this.decorateServiceException(Object.assign(new P({name:d}),c),n)}throw this.decorateServiceException(Object.assign(new Error(d),c),n)}}decorateServiceException(t,s={}){if(this.queryCompat){const r=t.Message??s.Message,n=me(t,s);r&&(n.message=r),n.Error={...n.Error,Type:n.Error.Type,Code:n.Error.Code,Message:n.Error.message??n.Error.Message??r};const i=n.$metadata.requestId;return i&&(n.RequestId=i),n}return me(t,s)}setQueryCompatError(t,s){const r=s.headers?.["x-amzn-query-error"];if(t!==void 0&&r!=null){const[n,i]=r.split(";"),o=Object.entries(t),a={Code:n,Type:i};Object.assign(t,a);for(const[d,c]of o)a[d==="message"?"Message":d]=c;delete a.__type,t.Error=a}}queryCompatOutput(t,s){t.Error&&(s.Error=t.Error),t.Type&&(s.Type=t.Type),t.Code&&(s.Code=t.Code)}findQueryCompatibleError(t,s){try{return t.getSchema(s)}catch{return t.find(n=>x.of(n).getMergedTraits().awsQueryError?.[0]===s)}}}class Be{serdeContext;setSerdeContext(t){this.serdeContext=t}}function*Ws(e,t){if(e.isUnitSchema())return;const s=e.getSchema();for(let r=0;r<s[4].length;++r){const n=s[4][r],i=s[5][r],o=new x([i,0],n);!(n in t)&&!o.isIdempotencyToken()||(yield[n,o])}}class Vs{from;to;keys;constructor(t,s){this.from=t,this.to=s,this.keys=new Set(Object.keys(this.from).filter(r=>r!=="__type"))}mark(t){this.keys.delete(t)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){const t=this.keys.values().next().value,s=this.from[t];this.to.$unknown=[t,s]}}}let j;function Bs(e){j||(j=new DOMParser);const t=j.parseFromString(e,"application/xml");if(t.getElementsByTagName("parsererror").length>0)throw new Error("DOMParser XML parsing error.");const s=r=>{if(r.nodeType===Node.TEXT_NODE&&r.textContent?.trim())return r.textContent;if(r.nodeType===Node.ELEMENT_NODE){const n=r;if(n.attributes.length===0&&n.childNodes.length===0)return"";const i={},o=Array.from(n.attributes);for(const d of o)i[`${d.name}`]=d.value;const a=Array.from(n.childNodes);for(const d of a){const c=s(d);if(c!=null){const u=d.nodeName;if(a.length===1&&o.length===0&&u==="#text")return c;i[u]?Array.isArray(i[u])?i[u].push(c):i[u]=[i[u],c]:i[u]=c}else if(a.length===1&&o.length===0)return n.textContent}return i}return null};return{[t.documentElement.nodeName]:s(t.documentElement)}}class Ks extends Be{settings;stringDeserializer;constructor(t){super(),this.settings=t,this.stringDeserializer=new hs(t)}setSerdeContext(t){this.serdeContext=t,this.stringDeserializer.setSerdeContext(t)}read(t,s,r){const n=x.of(t),i=n.getMemberSchemas();if(n.isStructSchema()&&n.isMemberSchema()&&!!Object.values(i).find(c=>!!c.getMemberTraits().eventPayload)){const c={},u=Object.keys(i)[0];return i[u].isBlobSchema()?c[u]=s:c[u]=this.read(i[u],s),c}const a=(this.serdeContext?.utf8Encoder??G)(s),d=this.parseXml(a);return this.readSchema(t,r?d[r]:d)}readSchema(t,s){const r=x.of(t);if(r.isUnitSchema())return;const n=r.getMergedTraits();if(r.isListSchema()&&!Array.isArray(s))return this.readSchema(r,[s]);if(s==null)return s;if(typeof s=="object"){const i=!!n.sparse,o=!!n.xmlFlattened;if(r.isListSchema()){const d=r.getValueSchema(),c=[],u=d.getMergedTraits().xmlName??"member",l=o?s:(s[0]??s)[u],m=Array.isArray(l)?l:[l];for(const S of m)(S!=null||i)&&c.push(this.readSchema(d,S));return c}const a={};if(r.isMapSchema()){const d=r.getKeySchema(),c=r.getValueSchema();let u;o?u=Array.isArray(s)?s:[s]:u=Array.isArray(s.entry)?s.entry:[s.entry];const l=d.getMergedTraits().xmlName??"key",m=c.getMergedTraits().xmlName??"value";for(const S of u){const P=S[l],F=S[m];(F!=null||i)&&(a[P]=this.readSchema(c,F))}return a}if(r.isStructSchema()){const d=r.isUnionSchema();let c;d&&(c=new Vs(s,a));for(const[u,l]of r.structIterator()){const m=l.getMergedTraits(),S=m.httpPayload?m.xmlName??l.getName():l.getMemberTraits().xmlName??u;d&&c.mark(S),s[S]!=null&&(a[u]=this.readSchema(l,s[S]))}return d&&c.writeUnknown(),a}if(r.isDocumentSchema())return s;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${r.getName(!0)}`)}return r.isListSchema()?[]:r.isMapSchema()||r.isStructSchema()?{}:this.stringDeserializer.read(r,s)}parseXml(t){if(t.length){let s;try{s=Bs(t)}catch(o){throw o&&typeof o=="object"&&Object.defineProperty(o,"$responseBodyText",{value:t}),o}const r="#text",n=Object.keys(s)[0],i=s[n];return i[r]&&(i[n]=i[r],delete i[r]),He(i)}return{}}}class qs extends Be{settings;buffer;constructor(t){super(),this.settings=t}write(t,s,r=""){this.buffer===void 0&&(this.buffer="");const n=x.of(t);if(r&&!r.endsWith(".")&&(r+="."),n.isBlobSchema())(typeof s=="string"||s instanceof Uint8Array)&&(this.writeKey(r),this.writeValue((this.serdeContext?.base64Encoder??Fe)(s)));else if(n.isBooleanSchema()||n.isNumericSchema()||n.isStringSchema())s!=null?(this.writeKey(r),this.writeValue(String(s))):n.isIdempotencyToken()&&(this.writeKey(r),this.writeValue(bt()));else if(n.isBigIntegerSchema())s!=null&&(this.writeKey(r),this.writeValue(String(s)));else if(n.isBigDecimalSchema())s!=null&&(this.writeKey(r),this.writeValue(s instanceof $e?s.string:String(s)));else if(n.isTimestampSchema()){if(s instanceof Date)switch(this.writeKey(r),Oe(n,this.settings)){case 5:this.writeValue(s.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue(rs(s));break;case 7:this.writeValue(String(s.getTime()/1e3));break}}else if(n.isDocumentSchema())Array.isArray(s)?this.write(79,s,r):s instanceof Date?this.write(4,s,r):s instanceof Uint8Array?this.write(21,s,r):s&&typeof s=="object"?this.write(143,s,r):(this.writeKey(r),this.writeValue(String(s)));else if(n.isListSchema()){if(Array.isArray(s))if(s.length===0)this.settings.serializeEmptyLists&&(this.writeKey(r),this.writeValue(""));else{const i=n.getValueSchema(),o=this.settings.flattenLists||n.getMergedTraits().xmlFlattened;let a=1;for(const d of s){if(d==null)continue;const c=this.getKey("member",i.getMergedTraits().xmlName),u=o?`${r}${a}`:`${r}${c}.${a}`;this.write(i,d,u),++a}}}else if(n.isMapSchema()){if(s&&typeof s=="object"){const i=n.getKeySchema(),o=n.getValueSchema(),a=n.getMergedTraits().xmlFlattened;let d=1;for(const[c,u]of Object.entries(s)){if(u==null)continue;const l=this.getKey("key",i.getMergedTraits().xmlName),m=a?`${r}${d}.${l}`:`${r}entry.${d}.${l}`,S=this.getKey("value",o.getMergedTraits().xmlName),P=a?`${r}${d}.${S}`:`${r}entry.${d}.${S}`;this.write(i,c,m),this.write(o,u,P),++d}}}else if(n.isStructSchema()){if(s&&typeof s=="object"){let i=!1;for(const[o,a]of Ws(n,s)){if(s[o]==null&&!a.isIdempotencyToken())continue;const d=this.getKey(o,a.getMergedTraits().xmlName),c=`${r}${d}`;this.write(a,s[o],c),i=!0}if(!i&&n.isUnionSchema()){const{$unknown:o}=s;if(Array.isArray(o)){const[a,d]=o,c=`${r}${a}`;this.write(15,d,c)}}}}else if(!n.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${n.getName(!0)}`)}flush(){if(this.buffer===void 0)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");const t=this.buffer;return delete this.buffer,t}getKey(t,s){const r=s??t;return this.settings.capitalizeKeys?r[0].toUpperCase()+r.slice(1):r}writeKey(t){t.endsWith(".")&&(t=t.slice(0,t.length-1)),this.buffer+=`&${fe(t)}=`}writeValue(t){this.buffer+=fe(t)}}class Gs extends At{options;serializer;deserializer;mixin=new js;constructor(t){super({defaultNamespace:t.defaultNamespace}),this.options=t;const s={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace,serializeEmptyLists:!0};this.serializer=new qs(s),this.deserializer=new Ks(s)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(t){this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t)}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(t,s,r){const n=await super.serializeRequest(t,s,r);n.path.endsWith("/")||(n.path+="/"),Object.assign(n.headers,{"content-type":"application/x-www-form-urlencoded"}),(Pt(t.input)==="unit"||!n.body)&&(n.body="");const i=t.name.split("#")[1]??t.name;return n.body=`Action=${i}&Version=${this.options.version}`+n.body,n.body.endsWith("&")&&(n.body=n.body.slice(-1)),n}async deserializeResponse(t,s,r){const n=this.deserializer,i=x.of(t.output),o={};if(r.statusCode>=300){const l=await ge(r.body,s);l.byteLength>0&&Object.assign(o,await n.read(15,l)),await this.handleError(t,s,r,o,this.deserializeMetadata(r))}for(const l in r.headers){const m=r.headers[l];delete r.headers[l],r.headers[l.toLowerCase()]=m}const a=t.name.split("#")[1]??t.name,d=i.isStructSchema()&&this.useNestedResult()?a+"Result":void 0,c=await ge(r.body,s);return c.byteLength>0&&Object.assign(o,await n.read(i,c,d)),{$metadata:this.deserializeMetadata(r),...o}}useNestedResult(){return!0}async handleError(t,s,r,n,i){const o=this.loadQueryErrorCode(r,n)??"Unknown",a=this.loadQueryError(n),d=this.loadQueryErrorMessage(n);a.message=d,a.Error={Type:a.Type,Code:a.Code,Message:d};const{errorSchema:c,errorMetadata:u}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,r,a,i,this.mixin.findQueryCompatibleError),l=x.of(c),m=T.for(c[1]).getErrorCtor(c)??Error,S=new m(d),P={Type:a.Error.Type,Code:a.Error.Code,Error:a.Error};for(const[F,ue]of l.structIterator()){const le=ue.getMergedTraits().xmlName??F,mt=a[le]??n[le];P[F]=this.deserializer.readSchema(ue,mt)}throw this.mixin.decorateServiceException(Object.assign(S,u,{$fault:l.getMergedTraits().error,message:d},P),n)}loadQueryErrorCode(t,s){const r=(s.Errors?.[0]?.Error??s.Errors?.Error??s.Error)?.Code;if(r!==void 0)return r;if(t.statusCode==404)return"NotFound"}loadQueryError(t){return t.Errors?.[0]?.Error??t.Errors?.Error??t.Error}loadQueryErrorMessage(t){const s=this.loadQueryError(t);return s?.message??s?.Message??t.message??t.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}}const Qs=/\d{12}\.ddb/;async function Xs(e,t,s){if(s.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&C(e,"PROTOCOL_RPC_V2_CBOR","M"),typeof t.retryStrategy=="function"){const i=await t.retryStrategy();typeof i.acquireInitialRetryToken=="function"?i.constructor?.name?.includes("Adaptive")?C(e,"RETRY_MODE_ADAPTIVE","F"):C(e,"RETRY_MODE_STANDARD","E"):C(e,"RETRY_MODE_LEGACY","D")}if(typeof t.accountIdEndpointMode=="function"){const i=e.endpointV2;switch(String(i?.url?.hostname).match(Qs)&&C(e,"ACCOUNT_ID_ENDPOINT","O"),await t.accountIdEndpointMode?.()){case"disabled":C(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":C(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":C(e,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const n=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(n?.$source){const i=n;i.accountId&&C(e,"RESOLVED_ACCOUNT_ID","T");for(const[o,a]of Object.entries(i.$source??{}))C(e,o,a)}}const we="user-agent",W="x-amz-user-agent",Ee=" ",V="/",Js=/[^!$%&'*+\-.^_`|~\w]/g,Ys=/[^!$%&'*+\-.^_`|~\w#]/g,be="-",Zs=1024;function er(e){let t="";for(const s in e){const r=e[s];if(t.length+r.length+1<=Zs){t.length?t+=","+r:t+=r;continue}break}return t}const tr=e=>(t,s)=>async r=>{const{request:n}=r;if(!Q.isInstance(n))return t(r);const{headers:i}=n,o=s?.userAgent?.map(H)||[],a=(await e.defaultUserAgentProvider()).map(H);await Xs(s,e,r);const d=s;a.push(`m/${er(Object.assign({},s.__smithy_context?.features,d.__aws_sdk_context?.features))}`);const c=e?.customUserAgent?.map(H)||[],u=await e.userAgentAppId();u&&a.push(H(["app",`${u}`]));const l=[].concat([...a,...o,...c]).join(Ee),m=[...a.filter(S=>S.startsWith("aws-sdk-")),...c].join(Ee);return e.runtime!=="browser"?(m&&(i[W]=i[W]?`${i[we]} ${m}`:m),i[we]=l):i[W]=l,t({...r,request:n})},H=e=>{const t=e[0].split(V).map(o=>o.replace(Js,be)).join(V),s=e[1]?.replace(Ys,be),r=t.indexOf(V),n=t.substring(0,r);let i=t.substring(r+1);return n==="api"&&(i=i.toLowerCase()),[n,i,s].filter(o=>o&&o.length>0).reduce((o,a,d)=>{switch(d){case 0:return a;case 1:return`${o}/${a}`;default:return`${o}#${a}`}},"")},sr={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},rr=e=>({applyToStack:t=>{t.add(tr(e),sr)}}),nr=async(e,t,s)=>({operation:Tt(t).operation,region:await Ue(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function ir(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:e.region},propertiesExtractor:(t,s)=>({signingProperties:{config:t,context:s}})}}function or(e){return{schemeId:"smithy.api#noAuth"}}const ar=e=>{const t=[];switch(e.operation){case"AssumeRoleWithWebIdentity":{t.push(or());break}default:t.push(ir(e))}return t},cr=e=>Object.assign(e,{stsClientCtor:st}),dr=e=>{const t=cr(e),s=Ls(t);return Object.assign(s,{authSchemePreference:Ue(e.authSchemePreference??[])})},ur=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,useGlobalEndpoint:e.useGlobalEndpoint??!1,defaultSigningName:"sts"}),lr={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"}},pr="3.958.0",mr={version:pr},gr=({serviceId:e,clientVersion:t})=>async s=>{const r=typeof window<"u"?window.navigator:void 0,n=r?.userAgent??"",i=r?.userAgentData?.platform??Ae.os(n)??"other",o=void 0,a=r?.userAgentData?.brands??[],d=a[a.length-1],c=d?.brand??Ae.browser(n)??"unknown",u=d?.version??"unknown",l=[["aws-sdk-js",t],["ua","2.1"],[`os/${i}`,o],["lang/js"],["md/browser",`${c}_${u}`]];e&&l.push([`api/${e}`,t]);const m=await s?.userAgentAppId?.();return m&&l.push([`app/${m}`]),l},Ae={os(e){if(/iPhone|iPad|iPod/.test(e))return"iOS";if(/Macintosh|Mac OS X/.test(e))return"macOS";if(/Windows NT/.test(e))return"Windows";if(/Android/.test(e))return"Android";if(/Linux/.test(e))return"Linux"},browser(e){if(/EdgiOS|EdgA|Edg\//.test(e))return"Microsoft Edge";if(/Firefox\//.test(e))return"Firefox";if(/Chrome\//.test(e))return"Chrome";if(/Safari\//.test(e))return"Safari"}},Ke="required",p="type",g="fn",f="argv",D="ref",Pe=!1,B=!0,k="booleanEquals",w="stringEquals",qe="sigv4",Ge="sts",Qe="us-east-1",y="endpoint",Te="https://sts.{Region}.{PartitionResult#dnsSuffix}",R="tree",U="error",Z="getAttr",Ce={[Ke]:!1,[p]:"string"},K={[Ke]:!0,default:!1,[p]:"boolean"},Xe={[D]:"Endpoint"},Re={[g]:"isSet",[f]:[{[D]:"Region"}]},E={[D]:"Region"},_e={[g]:"aws.partition",[f]:[E],assign:"PartitionResult"},Je={[D]:"UseFIPS"},Ye={[D]:"UseDualStack"},b={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:qe,signingName:Ge,signingRegion:Qe}]},headers:{}},A={},Ie={conditions:[{[g]:w,[f]:[E,"aws-global"]}],[y]:b,[p]:y},Ze={[g]:k,[f]:[Je,!0]},et={[g]:k,[f]:[Ye,!0]},ke={[g]:Z,[f]:[{[D]:"PartitionResult"},"supportsFIPS"]},tt={[D]:"PartitionResult"},xe={[g]:k,[f]:[!0,{[g]:Z,[f]:[tt,"supportsDualStack"]}]},De=[{[g]:"isSet",[f]:[Xe]}],ve=[Ze],Ne=[et],fr={parameters:{Region:Ce,UseDualStack:K,UseFIPS:K,Endpoint:Ce,UseGlobalEndpoint:K},rules:[{conditions:[{[g]:k,[f]:[{[D]:"UseGlobalEndpoint"},B]},{[g]:"not",[f]:De},Re,_e,{[g]:k,[f]:[Je,Pe]},{[g]:k,[f]:[Ye,Pe]}],rules:[{conditions:[{[g]:w,[f]:[E,"ap-northeast-1"]}],endpoint:b,[p]:y},{conditions:[{[g]:w,[f]:[E,"ap-south-1"]}],endpoint:b,[p]:y},{conditions:[{[g]:w,[f]:[E,"ap-southeast-1"]}],endpoint:b,[p]:y},{conditions:[{[g]:w,[f]:[E,"ap-southeast-2"]}],endpoint:b,[p]:y},Ie,{conditions:[{[g]:w,[f]:[E,"ca-central-1"]}],endpoint:b,[p]:y},{conditions:[{[g]:w,[f]:[E,"eu-central-1"]}],endpoint:b,[p]:y},{conditions:[{[g]:w,[f]:[E,"eu-north-1"]}],endpoint:b,[p]:y},{conditions:[{[g]:w,[f]:[E,"eu-west-1"]}],endpoint:b,[p]:y},{conditions:[{[g]:w,[f]:[E,"eu-west-2"]}],endpoint:b,[p]:y},{conditions:[{[g]:w,[f]:[E,"eu-west-3"]}],endpoint:b,[p]:y},{conditions:[{[g]:w,[f]:[E,"sa-east-1"]}],endpoint:b,[p]:y},{conditions:[{[g]:w,[f]:[E,Qe]}],endpoint:b,[p]:y},{conditions:[{[g]:w,[f]:[E,"us-east-2"]}],endpoint:b,[p]:y},{conditions:[{[g]:w,[f]:[E,"us-west-1"]}],endpoint:b,[p]:y},{conditions:[{[g]:w,[f]:[E,"us-west-2"]}],endpoint:b,[p]:y},{endpoint:{url:Te,properties:{authSchemes:[{name:qe,signingName:Ge,signingRegion:"{Region}"}]},headers:A},[p]:y}],[p]:R},{conditions:De,rules:[{conditions:ve,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[p]:U},{conditions:Ne,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[p]:U},{endpoint:{url:Xe,properties:A,headers:A},[p]:y}],[p]:R},{conditions:[Re],rules:[{conditions:[_e],rules:[{conditions:[Ze,et],rules:[{conditions:[{[g]:k,[f]:[B,ke]},xe],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:A,headers:A},[p]:y}],[p]:R},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[p]:U}],[p]:R},{conditions:ve,rules:[{conditions:[{[g]:k,[f]:[ke,B]}],rules:[{conditions:[{[g]:w,[f]:[{[g]:Z,[f]:[tt,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:A,headers:A},[p]:y},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:A,headers:A},[p]:y}],[p]:R},{error:"FIPS is enabled but this partition does not support FIPS",[p]:U}],[p]:R},{conditions:Ne,rules:[{conditions:[xe],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:A,headers:A},[p]:y}],[p]:R},{error:"DualStack is enabled but this partition does not support DualStack",[p]:U}],[p]:R},Ie,{endpoint:{url:Te,properties:A,headers:A},[p]:y}],[p]:R}],[p]:R},{error:"Invalid Configuration: Missing Region",[p]:U}]},hr=fr,Sr=new Ct({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),yr=(e,t={})=>Sr.get(e,()=>Rt(hr,{endpointParams:e,logger:t.logger}));Me.aws=We;const wr=e=>({apiVersion:"2011-06-15",base64Decoder:e?.base64Decoder??q,base64Encoder:e?.base64Encoder??Fe,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??yr,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??ar,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new Fs},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new kt}],logger:e?.logger??new It,protocol:e?.protocol??Gs,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.sts",xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/",version:"2011-06-15",serviceTarget:"AWSSecurityTokenServiceV20110615"},serviceId:e?.serviceId??"STS",urlParser:e?.urlParser??_t,utf8Decoder:e?.utf8Decoder??ns,utf8Encoder:e?.utf8Encoder??G}),Er=e=>{const t=xt(e),s=()=>t().then(Ft),r=wr(e);return{...r,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??$t,credentialDefaultProvider:e?.credentialDefaultProvider??(n=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??gr({serviceId:r.serviceId,clientVersion:mr.version}),maxAttempts:e?.maxAttempts??Ot,region:e?.region??Nt("Region is missing"),requestHandler:os.create(e?.requestHandler??s),retryMode:e?.retryMode??(async()=>(await s()).retryMode||vt),sha256:e?.sha256??Dt,streamCollector:e?.streamCollector??is,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(Ut)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(Mt))}},br=e=>({setRegion(t){e.region=t},region(){return e.region}}),Ar=e=>({region:e.region()}),Pr=e=>{const t=e.httpAuthSchemes;let s=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(n){const i=t.findIndex(o=>o.schemeId===n.schemeId);i===-1?t.push(n):t.splice(i,1,n)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(n){s=n},httpAuthSchemeProvider(){return s},setCredentials(n){r=n},credentials(){return r}}},Tr=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),Cr=(e,t)=>{const s=Object.assign(br(e),Lt(e),zt(e),Pr(e));return t.forEach(r=>r.configure(s)),Object.assign(e,Ar(s),Ht(s),jt(s),Tr(s))};class st extends Wt{config;constructor(...[t]){const s=Er(t||{});super(s),this.initConfig=s;const r=ur(s),n=Is(r),i=Vt(n),o=Bt(i),a=o,d=Kt(a),c=dr(d),u=Cr(c,t?.extensions||[]);this.config=u,this.middlewareStack.use(qt(this.config)),this.middlewareStack.use(rr(this.config)),this.middlewareStack.use(Gt(this.config)),this.middlewareStack.use(Qt(this.config)),this.middlewareStack.use(ws(this.config)),this.middlewareStack.use(As(this.config)),this.middlewareStack.use(Cs(this.config)),this.middlewareStack.use(Xt(this.config,{httpAuthSchemeParametersProvider:nr,identityProviderConfigProvider:async l=>new Yt({"aws.auth#sigv4":l.credentials})})),this.middlewareStack.use(Jt(this.config))}destroy(){super.destroy()}}class _ extends Zt{constructor(t){super(t),Object.setPrototypeOf(this,_.prototype)}}class ee extends _{name="ExpiredTokenException";$fault="client";constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,ee.prototype)}}class te extends _{name="MalformedPolicyDocumentException";$fault="client";constructor(t){super({name:"MalformedPolicyDocumentException",$fault:"client",...t}),Object.setPrototypeOf(this,te.prototype)}}class se extends _{name="PackedPolicyTooLargeException";$fault="client";constructor(t){super({name:"PackedPolicyTooLargeException",$fault:"client",...t}),Object.setPrototypeOf(this,se.prototype)}}class re extends _{name="RegionDisabledException";$fault="client";constructor(t){super({name:"RegionDisabledException",$fault:"client",...t}),Object.setPrototypeOf(this,re.prototype)}}class ne extends _{name="IDPRejectedClaimException";$fault="client";constructor(t){super({name:"IDPRejectedClaimException",$fault:"client",...t}),Object.setPrototypeOf(this,ne.prototype)}}class ie extends _{name="InvalidIdentityTokenException";$fault="client";constructor(t){super({name:"InvalidIdentityTokenException",$fault:"client",...t}),Object.setPrototypeOf(this,ie.prototype)}}class oe extends _{name="IDPCommunicationErrorException";$fault="client";constructor(t){super({name:"IDPCommunicationErrorException",$fault:"client",...t}),Object.setPrototypeOf(this,oe.prototype)}}const Rr="Arn",_r="AccessKeyId",Ir="AssumeRole",kr="AssumedRoleId",xr="AssumeRoleRequest",Dr="AssumeRoleResponse",ae="AssumedRoleUser",vr="AssumeRoleWithWebIdentity",Nr="AssumeRoleWithWebIdentityRequest",Or="AssumeRoleWithWebIdentityResponse",$r="Audience",ce="Credentials",Mr="ContextAssertion",rt="DurationSeconds",Ur="Expiration",Fr="ExternalId",Lr="ExpiredTokenException",zr="IDPCommunicationErrorException",Hr="IDPRejectedClaimException",jr="InvalidIdentityTokenException",Wr="Key",Vr="MalformedPolicyDocumentException",nt="Policy",it="PolicyArns",Br="ProviderArn",Kr="ProvidedContexts",qr="ProvidedContextsListType",Gr="ProvidedContext",Qr="PolicyDescriptorType",Xr="ProviderId",ot="PackedPolicySize",Jr="PackedPolicyTooLargeException",Yr="Provider",at="RoleArn",Zr="RegionDisabledException",ct="RoleSessionName",en="SecretAccessKey",tn="SubjectFromWebIdentityToken",de="SourceIdentity",sn="SerialNumber",rn="SessionToken",nn="Tags",on="TokenCode",an="TransitiveTagKeys",cn="Tag",dn="Value",un="WebIdentityToken",ln="arn",pn="accessKeySecretType",v="awsQueryError",N="client",mn="clientTokenType",O="error",$="httpError",M="message",gn="policyDescriptorListType",dt="smithy.ts.sdk.synthetic.com.amazonaws.sts",fn="tagListType",h="com.amazonaws.sts";var hn=[0,h,pn,8,0],Sn=[0,h,mn,8,0],ut=[3,h,ae,0,[kr,Rr],[0,0]],yn=[3,h,xr,0,[at,ct,it,nt,rt,nn,an,Fr,sn,on,de,Kr],[0,0,()=>pt,0,1,()=>On,64,0,0,0,0,()=>Nn]],wn=[3,h,Dr,0,[ce,ae,ot,de],[[()=>lt,0],()=>ut,1,0]],En=[3,h,Nr,0,[at,ct,un,Xr,it,nt,rt],[0,0,[()=>Sn,0],0,()=>pt,0,1]],bn=[3,h,Or,0,[ce,tn,ae,ot,Yr,$r,de],[[()=>lt,0],0,()=>ut,1,0,0,0]],lt=[3,h,ce,0,[_r,en,rn,Ur],[0,[()=>hn,0],0,4]],An=[-3,h,Lr,{[v]:["ExpiredTokenException",400],[O]:N,[$]:400},[M],[0]];T.for(h).registerError(An,ee);var Pn=[-3,h,zr,{[v]:["IDPCommunicationError",400],[O]:N,[$]:400},[M],[0]];T.for(h).registerError(Pn,oe);var Tn=[-3,h,Hr,{[v]:["IDPRejectedClaim",403],[O]:N,[$]:403},[M],[0]];T.for(h).registerError(Tn,ne);var Cn=[-3,h,jr,{[v]:["InvalidIdentityToken",400],[O]:N,[$]:400},[M],[0]];T.for(h).registerError(Cn,ie);var Rn=[-3,h,Vr,{[v]:["MalformedPolicyDocument",400],[O]:N,[$]:400},[M],[0]];T.for(h).registerError(Rn,te);var _n=[-3,h,Jr,{[v]:["PackedPolicyTooLarge",400],[O]:N,[$]:400},[M],[0]];T.for(h).registerError(_n,se);var In=[3,h,Qr,0,[ln],[0]],kn=[3,h,Gr,0,[Br,Mr],[0,0]],xn=[-3,h,Zr,{[v]:["RegionDisabledException",403],[O]:N,[$]:403},[M],[0]];T.for(h).registerError(xn,re);var Dn=[3,h,cn,0,[Wr,dn],[0,0]],vn=[-3,dt,"STSServiceException",0,[],[]];T.for(dt).registerError(vn,_);var pt=[1,h,gn,0,()=>In],Nn=[1,h,qr,0,()=>kn],On=[1,h,fn,0,()=>Dn],$n=[9,h,Ir,0,()=>yn,()=>wn],Ln=[9,h,vr,0,()=>En,()=>bn];class Mn extends es.classBuilder().ep(lr).m(function(t,s,r,n){return[ts(r,t.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").sc($n).build(){}const zn=Object.freeze(Object.defineProperty({__proto__:null,AssumeRoleCommand:Mn,STSClient:st},Symbol.toStringTag,{value:"Module"}));export{Ln as A,lt as C,An as E,Pn as I,Rn as M,_n as P,xn as R,st as S,Dn as T,_ as a,Mn as b,lr as c,ut as d,yn as e,wn as f,En as g,bn as h,Tn as i,Cn as j,In as k,kn as l,vn as m,$n as n,ee as o,te as p,se as q,re as r,$s as s,ne as t,ie as u,oe as v,zn as w};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
class U{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){const r=new U({...t,headers:{...t.headers}});return r.query&&(r.query=V(r.query)),r}static isInstance(t){if(!t)return!1;const r=t;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return U.clone(this)}}function V(e){return Object.keys(e).reduce((t,r)=>{const n=e[r];return{...t,[r]:Array.isArray(n)?[...n]:n}},{})}class B{statusCode;reason;headers;body;constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;const r=t;return typeof r.statusCode=="number"&&typeof r.headers=="object"}}const M=e=>encodeURIComponent(e).replace(/[!'()*]/g,X),X=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function z(e){const t=[];for(let r of Object.keys(e).sort()){const n=e[r];if(r=M(r),Array.isArray(n))for(let o=0,i=n.length;o<i;o++)t.push(`${r}=${M(n[o])}`);else{let o=r;(n||typeof n=="string")&&(o+=`=${M(n)}`),t.push(o)}}return t.join("&")}function P(e,t){return new Request(e,t)}function Z(e=0){return new Promise((t,r)=>{e&&setTimeout(()=>{const n=new Error(`Request did not complete within ${e} ms`);n.name="TimeoutError",r(n)},e)})}const I={supported:void 0};class J{config;configProvider;static create(t){return typeof t?.handle=="function"?t:new J(t)}constructor(t){typeof t=="function"?this.configProvider=t().then(r=>r||{}):(this.config=t??{},this.configProvider=Promise.resolve(this.config)),I.supported===void 0&&(I.supported=typeof Request<"u"&&"keepalive"in P("https://[::1]"))}destroy(){}async handle(t,{abortSignal:r,requestTimeout:n}={}){this.config||(this.config=await this.configProvider);const o=n??this.config.requestTimeout,i=this.config.keepAlive===!0,c=this.config.credentials;if(r?.aborted){const u=new Error("Request aborted");return u.name="AbortError",Promise.reject(u)}let a=t.path;const d=z(t.query||{});d&&(a+=`?${d}`),t.fragment&&(a+=`#${t.fragment}`);let s="";if(t.username!=null||t.password!=null){const u=t.username??"",T=t.password??"";s=`${u}:${T}@`}const{port:f,method:y}=t,w=`${t.protocol}//${s}${t.hostname}${f?`:${f}`:""}${a}`,C=y==="GET"||y==="HEAD"?void 0:t.body,h={body:C,headers:new Headers(t.headers),method:y,credentials:c};this.config?.cache&&(h.cache=this.config.cache),C&&(h.duplex="half"),typeof AbortController<"u"&&(h.signal=r),I.supported&&(h.keepalive=i),typeof this.config.requestInit=="function"&&Object.assign(h,this.config.requestInit(t));let O=()=>{};const G=P(w,h),L=[fetch(G).then(u=>{const T=u.headers,g={};for(const x of T.entries())g[x[0]]=x[1];return u.body!=null?{response:new B({headers:g,reason:u.statusText,statusCode:u.status,body:u.body})}:u.blob().then(x=>({response:new B({headers:g,reason:u.statusText,statusCode:u.status,body:x})}))}),Z(o)];return r&&L.push(new Promise((u,T)=>{const g=()=>{const m=new Error("Request aborted");m.name="AbortError",T(m)};if(typeof r.addEventListener=="function"){const m=r;m.addEventListener("abort",g,{once:!0}),O=()=>m.removeEventListener("abort",g)}else r.onabort=g})),Promise.race(L).finally(O)}updateHttpClientConfig(t,r){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[t]=r,n))}httpHandlerConfigs(){return this.config??{}}}const Y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k=Object.entries(Y).reduce((e,[t,r])=>(e[r]=Number(t),e),{}),Q=Y.split(""),p=6,E=8,K=63,v=e=>{let t=e.length/4*3;e.slice(-2)==="=="?t-=2:e.slice(-1)==="="&&t--;const r=new ArrayBuffer(t),n=new DataView(r);for(let o=0;o<e.length;o+=4){let i=0,c=0;for(let s=o,f=o+3;s<=f;s++)if(e[s]!=="="){if(!(e[s]in k))throw new TypeError(`Invalid character ${e[s]} in base64 string.`);i|=k[e[s]]<<(f-s)*p,c+=p}else i>>=p;const a=o/4*3;i>>=c%E;const d=Math.floor(c/E);for(let s=0;s<d;s++){const f=(d-s-1)*E;n.setUint8(a+s,(i&255<<f)>>f)}}return new Uint8Array(r)},ee=e=>new TextEncoder().encode(e),Me=e=>{if(typeof e=="string")return e;if(typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)};function Ie(e){let t;typeof e=="string"?t=ee(e):t=e;const r=typeof t=="object"&&typeof t.length=="number",n=typeof t=="object"&&typeof t.byteOffset=="number"&&typeof t.byteLength=="number";if(!r&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let o="";for(let i=0;i<t.length;i+=3){let c=0,a=0;for(let s=i,f=Math.min(i+3,t.length);s<f;s++)c|=t[s]<<(f-s-1)*E,a+=E;const d=Math.ceil(a/p);c<<=d*p-a;for(let s=1;s<=d;s++){const f=(d-s)*p;o+=Q[(c&K<<f)>>f]}o+="==".slice(0,4-d)}return o}const Re=async e=>typeof Blob=="function"&&e instanceof Blob||e.constructor?.name==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await e.arrayBuffer()):te(e):re(e);async function te(e){const t=await ne(e),r=v(t);return new Uint8Array(r)}async function re(e){const t=[],r=e.getReader();let n=!1,o=0;for(;!n;){const{done:a,value:d}=await r.read();d&&(t.push(d),o+=d.length),n=a}const i=new Uint8Array(o);let c=0;for(const a of t)i.set(a,c),c+=a.length;return i}function ne(e){return new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const o=n.result??"",i=o.indexOf(","),c=i>-1?i+1:o.length;t(o.substring(c))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(e)})}const W={},D={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),W[e]=t,D[t]=e}function Ue(e){if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2){const n=e.slice(r,r+2).toLowerCase();if(n in D)t[r/2]=D[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return t}function De(e){let t="";for(let r=0;r<e.byteLength;r++)t+=W[e[r]];return t}const F=e=>{if(e!=null){if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&he.warn(ue(`Expected number but observed string: ${e}`)),t}if(typeof e=="number")return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},oe=Math.ceil(2**127*(2-2**-23)),H=e=>{const t=F(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>oe)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},se=e=>{if(e!=null){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}},j=e=>q(e,16),_=e=>q(e,8),q=(e,t)=>{const r=se(e);if(r!==void 0&&ie(r,t)!==r)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return r},ie=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},ce=e=>F(typeof e=="string"?A(e):e),ae=e=>H(typeof e=="string"?A(e):e),de=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,A=e=>{const t=e.match(de);if(t===null||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},$=e=>j(typeof e=="string"?A(e):e),fe=e=>_(typeof e=="string"?A(e):e),ue=e=>String(new TypeError(e).stack||e).split(`
|
|
2
2
|
`).slice(0,5).filter(t=>!t.includes("stackTraceWarning")).join(`
|
|
3
|
-
`),he={warn:console.warn},le=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Fe(e){const t=e.getUTCFullYear(),r=e.getUTCMonth(),n=e.getUTCDay(),o=e.getUTCDate(),i=e.getUTCHours(),c=e.getUTCMinutes(),a=e.getUTCSeconds(),d=o<10?`0${o}`:`${o}`,s=i<10?`0${i}`:`${i}`,f=c<10?`0${c}`:`${c}`,y=a<10?`0${a}`:`${a}`;return`${le[n]}, ${d} ${N[r]} ${t} ${s}:${f}:${y} GMT`}const ye=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Ne=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=ye.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,o,i,c,a,d,s]=t,f=$(b(n)),y=l(o,"month",1,12),w=l(i,"day",1,31);return S(f,y,w,{hours:c,minutes:a,seconds:d,fractionalMilliseconds:s})},ge=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Oe=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=ge.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,o,i,c,a,d,s,f]=t,y=$(b(n)),w=l(o,"month",1,12),C=l(i,"day",1,31),h=S(y,w,C,{hours:c,minutes:a,seconds:d,fractionalMilliseconds:s});return f.toUpperCase()!="Z"&&h.setTime(h.getTime()-Ae(f)),h},me=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),pe=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),be=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),Le=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=me.exec(e);if(t){const[r,n,o,i,c,a,d,s]=t;return S($(b(i)),R(o),l(n,"day",1,31),{hours:c,minutes:a,seconds:d,fractionalMilliseconds:s})}if(t=pe.exec(e),t){const[r,n,o,i,c,a,d,s]=t;return Ee(S(we(i),R(o),l(n,"day",1,31),{hours:c,minutes:a,seconds:d,fractionalMilliseconds:s}))}if(t=be.exec(e),t){const[r,n,o,i,c,a,d,s]=t;return S($(b(s)),R(n),l(o.trimLeft(),"day",1,31),{hours:i,minutes:c,seconds:a,fractionalMilliseconds:d})}throw new TypeError("Invalid RFC-7231 date-time value")},Be=e=>{if(e==null)return;let t;if(typeof e=="number")t=e;else if(typeof e=="string")t=ce(e);else if(typeof e=="object"&&e.tag===1)t=e.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(t*1e3))},S=(e,t,r,n)=>{const o=t-1;return $e(e,o,r),new Date(Date.UTC(e,o,r,l(n.hours,"hour",0,23),l(n.minutes,"minute",0,59),l(n.seconds,"seconds",0,60),xe(n.fractionalMilliseconds)))},we=e=>{const t=new Date().getUTCFullYear(),r=Math.floor(t/100)*100+$(b(e));return r<t?r+100:r},Te=50*365*24*60*60*1e3,Ee=e=>e.getTime()-new Date().getTime()>Te?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,R=e=>{const t=N.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},Se=[31,28,31,30,31,30,31,31,30,31,30,31],$e=(e,t,r)=>{let n=Se[t];if(t===1&&Ce(e)&&(n=29),r>n)throw new TypeError(`Invalid day for ${N[t]} in ${e}: ${r}`)},Ce=e=>e%4===0&&(e%100!==0||e%400===0),l=(e,t,r,n)=>{const o=fe(b(e));if(o<r||o>n)throw new TypeError(`${t} must be between ${r} and ${n}, inclusive`);return o},xe=e=>e==null?0:ae("0."+e)*1e3,Ae=e=>{const t=e[0];let r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);const n=Number(e.substring(1,3)),o=Number(e.substring(4,6));return r*(n*60+o)*60*1e3},b=e=>{let t=0;for(;t<e.length-1&&e.charAt(t)==="0";)t++;return t===0?e:e.slice(t)},Pe=e=>{if(typeof e=="function")return e;const t=Promise.resolve(e);return()=>t};export{J as F,U as H,
|
|
3
|
+
`),he={warn:console.warn},le=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Fe(e){const t=e.getUTCFullYear(),r=e.getUTCMonth(),n=e.getUTCDay(),o=e.getUTCDate(),i=e.getUTCHours(),c=e.getUTCMinutes(),a=e.getUTCSeconds(),d=o<10?`0${o}`:`${o}`,s=i<10?`0${i}`:`${i}`,f=c<10?`0${c}`:`${c}`,y=a<10?`0${a}`:`${a}`;return`${le[n]}, ${d} ${N[r]} ${t} ${s}:${f}:${y} GMT`}const ye=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Ne=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=ye.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,o,i,c,a,d,s]=t,f=$(b(n)),y=l(o,"month",1,12),w=l(i,"day",1,31);return S(f,y,w,{hours:c,minutes:a,seconds:d,fractionalMilliseconds:s})},ge=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Oe=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=ge.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,o,i,c,a,d,s,f]=t,y=$(b(n)),w=l(o,"month",1,12),C=l(i,"day",1,31),h=S(y,w,C,{hours:c,minutes:a,seconds:d,fractionalMilliseconds:s});return f.toUpperCase()!="Z"&&h.setTime(h.getTime()-Ae(f)),h},me=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),pe=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),be=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),Le=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=me.exec(e);if(t){const[r,n,o,i,c,a,d,s]=t;return S($(b(i)),R(o),l(n,"day",1,31),{hours:c,minutes:a,seconds:d,fractionalMilliseconds:s})}if(t=pe.exec(e),t){const[r,n,o,i,c,a,d,s]=t;return Ee(S(we(i),R(o),l(n,"day",1,31),{hours:c,minutes:a,seconds:d,fractionalMilliseconds:s}))}if(t=be.exec(e),t){const[r,n,o,i,c,a,d,s]=t;return S($(b(s)),R(n),l(o.trimLeft(),"day",1,31),{hours:i,minutes:c,seconds:a,fractionalMilliseconds:d})}throw new TypeError("Invalid RFC-7231 date-time value")},Be=e=>{if(e==null)return;let t;if(typeof e=="number")t=e;else if(typeof e=="string")t=ce(e);else if(typeof e=="object"&&e.tag===1)t=e.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(t*1e3))},S=(e,t,r,n)=>{const o=t-1;return $e(e,o,r),new Date(Date.UTC(e,o,r,l(n.hours,"hour",0,23),l(n.minutes,"minute",0,59),l(n.seconds,"seconds",0,60),xe(n.fractionalMilliseconds)))},we=e=>{const t=new Date().getUTCFullYear(),r=Math.floor(t/100)*100+$(b(e));return r<t?r+100:r},Te=50*365*24*60*60*1e3,Ee=e=>e.getTime()-new Date().getTime()>Te?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,R=e=>{const t=N.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},Se=[31,28,31,30,31,30,31,31,30,31,30,31],$e=(e,t,r)=>{let n=Se[t];if(t===1&&Ce(e)&&(n=29),r>n)throw new TypeError(`Invalid day for ${N[t]} in ${e}: ${r}`)},Ce=e=>e%4===0&&(e%100!==0||e%400===0),l=(e,t,r,n)=>{const o=fe(b(e));if(o<r||o>n)throw new TypeError(`${t} must be between ${r} and ${n}, inclusive`);return o},xe=e=>e==null?0:ae("0."+e)*1e3,Ae=e=>{const t=e[0];let r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);const n=Number(e.substring(1,3)),o=Number(e.substring(4,6));return r*(n*60+o)*60*1e3},b=e=>{let t=0;for(;t<e.length-1&&e.charAt(t)==="0";)t++;return t===0?e:e.slice(t)},Pe=e=>{if(typeof e=="function")return e;const t=Promise.resolve(e);return()=>t};export{J as F,U as H,Ie as a,De as b,B as c,v as d,Be as e,ee as f,Le as g,Oe as h,Fe as i,Ue as j,M as k,Pe as n,Ne as p,Re as s,Me as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o}from"./index-
|
|
1
|
+
import{r as o}from"./index-CWcv-6Zk.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-ChvoNxcO.js";import"./preload-helper-BlTxHScW.js";import"./__vite-browser-external-DLjrMatA.js";import"./inherits_browser-nmOknR35-Bp0mvRSL.js";import"./index-6mKfgpcs-DsgiI2lM.js";import"./_commonjsHelpers-B4e78b8K-W3E8ocG7.js";import"./index-DsIu-45t-Bejjlpz4.js";import"./index-DSosZ5sh-Ceejs_jv.js";import"./index-69shuAsh-DF18H7zf.js";import"./index-BJBOx-Z---hbiLl7B.js";import"./index.browser-BHPvGrwi-6Mh8eUw-.js";import"./_commonjs-dynamic-modules-BpilXLfW-DfYEAvWy.js";import"./_commonjs-dynamic-modules-B7n8ZNar.js";export{o as default};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CuvfCO6A.js","assets/normalizeProvider-BrOPyH3l.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{f as K,d as ct,a as ut,t as ht,c as pe,H as P,b as M,j as dt,k as V}from"./normalizeProvider-BrOPyH3l.js";import{_ as lt}from"./preload-helper-BlTxHScW.js";import{_ as ft,j as mt}from"./index-CWcv-6Zk.js";const pt=(t,e,r)=>{let s,n,i,a=!1;const u=async()=>{n||(n=t());try{s=await n,i=!0,a=!1}finally{n=void 0}return s};return async o=>((!i||o?.forceRefresh)&&(s=await u()),s)},Bs=t=>({setHttpHandler(e){t.httpHandler=e},httpHandler(){return t.httpHandler},updateHttpClientConfig(e,r){t.httpHandler?.updateHttpClientConfig(e,r)},httpHandlerConfigs(){return t.httpHandler.httpHandlerConfigs()}}),Fs=t=>({httpHandler:t.httpHandler()});var U;(function(t){t.HTTP="http",t.HTTPS="https"})(U||(U={}));var X;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(X||(X={}));const ce="__smithy_context",z=t=>typeof t=="string"?K(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t),I=(t,e)=>{const r=[];if(t&&r.push(t),e)for(const s of e)r.push(s);return r},C=(t,e)=>`${t||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,J=()=>{let t=[],e=[],r=!1;const s=new Set,n=c=>c.sort((h,l)=>Re[l.step]-Re[h.step]||Ee[l.priority||"normal"]-Ee[h.priority||"normal"]),i=c=>{let h=!1;const l=p=>{const y=I(p.name,p.aliases);if(y.includes(c)){h=!0;for(const f of y)s.delete(f);return!1}return!0};return t=t.filter(l),e=e.filter(l),h},a=c=>{let h=!1;const l=p=>{if(p.middleware===c){h=!0;for(const y of I(p.name,p.aliases))s.delete(y);return!1}return!0};return t=t.filter(l),e=e.filter(l),h},u=c=>(t.forEach(h=>{c.add(h.middleware,{...h})}),e.forEach(h=>{c.addRelativeTo(h.middleware,{...h})}),c.identifyOnResolve?.(m.identifyOnResolve()),c),o=c=>{const h=[];return c.before.forEach(l=>{l.before.length===0&&l.after.length===0?h.push(l):h.push(...o(l))}),h.push(c),c.after.reverse().forEach(l=>{l.before.length===0&&l.after.length===0?h.push(l):h.push(...o(l))}),h},d=(c=!1)=>{const h=[],l=[],p={};return t.forEach(f=>{const g={...f,before:[],after:[]};for(const w of I(g.name,g.aliases))p[w]=g;h.push(g)}),e.forEach(f=>{const g={...f,before:[],after:[]};for(const w of I(g.name,g.aliases))p[w]=g;l.push(g)}),l.forEach(f=>{if(f.toMiddleware){const g=p[f.toMiddleware];if(g===void 0){if(c)return;throw new Error(`${f.toMiddleware} is not found when adding ${C(f.name,f.aliases)} middleware ${f.relation} ${f.toMiddleware}`)}f.relation==="after"&&g.after.push(f),f.relation==="before"&&g.before.push(f)}}),n(h).map(o).reduce((f,g)=>(f.push(...g),f),[])},m={add:(c,h={})=>{const{name:l,override:p,aliases:y}=h,f={step:"initialize",priority:"normal",middleware:c,...h},g=I(l,y);if(g.length>0){if(g.some(w=>s.has(w))){if(!p)throw new Error(`Duplicate middleware name '${C(l,y)}'`);for(const w of g){const v=t.findIndex(D=>D.name===w||D.aliases?.some(Y=>Y===w));if(v===-1)continue;const b=t[v];if(b.step!==f.step||f.priority!==b.priority)throw new Error(`"${C(b.name,b.aliases)}" middleware with ${b.priority} priority in ${b.step} step cannot be overridden by "${C(l,y)}" middleware with ${f.priority} priority in ${f.step} step.`);t.splice(v,1)}}for(const w of g)s.add(w)}t.push(f)},addRelativeTo:(c,h)=>{const{name:l,override:p,aliases:y}=h,f={middleware:c,...h},g=I(l,y);if(g.length>0){if(g.some(w=>s.has(w))){if(!p)throw new Error(`Duplicate middleware name '${C(l,y)}'`);for(const w of g){const v=e.findIndex(D=>D.name===w||D.aliases?.some(Y=>Y===w));if(v===-1)continue;const b=e[v];if(b.toMiddleware!==f.toMiddleware||b.relation!==f.relation)throw new Error(`"${C(b.name,b.aliases)}" middleware ${b.relation} "${b.toMiddleware}" middleware cannot be overridden by "${C(l,y)}" middleware ${f.relation} "${f.toMiddleware}" middleware.`);e.splice(v,1)}}for(const w of g)s.add(w)}e.push(f)},clone:()=>u(J()),use:c=>{c.applyToStack(m)},remove:c=>typeof c=="string"?i(c):a(c),removeByTag:c=>{let h=!1;const l=p=>{const{tags:y,name:f,aliases:g}=p;if(y&&y.includes(c)){const w=I(f,g);for(const v of w)s.delete(v);return h=!0,!1}return!0};return t=t.filter(l),e=e.filter(l),h},concat:c=>{const h=u(J());return h.use(c),h.identifyOnResolve(r||h.identifyOnResolve()||(c.identifyOnResolve?.()??!1)),h},applyToStack:u,identify:()=>d(!0).map(c=>{const h=c.step??c.relation+" "+c.toMiddleware;return C(c.name,c.aliases)+" - "+h}),identifyOnResolve(c){return typeof c=="boolean"&&(r=c),r},resolve:(c,h)=>{for(const l of d().map(p=>p.middleware).reverse())c=l(c,h);return r&&console.log(m.identify()),c}};return m},Re={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Ee={high:3,normal:2,low:1};class js{config;middlewareStack=J();initConfig;handlers;constructor(e){this.config=e;const{protocol:r,protocolSettings:s}=e;s&&typeof r=="function"&&(e.protocol=new r(s))}send(e,r,s){const n=typeof r!="function"?r:void 0,i=typeof r=="function"?r:s,a=n===void 0&&this.config.cacheMiddleware===!0;let u;if(a){this.handlers||(this.handlers=new WeakMap);const o=this.handlers;o.has(e.constructor)?u=o.get(e.constructor):(u=e.resolveMiddleware(this.middlewareStack,this.config,n),o.set(e.constructor,u))}else delete this.handlers,u=e.resolveMiddleware(this.middlewareStack,this.config,n);if(i)u(e).then(o=>i(null,o.output),o=>i(o)).catch(()=>{});else return u(e).then(o=>o.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}class $ extends Uint8Array{static fromString(e,r="utf-8"){if(typeof e=="string")return r==="base64"?$.mutate(ct(e)):$.mutate(K(e));throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}static mutate(e){return Object.setPrototypeOf(e,$.prototype),e}transformToString(e="utf-8"){return e==="base64"?ut(this):ht(this)}}const Te=async(t=new Uint8Array,e)=>{if(t instanceof Uint8Array)return $.mutate(t);if(!t)return $.mutate(new Uint8Array);const r=e.streamCollector(t);return $.mutate(await r)},Z=t=>typeof t=="function"?t():t,j=t=>t[ce]||(t[ce]={}),O=t=>{if(typeof t=="function")return t;const e=Promise.resolve(t);return()=>e},He=(t,e,r,s,n)=>({name:e,namespace:t,traits:r,input:s,output:n}),yt=t=>(e,r)=>async s=>{const{response:n}=await e(s),{operationSchema:i}=j(r),[,a,u,o,d,m]=i??[];try{const c=await t.protocol.deserializeResponse(He(a,u,o,d,m),{...t,...r},n);return{response:n,output:c}}catch(c){if(Object.defineProperty(c,"$response",{value:n,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in c)){const h="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{c.message+=`
|
|
3
|
+
`+h}catch{!r.logger||r.logger?.constructor?.name==="NoOpLogger"?console.warn(h):r.logger?.warn?.(h)}typeof c.$responseBodyText<"u"&&c.$response&&(c.$response.body=c.$responseBodyText);try{if(pe.isInstance(n)){const{headers:l={}}=n,p=Object.entries(l);c.$metadata={httpStatusCode:n.statusCode,requestId:ee(/^x-[\w-]+-request-?id$/,p),extendedRequestId:ee(/^x-[\w-]+-id-2$/,p),cfId:ee(/^x-[\w-]+-cf-id$/,p)}}}catch{}}throw c}},ee=(t,e)=>(e.find(([r])=>r.match(t))||[void 0,void 0])[1],gt=t=>(e,r)=>async s=>{const{operationSchema:n}=j(r),[,i,a,u,o,d]=n??[],m=r.endpointV2?.url&&t.urlParser?async()=>t.urlParser(r.endpointV2.url):t.endpoint,c=await t.protocol.serializeRequest(He(i,a,u,o,d),s.input,{...t,...r,endpoint:m});return e({...s,request:c})},wt={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},St={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function qs(t){return{applyToStack:e=>{e.add(gt(t),St),e.add(yt(t),wt),t.protocol.setSerdeContext(t)}}}function L(t){if(typeof t=="object")return t;t=t|0;const e={};let r=0;for(const s of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(t>>r++&1)===1&&(e[s]=1);return e}class T{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=T.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(e,r){this.ref=e,this.memberName=r;const s=[];let n=e,i=e;for(this._isMemberSchema=!1;te(n);)s.push(n[1]),n=n[0],i=Z(n),this._isMemberSchema=!0;if(s.length>0){this.memberTraits={};for(let a=s.length-1;a>=0;--a){const u=s[a];Object.assign(this.memberTraits,L(u))}}else this.memberTraits=0;if(i instanceof T){const a=this.memberTraits;Object.assign(this,i),this.memberTraits=Object.assign({},a,i.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=r??i.memberName;return}if(this.schema=Z(i),bt(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(i),this.traits=0),this._isMemberSchema&&!r)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){const r=this.prototype.isPrototypeOf(e);return!r&&typeof e=="object"&&e!==null?e.symbol===this.symbol:r}static of(e){const r=Z(e);if(r instanceof T)return r;if(te(r)){const[s,n]=r;if(s instanceof T)return Object.assign(s.getMergedTraits(),L(n)),s;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}return new T(r)}getSchema(){const e=this.schema;return e[0]===0?e[4]:e}getName(e=!1){const{name:r}=this;return!e&&r&&r.includes("#")?r.split("#")[1]:r||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){const e=this.getSchema();return typeof e=="number"?e>=64&&e<128:e[0]===1}isMapSchema(){const e=this.getSchema();return typeof e=="number"?e>=128&&e<=255:e[0]===2}isStructSchema(){const r=this.getSchema()[0];return r===3||r===-3||r===4}isUnionSchema(){return this.getSchema()[0]===4}isBlobSchema(){const e=this.getSchema();return e===21||e===42}isTimestampSchema(){const e=this.getSchema();return typeof e=="number"&&e>=4&&e<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){const{streaming:e}=this.getMergedTraits();return!!e||this.getSchema()===42}isIdempotencyToken(){const e=i=>(i&4)===4||!!i?.idempotencyToken,{normalizedTraits:r,traits:s,memberTraits:n}=this;return e(r)||e(s)||e(n)}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return L(this.memberTraits)}getOwnTraits(){return L(this.traits)}getKeySchema(){const[e,r]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!r)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const s=this.getSchema(),n=e?15:s[4]??0;return k([n,0],"key")}getValueSchema(){const e=this.getSchema(),[r,s,n]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],i=typeof e=="number"?63&e:e&&typeof e=="object"&&(s||n)?e[3+e[0]]:r?15:void 0;if(i!=null)return k([i,0],s?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){const r=this.getSchema();if(this.isStructSchema()&&r[4].includes(e)){const s=r[4].indexOf(e),n=r[5][s];return k(te(n)?n:[n,0],e)}if(this.isDocumentSchema())return k([15,0],e);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no no member=${e}.`)}getMemberSchemas(){const e={};try{for(const[r,s]of this.structIterator())e[r]=s}catch{}return e}getEventStreamMember(){if(this.isStructSchema()){for(const[e,r]of this.structIterator())if(r.isStreaming()&&r.isStructSchema())return e}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const e=this.getSchema();for(let r=0;r<e[4].length;++r)yield[e[4][r],k([e[5][r],0],e[4][r])]}}function k(t,e){if(t instanceof T)return Object.assign(t,{memberName:e,_isMemberSchema:!0});const r=T;return new r(t,e)}const te=t=>Array.isArray(t)&&t.length===2,bt=t=>Array.isArray(t)&&t.length>=5;class A{namespace;schemas;exceptions;static registries=new Map;constructor(e,r=new Map,s=new Map){this.namespace=e,this.schemas=r,this.exceptions=s}static for(e){return A.registries.has(e)||A.registries.set(e,new A(e)),A.registries.get(e)}register(e,r){const s=this.normalizeShapeId(e);A.for(s.split("#")[0]).schemas.set(s,r)}getSchema(e){const r=this.normalizeShapeId(e);if(!this.schemas.has(r))throw new Error(`@smithy/core/schema - schema not found for ${r}`);return this.schemas.get(r)}registerError(e,r){const s=e,n=A.for(s[1]);n.schemas.set(s[1]+"#"+s[2],s),n.exceptions.set(s,r)}getErrorCtor(e){const r=e;return A.for(r[1]).exceptions.get(r)}getBaseException(){for(const e of this.exceptions.keys())if(Array.isArray(e)){const[,r,s]=e,n=r+"#"+s;if(n.startsWith("smithy.ts.sdk.synthetic.")&&n.endsWith("ServiceException"))return e}}find(e){return[...this.schemas.values()].find(e)}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){return e.includes("#")?e:this.namespace+"#"+e}}const ve=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),S=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0")),Rt=()=>{if(ve)return ve();const t=new Uint8Array(16);return crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128,S[t[0]]+S[t[1]]+S[t[2]]+S[t[3]]+"-"+S[t[4]]+S[t[5]]+"-"+S[t[6]]+S[t[7]]+"-"+S[t[8]]+S[t[9]]+"-"+S[t[10]]+S[t[11]]+S[t[12]]+S[t[13]]+S[t[14]]+S[t[15]]},N=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})};N.from=t=>t&&typeof t=="object"&&(t instanceof N||"deserializeJSON"in t)?t:typeof t=="string"||Object.getPrototypeOf(t)===String.prototype?N(String(t)):N(JSON.stringify(t));N.fromObject=N.from;const Ce=/^-?\d*(\.\d+)?$/;class Ue{string;type;constructor(e,r){if(this.string=e,this.type=r,!Ce.test(e))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!="object")return!1;const r=e;return Ue.prototype.isPrototypeOf(e)||r.type==="bigDecimal"&&Ce.test(r.string)}}class Et{serdeContext;setSerdeContext(e){this.serdeContext=e}}class Tt extends Et{options;constructor(e){super(),this.options=e}getRequestType(){return P}getResponseType(){return pe}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,r){if("url"in r){e.protocol=r.url.protocol,e.hostname=r.url.hostname,e.port=r.url.port?Number(r.url.port):void 0,e.path=r.url.pathname,e.fragment=r.url.hash||void 0,e.username=r.url.username||void 0,e.password=r.url.password||void 0,e.query||(e.query={});for(const[s,n]of r.url.searchParams.entries())e.query[s]=n;return e}else return e.protocol=r.protocol,e.hostname=r.hostname,e.port=r.port?Number(r.port):void 0,e.path=r.path,e.query={...r.query},e}setHostPrefix(e,r,s){const n=T.of(r.input),i=L(r.traits??{});if(i.endpoint){let a=i.endpoint?.[0];if(typeof a=="string"){const u=[...n.structIterator()].filter(([,o])=>o.getMergedTraits().hostLabel);for(const[o]of u){const d=s[o];if(typeof d!="string")throw new Error(`@smithy/core/schema - ${o} in input must be a string as hostLabel.`);a=a.replace(`{${o}}`,d)}e.hostname=a+e.hostname}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:r,initialRequest:s}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:r,initialRequest:s})}async deserializeEventStream({response:e,responseSchema:r,initialResponseContainer:s}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:r,initialResponseContainer:s})}async loadEventStreamCapability(){const{EventStreamSerde:e}=await lt(async()=>{const{EventStreamSerde:r}=await import("./index-CuvfCO6A.js");return{EventStreamSerde:r}},__vite__mapDeps([0,1]));return new e({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,r,s,n,i){return[]}getEventStreamMarshaller(){const e=this.serdeContext;if(!e.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class Vs extends Tt{async serializeRequest(e,r,s){const n=this.serializer,i={},a={},u=await s.endpoint(),o=T.of(e?.input),d=o.getSchema();let m;const c=new P({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:i,headers:a,body:void 0});u&&(this.updateServiceEndpoint(c,u),this.setHostPrefix(c,e,r));const h={...r};if(r){const l=o.getEventStreamMember();if(l){if(h[l]){const p={};for(const[y,f]of o.structIterator())y!==l&&h[y]&&(n.write(f,h[y]),p[y]=n.flush());m=await this.serializeEventStream({eventStream:h[l],requestSchema:o,initialRequest:p})}}else n.write(d,h),m=n.flush()}return c.headers=a,c.query=i,c.body=m,c.method="POST",c}async deserializeResponse(e,r,s){const n=this.deserializer,i=T.of(e.output),a={};if(s.statusCode>=300){const o=await Te(s.body,r);throw o.byteLength>0&&Object.assign(a,await n.read(15,o)),await this.handleError(e,r,s,a,this.deserializeMetadata(s)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const o in s.headers){const d=s.headers[o];delete s.headers[o],s.headers[o.toLowerCase()]=d}const u=i.getEventStreamMember();if(u)a[u]=await this.deserializeEventStream({response:s,responseSchema:i,initialResponseContainer:a});else{const o=await Te(s.body,r);o.byteLength>0&&Object.assign(a,await n.read(i,o))}return a.$metadata=this.deserializeMetadata(s),a}}function Ws(t,e){if(e.timestampFormat.useTrait&&t.isTimestampSchema()&&(t.getSchema()===5||t.getSchema()===6||t.getSchema()===7))return t.getSchema();const{httpLabel:r,httpPrefixHeaders:s,httpHeader:n,httpQuery:i}=t.getMergedTraits();return(e.httpBindings?typeof s=="string"||n?6:i||r?5:void 0:void 0)??e.timestampFormat.default}const re="***SensitiveInformation***";function ue(t,e){if(e==null)return e;const r=T.of(t);if(r.getMergedTraits().sensitive)return re;if(r.isListSchema()){if(!!r.getValueSchema().getMergedTraits().sensitive)return re}else if(r.isMapSchema()){if(!!r.getKeySchema().getMergedTraits().sensitive||!!r.getValueSchema().getMergedTraits().sensitive)return re}else if(r.isStructSchema()&&typeof e=="object"){const s=e,n={};for(const[i,a]of r.structIterator())s[i]!=null&&(n[i]=ue(a,s[i]));return n}return e}class vt{middlewareStack=J();schema;static classBuilder(){return new Ct}resolveMiddlewareWithContext(e,r,s,{middlewareFn:n,clientName:i,commandName:a,inputFilterSensitiveLog:u,outputFilterSensitiveLog:o,smithyContext:d,additionalContext:m,CommandCtor:c}){for(const f of n.bind(this)(c,e,r,s))this.middlewareStack.use(f);const h=e.concat(this.middlewareStack),{logger:l}=r,p={logger:l,clientName:i,commandName:a,inputFilterSensitiveLog:u,outputFilterSensitiveLog:o,[ce]:{commandInstance:this,...d},...m},{requestHandler:y}=r;return h.resolve(f=>y.handle(f.request,s||{}),p)}}class Ct{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,r,s={}){return this._smithyContext={service:e,operation:r,...s},this}c(e={}){return this._additionalContext=e,this}n(e,r){return this._clientName=e,this._commandName=r,this}f(e=s=>s,r=s=>s){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=r,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){const e=this;let r;return r=class extends vt{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[s]){super(),this.input=s??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(s,n,i){const a=e._operationSchema,u=a?.[4]??a?.input,o=a?.[5]??a?.output;return this.resolveMiddlewareWithContext(s,n,i,{CommandCtor:r,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(a?ue.bind(null,u):d=>d),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(a?ue.bind(null,o):d=>d),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}class H extends Error{$fault;$response;$retryable;$metadata;constructor(e){super(e.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;const r=e;return H.prototype.isPrototypeOf(r)||!!r.$fault&&!!r.$metadata&&(r.$fault==="client"||r.$fault==="server")}static[Symbol.hasInstance](e){if(!e)return!1;const r=e;return this===H?H.isInstance(e):H.isInstance(e)?r.name&&this.name?this.prototype.isPrototypeOf(e)||r.name===this.name:this.prototype.isPrototypeOf(e):!1}}const Gs=(t,e={})=>{Object.entries(e).filter(([,s])=>s!==void 0).forEach(([s,n])=>{(t[s]==null||t[s]==="")&&(t[s]=n)});const r=t.message||t.Message||"UnknownError";return t.message=r,delete t.Message,t},Ks=t=>{switch(t){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},At=t=>{const e=[];for(const r in X){const s=X[r];t[s]!==void 0&&e.push({algorithmId:()=>s,checksumConstructor:()=>t[s]})}return{addChecksumAlgorithm(r){e.push(r)},checksumAlgorithms(){return e}}},xt=t=>{const e={};return t.checksumAlgorithms().forEach(r=>{e[r.algorithmId()]=r.checksumConstructor()}),e},It=t=>({setRetryStrategy(e){t.retryStrategy=e},retryStrategy(){return t.retryStrategy}}),Mt=t=>{const e={};return e.retryStrategy=t.retryStrategy(),e},Xs=t=>Object.assign(At(t),It(t)),Js=t=>Object.assign(xt(t),Mt(t));class $t{trace(){}debug(){}info(){}warn(){}error(){}}const Ot=(t,e)=>{if(!e||e.length===0)return t;const r=[];for(const s of e)for(const n of t)n.schemeId.split("#")[1]===s&&r.push(n);for(const s of t)r.find(({schemeId:n})=>n===s.schemeId)||r.push(s);return r};function Pt(t){const e=new Map;for(const r of t)e.set(r.schemeId,r);return e}const Nt=(t,e)=>(r,s)=>async n=>{const i=t.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(t,s,n.input)),a=t.authSchemePreference?await t.authSchemePreference():[],u=Ot(i,a),o=Pt(t.httpAuthSchemes),d=j(s),m=[];for(const c of u){const h=o.get(c.schemeId);if(!h){m.push(`HttpAuthScheme \`${c.schemeId}\` was not enabled for this service.`);continue}const l=h.identityProvider(await e.identityProviderConfigProvider(t));if(!l){m.push(`HttpAuthScheme \`${c.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:p={},signingProperties:y={}}=c.propertiesExtractor?.(t,s)||{};c.identityProperties=Object.assign(c.identityProperties||{},p),c.signingProperties=Object.assign(c.signingProperties||{},y),d.selectedHttpAuthScheme={httpAuthOption:c,identity:await l(c.identityProperties),signer:h.signer};break}if(!d.selectedHttpAuthScheme)throw new Error(m.join(`
|
|
4
|
+
`));return r(n)},_t={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},Qs=(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r})=>({applyToStack:s=>{s.addRelativeTo(Nt(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r}),_t)}}),Dt={name:"serializerMiddleware"},kt=t=>e=>{throw e},Lt=(t,e)=>{},Ht=t=>(e,r)=>async s=>{if(!P.isInstance(s.request))return e(s);const i=j(r).selectedHttpAuthScheme;if(!i)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:a={}},identity:u,signer:o}=i,d=await e({...s,request:await o.sign(s.request,u,a)}).catch((o.errorHandler||kt)(a));return(o.successHandler||Lt)(d.response,a),d},Ut={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},Ys=t=>({applyToStack:e=>{e.addRelativeTo(Ht(),Ut)}});function zt(t,e,r){t.__smithy_context?t.__smithy_context.features||(t.__smithy_context.features={}):t.__smithy_context={features:{}},t.__smithy_context.features[e]=r}class Zs{authSchemes=new Map;constructor(e){for(const[r,s]of Object.entries(e))s!==void 0&&this.authSchemes.set(r,s)}getIdentityProvider(e){return this.authSchemes.get(e)}}class en{async sign(e,r,s){return e}}const Bt=t=>function(r){return jt(r)&&r.expiration.getTime()-Date.now()<t},Ft=3e5,tn=Bt(Ft),jt=t=>t.expiration!==void 0,rn=(t,e,r)=>{if(t===void 0)return;const s=typeof t!="function"?async()=>Promise.resolve(t):t;let n,i,a,u=!1;const o=async d=>{i||(i=s(d));try{n=await i,a=!0,u=!1}finally{i=void 0}return n};return e===void 0?async d=>((!a||d?.forceRefresh)&&(n=await o(d)),n):async d=>((!a||d?.forceRefresh)&&(n=await o(d)),u?n:r(n)?(e(n)&&await o(d),n):(u=!0,n))};class sn{capacity;data=new Map;parameters=[];constructor({size:e,params:r}){this.capacity=e??50,r&&(this.parameters=r)}get(e,r){const s=this.hash(e);if(s===!1)return r();if(!this.data.has(s)){if(this.data.size>this.capacity+10){const n=this.data.keys();let i=0;for(;;){const{value:a,done:u}=n.next();if(this.data.delete(a),u||++i>10)break}}this.data.set(s,r())}return this.data.get(s)}size(){return this.data.size}hash(e){let r="";const{parameters:s}=this;if(s.length===0)return!1;for(const n of s){const i=String(e[n]??"");if(i.includes("|;"))return!1;r+=i+"|;"}return r}}const qt=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),Vt=t=>qt.test(t)||t.startsWith("[")&&t.endsWith("]"),Wt=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),ye=(t,e=!1)=>{if(!e)return Wt.test(t);const r=t.split(".");for(const s of r)if(!ye(s))return!1;return!0},Ae={},B="endpoints";function x(t){return typeof t!="object"||t==null?t:"ref"in t?`$${x(t.ref)}`:"fn"in t?`${t.fn}(${(t.argv||[]).map(x).join(", ")})`:JSON.stringify(t,null,2)}class R extends Error{constructor(e){super(e),this.name="EndpointError"}}const Gt=(t,e)=>t===e,Kt=t=>{const e=t.split("."),r=[];for(const s of e){const n=s.indexOf("[");if(n!==-1){if(s.indexOf("]")!==s.length-1)throw new R(`Path: '${t}' does not end with ']'`);const i=s.slice(n+1,-1);if(Number.isNaN(parseInt(i)))throw new R(`Invalid array index: '${i}' in path: '${t}'`);n!==0&&r.push(s.slice(0,n)),r.push(i)}else r.push(s)}return r},ze=(t,e)=>Kt(e).reduce((r,s)=>{if(typeof r!="object")throw new R(`Index '${s}' in '${e}' not found in '${JSON.stringify(t)}'`);return Array.isArray(r)?r[parseInt(s)]:r[s]},t),Xt=t=>t!=null,Jt=t=>!t,se={[U.HTTP]:80,[U.HTTPS]:443},Qt=t=>{const e=(()=>{try{if(t instanceof URL)return t;if(typeof t=="object"&&"hostname"in t){const{hostname:h,port:l,protocol:p="",path:y="",query:f={}}=t,g=new URL(`${p}//${h}${l?`:${l}`:""}${y}`);return g.search=Object.entries(f).map(([w,v])=>`${w}=${v}`).join("&"),g}return new URL(t)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(t)} as a whatwg URL.`),null;const r=e.href,{host:s,hostname:n,pathname:i,protocol:a,search:u}=e;if(u)return null;const o=a.slice(0,-1);if(!Object.values(U).includes(o))return null;const d=Vt(n),m=r.includes(`${s}:${se[o]}`)||typeof t=="string"&&t.includes(`${s}:${se[o]}`),c=`${s}${m?`:${se[o]}`:""}`;return{scheme:o,authority:c,path:i,normalizedPath:i.endsWith("/")?i:`${i}/`,isIp:d}},Yt=(t,e)=>t===e,Zt=(t,e,r,s)=>e>=r||t.length<r?null:s?t.substring(t.length-r,t.length-e):t.substring(e,r),er=t=>encodeURIComponent(t).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),tr={booleanEquals:Gt,getAttr:ze,isSet:Xt,isValidHostLabel:ye,not:Jt,parseURL:Qt,stringEquals:Yt,substring:Zt,uriEncode:er},Be=(t,e)=>{const r=[],s={...e.endpointParams,...e.referenceRecord};let n=0;for(;n<t.length;){const i=t.indexOf("{",n);if(i===-1){r.push(t.slice(n));break}r.push(t.slice(n,i));const a=t.indexOf("}",i);if(a===-1){r.push(t.slice(i));break}t[i+1]==="{"&&t[a+1]==="}"&&(r.push(t.slice(i+1,a)),n=a+2);const u=t.substring(i+1,a);if(u.includes("#")){const[o,d]=u.split("#");r.push(ze(s[o],d))}else r.push(s[u]);n=a+1}return r.join("")},rr=({ref:t},e)=>({...e.endpointParams,...e.referenceRecord})[t],Q=(t,e,r)=>{if(typeof t=="string")return Be(t,r);if(t.fn)return je.callFunction(t,r);if(t.ref)return rr(t,r);throw new R(`'${e}': ${String(t)} is not a string, function or reference.`)},Fe=({fn:t,argv:e},r)=>{const s=e.map(i=>["boolean","number"].includes(typeof i)?i:je.evaluateExpression(i,"arg",r)),n=t.split(".");return n[0]in Ae&&n[1]!=null?Ae[n[0]][n[1]](...s):tr[t](...s)},je={evaluateExpression:Q,callFunction:Fe},sr=({assign:t,...e},r)=>{if(t&&t in r.referenceRecord)throw new R(`'${t}' is already defined in Reference Record.`);const s=Fe(e,r);return r.logger?.debug?.(`${B} evaluateCondition: ${x(e)} = ${x(s)}`),{result:s===""?!0:!!s,...t!=null&&{toAssign:{name:t,value:s}}}},ge=(t=[],e)=>{const r={};for(const s of t){const{result:n,toAssign:i}=sr(s,{...e,referenceRecord:{...e.referenceRecord,...r}});if(!n)return{result:n};i&&(r[i.name]=i.value,e.logger?.debug?.(`${B} assign: ${i.name} := ${x(i.value)}`))}return{result:!0,referenceRecord:r}},nr=(t,e)=>Object.entries(t).reduce((r,[s,n])=>({...r,[s]:n.map(i=>{const a=Q(i,"Header value entry",e);if(typeof a!="string")throw new R(`Header '${s}' value '${a}' is not a string`);return a})}),{}),qe=(t,e)=>Object.entries(t).reduce((r,[s,n])=>({...r,[s]:We.getEndpointProperty(n,e)}),{}),Ve=(t,e)=>{if(Array.isArray(t))return t.map(r=>Ve(r,e));switch(typeof t){case"string":return Be(t,e);case"object":if(t===null)throw new R(`Unexpected endpoint property: ${t}`);return We.getEndpointProperties(t,e);case"boolean":return t;default:throw new R(`Unexpected endpoint property type: ${typeof t}`)}},We={getEndpointProperty:Ve,getEndpointProperties:qe},ir=(t,e)=>{const r=Q(t,"Endpoint URL",e);if(typeof r=="string")try{return new URL(r)}catch(s){throw console.error(`Failed to construct URL with ${r}`,s),s}throw new R(`Endpoint URL must be a string, got ${typeof r}`)},ar=(t,e)=>{const{conditions:r,endpoint:s}=t,{result:n,referenceRecord:i}=ge(r,e);if(!n)return;const a={...e,referenceRecord:{...e.referenceRecord,...i}},{url:u,properties:o,headers:d}=s;return e.logger?.debug?.(`${B} Resolving endpoint from template: ${x(s)}`),{...d!=null&&{headers:nr(d,a)},...o!=null&&{properties:qe(o,a)},url:ir(u,a)}},or=(t,e)=>{const{conditions:r,error:s}=t,{result:n,referenceRecord:i}=ge(r,e);if(n)throw new R(Q(s,"Error",{...e,referenceRecord:{...e.referenceRecord,...i}}))},Ge=(t,e)=>{for(const r of t)if(r.type==="endpoint"){const s=ar(r,e);if(s)return s}else if(r.type==="error")or(r,e);else if(r.type==="tree"){const s=Ke.evaluateTreeRule(r,e);if(s)return s}else throw new R(`Unknown endpoint rule: ${r}`);throw new R("Rules evaluation failed")},cr=(t,e)=>{const{conditions:r,rules:s}=t,{result:n,referenceRecord:i}=ge(r,e);if(n)return Ke.evaluateRules(s,{...e,referenceRecord:{...e.referenceRecord,...i}})},Ke={evaluateRules:Ge,evaluateTreeRule:cr},nn=(t,e)=>{const{endpointParams:r,logger:s}=e,{parameters:n,rules:i}=t;e.logger?.debug?.(`${B} Initial EndpointParams: ${x(r)}`);const a=Object.entries(n).filter(([,d])=>d.default!=null).map(([d,m])=>[d,m.default]);if(a.length>0)for(const[d,m]of a)r[d]=r[d]??m;const u=Object.entries(n).filter(([,d])=>d.required).map(([d])=>d);for(const d of u)if(r[d]==null)throw new R(`Missing required parameter: '${d}'`);const o=Ge(i,{endpointParams:r,logger:s,referenceRecord:{}});return e.logger?.debug?.(`${B} Resolved endpoint: ${x(o)}`),o};function ur(t){const e={};if(t=t.replace(/^\?/,""),t)for(const r of t.split("&")){let[s,n=null]=r.split("=");s=decodeURIComponent(s),n&&(n=decodeURIComponent(n)),s in e?Array.isArray(e[s])?e[s].push(n):e[s]=[e[s],n]:e[s]=n}return e}const he=t=>{if(typeof t=="string")return he(new URL(t));const{hostname:e,pathname:r,port:s,protocol:n,search:i}=t;let a;return i&&(a=ur(i)),{hostname:e,port:s?parseInt(s):void 0,protocol:n,path:r,query:a}},hr="X-Amz-Algorithm",dr="X-Amz-Credential",Xe="X-Amz-Date",lr="X-Amz-SignedHeaders",fr="X-Amz-Expires",Je="X-Amz-Signature",Qe="X-Amz-Security-Token",Ye="authorization",Ze=Xe.toLowerCase(),mr="date",pr=[Ye,Ze,mr],yr=Je.toLowerCase(),de="x-amz-content-sha256",gr=Qe.toLowerCase(),wr={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Sr=/^proxy-/,br=/^sec-/,ne="AWS4-HMAC-SHA256",Rr="AWS4-HMAC-SHA256-PAYLOAD",Er="UNSIGNED-PAYLOAD",Tr=50,et="aws4_request",vr=3600*24*7,q={},ie=[],ae=(t,e,r)=>`${t}/${e}/${r}/${et}`,Cr=async(t,e,r,s,n)=>{const i=await xe(t,e.secretAccessKey,e.accessKeyId),a=`${r}:${s}:${n}:${M(i)}:${e.sessionToken}`;if(a in q)return q[a];for(ie.push(a);ie.length>Tr;)delete q[ie.shift()];let u=`AWS4${e.secretAccessKey}`;for(const o of[r,s,n,et])u=await xe(t,u,o);return q[a]=u},xe=(t,e,r)=>{const s=new t(e);return s.update(z(r)),s.digest()},Ie=({headers:t},e,r)=>{const s={};for(const n of Object.keys(t).sort()){if(t[n]==null)continue;const i=n.toLowerCase();(i in wr||e?.has(i)||Sr.test(i)||br.test(i))&&(!r||r&&!r.has(i))||(s[i]=t[n].trim().replace(/\s+/g," "))}return s},Ar=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",oe=async({headers:t,body:e},r)=>{for(const s of Object.keys(t))if(s.toLowerCase()===de)return t[s];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||Ar(e)){const s=new r;return s.update(z(e)),M(await s.digest())}return Er};class xr{format(e){const r=[];for(const i of Object.keys(e)){const a=K(i);r.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(e[i]))}const s=new Uint8Array(r.reduce((i,a)=>i+a.byteLength,0));let n=0;for(const i of r)s.set(i,n),n+=i.byteLength;return s}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,e.value,!1),new Uint8Array(r.buffer);case"integer":const s=new DataView(new ArrayBuffer(5));return s.setUint8(0,4),s.setInt32(1,e.value,!1),new Uint8Array(s.buffer);case"long":const n=new Uint8Array(9);return n[0]=5,n.set(e.value.bytes,1),n;case"binary":const i=new DataView(new ArrayBuffer(3+e.value.byteLength));i.setUint8(0,6),i.setUint16(1,e.value.byteLength,!1);const a=new Uint8Array(i.buffer);return a.set(e.value,3),a;case"string":const u=K(e.value),o=new DataView(new ArrayBuffer(3+u.byteLength));o.setUint8(0,7),o.setUint16(1,u.byteLength,!1);const d=new Uint8Array(o.buffer);return d.set(u,3),d;case"timestamp":const m=new Uint8Array(9);return m[0]=8,m.set(we.fromNumber(e.value.valueOf()).bytes,1),m;case"uuid":if(!Ir.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const c=new Uint8Array(17);return c[0]=9,c.set(dt(e.value.replace(/\-/g,"")),1),c}}}var Me;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(Me||(Me={}));const Ir=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class we{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let s=7,n=Math.abs(Math.round(e));s>-1&&n>0;s--,n/=256)r[s]=n;return e<0&&$e(r),new we(r)}valueOf(){const e=this.bytes.slice(0),r=e[0]&128;return r&&$e(e),parseInt(M(e),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function $e(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}const Mr=(t,e)=>{t=t.toLowerCase();for(const r of Object.keys(e))if(t===r.toLowerCase())return!0;return!1},$r=(t,e={})=>{const{headers:r,query:s={}}=P.clone(t);for(const n of Object.keys(r)){const i=n.toLowerCase();(i.slice(0,6)==="x-amz-"&&!e.unhoistableHeaders?.has(i)||e.hoistableHeaders?.has(i))&&(s[n]=r[n],delete r[n])}return{...t,headers:r,query:s}},Oe=t=>{t=P.clone(t);for(const e of Object.keys(t.headers))pr.indexOf(e.toLowerCase())>-1&&delete t.headers[e];return t},Or=({query:t={}})=>{const e=[],r={};for(const s of Object.keys(t)){if(s.toLowerCase()===yr)continue;const n=V(s);e.push(n);const i=t[s];typeof i=="string"?r[n]=`${n}=${V(i)}`:Array.isArray(i)&&(r[n]=i.slice(0).reduce((a,u)=>a.concat([`${n}=${V(u)}`]),[]).sort().join("&"))}return e.sort().map(s=>r[s]).filter(s=>s).join("&")},Pr=t=>Nr(t).toISOString().replace(/\.\d{3}Z$/,"Z"),Nr=t=>typeof t=="number"?new Date(t*1e3):typeof t=="string"?Number(t)?new Date(Number(t)*1e3):new Date(t):t;class _r{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:r,region:s,service:n,sha256:i,uriEscapePath:a=!0}){this.service=n,this.sha256=i,this.uriEscapePath=a,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=O(s),this.credentialProvider=O(r)}createCanonicalRequest(e,r,s){const n=Object.keys(r).sort();return`${e.method}
|
|
5
|
+
${this.getCanonicalPath(e)}
|
|
6
|
+
${Or(e)}
|
|
7
|
+
${n.map(i=>`${i}:${r[i]}`).join(`
|
|
8
|
+
`)}
|
|
9
|
+
|
|
10
|
+
${n.join(";")}
|
|
11
|
+
${s}`}async createStringToSign(e,r,s,n){const i=new this.sha256;i.update(z(s));const a=await i.digest();return`${n}
|
|
12
|
+
${e}
|
|
13
|
+
${r}
|
|
14
|
+
${M(a)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const r=[];for(const i of e.split("/"))i?.length!==0&&i!=="."&&(i===".."?r.pop():r.push(i));const s=`${e?.startsWith("/")?"/":""}${r.join("/")}${r.length>0&&e?.endsWith("/")?"/":""}`;return V(s).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(e){const r=Pr(e).replace(/[\-:]/g,"");return{longDate:r,shortDate:r.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}}class an extends _r{headerFormatter=new xr;constructor({applyChecksum:e,credentials:r,region:s,service:n,sha256:i,uriEscapePath:a=!0}){super({applyChecksum:e,credentials:r,region:s,service:n,sha256:i,uriEscapePath:a})}async presign(e,r={}){const{signingDate:s=new Date,expiresIn:n=3600,unsignableHeaders:i,unhoistableHeaders:a,signableHeaders:u,hoistableHeaders:o,signingRegion:d,signingService:m}=r,c=await this.credentialProvider();this.validateResolvedCredentials(c);const h=d??await this.regionProvider(),{longDate:l,shortDate:p}=this.formatDate(s);if(n>vr)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const y=ae(p,h,m??this.service),f=$r(Oe(e),{unhoistableHeaders:a,hoistableHeaders:o});c.sessionToken&&(f.query[Qe]=c.sessionToken),f.query[hr]=ne,f.query[dr]=`${c.accessKeyId}/${y}`,f.query[Xe]=l,f.query[fr]=n.toString(10);const g=Ie(f,i,u);return f.query[lr]=this.getCanonicalHeaderList(g),f.query[Je]=await this.getSignature(l,y,this.getSigningKey(c,h,p,m),this.createCanonicalRequest(f,g,await oe(e,this.sha256))),f}async sign(e,r){return typeof e=="string"?this.signString(e,r):e.headers&&e.payload?this.signEvent(e,r):e.message?this.signMessage(e,r):this.signRequest(e,r)}async signEvent({headers:e,payload:r},{signingDate:s=new Date,priorSignature:n,signingRegion:i,signingService:a}){const u=i??await this.regionProvider(),{shortDate:o,longDate:d}=this.formatDate(s),m=ae(o,u,a??this.service),c=await oe({headers:{},body:r},this.sha256),h=new this.sha256;h.update(e);const l=M(await h.digest()),p=[Rr,d,m,n,l,c].join(`
|
|
15
|
+
`);return this.signString(p,{signingDate:s,signingRegion:u,signingService:a})}async signMessage(e,{signingDate:r=new Date,signingRegion:s,signingService:n}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:r,signingRegion:s,signingService:n,priorSignature:e.priorSignature}).then(a=>({message:e.message,signature:a}))}async signString(e,{signingDate:r=new Date,signingRegion:s,signingService:n}={}){const i=await this.credentialProvider();this.validateResolvedCredentials(i);const a=s??await this.regionProvider(),{shortDate:u}=this.formatDate(r),o=new this.sha256(await this.getSigningKey(i,a,u,n));return o.update(z(e)),M(await o.digest())}async signRequest(e,{signingDate:r=new Date,signableHeaders:s,unsignableHeaders:n,signingRegion:i,signingService:a}={}){const u=await this.credentialProvider();this.validateResolvedCredentials(u);const o=i??await this.regionProvider(),d=Oe(e),{longDate:m,shortDate:c}=this.formatDate(r),h=ae(c,o,a??this.service);d.headers[Ze]=m,u.sessionToken&&(d.headers[gr]=u.sessionToken);const l=await oe(d,this.sha256);!Mr(de,d.headers)&&this.applyChecksum&&(d.headers[de]=l);const p=Ie(d,n,s),y=await this.getSignature(m,h,this.getSigningKey(u,o,c,a),this.createCanonicalRequest(d,p,l));return d.headers[Ye]=`${ne} Credential=${u.accessKeyId}/${h}, SignedHeaders=${this.getCanonicalHeaderList(p)}, Signature=${y}`,d}async getSignature(e,r,s,n){const i=await this.createStringToSign(e,r,n,ne),a=new this.sha256(await s);return a.update(z(i)),M(await a.digest())}getSigningKey(e,r,s,n){return Cr(this.sha256,e,s,r,n||this.service)}}const Pe=typeof TextEncoder=="function"?new TextEncoder:null,on=t=>{if(typeof t=="string"){if(Pe)return Pe.encode(t).byteLength;let e=t.length;for(let r=e-1;r>=0;r--){const s=t.charCodeAt(r);s>127&&s<=2047?e++:s>2047&&s<=65535&&(e+=2),s>=56320&&s<=57343&&r--}return e}else{if(typeof t.byteLength=="number")return t.byteLength;if(typeof t.size=="number")return t.size}throw new Error(`Body Length computation failed for ${t}`)},cn=!1,un=!1,Ne=new Set,Dr=(t,e=ye)=>{if(!Ne.has(t)&&!e(t))if(t==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw new Error(`Region not accepted: region="${t}" is not a valid hostname component.`);else Ne.add(t)},tt=t=>typeof t=="string"&&(t.startsWith("fips-")||t.endsWith("-fips")),kr=t=>tt(t)?["fips-aws-global","aws-fips"].includes(t)?"us-east-1":t.replace(/fips-(dkr-|prod-)?|-fips/,""):t,hn=t=>{const{region:e,useFipsEndpoint:r}=t;if(!e)throw new Error("Region is missing");return Object.assign(t,{region:async()=>{const s=typeof e=="function"?await e():e,n=kr(s);return Dr(n),n},useFipsEndpoint:async()=>{const s=typeof e=="string"?e:await e();return tt(s)?!0:typeof r!="function"?Promise.resolve(!!r):r()}})},_e="content-length";function Lr(t){return e=>async r=>{const s=r.request;if(P.isInstance(s)){const{body:n,headers:i}=s;if(n&&Object.keys(i).map(a=>a.toLowerCase()).indexOf(_e)===-1)try{const a=t(n);s.headers={...s.headers,[_e]:String(a)}}catch{}}return e({...r,request:s})}}const Hr={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},dn=t=>({applyToStack:e=>{e.add(Lr(t.bodyLengthChecker),Hr)}}),Ur=async t=>{const e=t?.Bucket||"";if(typeof t.Bucket=="string"&&(t.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),qr(e)){if(t.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!jr(e)||e.indexOf(".")!==-1&&!String(t.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(t.ForcePathStyle=!0);return t.DisableMultiRegionAccessPoints&&(t.disableMultiRegionAccessPoints=!0,t.DisableMRAP=!0),t},zr=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,Br=/(\d+\.){3}\d+/,Fr=/\.\./,jr=t=>zr.test(t)&&!Br.test(t)&&!Fr.test(t),qr=t=>{const[e,r,s,,,n]=t.split(":"),i=e==="arn"&&t.split(":").length>=6,a=!!(i&&r&&s&&n);if(i&&!a)throw new Error(`Invalid ARN: ${t} was an invalid ARN.`);return a},Vr=(t,e,r,s=!1)=>{const n=async()=>{let i;return s?i=r.clientContextParams?.[t]??r[t]??r[e]:i=r[t]??r[e],typeof i=="function"?i():i};return t==="credentialScope"||e==="CredentialScope"?async()=>{const i=typeof r.credentials=="function"?await r.credentials():r.credentials;return i?.credentialScope??i?.CredentialScope}:t==="accountId"||e==="AccountId"?async()=>{const i=typeof r.credentials=="function"?await r.credentials():r.credentials;return i?.accountId??i?.AccountId}:t==="endpoint"||e==="endpoint"?async()=>{if(r.isCustomEndpoint===!1)return;const i=await n();if(i&&typeof i=="object"){if("url"in i)return i.url.href;if("hostname"in i){const{protocol:a,hostname:u,port:o,path:d}=i;return`${a}//${u}${o?":"+o:""}${d}`}}return i}:n},rt=async t=>{},st=t=>typeof t=="object"?"url"in t?he(t.url):t:he(t),Wr=async(t,e,r,s)=>{if(!r.isCustomEndpoint){let a;r.serviceConfiguredEndpoint?a=await r.serviceConfiguredEndpoint():a=await rt(r.serviceId),a&&(r.endpoint=()=>Promise.resolve(st(a)),r.isCustomEndpoint=!0)}const n=await Gr(t,e,r);if(typeof r.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");return r.endpointProvider(n,s)},Gr=async(t,e,r)=>{const s={},n=e?.getEndpointParameterInstructions?.()||{};for(const[i,a]of Object.entries(n))switch(a.type){case"staticContextParams":s[i]=a.value;break;case"contextParams":s[i]=t[a.name];break;case"clientContextParams":case"builtInParams":s[i]=await Vr(a.name,i,r,a.type!=="builtInParams")();break;case"operationContextParams":s[i]=a.get(t);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(a))}return Object.keys(n).length===0&&Object.assign(s,r),String(r.serviceId).toLowerCase()==="s3"&&await Ur(s),s},Kr=({config:t,instructions:e})=>(r,s)=>async n=>{t.isCustomEndpoint&&zt(s,"ENDPOINT_OVERRIDE","N");const i=await Wr(n.input,{getEndpointParameterInstructions(){return e}},{...t},s);s.endpointV2=i,s.authSchemes=i.properties?.authSchemes;const a=s.authSchemes?.[0];if(a){s.signing_region=a.signingRegion,s.signing_service=a.signingName;const o=j(s)?.selectedHttpAuthScheme?.httpAuthOption;o&&(o.signingProperties=Object.assign(o.signingProperties||{},{signing_region:a.signingRegion,signingRegion:a.signingRegion,signing_service:a.signingName,signingName:a.signingName,signingRegionSet:a.signingRegionSet},a.properties))}return r({...n})},Xr={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Dt.name},ln=(t,e)=>({applyToStack:r=>{r.addRelativeTo(Kr({config:t,instructions:e}),Xr)}}),fn=t=>{const e=t.tls??!0,{endpoint:r,useDualstackEndpoint:s,useFipsEndpoint:n}=t,i=r!=null?async()=>st(await O(r)()):void 0,u=Object.assign(t,{endpoint:i,tls:e,isCustomEndpoint:!!r,useDualstackEndpoint:O(s??!1),useFipsEndpoint:O(n??!1)});let o;return u.serviceConfiguredEndpoint=async()=>(t.serviceId&&!o&&(o=rt(t.serviceId)),o),u};var _;(function(t){t.STANDARD="standard",t.ADAPTIVE="adaptive"})(_||(_={}));const le=3,mn=_.STANDARD,Jr=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],Qr=["TimeoutError","RequestTimeout","RequestTimeoutException"],Yr=[500,502,503,504],Zr=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],es=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],ts=t=>t?.$retryable!==void 0,rs=t=>t.$metadata?.clockSkewCorrected,ss=t=>{const e=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return t&&t instanceof TypeError?e.has(t.message):!1},nt=t=>t.$metadata?.httpStatusCode===429||Jr.includes(t.name)||t.$retryable?.throttling==!0,Se=(t,e=0)=>ts(t)||rs(t)||Qr.includes(t.name)||Zr.includes(t?.code||"")||es.includes(t?.code||"")||Yr.includes(t.$metadata?.httpStatusCode||0)||ss(t)||t.cause!==void 0&&e<=10&&Se(t.cause,e+1),ns=t=>{if(t.$metadata?.httpStatusCode!==void 0){const e=t.$metadata.httpStatusCode;return 500<=e&&e<=599&&!Se(t)}return!1};class be{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;currentCapacity=0;enabled=!1;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8;const r=this.getCurrentTimeInSeconds();this.lastThrottleTime=r,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.currentCapacity){const r=(e-this.currentCapacity)/this.fillRate*1e3;await new Promise(s=>be.setTimeoutFn(s,r))}this.currentCapacity=this.currentCapacity-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}const r=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+r),this.lastTimestamp=e}updateClientSendingRate(e){let r;if(this.updateMeasuredRate(),nt(e)){const n=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=n,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(n),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());const s=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(s)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),r=Math.floor(e*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){const s=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(s*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(e){return parseFloat(e.toFixed(8))}}const fe=100,it=20*1e3,is=500,De=500,as=5,os=10,cs=1,us="amz-sdk-invocation-id",hs="amz-sdk-request",ds=()=>{let t=fe;return{computeNextBackoffDelay:s=>Math.floor(Math.min(it,Math.random()*2**s*t)),setDelayBase:s=>{t=s}}},ke=({retryDelay:t,retryCount:e,retryCost:r})=>({getRetryCount:()=>e,getRetryDelay:()=>Math.min(it,t),getRetryCost:()=>r});class at{maxAttempts;mode=_.STANDARD;capacity=De;retryBackoffStrategy=ds();maxAttemptsProvider;constructor(e){this.maxAttempts=e,this.maxAttemptsProvider=typeof e=="function"?e:async()=>e}async acquireInitialRetryToken(e){return ke({retryDelay:fe,retryCount:0})}async refreshRetryTokenForRetry(e,r){const s=await this.getMaxAttempts();if(this.shouldRetry(e,r,s)){const n=r.errorType;this.retryBackoffStrategy.setDelayBase(n==="THROTTLING"?is:fe);const i=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),a=r.retryAfterHint?Math.max(r.retryAfterHint.getTime()-Date.now()||0,i):i,u=this.getCapacityCost(n);return this.capacity-=u,ke({retryDelay:a,retryCount:e.getRetryCount()+1,retryCost:u})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.max(De,this.capacity+(e.getRetryCost()??cs))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${le}`),le}}shouldRetry(e,r,s){return e.getRetryCount()+1<s&&this.capacity>=this.getCapacityCost(r.errorType)&&this.isRetryableError(r.errorType)}getCapacityCost(e){return e==="TRANSIENT"?os:as}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class ls{maxAttemptsProvider;rateLimiter;standardRetryStrategy;mode=_.ADAPTIVE;constructor(e,r){this.maxAttemptsProvider=e;const{rateLimiter:s}=r??{};this.rateLimiter=s??new be,this.standardRetryStrategy=new at(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,r){return this.rateLimiter.updateClientSendingRate(r),this.standardRetryStrategy.refreshRetryTokenForRetry(e,r)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}const fs=t=>t instanceof Error?t:t instanceof Object?Object.assign(new Error,t):typeof t=="string"?new Error(t):new Error(`AWS SDK error wrapper for ${t}`),pn=t=>{const{retryStrategy:e,retryMode:r,maxAttempts:s}=t,n=O(s??le);return Object.assign(t,{maxAttempts:n,retryStrategy:async()=>e||(await O(r)()===_.ADAPTIVE?new ls(n):new at(n))})},ms=t=>t?.body instanceof ReadableStream,ps=t=>(e,r)=>async s=>{let n=await t.retryStrategy();const i=await t.maxAttempts();if(ys(n)){n=n;let a=await n.acquireInitialRetryToken(r.partition_id),u=new Error,o=0,d=0;const{request:m}=s,c=P.isInstance(m);for(c&&(m.headers[us]=Rt());;)try{c&&(m.headers[hs]=`attempt=${o+1}; max=${i}`);const{response:h,output:l}=await e(s);return n.recordSuccess(a),l.$metadata.attempts=o+1,l.$metadata.totalRetryDelay=d,{response:h,output:l}}catch(h){const l=gs(h);if(u=fs(h),c&&ms(m))throw(r.logger instanceof $t?console:r.logger)?.warn("An error was encountered in a non-retryable streaming request."),u;try{a=await n.refreshRetryTokenForRetry(a,l)}catch{throw u.$metadata||(u.$metadata={}),u.$metadata.attempts=o+1,u.$metadata.totalRetryDelay=d,u}o=a.getRetryCount();const p=a.getRetryDelay();d+=p,await new Promise(y=>setTimeout(y,p))}}else return n=n,n?.mode&&(r.userAgent=[...r.userAgent||[],["cfg/retry-mode",n.mode]]),n.retry(e,s)},ys=t=>typeof t.acquireInitialRetryToken<"u"&&typeof t.refreshRetryTokenForRetry<"u"&&typeof t.recordSuccess<"u",gs=t=>{const e={error:t,errorType:ws(t)},r=bs(t.$response);return r&&(e.retryAfterHint=r),e},ws=t=>nt(t)?"THROTTLING":Se(t)?"TRANSIENT":ns(t)?"SERVER_ERROR":"CLIENT_ERROR",Ss={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},yn=t=>({applyToStack:e=>{e.add(ps(t),Ss)}}),bs=t=>{if(!pe.isInstance(t))return;const e=Object.keys(t.headers).find(i=>i.toLowerCase()==="retry-after");if(!e)return;const r=t.headers[e],s=Number(r);return Number.isNaN(s)?new Date(r):new Date(s*1e3)},Rs=t=>new TextEncoder().encode(t);var Es=typeof Buffer<"u"&&Buffer.from?function(t){return Buffer.from(t,"utf8")}:Rs;function F(t){return t instanceof Uint8Array?t:typeof t=="string"?Es(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}function me(t){return typeof t=="string"?t.length===0:t.byteLength===0}var ot={name:"SHA-256"},Le={name:"HMAC",hash:ot},Ts=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]);const vs={};function W(){return typeof window<"u"?window:typeof self<"u"?self:vs}var Cs=(function(){function t(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return t.prototype.update=function(e){if(!me(e)){var r=F(e),s=new Uint8Array(this.toHash.byteLength+r.byteLength);s.set(this.toHash,0),s.set(r,this.toHash.byteLength),this.toHash=s}},t.prototype.digest=function(){var e=this;return this.key?this.key.then(function(r){return W().crypto.subtle.sign(Le,r,e.toHash).then(function(s){return new Uint8Array(s)})}):me(this.toHash)?Promise.resolve(Ts):Promise.resolve().then(function(){return W().crypto.subtle.digest(ot,e.toHash)}).then(function(r){return Promise.resolve(new Uint8Array(r))})},t.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(r,s){W().crypto.subtle.importKey("raw",F(e.secret),Le,!1,["sign"]).then(r,s)}),this.key.catch(function(){}))},t})(),E=64,As=32,xs=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Is=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Ms=Math.pow(2,53)-1,G=(function(){function t(){this.state=Int32Array.from(Is),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return t.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var r=0,s=e.byteLength;if(this.bytesHashed+=s,this.bytesHashed*8>Ms)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;s>0;)this.buffer[this.bufferLength++]=e[r++],s--,this.bufferLength===E&&(this.hashBuffer(),this.bufferLength=0)},t.prototype.digest=function(){if(!this.finished){var e=this.bytesHashed*8,r=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),s=this.bufferLength;if(r.setUint8(this.bufferLength++,128),s%E>=E-8){for(var n=this.bufferLength;n<E;n++)r.setUint8(n,0);this.hashBuffer(),this.bufferLength=0}for(var n=this.bufferLength;n<E-8;n++)r.setUint8(n,0);r.setUint32(E-8,Math.floor(e/4294967296),!0),r.setUint32(E-4,e),this.hashBuffer(),this.finished=!0}for(var i=new Uint8Array(As),n=0;n<8;n++)i[n*4]=this.state[n]>>>24&255,i[n*4+1]=this.state[n]>>>16&255,i[n*4+2]=this.state[n]>>>8&255,i[n*4+3]=this.state[n]>>>0&255;return i},t.prototype.hashBuffer=function(){for(var e=this,r=e.buffer,s=e.state,n=s[0],i=s[1],a=s[2],u=s[3],o=s[4],d=s[5],m=s[6],c=s[7],h=0;h<E;h++){if(h<16)this.temp[h]=(r[h*4]&255)<<24|(r[h*4+1]&255)<<16|(r[h*4+2]&255)<<8|r[h*4+3]&255;else{var l=this.temp[h-2],p=(l>>>17|l<<15)^(l>>>19|l<<13)^l>>>10;l=this.temp[h-15];var y=(l>>>7|l<<25)^(l>>>18|l<<14)^l>>>3;this.temp[h]=(p+this.temp[h-7]|0)+(y+this.temp[h-16]|0)}var f=(((o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7))+(o&d^~o&m)|0)+(c+(xs[h]+this.temp[h]|0)|0)|0,g=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&i^n&a^i&a)|0;c=m,m=d,d=o,o=u+f|0,u=a,a=i,i=n,n=f+g|0}s[0]+=n,s[1]+=i,s[2]+=a,s[3]+=u,s[4]+=o,s[5]+=d,s[6]+=m,s[7]+=c},t})(),$s=(function(){function t(e){this.secret=e,this.hash=new G,this.reset()}return t.prototype.update=function(e){if(!(me(e)||this.error))try{this.hash.update(F(e))}catch(r){this.error=r}},t.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},t.prototype.digest=function(){return ft(this,void 0,void 0,function(){return mt(this,function(e){return[2,this.digestSync()]})})},t.prototype.reset=function(){if(this.hash=new G,this.secret){this.outer=new G;var e=Os(this.secret),r=new Uint8Array(E);r.set(e);for(var s=0;s<E;s++)e[s]^=54,r[s]^=92;this.hash.update(e),this.outer.update(r);for(var s=0;s<e.byteLength;s++)e[s]=0}},t})();function Os(t){var e=F(t);if(e.byteLength>E){var r=new G;r.update(e),e=r.digest()}var s=new Uint8Array(E);return s.set(e),s}var Ps=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function Ns(t){if(_s(t)&&typeof t.crypto.subtle=="object"){var e=t.crypto.subtle;return Ds(e)}return!1}function _s(t){if(typeof t=="object"&&typeof t.crypto=="object"){var e=t.crypto.getRandomValues;return typeof e=="function"}return!1}function Ds(t){return t&&Ps.every(function(e){return typeof t[e]=="function"})}var gn=(function(){function t(e){Ns(W())?this.hash=new Cs(e):this.hash=new $s(e)}return t.prototype.update=function(e,r){this.hash.update(F(e))},t.prototype.digest=function(){return this.hash.digest()},t.prototype.reset=function(){this.hash.reset()},t})();const wn=t=>()=>Promise.reject(t),ks=["in-region","cross-region","mobile","standard","legacy"],Sn=({defaultsMode:t}={})=>pt(async()=>{const e=typeof t=="function"?await t():t;switch(e?.toLowerCase()){case"auto":return Promise.resolve(Ls()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(e?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${ks.join(", ")}, got ${e}`)}}),Ls=()=>{const t=window?.navigator;if(t?.connection){const{effectiveType:e,rtt:r,downlink:s}=t?.connection;if(typeof e=="string"&&e!=="4g"||Number(r)>100||Number(s)<10)return!0}return t?.userAgentData?.mobile||typeof t?.maxTouchPoints=="number"&&t?.maxTouchPoints>1};export{cn as A,Ks as B,vt as C,mn as D,sn as E,Xs as F,Bs as G,Js as H,Fs as I,pn as J,hn as K,N as L,fn as M,T as N,qs as O,yn as P,dn as Q,Vs as R,an as S,A as T,Qs as U,Ys as V,Zs as W,H as X,Et as Y,js as a,Vt as b,Ae as c,jt as d,tn as e,Gs as f,ln as g,Ue as h,ye as i,Te as j,Ws as k,Z as l,rn as m,O as n,j as o,he as p,$t as q,nn as r,en as s,Sn as t,gn as u,Rt as v,wn as w,le as x,on as y,un as z};
|