@agentlang/lstudio 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/assets/AwsJson1_1Protocol-DdIGyZVw.js +1 -0
  2. package/assets/{index-V-xWzSNb.js → fractl_coilot.gif} +0 -0
  3. package/assets/index-B3X6Xu-W.js +1 -0
  4. package/assets/index-BEhtjPxy-CBgP3wC4.js +1 -0
  5. package/assets/{index-DYmn2gQ6-CnjFa625.js → index-BdxSFemm-BKC3Ptjg.js} +1 -1
  6. package/assets/index-BjQNf7Nf.js +15 -0
  7. package/assets/index-Br2Hgz2q.js +1 -0
  8. package/assets/{index-D4z_hbl0-MSJ43mR7.js → index-CSAsH4Cj-CNgNYeys.js} +8 -8
  9. package/assets/{index-nAh4PLWc.js → index-CbTQ5dVq.js} +1 -1
  10. package/assets/index-ClUL-R5x.js +1 -0
  11. package/assets/{index-BFv-M3PX.js → index-CoCLR6CX.js} +5 -5
  12. package/assets/{index-BJBOx-Z---hbiLl7B.js → index-D3JO_TBD-DrqEk_TF.js} +3 -3
  13. package/assets/index-DB9kJcqZ.js +5166 -0
  14. package/assets/index-DSosZ5sh-_5CimrqR.js +1 -0
  15. package/assets/{index-BitrXVkV.js → index-DlfdnOJV.js} +1 -1
  16. package/assets/index-DzMfgnJU.css +1 -0
  17. package/assets/{index-ChvoNxcO.js → index-JiKw9JSs.js} +1 -1
  18. package/assets/{index-KGBiLwKE-Doz2tX9S.js → index-KGBiLwKE-Kc8k70rJ.js} +4 -4
  19. package/assets/index-ZTnKX8xy-BNOF_2FA.js +16952 -0
  20. package/assets/index-mwiGaNy1-DKNEoPya.js +17 -0
  21. package/assets/index-q0DdgLUs.js +1 -0
  22. package/assets/index.browser-ClkxIF_a.js +6 -0
  23. package/assets/inherits_browser-SFmLU6iN-Bpg6Btaw.js +6 -0
  24. package/assets/loadCognitoIdentity-D3DCDtA_.js +1 -0
  25. package/assets/loadSts-De9MppCU.js +1 -0
  26. package/assets/{normalizeProvider-CtDY37Q6.js → normalizeProvider-EC8cbfMc.js} +1 -1
  27. package/assets/replService-3_Zm3_kc.js +1 -0
  28. package/assets/util-COkob34j-BZ2TtJP8.js +10 -0
  29. package/assets/util-CsY--ROm-CHWqg22i.js +1 -0
  30. package/assets/winston-BSc_Rh2n-BqL-578K.js +46 -0
  31. package/assets/{winston-dEjhd1YE.js → winston-CPWYjGTE.js} +1 -1
  32. package/assets/winston-C_b7Zy4p.js +46 -0
  33. package/assets/winston-tM2NjUgP-Cgaf-Nmz.js +1 -0
  34. package/index.html +9 -11
  35. package/package.json +1 -1
  36. package/assets/_commonjs-dynamic-modules-DkOKMH7F.js +0 -1
  37. package/assets/_commonjsHelpers-B4e78b8K-W3E8ocG7.js +0 -1
  38. package/assets/index-0JmHOPsf.js +0 -1
  39. package/assets/index-69shuAsh-DF18H7zf.js +0 -1
  40. package/assets/index-BXMy9UIl.js +0 -1
  41. package/assets/index-Bto-kj6R-C0A_3Pwb.js +0 -1
  42. package/assets/index-DPVspNVL.js +0 -1
  43. package/assets/index-DSosZ5sh-Ceejs_jv.js +0 -1
  44. package/assets/index-DTNuphFO-Bf5Ad1xs.js +0 -17
  45. package/assets/index-DdJraFJK.css +0 -1
  46. package/assets/index-DsIu-45t-Bejjlpz4.js +0 -6
  47. package/assets/index-Dt_ETtFl.js +0 -1
  48. package/assets/index.browser-lOmG7_PN.js +0 -6
  49. package/assets/inherits_browser-nmOknR35-Bp0mvRSL.js +0 -1
  50. package/assets/loadCognitoIdentity-DZFjtemX.js +0 -1
  51. package/assets/loadSts-ByIZDCSr.js +0 -1
  52. package/assets/replService-BZQN4pqx.js +0 -1
  53. package/assets/resolveDefaultsModeConfig-tQhK1DqL.js +0 -15
  54. package/assets/util-BtFUhH79.js +0 -10
  55. package/assets/util-CNqBjtt6-GUXK7Yxz.js +0 -10
  56. package/assets/util-DZRIOW0Z-CproX86h.js +0 -1
  57. package/assets/winston-1qzyIKCb-DDRDQd62.js +0 -37
  58. package/assets/winston-CtxF18qc-BdIq9r55.js +0 -1
  59. package/assets/winston-WF_w71lY.js +0 -37
@@ -1,4 +1,4 @@
1
- import{a as On,g as Tn}from"./_commonjsHelpers-D6-XlEtG.js";import{r as En,a as Nn,b as In,c as An}from"./winston-WF_w71lY.js";import{c as it,b as Pe}from"./_commonjs-dynamic-modules-DkOKMH7F.js";import{r as Fr}from"./util-BtFUhH79.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"&&it;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
1
+ import{a as On,g as Tn}from"./_commonjsHelpers-D6-XlEtG.js";import{a as En,b as Fr,c as Nn,d as In,r as An}from"./winston-C_b7Zy4p.js";import{a as Pe}from"./index-DB9kJcqZ.js";import{c as it}from"./index-B3X6Xu-W.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"&&it;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])
@@ -0,0 +1 @@
1
+ import{c as R,A as S,S as A}from"./loadSts-De9MppCU.js";import{n as _,b as H,e as M,f as U,g as j,h as N,d as z,C as B,o as F,E as V,u as G,I as J,s as Q,i as X,t as Y,j as Z,p as O,M as ee,q as te,P as ne,k as oe,l as se,r as ie,R as re,a as ae,m as ce,T as le}from"./loadSts-De9MppCU.js";import{C as E,g as I,s as l}from"./index-BjQNf7Nf.js";import{a as ue}from"./index-BjQNf7Nf.js";import"./normalizeProvider-EC8cbfMc.js";import"./preload-helper-BlTxHScW.js";function y(){return async()=>"us-east-1"}class x extends E.classBuilder().ep(R).m(function(t,o,s,n){return[I(s,t.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").sc(S).build(){}const $=e=>{if(typeof e?.Arn=="string"){const t=e.Arn.split(":");if(t.length>4&&t[4]!=="")return t[4]}},T=async(e,t,o,s={})=>{const n=typeof e=="function"?await e():e,a=typeof t=="function"?await t():t;let i="";const r=n??a??(i=await y()());return o?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${n} (credential provider clientConfig)`,`${a} (contextual client)`,`${i} (STS default: AWS_REGION, profile region, or us-east-1)`),r},W=(e,t)=>{let o;return async s=>{if(!o){const{logger:d=e?.parentClientConfig?.logger,profile:u=e?.parentClientConfig?.profile,region:m,requestHandler:c=e?.parentClientConfig?.requestHandler,credentialProviderLogger:p,userAgentAppId:g=e?.parentClientConfig?.userAgentAppId}=e,f=await T(m,e?.parentClientConfig?.region,p,{}),C=!P(c);o=new t({...e,userAgentAppId:g,profile:u,region:f,requestHandler:C?c:void 0,logger:d})}const{Credentials:n,AssumedRoleUser:a}=await o.send(new x(s));if(!n||!n.AccessKeyId||!n.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${s.RoleArn}`);const i=$(a),r={accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,sessionToken:n.SessionToken,expiration:n.Expiration,...n.CredentialScope&&{credentialScope:n.CredentialScope},...i&&{accountId:i}};return i&&l(r,"RESOLVED_ACCOUNT_ID","T"),l(r,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),r}},P=e=>e?.metadata?.handlerProtocol==="h2",D=(e,t)=>t?class extends e{constructor(s){super(s);for(const n of t)this.middlewareStack.use(n)}}:e,q=(e={},t)=>W(e,D(A,t));export{E as $Command,_ as AssumeRole$,H as AssumeRoleCommand,M as AssumeRoleRequest$,U as AssumeRoleResponse$,S as AssumeRoleWithWebIdentity$,x as AssumeRoleWithWebIdentityCommand,j as AssumeRoleWithWebIdentityRequest$,N as AssumeRoleWithWebIdentityResponse$,z as AssumedRoleUser$,B as Credentials$,F as ExpiredTokenException,V as ExpiredTokenException$,G as IDPCommunicationErrorException,J as IDPCommunicationErrorException$,Q as IDPRejectedClaimException,X as IDPRejectedClaimException$,Y as InvalidIdentityTokenException,Z as InvalidIdentityTokenException$,O as MalformedPolicyDocumentException,ee as MalformedPolicyDocumentException$,te as PackedPolicyTooLargeException,ne as PackedPolicyTooLargeException$,oe as PolicyDescriptorType$,se as ProvidedContext$,ie as RegionDisabledException,re as RegionDisabledException$,A as STSClient,ae as STSServiceException,ce as STSServiceException$,le as Tag$,ue as __Client,q as getDefaultRoleAssumerWithWebIdentity};
@@ -1,7 +1,7 @@
1
- import{c as We,a as Oe}from"./_commonjsHelpers-D6-XlEtG.js";import{a as Ot,r as Nt,c as Kt,b as kt}from"./_commonjs-dynamic-modules-DkOKMH7F.js";import"./__vite-browser-external-DLjrMatA.js";/*!
1
+ import{c as We,a as Oe}from"./_commonjsHelpers-D6-XlEtG.js";import{r as Ot,a as Nt,c as Kt}from"./index-B3X6Xu-W.js";import{a as kt}from"./index-DB9kJcqZ.js";import"./index-ZTnKX8xy-BNOF_2FA.js";import"./preload-helper-BlTxHScW.js";import"./__vite-browser-external-DLjrMatA.js";import"./index-DSosZ5sh-_5CimrqR.js";import"./inherits_browser-SFmLU6iN-Bpg6Btaw.js";import"./index-D3JO_TBD-DrqEk_TF.js";import"./index.browser-BHPvGrwi-6Mh8eUw-.js";import"./index-6mKfgpcs-DsgiI2lM.js";import"./_commonjs-dynamic-modules-BpilXLfW-DfYEAvWy.js";import"./index-JiKw9JSs.js";/*!
2
2
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
- */var Vn=(function(){function o(r){var e=r||{},a=e.ValidationData,s=e.Username,f=e.Password,u=e.AuthParameters,l=e.ClientMetadata;this.validationData=a||{},this.authParameters=u||{},this.clientMetadata=l||{},this.username=s,this.password=f}var t=o.prototype;return t.getUsername=function(){return this.username},t.getPassword=function(){return this.password},t.getValidationData=function(){return this.validationData},t.getAuthParameters=function(){return this.authParameters},t.getClientMetadata=function(){return this.clientMetadata},o})(),Ae={},Ue,Je;function qt(){if(Je)return Ue;Je=1;var o={}.toString;return Ue=Array.isArray||function(t){return o.call(t)=="[object Array]"},Ue}/*!
4
+ */var $n=(function(){function o(r){var e=r||{},a=e.ValidationData,s=e.Username,f=e.Password,u=e.AuthParameters,l=e.ClientMetadata;this.validationData=a||{},this.authParameters=u||{},this.clientMetadata=l||{},this.username=s,this.password=f}var t=o.prototype;return t.getUsername=function(){return this.username},t.getPassword=function(){return this.password},t.getValidationData=function(){return this.validationData},t.getAuthParameters=function(){return this.authParameters},t.getClientMetadata=function(){return this.clientMetadata},o})(),Ae={},Ue,Je;function qt(){if(Je)return Ue;Je=1;var o={}.toString;return Ue=Array.isArray||function(t){return o.call(t)=="[object Array]"},Ue}/*!
5
5
  * The buffer module from node.js, for the browser.
6
6
  *
7
7
  * @author Feross Aboukhadijeh <http://feross.org>
@@ -46,13 +46,13 @@ PERFORMANCE OF THIS SOFTWARE.
46
46
  */var Z={},An=(function(){function o(){}return o.setItem=function(r,e){return Z[r]=e,Z[r]},o.getItem=function(r){return Object.prototype.hasOwnProperty.call(Z,r)?Z[r]:void 0},o.removeItem=function(r){return delete Z[r]},o.clear=function(){return Z={},Z},o})(),At=(function(){function o(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.cognito.test-ls",1),this.storageWindow.removeItem("aws.cognito.test-ls")}catch{this.storageWindow=An}}var t=o.prototype;return t.getStorage=function(){return this.storageWindow},o})();/*!
47
47
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
48
48
  * SPDX-License-Identifier: Apache-2.0
49
- */var Un=typeof navigator<"u",lt=Un?Ct.isReactNative?"react-native":navigator.userAgent:"nodejs",pt=(function(){function o(r){if(r==null||r.Username==null||r.Pool==null)throw new Error("Username and Pool information are required.");this.username=r.Username||"",this.pool=r.Pool,this.Session=null,this.client=r.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=r.Storage||new At().getStorage(),this.keyPrefix="CognitoIdentityServiceProvider."+this.pool.getClientId(),this.userDataKey=this.keyPrefix+"."+this.username+".userData"}var t=o.prototype;return t.setSignInUserSession=function(e){this.clearCachedUserData(),this.signInUserSession=e,this.cacheTokens()},t.getSignInUserSession=function(){return this.signInUserSession},t.getUsername=function(){return this.username},t.getAuthenticationFlowType=function(){return this.authenticationFlowType},t.setAuthenticationFlowType=function(e){this.authenticationFlowType=e},t.initiateAuth=function(e,a){var s=this,f=e.getAuthParameters();f.USERNAME=this.username;var u=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),l={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:f,ClientMetadata:u};this.getUserContextData()&&(l.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",l,function(p,d){if(p)return a.onFailure(p);var y=d.ChallengeName,S=d.ChallengeParameters;return y==="CUSTOM_CHALLENGE"?(s.Session=d.Session,a.customChallenge(S)):(s.signInUserSession=s.getCognitoUserSession(d.AuthenticationResult),s.cacheTokens(),a.onSuccess(s.signInUserSession))})},t.authenticateUser=function(e,a){return this.authenticationFlowType==="USER_PASSWORD_AUTH"?this.authenticateUserPlainUsernamePassword(e,a):this.authenticationFlowType==="USER_SRP_AUTH"||this.authenticationFlowType==="CUSTOM_AUTH"?this.authenticateUserDefaultAuth(e,a):a.onFailure(new Error("Authentication flow type is invalid."))},t.authenticateUserDefaultAuth=function(e,a){var s=this,f=new X(this.pool.getUserPoolName()),u=new ct,l,p,d={};this.deviceKey!=null&&(d.DEVICE_KEY=this.deviceKey),d.USERNAME=this.username,f.getLargeAValue(function(y,S){y&&a.onFailure(y),d.SRP_A=S.toString(16),s.authenticationFlowType==="CUSTOM_AUTH"&&(d.CHALLENGE_NAME="SRP_A");var U=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),A={AuthFlow:s.authenticationFlowType,ClientId:s.pool.getClientId(),AuthParameters:d,ClientMetadata:U};s.getUserContextData(s.username)&&(A.UserContextData=s.getUserContextData(s.username)),s.client.request("InitiateAuth",A,function(C,D){if(C)return a.onFailure(C);var T=D.ChallengeParameters;s.username=T.USER_ID_FOR_SRP,s.userDataKey=s.keyPrefix+"."+s.username+".userData",l=new w(T.SRP_B,16),p=new w(T.SALT,16),s.getCachedDeviceKeyAndPassword(),f.getPasswordAuthenticationKey(s.username,e.getPassword(),l,p,function(P,j){P&&a.onFailure(P);var k=u.getNowString(),Y=I.Buffer.concat([I.Buffer.from(s.pool.getUserPoolName(),"utf8"),I.Buffer.from(s.username,"utf8"),I.Buffer.from(T.SECRET_BLOCK,"base64"),I.Buffer.from(k,"utf8")]),W=new ce.Sha256(j);W.update(Y);var te=W.digestSync(),L=I.Buffer.from(te).toString("base64"),O={};O.USERNAME=s.username,O.PASSWORD_CLAIM_SECRET_BLOCK=T.SECRET_BLOCK,O.TIMESTAMP=k,O.PASSWORD_CLAIM_SIGNATURE=L,s.deviceKey!=null&&(O.DEVICE_KEY=s.deviceKey);var J=function($,ne){return s.client.request("RespondToAuthChallenge",$,function(G,Ce){return G&&G.code==="ResourceNotFoundException"&&G.message.toLowerCase().indexOf("device")!==-1?(O.DEVICE_KEY=null,s.deviceKey=null,s.randomPassword=null,s.deviceGroupKey=null,s.clearCachedDeviceKeyAndPassword(),J($,ne)):ne(G,Ce)})},z={ChallengeName:"PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:O,Session:D.Session,ClientMetadata:U};s.getUserContextData()&&(z.UserContextData=s.getUserContextData()),J(z,function(re,$){return re?a.onFailure(re):s.authenticateUserInternal($,f,a)})})})})},t.authenticateUserPlainUsernamePassword=function(e,a){var s=this,f={};if(f.USERNAME=this.username,f.PASSWORD=e.getPassword(),!f.PASSWORD){a.onFailure(new Error("PASSWORD parameter is required"));return}var u=new X(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),this.deviceKey!=null&&(f.DEVICE_KEY=this.deviceKey);var l=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),p={AuthFlow:"USER_PASSWORD_AUTH",ClientId:this.pool.getClientId(),AuthParameters:f,ClientMetadata:l};this.getUserContextData(this.username)&&(p.UserContextData=this.getUserContextData(this.username)),this.client.request("InitiateAuth",p,function(d,y){return d?a.onFailure(d):s.authenticateUserInternal(y,u,a)})},t.authenticateUserInternal=function(e,a,s){var f=this,u=e.ChallengeName,l=e.ChallengeParameters;if(u==="SMS_MFA")return this.Session=e.Session,s.mfaRequired(u,l);if(u==="SELECT_MFA_TYPE")return this.Session=e.Session,s.selectMFAType(u,l);if(u==="MFA_SETUP")return this.Session=e.Session,s.mfaSetup(u,l);if(u==="SOFTWARE_TOKEN_MFA")return this.Session=e.Session,s.totpRequired(u,l);if(u==="CUSTOM_CHALLENGE")return this.Session=e.Session,s.customChallenge(l);if(u==="NEW_PASSWORD_REQUIRED"){this.Session=e.Session;var p=null,d=null,y=[],S=a.getNewPasswordRequiredChallengeUserAttributePrefix();if(l&&(p=JSON.parse(e.ChallengeParameters.userAttributes),d=JSON.parse(e.ChallengeParameters.requiredAttributes)),d)for(var U=0;U<d.length;U++)y[U]=d[U].substr(S.length);return s.newPasswordRequired(p,y)}if(u==="DEVICE_SRP_AUTH"){this.Session=e.Session,this.getDeviceResponse(s);return}this.signInUserSession=this.getCognitoUserSession(e.AuthenticationResult),this.challengeName=u,this.cacheTokens();var A=e.AuthenticationResult.NewDeviceMetadata;if(A==null)return s.onSuccess(this.signInUserSession);a.generateHashDevice(e.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,e.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(C){if(C)return s.onFailure(C);var D={Salt:I.Buffer.from(a.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:I.Buffer.from(a.getVerifierDevices(),"hex").toString("base64")};f.verifierDevices=D.PasswordVerifier,f.deviceGroupKey=A.DeviceGroupKey,f.randomPassword=a.getRandomPassword(),f.client.request("ConfirmDevice",{DeviceKey:A.DeviceKey,AccessToken:f.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:D,DeviceName:lt},function(T,P){return T?s.onFailure(T):(f.deviceKey=e.AuthenticationResult.NewDeviceMetadata.DeviceKey,f.cacheDeviceKeyAndPassword(),P.UserConfirmationNecessary===!0?s.onSuccess(f.signInUserSession,P.UserConfirmationNecessary):s.onSuccess(f.signInUserSession))})})},t.completeNewPasswordChallenge=function(e,a,s,f){var u=this;if(!e)return s.onFailure(new Error("New password is required."));var l=new X(this.pool.getUserPoolName()),p=l.getNewPasswordRequiredChallengeUserAttributePrefix(),d={};a&&Object.keys(a).forEach(function(S){d[p+S]=a[S]}),d.NEW_PASSWORD=e,d.USERNAME=this.username;var y={ChallengeName:"NEW_PASSWORD_REQUIRED",ClientId:this.pool.getClientId(),ChallengeResponses:d,Session:this.Session,ClientMetadata:f};this.getUserContextData()&&(y.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",y,function(S,U){return S?s.onFailure(S):u.authenticateUserInternal(U,l,s)})},t.getDeviceResponse=function(e,a){var s=this,f=new X(this.deviceGroupKey),u=new ct,l={};l.USERNAME=this.username,l.DEVICE_KEY=this.deviceKey,f.getLargeAValue(function(p,d){p&&e.onFailure(p),l.SRP_A=d.toString(16);var y={ChallengeName:"DEVICE_SRP_AUTH",ClientId:s.pool.getClientId(),ChallengeResponses:l,ClientMetadata:a,Session:s.Session};s.getUserContextData()&&(y.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",y,function(S,U){if(S)return e.onFailure(S);var A=U.ChallengeParameters,C=new w(A.SRP_B,16),D=new w(A.SALT,16);f.getPasswordAuthenticationKey(s.deviceKey,s.randomPassword,C,D,function(T,P){if(T)return e.onFailure(T);var j=u.getNowString(),k=I.Buffer.concat([I.Buffer.from(s.deviceGroupKey,"utf8"),I.Buffer.from(s.deviceKey,"utf8"),I.Buffer.from(A.SECRET_BLOCK,"base64"),I.Buffer.from(j,"utf8")]),Y=new ce.Sha256(P);Y.update(k);var W=Y.digestSync(),te=I.Buffer.from(W).toString("base64"),L={};L.USERNAME=s.username,L.PASSWORD_CLAIM_SECRET_BLOCK=A.SECRET_BLOCK,L.TIMESTAMP=j,L.PASSWORD_CLAIM_SIGNATURE=te,L.DEVICE_KEY=s.deviceKey;var O={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:L,Session:U.Session};s.getUserContextData()&&(O.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",O,function(J,z){return J?e.onFailure(J):(s.signInUserSession=s.getCognitoUserSession(z.AuthenticationResult),s.cacheTokens(),e.onSuccess(s.signInUserSession))})})})})},t.confirmRegistration=function(e,a,s,f){var u={ClientId:this.pool.getClientId(),ConfirmationCode:e,Username:this.username,ForceAliasCreation:a,ClientMetadata:f};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("ConfirmSignUp",u,function(l){return l?s(l,null):s(null,"SUCCESS")})},t.sendCustomChallengeAnswer=function(e,a,s){var f=this,u={};u.USERNAME=this.username,u.ANSWER=e;var l=new X(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),this.deviceKey!=null&&(u.DEVICE_KEY=this.deviceKey);var p={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:u,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:s};this.getUserContextData()&&(p.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",p,function(d,y){return d?a.onFailure(d):f.authenticateUserInternal(y,l,a)})},t.sendMFACode=function(e,a,s,f){var u=this,l={};l.USERNAME=this.username,l.SMS_MFA_CODE=e;var p=s||"SMS_MFA";p==="SOFTWARE_TOKEN_MFA"&&(l.SOFTWARE_TOKEN_MFA_CODE=e),this.deviceKey!=null&&(l.DEVICE_KEY=this.deviceKey);var d={ChallengeName:p,ChallengeResponses:l,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:f};this.getUserContextData()&&(d.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",d,function(y,S){if(y)return a.onFailure(y);var U=S.ChallengeName;if(U==="DEVICE_SRP_AUTH"){u.getDeviceResponse(a);return}if(u.signInUserSession=u.getCognitoUserSession(S.AuthenticationResult),u.cacheTokens(),S.AuthenticationResult.NewDeviceMetadata==null)return a.onSuccess(u.signInUserSession);var A=new X(u.pool.getUserPoolName());A.generateHashDevice(S.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,S.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(C){if(C)return a.onFailure(C);var D={Salt:I.Buffer.from(A.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:I.Buffer.from(A.getVerifierDevices(),"hex").toString("base64")};u.verifierDevices=D.PasswordVerifier,u.deviceGroupKey=S.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,u.randomPassword=A.getRandomPassword(),u.client.request("ConfirmDevice",{DeviceKey:S.AuthenticationResult.NewDeviceMetadata.DeviceKey,AccessToken:u.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:D,DeviceName:lt},function(T,P){return T?a.onFailure(T):(u.deviceKey=S.AuthenticationResult.NewDeviceMetadata.DeviceKey,u.cacheDeviceKeyAndPassword(),P.UserConfirmationNecessary===!0?a.onSuccess(u.signInUserSession,P.UserConfirmationNecessary):a.onSuccess(u.signInUserSession))})})})},t.changePassword=function(e,a,s,f){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return s(new Error("User is not authenticated"),null);this.client.request("ChangePassword",{PreviousPassword:e,ProposedPassword:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:f},function(u){return u?s(u,null):s(null,"SUCCESS")})},t.enableMFA=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var a=[],s={DeliveryMedium:"SMS",AttributeName:"phone_number"};a.push(s),this.client.request("SetUserSettings",{MFAOptions:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?e(f,null):e(null,"SUCCESS")})},t.setUserMfaPreference=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s(new Error("User is not authenticated"),null);this.client.request("SetUserMFAPreference",{SMSMfaSettings:e,SoftwareTokenMfaSettings:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?s(f,null):s(null,"SUCCESS")})},t.disableMFA=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var a=[];this.client.request("SetUserSettings",{MFAOptions:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s){return s?e(s,null):e(null,"SUCCESS")})},t.deleteUser=function(e,a){var s=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("DeleteUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:a},function(f){return f?e(f,null):(s.clearCachedUser(),e(null,"SUCCESS"))})},t.updateAttributes=function(e,a,s){var f=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return a(new Error("User is not authenticated"),null);this.client.request("UpdateUserAttributes",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserAttributes:e,ClientMetadata:s},function(u,l){return u?a(u,null):f.getUserData(function(){return a(null,"SUCCESS",l)},{bypassCache:!0})})},t.getUserAttributes=function(e){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(a,s){if(a)return e(a,null);for(var f=[],u=0;u<s.UserAttributes.length;u++){var l={Name:s.UserAttributes[u].Name,Value:s.UserAttributes[u].Value},p=new Cn(l);f.push(p)}return e(null,f)})},t.getMFAOptions=function(e){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(a,s){return a?e(a,null):e(null,s.MFAOptions)})},t.createGetUserRequest=function(){return this.client.promisifyRequest("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()})},t.refreshSessionIfPossible=function(e){var a=this;return e===void 0&&(e={}),new Promise(function(s){var f=a.signInUserSession.getRefreshToken();f&&f.getToken()?a.refreshSession(f,s,e.clientMetadata):s()})},t.getUserData=function(e,a){var s=this;if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return this.clearCachedUserData(),e(new Error("User is not authenticated"),null);var f=this.getUserDataFromCache();if(!f){this.fetchUserData().then(function(u){e(null,u)}).catch(e);return}if(this.isFetchUserDataAndTokenRequired(a)){this.fetchUserData().then(function(u){return s.refreshSessionIfPossible(a).then(function(){return u})}).then(function(u){return e(null,u)}).catch(e);return}try{e(null,JSON.parse(f));return}catch(u){this.clearCachedUserData(),e(u,null);return}},t.getUserDataFromCache=function(){var e=this.storage.getItem(this.userDataKey);return e},t.isFetchUserDataAndTokenRequired=function(e){var a=e||{},s=a.bypassCache,f=s===void 0?!1:s;return f},t.fetchUserData=function(){var e=this;return this.createGetUserRequest().then(function(a){return e.cacheUserData(a),a})},t.deleteAttributes=function(e,a){var s=this;if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return a(new Error("User is not authenticated"),null);this.client.request("DeleteUserAttributes",{UserAttributeNames:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?a(f,null):s.getUserData(function(){return a(null,"SUCCESS")},{bypassCache:!0})})},t.resendConfirmationCode=function(e,a){var s={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:a};this.client.request("ResendConfirmationCode",s,function(f,u){return f?e(f,null):e(null,u)})},t.getSession=function(e,a){if(a===void 0&&(a={}),this.username==null)return e(new Error("Username is null. Cannot retrieve a new session"),null);if(this.signInUserSession!=null&&this.signInUserSession.isValid())return e(null,this.signInUserSession);var s="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,f=s+".idToken",u=s+".accessToken",l=s+".refreshToken",p=s+".clockDrift";if(this.storage.getItem(f)){var d=new ut({IdToken:this.storage.getItem(f)}),y=new at({AccessToken:this.storage.getItem(u)}),S=new ft({RefreshToken:this.storage.getItem(l)}),U=parseInt(this.storage.getItem(p),0)||0,A={IdToken:d,AccessToken:y,RefreshToken:S,ClockDrift:U},C=new ht(A);if(C.isValid())return this.signInUserSession=C,e(null,this.signInUserSession);if(!S.getToken())return e(new Error("Cannot retrieve a new session. Please authenticate."),null);this.refreshSession(S,e,a.clientMetadata)}else e(new Error("Local storage is missing an ID Token, Please authenticate"),null)},t.refreshSession=function(e,a,s){var f=this,u=this.pool.wrapRefreshSessionCallback?this.pool.wrapRefreshSessionCallback(a):a,l={};l.REFRESH_TOKEN=e.getToken();var p="CognitoIdentityServiceProvider."+this.pool.getClientId(),d=p+".LastAuthUser";if(this.storage.getItem(d)){this.username=this.storage.getItem(d);var y=p+"."+this.username+".deviceKey";this.deviceKey=this.storage.getItem(y),l.DEVICE_KEY=this.deviceKey}var S={ClientId:this.pool.getClientId(),AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:l,ClientMetadata:s};this.getUserContextData()&&(S.UserContextData=this.getUserContextData()),this.client.requestWithRetry("InitiateAuth",S,function(U,A){if(U)return U.code==="NotAuthorizedException"&&f.clearCachedUser(),u(U,null);if(A){var C=A.AuthenticationResult;return Object.prototype.hasOwnProperty.call(C,"RefreshToken")||(C.RefreshToken=e.getToken()),f.signInUserSession=f.getCognitoUserSession(C),f.cacheTokens(),u(null,f.signInUserSession)}})},t.cacheTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),a=e+"."+this.username+".idToken",s=e+"."+this.username+".accessToken",f=e+"."+this.username+".refreshToken",u=e+"."+this.username+".clockDrift",l=e+".LastAuthUser";this.storage.setItem(a,this.signInUserSession.getIdToken().getJwtToken()),this.storage.setItem(s,this.signInUserSession.getAccessToken().getJwtToken()),this.storage.setItem(f,this.signInUserSession.getRefreshToken().getToken()),this.storage.setItem(u,""+this.signInUserSession.getClockDrift()),this.storage.setItem(l,this.username)},t.cacheUserData=function(e){this.storage.setItem(this.userDataKey,JSON.stringify(e))},t.clearCachedUserData=function(){this.storage.removeItem(this.userDataKey)},t.clearCachedUser=function(){this.clearCachedTokens(),this.clearCachedUserData()},t.cacheDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.setItem(a,this.deviceKey),this.storage.setItem(s,this.randomPassword),this.storage.setItem(f,this.deviceGroupKey)},t.getCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.getItem(a)&&(this.deviceKey=this.storage.getItem(a),this.randomPassword=this.storage.getItem(s),this.deviceGroupKey=this.storage.getItem(f))},t.clearCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.removeItem(a),this.storage.removeItem(s),this.storage.removeItem(f)},t.clearCachedTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),a=e+"."+this.username+".idToken",s=e+"."+this.username+".accessToken",f=e+"."+this.username+".refreshToken",u=e+".LastAuthUser",l=e+"."+this.username+".clockDrift";this.storage.removeItem(a),this.storage.removeItem(s),this.storage.removeItem(f),this.storage.removeItem(u),this.storage.removeItem(l)},t.getCognitoUserSession=function(e){var a=new ut(e),s=new at(e),f=new ft(e),u={IdToken:a,AccessToken:s,RefreshToken:f};return new ht(u)},t.forgotPassword=function(e,a){var s={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:a};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("ForgotPassword",s,function(f,u){return f?e.onFailure(f):typeof e.inputVerificationCode=="function"?e.inputVerificationCode(u):e.onSuccess(u)})},t.confirmPassword=function(e,a,s,f){var u={ClientId:this.pool.getClientId(),Username:this.username,ConfirmationCode:e,Password:a,ClientMetadata:f};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("ConfirmForgotPassword",u,function(l){return l?s.onFailure(l):s.onSuccess("SUCCESS")})},t.getAttributeVerificationCode=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return a.onFailure(new Error("User is not authenticated"));this.client.request("GetUserAttributeVerificationCode",{AttributeName:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:s},function(f,u){return f?a.onFailure(f):typeof a.inputVerificationCode=="function"?a.inputVerificationCode(u):a.onSuccess("SUCCESS")})},t.verifyAttribute=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s.onFailure(new Error("User is not authenticated"));this.client.request("VerifyUserAttribute",{AttributeName:e,Code:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?s.onFailure(f):s.onSuccess("SUCCESS")})},t.getDevice=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey},function(a,s){return a?e.onFailure(a):e.onSuccess(s)})},t.forgetSpecificDevice=function(e,a){if(this.signInUserSession==null||!this.signInUserSession.isValid())return a.onFailure(new Error("User is not authenticated"));this.client.request("ForgetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:e},function(s){return s?a.onFailure(s):a.onSuccess("SUCCESS")})},t.forgetDevice=function(e){var a=this;this.forgetSpecificDevice(this.deviceKey,{onFailure:e.onFailure,onSuccess:function(f){return a.deviceKey=null,a.deviceGroupKey=null,a.randomPassword=null,a.clearCachedDeviceKeyAndPassword(),e.onSuccess(f)}})},t.setDeviceStatusRemembered=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"remembered"},function(a){return a?e.onFailure(a):e.onSuccess("SUCCESS")})},t.setDeviceStatusNotRemembered=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"not_remembered"},function(a){return a?e.onFailure(a):e.onSuccess("SUCCESS")})},t.listDevices=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s.onFailure(new Error("User is not authenticated"));var f={AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),Limit:e};a&&(f.PaginationToken=a),this.client.request("ListDevices",f,function(u,l){return u?s.onFailure(u):s.onSuccess(l)})},t.globalSignOut=function(e){var a=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GlobalSignOut",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s){return s?e.onFailure(s):(a.clearCachedUser(),e.onSuccess("SUCCESS"))})},t.signOut=function(e){var a=this;if(!e||typeof e!="function"){this.cleanClientData();return}this.getSession(function(s,f){if(s)return e(s);a.revokeTokens(function(u){a.cleanClientData(),e(u)})})},t.revokeTokens=function(e){if(e===void 0&&(e=function(){}),typeof e!="function")throw new Error("Invalid revokeTokenCallback. It should be a function.");if(!this.signInUserSession){var a=new Error("User is not authenticated");return e(a)}if(!this.signInUserSession.getAccessToken()){var s=new Error("No Access token available");return e(s)}var f=this.signInUserSession.getRefreshToken().getToken(),u=this.signInUserSession.getAccessToken();if(this.isSessionRevocable(u)&&f)return this.revokeToken({token:f,callback:e});e()},t.isSessionRevocable=function(e){if(e&&typeof e.decodePayload=="function")try{var a=e.decodePayload(),s=a.origin_jti;return!!s}catch{}return!1},t.cleanClientData=function(){this.signInUserSession=null,this.clearCachedUser()},t.revokeToken=function(e){var a=e.token,s=e.callback;this.client.requestWithRetry("RevokeToken",{Token:a,ClientId:this.pool.getClientId()},function(f){if(f)return s(f);s()})},t.sendMFASelectionAnswer=function(e,a){var s=this,f={};f.USERNAME=this.username,f.ANSWER=e;var u={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:f,ClientId:this.pool.getClientId(),Session:this.Session};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",u,function(l,p){if(l)return a.onFailure(l);if(s.Session=p.Session,e==="SMS_MFA")return a.mfaRequired(p.ChallengeName,p.ChallengeParameters);if(e==="SOFTWARE_TOKEN_MFA")return a.totpRequired(p.ChallengeName,p.ChallengeParameters)})},t.getUserContextData=function(){var e=this.pool;return e.getUserContextData(this.username)},t.associateSoftwareToken=function(e){var a=this;this.signInUserSession!=null&&this.signInUserSession.isValid()?this.client.request("AssociateSoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s,f){return s?e.onFailure(s):e.associateSecretCode(f.SecretCode)}):this.client.request("AssociateSoftwareToken",{Session:this.Session},function(s,f){return s?e.onFailure(s):(a.Session=f.Session,e.associateSecretCode(f.SecretCode))})},t.verifySoftwareToken=function(e,a,s){var f=this;this.signInUserSession!=null&&this.signInUserSession.isValid()?this.client.request("VerifySoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserCode:e,FriendlyDeviceName:a},function(u,l){return u?s.onFailure(u):s.onSuccess(l)}):this.client.request("VerifySoftwareToken",{Session:this.Session,UserCode:e,FriendlyDeviceName:a},function(u,l){if(u)return s.onFailure(u);f.Session=l.Session;var p={};p.USERNAME=f.username;var d={ChallengeName:"MFA_SETUP",ClientId:f.pool.getClientId(),ChallengeResponses:p,Session:f.Session};f.getUserContextData()&&(d.UserContextData=f.getUserContextData()),f.client.request("RespondToAuthChallenge",d,function(y,S){return y?s.onFailure(y):(f.signInUserSession=f.getCognitoUserSession(S.AuthenticationResult),f.cacheTokens(),s.onSuccess(f.signInUserSession))})})},o})();function En(o,t){return t=t||{},new Promise(function(r,e){var a=new XMLHttpRequest,s=[],f=[],u={},l=function(){return{ok:(a.status/100|0)==2,statusText:a.statusText,status:a.status,url:a.responseURL,text:function(){return Promise.resolve(a.responseText)},json:function(){return Promise.resolve(a.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([a.response]))},clone:l,headers:{keys:function(){return s},entries:function(){return f},get:function(d){return u[d.toLowerCase()]},has:function(d){return d.toLowerCase()in u}}}};for(var p in a.open(t.method||"get",o,!0),a.onload=function(){a.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(d,y,S){s.push(y=y.toLowerCase()),f.push([y,S]),u[y]=u[y]?u[y]+","+S:S}),r(l())},a.onerror=e,a.withCredentials=t.credentials=="include",t.headers)a.setRequestHeader(p,t.headers[p]);a.send(t.body||null)})}const Tn=Object.freeze(Object.defineProperty({__proto__:null,default:En},Symbol.toStringTag,{value:"Module"})),gt=Oe(Tn);var xe,dt;function Dn(){return dt||(dt=1,xe=self.fetch||(self.fetch=gt.default||gt)),xe}Dn();function K(){}K.prototype.userAgent=yn();var Ln=function(t){t&&(K.prototype.userAgent&&!K.prototype.userAgent.includes(t)&&(K.prototype.userAgent=K.prototype.userAgent.concat(" ",t)),(!K.prototype.userAgent||K.prototype.userAgent==="")&&(K.prototype.userAgent=t))},xn=function(t){var r=K.category?" "+K.category:"",e=K.framework?" framework/"+K.framework:"",a=""+K.prototype.userAgent+r+e;return a};function In(o,t){o.prototype=Object.create(t.prototype),o.prototype.constructor=o,pe(o,t)}function be(o){var t=typeof Map=="function"?new Map:void 0;return be=function(e){if(e===null||!Rn(e))return e;if(typeof e!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return _n(e,arguments,Me(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),pe(a,e)},be(o)}function _n(o,t,r){if(Ut())return Reflect.construct.apply(null,arguments);var e=[null];e.push.apply(e,t);var a=new(o.bind.apply(o,e));return r&&pe(a,r.prototype),a}function Ut(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ut=function(){return!!o})()}function Rn(o){try{return Function.toString.call(o).indexOf("[native code]")!==-1}catch{return typeof o=="function"}}function pe(o,t){return pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},pe(o,t)}function Me(o){return Me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Me(o)}var Pn=(function(o){function t(r,e,a,s){var f;return f=o.call(this,r)||this,f.code=e,f.name=a,f.statusCode=s,f}return In(t,o),t})(be(Error)),Fn=(function(){function o(r,e,a){this.endpoint=e||"https://cognito-idp."+r+".amazonaws.com/";var s=a||{},f=s.credentials;this.fetchOptions=f?{credentials:f}:{}}var t=o.prototype;return t.promisifyRequest=function(e,a){var s=this;return new Promise(function(f,u){s.request(e,a,function(l,p){l?u(new Pn(l.message,l.code,l.name,l.statusCode)):f(p)})})},t.requestWithRetry=function(e,a,s){var f=this,u=5*1e3;Mn(function(l){return new Promise(function(p,d){f.request(e,l,function(y,S){y?d(y):p(S)})})},[a],u).then(function(l){return s(null,l)}).catch(function(l){return s(l)})},t.request=function(e,a,s){var f={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+e,"X-Amz-User-Agent":xn(),"Cache-Control":"no-store"},u=Object.assign({},this.fetchOptions,{headers:f,method:"POST",mode:"cors",body:JSON.stringify(a)}),l;fetch(this.endpoint,u).then(function(p){return l=p,p},function(p){throw p instanceof TypeError?new Error("Network error"):p}).then(function(p){return p.json().catch(function(){return{}})}).then(function(p){if(l.ok)return s(null,p);var d=(p.__type||p.code).split("#").pop(),y=new Error(p.message||p.Message||null);return y.name=d,y.code=d,s(y)}).catch(function(p){if(l&&l.headers&&l.headers.get("x-amzn-errortype"))try{var d=l.headers.get("x-amzn-errortype").split(":")[0],y=new Error(l.status?l.status.toString():null);return y.code=d,y.name=d,y.statusCode=l.status,s(y)}catch{return s(p)}else p instanceof Error&&p.message==="Network error"&&(p.code="NetworkError");return s(p)})},o})(),Se={debug:function(){}},Bn=function(t){var r="nonRetryable";return t&&t[r]};function Et(o,t,r,e){if(e===void 0&&(e=1),typeof o!="function")throw Error("functionToRetry must be a function");return Se.debug(o.name+" attempt #"+e+" with args: "+JSON.stringify(t)),o.apply(void 0,t).catch(function(a){if(Se.debug("error on "+o.name,a),Bn(a))throw Se.debug(o.name+" non retryable error",a),a;var s=r(e,t,a);if(Se.debug(o.name+" retrying in "+s+" ms"),s!==!1)return new Promise(function(f){return setTimeout(f,s)}).then(function(){return Et(o,t,r,e+1)});throw a})}function bn(o){var t=100,r=100;return function(e){var a=Math.pow(2,e)*t+r*Math.random();return a>o?!1:a}}function Mn(o,t,r){return Et(o,t,bn(r))}/*!
49
+ */var Un=typeof navigator<"u",lt=Un?Ct.isReactNative?"react-native":navigator.userAgent:"nodejs",pt=(function(){function o(r){if(r==null||r.Username==null||r.Pool==null)throw new Error("Username and Pool information are required.");this.username=r.Username||"",this.pool=r.Pool,this.Session=null,this.client=r.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=r.Storage||new At().getStorage(),this.keyPrefix="CognitoIdentityServiceProvider."+this.pool.getClientId(),this.userDataKey=this.keyPrefix+"."+this.username+".userData"}var t=o.prototype;return t.setSignInUserSession=function(e){this.clearCachedUserData(),this.signInUserSession=e,this.cacheTokens()},t.getSignInUserSession=function(){return this.signInUserSession},t.getUsername=function(){return this.username},t.getAuthenticationFlowType=function(){return this.authenticationFlowType},t.setAuthenticationFlowType=function(e){this.authenticationFlowType=e},t.initiateAuth=function(e,a){var s=this,f=e.getAuthParameters();f.USERNAME=this.username;var u=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),l={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:f,ClientMetadata:u};this.getUserContextData()&&(l.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",l,function(p,d){if(p)return a.onFailure(p);var y=d.ChallengeName,S=d.ChallengeParameters;return y==="CUSTOM_CHALLENGE"?(s.Session=d.Session,a.customChallenge(S)):(s.signInUserSession=s.getCognitoUserSession(d.AuthenticationResult),s.cacheTokens(),a.onSuccess(s.signInUserSession))})},t.authenticateUser=function(e,a){return this.authenticationFlowType==="USER_PASSWORD_AUTH"?this.authenticateUserPlainUsernamePassword(e,a):this.authenticationFlowType==="USER_SRP_AUTH"||this.authenticationFlowType==="CUSTOM_AUTH"?this.authenticateUserDefaultAuth(e,a):a.onFailure(new Error("Authentication flow type is invalid."))},t.authenticateUserDefaultAuth=function(e,a){var s=this,f=new X(this.pool.getUserPoolName()),u=new ct,l,p,d={};this.deviceKey!=null&&(d.DEVICE_KEY=this.deviceKey),d.USERNAME=this.username,f.getLargeAValue(function(y,S){y&&a.onFailure(y),d.SRP_A=S.toString(16),s.authenticationFlowType==="CUSTOM_AUTH"&&(d.CHALLENGE_NAME="SRP_A");var U=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),A={AuthFlow:s.authenticationFlowType,ClientId:s.pool.getClientId(),AuthParameters:d,ClientMetadata:U};s.getUserContextData(s.username)&&(A.UserContextData=s.getUserContextData(s.username)),s.client.request("InitiateAuth",A,function(C,D){if(C)return a.onFailure(C);var T=D.ChallengeParameters;s.username=T.USER_ID_FOR_SRP,s.userDataKey=s.keyPrefix+"."+s.username+".userData",l=new w(T.SRP_B,16),p=new w(T.SALT,16),s.getCachedDeviceKeyAndPassword(),f.getPasswordAuthenticationKey(s.username,e.getPassword(),l,p,function(P,j){P&&a.onFailure(P);var k=u.getNowString(),Y=I.Buffer.concat([I.Buffer.from(s.pool.getUserPoolName(),"utf8"),I.Buffer.from(s.username,"utf8"),I.Buffer.from(T.SECRET_BLOCK,"base64"),I.Buffer.from(k,"utf8")]),W=new ce.Sha256(j);W.update(Y);var te=W.digestSync(),L=I.Buffer.from(te).toString("base64"),O={};O.USERNAME=s.username,O.PASSWORD_CLAIM_SECRET_BLOCK=T.SECRET_BLOCK,O.TIMESTAMP=k,O.PASSWORD_CLAIM_SIGNATURE=L,s.deviceKey!=null&&(O.DEVICE_KEY=s.deviceKey);var J=function($,ne){return s.client.request("RespondToAuthChallenge",$,function(G,Ce){return G&&G.code==="ResourceNotFoundException"&&G.message.toLowerCase().indexOf("device")!==-1?(O.DEVICE_KEY=null,s.deviceKey=null,s.randomPassword=null,s.deviceGroupKey=null,s.clearCachedDeviceKeyAndPassword(),J($,ne)):ne(G,Ce)})},z={ChallengeName:"PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:O,Session:D.Session,ClientMetadata:U};s.getUserContextData()&&(z.UserContextData=s.getUserContextData()),J(z,function(re,$){return re?a.onFailure(re):s.authenticateUserInternal($,f,a)})})})})},t.authenticateUserPlainUsernamePassword=function(e,a){var s=this,f={};if(f.USERNAME=this.username,f.PASSWORD=e.getPassword(),!f.PASSWORD){a.onFailure(new Error("PASSWORD parameter is required"));return}var u=new X(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),this.deviceKey!=null&&(f.DEVICE_KEY=this.deviceKey);var l=Object.keys(e.getValidationData()).length!==0?e.getValidationData():e.getClientMetadata(),p={AuthFlow:"USER_PASSWORD_AUTH",ClientId:this.pool.getClientId(),AuthParameters:f,ClientMetadata:l};this.getUserContextData(this.username)&&(p.UserContextData=this.getUserContextData(this.username)),this.client.request("InitiateAuth",p,function(d,y){return d?a.onFailure(d):s.authenticateUserInternal(y,u,a)})},t.authenticateUserInternal=function(e,a,s){var f=this,u=e.ChallengeName,l=e.ChallengeParameters;if(u==="SMS_MFA")return this.Session=e.Session,s.mfaRequired(u,l);if(u==="SELECT_MFA_TYPE")return this.Session=e.Session,s.selectMFAType(u,l);if(u==="MFA_SETUP")return this.Session=e.Session,s.mfaSetup(u,l);if(u==="SOFTWARE_TOKEN_MFA")return this.Session=e.Session,s.totpRequired(u,l);if(u==="CUSTOM_CHALLENGE")return this.Session=e.Session,s.customChallenge(l);if(u==="NEW_PASSWORD_REQUIRED"){this.Session=e.Session;var p=null,d=null,y=[],S=a.getNewPasswordRequiredChallengeUserAttributePrefix();if(l&&(p=JSON.parse(e.ChallengeParameters.userAttributes),d=JSON.parse(e.ChallengeParameters.requiredAttributes)),d)for(var U=0;U<d.length;U++)y[U]=d[U].substr(S.length);return s.newPasswordRequired(p,y)}if(u==="DEVICE_SRP_AUTH"){this.Session=e.Session,this.getDeviceResponse(s);return}this.signInUserSession=this.getCognitoUserSession(e.AuthenticationResult),this.challengeName=u,this.cacheTokens();var A=e.AuthenticationResult.NewDeviceMetadata;if(A==null)return s.onSuccess(this.signInUserSession);a.generateHashDevice(e.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,e.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(C){if(C)return s.onFailure(C);var D={Salt:I.Buffer.from(a.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:I.Buffer.from(a.getVerifierDevices(),"hex").toString("base64")};f.verifierDevices=D.PasswordVerifier,f.deviceGroupKey=A.DeviceGroupKey,f.randomPassword=a.getRandomPassword(),f.client.request("ConfirmDevice",{DeviceKey:A.DeviceKey,AccessToken:f.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:D,DeviceName:lt},function(T,P){return T?s.onFailure(T):(f.deviceKey=e.AuthenticationResult.NewDeviceMetadata.DeviceKey,f.cacheDeviceKeyAndPassword(),P.UserConfirmationNecessary===!0?s.onSuccess(f.signInUserSession,P.UserConfirmationNecessary):s.onSuccess(f.signInUserSession))})})},t.completeNewPasswordChallenge=function(e,a,s,f){var u=this;if(!e)return s.onFailure(new Error("New password is required."));var l=new X(this.pool.getUserPoolName()),p=l.getNewPasswordRequiredChallengeUserAttributePrefix(),d={};a&&Object.keys(a).forEach(function(S){d[p+S]=a[S]}),d.NEW_PASSWORD=e,d.USERNAME=this.username;var y={ChallengeName:"NEW_PASSWORD_REQUIRED",ClientId:this.pool.getClientId(),ChallengeResponses:d,Session:this.Session,ClientMetadata:f};this.getUserContextData()&&(y.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",y,function(S,U){return S?s.onFailure(S):u.authenticateUserInternal(U,l,s)})},t.getDeviceResponse=function(e,a){var s=this,f=new X(this.deviceGroupKey),u=new ct,l={};l.USERNAME=this.username,l.DEVICE_KEY=this.deviceKey,f.getLargeAValue(function(p,d){p&&e.onFailure(p),l.SRP_A=d.toString(16);var y={ChallengeName:"DEVICE_SRP_AUTH",ClientId:s.pool.getClientId(),ChallengeResponses:l,ClientMetadata:a,Session:s.Session};s.getUserContextData()&&(y.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",y,function(S,U){if(S)return e.onFailure(S);var A=U.ChallengeParameters,C=new w(A.SRP_B,16),D=new w(A.SALT,16);f.getPasswordAuthenticationKey(s.deviceKey,s.randomPassword,C,D,function(T,P){if(T)return e.onFailure(T);var j=u.getNowString(),k=I.Buffer.concat([I.Buffer.from(s.deviceGroupKey,"utf8"),I.Buffer.from(s.deviceKey,"utf8"),I.Buffer.from(A.SECRET_BLOCK,"base64"),I.Buffer.from(j,"utf8")]),Y=new ce.Sha256(P);Y.update(k);var W=Y.digestSync(),te=I.Buffer.from(W).toString("base64"),L={};L.USERNAME=s.username,L.PASSWORD_CLAIM_SECRET_BLOCK=A.SECRET_BLOCK,L.TIMESTAMP=j,L.PASSWORD_CLAIM_SIGNATURE=te,L.DEVICE_KEY=s.deviceKey;var O={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:s.pool.getClientId(),ChallengeResponses:L,Session:U.Session};s.getUserContextData()&&(O.UserContextData=s.getUserContextData()),s.client.request("RespondToAuthChallenge",O,function(J,z){return J?e.onFailure(J):(s.signInUserSession=s.getCognitoUserSession(z.AuthenticationResult),s.cacheTokens(),e.onSuccess(s.signInUserSession))})})})})},t.confirmRegistration=function(e,a,s,f){var u={ClientId:this.pool.getClientId(),ConfirmationCode:e,Username:this.username,ForceAliasCreation:a,ClientMetadata:f};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("ConfirmSignUp",u,function(l){return l?s(l,null):s(null,"SUCCESS")})},t.sendCustomChallengeAnswer=function(e,a,s){var f=this,u={};u.USERNAME=this.username,u.ANSWER=e;var l=new X(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),this.deviceKey!=null&&(u.DEVICE_KEY=this.deviceKey);var p={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:u,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:s};this.getUserContextData()&&(p.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",p,function(d,y){return d?a.onFailure(d):f.authenticateUserInternal(y,l,a)})},t.sendMFACode=function(e,a,s,f){var u=this,l={};l.USERNAME=this.username,l.SMS_MFA_CODE=e;var p=s||"SMS_MFA";p==="SOFTWARE_TOKEN_MFA"&&(l.SOFTWARE_TOKEN_MFA_CODE=e),this.deviceKey!=null&&(l.DEVICE_KEY=this.deviceKey);var d={ChallengeName:p,ChallengeResponses:l,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:f};this.getUserContextData()&&(d.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",d,function(y,S){if(y)return a.onFailure(y);var U=S.ChallengeName;if(U==="DEVICE_SRP_AUTH"){u.getDeviceResponse(a);return}if(u.signInUserSession=u.getCognitoUserSession(S.AuthenticationResult),u.cacheTokens(),S.AuthenticationResult.NewDeviceMetadata==null)return a.onSuccess(u.signInUserSession);var A=new X(u.pool.getUserPoolName());A.generateHashDevice(S.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,S.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(C){if(C)return a.onFailure(C);var D={Salt:I.Buffer.from(A.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:I.Buffer.from(A.getVerifierDevices(),"hex").toString("base64")};u.verifierDevices=D.PasswordVerifier,u.deviceGroupKey=S.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,u.randomPassword=A.getRandomPassword(),u.client.request("ConfirmDevice",{DeviceKey:S.AuthenticationResult.NewDeviceMetadata.DeviceKey,AccessToken:u.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:D,DeviceName:lt},function(T,P){return T?a.onFailure(T):(u.deviceKey=S.AuthenticationResult.NewDeviceMetadata.DeviceKey,u.cacheDeviceKeyAndPassword(),P.UserConfirmationNecessary===!0?a.onSuccess(u.signInUserSession,P.UserConfirmationNecessary):a.onSuccess(u.signInUserSession))})})})},t.changePassword=function(e,a,s,f){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return s(new Error("User is not authenticated"),null);this.client.request("ChangePassword",{PreviousPassword:e,ProposedPassword:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:f},function(u){return u?s(u,null):s(null,"SUCCESS")})},t.enableMFA=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var a=[],s={DeliveryMedium:"SMS",AttributeName:"phone_number"};a.push(s),this.client.request("SetUserSettings",{MFAOptions:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?e(f,null):e(null,"SUCCESS")})},t.setUserMfaPreference=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s(new Error("User is not authenticated"),null);this.client.request("SetUserMFAPreference",{SMSMfaSettings:e,SoftwareTokenMfaSettings:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?s(f,null):s(null,"SUCCESS")})},t.disableMFA=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var a=[];this.client.request("SetUserSettings",{MFAOptions:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s){return s?e(s,null):e(null,"SUCCESS")})},t.deleteUser=function(e,a){var s=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("DeleteUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:a},function(f){return f?e(f,null):(s.clearCachedUser(),e(null,"SUCCESS"))})},t.updateAttributes=function(e,a,s){var f=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return a(new Error("User is not authenticated"),null);this.client.request("UpdateUserAttributes",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserAttributes:e,ClientMetadata:s},function(u,l){return u?a(u,null):f.getUserData(function(){return a(null,"SUCCESS",l)},{bypassCache:!0})})},t.getUserAttributes=function(e){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(a,s){if(a)return e(a,null);for(var f=[],u=0;u<s.UserAttributes.length;u++){var l={Name:s.UserAttributes[u].Name,Value:s.UserAttributes[u].Value},p=new Cn(l);f.push(p)}return e(null,f)})},t.getMFAOptions=function(e){if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(a,s){return a?e(a,null):e(null,s.MFAOptions)})},t.createGetUserRequest=function(){return this.client.promisifyRequest("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()})},t.refreshSessionIfPossible=function(e){var a=this;return e===void 0&&(e={}),new Promise(function(s){var f=a.signInUserSession.getRefreshToken();f&&f.getToken()?a.refreshSession(f,s,e.clientMetadata):s()})},t.getUserData=function(e,a){var s=this;if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return this.clearCachedUserData(),e(new Error("User is not authenticated"),null);var f=this.getUserDataFromCache();if(!f){this.fetchUserData().then(function(u){e(null,u)}).catch(e);return}if(this.isFetchUserDataAndTokenRequired(a)){this.fetchUserData().then(function(u){return s.refreshSessionIfPossible(a).then(function(){return u})}).then(function(u){return e(null,u)}).catch(e);return}try{e(null,JSON.parse(f));return}catch(u){this.clearCachedUserData(),e(u,null);return}},t.getUserDataFromCache=function(){var e=this.storage.getItem(this.userDataKey);return e},t.isFetchUserDataAndTokenRequired=function(e){var a=e||{},s=a.bypassCache,f=s===void 0?!1:s;return f},t.fetchUserData=function(){var e=this;return this.createGetUserRequest().then(function(a){return e.cacheUserData(a),a})},t.deleteAttributes=function(e,a){var s=this;if(!(this.signInUserSession!=null&&this.signInUserSession.isValid()))return a(new Error("User is not authenticated"),null);this.client.request("DeleteUserAttributes",{UserAttributeNames:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?a(f,null):s.getUserData(function(){return a(null,"SUCCESS")},{bypassCache:!0})})},t.resendConfirmationCode=function(e,a){var s={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:a};this.client.request("ResendConfirmationCode",s,function(f,u){return f?e(f,null):e(null,u)})},t.getSession=function(e,a){if(a===void 0&&(a={}),this.username==null)return e(new Error("Username is null. Cannot retrieve a new session"),null);if(this.signInUserSession!=null&&this.signInUserSession.isValid())return e(null,this.signInUserSession);var s="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,f=s+".idToken",u=s+".accessToken",l=s+".refreshToken",p=s+".clockDrift";if(this.storage.getItem(f)){var d=new ut({IdToken:this.storage.getItem(f)}),y=new at({AccessToken:this.storage.getItem(u)}),S=new ft({RefreshToken:this.storage.getItem(l)}),U=parseInt(this.storage.getItem(p),0)||0,A={IdToken:d,AccessToken:y,RefreshToken:S,ClockDrift:U},C=new ht(A);if(C.isValid())return this.signInUserSession=C,e(null,this.signInUserSession);if(!S.getToken())return e(new Error("Cannot retrieve a new session. Please authenticate."),null);this.refreshSession(S,e,a.clientMetadata)}else e(new Error("Local storage is missing an ID Token, Please authenticate"),null)},t.refreshSession=function(e,a,s){var f=this,u=this.pool.wrapRefreshSessionCallback?this.pool.wrapRefreshSessionCallback(a):a,l={};l.REFRESH_TOKEN=e.getToken();var p="CognitoIdentityServiceProvider."+this.pool.getClientId(),d=p+".LastAuthUser";if(this.storage.getItem(d)){this.username=this.storage.getItem(d);var y=p+"."+this.username+".deviceKey";this.deviceKey=this.storage.getItem(y),l.DEVICE_KEY=this.deviceKey}var S={ClientId:this.pool.getClientId(),AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:l,ClientMetadata:s};this.getUserContextData()&&(S.UserContextData=this.getUserContextData()),this.client.requestWithRetry("InitiateAuth",S,function(U,A){if(U)return U.code==="NotAuthorizedException"&&f.clearCachedUser(),u(U,null);if(A){var C=A.AuthenticationResult;return Object.prototype.hasOwnProperty.call(C,"RefreshToken")||(C.RefreshToken=e.getToken()),f.signInUserSession=f.getCognitoUserSession(C),f.cacheTokens(),u(null,f.signInUserSession)}})},t.cacheTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),a=e+"."+this.username+".idToken",s=e+"."+this.username+".accessToken",f=e+"."+this.username+".refreshToken",u=e+"."+this.username+".clockDrift",l=e+".LastAuthUser";this.storage.setItem(a,this.signInUserSession.getIdToken().getJwtToken()),this.storage.setItem(s,this.signInUserSession.getAccessToken().getJwtToken()),this.storage.setItem(f,this.signInUserSession.getRefreshToken().getToken()),this.storage.setItem(u,""+this.signInUserSession.getClockDrift()),this.storage.setItem(l,this.username)},t.cacheUserData=function(e){this.storage.setItem(this.userDataKey,JSON.stringify(e))},t.clearCachedUserData=function(){this.storage.removeItem(this.userDataKey)},t.clearCachedUser=function(){this.clearCachedTokens(),this.clearCachedUserData()},t.cacheDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.setItem(a,this.deviceKey),this.storage.setItem(s,this.randomPassword),this.storage.setItem(f,this.deviceGroupKey)},t.getCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.getItem(a)&&(this.deviceKey=this.storage.getItem(a),this.randomPassword=this.storage.getItem(s),this.deviceGroupKey=this.storage.getItem(f))},t.clearCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,a=e+".deviceKey",s=e+".randomPasswordKey",f=e+".deviceGroupKey";this.storage.removeItem(a),this.storage.removeItem(s),this.storage.removeItem(f)},t.clearCachedTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),a=e+"."+this.username+".idToken",s=e+"."+this.username+".accessToken",f=e+"."+this.username+".refreshToken",u=e+".LastAuthUser",l=e+"."+this.username+".clockDrift";this.storage.removeItem(a),this.storage.removeItem(s),this.storage.removeItem(f),this.storage.removeItem(u),this.storage.removeItem(l)},t.getCognitoUserSession=function(e){var a=new ut(e),s=new at(e),f=new ft(e),u={IdToken:a,AccessToken:s,RefreshToken:f};return new ht(u)},t.forgotPassword=function(e,a){var s={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:a};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("ForgotPassword",s,function(f,u){return f?e.onFailure(f):typeof e.inputVerificationCode=="function"?e.inputVerificationCode(u):e.onSuccess(u)})},t.confirmPassword=function(e,a,s,f){var u={ClientId:this.pool.getClientId(),Username:this.username,ConfirmationCode:e,Password:a,ClientMetadata:f};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("ConfirmForgotPassword",u,function(l){return l?s.onFailure(l):s.onSuccess("SUCCESS")})},t.getAttributeVerificationCode=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return a.onFailure(new Error("User is not authenticated"));this.client.request("GetUserAttributeVerificationCode",{AttributeName:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:s},function(f,u){return f?a.onFailure(f):typeof a.inputVerificationCode=="function"?a.inputVerificationCode(u):a.onSuccess("SUCCESS")})},t.verifyAttribute=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s.onFailure(new Error("User is not authenticated"));this.client.request("VerifyUserAttribute",{AttributeName:e,Code:a,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(f){return f?s.onFailure(f):s.onSuccess("SUCCESS")})},t.getDevice=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey},function(a,s){return a?e.onFailure(a):e.onSuccess(s)})},t.forgetSpecificDevice=function(e,a){if(this.signInUserSession==null||!this.signInUserSession.isValid())return a.onFailure(new Error("User is not authenticated"));this.client.request("ForgetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:e},function(s){return s?a.onFailure(s):a.onSuccess("SUCCESS")})},t.forgetDevice=function(e){var a=this;this.forgetSpecificDevice(this.deviceKey,{onFailure:e.onFailure,onSuccess:function(f){return a.deviceKey=null,a.deviceGroupKey=null,a.randomPassword=null,a.clearCachedDeviceKeyAndPassword(),e.onSuccess(f)}})},t.setDeviceStatusRemembered=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"remembered"},function(a){return a?e.onFailure(a):e.onSuccess("SUCCESS")})},t.setDeviceStatusNotRemembered=function(e){if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"not_remembered"},function(a){return a?e.onFailure(a):e.onSuccess("SUCCESS")})},t.listDevices=function(e,a,s){if(this.signInUserSession==null||!this.signInUserSession.isValid())return s.onFailure(new Error("User is not authenticated"));var f={AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),Limit:e};a&&(f.PaginationToken=a),this.client.request("ListDevices",f,function(u,l){return u?s.onFailure(u):s.onSuccess(l)})},t.globalSignOut=function(e){var a=this;if(this.signInUserSession==null||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GlobalSignOut",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s){return s?e.onFailure(s):(a.clearCachedUser(),e.onSuccess("SUCCESS"))})},t.signOut=function(e){var a=this;if(!e||typeof e!="function"){this.cleanClientData();return}this.getSession(function(s,f){if(s)return e(s);a.revokeTokens(function(u){a.cleanClientData(),e(u)})})},t.revokeTokens=function(e){if(e===void 0&&(e=function(){}),typeof e!="function")throw new Error("Invalid revokeTokenCallback. It should be a function.");if(!this.signInUserSession){var a=new Error("User is not authenticated");return e(a)}if(!this.signInUserSession.getAccessToken()){var s=new Error("No Access token available");return e(s)}var f=this.signInUserSession.getRefreshToken().getToken(),u=this.signInUserSession.getAccessToken();if(this.isSessionRevocable(u)&&f)return this.revokeToken({token:f,callback:e});e()},t.isSessionRevocable=function(e){if(e&&typeof e.decodePayload=="function")try{var a=e.decodePayload(),s=a.origin_jti;return!!s}catch{}return!1},t.cleanClientData=function(){this.signInUserSession=null,this.clearCachedUser()},t.revokeToken=function(e){var a=e.token,s=e.callback;this.client.requestWithRetry("RevokeToken",{Token:a,ClientId:this.pool.getClientId()},function(f){if(f)return s(f);s()})},t.sendMFASelectionAnswer=function(e,a){var s=this,f={};f.USERNAME=this.username,f.ANSWER=e;var u={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:f,ClientId:this.pool.getClientId(),Session:this.Session};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",u,function(l,p){if(l)return a.onFailure(l);if(s.Session=p.Session,e==="SMS_MFA")return a.mfaRequired(p.ChallengeName,p.ChallengeParameters);if(e==="SOFTWARE_TOKEN_MFA")return a.totpRequired(p.ChallengeName,p.ChallengeParameters)})},t.getUserContextData=function(){var e=this.pool;return e.getUserContextData(this.username)},t.associateSoftwareToken=function(e){var a=this;this.signInUserSession!=null&&this.signInUserSession.isValid()?this.client.request("AssociateSoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(s,f){return s?e.onFailure(s):e.associateSecretCode(f.SecretCode)}):this.client.request("AssociateSoftwareToken",{Session:this.Session},function(s,f){return s?e.onFailure(s):(a.Session=f.Session,e.associateSecretCode(f.SecretCode))})},t.verifySoftwareToken=function(e,a,s){var f=this;this.signInUserSession!=null&&this.signInUserSession.isValid()?this.client.request("VerifySoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserCode:e,FriendlyDeviceName:a},function(u,l){return u?s.onFailure(u):s.onSuccess(l)}):this.client.request("VerifySoftwareToken",{Session:this.Session,UserCode:e,FriendlyDeviceName:a},function(u,l){if(u)return s.onFailure(u);f.Session=l.Session;var p={};p.USERNAME=f.username;var d={ChallengeName:"MFA_SETUP",ClientId:f.pool.getClientId(),ChallengeResponses:p,Session:f.Session};f.getUserContextData()&&(d.UserContextData=f.getUserContextData()),f.client.request("RespondToAuthChallenge",d,function(y,S){return y?s.onFailure(y):(f.signInUserSession=f.getCognitoUserSession(S.AuthenticationResult),f.cacheTokens(),s.onSuccess(f.signInUserSession))})})},o})();function En(o,t){return t=t||{},new Promise(function(r,e){var a=new XMLHttpRequest,s=[],f=[],u={},l=function(){return{ok:(a.status/100|0)==2,statusText:a.statusText,status:a.status,url:a.responseURL,text:function(){return Promise.resolve(a.responseText)},json:function(){return Promise.resolve(a.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([a.response]))},clone:l,headers:{keys:function(){return s},entries:function(){return f},get:function(d){return u[d.toLowerCase()]},has:function(d){return d.toLowerCase()in u}}}};for(var p in a.open(t.method||"get",o,!0),a.onload=function(){a.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(d,y,S){s.push(y=y.toLowerCase()),f.push([y,S]),u[y]=u[y]?u[y]+","+S:S}),r(l())},a.onerror=e,a.withCredentials=t.credentials=="include",t.headers)a.setRequestHeader(p,t.headers[p]);a.send(t.body||null)})}const Tn=Object.freeze(Object.defineProperty({__proto__:null,default:En},Symbol.toStringTag,{value:"Module"})),gt=Oe(Tn);var xe,dt;function Dn(){return dt||(dt=1,xe=self.fetch||(self.fetch=gt.default||gt)),xe}Dn();function K(){}K.prototype.userAgent=yn();var Xn=function(t){t&&(K.prototype.userAgent&&!K.prototype.userAgent.includes(t)&&(K.prototype.userAgent=K.prototype.userAgent.concat(" ",t)),(!K.prototype.userAgent||K.prototype.userAgent==="")&&(K.prototype.userAgent=t))},xn=function(t){var r=K.category?" "+K.category:"",e=K.framework?" framework/"+K.framework:"",a=""+K.prototype.userAgent+r+e;return a};function In(o,t){o.prototype=Object.create(t.prototype),o.prototype.constructor=o,pe(o,t)}function be(o){var t=typeof Map=="function"?new Map:void 0;return be=function(e){if(e===null||!Rn(e))return e;if(typeof e!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return _n(e,arguments,Me(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),pe(a,e)},be(o)}function _n(o,t,r){if(Ut())return Reflect.construct.apply(null,arguments);var e=[null];e.push.apply(e,t);var a=new(o.bind.apply(o,e));return r&&pe(a,r.prototype),a}function Ut(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ut=function(){return!!o})()}function Rn(o){try{return Function.toString.call(o).indexOf("[native code]")!==-1}catch{return typeof o=="function"}}function pe(o,t){return pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},pe(o,t)}function Me(o){return Me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Me(o)}var Pn=(function(o){function t(r,e,a,s){var f;return f=o.call(this,r)||this,f.code=e,f.name=a,f.statusCode=s,f}return In(t,o),t})(be(Error)),Fn=(function(){function o(r,e,a){this.endpoint=e||"https://cognito-idp."+r+".amazonaws.com/";var s=a||{},f=s.credentials;this.fetchOptions=f?{credentials:f}:{}}var t=o.prototype;return t.promisifyRequest=function(e,a){var s=this;return new Promise(function(f,u){s.request(e,a,function(l,p){l?u(new Pn(l.message,l.code,l.name,l.statusCode)):f(p)})})},t.requestWithRetry=function(e,a,s){var f=this,u=5*1e3;Mn(function(l){return new Promise(function(p,d){f.request(e,l,function(y,S){y?d(y):p(S)})})},[a],u).then(function(l){return s(null,l)}).catch(function(l){return s(l)})},t.request=function(e,a,s){var f={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+e,"X-Amz-User-Agent":xn(),"Cache-Control":"no-store"},u=Object.assign({},this.fetchOptions,{headers:f,method:"POST",mode:"cors",body:JSON.stringify(a)}),l;fetch(this.endpoint,u).then(function(p){return l=p,p},function(p){throw p instanceof TypeError?new Error("Network error"):p}).then(function(p){return p.json().catch(function(){return{}})}).then(function(p){if(l.ok)return s(null,p);var d=(p.__type||p.code).split("#").pop(),y=new Error(p.message||p.Message||null);return y.name=d,y.code=d,s(y)}).catch(function(p){if(l&&l.headers&&l.headers.get("x-amzn-errortype"))try{var d=l.headers.get("x-amzn-errortype").split(":")[0],y=new Error(l.status?l.status.toString():null);return y.code=d,y.name=d,y.statusCode=l.status,s(y)}catch{return s(p)}else p instanceof Error&&p.message==="Network error"&&(p.code="NetworkError");return s(p)})},o})(),Se={debug:function(){}},Bn=function(t){var r="nonRetryable";return t&&t[r]};function Et(o,t,r,e){if(e===void 0&&(e=1),typeof o!="function")throw Error("functionToRetry must be a function");return Se.debug(o.name+" attempt #"+e+" with args: "+JSON.stringify(t)),o.apply(void 0,t).catch(function(a){if(Se.debug("error on "+o.name,a),Bn(a))throw Se.debug(o.name+" non retryable error",a),a;var s=r(e,t,a);if(Se.debug(o.name+" retrying in "+s+" ms"),s!==!1)return new Promise(function(f){return setTimeout(f,s)}).then(function(){return Et(o,t,r,e+1)});throw a})}function bn(o){var t=100,r=100;return function(e){var a=Math.pow(2,e)*t+r*Math.random();return a>o?!1:a}}function Mn(o,t,r){return Et(o,t,bn(r))}/*!
50
50
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
51
51
  * SPDX-License-Identifier: Apache-2.0
52
- */var On=55,jn=(function(){function o(r,e){var a=r||{},s=a.UserPoolId,f=a.ClientId,u=a.endpoint,l=a.fetchOptions,p=a.AdvancedSecurityDataCollectionFlag;if(!s||!f)throw new Error("Both UserPoolId and ClientId are required.");if(s.length>On||!/^[\w-]+_[0-9a-zA-Z]+$/.test(s))throw new Error("Invalid UserPoolId format.");var d=s.split("_")[0];this.userPoolId=s,this.clientId=f,this.client=new Fn(d,u,l),this.advancedSecurityDataCollectionFlag=p!==!1,this.storage=r.Storage||new At().getStorage(),e&&(this.wrapRefreshSessionCallback=e)}var t=o.prototype;return t.getUserPoolId=function(){return this.userPoolId},t.getUserPoolName=function(){return this.getUserPoolId().split("_")[1]},t.getClientId=function(){return this.clientId},t.signUp=function(e,a,s,f,u,l){var p=this,d={ClientId:this.clientId,Username:e,Password:a,UserAttributes:s,ValidationData:f,ClientMetadata:l};this.getUserContextData(e)&&(d.UserContextData=this.getUserContextData(e)),this.client.request("SignUp",d,function(y,S){if(y)return u(y,null);var U={Username:e,Pool:p,Storage:p.storage},A={user:new pt(U),userConfirmed:S.UserConfirmed,userSub:S.UserSub,codeDeliveryDetails:S.CodeDeliveryDetails};return u(null,A)})},t.getCurrentUser=function(){var e="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",a=this.storage.getItem(e);if(a){var s={Username:a,Pool:this,Storage:this.storage};return new pt(s)}return null},t.getUserContextData=function(e){if(!(typeof AmazonCognitoAdvancedSecurityData>"u")){var a=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var s=a.getData(e,this.userPoolId,this.clientId);if(s){var f={EncodedData:s};return f}}return{}}},o})(),Ie={exports:{}};/*!
52
+ */var On=55,Qn=(function(){function o(r,e){var a=r||{},s=a.UserPoolId,f=a.ClientId,u=a.endpoint,l=a.fetchOptions,p=a.AdvancedSecurityDataCollectionFlag;if(!s||!f)throw new Error("Both UserPoolId and ClientId are required.");if(s.length>On||!/^[\w-]+_[0-9a-zA-Z]+$/.test(s))throw new Error("Invalid UserPoolId format.");var d=s.split("_")[0];this.userPoolId=s,this.clientId=f,this.client=new Fn(d,u,l),this.advancedSecurityDataCollectionFlag=p!==!1,this.storage=r.Storage||new At().getStorage(),e&&(this.wrapRefreshSessionCallback=e)}var t=o.prototype;return t.getUserPoolId=function(){return this.userPoolId},t.getUserPoolName=function(){return this.getUserPoolId().split("_")[1]},t.getClientId=function(){return this.clientId},t.signUp=function(e,a,s,f,u,l){var p=this,d={ClientId:this.clientId,Username:e,Password:a,UserAttributes:s,ValidationData:f,ClientMetadata:l};this.getUserContextData(e)&&(d.UserContextData=this.getUserContextData(e)),this.client.request("SignUp",d,function(y,S){if(y)return u(y,null);var U={Username:e,Pool:p,Storage:p.storage},A={user:new pt(U),userConfirmed:S.UserConfirmed,userSub:S.UserSub,codeDeliveryDetails:S.CodeDeliveryDetails};return u(null,A)})},t.getCurrentUser=function(){var e="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",a=this.storage.getItem(e);if(a){var s={Username:a,Pool:this,Storage:this.storage};return new pt(s)}return null},t.getUserContextData=function(e){if(!(typeof AmazonCognitoAdvancedSecurityData>"u")){var a=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var s=a.getData(e,this.userPoolId,this.clientId);if(s){var f={EncodedData:s};return f}}return{}}},o})(),Ie={exports:{}};/*!
53
53
  * JavaScript Cookie v2.2.1
54
54
  * https://github.com/js-cookie/js-cookie
55
55
  *
56
56
  * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
57
57
  * Released under the MIT license
58
- */var vt;function Nn(){return vt||(vt=1,(function(o,t){(function(r){var e;if(o.exports=r(),e=!0,!e){var a=window.Cookies,s=window.Cookies=r();s.noConflict=function(){return window.Cookies=a,s}}})(function(){function r(){for(var s=0,f={};s<arguments.length;s++){var u=arguments[s];for(var l in u)f[l]=u[l]}return f}function e(s){return s.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function a(s){function f(){}function u(p,d,y){if(!(typeof document>"u")){y=r({path:"/"},f.defaults,y),typeof y.expires=="number"&&(y.expires=new Date(new Date*1+y.expires*864e5)),y.expires=y.expires?y.expires.toUTCString():"";try{var S=JSON.stringify(d);/^[\{\[]/.test(S)&&(d=S)}catch{}d=s.write?s.write(d,p):encodeURIComponent(String(d)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),p=encodeURIComponent(String(p)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var U="";for(var A in y)y[A]&&(U+="; "+A,y[A]!==!0&&(U+="="+y[A].split(";")[0]));return document.cookie=p+"="+d+U}}function l(p,d){if(!(typeof document>"u")){for(var y={},S=document.cookie?document.cookie.split("; "):[],U=0;U<S.length;U++){var A=S[U].split("="),C=A.slice(1).join("=");!d&&C.charAt(0)==='"'&&(C=C.slice(1,-1));try{var D=e(A[0]);if(C=(s.read||s)(C,D)||e(C),d)try{C=JSON.parse(C)}catch{}if(y[D]=C,p===D)break}catch{}}return p?y[p]:y}}return f.set=u,f.get=function(p){return l(p,!1)},f.getJSON=function(p){return l(p,!0)},f.remove=function(p,d){u(p,"",r(d,{expires:-1}))},f.defaults={},f.withConverter=a,f}return a(function(){})})})(Ie)),Ie.exports}var he=Nn(),Hn=(function(){function o(r){if(r===void 0&&(r={}),r.domain&&(this.domain=r.domain),r.path?this.path=r.path:this.path="/",Object.prototype.hasOwnProperty.call(r,"expires")?this.expires=r.expires:this.expires=365,Object.prototype.hasOwnProperty.call(r,"secure")?this.secure=r.secure:this.secure=!0,Object.prototype.hasOwnProperty.call(r,"sameSite")){if(!["strict","lax","none"].includes(r.sameSite))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if(r.sameSite==="none"&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=r.sameSite}else this.sameSite=null}var t=o.prototype;return t.setItem=function(e,a){var s={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(s.sameSite=this.sameSite),he.set(e,a,s),he.get(e)},t.getItem=function(e){return he.get(e)},t.removeItem=function(e){var a={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(a.sameSite=this.sameSite),he.remove(e,a)},t.clear=function(){for(var e=he.get(),a=Object.keys(e).length,s=0;s<a;++s)this.removeItem(Object.keys(e)[s]);return{}},o})();export{Vn as AuthenticationDetails,X as AuthenticationHelper,at as CognitoAccessToken,ut as CognitoIdToken,ft as CognitoRefreshToken,pt as CognitoUser,Cn as CognitoUserAttribute,jn as CognitoUserPool,ht as CognitoUserSession,Hn as CookieStorage,ct as DateHelper,Ht as WordArray,Ln as appendToCognitoUserAgent};
58
+ */var vt;function Nn(){return vt||(vt=1,(function(o,t){(function(r){var e;if(o.exports=r(),e=!0,!e){var a=window.Cookies,s=window.Cookies=r();s.noConflict=function(){return window.Cookies=a,s}}})(function(){function r(){for(var s=0,f={};s<arguments.length;s++){var u=arguments[s];for(var l in u)f[l]=u[l]}return f}function e(s){return s.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function a(s){function f(){}function u(p,d,y){if(!(typeof document>"u")){y=r({path:"/"},f.defaults,y),typeof y.expires=="number"&&(y.expires=new Date(new Date*1+y.expires*864e5)),y.expires=y.expires?y.expires.toUTCString():"";try{var S=JSON.stringify(d);/^[\{\[]/.test(S)&&(d=S)}catch{}d=s.write?s.write(d,p):encodeURIComponent(String(d)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),p=encodeURIComponent(String(p)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var U="";for(var A in y)y[A]&&(U+="; "+A,y[A]!==!0&&(U+="="+y[A].split(";")[0]));return document.cookie=p+"="+d+U}}function l(p,d){if(!(typeof document>"u")){for(var y={},S=document.cookie?document.cookie.split("; "):[],U=0;U<S.length;U++){var A=S[U].split("="),C=A.slice(1).join("=");!d&&C.charAt(0)==='"'&&(C=C.slice(1,-1));try{var D=e(A[0]);if(C=(s.read||s)(C,D)||e(C),d)try{C=JSON.parse(C)}catch{}if(y[D]=C,p===D)break}catch{}}return p?y[p]:y}}return f.set=u,f.get=function(p){return l(p,!1)},f.getJSON=function(p){return l(p,!0)},f.remove=function(p,d){u(p,"",r(d,{expires:-1}))},f.defaults={},f.withConverter=a,f}return a(function(){})})})(Ie)),Ie.exports}var he=Nn(),ei=(function(){function o(r){if(r===void 0&&(r={}),r.domain&&(this.domain=r.domain),r.path?this.path=r.path:this.path="/",Object.prototype.hasOwnProperty.call(r,"expires")?this.expires=r.expires:this.expires=365,Object.prototype.hasOwnProperty.call(r,"secure")?this.secure=r.secure:this.secure=!0,Object.prototype.hasOwnProperty.call(r,"sameSite")){if(!["strict","lax","none"].includes(r.sameSite))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if(r.sameSite==="none"&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=r.sameSite}else this.sameSite=null}var t=o.prototype;return t.setItem=function(e,a){var s={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(s.sameSite=this.sameSite),he.set(e,a,s),he.get(e)},t.getItem=function(e){return he.get(e)},t.removeItem=function(e){var a={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(a.sameSite=this.sameSite),he.remove(e,a)},t.clear=function(){for(var e=he.get(),a=Object.keys(e).length,s=0;s<a;++s)this.removeItem(Object.keys(e)[s]);return{}},o})();export{$n as AuthenticationDetails,X as AuthenticationHelper,at as CognitoAccessToken,ut as CognitoIdToken,ft as CognitoRefreshToken,pt as CognitoUser,Cn as CognitoUserAttribute,Qn as CognitoUserPool,ht as CognitoUserSession,ei as CookieStorage,ct as DateHelper,Ht as WordArray,Xn as appendToCognitoUserAgent};
@@ -1,5 +1,5 @@
1
- const p=(o=0)=>e=>`\x1B[${e+o}m`,B=(o=0)=>e=>`\x1B[${38+o};5;${e}m`,y=(o=0)=>(e,t,r)=>`\x1B[${38+o};2;${e};${t};${r}m`,l={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(l.modifier);const T=Object.keys(l.color),M=Object.keys(l.bgColor);[...T,...M];function w(){const o=new Map;for(const[e,t]of Object.entries(l)){for(const[r,n]of Object.entries(t))l[r]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},t[r]=l[r],o.set(n[0],n[1]);Object.defineProperty(l,e,{value:t,enumerable:!1})}return Object.defineProperty(l,"codes",{value:o,enumerable:!1}),l.color.close="\x1B[39m",l.bgColor.close="\x1B[49m",l.color.ansi=p(),l.color.ansi256=B(),l.color.ansi16m=y(),l.bgColor.ansi=p(10),l.bgColor.ansi256=B(10),l.bgColor.ansi16m=y(10),Object.defineProperties(l,{rgbToAnsi256:{value(e,t,r){return e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(s=>s+s).join(""));const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:e=>l.rgbToAnsi256(...l.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,r,n;if(e>=232)t=((e-232)*10+8)/255,r=t,n=t;else{e-=16;const v=e%36;t=Math.floor(e/36)/5,r=Math.floor(v/6)/5,n=v%6/5}const s=Math.max(t,r,n)*2;if(s===0)return 30;let a=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>l.ansi256ToAnsi(l.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>l.ansi256ToAnsi(l.hexToAnsi256(e)),enumerable:!1}}),l}const i=w(),O=(()=>{if(navigator.userAgentData){const o=navigator.userAgentData.brands.find(({brand:e})=>e==="Chromium");if(o&&o.version>93)return 3}return/\b(Chrome|Chromium)\//.test(navigator.userAgent)?1:0})(),x=O!==0&&{level:O},P={stdout:x,stderr:x};function k(o,e,t){let r=o.indexOf(e);if(r===-1)return o;const n=e.length;let s=0,a="";do a+=o.slice(s,r)+e+t,s=r+n,r=o.indexOf(e,s);while(r!==-1);return a+=o.slice(s),a}function R(o,e,t,r){let n=0,s="";do{const a=o[r-1]==="\r";s+=o.slice(n,a?r-1:r)+e+(a?`\r
1
+ const p=(o=0)=>e=>`\x1B[${e+o}m`,B=(o=0)=>e=>`\x1B[${38+o};5;${e}m`,y=(o=0)=>(e,t,r)=>`\x1B[${38+o};2;${e};${t};${r}m`,l={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(l.modifier);const C=Object.keys(l.color),M=Object.keys(l.bgColor);[...C,...M];function w(){const o=new Map;for(const[e,t]of Object.entries(l)){for(const[r,n]of Object.entries(t))l[r]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},t[r]=l[r],o.set(n[0],n[1]);Object.defineProperty(l,e,{value:t,enumerable:!1})}return Object.defineProperty(l,"codes",{value:o,enumerable:!1}),l.color.close="\x1B[39m",l.bgColor.close="\x1B[49m",l.color.ansi=p(),l.color.ansi256=B(),l.color.ansi16m=y(),l.bgColor.ansi=p(10),l.bgColor.ansi256=B(10),l.bgColor.ansi16m=y(10),Object.defineProperties(l,{rgbToAnsi256:{value(e,t,r){return e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(s=>s+s).join(""));const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:e=>l.rgbToAnsi256(...l.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,r,n;if(e>=232)t=((e-232)*10+8)/255,r=t,n=t;else{e-=16;const v=e%36;t=Math.floor(e/36)/5,r=Math.floor(v/6)/5,n=v%6/5}const s=Math.max(t,r,n)*2;if(s===0)return 30;let a=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return s===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>l.ansi256ToAnsi(l.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>l.ansi256ToAnsi(l.hexToAnsi256(e)),enumerable:!1}}),l}const i=w(),O=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){const o=navigator.userAgentData.brands.find(({brand:e})=>e==="Chromium");if(o&&o.version>93)return 3}return/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),x=O!==0&&{level:O},P={stdout:x,stderr:x};function k(o,e,t){let r=o.indexOf(e);if(r===-1)return o;const n=e.length;let s=0,a="";do a+=o.slice(s,r)+e+t,s=r+n,r=o.indexOf(e,s);while(r!==-1);return a+=o.slice(s),a}function R(o,e,t,r){let n=0,s="";do{const a=o[r-1]==="\r";s+=o.slice(n,a?r-1:r)+e+(a?`\r
2
2
  `:`
3
3
  `)+t,n=r+1,r=o.indexOf(`
4
- `,n)}while(r!==-1);return s+=o.slice(n),s}const{stdout:A,stderr:j}=P,f=Symbol("GENERATOR"),c=Symbol("STYLER"),g=Symbol("IS_EMPTY"),C=["ansi","ansi","ansi256","ansi16m"],u=Object.create(null),$=(o,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const t=A?A.level:0;o.level=e.level===void 0?t:e.level},S=o=>{const e=(...t)=>t.join(" ");return $(e,o),Object.setPrototypeOf(e,b.prototype),e};function b(o){return S(o)}Object.setPrototypeOf(b.prototype,Function.prototype);for(const[o,e]of Object.entries(i))u[o]={get(){const t=h(this,m(e.open,e.close,this[c]),this[g]);return Object.defineProperty(this,o,{value:t}),t}};u.visible={get(){const o=h(this,this[c],!0);return Object.defineProperty(this,"visible",{value:o}),o}};const d=(o,e,t,...r)=>o==="rgb"?e==="ansi16m"?i[t].ansi16m(...r):e==="ansi256"?i[t].ansi256(i.rgbToAnsi256(...r)):i[t].ansi(i.rgbToAnsi(...r)):o==="hex"?d("rgb",e,t,...i.hexToRgb(...r)):i[t][o](...r),E=["rgb","hex","ansi256"];for(const o of E){u[o]={get(){const{level:t}=this;return function(...r){const n=m(d(o,C[t],"color",...r),i.color.close,this[c]);return h(this,n,this[g])}}};const e="bg"+o[0].toUpperCase()+o.slice(1);u[e]={get(){const{level:t}=this;return function(...r){const n=m(d(o,C[t],"bgColor",...r),i.bgColor.close,this[c]);return h(this,n,this[g])}}}}const G=Object.defineProperties(()=>{},{...u,level:{enumerable:!0,get(){return this[f].level},set(o){this[f].level=o}}}),m=(o,e,t)=>{let r,n;return t===void 0?(r=o,n=e):(r=t.openAll+o,n=e+t.closeAll),{open:o,close:e,openAll:r,closeAll:n,parent:t}},h=(o,e,t)=>{const r=(...n)=>N(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,G),r[f]=o,r[c]=e,r[g]=t,r},N=(o,e)=>{if(o.level<=0||!e)return o[g]?"":e;let t=o[c];if(t===void 0)return e;const{openAll:r,closeAll:n}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=k(e,t.close,t.open),t=t.parent;const s=e.indexOf(`
5
- `);return s!==-1&&(e=R(e,n,r,s)),r+e+n};Object.defineProperties(b.prototype,u);const I=b();b({level:j?j.level:0});export{M as backgroundColorNames,M as backgroundColors,I as default,T as foregroundColorNames,T as foregroundColors,A as supportsColor,j as supportsColorStderr};
4
+ `,n)}while(r!==-1);return s+=o.slice(n),s}const{stdout:A,stderr:T}=P,f=Symbol("GENERATOR"),c=Symbol("STYLER"),u=Symbol("IS_EMPTY"),j=["ansi","ansi","ansi256","ansi16m"],g=Object.create(null),$=(o,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const t=A?A.level:0;o.level=e.level===void 0?t:e.level},S=o=>{const e=(...t)=>t.join(" ");return $(e,o),Object.setPrototypeOf(e,b.prototype),e};function b(o){return S(o)}Object.setPrototypeOf(b.prototype,Function.prototype);for(const[o,e]of Object.entries(i))g[o]={get(){const t=h(this,m(e.open,e.close,this[c]),this[u]);return Object.defineProperty(this,o,{value:t}),t}};g.visible={get(){const o=h(this,this[c],!0);return Object.defineProperty(this,"visible",{value:o}),o}};const d=(o,e,t,...r)=>o==="rgb"?e==="ansi16m"?i[t].ansi16m(...r):e==="ansi256"?i[t].ansi256(i.rgbToAnsi256(...r)):i[t].ansi(i.rgbToAnsi(...r)):o==="hex"?d("rgb",e,t,...i.hexToRgb(...r)):i[t][o](...r),E=["rgb","hex","ansi256"];for(const o of E){g[o]={get(){const{level:t}=this;return function(...r){const n=m(d(o,j[t],"color",...r),i.color.close,this[c]);return h(this,n,this[u])}}};const e="bg"+o[0].toUpperCase()+o.slice(1);g[e]={get(){const{level:t}=this;return function(...r){const n=m(d(o,j[t],"bgColor",...r),i.bgColor.close,this[c]);return h(this,n,this[u])}}}}const G=Object.defineProperties(()=>{},{...g,level:{enumerable:!0,get(){return this[f].level},set(o){this[f].level=o}}}),m=(o,e,t)=>{let r,n;return t===void 0?(r=o,n=e):(r=t.openAll+o,n=e+t.closeAll),{open:o,close:e,openAll:r,closeAll:n,parent:t}},h=(o,e,t)=>{const r=(...n)=>N(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,G),r[f]=o,r[c]=e,r[u]=t,r},N=(o,e)=>{if(o.level<=0||!e)return o[u]?"":e;let t=o[c];if(t===void 0)return e;const{openAll:r,closeAll:n}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=k(e,t.close,t.open),t=t.parent;const s=e.indexOf(`
5
+ `);return s!==-1&&(e=R(e,n,r,s)),r+e+n};Object.defineProperties(b.prototype,g);const I=b();b({level:T?T.level:0});export{M as backgroundColorNames,M as backgroundColors,I as default,C as foregroundColorNames,C as foregroundColors,A as supportsColor,T as supportsColorStderr};